mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
GPU Settings will be saved and auto-applied for each mode
This commit is contained in:
38
app/Fans.Designer.cs
generated
38
app/Fans.Designer.cs
generated
@@ -31,12 +31,12 @@ namespace GHelper
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
ChartArea chartArea4 = new ChartArea();
|
ChartArea chartArea1 = new ChartArea();
|
||||||
Title title4 = new Title();
|
Title title1 = new Title();
|
||||||
ChartArea chartArea5 = new ChartArea();
|
ChartArea chartArea2 = new ChartArea();
|
||||||
Title title5 = new Title();
|
Title title2 = new Title();
|
||||||
ChartArea chartArea6 = new ChartArea();
|
ChartArea chartArea3 = new ChartArea();
|
||||||
Title title6 = new Title();
|
Title title3 = new Title();
|
||||||
panelFans = new Panel();
|
panelFans = new Panel();
|
||||||
labelFansResult = new Label();
|
labelFansResult = new Label();
|
||||||
labelTip = new Label();
|
labelTip = new Label();
|
||||||
@@ -211,8 +211,8 @@ namespace GHelper
|
|||||||
//
|
//
|
||||||
// chartGPU
|
// chartGPU
|
||||||
//
|
//
|
||||||
chartArea4.Name = "ChartArea1";
|
chartArea1.Name = "ChartArea1";
|
||||||
chartGPU.ChartAreas.Add(chartArea4);
|
chartGPU.ChartAreas.Add(chartArea1);
|
||||||
chartGPU.Dock = DockStyle.Fill;
|
chartGPU.Dock = DockStyle.Fill;
|
||||||
chartGPU.Location = new Point(2, 350);
|
chartGPU.Location = new Point(2, 350);
|
||||||
chartGPU.Margin = new Padding(2, 10, 2, 10);
|
chartGPU.Margin = new Padding(2, 10, 2, 10);
|
||||||
@@ -220,13 +220,13 @@ namespace GHelper
|
|||||||
chartGPU.Size = new Size(760, 320);
|
chartGPU.Size = new Size(760, 320);
|
||||||
chartGPU.TabIndex = 17;
|
chartGPU.TabIndex = 17;
|
||||||
chartGPU.Text = "chartGPU";
|
chartGPU.Text = "chartGPU";
|
||||||
title4.Name = "Title1";
|
title1.Name = "Title1";
|
||||||
chartGPU.Titles.Add(title4);
|
chartGPU.Titles.Add(title1);
|
||||||
//
|
//
|
||||||
// chartCPU
|
// chartCPU
|
||||||
//
|
//
|
||||||
chartArea5.Name = "ChartArea1";
|
chartArea2.Name = "ChartArea1";
|
||||||
chartCPU.ChartAreas.Add(chartArea5);
|
chartCPU.ChartAreas.Add(chartArea2);
|
||||||
chartCPU.Dock = DockStyle.Fill;
|
chartCPU.Dock = DockStyle.Fill;
|
||||||
chartCPU.Location = new Point(2, 10);
|
chartCPU.Location = new Point(2, 10);
|
||||||
chartCPU.Margin = new Padding(2, 10, 2, 10);
|
chartCPU.Margin = new Padding(2, 10, 2, 10);
|
||||||
@@ -234,13 +234,13 @@ namespace GHelper
|
|||||||
chartCPU.Size = new Size(760, 320);
|
chartCPU.Size = new Size(760, 320);
|
||||||
chartCPU.TabIndex = 14;
|
chartCPU.TabIndex = 14;
|
||||||
chartCPU.Text = "chartCPU";
|
chartCPU.Text = "chartCPU";
|
||||||
title5.Name = "Title1";
|
title2.Name = "Title1";
|
||||||
chartCPU.Titles.Add(title5);
|
chartCPU.Titles.Add(title2);
|
||||||
//
|
//
|
||||||
// chartMid
|
// chartMid
|
||||||
//
|
//
|
||||||
chartArea6.Name = "ChartArea3";
|
chartArea3.Name = "ChartArea3";
|
||||||
chartMid.ChartAreas.Add(chartArea6);
|
chartMid.ChartAreas.Add(chartArea3);
|
||||||
chartMid.Dock = DockStyle.Fill;
|
chartMid.Dock = DockStyle.Fill;
|
||||||
chartMid.Location = new Point(2, 690);
|
chartMid.Location = new Point(2, 690);
|
||||||
chartMid.Margin = new Padding(2, 10, 2, 10);
|
chartMid.Margin = new Padding(2, 10, 2, 10);
|
||||||
@@ -248,8 +248,8 @@ namespace GHelper
|
|||||||
chartMid.Size = new Size(760, 322);
|
chartMid.Size = new Size(760, 322);
|
||||||
chartMid.TabIndex = 14;
|
chartMid.TabIndex = 14;
|
||||||
chartMid.Text = "chartMid";
|
chartMid.Text = "chartMid";
|
||||||
title6.Name = "Title3";
|
title3.Name = "Title3";
|
||||||
chartMid.Titles.Add(title6);
|
chartMid.Titles.Add(title3);
|
||||||
chartMid.Visible = false;
|
chartMid.Visible = false;
|
||||||
//
|
//
|
||||||
// labelFans
|
// labelFans
|
||||||
@@ -352,7 +352,7 @@ namespace GHelper
|
|||||||
labelInfo.Margin = new Padding(4, 0, 4, 0);
|
labelInfo.Margin = new Padding(4, 0, 4, 0);
|
||||||
labelInfo.Name = "labelInfo";
|
labelInfo.Name = "labelInfo";
|
||||||
labelInfo.Padding = new Padding(5);
|
labelInfo.Padding = new Padding(5);
|
||||||
labelInfo.Size = new Size(523, 92);
|
labelInfo.Size = new Size(523, 149);
|
||||||
labelInfo.TabIndex = 43;
|
labelInfo.TabIndex = 43;
|
||||||
labelInfo.Text = "Experimental Feature";
|
labelInfo.Text = "Experimental Feature";
|
||||||
//
|
//
|
||||||
|
|||||||
59
app/Fans.cs
59
app/Fans.cs
@@ -97,9 +97,8 @@ namespace GHelper
|
|||||||
|
|
||||||
trackGPUCore.MouseUp += TrackGPU_MouseUp;
|
trackGPUCore.MouseUp += TrackGPU_MouseUp;
|
||||||
trackGPUMemory.MouseUp += TrackGPU_MouseUp;
|
trackGPUMemory.MouseUp += TrackGPU_MouseUp;
|
||||||
|
trackGPUBoost.MouseUp += TrackGPU_MouseUp;
|
||||||
trackGPUBoost.MouseUp += TrackGPUBoost_MouseUp;
|
trackGPUTemp.MouseUp += TrackGPU_MouseUp;
|
||||||
trackGPUTemp.MouseUp += TrackGPUBoost_MouseUp;
|
|
||||||
|
|
||||||
//labelInfo.MaximumSize = new Size(280, 0);
|
//labelInfo.MaximumSize = new Size(280, 0);
|
||||||
labelInfo.Text = Properties.Strings.PPTExperimental;
|
labelInfo.Text = Properties.Strings.PPTExperimental;
|
||||||
@@ -108,41 +107,22 @@ namespace GHelper
|
|||||||
InitFans();
|
InitFans();
|
||||||
InitPower();
|
InitPower();
|
||||||
InitBoost();
|
InitBoost();
|
||||||
|
InitGPU();
|
||||||
|
|
||||||
comboBoost.SelectedValueChanged += ComboBoost_Changed;
|
comboBoost.SelectedValueChanged += ComboBoost_Changed;
|
||||||
|
|
||||||
Shown += Fans_Shown;
|
Shown += Fans_Shown;
|
||||||
|
|
||||||
InitGPUControl();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TrackGPUBoost_MouseUp(object? sender, MouseEventArgs e)
|
|
||||||
{
|
|
||||||
Program.config.setConfig("gpu_boost", trackGPUBoost.Value);
|
|
||||||
Program.config.setConfig("gpu_temp", trackGPUTemp.Value);
|
|
||||||
Program.settingsForm.SetGPUPower();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void TrackGPU_MouseUp(object? sender, MouseEventArgs e)
|
private void TrackGPU_MouseUp(object? sender, MouseEventArgs e)
|
||||||
{
|
{
|
||||||
try
|
Program.settingsForm.AutoGPUSettings(true);
|
||||||
{
|
|
||||||
Program.config.setConfig("gpu_core", trackGPUCore.Value);
|
|
||||||
Program.config.setConfig("gpu_memory", trackGPUMemory.Value);
|
|
||||||
|
|
||||||
int status = nvControl.SetClocks(trackGPUCore.Value, trackGPUMemory.Value);
|
|
||||||
if (status == -1) Program.RunAsAdmin("gpu");
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
Logger.WriteLine("F:" + ex.ToString());
|
|
||||||
}
|
|
||||||
|
|
||||||
InitGPUControl();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitGPUControl()
|
public void InitGPU()
|
||||||
{
|
{
|
||||||
if (HardwareControl.GpuControl is not null && HardwareControl.GpuControl.IsNvidia)
|
if (HardwareControl.GpuControl is not null && HardwareControl.GpuControl.IsNvidia)
|
||||||
{
|
{
|
||||||
@@ -164,8 +144,8 @@ namespace GHelper
|
|||||||
trackGPUMemory.Value = Math.Max(Math.Min(memory, NvidiaGpuControl.MaxMemoryOffset), NvidiaGpuControl.MinMemoryOffset);
|
trackGPUMemory.Value = Math.Max(Math.Min(memory, NvidiaGpuControl.MaxMemoryOffset), NvidiaGpuControl.MinMemoryOffset);
|
||||||
labelGPU.Text = gpuTitle;
|
labelGPU.Text = gpuTitle;
|
||||||
|
|
||||||
int gpu_boost = Program.config.getConfig("gpu_boost");
|
int gpu_boost = Program.config.getConfigPerf("gpu_boost");
|
||||||
int gpu_temp = Program.config.getConfig("gpu_temp");
|
int gpu_temp = Program.config.getConfigPerf("gpu_temp");
|
||||||
|
|
||||||
if (gpu_boost < 0) gpu_boost = ASUSWmi.MaxGPUBoost;
|
if (gpu_boost < 0) gpu_boost = ASUSWmi.MaxGPUBoost;
|
||||||
if (gpu_temp < 0) gpu_temp = ASUSWmi.MaxGPUTemp;
|
if (gpu_temp < 0) gpu_temp = ASUSWmi.MaxGPUTemp;
|
||||||
@@ -198,15 +178,21 @@ namespace GHelper
|
|||||||
private void trackGPU_Scroll(object? sender, EventArgs e)
|
private void trackGPU_Scroll(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (sender is null) return;
|
if (sender is null) return;
|
||||||
|
|
||||||
TrackBar track = (TrackBar)sender;
|
TrackBar track = (TrackBar)sender;
|
||||||
track.Value = (int)Math.Round((float)track.Value / 5) * 5;
|
track.Value = (int)Math.Round((float)track.Value / 5) * 5;
|
||||||
|
|
||||||
|
Program.config.setConfigPerf("gpu_core", trackGPUCore.Value);
|
||||||
|
Program.config.setConfigPerf("gpu_memory", trackGPUMemory.Value);
|
||||||
|
|
||||||
VisualiseGPUSettings();
|
VisualiseGPUSettings();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void trackGPUPower_Scroll(object? sender, EventArgs e)
|
private void trackGPUPower_Scroll(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
Program.config.setConfigPerf("gpu_boost", trackGPUBoost.Value);
|
||||||
|
Program.config.setConfigPerf("gpu_temp", trackGPUTemp.Value);
|
||||||
|
|
||||||
VisualiseGPUSettings();
|
VisualiseGPUSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -367,7 +353,7 @@ namespace GHelper
|
|||||||
// Yes, that's stupid, but Total slider on 2021 model actually adjusts CPU PPT
|
// Yes, that's stupid, but Total slider on 2021 model actually adjusts CPU PPT
|
||||||
if (!cpuBmode)
|
if (!cpuBmode)
|
||||||
{
|
{
|
||||||
labelPlatform.Text = "CPU SPPT";
|
labelPlatform.Text = "CPU PPT";
|
||||||
}
|
}
|
||||||
|
|
||||||
int limit_total;
|
int limit_total;
|
||||||
@@ -506,20 +492,17 @@ namespace GHelper
|
|||||||
checkApplyFans.Checked = false;
|
checkApplyFans.Checked = false;
|
||||||
checkApplyPower.Checked = false;
|
checkApplyPower.Checked = false;
|
||||||
|
|
||||||
/*
|
Program.config.setConfigPerf("auto_apply", 0);
|
||||||
|
Program.config.setConfigPerf("auto_apply_power", 0);
|
||||||
|
|
||||||
|
Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, Program.config.getConfig("performance_mode"), "PerfMode");
|
||||||
|
|
||||||
trackGPUCore.Value = 0;
|
trackGPUCore.Value = 0;
|
||||||
trackGPUMemory.Value = 0;
|
trackGPUMemory.Value = 0;
|
||||||
trackGPUBoost.Value = ASUSWmi.MaxGPUBoost;
|
trackGPUBoost.Value = ASUSWmi.MaxGPUBoost;
|
||||||
trackGPUTemp.Value = ASUSWmi.MaxGPUTemp;
|
trackGPUTemp.Value = ASUSWmi.MaxGPUTemp;
|
||||||
|
|
||||||
Program.config.setConfig("gpu_core", ASUSWmi.MaxGPUBoost);
|
Program.settingsForm.AutoGPUSettings(true);
|
||||||
Program.config.setConfig("gpu_memory", ASUSWmi.MaxGPUTemp);
|
|
||||||
*/
|
|
||||||
|
|
||||||
Program.config.setConfigPerf("auto_apply", 0);
|
|
||||||
Program.config.setConfigPerf("auto_apply_power", 0);
|
|
||||||
|
|
||||||
Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, Program.config.getConfig("performance_mode"), "PerfMode");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ChartCPU_MouseUp(object? sender, MouseEventArgs e)
|
private void ChartCPU_MouseUp(object? sender, MouseEventArgs e)
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ namespace GHelper
|
|||||||
|
|
||||||
private static long lastAuto;
|
private static long lastAuto;
|
||||||
private static long lastTheme;
|
private static long lastTheme;
|
||||||
|
private static long lastAdmin;
|
||||||
|
|
||||||
private static PowerLineStatus isPlugged = PowerLineStatus.Unknown;
|
private static PowerLineStatus isPlugged = PowerLineStatus.Unknown;
|
||||||
|
|
||||||
// The main entry point for the application
|
// The main entry point for the application
|
||||||
@@ -62,7 +64,7 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
|
|
||||||
Logger.WriteLine("------------");
|
Logger.WriteLine("------------");
|
||||||
Logger.WriteLine("App launched: " + config.GetModel() + " :" + Assembly.GetExecutingAssembly().GetName().Version.ToString() + (IsUserAdministrator()?"A":"N"));
|
Logger.WriteLine("App launched: " + config.GetModel() + " :" + Assembly.GetExecutingAssembly().GetName().Version.ToString() + (IsUserAdministrator()?"A":""));
|
||||||
|
|
||||||
Application.EnableVisualStyles();
|
Application.EnableVisualStyles();
|
||||||
|
|
||||||
@@ -292,7 +294,7 @@ namespace GHelper
|
|||||||
|
|
||||||
if (action == "gpu")
|
if (action == "gpu")
|
||||||
{
|
{
|
||||||
HardwareControl.GetNvidiaGpuControl()?.SetClocksFromConfig();
|
Startup.ReScheduleAdmin();
|
||||||
settingsForm.FansToggle();
|
settingsForm.FansToggle();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -352,6 +354,10 @@ namespace GHelper
|
|||||||
|
|
||||||
public static void RunAsAdmin(string? param = null)
|
public static void RunAsAdmin(string? param = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if (Math.Abs(DateTimeOffset.Now.ToUnixTimeMilliseconds() - lastAdmin) < 2000) return;
|
||||||
|
lastAdmin = DateTimeOffset.Now.ToUnixTimeMilliseconds();
|
||||||
|
|
||||||
// Check if the current user is an administrator
|
// Check if the current user is an administrator
|
||||||
if (!IsUserAdministrator())
|
if (!IsUserAdministrator())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using CustomControls;
|
using CustomControls;
|
||||||
|
using GHelper.Gpu;
|
||||||
using Starlight.AnimeMatrix;
|
using Starlight.AnimeMatrix;
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
@@ -7,6 +8,7 @@ using System.Reflection;
|
|||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.Timers;
|
using System.Timers;
|
||||||
|
using System.Windows.Forms;
|
||||||
using Tools;
|
using Tools;
|
||||||
|
|
||||||
namespace GHelper
|
namespace GHelper
|
||||||
@@ -140,7 +142,7 @@ namespace GHelper
|
|||||||
int trim = model.LastIndexOf("_");
|
int trim = model.LastIndexOf("_");
|
||||||
if (trim > 0) model = model.Substring(0, trim);
|
if (trim > 0) model = model.Substring(0, trim);
|
||||||
|
|
||||||
labelModel.Text = model;
|
labelModel.Text = model+(Program.IsUserAdministrator()?".":"");
|
||||||
|
|
||||||
TopMost = Program.config.getConfig("topmost") == 1;
|
TopMost = Program.config.getConfig("topmost") == 1;
|
||||||
|
|
||||||
@@ -1043,11 +1045,14 @@ namespace GHelper
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetGPUPower()
|
public void AutoGPUSettings(bool launchAsAdmin = false)
|
||||||
{
|
{
|
||||||
|
|
||||||
int gpu_boost = Program.config.getConfig("gpu_boost");
|
int gpu_boost = Program.config.getConfigPerf("gpu_boost");
|
||||||
int gpu_temp = Program.config.getConfig("gpu_temp");
|
int gpu_temp = Program.config.getConfigPerf("gpu_temp");
|
||||||
|
|
||||||
|
int gpu_core = Program.config.getConfigPerf("gpu_core");
|
||||||
|
int gpu_memory = Program.config.getConfigPerf("gpu_memory");
|
||||||
|
|
||||||
if (gpu_boost < ASUSWmi.MinGPUBoost || gpu_boost > ASUSWmi.MaxGPUBoost ) return;
|
if (gpu_boost < ASUSWmi.MinGPUBoost || gpu_boost > ASUSWmi.MaxGPUBoost ) return;
|
||||||
if (gpu_temp < ASUSWmi.MinGPUTemp || gpu_temp > ASUSWmi.MaxGPUTemp) return;
|
if (gpu_temp < ASUSWmi.MinGPUTemp || gpu_temp > ASUSWmi.MaxGPUTemp) return;
|
||||||
@@ -1062,6 +1067,23 @@ namespace GHelper
|
|||||||
Program.wmi.DeviceSet(ASUSWmi.PPT_GPUC2, gpu_temp, "PowerLimit C2");
|
Program.wmi.DeviceSet(ASUSWmi.PPT_GPUC2, gpu_temp, "PowerLimit C2");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (gpu_core == -1 && gpu_memory == -1) return;
|
||||||
|
|
||||||
|
if (HardwareControl.GpuControl is not null && HardwareControl.GpuControl.IsNvidia)
|
||||||
|
{
|
||||||
|
using NvidiaGpuControl nvControl = (NvidiaGpuControl)HardwareControl.GpuControl;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
int status = nvControl.SetClocks(gpu_core, gpu_memory);
|
||||||
|
if (launchAsAdmin && status == -1) Program.RunAsAdmin("gpu");
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Debug.WriteLine(ex.ToString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void LabelFansResult(string text)
|
protected void LabelFansResult(string text)
|
||||||
@@ -1136,14 +1158,12 @@ namespace GHelper
|
|||||||
timer.Stop();
|
timer.Stop();
|
||||||
timer.Dispose();
|
timer.Dispose();
|
||||||
SetPower();
|
SetPower();
|
||||||
SetGPUPower();
|
|
||||||
};
|
};
|
||||||
timer.Start();
|
timer.Start();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SetPower();
|
SetPower();
|
||||||
SetGPUPower();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1201,8 +1221,10 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
|
|
||||||
AutoFans();
|
AutoFans();
|
||||||
|
AutoGPUSettings();
|
||||||
AutoPower(1000);
|
AutoPower(1000);
|
||||||
|
|
||||||
|
|
||||||
if (Program.config.getConfigPerfString("scheme") is not null)
|
if (Program.config.getConfigPerfString("scheme") is not null)
|
||||||
NativeMethods.SetPowerScheme(Program.config.getConfigPerfString("scheme"));
|
NativeMethods.SetPowerScheme(Program.config.getConfigPerfString("scheme"));
|
||||||
else
|
else
|
||||||
@@ -1223,6 +1245,7 @@ namespace GHelper
|
|||||||
fans.InitFans();
|
fans.InitFans();
|
||||||
fans.InitPower();
|
fans.InitPower();
|
||||||
fans.InitBoost();
|
fans.InitBoost();
|
||||||
|
fans.InitGPU();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1424,10 +1447,10 @@ namespace GHelper
|
|||||||
|
|
||||||
labelGPU.Text = Properties.Strings.GPUMode + ": " + Properties.Strings.GPUChanging + " ...";
|
labelGPU.Text = Properties.Strings.GPUMode + ": " + Properties.Strings.GPUChanging + " ...";
|
||||||
|
|
||||||
Thread t = new Thread(() =>
|
|
||||||
{
|
|
||||||
Thread.CurrentThread.IsBackground = true;
|
|
||||||
|
|
||||||
|
Task.Run(async () =>
|
||||||
|
{
|
||||||
|
|
||||||
if (eco == 1)
|
if (eco == 1)
|
||||||
{
|
{
|
||||||
string[] tokill = { "EADesktop", "RadeonSoftware" };
|
string[] tokill = { "EADesktop", "RadeonSoftware" };
|
||||||
@@ -1437,18 +1460,18 @@ namespace GHelper
|
|||||||
|
|
||||||
Program.wmi.DeviceSet(ASUSWmi.GPUEco, eco, "GPUEco");
|
Program.wmi.DeviceSet(ASUSWmi.GPUEco, eco, "GPUEco");
|
||||||
|
|
||||||
if (eco == 0)
|
await Task.Delay(TimeSpan.FromSeconds(1));
|
||||||
HardwareControl.RecreateGpuControlWithDelay();
|
|
||||||
|
|
||||||
Program.settingsForm.BeginInvoke(delegate
|
Program.settingsForm.BeginInvoke(delegate
|
||||||
{
|
{
|
||||||
Thread.Sleep(500);
|
|
||||||
InitGPUMode();
|
InitGPUMode();
|
||||||
AutoScreen();
|
AutoScreen();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (eco == 0)
|
||||||
|
HardwareControl.RecreateGpuControlWithDelay();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
t.Start();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,15 @@ public class Startup
|
|||||||
return (taskService.RootFolder.AllTasks.Any(t => t.Name == taskName));
|
return (taskService.RootFolder.AllTasks.Any(t => t.Name == taskName));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void ReScheduleAdmin()
|
||||||
|
{
|
||||||
|
if (Program.IsUserAdministrator() && IsScheduled())
|
||||||
|
{
|
||||||
|
UnSchedule();
|
||||||
|
Schedule();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void Schedule()
|
public static void Schedule()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user