diff --git a/IOB-WIN/AdapterForm.Designer.cs b/IOB-WIN/AdapterForm.Designer.cs index 21ef28fa..d0bb5e42 100644 --- a/IOB-WIN/AdapterForm.Designer.cs +++ b/IOB-WIN/AdapterForm.Designer.cs @@ -92,6 +92,7 @@ this.lblBitmap_03 = new System.Windows.Forms.Label(); this.chkEdit = new System.Windows.Forms.CheckBox(); this.btnSendPLC = new System.Windows.Forms.Button(); + this.btnOpenLog = new System.Windows.Forms.Button(); this.statusStrip1.SuspendLayout(); this.tableLayoutPanel1.SuspendLayout(); this.tabData.SuspendLayout(); @@ -144,14 +145,13 @@ | System.Windows.Forms.AnchorStyles.Right))); this.tableLayoutPanel1.ColumnCount = 8; this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 32F)); - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 91F)); - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 91F)); - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 91F)); - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 59F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 70F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 70F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 70F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 54F)); this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 32F)); this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 32F)); - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 27F)); this.tableLayoutPanel1.Controls.Add(this.restart, 0, 0); this.tableLayoutPanel1.Controls.Add(this.stop, 2, 0); this.tableLayoutPanel1.Controls.Add(this.nLines, 6, 0); @@ -178,7 +178,7 @@ this.restart.Location = new System.Drawing.Point(36, 4); this.restart.Margin = new System.Windows.Forms.Padding(4); this.restart.Name = "restart"; - this.restart.Size = new System.Drawing.Size(83, 29); + this.restart.Size = new System.Drawing.Size(62, 29); this.restart.TabIndex = 78; this.restart.Text = "Reset"; this.restart.UseVisualStyleBackColor = false; @@ -191,10 +191,10 @@ | System.Windows.Forms.AnchorStyles.Right))); this.stop.Font = new System.Drawing.Font("Arial Narrow", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.stop.ForeColor = System.Drawing.SystemColors.ControlText; - this.stop.Location = new System.Drawing.Point(218, 4); + this.stop.Location = new System.Drawing.Point(176, 4); this.stop.Margin = new System.Windows.Forms.Padding(4); this.stop.Name = "stop"; - this.stop.Size = new System.Drawing.Size(83, 29); + this.stop.Size = new System.Drawing.Size(62, 29); this.stop.TabIndex = 3; this.stop.Text = "Stop"; this.stop.UseVisualStyleBackColor = true; @@ -220,10 +220,10 @@ this.start.BackColor = System.Drawing.SystemColors.Control; this.start.Font = new System.Drawing.Font("Arial Narrow", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.start.ForeColor = System.Drawing.SystemColors.ControlText; - this.start.Location = new System.Drawing.Point(127, 4); + this.start.Location = new System.Drawing.Point(106, 4); this.start.Margin = new System.Windows.Forms.Padding(4); this.start.Name = "start"; - this.start.Size = new System.Drawing.Size(83, 29); + this.start.Size = new System.Drawing.Size(62, 29); this.start.TabIndex = 2; this.start.Text = "Start"; this.start.UseVisualStyleBackColor = false; @@ -264,7 +264,7 @@ this.chkForceDequeue.AutoSize = true; this.chkForceDequeue.Dock = System.Windows.Forms.DockStyle.Fill; this.chkForceDequeue.Font = new System.Drawing.Font("Arial Narrow", 7F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.chkForceDequeue.Location = new System.Drawing.Point(308, 2); + this.chkForceDequeue.Location = new System.Drawing.Point(245, 2); this.chkForceDequeue.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.chkForceDequeue.MinimumSize = new System.Drawing.Size(60, 0); this.chkForceDequeue.Name = "chkForceDequeue"; @@ -542,6 +542,7 @@ // // tabLog // + this.tabLog.Controls.Add(this.btnOpenLog); this.tabLog.Controls.Add(this.label6); this.tabLog.Controls.Add(this.flowLayoutPanel1); this.tabLog.Location = new System.Drawing.Point(4, 25); @@ -555,12 +556,13 @@ // label6 // this.label6.AutoSize = true; + this.label6.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label6.Location = new System.Drawing.Point(16, 7); this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(146, 17); + this.label6.Size = new System.Drawing.Size(277, 17); this.label6.TabIndex = 4; - this.label6.Text = "Log message watcher"; + this.label6.Text = "Log message watcher (last message)"; // // flowLayoutPanel1 // @@ -568,10 +570,10 @@ | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.flowLayoutPanel1.Controls.Add(this.lblLogfile); - this.flowLayoutPanel1.Location = new System.Drawing.Point(8, 36); + this.flowLayoutPanel1.Location = new System.Drawing.Point(8, 37); this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(4); this.flowLayoutPanel1.Name = "flowLayoutPanel1"; - this.flowLayoutPanel1.Size = new System.Drawing.Size(1257, 641); + this.flowLayoutPanel1.Size = new System.Drawing.Size(1257, 640); this.flowLayoutPanel1.TabIndex = 3; // // lblLogfile @@ -840,6 +842,17 @@ this.btnSendPLC.UseVisualStyleBackColor = true; this.btnSendPLC.Click += new System.EventHandler(this.BtnSendPLC_Click); // + // btnOpenLog + // + this.btnOpenLog.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnOpenLog.Location = new System.Drawing.Point(1055, 7); + this.btnOpenLog.Name = "btnOpenLog"; + this.btnOpenLog.Size = new System.Drawing.Size(210, 27); + this.btnOpenLog.TabIndex = 5; + this.btnOpenLog.Text = "Open Machine FULL LOG"; + this.btnOpenLog.UseVisualStyleBackColor = true; + this.btnOpenLog.Click += new System.EventHandler(this.BtnOpenLog_Click); + // // AdapterForm // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); @@ -945,5 +958,6 @@ private System.Windows.Forms.Label label14; private System.Windows.Forms.TextBox txtItemCode; private System.Windows.Forms.Label label13; + private System.Windows.Forms.Button btnOpenLog; } } \ No newline at end of file diff --git a/IOB-WIN/AdapterForm.cs b/IOB-WIN/AdapterForm.cs index c664aa19..a90d45e0 100644 --- a/IOB-WIN/AdapterForm.cs +++ b/IOB-WIN/AdapterForm.cs @@ -4,6 +4,7 @@ using NLog.Config; using NLog.Targets; using System; using System.Collections.Generic; +using System.Diagnostics; using System.Drawing; using System.Threading; using System.Windows.Forms; @@ -1083,5 +1084,18 @@ namespace IOB_WIN //!!!FIXME!!! FARE!!! } + + private void BtnOpenLog_Click(object sender, EventArgs e) + { + try + { + string logPath = $"{System.AppDomain.CurrentDomain.BaseDirectory}logs\\{CurrIOB}\\{DateTime.Today:yyyy-MM-dd}.log"; + Process.Start(logPath); + } + catch (Exception exc) + { + lgError($"Eccezione in show log (MAIN):{Environment.NewLine}{exc}"); + } + } } } diff --git a/IOB-WIN/MainForm.cs b/IOB-WIN/MainForm.cs index 92b44123..85955b31 100644 --- a/IOB-WIN/MainForm.cs +++ b/IOB-WIN/MainForm.cs @@ -810,7 +810,7 @@ namespace IOB_WIN { try { - string logPath = $"{System.AppDomain.CurrentDomain.BaseDirectory}\\logs\\MAIN\\{DateTime.Today:yyyy-MM-dd}.log"; + string logPath = $"{System.AppDomain.CurrentDomain.BaseDirectory}logs\\MAIN\\{DateTime.Today:yyyy-MM-dd}.log"; Process.Start(logPath); } catch(Exception exc)