mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Sensor refresh timers
This commit is contained in:
@@ -1,11 +1,10 @@
|
|||||||
|
using HidLibrary;
|
||||||
|
using LibreHardwareMonitor.Hardware;
|
||||||
using Microsoft.Win32.TaskScheduler;
|
using Microsoft.Win32.TaskScheduler;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Management;
|
using System.Management;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using HidLibrary;
|
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using LibreHardwareMonitor.Hardware;
|
|
||||||
using System.Threading;
|
|
||||||
|
|
||||||
public class ASUSWmi
|
public class ASUSWmi
|
||||||
{
|
{
|
||||||
|
|||||||
5
Settings.Designer.cs
generated
5
Settings.Designer.cs
generated
@@ -473,6 +473,7 @@
|
|||||||
"Strobe",
|
"Strobe",
|
||||||
"Rainbow"});
|
"Rainbow"});
|
||||||
this.comboKeyboard.Location = new System.Drawing.Point(38, 778);
|
this.comboKeyboard.Location = new System.Drawing.Point(38, 778);
|
||||||
|
this.comboKeyboard.Margin = new System.Windows.Forms.Padding(0);
|
||||||
this.comboKeyboard.Name = "comboKeyboard";
|
this.comboKeyboard.Name = "comboKeyboard";
|
||||||
this.comboKeyboard.Size = new System.Drawing.Size(200, 40);
|
this.comboKeyboard.Size = new System.Drawing.Size(200, 40);
|
||||||
this.comboKeyboard.TabIndex = 24;
|
this.comboKeyboard.TabIndex = 24;
|
||||||
@@ -482,7 +483,7 @@
|
|||||||
//
|
//
|
||||||
this.buttonKeyboardColor.BackColor = System.Drawing.SystemColors.ButtonHighlight;
|
this.buttonKeyboardColor.BackColor = System.Drawing.SystemColors.ButtonHighlight;
|
||||||
this.buttonKeyboardColor.FlatAppearance.BorderColor = System.Drawing.Color.Red;
|
this.buttonKeyboardColor.FlatAppearance.BorderColor = System.Drawing.Color.Red;
|
||||||
this.buttonKeyboardColor.FlatAppearance.BorderSize = 4;
|
this.buttonKeyboardColor.FlatAppearance.BorderSize = 3;
|
||||||
this.buttonKeyboardColor.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
this.buttonKeyboardColor.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||||
this.buttonKeyboardColor.ForeColor = System.Drawing.SystemColors.ControlText;
|
this.buttonKeyboardColor.ForeColor = System.Drawing.SystemColors.ControlText;
|
||||||
this.buttonKeyboardColor.Location = new System.Drawing.Point(261, 773);
|
this.buttonKeyboardColor.Location = new System.Drawing.Point(261, 773);
|
||||||
@@ -517,7 +518,7 @@
|
|||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(13F, 32F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(13F, 32F);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
this.ClientSize = new System.Drawing.Size(744, 1085);
|
this.ClientSize = new System.Drawing.Size(744, 1093);
|
||||||
this.Controls.Add(this.labelBattery);
|
this.Controls.Add(this.labelBattery);
|
||||||
this.Controls.Add(this.buttonKeyboardColor);
|
this.Controls.Add(this.buttonKeyboardColor);
|
||||||
this.Controls.Add(this.comboKeyboard);
|
this.Controls.Add(this.comboKeyboard);
|
||||||
|
|||||||
@@ -294,9 +294,10 @@ namespace GHelper
|
|||||||
|
|
||||||
private static void SetTimer()
|
private static void SetTimer()
|
||||||
{
|
{
|
||||||
aTimer = new System.Timers.Timer(2000);
|
aTimer = new System.Timers.Timer(500);
|
||||||
aTimer.Elapsed += OnTimedEvent;
|
aTimer.Elapsed += OnTimedEvent;
|
||||||
aTimer.AutoReset = true;
|
aTimer.AutoReset = true;
|
||||||
|
aTimer.Enabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void RefreshSensors()
|
private static void RefreshSensors()
|
||||||
@@ -340,6 +341,7 @@ namespace GHelper
|
|||||||
private static void OnTimedEvent(Object? source, ElapsedEventArgs? e)
|
private static void OnTimedEvent(Object? source, ElapsedEventArgs? e)
|
||||||
{
|
{
|
||||||
RefreshSensors();
|
RefreshSensors();
|
||||||
|
aTimer.Interval = 2000;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SettingsForm_VisibleChanged(object? sender, EventArgs e)
|
private void SettingsForm_VisibleChanged(object? sender, EventArgs e)
|
||||||
@@ -352,7 +354,7 @@ namespace GHelper
|
|||||||
this.Top = Screen.FromControl(this).WorkingArea.Height - 10 - this.Height;
|
this.Top = Screen.FromControl(this).WorkingArea.Height - 10 - this.Height;
|
||||||
this.Activate();
|
this.Activate();
|
||||||
|
|
||||||
//RefreshSensors();
|
aTimer.Interval = 500;
|
||||||
aTimer.Enabled = true;
|
aTimer.Enabled = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user