Optimisations

This commit is contained in:
Darren Ohonba - Evans
2024-05-19 21:16:18 +01:00
parent 79bc42e24d
commit 4198df7c23
14 changed files with 9908 additions and 323 deletions

View File

@@ -28,6 +28,7 @@
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
this.trackBarFanSpeed = new System.Windows.Forms.TrackBar();
this.label1 = new System.Windows.Forms.Label();
@@ -46,17 +47,40 @@
this.label5 = new System.Windows.Forms.Label();
this.pictureBoxFanCurve = new System.Windows.Forms.PictureBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.radioButton1 = new System.Windows.Forms.RadioButton();
this.fanControl = new System.Windows.Forms.RadioButton();
this.fanCurveControl = new System.Windows.Forms.RadioButton();
this.fanCurve = new System.Windows.Forms.RadioButton();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.button3 = new System.Windows.Forms.Button();
this.button4 = new System.Windows.Forms.Button();
this.autoRefresh = new System.Windows.Forms.CheckBox();
this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components);
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.closeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.label6 = new System.Windows.Forms.Label();
this.numericUpDown1 = new System.Windows.Forms.NumericUpDown();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.label9 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.numericUpDown2 = new System.Windows.Forms.NumericUpDown();
this.label7 = new System.Windows.Forms.Label();
this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker();
this.label3 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox();
((System.ComponentModel.ISupportInitialize)(this.trackBarFanSpeed)).BeginInit();
this.menuStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxFanCurve)).BeginInit();
this.groupBox1.SuspendLayout();
this.contextMenuStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
this.groupBox2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).BeginInit();
this.SuspendLayout();
//
// trackBarFanSpeed
//
this.trackBarFanSpeed.Location = new System.Drawing.Point(17, 54);
this.trackBarFanSpeed.Location = new System.Drawing.Point(17, 94);
this.trackBarFanSpeed.Margin = new System.Windows.Forms.Padding(4);
this.trackBarFanSpeed.Maximum = 100;
this.trackBarFanSpeed.Name = "trackBarFanSpeed";
@@ -65,11 +89,12 @@
this.trackBarFanSpeed.Value = 100;
this.trackBarFanSpeed.KeyUp += new System.Windows.Forms.KeyEventHandler(this.trackBarFanSpeed_KeyUp);
this.trackBarFanSpeed.MouseCaptureChanged += new System.EventHandler(this.trackBarFanSpeed_MouseCaptureChanged);
this.trackBarFanSpeed.MouseUp += new System.Windows.Forms.MouseEventHandler(this.trackBarFanSpeed_MouseUp);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(13, 401);
this.label1.Location = new System.Drawing.Point(13, 509);
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(88, 16);
@@ -79,7 +104,7 @@
// labelValue
//
this.labelValue.AutoSize = true;
this.labelValue.Location = new System.Drawing.Point(118, 401);
this.labelValue.Location = new System.Drawing.Point(118, 509);
this.labelValue.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.labelValue.Name = "labelValue";
this.labelValue.Size = new System.Drawing.Size(11, 16);
@@ -89,7 +114,7 @@
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(50, 437);
this.label2.Location = new System.Drawing.Point(50, 575);
this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(85, 16);
@@ -98,7 +123,7 @@
//
// button1
//
this.button1.Location = new System.Drawing.Point(13, 431);
this.button1.Location = new System.Drawing.Point(13, 569);
this.button1.Margin = new System.Windows.Forms.Padding(4);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(29, 28);
@@ -110,7 +135,7 @@
// labelRPM
//
this.labelRPM.AutoSize = true;
this.labelRPM.Location = new System.Drawing.Point(153, 437);
this.labelRPM.Location = new System.Drawing.Point(153, 575);
this.labelRPM.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.labelRPM.Name = "labelRPM";
this.labelRPM.Size = new System.Drawing.Size(11, 16);
@@ -120,7 +145,7 @@
// labelCPUTemp
//
this.labelCPUTemp.AutoSize = true;
this.labelCPUTemp.Location = new System.Drawing.Point(185, 473);
this.labelCPUTemp.Location = new System.Drawing.Point(185, 611);
this.labelCPUTemp.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.labelCPUTemp.Name = "labelCPUTemp";
this.labelCPUTemp.Size = new System.Drawing.Size(11, 16);
@@ -129,7 +154,7 @@
//
// button2
//
this.button2.Location = new System.Drawing.Point(13, 467);
this.button2.Location = new System.Drawing.Point(13, 605);
this.button2.Margin = new System.Windows.Forms.Padding(4);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(29, 28);
@@ -141,7 +166,7 @@
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(50, 473);
this.label4.Location = new System.Drawing.Point(50, 611);
this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(116, 16);
@@ -156,7 +181,7 @@
this.toolStripMenuItemCheckForUpdates});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(510, 28);
this.menuStrip1.Size = new System.Drawing.Size(595, 28);
this.menuStrip1.TabIndex = 10;
this.menuStrip1.Text = "menuStrip1";
//
@@ -195,17 +220,17 @@
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(341, 28);
this.label5.Location = new System.Drawing.Point(349, 67);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(76, 16);
this.label5.Size = new System.Drawing.Size(61, 16);
this.label5.TabIndex = 13;
this.label5.Text = "PWM value";
this.label5.Text = "XX% Fan";
//
// pictureBoxFanCurve
//
this.pictureBoxFanCurve.Location = new System.Drawing.Point(13, 184);
this.pictureBoxFanCurve.Location = new System.Drawing.Point(13, 200);
this.pictureBoxFanCurve.Name = "pictureBoxFanCurve";
this.pictureBoxFanCurve.Size = new System.Drawing.Size(477, 203);
this.pictureBoxFanCurve.Size = new System.Drawing.Size(565, 258);
this.pictureBoxFanCurve.TabIndex = 0;
this.pictureBoxFanCurve.TabStop = false;
this.pictureBoxFanCurve.Paint += new System.Windows.Forms.PaintEventHandler(this.pictureBoxFanCurve_Paint);
@@ -217,44 +242,241 @@
//
// groupBox1
//
this.groupBox1.Controls.Add(this.radioButton1);
this.groupBox1.Controls.Add(this.fanControl);
this.groupBox1.Controls.Add(this.fanCurveControl);
this.groupBox1.Controls.Add(this.fanCurve);
this.groupBox1.Controls.Add(this.trackBarFanSpeed);
this.groupBox1.Controls.Add(this.label5);
this.groupBox1.Location = new System.Drawing.Point(12, 32);
this.groupBox1.Location = new System.Drawing.Point(12, 12);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(486, 146);
this.groupBox1.Size = new System.Drawing.Size(566, 182);
this.groupBox1.TabIndex = 14;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "groupBox1";
//
// radioButton1
//
this.radioButton1.AutoSize = true;
this.radioButton1.Checked = true;
this.radioButton1.Location = new System.Drawing.Point(20, 31);
this.radioButton1.Name = "radioButton1";
this.radioButton1.Size = new System.Drawing.Size(72, 20);
this.radioButton1.TabIndex = 16;
this.radioButton1.TabStop = true;
this.radioButton1.Text = "Turn off";
this.radioButton1.UseVisualStyleBackColor = true;
this.radioButton1.CheckedChanged += new System.EventHandler(this.radioButton1_CheckedChanged);
//
// fanControl
//
this.fanControl.AutoSize = true;
this.fanControl.Location = new System.Drawing.Point(20, 27);
this.fanControl.Location = new System.Drawing.Point(20, 67);
this.fanControl.Name = "fanControl";
this.fanControl.Size = new System.Drawing.Size(137, 20);
this.fanControl.TabIndex = 15;
this.fanControl.Text = "Turn on fan control";
this.fanControl.UseVisualStyleBackColor = true;
this.fanControl.CheckedChanged += new System.EventHandler(this.radioButton2_CheckedChanged);
this.fanControl.CheckedChanged += new System.EventHandler(this.fanControl_CheckedChanged);
//
// fanCurveControl
// fanCurve
//
this.fanCurveControl.AutoSize = true;
this.fanCurveControl.Location = new System.Drawing.Point(20, 108);
this.fanCurveControl.Name = "fanCurveControl";
this.fanCurveControl.Size = new System.Drawing.Size(130, 20);
this.fanCurveControl.TabIndex = 14;
this.fanCurveControl.Text = "Turn on fan curve";
this.fanCurveControl.UseVisualStyleBackColor = true;
this.fanCurveControl.CheckedChanged += new System.EventHandler(this.fanCurve_CheckedChanged);
this.fanCurve.AutoSize = true;
this.fanCurve.Location = new System.Drawing.Point(20, 148);
this.fanCurve.Name = "fanCurve";
this.fanCurve.Size = new System.Drawing.Size(130, 20);
this.fanCurve.TabIndex = 14;
this.fanCurve.Text = "Turn on fan curve";
this.fanCurve.UseVisualStyleBackColor = true;
this.fanCurve.CheckedChanged += new System.EventHandler(this.fanCurve_CheckedChanged);
//
// button3
//
this.button3.Location = new System.Drawing.Point(553, 464);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(25, 23);
this.button3.TabIndex = 22;
this.button3.Text = "S";
this.toolTip1.SetToolTip(this.button3, "Set");
this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// button4
//
this.button4.Location = new System.Drawing.Point(12, 464);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(35, 23);
this.button4.TabIndex = 23;
this.button4.Text = "R";
this.toolTip1.SetToolTip(this.button4, "Reset");
this.button4.UseVisualStyleBackColor = true;
this.button4.Click += new System.EventHandler(this.button4_Click);
//
// autoRefresh
//
this.autoRefresh.AutoSize = true;
this.autoRefresh.Checked = true;
this.autoRefresh.CheckState = System.Windows.Forms.CheckState.Checked;
this.autoRefresh.Location = new System.Drawing.Point(12, 542);
this.autoRefresh.Name = "autoRefresh";
this.autoRefresh.Size = new System.Drawing.Size(106, 20);
this.autoRefresh.TabIndex = 15;
this.autoRefresh.Text = "Auto Refresh";
this.autoRefresh.UseVisualStyleBackColor = true;
//
// notifyIcon1
//
this.notifyIcon1.ContextMenuStrip = this.contextMenuStrip1;
this.notifyIcon1.Icon = ((System.Drawing.Icon)(resources.GetObject("notifyIcon1.Icon")));
this.notifyIcon1.Text = "notifyIcon1";
this.notifyIcon1.Visible = true;
this.notifyIcon1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.notifyIcon1_MouseClick);
//
// contextMenuStrip1
//
this.contextMenuStrip1.ImageScalingSize = new System.Drawing.Size(20, 20);
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.openToolStripMenuItem,
this.closeToolStripMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(115, 52);
//
// openToolStripMenuItem
//
this.openToolStripMenuItem.Name = "openToolStripMenuItem";
this.openToolStripMenuItem.Size = new System.Drawing.Size(114, 24);
this.openToolStripMenuItem.Text = "Open";
this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click);
//
// closeToolStripMenuItem
//
this.closeToolStripMenuItem.Name = "closeToolStripMenuItem";
this.closeToolStripMenuItem.Size = new System.Drawing.Size(114, 24);
this.closeToolStripMenuItem.Text = "Close";
this.closeToolStripMenuItem.Click += new System.EventHandler(this.closeToolStripMenuItem_Click);
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(6, 29);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(74, 16);
this.label6.TabIndex = 17;
this.label6.Text = "Hysteresis:";
//
// numericUpDown1
//
this.numericUpDown1.Location = new System.Drawing.Point(153, 23);
this.numericUpDown1.Maximum = new decimal(new int[] {
10,
0,
0,
0});
this.numericUpDown1.Name = "numericUpDown1";
this.numericUpDown1.Size = new System.Drawing.Size(41, 22);
this.numericUpDown1.TabIndex = 18;
this.numericUpDown1.Value = new decimal(new int[] {
1,
0,
0,
0});
//
// groupBox2
//
this.groupBox2.Controls.Add(this.label9);
this.groupBox2.Controls.Add(this.label8);
this.groupBox2.Controls.Add(this.numericUpDown2);
this.groupBox2.Controls.Add(this.label7);
this.groupBox2.Controls.Add(this.numericUpDown1);
this.groupBox2.Controls.Add(this.label6);
this.groupBox2.Location = new System.Drawing.Point(364, 512);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(214, 87);
this.groupBox2.TabIndex = 19;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Advanced";
//
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(194, 28);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(14, 16);
this.label9.TabIndex = 24;
this.label9.Text = "s";
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(183, 62);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(25, 16);
this.label8.TabIndex = 23;
this.label8.Text = "ms";
//
// numericUpDown2
//
this.numericUpDown2.Increment = new decimal(new int[] {
500,
0,
0,
0});
this.numericUpDown2.Location = new System.Drawing.Point(120, 56);
this.numericUpDown2.Maximum = new decimal(new int[] {
10000,
0,
0,
0});
this.numericUpDown2.Minimum = new decimal(new int[] {
1000,
0,
0,
0});
this.numericUpDown2.Name = "numericUpDown2";
this.numericUpDown2.Size = new System.Drawing.Size(63, 22);
this.numericUpDown2.TabIndex = 22;
this.numericUpDown2.Value = new decimal(new int[] {
3000,
0,
0,
0});
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(7, 58);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(99, 16);
this.label7.TabIndex = 21;
this.label7.Text = "Update Speed:";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(371, 617);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(44, 16);
this.label3.TabIndex = 20;
this.label3.Text = "label3";
this.label3.Visible = false;
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(53, 464);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(494, 22);
this.textBox1.TabIndex = 21;
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(510, 523);
this.ClientSize = new System.Drawing.Size(595, 650);
this.Controls.Add(this.button4);
this.Controls.Add(this.button3);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.label3);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.autoRefresh);
this.Controls.Add(this.pictureBoxFanCurve);
this.Controls.Add(this.labelCPUTemp);
this.Controls.Add(this.button2);
@@ -270,14 +492,19 @@
this.MainMenuStrip = this.menuStrip1;
this.Margin = new System.Windows.Forms.Padding(4);
this.Name = "Form1";
this.Text = "Asus Fan Control";
this.Load += new System.EventHandler(this.Form1_Load);
this.Text = "AsusFanControlEnhanced";
this.Resize += new System.EventHandler(this.Form1_Resize);
((System.ComponentModel.ISupportInitialize)(this.trackBarFanSpeed)).EndInit();
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxFanCurve)).EndInit();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.contextMenuStrip1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
@@ -302,8 +529,27 @@
private System.Windows.Forms.Label label5;
private System.Windows.Forms.PictureBox pictureBoxFanCurve;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.RadioButton fanCurveControl;
private System.Windows.Forms.RadioButton fanCurve;
private System.Windows.Forms.RadioButton fanControl;
private System.Windows.Forms.ToolTip toolTip1;
private System.Windows.Forms.CheckBox autoRefresh;
private System.Windows.Forms.NotifyIcon notifyIcon1;
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem closeToolStripMenuItem;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.NumericUpDown numericUpDown1;
private System.Windows.Forms.GroupBox groupBox2;
private System.ComponentModel.BackgroundWorker backgroundWorker1;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.RadioButton radioButton1;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.NumericUpDown numericUpDown2;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.Button button4;
}
}