diff --git a/YiDa_WinForm/Form/MainForm.Designer.cs b/YiDa_WinForm/Form/MainForm.Designer.cs index 3deab08..410c301 100644 --- a/YiDa_WinForm/Form/MainForm.Designer.cs +++ b/YiDa_WinForm/Form/MainForm.Designer.cs @@ -33,7 +33,7 @@ this.buttonDisconnect = new System.Windows.Forms.Button(); this.textBoxLog = new System.Windows.Forms.TextBox(); this.statusStrip1 = new System.Windows.Forms.StatusStrip(); - this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel(); + this.toolStripStatusLabel3 = new System.Windows.Forms.ToolStripStatusLabel(); this.panel1 = new System.Windows.Forms.Panel(); this.button6 = new System.Windows.Forms.Button(); this.label8 = new System.Windows.Forms.Label(); @@ -57,13 +57,14 @@ this.label3 = new System.Windows.Forms.Label(); this.panelLed = new System.Windows.Forms.Panel(); this.panel3 = new System.Windows.Forms.Panel(); + this.statusStrip2 = new System.Windows.Forms.StatusStrip(); this.timer1 = new System.Windows.Forms.Timer(this.components); this.miniToolStrip = new System.Windows.Forms.StatusStrip(); - this.statusStrip1.SuspendLayout(); this.panel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.bsPF2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.bsPF)).BeginInit(); this.panel3.SuspendLayout(); + this.statusStrip2.SuspendLayout(); this.SuspendLayout(); // // buttonConnect @@ -109,7 +110,6 @@ // this.statusStrip1.AutoSize = false; this.statusStrip1.Dock = System.Windows.Forms.DockStyle.None; - this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripStatusLabel1 }); this.statusStrip1.Location = new System.Drawing.Point(72, 26); this.statusStrip1.Name = "statusStrip1"; this.statusStrip1.Padding = new System.Windows.Forms.Padding(1, 0, 13, 0); @@ -120,11 +120,12 @@ this.statusStrip1.Text = "miniToolStrip"; this.statusStrip1.Visible = false; // - // toolStripStatusLabel1 + // toolStripStatusLabel3 // - this.toolStripStatusLabel1.Name = "toolStripStatusLabel1"; - this.toolStripStatusLabel1.Size = new System.Drawing.Size(54, 14); - this.toolStripStatusLabel1.Text = "未连接"; + this.toolStripStatusLabel3.Name = "toolStripStatusLabel3"; + this.toolStripStatusLabel3.Size = new System.Drawing.Size(54, 20); + this.toolStripStatusLabel3.Text = "未连接"; + this.toolStripStatusLabel3.Click += new System.EventHandler(this.toolStripStatusLabel3_Click); // // panel1 // @@ -372,6 +373,7 @@ // // panel3 // + this.panel3.Controls.Add(this.statusStrip2); this.panel3.Controls.Add(this.panelLed); this.panel3.Controls.Add(this.statusStrip1); this.panel3.Controls.Add(this.label3); @@ -383,6 +385,18 @@ this.panel3.Size = new System.Drawing.Size(1008, 47); this.panel3.TabIndex = 7; // + // statusStrip2 + // + this.statusStrip2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.statusStrip2.Dock = System.Windows.Forms.DockStyle.None; + this.statusStrip2.ImageScalingSize = new System.Drawing.Size(20, 20); + this.statusStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripStatusLabel3 }); + this.statusStrip2.Location = new System.Drawing.Point(35, 12); + this.statusStrip2.Name = "statusStrip2"; + this.statusStrip2.Size = new System.Drawing.Size(71, 25); + this.statusStrip2.TabIndex = 13; + this.statusStrip2.Text = "statusStrip2"; + // // timer1 // this.timer1.Interval = 1000; @@ -413,20 +427,24 @@ this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.Name = "MainForm"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "孚冈-宜搭数据数据转发"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainFormClosing); this.Load += new System.EventHandler(this.Form1_Load); - this.statusStrip1.ResumeLayout(false); - this.statusStrip1.PerformLayout(); this.panel1.ResumeLayout(false); this.panel1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.bsPF2)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.bsPF)).EndInit(); this.panel3.ResumeLayout(false); this.panel3.PerformLayout(); + this.statusStrip2.ResumeLayout(false); + this.statusStrip2.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); } + private System.Windows.Forms.StatusStrip statusStrip2; + private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel3; + private System.Windows.Forms.Button button6; private System.Windows.Forms.Label label8; @@ -443,7 +461,6 @@ private System.Windows.Forms.Button buttonDisconnect; private System.Windows.Forms.TextBox textBoxLog; private System.Windows.Forms.StatusStrip statusStrip1; - private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1; private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Label label1; private System.Windows.Forms.ComboBox comboBox1; diff --git a/YiDa_WinForm/Form/MainForm.cs b/YiDa_WinForm/Form/MainForm.cs index f788803..ec105cd 100644 --- a/YiDa_WinForm/Form/MainForm.cs +++ b/YiDa_WinForm/Form/MainForm.cs @@ -262,7 +262,7 @@ namespace YiDa_WinForm await _mqttService.MqttClientStartAsync(); LogHelper.AppendLog("连接成功!"); panelLed.BackColor = Color.Green; - toolStripStatusLabel1.Text = "已连接"; + toolStripStatusLabel3.Text = "已连接"; buttonConnect.Enabled = false; buttonDisconnect.Enabled = true; @@ -280,7 +280,7 @@ namespace YiDa_WinForm { panelLed.BackColor = Color.Red; LogHelper.AppendLog($"连接失败:{ex.Message}"); - toolStripStatusLabel1.Text = "连接失败"; + toolStripStatusLabel3.Text = "连接失败"; } } @@ -294,7 +294,7 @@ namespace YiDa_WinForm await _mqttService.MqttClientStopAsync(); LogHelper.AppendLog("已断开连接"); panelLed.BackColor = Color.Red; - toolStripStatusLabel1.Text = "未连接"; + toolStripStatusLabel3.Text = "未连接"; buttonConnect.Enabled = true; buttonDisconnect.Enabled = false; @@ -375,7 +375,7 @@ namespace YiDa_WinForm { try { - if (toolStripStatusLabel1.Text != "已连接") //如果 MQTT 没连接,就不允许上传。 + if (toolStripStatusLabel3.Text != "已连接") //如果 MQTT 没连接,就不允许上传。 { MessageBox.Show("请先连接MQTT网关!"); return; @@ -635,7 +635,7 @@ namespace YiDa_WinForm InitDailyRodCheckTimes(); // ========== 修改:如果网关已连接,重启早晚固定检查定时器 ========== - if (toolStripStatusLabel1.Text == "已连接") + if (toolStripStatusLabel3.Text == "已连接") { StartDailyRodFixedTimers(); } @@ -838,7 +838,7 @@ namespace YiDa_WinForm // 2. 使用静态标记 _isRodImageUploaded 判断是否报警 if (!_isRodImageUploaded) { - string alarmContent = $"连杆测试超时未上传图片!当前时间:{now:yyyy-MM-dd HH:mm:ss},配置间隔:{_lastStrengthInterval}分钟"; + string alarmContent = $"连杆测试超时未上传图片!
当前时间:{now:yyyy-MM-dd HH:mm:ss}"; this.Invoke(new Action(() => SendDingDingAlarm(alarmContent, true))); } else @@ -870,7 +870,7 @@ namespace YiDa_WinForm // 2. 使用静态标记 _isScrapImageUploaded 判断是否报警(核心:上传成功则不报警) if (!_isScrapImageUploaded) { - string alarmContent = $"报废上传超时未上传凭证!当前时间:{now:yyyy-MM-dd HH:mm:ss},配置间隔:{_lastScrapInterval}分钟"; + string alarmContent = $"报废上传超时未上传凭证!
当前时间:{now:yyyy-MM-dd HH:mm:ss}"; this.Invoke(new Action(() => SendDingDingAlarm(alarmContent, false))); } else @@ -890,8 +890,8 @@ namespace YiDa_WinForm { LogHelper.AppendLog($"【钉钉报警】{(isRodAlarm ? "连杆" : "报废")}:{alarmContent}"); await _uploadService.SendDingDingTextAlarmAsync(alarmContent, isRodAlarm); - MessageBox.Show($"已发送钉钉{(isRodAlarm ? "连杆" : "报废")}报警:{alarmContent}", "报警提示", MessageBoxButtons.OK, - MessageBoxIcon.Warning); + // MessageBox.Show($"已发送钉钉{(isRodAlarm ? "连杆" : "报废")}报警:{alarmContent}", "报警提示", MessageBoxButtons.OK, + // MessageBoxIcon.Warning); } catch (Exception ex) { @@ -1091,7 +1091,7 @@ namespace YiDa_WinForm if (!_isMorningRodUploaded) { DateTime now = DateTime.Now; - string morningAlarmContent = $"【早上连杆强制上传报警】当前时间{now:yyyy-MM-dd HH:mm:ss},已超过工作开始后30分钟({_morningCheckTime:hh\\:mm}),未上传连杆测试图片!"; + string morningAlarmContent = $"【早上连杆强制上传报警】
当前时间{now:yyyy-MM-dd HH:mm:ss},
已超过工作开始后30分钟({_morningCheckTime:hh\\:mm}),
未上传连杆测试图片!"; this.Invoke(new Action(() => SendDingDingAlarm(morningAlarmContent, true))); } else @@ -1114,7 +1114,7 @@ namespace YiDa_WinForm if (!_isEveningRodUploaded) { DateTime now = DateTime.Now; - string eveningAlarmContent = $"【晚上连杆强制上传报警】当前时间{now:yyyy-MM-dd HH:mm:ss},已超过工作结束前30分钟({_eveningCheckTime:hh\\:mm}),未上传连杆测试图片!"; + string eveningAlarmContent = $"【晚上连杆强制上传报警】
当前时间{now:yyyy-MM-dd HH:mm:ss},
已超过工作结束前30分钟({_eveningCheckTime:hh\\:mm}),
未上传连杆测试图片!"; this.Invoke(new Action(() => SendDingDingAlarm(eveningAlarmContent, true))); } else @@ -1359,7 +1359,7 @@ namespace YiDa_WinForm { return string.Equals(value?.ToString(), "无错误", StringComparison.Ordinal) ? "合格" : "不合格"; } - else if (paramName == "开模总数实时" || paramName == "托模次数" || paramName == "报废图片") + else if (paramName == "开模总数实时" || paramName == "托模次数" || paramName == "报废图片" || paramName == "连杆测试") { return "合格"; } @@ -1435,5 +1435,10 @@ namespace YiDa_WinForm private void label6_Click(object sender, EventArgs e) { } + + private void toolStripStatusLabel3_Click(object sender, EventArgs e) + { + + } } } \ No newline at end of file diff --git a/YiDa_WinForm/Form/MainForm.resx b/YiDa_WinForm/Form/MainForm.resx index 4bbdc6c..8f558a7 100644 --- a/YiDa_WinForm/Form/MainForm.resx +++ b/YiDa_WinForm/Form/MainForm.resx @@ -126,6 +126,9 @@ 17, 93 + + 170, 131 + 100, 93 diff --git a/YiDa_WinForm/Service/YiDaUploadService.cs b/YiDa_WinForm/Service/YiDaUploadService.cs index 35f6037..1714a7d 100644 --- a/YiDa_WinForm/Service/YiDaUploadService.cs +++ b/YiDa_WinForm/Service/YiDaUploadService.cs @@ -388,14 +388,14 @@ namespace YiDa_WinForm.Service // 5. 构造报警消息(区分连杆/报废) string alarmTitle = isRodAlarm ? "连杆测试报警" : "报废上传报警"; - string alarmDesc = isRodAlarm ? "未上传图片" : "未上传报废凭证"; + string alarmDesc = isRodAlarm ? "未及时提供强度测试图片" : "未及时提供报废图片"; var msg = new { msgtype = "markdown", markdown = new { title = alarmTitle, - text = $"## {alarmTitle}\n\n> 报警时间:{ymdhms}\n\n> 报警内容:{alarmContent}\n\n> 状态:{alarmDesc}" + text = $"## **{alarmTitle}**
报警内容:{alarmContent}" } }; diff --git a/YiDa_WinForm/bin/Debug/YiDa_WinForm.exe b/YiDa_WinForm/bin/Debug/YiDa_WinForm.exe index 4c794fa..c04c9d2 100644 Binary files a/YiDa_WinForm/bin/Debug/YiDa_WinForm.exe and b/YiDa_WinForm/bin/Debug/YiDa_WinForm.exe differ diff --git a/YiDa_WinForm/bin/Debug/YiDa_WinForm.pdb b/YiDa_WinForm/bin/Debug/YiDa_WinForm.pdb index 9886446..581d265 100644 Binary files a/YiDa_WinForm/bin/Debug/YiDa_WinForm.pdb and b/YiDa_WinForm/bin/Debug/YiDa_WinForm.pdb differ