Aggiunto progetto gestione TaskScheduler

This commit is contained in:
Samuele E. Locatelli
2020-03-12 11:27:15 +01:00
parent 334127ab89
commit 149d607ad3
10 changed files with 510 additions and 90 deletions
+240 -74
View File
@@ -28,6 +28,7 @@
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.lblOutMessage = new System.Windows.Forms.Label();
this.chkRecursive = new System.Windows.Forms.CheckBox();
@@ -48,16 +49,30 @@
this.tabPage1 = new System.Windows.Forms.TabPage();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.tabPage4 = new System.Windows.Forms.TabPage();
this.btnResetCdv = new System.Windows.Forms.Button();
this.lblRedCDV = new System.Windows.Forms.Label();
this.btnShowCdv = new System.Windows.Forms.Button();
this.btnResetCdv = new System.Windows.Forms.Button();
this.tabPage4 = new System.Windows.Forms.TabPage();
this.tabPage5 = new System.Windows.Forms.TabPage();
this.btnStartSched = new System.Windows.Forms.Button();
this.txtOre = new System.Windows.Forms.TextBox();
this.lblOre = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.txtMin = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.txtSec = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.lblStartTimer = new System.Windows.Forms.Label();
this.lblNextSched = new System.Windows.Forms.Label();
this.lblClock = new System.Windows.Forms.Label();
this.clockTimer = new System.Windows.Forms.Timer(this.components);
this.groupBox1.SuspendLayout();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.tabPage3.SuspendLayout();
this.tabPage4.SuspendLayout();
this.tabPage5.SuspendLayout();
this.SuspendLayout();
//
// groupBox1
@@ -72,11 +87,11 @@
this.groupBox1.Controls.Add(this.txtDestDir);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Controls.Add(this.txtSourceDir);
this.groupBox1.Location = new System.Drawing.Point(5, 5);
this.groupBox1.Margin = new System.Windows.Forms.Padding(2);
this.groupBox1.Location = new System.Drawing.Point(7, 6);
this.groupBox1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Padding = new System.Windows.Forms.Padding(2);
this.groupBox1.Size = new System.Drawing.Size(740, 79);
this.groupBox1.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.groupBox1.Size = new System.Drawing.Size(987, 103);
this.groupBox1.TabIndex = 1;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "File IO test";
@@ -84,30 +99,29 @@
// lblOutMessage
//
this.lblOutMessage.AutoSize = true;
this.lblOutMessage.Location = new System.Drawing.Point(13, 50);
this.lblOutMessage.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblOutMessage.Location = new System.Drawing.Point(17, 62);
this.lblOutMessage.Name = "lblOutMessage";
this.lblOutMessage.Size = new System.Drawing.Size(16, 13);
this.lblOutMessage.Size = new System.Drawing.Size(20, 17);
this.lblOutMessage.TabIndex = 7;
this.lblOutMessage.Text = "...";
//
// chkRecursive
//
this.chkRecursive.AutoSize = true;
this.chkRecursive.Location = new System.Drawing.Point(400, 17);
this.chkRecursive.Margin = new System.Windows.Forms.Padding(2);
this.chkRecursive.Location = new System.Drawing.Point(533, 21);
this.chkRecursive.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.chkRecursive.Name = "chkRecursive";
this.chkRecursive.Size = new System.Drawing.Size(69, 17);
this.chkRecursive.Size = new System.Drawing.Size(88, 21);
this.chkRecursive.TabIndex = 6;
this.chkRecursive.Text = "recursive";
this.chkRecursive.UseVisualStyleBackColor = true;
//
// btnCopyAll
//
this.btnCopyAll.Location = new System.Drawing.Point(521, 15);
this.btnCopyAll.Margin = new System.Windows.Forms.Padding(2);
this.btnCopyAll.Location = new System.Drawing.Point(695, 18);
this.btnCopyAll.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnCopyAll.Name = "btnCopyAll";
this.btnCopyAll.Size = new System.Drawing.Size(56, 19);
this.btnCopyAll.Size = new System.Drawing.Size(75, 23);
this.btnCopyAll.TabIndex = 5;
this.btnCopyAll.Text = "Copy All";
this.btnCopyAll.UseVisualStyleBackColor = true;
@@ -116,54 +130,54 @@
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(226, 20);
this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label2.Location = new System.Drawing.Point(301, 25);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(51, 13);
this.label2.Size = new System.Drawing.Size(64, 17);
this.label2.TabIndex = 4;
this.label2.Text = "Dest DIR";
//
// txtDestDir
//
this.txtDestDir.Location = new System.Drawing.Point(278, 17);
this.txtDestDir.Margin = new System.Windows.Forms.Padding(2);
this.txtDestDir.Location = new System.Drawing.Point(371, 21);
this.txtDestDir.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.txtDestDir.Name = "txtDestDir";
this.txtDestDir.Size = new System.Drawing.Size(118, 20);
this.txtDestDir.Size = new System.Drawing.Size(156, 22);
this.txtDestDir.TabIndex = 3;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(13, 20);
this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label1.Location = new System.Drawing.Point(17, 25);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(63, 13);
this.label1.Size = new System.Drawing.Size(80, 17);
this.label1.TabIndex = 2;
this.label1.Text = "Source DIR";
//
// txtSourceDir
//
this.txtSourceDir.Location = new System.Drawing.Point(77, 17);
this.txtSourceDir.Margin = new System.Windows.Forms.Padding(2);
this.txtSourceDir.Location = new System.Drawing.Point(103, 21);
this.txtSourceDir.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.txtSourceDir.Name = "txtSourceDir";
this.txtSourceDir.Size = new System.Drawing.Size(118, 20);
this.txtSourceDir.Size = new System.Drawing.Size(156, 22);
this.txtSourceDir.TabIndex = 1;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(9, 16);
this.label3.Location = new System.Drawing.Point(12, 20);
this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(64, 13);
this.label3.Size = new System.Drawing.Size(79, 17);
this.label3.TabIndex = 2;
this.label3.Text = "HwSw Data";
//
// lblHwSwData
//
this.lblHwSwData.AutoSize = true;
this.lblHwSwData.Location = new System.Drawing.Point(97, 16);
this.lblHwSwData.Location = new System.Drawing.Point(129, 20);
this.lblHwSwData.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblHwSwData.Name = "lblHwSwData";
this.lblHwSwData.Size = new System.Drawing.Size(16, 13);
this.lblHwSwData.Size = new System.Drawing.Size(20, 17);
this.lblHwSwData.TabIndex = 3;
this.lblHwSwData.Text = "...";
//
@@ -172,9 +186,10 @@
this.lblRedis.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lblRedis.AutoEllipsis = true;
this.lblRedis.Location = new System.Drawing.Point(8, 39);
this.lblRedis.Location = new System.Drawing.Point(11, 48);
this.lblRedis.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblRedis.Name = "lblRedis";
this.lblRedis.Size = new System.Drawing.Size(372, 293);
this.lblRedis.Size = new System.Drawing.Size(496, 361);
this.lblRedis.TabIndex = 5;
this.lblRedis.Text = "---";
//
@@ -187,17 +202,19 @@
//
// txtMergedName
//
this.txtMergedName.Location = new System.Drawing.Point(92, 14);
this.txtMergedName.Location = new System.Drawing.Point(123, 17);
this.txtMergedName.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.txtMergedName.Name = "txtMergedName";
this.txtMergedName.Size = new System.Drawing.Size(153, 20);
this.txtMergedName.Size = new System.Drawing.Size(203, 22);
this.txtMergedName.TabIndex = 6;
this.txtMergedName.Text = "MergedPdfFile.pdf";
//
// button1
//
this.button1.Location = new System.Drawing.Point(5, 11);
this.button1.Location = new System.Drawing.Point(7, 14);
this.button1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.Size = new System.Drawing.Size(100, 28);
this.button1.TabIndex = 7;
this.button1.Text = "Select PDF";
this.button1.UseVisualStyleBackColor = true;
@@ -206,17 +223,19 @@
// lblNumMerged
//
this.lblNumMerged.AutoSize = true;
this.lblNumMerged.Location = new System.Drawing.Point(300, 20);
this.lblNumMerged.Location = new System.Drawing.Point(400, 25);
this.lblNumMerged.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblNumMerged.Name = "lblNumMerged";
this.lblNumMerged.Size = new System.Drawing.Size(10, 13);
this.lblNumMerged.Size = new System.Drawing.Size(13, 17);
this.lblNumMerged.TabIndex = 8;
this.lblNumMerged.Text = "-";
//
// button2
//
this.button2.Location = new System.Drawing.Point(5, 13);
this.button2.Location = new System.Drawing.Point(7, 16);
this.button2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(75, 23);
this.button2.Size = new System.Drawing.Size(100, 28);
this.button2.TabIndex = 9;
this.button2.Text = "RedisInfo";
this.button2.UseVisualStyleBackColor = true;
@@ -228,20 +247,23 @@
this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Controls.Add(this.tabPage3);
this.tabControl1.Controls.Add(this.tabPage4);
this.tabControl1.Controls.Add(this.tabPage5);
this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabControl1.Location = new System.Drawing.Point(0, 0);
this.tabControl1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(776, 363);
this.tabControl1.Size = new System.Drawing.Size(1035, 447);
this.tabControl1.TabIndex = 10;
//
// tabPage1
//
this.tabPage1.Controls.Add(this.groupBox1);
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Location = new System.Drawing.Point(4, 25);
this.tabPage1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(750, 113);
this.tabPage1.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.tabPage1.Size = new System.Drawing.Size(1027, 418);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "File IO test";
this.tabPage1.UseVisualStyleBackColor = true;
@@ -251,10 +273,11 @@
this.tabPage2.Controls.Add(this.lblNumMerged);
this.tabPage2.Controls.Add(this.txtMergedName);
this.tabPage2.Controls.Add(this.button1);
this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Location = new System.Drawing.Point(4, 25);
this.tabPage2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(768, 337);
this.tabPage2.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.tabPage2.Size = new System.Drawing.Size(1027, 418);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "PDF test";
this.tabPage2.UseVisualStyleBackColor = true;
@@ -266,62 +289,190 @@
this.tabPage3.Controls.Add(this.btnShowCdv);
this.tabPage3.Controls.Add(this.lblRedis);
this.tabPage3.Controls.Add(this.button2);
this.tabPage3.Location = new System.Drawing.Point(4, 22);
this.tabPage3.Location = new System.Drawing.Point(4, 25);
this.tabPage3.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Size = new System.Drawing.Size(768, 337);
this.tabPage3.Size = new System.Drawing.Size(1027, 418);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "Redis test";
this.tabPage3.UseVisualStyleBackColor = true;
//
// tabPage4
// btnResetCdv
//
this.tabPage4.Controls.Add(this.label3);
this.tabPage4.Controls.Add(this.lblHwSwData);
this.tabPage4.Location = new System.Drawing.Point(4, 22);
this.tabPage4.Name = "tabPage4";
this.tabPage4.Size = new System.Drawing.Size(750, 192);
this.tabPage4.TabIndex = 3;
this.tabPage4.Text = "Hw Sw pages";
this.tabPage4.UseVisualStyleBackColor = true;
this.btnResetCdv.Location = new System.Drawing.Point(660, 16);
this.btnResetCdv.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.btnResetCdv.Name = "btnResetCdv";
this.btnResetCdv.Size = new System.Drawing.Size(100, 28);
this.btnResetCdv.TabIndex = 13;
this.btnResetCdv.Text = "Reset CDV";
this.btnResetCdv.UseVisualStyleBackColor = true;
this.btnResetCdv.Click += new System.EventHandler(this.btnResetCdv_Click);
//
// lblRedCDV
//
this.lblRedCDV.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lblRedCDV.AutoEllipsis = true;
this.lblRedCDV.Location = new System.Drawing.Point(411, 39);
this.lblRedCDV.Location = new System.Drawing.Point(548, 48);
this.lblRedCDV.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblRedCDV.Name = "lblRedCDV";
this.lblRedCDV.Size = new System.Drawing.Size(349, 293);
this.lblRedCDV.Size = new System.Drawing.Size(465, 361);
this.lblRedCDV.TabIndex = 10;
this.lblRedCDV.Text = "---";
//
// btnShowCdv
//
this.btnShowCdv.Location = new System.Drawing.Point(414, 13);
this.btnShowCdv.Location = new System.Drawing.Point(552, 16);
this.btnShowCdv.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.btnShowCdv.Name = "btnShowCdv";
this.btnShowCdv.Size = new System.Drawing.Size(75, 23);
this.btnShowCdv.Size = new System.Drawing.Size(100, 28);
this.btnShowCdv.TabIndex = 11;
this.btnShowCdv.Text = "Show Config";
this.btnShowCdv.UseVisualStyleBackColor = true;
this.btnShowCdv.Click += new System.EventHandler(this.btnShowCdv_Click);
//
// btnResetCdv
// tabPage4
//
this.btnResetCdv.Location = new System.Drawing.Point(495, 13);
this.btnResetCdv.Name = "btnResetCdv";
this.btnResetCdv.Size = new System.Drawing.Size(75, 23);
this.btnResetCdv.TabIndex = 13;
this.btnResetCdv.Text = "Reset CDV";
this.btnResetCdv.UseVisualStyleBackColor = true;
this.btnResetCdv.Click += new System.EventHandler(this.btnResetCdv_Click);
this.tabPage4.Controls.Add(this.label3);
this.tabPage4.Controls.Add(this.lblHwSwData);
this.tabPage4.Location = new System.Drawing.Point(4, 25);
this.tabPage4.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.tabPage4.Name = "tabPage4";
this.tabPage4.Size = new System.Drawing.Size(1027, 418);
this.tabPage4.TabIndex = 3;
this.tabPage4.Text = "Hw Sw pages";
this.tabPage4.UseVisualStyleBackColor = true;
//
// tabPage5
//
this.tabPage5.Controls.Add(this.lblClock);
this.tabPage5.Controls.Add(this.lblNextSched);
this.tabPage5.Controls.Add(this.lblStartTimer);
this.tabPage5.Controls.Add(this.label6);
this.tabPage5.Controls.Add(this.label5);
this.tabPage5.Controls.Add(this.txtSec);
this.tabPage5.Controls.Add(this.label4);
this.tabPage5.Controls.Add(this.txtMin);
this.tabPage5.Controls.Add(this.lblOre);
this.tabPage5.Controls.Add(this.txtOre);
this.tabPage5.Controls.Add(this.btnStartSched);
this.tabPage5.Location = new System.Drawing.Point(4, 25);
this.tabPage5.Name = "tabPage5";
this.tabPage5.Padding = new System.Windows.Forms.Padding(3);
this.tabPage5.Size = new System.Drawing.Size(1027, 418);
this.tabPage5.TabIndex = 4;
this.tabPage5.Text = "Scheduler";
this.tabPage5.UseVisualStyleBackColor = true;
//
// btnStartSched
//
this.btnStartSched.Location = new System.Drawing.Point(21, 23);
this.btnStartSched.Name = "btnStartSched";
this.btnStartSched.Size = new System.Drawing.Size(75, 23);
this.btnStartSched.TabIndex = 0;
this.btnStartSched.Text = "Start Scheduler";
this.btnStartSched.UseVisualStyleBackColor = true;
this.btnStartSched.Click += new System.EventHandler(this.btnStartSched_Click);
//
// txtOre
//
this.txtOre.Location = new System.Drawing.Point(163, 23);
this.txtOre.Name = "txtOre";
this.txtOre.Size = new System.Drawing.Size(39, 22);
this.txtOre.TabIndex = 1;
this.txtOre.Text = "0";
//
// lblOre
//
this.lblOre.AutoSize = true;
this.lblOre.Location = new System.Drawing.Point(133, 26);
this.lblOre.Name = "lblOre";
this.lblOre.Size = new System.Drawing.Size(24, 17);
this.lblOre.TabIndex = 2;
this.lblOre.Text = "hh";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(212, 26);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(30, 17);
this.label4.TabIndex = 4;
this.label4.Text = "min";
//
// txtMin
//
this.txtMin.Location = new System.Drawing.Point(242, 23);
this.txtMin.Name = "txtMin";
this.txtMin.Size = new System.Drawing.Size(39, 22);
this.txtMin.TabIndex = 3;
this.txtMin.Text = "0";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(287, 26);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(30, 17);
this.label5.TabIndex = 6;
this.label5.Text = "sec";
//
// txtSec
//
this.txtSec.Location = new System.Drawing.Point(322, 23);
this.txtSec.Name = "txtSec";
this.txtSec.Size = new System.Drawing.Size(45, 22);
this.txtSec.TabIndex = 5;
this.txtSec.Text = "10";
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(27, 62);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(311, 17);
this.label6.TabIndex = 7;
this.label6.Text = "Esecuzione test timer con apertura messagebox";
//
// lblStartTimer
//
this.lblStartTimer.AutoSize = true;
this.lblStartTimer.Location = new System.Drawing.Point(389, 26);
this.lblStartTimer.Name = "lblStartTimer";
this.lblStartTimer.Size = new System.Drawing.Size(23, 17);
this.lblStartTimer.TabIndex = 8;
this.lblStartTimer.Text = "---";
//
// lblNextSched
//
this.lblNextSched.AutoSize = true;
this.lblNextSched.Location = new System.Drawing.Point(389, 62);
this.lblNextSched.Name = "lblNextSched";
this.lblNextSched.Size = new System.Drawing.Size(23, 17);
this.lblNextSched.TabIndex = 9;
this.lblNextSched.Text = "---";
//
// lblClock
//
this.lblClock.AutoSize = true;
this.lblClock.Location = new System.Drawing.Point(792, 26);
this.lblClock.Name = "lblClock";
this.lblClock.Size = new System.Drawing.Size(20, 17);
this.lblClock.TabIndex = 10;
this.lblClock.Text = "...";
//
// clockTimer
//
this.clockTimer.Interval = 500;
this.clockTimer.Tick += new System.EventHandler(this.clockTimer_Tick);
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(776, 363);
this.ClientSize = new System.Drawing.Size(1035, 447);
this.Controls.Add(this.tabControl1);
this.Margin = new System.Windows.Forms.Padding(2);
this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.Name = "MainForm";
this.Text = "WinForm library POC";
this.groupBox1.ResumeLayout(false);
@@ -334,6 +485,8 @@
this.tabPage3.ResumeLayout(false);
this.tabPage4.ResumeLayout(false);
this.tabPage4.PerformLayout();
this.tabPage5.ResumeLayout(false);
this.tabPage5.PerformLayout();
this.ResumeLayout(false);
}
@@ -364,6 +517,19 @@
private System.Windows.Forms.Button btnResetCdv;
private System.Windows.Forms.Label lblRedCDV;
private System.Windows.Forms.Button btnShowCdv;
private System.Windows.Forms.TabPage tabPage5;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.TextBox txtSec;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox txtMin;
private System.Windows.Forms.Label lblOre;
private System.Windows.Forms.TextBox txtOre;
private System.Windows.Forms.Button btnStartSched;
private System.Windows.Forms.Label lblNextSched;
private System.Windows.Forms.Label lblStartTimer;
private System.Windows.Forms.Label lblClock;
private System.Windows.Forms.Timer clockTimer;
}
}
+51 -1
View File
@@ -1,4 +1,5 @@
using SteamWare;
using Steamware.Scheduler;
using SteamWare;
using System;
using System.Collections.Generic;
using System.IO;
@@ -95,5 +96,54 @@ namespace TestBench
}
lblRedCDV.Text = sb.ToString();
}
private void btnStartSched_Click(object sender, EventArgs e)
{
// avvia uno scheduler che apre una messagebox secondo programmazione impostata...
// For Interval in Minutes
// This Scheduler will start at 22:00 and call after every 30 Minutes
// IntervalInSeconds(start_hour, start_minute, minutes)
// calcolo istante dal PROSSIMO minuto
DateTime avvio = DateTime.Now;
lblStartTimer.Text = $"Avvio timer: {avvio:ddd yyyy-MM-dd HH:mm:ss}";
avvio = avvio.AddMinutes(1).AddSeconds(-avvio.Second);
lblNextSched.Text = $"Scadenza timer: {avvio:ddd yyyy-MM-dd HH:mm:ss}";
clockTimer.Start();
// calcolo periodo in minuti guardando quanto selezionato
int ore = 0;
int min = 0;
int sec = 0;
int.TryParse(txtOre.Text, out ore);
int.TryParse(txtMin.Text, out min);
int.TryParse(txtSec.Text, out sec);
// calcolo
double intSecondi = ore * 60 * 60 + min * 60 + sec;
TaskScheduler.IntervalInSeconds(avvio.Hour, avvio.Minute, intSecondi,
() =>
{
DateTime adesso = DateTime.Now;
// Initializes the variables to pass to the MessageBox.Show method.
string message = $"E' scattato il timer alle ore {DateTime.Now}.";
string caption = "Timer Elapsed";
MessageBoxButtons buttons = MessageBoxButtons.OK;
DialogResult result;
lblNextSched.Text = $"Scadenza timer: {adesso.AddSeconds(intSecondi):ddd yyyy-MM-dd HH:mm:ss}";
// Displays the MessageBox.
result = MessageBox.Show(message, caption, buttons);
});
}
private void clockTimer_Tick(object sender, EventArgs e)
{
DateTime adesso = DateTime.Now;
lblClock.Text = $"Clock: {adesso:ddd yyyy-MM-dd HH:mm:ss}";
}
}
}
+3
View File
@@ -120,4 +120,7 @@
<metadata name="openFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="clockTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>184, 17</value>
</metadata>
</root>
+16
View File
@@ -83,6 +83,22 @@
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SteamWare.IO\SteamWare.IO.csproj">
<Project>{62c5b3ce-b2b7-476a-a600-059ce52dae14}</Project>
<Name>SteamWare.IO</Name>
</ProjectReference>
<ProjectReference Include="..\SteamWare.Logger\SteamWare.Logger.csproj">
<Project>{97a9f482-c173-4f0f-9f8f-7bb41c59cdd6}</Project>
<Name>SteamWare.Logger</Name>
</ProjectReference>
<ProjectReference Include="..\SteamWare.Reports\SteamWare.Reports.csproj">
<Project>{1792d70c-d854-415b-acf1-76bbcb8ac6fe}</Project>
<Name>SteamWare.Reports</Name>
</ProjectReference>
<ProjectReference Include="..\Steamware.Scheduler\Steamware.Scheduler.csproj">
<Project>{8901afac-987a-40c9-b730-d1fde0e5170c}</Project>
<Name>Steamware.Scheduler</Name>
</ProjectReference>
<ProjectReference Include="..\SteamWareLib\SteamWare.csproj">
<Project>{2872dcfe-8b46-43b2-baa0-842a816a2dd5}</Project>
<Name>SteamWare</Name>