From e662fb8e5c7bb1b01defc8dc32c1569511711933 Mon Sep 17 00:00:00 2001 From: James Craddock-Jones Date: Mon, 19 Dec 2022 14:17:41 +0000 Subject: [PATCH] Bug Fixes --- Pages/ClockControl.xaml | 2 +- Pages/ClockControl.xaml.cs | 105 ++++++++++++++++++++----------------- Pages/HomeMenu.xaml | 2 +- Scripts/GlobalVariables.cs | 2 +- 4 files changed, 61 insertions(+), 50 deletions(-) diff --git a/Pages/ClockControl.xaml b/Pages/ClockControl.xaml index b46a63d..0126bea 100644 --- a/Pages/ClockControl.xaml +++ b/Pages/ClockControl.xaml @@ -129,7 +129,7 @@ - + Default diff --git a/Pages/ClockControl.xaml.cs b/Pages/ClockControl.xaml.cs index 8c6004f..d1dfbf0 100644 --- a/Pages/ClockControl.xaml.cs +++ b/Pages/ClockControl.xaml.cs @@ -21,6 +21,7 @@ using System.IO; using System.Diagnostics; using LibreHardwareMonitor.Hardware; +using System.Security.Cryptography; namespace AATUV3.Pages { @@ -57,10 +58,10 @@ public ClockControl() else if (Settings.Default.RadOption == 3) rbOCVRAM.IsChecked = true; else if (Settings.Default.RadOption == 4) rbMan.IsChecked = true; - GetPowerInfo(); - getGPURange(); - getVRAMInfo(); - getGPUClocks(); + //GetPowerInfo(); + //getGPURange(); + //getVRAMInfo(); + //getGPUClocks(); } private void Disable_Click(object sender, RoutedEventArgs e) @@ -95,10 +96,20 @@ private async void Apply_Click(object sender, RoutedEventArgs e) if (cbCoreVolt.IsChecked == true) { - double vid = Math.Round((double)nudCoreVolt.Value / 1000, 2); - SendCommand.set_oc_volt(Convert.ToUInt32((1.55 - vid) / 0.00625)); - SendCommand.set_oc_volt(Convert.ToUInt32((1.55 - vid) / 0.00625)); - SendCommand.set_enable_oc(); + if(Families.FAMID == 10) + { + double vid = ((double)nudCoreVolt.Value - 1125) / 5 + 1200; + SendCommand.set_oc_volt(Convert.ToUInt32(vid)); + SendCommand.set_oc_volt(Convert.ToUInt32(vid)); + SendCommand.set_enable_oc(); + } + else + { + double vid = Math.Round((double)nudCoreVolt.Value / 1000, 2); + SendCommand.set_oc_volt(Convert.ToUInt32((1.55 - vid) / 0.00625)); + SendCommand.set_oc_volt(Convert.ToUInt32((1.55 - vid) / 0.00625)); + SendCommand.set_enable_oc(); + } i++; } @@ -152,45 +163,45 @@ private async void Apply_Click(object sender, RoutedEventArgs e) i++; } - if (cbRaddGPUCore.IsChecked == true) - { - // Get path - string path = "\\bin\\vramoc.exe"; - string path2 = "\\bin\\coreoc.exe"; - string path3 = "\\bin\\auto.exe"; - string path4 = "\\bin\\power.exe"; - - // Pass settings on to be applied - if (rbFactory.IsChecked == true) BasicExeBackend.ApplySettings(path3, "0", true); - else if (rbUVGPU.IsChecked == true) BasicExeBackend.ApplySettings(path3, "1 0", true); - else if (rbOCGPU.IsChecked == true) BasicExeBackend.ApplySettings(path3, "1 1", true); - else if (rbOCVRAM.IsChecked == true) BasicExeBackend.ApplySettings(path3, "1 2", true); - else - { - power = (int)nudPower.Value; - minClock = (int)nudMinClockCore.Value; - maxClock = (int)nudMaxClockCore.Value; - Volt = (int)nudVoltage.Value; - VRAMClock = (int)nudVRAMClockMem.Value; - VRAMMode = 1; - - await Task.Run(() => - { - BasicExeBackend.ApplySettings(path3, "0", true); - Thread.Sleep(250); - BasicExeBackend.ApplySettings(path2, "3 " + minClock + " " + maxClock + " " + Volt, true); - Thread.Sleep(100); - BasicExeBackend.ApplySettings(path4, "1 " + power, true); - Thread.Sleep(100); - BasicExeBackend.ApplySettings(path, "4 " + VRAMClock, true); - Thread.Sleep(250); - BasicExeBackend.ApplySettings(path, "3 " + VRAMMode, true); - Thread.Sleep(100); - }); - - } - i++; - } + //if (cbRaddGPUCore.IsChecked == true) + //{ + // // Get path + // string path = "\\bin\\vramoc.exe"; + // string path2 = "\\bin\\coreoc.exe"; + // string path3 = "\\bin\\auto.exe"; + // string path4 = "\\bin\\power.exe"; + + // // Pass settings on to be applied + // if (rbFactory.IsChecked == true) BasicExeBackend.ApplySettings(path3, "0", true); + // else if (rbUVGPU.IsChecked == true) BasicExeBackend.ApplySettings(path3, "1 0", true); + // else if (rbOCGPU.IsChecked == true) BasicExeBackend.ApplySettings(path3, "1 1", true); + // else if (rbOCVRAM.IsChecked == true) BasicExeBackend.ApplySettings(path3, "1 2", true); + // else + // { + // power = (int)nudPower.Value; + // minClock = (int)nudMinClockCore.Value; + // maxClock = (int)nudMaxClockCore.Value; + // Volt = (int)nudVoltage.Value; + // VRAMClock = (int)nudVRAMClockMem.Value; + // VRAMMode = 1; + + // await Task.Run(() => + // { + // BasicExeBackend.ApplySettings(path3, "0", true); + // Thread.Sleep(250); + // BasicExeBackend.ApplySettings(path2, "3 " + minClock + " " + maxClock + " " + Volt, true); + // Thread.Sleep(100); + // BasicExeBackend.ApplySettings(path4, "1 " + power, true); + // Thread.Sleep(100); + // BasicExeBackend.ApplySettings(path, "4 " + VRAMClock, true); + // Thread.Sleep(250); + // BasicExeBackend.ApplySettings(path, "3 " + VRAMMode, true); + // Thread.Sleep(100); + // }); + + // } + // i++; + //} if (i == 0) { diff --git a/Pages/HomeMenu.xaml b/Pages/HomeMenu.xaml index 16507d6..7392c49 100644 --- a/Pages/HomeMenu.xaml +++ b/Pages/HomeMenu.xaml @@ -76,7 +76,7 @@ - + diff --git a/Scripts/GlobalVariables.cs b/Scripts/GlobalVariables.cs index 44d078d..d35e669 100644 --- a/Scripts/GlobalVariables.cs +++ b/Scripts/GlobalVariables.cs @@ -12,7 +12,7 @@ internal class GlobalVariables public static System.Diagnostics.Process magpieProcess = new System.Diagnostics.Process(); public static System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo(); - public static bool AdaptivePerf = true; + public static bool AdaptivePerf = false; public static void UpdateMagpie() {