change - 主界面添加操作日志

master
wenjy 9 months ago
parent 4e1f2bfedc
commit 006ee68fcb

@ -403,7 +403,6 @@ namespace ZJ_BYD
{
Program.siemensS7Net.Write(M20.Address, ushort.Parse("2"));
}
}
catch (Exception ex)
{

193
Main.Designer.cs generated

@ -36,9 +36,16 @@ namespace ZJ_BYD
this.sysLogo = new DevExpress.XtraEditors.PictureEdit();
this.lblLineName = new DevExpress.XtraEditors.LabelControl();
this.tablePanel1 = new DevExpress.Utils.Layout.TablePanel();
this.sopPanelControl = new DevExpress.XtraEditors.PanelControl();
this.splitContainerControl1 = new DevExpress.XtraEditors.SplitContainerControl();
this.xtraTabControl1 = new DevExpress.XtraTab.XtraTabControl();
this.xtraTabPage1 = new DevExpress.XtraTab.XtraTabPage();
this.txtLog = new DevExpress.XtraEditors.MemoEdit();
this.stationpanel = new DevExpress.Utils.Layout.StackPanel();
this.panelControl3 = new DevExpress.XtraEditors.PanelControl();
this.stackPanel5 = new DevExpress.Utils.Layout.StackPanel();
this.txtSubCode = new DevExpress.XtraEditors.LabelControl();
this.stackPanel4 = new DevExpress.Utils.Layout.StackPanel();
this.txtProductCode = new DevExpress.XtraEditors.LabelControl();
this.stackPanel3 = new DevExpress.Utils.Layout.StackPanel();
this.machineTypeControl = new DevExpress.XtraEditors.LabelControl();
this.stackPanel2 = new DevExpress.Utils.Layout.StackPanel();
@ -54,19 +61,27 @@ namespace ZJ_BYD
this.Result = new DevExpress.XtraGrid.Columns.GridColumn();
this.labelControl1 = new DevExpress.XtraEditors.LabelControl();
this.lbldatetime = new DevExpress.XtraEditors.LabelControl();
this.stackPanel4 = new DevExpress.Utils.Layout.StackPanel();
this.txtProductCode = new DevExpress.XtraEditors.LabelControl();
this.stackPanel5 = new DevExpress.Utils.Layout.StackPanel();
this.txtSubCode = new DevExpress.XtraEditors.LabelControl();
((System.ComponentModel.ISupportInitialize)(this.panelControl1)).BeginInit();
this.panelControl1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.sysLogo.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.tablePanel1)).BeginInit();
this.tablePanel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.sopPanelControl)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.splitContainerControl1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.splitContainerControl1.Panel1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.splitContainerControl1.Panel2)).BeginInit();
this.splitContainerControl1.Panel2.SuspendLayout();
this.splitContainerControl1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.xtraTabControl1)).BeginInit();
this.xtraTabControl1.SuspendLayout();
this.xtraTabPage1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.txtLog.Properties)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.stationpanel)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.panelControl3)).BeginInit();
this.panelControl3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.stackPanel5)).BeginInit();
this.stackPanel5.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.stackPanel4)).BeginInit();
this.stackPanel4.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.stackPanel3)).BeginInit();
this.stackPanel3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.stackPanel2)).BeginInit();
@ -75,10 +90,6 @@ namespace ZJ_BYD
this.stackPanel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.gridTestInfo)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.gridView1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.stackPanel4)).BeginInit();
this.stackPanel4.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.stackPanel5)).BeginInit();
this.stackPanel5.SuspendLayout();
this.SuspendLayout();
//
// panelControl1
@ -161,7 +172,7 @@ namespace ZJ_BYD
this.tablePanel1.Columns.AddRange(new DevExpress.Utils.Layout.TablePanelColumn[] {
new DevExpress.Utils.Layout.TablePanelColumn(DevExpress.Utils.Layout.TablePanelEntityStyle.Relative, 18.74F),
new DevExpress.Utils.Layout.TablePanelColumn(DevExpress.Utils.Layout.TablePanelEntityStyle.Relative, 58.62F)});
this.tablePanel1.Controls.Add(this.sopPanelControl);
this.tablePanel1.Controls.Add(this.splitContainerControl1);
this.tablePanel1.Controls.Add(this.stationpanel);
this.tablePanel1.Controls.Add(this.panelControl3);
this.tablePanel1.Controls.Add(this.lbldatetime);
@ -175,15 +186,52 @@ namespace ZJ_BYD
this.tablePanel1.Size = new System.Drawing.Size(1044, 973);
this.tablePanel1.TabIndex = 5;
//
// sopPanelControl
// splitContainerControl1
//
this.tablePanel1.SetColumn(this.splitContainerControl1, 1);
this.splitContainerControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainerControl1.Horizontal = false;
this.splitContainerControl1.Location = new System.Drawing.Point(256, 53);
this.splitContainerControl1.Name = "splitContainerControl1";
//
// splitContainerControl1.Panel1
//
this.splitContainerControl1.Panel1.Text = "Panel1";
//
// splitContainerControl1.Panel2
//
this.splitContainerControl1.Panel2.Controls.Add(this.xtraTabControl1);
this.splitContainerControl1.Panel2.Text = "Panel2";
this.tablePanel1.SetRow(this.splitContainerControl1, 1);
this.splitContainerControl1.Size = new System.Drawing.Size(785, 917);
this.splitContainerControl1.SplitterPosition = 763;
this.splitContainerControl1.TabIndex = 9;
//
// xtraTabControl1
//
this.xtraTabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.xtraTabControl1.Location = new System.Drawing.Point(0, 0);
this.xtraTabControl1.Name = "xtraTabControl1";
this.xtraTabControl1.SelectedTabPage = this.xtraTabPage1;
this.xtraTabControl1.Size = new System.Drawing.Size(785, 144);
this.xtraTabControl1.TabIndex = 0;
this.xtraTabControl1.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[] {
this.xtraTabPage1});
//
this.tablePanel1.SetColumn(this.sopPanelControl, 1);
this.sopPanelControl.Dock = System.Windows.Forms.DockStyle.Fill;
this.sopPanelControl.Location = new System.Drawing.Point(256, 53);
this.sopPanelControl.Name = "sopPanelControl";
this.tablePanel1.SetRow(this.sopPanelControl, 1);
this.sopPanelControl.Size = new System.Drawing.Size(785, 917);
this.sopPanelControl.TabIndex = 9;
// xtraTabPage1
//
this.xtraTabPage1.Controls.Add(this.txtLog);
this.xtraTabPage1.Name = "xtraTabPage1";
this.xtraTabPage1.Size = new System.Drawing.Size(783, 118);
this.xtraTabPage1.Text = "操作记录";
//
// txtLog
//
this.txtLog.Dock = System.Windows.Forms.DockStyle.Fill;
this.txtLog.Location = new System.Drawing.Point(0, 0);
this.txtLog.Name = "txtLog";
this.txtLog.Size = new System.Drawing.Size(783, 118);
this.txtLog.TabIndex = 0;
//
// stationpanel
//
@ -213,6 +261,46 @@ namespace ZJ_BYD
this.panelControl3.Size = new System.Drawing.Size(305, 919);
this.panelControl3.TabIndex = 6;
//
// stackPanel5
//
this.stackPanel5.Controls.Add(this.txtSubCode);
this.stackPanel5.Location = new System.Drawing.Point(3, 738);
this.stackPanel5.Name = "stackPanel5";
this.stackPanel5.Size = new System.Drawing.Size(296, 51);
this.stackPanel5.TabIndex = 4;
//
// txtSubCode
//
this.txtSubCode.Appearance.Font = new System.Drawing.Font("Tahoma", 15F);
this.txtSubCode.Appearance.ForeColor = System.Drawing.Color.White;
this.txtSubCode.Appearance.Options.UseFont = true;
this.txtSubCode.Appearance.Options.UseForeColor = true;
this.txtSubCode.Location = new System.Drawing.Point(3, 13);
this.txtSubCode.Name = "txtSubCode";
this.txtSubCode.Size = new System.Drawing.Size(100, 24);
this.txtSubCode.TabIndex = 0;
this.txtSubCode.Text = "组件条码:";
//
// stackPanel4
//
this.stackPanel4.Controls.Add(this.txtProductCode);
this.stackPanel4.Location = new System.Drawing.Point(3, 681);
this.stackPanel4.Name = "stackPanel4";
this.stackPanel4.Size = new System.Drawing.Size(296, 51);
this.stackPanel4.TabIndex = 4;
//
// txtProductCode
//
this.txtProductCode.Appearance.Font = new System.Drawing.Font("Tahoma", 15F);
this.txtProductCode.Appearance.ForeColor = System.Drawing.Color.White;
this.txtProductCode.Appearance.Options.UseFont = true;
this.txtProductCode.Appearance.Options.UseForeColor = true;
this.txtProductCode.Location = new System.Drawing.Point(3, 13);
this.txtProductCode.Name = "txtProductCode";
this.txtProductCode.Size = new System.Drawing.Size(80, 24);
this.txtProductCode.TabIndex = 0;
this.txtProductCode.Text = "主条码:";
//
// stackPanel3
//
this.stackPanel3.Controls.Add(this.machineTypeControl);
@ -514,46 +602,6 @@ namespace ZJ_BYD
this.lbldatetime.TabIndex = 4;
this.lbldatetime.Text = "2022-03-16 00:00:00";
//
// stackPanel4
//
this.stackPanel4.Controls.Add(this.txtProductCode);
this.stackPanel4.Location = new System.Drawing.Point(3, 681);
this.stackPanel4.Name = "stackPanel4";
this.stackPanel4.Size = new System.Drawing.Size(296, 51);
this.stackPanel4.TabIndex = 4;
//
// txtProductCode
//
this.txtProductCode.Appearance.Font = new System.Drawing.Font("Tahoma", 15F);
this.txtProductCode.Appearance.ForeColor = System.Drawing.Color.White;
this.txtProductCode.Appearance.Options.UseFont = true;
this.txtProductCode.Appearance.Options.UseForeColor = true;
this.txtProductCode.Location = new System.Drawing.Point(3, 13);
this.txtProductCode.Name = "txtProductCode";
this.txtProductCode.Size = new System.Drawing.Size(80, 24);
this.txtProductCode.TabIndex = 0;
this.txtProductCode.Text = "主条码:";
//
// stackPanel5
//
this.stackPanel5.Controls.Add(this.txtSubCode);
this.stackPanel5.Location = new System.Drawing.Point(3, 738);
this.stackPanel5.Name = "stackPanel5";
this.stackPanel5.Size = new System.Drawing.Size(296, 51);
this.stackPanel5.TabIndex = 4;
//
// txtSubCode
//
this.txtSubCode.Appearance.Font = new System.Drawing.Font("Tahoma", 15F);
this.txtSubCode.Appearance.ForeColor = System.Drawing.Color.White;
this.txtSubCode.Appearance.Options.UseFont = true;
this.txtSubCode.Appearance.Options.UseForeColor = true;
this.txtSubCode.Location = new System.Drawing.Point(3, 13);
this.txtSubCode.Name = "txtSubCode";
this.txtSubCode.Size = new System.Drawing.Size(100, 24);
this.txtSubCode.TabIndex = 0;
this.txtSubCode.Text = "组件条码:";
//
// Main
//
this.Appearance.BackColor = System.Drawing.Color.Transparent;
@ -577,10 +625,24 @@ namespace ZJ_BYD
((System.ComponentModel.ISupportInitialize)(this.tablePanel1)).EndInit();
this.tablePanel1.ResumeLayout(false);
this.tablePanel1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.sopPanelControl)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.splitContainerControl1.Panel1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.splitContainerControl1.Panel2)).EndInit();
this.splitContainerControl1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainerControl1)).EndInit();
this.splitContainerControl1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.xtraTabControl1)).EndInit();
this.xtraTabControl1.ResumeLayout(false);
this.xtraTabPage1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.txtLog.Properties)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.stationpanel)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.panelControl3)).EndInit();
this.panelControl3.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.stackPanel5)).EndInit();
this.stackPanel5.ResumeLayout(false);
this.stackPanel5.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.stackPanel4)).EndInit();
this.stackPanel4.ResumeLayout(false);
this.stackPanel4.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.stackPanel3)).EndInit();
this.stackPanel3.ResumeLayout(false);
this.stackPanel3.PerformLayout();
@ -590,12 +652,6 @@ namespace ZJ_BYD
this.stackPanel1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.gridTestInfo)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.gridView1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.stackPanel4)).EndInit();
this.stackPanel4.ResumeLayout(false);
this.stackPanel4.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.stackPanel5)).EndInit();
this.stackPanel5.ResumeLayout(false);
this.stackPanel5.PerformLayout();
this.ResumeLayout(false);
}
@ -623,12 +679,15 @@ namespace ZJ_BYD
private DevExpress.XtraEditors.SimpleButton btnSearchResult;
private DevExpress.XtraEditors.SimpleButton btnPassRate;
private DevExpress.XtraEditors.LabelControl lbldatetime;
private DevExpress.XtraEditors.PanelControl sopPanelControl;
private DevExpress.Utils.Layout.StackPanel stackPanel3;
private DevExpress.XtraEditors.LabelControl machineTypeControl;
private DevExpress.Utils.Layout.StackPanel stackPanel5;
private DevExpress.XtraEditors.LabelControl txtSubCode;
private DevExpress.Utils.Layout.StackPanel stackPanel4;
private DevExpress.XtraEditors.LabelControl txtProductCode;
private DevExpress.XtraEditors.SplitContainerControl splitContainerControl1;
private DevExpress.XtraTab.XtraTabControl xtraTabControl1;
private DevExpress.XtraTab.XtraTabPage xtraTabPage1;
private DevExpress.XtraEditors.MemoEdit txtLog;
}
}

@ -126,7 +126,7 @@ namespace ZJ_BYD
pdfViewer.Show();
pdfViewer.LoadDocument(pdfFiles.First());
pdfViewer.Dock = System.Windows.Forms.DockStyle.Fill;
this.sopPanelControl.Controls.Add(pdfViewer);
this.splitContainerControl1.Panel1.Controls.Add(pdfViewer);
return;
}
@ -139,7 +139,7 @@ namespace ZJ_BYD
}
imageSlider.Refresh();
imageSlider.Dock = System.Windows.Forms.DockStyle.Fill;
this.sopPanelControl.Controls.Add(imageSlider);
this.splitContainerControl1.Panel1.Controls.Add(imageSlider);
}
@ -227,31 +227,31 @@ namespace ZJ_BYD
{
try
{
//var object_txt = xtraTabPage1.Controls;
var object_txt = xtraTabPage1.Controls;
BeginInvoke(new Action(() =>
{
//foreach (var item in object_txt)
//{
// if (stationCode == Program.ActiveStatinCode)
// {
// if (((MemoEdit)item).Name == Program.ActiveStatinCode + "X6")
// {
// //txtLog.Visible = false;
// ((MemoEdit)item).Visible = true;
// UpdateMemo((MemoEdit)item, newValue.ToString());
// }
foreach (var item in object_txt)
{
if (stationCode == Program.ActiveStatinCode)
{
if (((MemoEdit)item).Name == Program.ActiveStatinCode + "X6")
{
txtLog.Visible = false;
((MemoEdit)item).Visible = true;
UpdateMemo((MemoEdit)item, newValue.ToString());
}
// }
// else
// {
// var hide_memo_ID = ((MemoEdit)item).Name.Replace("X6", "");
// if (hide_memo_ID == stationCode)
// {
// ((MemoEdit)item).Visible = false;
// UpdateMemo((MemoEdit)item, newValue.ToString());
// }
// }
//}
}
else
{
var hide_memo_ID = ((MemoEdit)item).Name.Replace("X6", "");
if (hide_memo_ID == stationCode)
{
((MemoEdit)item).Visible = false;
UpdateMemo((MemoEdit)item, newValue.ToString());
}
}
}
})
);
}
@ -276,20 +276,20 @@ namespace ZJ_BYD
{
try
{
//if (!ExtendMethod.BoolPing(Program.PlcIpAddress))
//{
if (!ExtendMethod.BoolPing(Program.PlcIpAddress))
{
//SetPlcStatusLbl(lblplcstatus, "PLC通讯状态异常", Color.Red);
// LogHelper.WriteLog($"PLC的IP地址{Program.PlcIpAddress}无法PING通请检查网络连接!");
// overWrite = true;
// continue;
//}
//if (Program.siemensS7Net == null)
//{
// LogHelper.WriteLog($"心跳监测时Program.siemensS7Net为空进行重连");
LogHelper.WriteLog($"PLC的IP地址{Program.PlcIpAddress}无法PING通请检查网络连接!");
overWrite = true;
continue;
}
if (Program.siemensS7Net == null)
{
LogHelper.WriteLog($"心跳监测时Program.siemensS7Net为空进行重连");
//SetPlcStatusLbl(lblplcstatus, "PLC通讯状态异常", Color.Red);
// overWrite = true;
// ConnectPLC();
//}
overWrite = true;
ConnectPLC();
}
if (heartPoints == null || heartPoints.Count <= 0)
{
@ -459,35 +459,38 @@ namespace ZJ_BYD
private void DoSomething_LogChanged(object newValue, string stationCode)
{
//var object_txt = xtraTabPage1.Controls;
var object_txt = xtraTabPage1.Controls;
if (this.IsHandleCreated)
{
BeginInvoke(new Action(() =>
{
//foreach (var item in object_txt)
//{
// if (stationCode == Program.ActiveStatinCode)
// {
foreach (var item in object_txt)
{
if (stationCode == Program.ActiveStatinCode)
{
//if (((MemoEdit)item).Name == Program.ActiveStatinCode + "X6")
//{
// //txtLog.Visible = false;
// txtLog.Visible = false;
// ((MemoEdit)item).Visible = true;
// UpdateMemo((MemoEdit)item, newValue.ToString());
//}
// }
// else
// {
// var hide_memo_ID = ((MemoEdit)item).Name.Replace("X6", "");
// if (hide_memo_ID == stationCode)
// {
// ((MemoEdit)item).Visible = false;
// UpdateMemo((MemoEdit)item, newValue.ToString());
// }
txtLog.Visible = false;
((MemoEdit)item).Visible = true;
UpdateMemo((MemoEdit)item, newValue.ToString());
// }
//}
}
else
{
var hide_memo_ID = ((MemoEdit)item).Name.Replace("X6", "");
if (hide_memo_ID == stationCode)
{
((MemoEdit)item).Visible = false;
UpdateMemo((MemoEdit)item, newValue.ToString());
}
}
}
}));
}
}
@ -880,8 +883,8 @@ namespace ZJ_BYD
BeginInvoke(new Action(() =>
{
var memoCon = ((MemoEdit)control);
//memoEdit最多显示500行每超过500就删除10行。
if (memoCon.Lines.Count() > 500)
//memoEdit最多显示100行每超过100就删除10行。
if (memoCon.Lines.Count() > 100)
{
string[] strs = memoCon.Lines;
ArrayList al = new ArrayList(strs);

Loading…
Cancel
Save