From 1596ce84e89d186311b9f34484a9dbe2219d2960 Mon Sep 17 00:00:00 2001 From: Serge <5920850+seerge@users.noreply.github.com> Date: Tue, 30 May 2023 18:58:44 +0200 Subject: [PATCH] PPT labels fixes --- app/Fans.Designer.cs | 54 ++++++++++++++++++++++---------------------- app/Fans.cs | 22 ++++++++++++++---- app/Settings.cs | 14 ++++++++++-- 3 files changed, 56 insertions(+), 34 deletions(-) diff --git a/app/Fans.Designer.cs b/app/Fans.Designer.cs index ab92205f..f634075b 100644 --- a/app/Fans.Designer.cs +++ b/app/Fans.Designer.cs @@ -31,14 +31,14 @@ namespace GHelper /// private void InitializeComponent() { - ChartArea chartArea5 = new ChartArea(); - Title title5 = new Title(); - ChartArea chartArea6 = new ChartArea(); - Title title6 = new Title(); - ChartArea chartArea7 = new ChartArea(); - Title title7 = new Title(); - ChartArea chartArea8 = new ChartArea(); - Title title8 = new Title(); + ChartArea chartArea9 = new ChartArea(); + Title title9 = new Title(); + ChartArea chartArea10 = new ChartArea(); + Title title10 = new Title(); + ChartArea chartArea11 = new ChartArea(); + Title title11 = new Title(); + ChartArea chartArea12 = new ChartArea(); + Title title12 = new Title(); panelFans = new Panel(); labelTip = new Label(); tableFanCharts = new TableLayoutPanel(); @@ -181,8 +181,8 @@ namespace GHelper // // chartGPU // - chartArea5.Name = "ChartArea1"; - chartGPU.ChartAreas.Add(chartArea5); + chartArea9.Name = "ChartArea1"; + chartGPU.ChartAreas.Add(chartArea9); chartGPU.Dock = DockStyle.Fill; chartGPU.Location = new Point(12, 289); chartGPU.Margin = new Padding(2, 10, 2, 10); @@ -190,13 +190,13 @@ namespace GHelper chartGPU.Size = new Size(781, 259); chartGPU.TabIndex = 17; chartGPU.Text = "chartGPU"; - title5.Name = "Title1"; - chartGPU.Titles.Add(title5); + title9.Name = "Title1"; + chartGPU.Titles.Add(title9); // // chartCPU // - chartArea6.Name = "ChartArea1"; - chartCPU.ChartAreas.Add(chartArea6); + chartArea10.Name = "ChartArea1"; + chartCPU.ChartAreas.Add(chartArea10); chartCPU.Dock = DockStyle.Fill; chartCPU.Location = new Point(12, 10); chartCPU.Margin = new Padding(2, 10, 2, 10); @@ -204,13 +204,13 @@ namespace GHelper chartCPU.Size = new Size(781, 259); chartCPU.TabIndex = 14; chartCPU.Text = "chartCPU"; - title6.Name = "Title1"; - chartCPU.Titles.Add(title6); + title10.Name = "Title1"; + chartCPU.Titles.Add(title10); // // chartXGM // - chartArea7.Name = "ChartAreaXGM"; - chartXGM.ChartAreas.Add(chartArea7); + chartArea11.Name = "ChartAreaXGM"; + chartXGM.ChartAreas.Add(chartArea11); chartXGM.Dock = DockStyle.Fill; chartXGM.Location = new Point(12, 847); chartXGM.Margin = new Padding(2, 10, 2, 10); @@ -218,14 +218,14 @@ namespace GHelper chartXGM.Size = new Size(781, 261); chartXGM.TabIndex = 14; chartXGM.Text = "chartXGM"; - title7.Name = "Title4"; - chartXGM.Titles.Add(title7); + title11.Name = "Title4"; + chartXGM.Titles.Add(title11); chartXGM.Visible = false; // // chartMid // - chartArea8.Name = "ChartArea3"; - chartMid.ChartAreas.Add(chartArea8); + chartArea12.Name = "ChartArea3"; + chartMid.ChartAreas.Add(chartArea12); chartMid.Dock = DockStyle.Fill; chartMid.Location = new Point(12, 568); chartMid.Margin = new Padding(2, 10, 2, 10); @@ -233,8 +233,8 @@ namespace GHelper chartMid.Size = new Size(781, 259); chartMid.TabIndex = 14; chartMid.Text = "chartMid"; - title8.Name = "Title3"; - chartMid.Titles.Add(title8); + title12.Name = "Title3"; + chartMid.Titles.Add(title12); chartMid.Visible = false; // // panelTitleFans @@ -366,8 +366,8 @@ namespace GHelper panelPower.AutoSizeMode = AutoSizeMode.GrowAndShrink; panelPower.Controls.Add(panelApplyPower); panelPower.Controls.Add(labelInfo); - panelPower.Controls.Add(panelAPU); panelPower.Controls.Add(panelCPU); + panelPower.Controls.Add(panelAPU); panelPower.Controls.Add(panelTotal); panelPower.Controls.Add(panelTitleCPU); panelPower.Dock = DockStyle.Fill; @@ -419,7 +419,7 @@ namespace GHelper panelAPU.Controls.Add(labelLeftAPU); panelAPU.Controls.Add(trackAPU); panelAPU.Dock = DockStyle.Top; - panelAPU.Location = new Point(0, 342); + panelAPU.Location = new Point(0, 206); panelAPU.Margin = new Padding(4); panelAPU.Name = "panelAPU"; panelAPU.Size = new Size(523, 140); @@ -469,7 +469,7 @@ namespace GHelper panelCPU.Controls.Add(labelLeftCPU); panelCPU.Controls.Add(trackCPU); panelCPU.Dock = DockStyle.Top; - panelCPU.Location = new Point(0, 206); + panelCPU.Location = new Point(0, 346); panelCPU.Margin = new Padding(4); panelCPU.Name = "panelCPU"; panelCPU.Size = new Size(523, 136); diff --git a/app/Fans.cs b/app/Fans.cs index 7f602ab1..ce4ea410 100644 --- a/app/Fans.cs +++ b/app/Fans.cs @@ -411,18 +411,30 @@ namespace GHelper public void InitPower(bool changed = false) { - bool cpuAmode = (Program.acpi.DeviceGet(AsusACPI.PPT_TotalA0) >= 0); // 2021 model + - bool cpuBmode = (Program.acpi.DeviceGet(AsusACPI.PPT_CPUB0) >= 0); // 2022 model + + bool cpuAmode = (Program.acpi.DeviceGet(AsusACPI.PPT_TotalA0) >= 0); + bool cpuBmode = (Program.acpi.DeviceGet(AsusACPI.PPT_CPUB1) >= 0); bool apuMode = (Program.acpi.DeviceGet(AsusACPI.PPT_APUC1) >= 0); + + bool gpuMode = (Program.acpi.DeviceGet(AsusACPI.PPT_GPUC0) >= 0); + + bool allAMD = cpuBmode && !gpuMode; powerVisible = panelPower.Visible = cpuAmode; - panelCPU.Visible = cpuBmode; + panelCPU.Visible = allAMD; panelAPU.Visible = apuMode; + // Yes, that's stupid, but Total slider on 2021 model actually adjusts CPU PPT - if (!cpuBmode) + if (allAMD) { - labelLeftPlatform.Text = "CPU"; + labelLeftPlatform.Text = "Platform Slow (CPU + GPU)"; + labelLeftAPU.Text = "Platform Fast (CPU + GPU)"; + labelLeftCPU.Text = "CPU"; + } + else + { + labelLeftPlatform.Text = "CPU Slow"; + labelLeftAPU.Text = "CPU Fast"; } int limit_total; diff --git a/app/Settings.cs b/app/Settings.cs index 55967c5d..6d696172 100644 --- a/app/Settings.cs +++ b/app/Settings.cs @@ -53,7 +53,7 @@ namespace GHelper buttonScreenAuto.Text = Properties.Strings.AutoMode; - buttonMiniled.Text = Properties.Strings.ToggleMiniled; + buttonMiniled.Text = Properties.Strings.Multizone; buttonKeyboardColor.Text = Properties.Strings.Color; buttonKeyboard.Text = Properties.Strings.Extra; @@ -1538,7 +1538,17 @@ namespace GHelper string[] tokill = { "EADesktop", "RadeonSoftware", "epicgameslauncher", "nvdisplay.container", "nvcontainer", "nvcplui" }; foreach (string kill in tokill) - foreach (var process in Process.GetProcessesByName(kill)) process.Kill(); + foreach (var process in Process.GetProcessesByName(kill)) + { + try + { + process.Kill(); + Logger.WriteLine($"Stopped: {process.ProcessName}"); + } catch (Exception ex) + { + Logger.WriteLine($"Failed to stop: {process.ProcessName} {ex.Message}"); + } + } if (AppConfig.isConfig("kill_gpu_apps") && HardwareControl.GpuControl is not null && HardwareControl.GpuControl.IsNvidia) {