diff --git a/CVCncLib/testSam.XmlSerializers.dll b/CVCncLib/testSam.XmlSerializers.dll index 410b706e..b5a5e75d 100644 Binary files a/CVCncLib/testSam.XmlSerializers.dll and b/CVCncLib/testSam.XmlSerializers.dll differ diff --git a/CVCncLib/testSam.dll b/CVCncLib/testSam.dll index bf276146..c767a943 100644 Binary files a/CVCncLib/testSam.dll and b/CVCncLib/testSam.dll differ diff --git a/IOB-MAN/App.config b/IOB-MAN/App.config index b2e82429..a95da3ed 100644 --- a/IOB-MAN/App.config +++ b/IOB-MAN/App.config @@ -7,6 +7,7 @@ + diff --git a/IOB-MAN/IOBManPanel.Designer.cs b/IOB-MAN/IOBManPanel.Designer.cs index e1493b52..175c1a09 100644 --- a/IOB-MAN/IOBManPanel.Designer.cs +++ b/IOB-MAN/IOBManPanel.Designer.cs @@ -44,11 +44,13 @@ this.btnMinimizeAll = new System.Windows.Forms.Button(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.panel2 = new System.Windows.Forms.Panel(); + this.txtTOutAutoCheck = new System.Windows.Forms.TextBox(); + this.chkAutoRestart = new System.Windows.Forms.CheckBox(); this.btnOpenAll = new System.Windows.Forms.Button(); this.btnRestartAll = new System.Windows.Forms.Button(); this.btnCloseAll = new System.Windows.Forms.Button(); this.dgvManagedItems = new System.Windows.Forms.DataGridView(); - this.chkAutoRestart = new System.Windows.Forms.CheckBox(); + this.btnMoreTOut = new System.Windows.Forms.Button(); this.statusStrip1.SuspendLayout(); this.panel1.SuspendLayout(); this.menuStrip1.SuspendLayout(); @@ -190,6 +192,8 @@ // panel2 // this.panel2.BackColor = System.Drawing.SystemColors.ControlLightLight; + this.panel2.Controls.Add(this.btnMoreTOut); + this.panel2.Controls.Add(this.txtTOutAutoCheck); this.panel2.Controls.Add(this.chkAutoRestart); this.panel2.Controls.Add(this.btnOpenAll); this.panel2.Controls.Add(this.btnRestartAll); @@ -204,6 +208,28 @@ this.panel2.Size = new System.Drawing.Size(116, 341); this.panel2.TabIndex = 85; // + // txtTOutAutoCheck + // + this.txtTOutAutoCheck.Location = new System.Drawing.Point(11, 306); + this.txtTOutAutoCheck.Name = "txtTOutAutoCheck"; + this.txtTOutAutoCheck.Size = new System.Drawing.Size(64, 20); + this.txtTOutAutoCheck.TabIndex = 86; + this.txtTOutAutoCheck.Visible = false; + this.txtTOutAutoCheck.TextChanged += new System.EventHandler(this.txtTOutAutoCheck_TextChanged); + // + // chkAutoRestart + // + this.chkAutoRestart.AutoSize = true; + this.chkAutoRestart.Checked = true; + this.chkAutoRestart.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkAutoRestart.Location = new System.Drawing.Point(11, 275); + this.chkAutoRestart.Name = "chkAutoRestart"; + this.chkAutoRestart.Size = new System.Drawing.Size(85, 17); + this.chkAutoRestart.TabIndex = 85; + this.chkAutoRestart.Text = "Auto Restart"; + this.chkAutoRestart.UseVisualStyleBackColor = true; + this.chkAutoRestart.CheckedChanged += new System.EventHandler(this.chkAutoRestart_CheckedChanged); + // // btnOpenAll // this.btnOpenAll.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); @@ -260,18 +286,16 @@ this.dgvManagedItems.TabIndex = 76; this.dgvManagedItems.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvManagedItems_CellDoubleClick); // - // chkAutoRestart + // btnMoreTOut // - this.chkAutoRestart.AutoSize = true; - this.chkAutoRestart.Checked = true; - this.chkAutoRestart.CheckState = System.Windows.Forms.CheckState.Checked; - this.chkAutoRestart.Location = new System.Drawing.Point(11, 283); - this.chkAutoRestart.Name = "chkAutoRestart"; - this.chkAutoRestart.Size = new System.Drawing.Size(85, 17); - this.chkAutoRestart.TabIndex = 85; - this.chkAutoRestart.Text = "Auto Restart"; - this.chkAutoRestart.UseVisualStyleBackColor = true; - this.chkAutoRestart.CheckedChanged += new System.EventHandler(this.chkAutoRestart_CheckedChanged); + this.btnMoreTOut.Location = new System.Drawing.Point(81, 306); + this.btnMoreTOut.Name = "btnMoreTOut"; + this.btnMoreTOut.Size = new System.Drawing.Size(25, 23); + this.btnMoreTOut.TabIndex = 87; + this.btnMoreTOut.Text = "+"; + this.btnMoreTOut.UseVisualStyleBackColor = true; + this.btnMoreTOut.Visible = false; + this.btnMoreTOut.Click += new System.EventHandler(this.btnMoreTOut_Click); // // IOBManPanel // @@ -324,6 +348,8 @@ private System.Windows.Forms.ToolStripMenuItem updateIOBMANToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem updateIOBWINToolStripMenuItem; private System.Windows.Forms.CheckBox chkAutoRestart; + private System.Windows.Forms.TextBox txtTOutAutoCheck; + private System.Windows.Forms.Button btnMoreTOut; } } diff --git a/IOB-MAN/IOBManPanel.cs b/IOB-MAN/IOBManPanel.cs index d9598430..60f0b67a 100644 --- a/IOB-MAN/IOBManPanel.cs +++ b/IOB-MAN/IOBManPanel.cs @@ -37,10 +37,14 @@ namespace IOB_MAN /// protected int watchDogMult = utils.CRI("watchDogMult"); /// - /// Counter per verifica processi (ogni volta ceh va a zero faccio vero check) + /// Counter per verifica processi (ogni volta che va a zero faccio vero check) /// protected int chekMult = utils.CRI("chekMult"); /// + /// Counter del timer di base + /// + protected int checkPeriod = utils.CRI("checkPeriod"); + /// /// Elenco ARGS (uno per child da avviare) /// public List ArgsList = new List(); @@ -52,7 +56,10 @@ namespace IOB_MAN /// Path dell'exe da chiamare /// protected string TargetExe = ""; - + /// + /// Contatore autockeck nativo + /// + protected int tOutAutocheck = 100; public IOBManPanel() { InitializeComponent(); @@ -71,7 +78,7 @@ namespace IOB_MAN ElencoIOB.ListChanged += ElencoIOB_ListChanged; // colelgo tab a binding dgvManagedItems.DataSource = ElencoIOB; - MainTimer.Interval = utils.CRI("checkPeriod"); + MainTimer.Interval = checkPeriod; loadConfig(); MainTimer.Start(); utils.lgInfo("Timer started"); @@ -143,15 +150,25 @@ namespace IOB_MAN hlRestart = true; } // fix autorestart... - if(hlRestart) + if (hlRestart) { chkAutoRestart.ForeColor = System.Drawing.Color.Red; chkAutoRestart.Text = "Auto Restart!!!"; + txtTOutAutoCheck.Visible = true; + btnMoreTOut.Visible = true; + // se NON checked aggiorno contatore... + if (!chkAutoRestart.Checked) + { + tOutAutocheck--; + txtTOutAutoCheck.Text = (tOutAutocheck / (1000 / (utils.CRI("checkPeriod") * utils.CRI("chekMult")))).ToString(); + } } else { chkAutoRestart.ForeColor = DefaultForeColor; chkAutoRestart.Text = "Auto Restart"; + txtTOutAutoCheck.Visible = false; + btnMoreTOut.Visible = false; } } @@ -318,6 +335,7 @@ namespace IOB_MAN proc2restart.Add(item); } } + // SE abilitato autorestart... if (chkAutoRestart.Checked) { @@ -333,6 +351,15 @@ namespace IOB_MAN startChildProc(item.CodIOB); } } + else + { + // se autorestart scaduto e NON checked --> lo imposto + if (tOutAutocheck < 0) + { + // lo riattivo + chkAutoRestart.Checked = true; + } + } } /// @@ -401,10 +428,13 @@ namespace IOB_MAN private void IOBManPanel_FormClosing(object sender, FormClosingEventArgs e) { - closeAllChild(); + closeAllChild(true); } - - private void closeAllChild() + /// + /// Chiude tutti i child + /// + /// resetta elenco + private void closeAllChild(bool doReset) { List item2rem = new List(); @@ -421,7 +451,15 @@ namespace IOB_MAN { Process p = Process.GetProcessById(item.pID); p.CloseMainWindow(); - ElencoIOB.Remove(item); + // indico NON running su datasource + if (doReset) + { + ElencoIOB.Remove(item); + } + else + { + item.isRunning = false; + } } catch { } @@ -455,9 +493,12 @@ namespace IOB_MAN { } } } - // resetto elenco! - ElencoIOB.Clear(); - numProcAvviati = 0; + if (doReset) + { + // resetto elenco! + ElencoIOB.Clear(); + numProcAvviati = 0; + } numProcRunning = 0; // update! updateStatus(); @@ -559,16 +600,7 @@ namespace IOB_MAN private void openALLToolStripMenuItem_Click(object sender, EventArgs e) { } - /// - /// Chiama chiusura + update status... - /// - /// - /// - private void closeALLToolStripMenuItem_Click(object sender, EventArgs e) - { - closeAllChild(); - updateStatus(); - } + /// /// Chiama Restart (close/start) + update status... @@ -578,7 +610,7 @@ namespace IOB_MAN private void restartALLToolStripMenuItem_Click(object sender, EventArgs e) { // chiude tutto - closeAllChild(); + closeAllChild(false); apriChild(); updateStatus(); } @@ -586,7 +618,7 @@ namespace IOB_MAN private void loadConfToolStripMenuItem_Click(object sender, EventArgs e) { // per iscurezza chiudo tutto - closeAllChild(); + closeAllChild(true); Thread.Sleep(1000); // lettura conf file... loadConfig(); @@ -598,7 +630,7 @@ namespace IOB_MAN private void updateModeToolStripMenuItem_Click(object sender, EventArgs e) { // chiude tutte - closeAllChild(); + closeAllChild(true); Thread.Sleep(1000); updateStatus(); // apre solo 1 con conf "fake" x condurre update... @@ -608,7 +640,7 @@ namespace IOB_MAN private void btnCloseAll_Click(object sender, EventArgs e) { // chiude tutto - closeAllChild(); + closeAllChild(false); //apriChild(); updateStatus(); } @@ -616,7 +648,7 @@ namespace IOB_MAN private void btnRestartAll_Click(object sender, EventArgs e) { // chiude tutto - closeAllChild(); + closeAllChild(true); apriChild(); updateStatus(); } @@ -625,7 +657,7 @@ namespace IOB_MAN private void btnOpenAll_Click(object sender, EventArgs e) { // per iscurezza chiudo tutto - closeAllChild(); + closeAllChild(true); Thread.Sleep(1000); // lettura conf file... loadConfig(); @@ -642,7 +674,7 @@ namespace IOB_MAN private void updateIOBWINToolStripMenuItem_Click(object sender, EventArgs e) { // chiude tutte - closeAllChild(); + closeAllChild(true); Thread.Sleep(1000); updateStatus(); // apre solo 1 con conf "fake" x condurre update... @@ -651,9 +683,21 @@ namespace IOB_MAN private void chkAutoRestart_CheckedChanged(object sender, EventArgs e) { + // se tolgo autorestart --> imposto NUOVA scadenza x forzare check + tOutAutocheck = 60 * utils.CRI("autoRestartTimeoutMin") * (1000 / (utils.CRI("checkPeriod") * utils.CRI("chekMult"))); // fa subito controllo riavvio... processAutoRestart(); } + + private void btnMoreTOut_Click(object sender, EventArgs e) + { + tOutAutocheck += 60 * utils.CRI("autoRestartTimeoutMin") * (1000 / (utils.CRI("checkPeriod") * utils.CRI("chekMult"))); + } + + private void txtTOutAutoCheck_TextChanged(object sender, EventArgs e) + { + + } } } diff --git a/Jenkinsfile b/Jenkinsfile index e5977cbf..5611a643 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,7 +16,7 @@ pipeline { /* calcolo numero versione... diverso x branch MASTER/DEVELOP */ script { - withEnv(['NEXT_BUILD_NUMBER=617']) { + withEnv(['NEXT_BUILD_NUMBER=619']) { // env.versionNumber = VersionNumber(versionNumberString : '3.0.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true) env.versionNumber = VersionNumber(versionNumberString : '3.0.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}') env.APP_NAME = 'MAPO-IOB-WIN'