@@ -121,17 +121,24 @@ public SettingsForm()
121
121
aTimer = new System . Timers . Timer ( 500 ) ;
122
122
aTimer . Elapsed += OnTimedEvent ;
123
123
124
+ // Subscribing for monitor power on events
125
+ var settingGuid = new NativeMethods . PowerSettingGuid ( ) ;
126
+ Program . unRegPowerNotify = NativeMethods . RegisterPowerSettingNotification ( Handle , settingGuid . ConsoleDisplayState , NativeMethods . DEVICE_NOTIFY_WINDOW_HANDLE ) ;
127
+
124
128
SetVersionLabel ( "Version: " + Assembly . GetExecutingAssembly ( ) . GetName ( ) . Version ) ;
125
- Thread t = new Thread ( ( ) =>
129
+
130
+ string model = Program . config . GetModel ( ) ;
131
+ int trim = model . LastIndexOf ( "_" ) ;
132
+ if ( trim > 0 ) model = model . Substring ( 0 , trim ) ;
133
+
134
+ labelModel . Text = model ;
135
+
136
+ Task . Run ( async ( ) =>
126
137
{
138
+ await Task . Delay ( TimeSpan . FromSeconds ( 5 ) ) ;
127
139
CheckForUpdatesAsync ( ) ;
128
140
} ) ;
129
- t . Start ( ) ;
130
- t . Join ( ) ;
131
141
132
- // Subscribing for monitor power on events
133
- var settingGuid = new NativeMethods . PowerSettingGuid ( ) ;
134
- Program . unRegPowerNotify = NativeMethods . RegisterPowerSettingNotification ( Handle , settingGuid . ConsoleDisplayState , NativeMethods . DEVICE_NOTIFY_WINDOW_HANDLE ) ;
135
142
136
143
}
137
144
@@ -156,8 +163,6 @@ public async void CheckForUpdatesAsync()
156
163
var tag = config . GetProperty ( "tag_name" ) . ToString ( ) . Replace ( "v" , "" ) ;
157
164
var url = config . GetProperty ( "assets" ) [ 0 ] . GetProperty ( "browser_download_url" ) . ToString ( ) ;
158
165
159
- Thread . Sleep ( 5000 ) ;
160
-
161
166
var gitVersion = new Version ( tag ) ;
162
167
var appVersion = new Version ( Assembly . GetExecutingAssembly ( ) . GetName ( ) . Version . ToString ( ) ) ;
163
168
@@ -506,7 +511,7 @@ public void SetMatrix(PowerLineStatus Plugged = PowerLineStatus.Online)
506
511
private void LabelCPUFan_Click ( object ? sender , EventArgs e )
507
512
{
508
513
Program . config . setConfig ( "fan_rpm" , ( Program . config . getConfig ( "fan_rpm" ) == 1 ) ? 0 : 1 ) ;
509
- RefreshSensors ( ) ;
514
+ RefreshSensors ( true ) ;
510
515
}
511
516
512
517
private void PictureColor2_Click ( object ? sender , EventArgs e )
@@ -808,10 +813,10 @@ private static string FormatFan(int fan)
808
813
return " Fan: " + Math . Min ( Math . Round ( fan / 0.6 ) , 100 ) . ToString ( ) + "%" ; // relatively to 6000 rpm
809
814
}
810
815
811
- private static void RefreshSensors ( )
816
+ private static void RefreshSensors ( bool force = false )
812
817
{
813
818
814
- if ( Math . Abs ( DateTimeOffset . Now . ToUnixTimeMilliseconds ( ) - lastRefresh ) < 2000 ) return ;
819
+ if ( ! force && Math . Abs ( DateTimeOffset . Now . ToUnixTimeMilliseconds ( ) - lastRefresh ) < 2000 ) return ;
815
820
lastRefresh = DateTimeOffset . Now . ToUnixTimeMilliseconds ( ) ;
816
821
817
822
string cpuFan = FormatFan ( Program . wmi . DeviceGet ( ASUSWmi . CPU_Fan ) ) ;
@@ -902,6 +907,12 @@ public void AutoFansAndPower()
902
907
903
908
if ( Program . config . getConfig ( "mid_fan" ) == 1 )
904
909
Program . wmi . SetFanCurve ( 2 , Program . config . getFanConfig ( 2 ) ) ;
910
+
911
+ labelPerf . Text = "Performance Mode+" ;
912
+
913
+ } else
914
+ {
915
+ labelPerf . Text = "Performance Mode" ;
905
916
}
906
917
907
918
if ( Program . config . getConfigPerf ( "auto_apply_power" ) == 1 )
0 commit comments