set interval

This commit is contained in:
Jelle Luteijn 2025-04-21 10:54:09 +02:00
parent 19db2a4fcd
commit 18f7d430e0
2 changed files with 201 additions and 200 deletions

View file

@ -43,7 +43,7 @@
this.cbCom = new System.Windows.Forms.ComboBox(); this.cbCom = new System.Windows.Forms.ComboBox();
this.btnClock = new System.Windows.Forms.Button(); this.btnClock = new System.Windows.Forms.Button();
this.label6 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox(); this.txtInterval = new System.Windows.Forms.TextBox();
this.tmrVlc = new System.Windows.Forms.Timer(this.components); this.tmrVlc = new System.Windows.Forms.Timer(this.components);
this.tmrClock = new System.Windows.Forms.Timer(this.components); this.tmrClock = new System.Windows.Forms.Timer(this.components);
this.SuspendLayout(); this.SuspendLayout();
@ -184,13 +184,13 @@
this.label6.TabIndex = 13; this.label6.TabIndex = 13;
this.label6.Text = "Interval (sec)"; this.label6.Text = "Interval (sec)";
// //
// textBox1 // txtInterval
// //
this.textBox1.Location = new System.Drawing.Point(96, 196); this.txtInterval.Location = new System.Drawing.Point(96, 196);
this.textBox1.Name = "textBox1"; this.txtInterval.Name = "txtInterval";
this.textBox1.Size = new System.Drawing.Size(100, 20); this.txtInterval.Size = new System.Drawing.Size(100, 20);
this.textBox1.TabIndex = 14; this.txtInterval.TabIndex = 14;
this.textBox1.Text = "30"; this.txtInterval.Text = "1";
// //
// tmrVlc // tmrVlc
// //
@ -207,7 +207,7 @@
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.SystemColors.ActiveCaptionText; this.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
this.ClientSize = new System.Drawing.Size(634, 286); this.ClientSize = new System.Drawing.Size(634, 286);
this.Controls.Add(this.textBox1); this.Controls.Add(this.txtInterval);
this.Controls.Add(this.label6); this.Controls.Add(this.label6);
this.Controls.Add(this.btnClock); this.Controls.Add(this.btnClock);
this.Controls.Add(this.cbCom); this.Controls.Add(this.cbCom);
@ -245,7 +245,7 @@
private System.Windows.Forms.ComboBox cbCom; private System.Windows.Forms.ComboBox cbCom;
private System.Windows.Forms.Button btnClock; private System.Windows.Forms.Button btnClock;
private System.Windows.Forms.Label label6; private System.Windows.Forms.Label label6;
private System.Windows.Forms.TextBox textBox1; private System.Windows.Forms.TextBox txtInterval;
private System.Windows.Forms.Timer tmrVlc; private System.Windows.Forms.Timer tmrVlc;
private System.Windows.Forms.Timer tmrClock; private System.Windows.Forms.Timer tmrClock;
} }

View file

@ -163,6 +163,7 @@ namespace AnimeCon.Vlc.Scraper
try try
{ {
DoSendDataSerial(); DoSendDataSerial();
tmrClock.Interval = Convert.ToInt32(txtInterval.Text)*1000;
tmrClock.Start(); tmrClock.Start();
btnClock.Text = "Stop"; btnClock.Text = "Stop";
lblStatus.Text = "On"; lblStatus.Text = "On";