diff --git a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/.vs/ZTTMS_Manage_yibayiyi_20230320/FileContentIndex/5ab432cd-207f-4a01-a145-8651acca0d3a.vsidx b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/.vs/ZTTMS_Manage_yibayiyi_20230320/FileContentIndex/5ab432cd-207f-4a01-a145-8651acca0d3a.vsidx deleted file mode 100644 index ae7a24c..0000000 Binary files a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/.vs/ZTTMS_Manage_yibayiyi_20230320/FileContentIndex/5ab432cd-207f-4a01-a145-8651acca0d3a.vsidx and /dev/null differ diff --git a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/.vs/ZTTMS_Manage_yibayiyi_20230320/FileContentIndex/867c7e0a-c978-429c-a5ce-1b14d9849541.vsidx b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/.vs/ZTTMS_Manage_yibayiyi_20230320/FileContentIndex/867c7e0a-c978-429c-a5ce-1b14d9849541.vsidx deleted file mode 100644 index e488bb7..0000000 Binary files a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/.vs/ZTTMS_Manage_yibayiyi_20230320/FileContentIndex/867c7e0a-c978-429c-a5ce-1b14d9849541.vsidx and /dev/null differ diff --git a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/.vs/ZTTMS_Manage_yibayiyi_20230320/FileContentIndex/9bd19898-5595-465f-86b6-7af90bc19a6f.vsidx b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/.vs/ZTTMS_Manage_yibayiyi_20230320/FileContentIndex/9bd19898-5595-465f-86b6-7af90bc19a6f.vsidx new file mode 100644 index 0000000..20fa028 Binary files /dev/null and b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/.vs/ZTTMS_Manage_yibayiyi_20230320/FileContentIndex/9bd19898-5595-465f-86b6-7af90bc19a6f.vsidx differ diff --git a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/.vs/ZTTMS_Manage_yibayiyi_20230320/FileContentIndex/f3afd613-0c5d-4a14-8ff3-b99edeffee70.vsidx b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/.vs/ZTTMS_Manage_yibayiyi_20230320/FileContentIndex/f3afd613-0c5d-4a14-8ff3-b99edeffee70.vsidx new file mode 100644 index 0000000..e26ddc4 Binary files /dev/null and b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/.vs/ZTTMS_Manage_yibayiyi_20230320/FileContentIndex/f3afd613-0c5d-4a14-8ff3-b99edeffee70.vsidx differ diff --git a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/.vs/ZTTMS_Manage_yibayiyi_20230320/v17/.suo b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/.vs/ZTTMS_Manage_yibayiyi_20230320/v17/.suo index 265eb4c..bd58f07 100644 Binary files a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/.vs/ZTTMS_Manage_yibayiyi_20230320/v17/.suo and b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/.vs/ZTTMS_Manage_yibayiyi_20230320/v17/.suo differ diff --git a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/Snipaste_2023-08-31_14-14-49.png b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/Snipaste_2023-08-31_14-14-49.png new file mode 100644 index 0000000..ef15037 Binary files /dev/null and b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/Snipaste_2023-08-31_14-14-49.png differ diff --git a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/GDFLPortStateForm.Designer.cs b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/GDFLPortStateForm.Designer.cs index 6344f47..04fb9eb 100644 --- a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/GDFLPortStateForm.Designer.cs +++ b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/GDFLPortStateForm.Designer.cs @@ -233,6 +233,7 @@ this.txtCycle.Size = new System.Drawing.Size(181, 35); this.txtCycle.TabIndex = 2; this.txtCycle.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.txtCycle.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtCycle_KeyPress); // // label7 // diff --git a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/GDFLPortStateForm.cs b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/GDFLPortStateForm.cs index 35dea58..2a55ce9 100644 --- a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/GDFLPortStateForm.cs +++ b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/GDFLPortStateForm.cs @@ -598,5 +598,13 @@ namespace ZTTMS_Manage_yibayiyi_20230320 { RefreshData(); } + + private void txtCycle_KeyPress(object sender, KeyPressEventArgs e) + { + if (!(Char.IsNumber(e.KeyChar)) && e.KeyChar != (char)8) + { + e.Handled = true; + } + } } } diff --git a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/MainForm.Designer.cs b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/MainForm.Designer.cs index 63cbace..057377e 100644 --- a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/MainForm.Designer.cs +++ b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/MainForm.Designer.cs @@ -38,6 +38,7 @@ this.btnFileAcquisition = new System.Windows.Forms.Button(); this.btnDeviceGovern = new System.Windows.Forms.Button(); this.btnOther = new System.Windows.Forms.Button(); + this.pnlSubSetting = new System.Windows.Forms.Panel(); this.btnSetting = new System.Windows.Forms.Button(); this.pnlSubStatusInfoData = new System.Windows.Forms.Panel(); this.pnlSubPortState = new System.Windows.Forms.Panel(); @@ -115,8 +116,11 @@ this.timerRecordSWDataSS = new System.Windows.Forms.Timer(this.components); this.timerRecordHXDataSS = new System.Windows.Forms.Timer(this.components); this.timerSendNorth = new System.Windows.Forms.Timer(this.components); + this.btnSetting1 = new System.Windows.Forms.Button(); + this.btnSetting2 = new System.Windows.Forms.Button(); this.pnlSideMenu.SuspendLayout(); this.pnlSubOthers.SuspendLayout(); + this.pnlSubSetting.SuspendLayout(); this.pnlSubStatusInfoData.SuspendLayout(); this.pnlSubPortState.SuspendLayout(); this.pnlSubOutputStateData.SuspendLayout(); @@ -143,6 +147,7 @@ this.pnlSideMenu.Controls.Add(this.btnRealTimeData); this.pnlSideMenu.Controls.Add(this.pnlSubOthers); this.pnlSideMenu.Controls.Add(this.btnOther); + this.pnlSideMenu.Controls.Add(this.pnlSubSetting); this.pnlSideMenu.Controls.Add(this.btnSetting); this.pnlSideMenu.Controls.Add(this.pnlSubStatusInfoData); this.pnlSideMenu.Controls.Add(this.btnStatusInfoData); @@ -171,7 +176,7 @@ this.btnRealTimeData.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnRealTimeData.Font = new System.Drawing.Font("方正楷体简体", 24F); this.btnRealTimeData.ForeColor = System.Drawing.SystemColors.ButtonHighlight; - this.btnRealTimeData.Location = new System.Drawing.Point(0, 2729); + this.btnRealTimeData.Location = new System.Drawing.Point(0, 2869); this.btnRealTimeData.Name = "btnRealTimeData"; this.btnRealTimeData.Padding = new System.Windows.Forms.Padding(20, 0, 0, 0); this.btnRealTimeData.Size = new System.Drawing.Size(325, 70); @@ -186,7 +191,7 @@ this.pnlSubOthers.Controls.Add(this.btnFileAcquisition); this.pnlSubOthers.Controls.Add(this.btnDeviceGovern); this.pnlSubOthers.Dock = System.Windows.Forms.DockStyle.Top; - this.pnlSubOthers.Location = new System.Drawing.Point(0, 2729); + this.pnlSubOthers.Location = new System.Drawing.Point(0, 2869); this.pnlSubOthers.Name = "pnlSubOthers"; this.pnlSubOthers.Size = new System.Drawing.Size(325, 0); this.pnlSubOthers.TabIndex = 14; @@ -233,7 +238,7 @@ this.btnOther.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnOther.Font = new System.Drawing.Font("方正楷体简体", 24F); this.btnOther.ForeColor = System.Drawing.SystemColors.ButtonHighlight; - this.btnOther.Location = new System.Drawing.Point(0, 2659); + this.btnOther.Location = new System.Drawing.Point(0, 2799); this.btnOther.Name = "btnOther"; this.btnOther.Padding = new System.Windows.Forms.Padding(20, 0, 0, 0); this.btnOther.Size = new System.Drawing.Size(325, 70); @@ -243,6 +248,17 @@ this.btnOther.UseVisualStyleBackColor = false; this.btnOther.Click += new System.EventHandler(this.btnOther_Click); // + // pnlSubSetting + // + this.pnlSubSetting.Controls.Add(this.btnSetting2); + this.pnlSubSetting.Controls.Add(this.btnSetting1); + this.pnlSubSetting.Dock = System.Windows.Forms.DockStyle.Top; + this.pnlSubSetting.Location = new System.Drawing.Point(0, 2659); + this.pnlSubSetting.Name = "pnlSubSetting"; + this.pnlSubSetting.Size = new System.Drawing.Size(325, 140); + this.pnlSubSetting.TabIndex = 20; + this.pnlSubSetting.VisibleChanged += new System.EventHandler(this.pnlSubSetting_VisibleChanged); + // // btnSetting // this.btnSetting.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(118)))), ((int)(((byte)(141)))), ((int)(((byte)(157))))); @@ -1236,6 +1252,40 @@ // this.timerSendNorth.Tick += new System.EventHandler(this.timerSendNorth_Tick); // + // btnSetting1 + // + this.btnSetting1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(118)))), ((int)(((byte)(141)))), ((int)(((byte)(157))))); + this.btnSetting1.Dock = System.Windows.Forms.DockStyle.Top; + this.btnSetting1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnSetting1.Font = new System.Drawing.Font("方正楷体简体", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnSetting1.ForeColor = System.Drawing.SystemColors.ControlLightLight; + this.btnSetting1.Location = new System.Drawing.Point(0, 0); + this.btnSetting1.Name = "btnSetting1"; + this.btnSetting1.Padding = new System.Windows.Forms.Padding(60, 0, 0, 0); + this.btnSetting1.Size = new System.Drawing.Size(325, 70); + this.btnSetting1.TabIndex = 14; + this.btnSetting1.Text = "继电控制1"; + this.btnSetting1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.btnSetting1.UseVisualStyleBackColor = false; + this.btnSetting1.Click += new System.EventHandler(this.btnSetting1_Click); + // + // btnSetting2 + // + this.btnSetting2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(118)))), ((int)(((byte)(141)))), ((int)(((byte)(157))))); + this.btnSetting2.Dock = System.Windows.Forms.DockStyle.Top; + this.btnSetting2.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnSetting2.Font = new System.Drawing.Font("方正楷体简体", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnSetting2.ForeColor = System.Drawing.SystemColors.ControlLightLight; + this.btnSetting2.Location = new System.Drawing.Point(0, 70); + this.btnSetting2.Name = "btnSetting2"; + this.btnSetting2.Padding = new System.Windows.Forms.Padding(60, 0, 0, 0); + this.btnSetting2.Size = new System.Drawing.Size(325, 70); + this.btnSetting2.TabIndex = 15; + this.btnSetting2.Text = "继电控制2"; + this.btnSetting2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.btnSetting2.UseVisualStyleBackColor = false; + this.btnSetting2.Click += new System.EventHandler(this.btnSetting2_Click); + // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -1260,6 +1310,7 @@ this.Resize += new System.EventHandler(this.MainForm_Resize); this.pnlSideMenu.ResumeLayout(false); this.pnlSubOthers.ResumeLayout(false); + this.pnlSubSetting.ResumeLayout(false); this.pnlSubStatusInfoData.ResumeLayout(false); this.pnlSubPortState.ResumeLayout(false); this.pnlSubOutputStateData.ResumeLayout(false); @@ -1367,6 +1418,9 @@ private System.Windows.Forms.Timer timerRecordSWDataSS; private System.Windows.Forms.Timer timerRecordHXDataSS; private System.Windows.Forms.Timer timerSendNorth; + private System.Windows.Forms.Panel pnlSubSetting; + private System.Windows.Forms.Button btnSetting2; + private System.Windows.Forms.Button btnSetting1; } } diff --git a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/MainForm.cs b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/MainForm.cs index 904b0a4..67a897a 100644 --- a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/MainForm.cs +++ b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/MainForm.cs @@ -1,5 +1,6 @@ using Cairo; using Coldairarrow.Util; +using Emgu.CV.OCR; using FFmpeg.AutoGen; using Google.Protobuf.WellKnownTypes; using Gst; @@ -38,6 +39,7 @@ using Windows.Globalization.DateTimeFormatting; using Windows.Storage.Streams; using Windows.UI.Xaml.Automation; using ZTTMS_Manage_yibayiyi_20230320; +using static org.apache.zookeeper.ZooKeeper; using static System.Windows.Forms.AxHost; using static ZTTMS_Manage_yibayiyi_20230320.CloseBoxForm; using static ZTTMS_Manage_yibayiyi_20230320.ItfN; @@ -203,16 +205,15 @@ namespace ZTTMS_Manage_yibayiyi_20230320 public static VideoRecordForm videoRecordForm = new VideoRecordForm(); public static CamAndVidCurrentDataForm camAndVidCurrentDataForm = new CamAndVidCurrentDataForm(); public static CavityEnvironDataForm cavityEnvironDataForm = new CavityEnvironDataForm(); - //public static VideoForm videoForm = new VideoForm(); PictureSearchForm pictureSearchForm = new PictureSearchForm(); VideoSearchForm videoSearchForm = new VideoSearchForm(); public static PictureTakeForm pictureTakeForm = new PictureTakeForm(); WorkStatusInfoDataForm workStatusInfoDataForm = new WorkStatusInfoDataForm(); + public static RelayControlForm relayControlForm = new RelayControlForm(); public static OutputStatusInfoDataForm outputStatusInfoDataForm = new OutputStatusInfoDataForm(); public static OtherSettingForm otherSettingForm = new OtherSettingForm(); PhotoelectricSeparationDataForm photoelectricSeparationDataForm = new PhotoelectricSeparationDataForm(); public static OutputPortStateData outputPortStateData = new OutputPortStateData(); - //LoadingForm loadingForm = new LoadingForm(); #region 定时器设置 @@ -453,17 +454,17 @@ namespace ZTTMS_Manage_yibayiyi_20230320 EveryDayLog.WriteOther("定时器(删除本地二十日以外的视频文件)已开启!"); Console.WriteLine("定时器(删除本地二十日以外的视频文件)已开启!"); - //timerRecordHXDataSS.Enabled = true; - //timerRecordHXDataSS.Interval = 60 * 1000; - //timerRecordHXDataSS.Start(); - //EveryDayLog.WriteOther("定时器(生成化学数据记录实时)已开启!"); - //Console.WriteLine("定时器(生成化学数据记录实时)已开启!"); + ////timerRecordHXDataSS.Enabled = true; + ////timerRecordHXDataSS.Interval = 60 * 1000; + ////timerRecordHXDataSS.Start(); + ////EveryDayLog.WriteOther("定时器(生成化学数据记录实时)已开启!"); + ////Console.WriteLine("定时器(生成化学数据记录实时)已开启!"); - //timerRecordSWDataSS.Enabled = true; - //timerRecordSWDataSS.Interval = 20 * 1000; - //timerRecordSWDataSS.Start(); - //EveryDayLog.WriteOther("定时器(生成水文数据记录实时)已开启!"); - //Console.WriteLine("定时器(生成水文数据记录实时)已开启!"); + ////timerRecordSWDataSS.Enabled = true; + ////timerRecordSWDataSS.Interval = 20 * 1000; + ////timerRecordSWDataSS.Start(); + ////EveryDayLog.WriteOther("定时器(生成水文数据记录实时)已开启!"); + ////Console.WriteLine("定时器(生成水文数据记录实时)已开启!"); timerRecordDataMinute.Enabled = true; timerRecordDataMinute.Interval = 60 * 1000; @@ -483,25 +484,25 @@ namespace ZTTMS_Manage_yibayiyi_20230320 EveryDayLog.WriteOther("定时器(生成化学数据记录小时级)已开启!"); Console.WriteLine("定时器(生成化学数据记录小时级)已开启!"); - timerSendNorth.Enabled = true; - timerSendNorth.Interval = 60 * 1000; - timerSendNorth.Start(); - EveryDayLog.WriteOther("定时器(常规水下设备信息上报)已开启!"); - Console.WriteLine("定时器(常规水下设备信息上报)已开启!"); + //timerSendNorth.Enabled = true; + //timerSendNorth.Interval = 60 * 1000; + //timerSendNorth.Start(); + //EveryDayLog.WriteOther("定时器(常规水下设备信息上报)已开启!"); + //Console.WriteLine("定时器(常规水下设备信息上报)已开启!"); - //var watch = Stopwatch.StartNew(); - //SendNorth(); - //watch.Stop(); + ////var watch = Stopwatch.StartNew(); + ////SendNorth(); + ////watch.Stop(); - // Print the execution time in milliseconds - // by using the property elapsed milliseconds - //Console.WriteLine(" The Execution time of the program is " + watch.ElapsedMilliseconds.ToString() + "ms"); + //// Print the execution time in milliseconds + //// by using the property elapsed milliseconds + ////Console.WriteLine(" The Execution time of the program is " + watch.ElapsedMilliseconds.ToString() + "ms"); - //////定时器配置 - ////g_timerFileTransfer.Enabled = true; - ////g_timerFileTransfer.Interval = 20000; - ////g_timerFileTransfer.AutoReset = false; - ////g_timerFileTransfer.Elapsed += new System.Timers.ElapsedEventHandler(methodFileTransfer); + ////////定时器配置 + //////g_timerFileTransfer.Enabled = true; + //////g_timerFileTransfer.Interval = 20000; + //////g_timerFileTransfer.AutoReset = false; + //////g_timerFileTransfer.Elapsed += new System.Timers.ElapsedEventHandler(methodFileTransfer); timerCheckDeviceState.Enabled = true; timerCheckDeviceState.Interval = 10 * 1000; //10s判断一次所有设备是否使能 @@ -841,6 +842,7 @@ namespace ZTTMS_Manage_yibayiyi_20230320 pnlSubSensorData.Visible = false; pnlSubStatusInfoData.Visible = false; pnlSubOthers.Visible = false; + pnlSubSetting.Visible = false; pnlSubCamera.Visible = false; pnlSubVideo.Visible = false; pnlSubImageProcess.Visible = false; @@ -927,11 +929,6 @@ namespace ZTTMS_Manage_yibayiyi_20230320 btnRealTimeData.Text = "▷ 实时数据"; } - if (btnSetting.Text == "▶ 设置") - { - btnSetting.Text = "▷ 设置"; - } - if (btnOther.Text == "▶ 设备管理") { btnOther.Text = "▷ 设备管理"; @@ -992,11 +989,6 @@ namespace ZTTMS_Manage_yibayiyi_20230320 btnRealTimeData.Text = "▷ 实时数据"; } - if (btnSetting.Text == "▶ 设置") - { - btnSetting.Text = "▷ 设置"; - } - if (btnOther.Text == "▶ 设备管理") { btnOther.Text = "▷ 设备管理"; @@ -1031,11 +1023,6 @@ namespace ZTTMS_Manage_yibayiyi_20230320 btnRealTimeData.Text = "▷ 实时数据"; } - if (btnSetting.Text == "▶ 设置") - { - btnSetting.Text = "▷ 设置"; - } - if (btnOther.Text == "▶ 设备管理") { btnOther.Text = "▷ 设备管理"; @@ -1070,36 +1057,20 @@ namespace ZTTMS_Manage_yibayiyi_20230320 btnRealTimeData.Text = "▷ 实时数据"; } - if (btnSetting.Text == "▶ 设置") - { - btnSetting.Text = "▷ 设置"; - } - if (btnOther.Text == "▶ 设备管理") { btnOther.Text = "▷ 设备管理"; } } - private void btnSetting_Click(object sender, EventArgs e) { OpenChildForm(otherSettingForm); + ShowSubMenu(pnlSubSetting); if (videoRecordForm.videoForm != null) videoRecordForm.videoForm.Visible = false; - HideSubMenu(); - - if (btnSetting.Text == "▷ 设置") - { - btnSetting.Text = "▶ 设置"; - } - else - { - btnSetting.Text = "▷ 设置"; - } - if (btnRealTimeData.Text == "▶ 实时数据") { btnRealTimeData.Text = "▷ 实时数据"; @@ -1110,6 +1081,7 @@ namespace ZTTMS_Manage_yibayiyi_20230320 btnOther.Text = "▷ 设备管理"; } + ChangeText(); ChangeTextSub(); } @@ -1126,11 +1098,6 @@ namespace ZTTMS_Manage_yibayiyi_20230320 btnRealTimeData.Text = "▷ 实时数据"; } - if (btnSetting.Text == "▶ 设置") - { - btnSetting.Text = "▷ 设置"; - } - if (btnOther.Text == "▶ 设备管理") { btnOther.Text = "▷ 设备管理"; @@ -1162,11 +1129,6 @@ namespace ZTTMS_Manage_yibayiyi_20230320 btnRealTimeData.Text = "▷ 实时数据"; } - if (btnSetting.Text == "▶ 设置") - { - btnSetting.Text = "▷ 设置"; - } - if (btnOther.Text == "▶ 设备管理") { btnOther.Text = "▷ 设备管理"; @@ -1182,11 +1144,6 @@ namespace ZTTMS_Manage_yibayiyi_20230320 btnRealTimeData.Text = "▷ 实时数据"; } - if (btnSetting.Text == "▶ 设置") - { - btnSetting.Text = "▷ 设置"; - } - if (btnOther.Text == "▶ 设备管理") { btnOther.Text = "▷ 设备管理"; @@ -1808,942 +1765,837 @@ namespace ZTTMS_Manage_yibayiyi_20230320 { while (true) { - int k; - List data = new List(); - for (int ii = 0; ii < gDevConnSerialHandleBufLen; ii++) + try { - if (gDevConnSerialHandleBuf[ii].gDevConnectRecvHandleFlag == DevSerialRecvHandle.DevDataHandleFlag.HANDLING) + int k; + List data = new List(); + for (int ii = 0; ii < gDevConnSerialHandleBufLen; ii++) { - data.Clear(); - for (k = 0; k < gDevConnSerialHandleBuf[ii].gDevConnectRecvHandleCount; k++) + if (gDevConnSerialHandleBuf[ii].gDevConnectRecvHandleFlag == DevSerialRecvHandle.DevDataHandleFlag.HANDLING) { - data.Add(gDevConnSerialHandleBuf[ii].gDevConnectRecvHandleBuff[k]); - } - byte[] newDataTemp = data.ToArray(); - - gDevConnSerialHandleBuf[ii].gDevConnectRecvHandleCount = 0; - gDevConnSerialHandleBuf[ii].gDevConnectRecvHandleFlag = DevSerialRecvHandle.DevDataHandleFlag.IDILING; - - //Console.WriteLine("数据处理:" + BitConverter.ToString(newDataTemp)); - Others.dzReceiveTimes++; - - string sqlSerialNum; - string[] numb; - - #region 原始指令存储 - sqlTime = DateTime.Now; - sqlSerialNum = BitConverter.ToString(new byte[2] { newDataTemp[15], newDataTemp[16] }); - numb = sqlSerialNum.Split('-'); - sqlSerialNum = numb[0] + numb[1]; - int num = 0; - int cycleTime = 0; - while (cycleTime < 3) - { - sqlId = IdHelper.GetId(); - - string sql = $"insert into tb_stateinfo_original(id,record_time,equipment_type,equipment_id,version_number,serialnumber,code) " + - $"values('{sqlId}','{sqlTime}','{g_sqlTerminalEquipmentType}','{g_sqlTerminalEquipmentId}','{g_sqlVersionNumber}','{sqlSerialNum}','{BitConverter.ToString(newDataTemp)}');"; - try + data.Clear(); + for (k = 0; k < gDevConnSerialHandleBuf[ii].gDevConnectRecvHandleCount; k++) { - num = MySQL.ExecuteSql(sql); - } - catch (Exception ex) - { - Console.WriteLine("Insert StateInfo Original Data Error:" + ex.Message); - EveryDayLog.WriteErrorDZ("Insert StateInfo Original Data Error:" + ex.Message); + data.Add(gDevConnSerialHandleBuf[ii].gDevConnectRecvHandleBuff[k]); } + byte[] newDataTemp = data.ToArray(); - if (num > 0) - { - Console.WriteLine("Insert StateInfo Original Data Success!" + DateTime.Now); - break; - } - else - { - Console.WriteLine("Insert StateInfo Original Data Default, Please Reinsert!" + DateTime.Now); - EveryDayLog.WriteErrorDZ("Insert StateInfo Original Data Default, Please Reinsert!"); - } + gDevConnSerialHandleBuf[ii].gDevConnectRecvHandleCount = 0; + gDevConnSerialHandleBuf[ii].gDevConnectRecvHandleFlag = DevSerialRecvHandle.DevDataHandleFlag.IDILING; - cycleTime++; - Thread.Sleep(1); - } - #endregion + //Console.WriteLine("数据处理:" + BitConverter.ToString(newDataTemp)); + Others.dzReceiveTimes++; - //数据处理 - if (newDataTemp.Length > 18) - { - #region 转义 - int j = 0; - for (int i = 0; i < newDataTemp.Length; i++) + string sqlSerialNum; + string[] numb; + + #region 原始指令存储 + sqlTime = DateTime.Now; + sqlSerialNum = BitConverter.ToString(new byte[2] { newDataTemp[15], newDataTemp[16] }); + numb = sqlSerialNum.Split('-'); + sqlSerialNum = numb[0] + numb[1]; + int num = 0; + int cycleTime = 0; + while (cycleTime < 3) { - if (newDataTemp[i] == 0x7e && newDataTemp[i + 1] == 0x01) + sqlId = IdHelper.GetId(); + + string sql = $"insert into tb_stateinfo_original(id,record_time,equipment_type,equipment_id,version_number,serialnumber,code) " + + $"values('{sqlId}','{sqlTime}','{g_sqlTerminalEquipmentType}','{g_sqlTerminalEquipmentId}','{g_sqlVersionNumber}','{sqlSerialNum}','{BitConverter.ToString(newDataTemp)}');"; + try { - newDataTemp[j] = 0x7e; - i++; + num = MySQL.ExecuteSql(sql); } - else if (newDataTemp[i] == 0x7e && newDataTemp[i + 1] == 0x02) + catch (Exception ex) { - newDataTemp[j] = 0x7f; - i++; + Console.WriteLine("Insert StateInfo Original Data Error:" + ex.Message); + EveryDayLog.WriteErrorDZ("Insert StateInfo Original Data Error:" + ex.Message); + } + + if (num > 0) + { + Console.WriteLine("Insert StateInfo Original Data Success!" + DateTime.Now); + break; } else { - newDataTemp[j] = newDataTemp[i]; + Console.WriteLine("Insert StateInfo Original Data Default, Please Reinsert!" + DateTime.Now); + EveryDayLog.WriteErrorDZ("Insert StateInfo Original Data Default, Please Reinsert!"); } - j++; - } - - byte[] dataTemp = new byte[j]; - for (int i = 0; i < j; i++) - { - dataTemp[i] = newDataTemp[i]; + cycleTime++; + Thread.Sleep(1); } #endregion - byte newCheckCode; - g_checkBuffer.Clear(); - - //进行CRC校验,判断消息是否错误 - for (int i = 1; i < dataTemp.Length - 2; i++) + //数据处理 + if (newDataTemp.Length > 18) { - g_checkBuffer.Add(dataTemp[i]); - } - newCheckCode = Others.CRC(g_checkBuffer.ToArray()); - - //CRC校验通过 - if (newCheckCode == dataTemp[dataTemp.Length - 2] && dataTemp[3] == 0x00 && dataTemp[4] == 0x00 && dataTemp[5] == 0x00 && dataTemp[6] == 0xc9 && dataTemp[7] == 0x00 && dataTemp[8] == 0x00 && dataTemp[9] == 0x00 && dataTemp[10] == 0x01) - { - //终端通用应答 - if (dataTemp[1] == 0x00 && dataTemp[2] == 0x00) + #region 转义 + int j = 0; + for (int i = 0; i < newDataTemp.Length; i++) { - //平台设置线路供电 - if (dataTemp[19] == 0x81 && dataTemp[20] == 0x00) + if (newDataTemp[i] == 0x7e && newDataTemp[i + 1] == 0x01) { - g_terminalResult = dataTemp[21]; - Console.WriteLine("继电控制结果为:" + g_terminalResult + "/" + DateTime.Now); - EveryDayLog.WriteDZ("继电控制结果为:" + g_terminalResult); - - if (g_terminalResult != 0) - { - string sql = $"delete from tb_stateinfo_state where controlstate_re48!='' order by record_time desc limit 1;"; - - try - { - if (MySQL.ExecuteSql(sql) > 0) - { - Console.WriteLine("删除继电控制记录成功!"); - } - else - { - Console.WriteLine("删除继电控制记录失败!"); - } - } - catch (Exception ex) - { - Console.WriteLine(ex.Message); - } - } - - otherSettingForm.g_flagSetLine = true; - otherSettingForm.btnSetState.Enabled = true; - otherSettingForm.g_timerSetLine.Stop(); - - otherSettingForm.RefreshOpenCloseState(); + newDataTemp[j] = 0x7e; + i++; } - - //时间同步 - if (dataTemp[19] == 0x80 && dataTemp[20] == 0x02) + else if (newDataTemp[i] == 0x7e && newDataTemp[i + 1] == 0x02) { - g_terminalResult = dataTemp[21]; - Console.WriteLine("时间同步结果为:" + g_terminalResult + "/" + DateTime.Now); - EveryDayLog.WriteDZ("时间同步结果为:" + g_terminalResult); - - if (g_terminalResult != 0) - { - string sql = $"delete from tb_synctime where synctime!='' order by record_time desc limit 1;"; - - try - { - if (MySQL.ExecuteSql(sql) > 0) - { - Console.WriteLine("删除时间同步记录成功!"); - } - else - { - Console.WriteLine("删除时间同步记录失败!"); - } - } - catch (Exception ex) - { - Console.WriteLine(ex.Message); - } - } + newDataTemp[j] = 0x7f; + i++; } - - //平台请求数据 - if (dataTemp[19] == 0x80 && dataTemp[20] == 0x0b) - { - g_terminalResult = dataTemp[21]; //成功接收 - Console.WriteLine("请求数据结果为:" + g_terminalResult + "/" + DateTime.Now); - EveryDayLog.WriteDZ("上位机接收到请求数据应答,结果为:" + g_terminalResult); - } - - //平台请求终端重启 - if (dataTemp[19] == 0x80 && dataTemp[20] == 0x11) - { - g_terminalResult = dataTemp[21]; //成功接收 - otherSettingForm.g_flagRequestRestart = true; - otherSettingForm.btnRestart.Enabled = true; - otherSettingForm.g_timerRequestRestart.Stop(); - Console.WriteLine("终端重启结果为:" + g_terminalResult + "/" + DateTime.Now); - EveryDayLog.WriteDZ("上位机接收到终端重启应答,结果为:" + g_terminalResult); - } - - //平台请求文件 - if (dataTemp[19] == 0x80 && dataTemp[20] == 0x0e) - { - if (dataTemp[21] == 0x00) - { - g_terminalResult = 0; //成功接收 - fileAcquisitionForm.g_flagRequestTerminalFile = true; - fileAcquisitionForm.lblError.Text = "您选择日期的文件操作成功!"; - fileAcquisitionForm.btnUpgrade.Enabled = true; - fileAcquisitionForm.g_timerRequestTerminalFile.Stop(); - - receiveFileNumber = 0; - } - else if (dataTemp[21] == 0x01) - { - g_terminalResult = 1; - fileAcquisitionForm.g_flagRequestTerminalFile = true; - fileAcquisitionForm.btnUpgrade.Enabled = true; - fileAcquisitionForm.g_timerRequestTerminalFile.Stop(); - } - else if (dataTemp[21] == 0x02) - { - g_terminalResult = 2; - fileAcquisitionForm.g_flagRequestTerminalFile = true; - fileAcquisitionForm.lblError.Text = "您选择的日期无该文件,请重新选择!"; - fileAcquisitionForm.btnUpgrade.Enabled = true; - fileAcquisitionForm.g_timerRequestTerminalFile.Stop(); - } - else if (dataTemp[21] == 0x03) - { - g_terminalResult = 3; - fileAcquisitionForm.g_flagRequestTerminalFile = true; - fileAcquisitionForm.btnUpgrade.Enabled = true; - fileAcquisitionForm.g_timerRequestTerminalFile.Stop(); - } - Console.WriteLine("请求文件结果为:" + g_terminalResult + "/" + DateTime.Now); - EveryDayLog.WriteDZ("上位机接收到请求文件应答,结果为:" + g_terminalResult); - } - - #region RemoteUpgrade - ////平台请求远程升级 - //if (dataTemp[19] == 0x80 && dataTemp[20] == 0x0d) - //{ - // if (dataTemp[21] == 0x00) - // { - // g_terminalResult = 0; //成功接收 - // remoteUpgradeForm.g_flagRequestRemoteUpgrade = true; - // remoteUpgradeForm.g_timerRequestRemoteUpgrade.Stop(); - // g_fileTransferTime = 1; - // //发送升级程序 - // TransferFile(); - // } - // else if (dataTemp[21] == 0x01) - // { - // g_terminalResult = 1; - // remoteUpgradeForm.g_flagRequestRemoteUpgrade = true; - // remoteUpgradeForm.btnUpgrade.Enabled = true; - // remoteUpgradeForm.g_timerRequestRemoteUpgrade.Stop(); - // } - // else if (dataTemp[21] == 0x02) - // { - // g_terminalResult = 2; - // remoteUpgradeForm.g_flagRequestRemoteUpgrade = true; - // remoteUpgradeForm.btnUpgrade.Enabled = true; - // remoteUpgradeForm.g_timerRequestRemoteUpgrade.Stop(); - // } - // else if (dataTemp[21] == 0x03) - // { - // g_terminalResult = 3; - // remoteUpgradeForm.g_flagRequestRemoteUpgrade = true; - // remoteUpgradeForm.btnUpgrade.Enabled = true; - // remoteUpgradeForm.g_timerRequestRemoteUpgrade.Stop(); - // } - // Console.WriteLine("请求远程升级结果为:" + g_terminalResult + "/" + DateTime.Now); - //} - - - ////升级程序传输 - //if (dataTemp[19] == 0x80 && dataTemp[20] == 0x05) - //{ - // if (dataTemp[21] == 0x00) - // { - // g_terminalResult = 0; //成功接收 - // g_flagFileTransfer = true; - // g_timerFileTransfer.Stop(); - // //判断是否为最后一个文件,否则继续传输下一个文件 - // if (g_currentFileNum != g_fileNum) - // { - // //发送升级程序 - // TransferFile(); - // } - // else - // { - // remoteUpgradeForm.btnUpgrade.Enabled = true; - // } - - // g_retransmission = 0; - // } - // else if (dataTemp[21] == 0x01) - // { - // g_terminalResult = 1; - // g_flagFileTransfer = true; - // g_timerFileTransfer.Stop(); - - // //Console.WriteLine("升级程序传输出错,请重新升级!"); - // MessageBoxForm messageBoxForm = new MessageBoxForm(); - // messageBoxForm.strType = "警告"; - // messageBoxForm.strMessage = "升级程序传输出错,请重新升级!"; - // OpenMessageForm(messageBoxForm); - - // remoteUpgradeForm.btnUpgrade.Enabled = true; - // g_fileTransferTime = 1; - // } - // else if (dataTemp[21] == 0x02) - // { - // g_terminalResult = 2; - // g_flagFileTransfer = true; - // g_timerFileTransfer.Stop(); - - // if (g_retransmission == 2) - // { - // g_fileTransferTime = 1; - // //MessageBox.Show("远程升级失败,请重新请求升级!"); - // MessageBoxForm messageBoxForm = new MessageBoxForm(); - // messageBoxForm.strType = "警告"; - // messageBoxForm.strMessage = "远程升级失败,请重新请求升级!"; - // OpenMessageForm(messageBoxForm); - - // remoteUpgradeForm.btnUpgrade.Enabled = true; - // } - - // //判断是否为最后一个文件,否则继续传输下一个文件 - // if (g_currentFileNum != g_fileNum) - // { - // //发送升级程序 - // TransferFile(); - // } - // else - // { - // remoteUpgradeForm.btnUpgrade.Enabled = true; - // } - - // g_retransmission = 2; - // } - // else if (dataTemp[21] == 0x03) - // { - // g_terminalResult = 3; - // g_flagFileTransfer = true; - // g_timerFileTransfer.Stop(); - - // //Console.WriteLine("升级程序传输出错,请重新升级!"); - // MessageBoxForm messageBoxForm = new MessageBoxForm(); - // messageBoxForm.strType = "警告"; - // messageBoxForm.strMessage = "升级程序传输出错,请重新升级!"; - // OpenMessageForm(messageBoxForm); - - // remoteUpgradeForm.btnUpgrade.Enabled = true; - // g_fileTransferTime = 1; - // } - // Console.WriteLine("平台请求终端文件结果为:" + g_terminalResult + "/" + DateTime.Now); - //} - #endregion - - } - - else if (dataTemp[1] == 0x00 && dataTemp[2] == 0x01) - { - //Console.WriteLine("接收到心跳数据!"); - Others.dzReceiveTimes--; - - heartTimes++; - } - - //接收时间同步 - else if (dataTemp[1] == 0x00 && dataTemp[2] == 0x02) - { - Others.g_messageId[0] = 0x80; - Others.g_messageId[1] = 0x02; - - //消息体流水号 - byte[] messageBodySerialNumbeReturnSyncTime = new byte[2]; - messageBodySerialNumbeReturnSyncTime[0] = (byte)((g_serialSyncTime & 0xFF00) >> 8); - messageBodySerialNumbeReturnSyncTime[1] = (byte)((g_serialSyncTime & 0x00FF)); - - //消息体 - g_sqlSyncTime = Convert.ToInt64(DateTime.Now.ToString("yyyyMMddHHmmss")); - ulong datetime = (ulong)g_sqlSyncTime; - byte[] time = new byte[8]; - time[0] = (byte)((byte)(datetime >> 56) & 0xff); - time[1] = (byte)((byte)(datetime >> 48) & 0xff); - time[2] = (byte)((byte)(datetime >> 40) & 0xff); - time[3] = (byte)((byte)(datetime >> 32) & 0xff); - time[4] = (byte)((byte)(datetime >> 24) & 0xff); - time[5] = (byte)((byte)(datetime >> 16) & 0xff); - time[6] = (byte)((byte)(datetime >> 8) & 0xff); - time[7] = (byte)((byte)datetime & 0xff); - - //消息体属性 - ushort datalen = (ushort)(time.Length); - Others.g_messageBodyProperty = Others.Property(datalen); - - //校验码 - g_crc8CheckBuffer.Clear(); - g_crc8CheckBuffer.Clear(); - g_crc8CheckBuffer.AddRange(Others.g_messageId); - g_crc8CheckBuffer.AddRange(Others.g_terminalEquipmentType); - g_crc8CheckBuffer.AddRange(Others.g_terminalEquipmentId); - g_crc8CheckBuffer.AddRange(Others.g_messageBodyProperty); - g_crc8CheckBuffer.AddRange(Others.g_versionNumber); - g_crc8CheckBuffer.AddRange(messageBodySerialNumbeReturnSyncTime); - g_crc8CheckBuffer.AddRange(time); - g_checkCode = Others.CRC(g_crc8CheckBuffer.ToArray()); - - List buffer = Others.Transform(g_crc8CheckBuffer, g_checkCode, Others.g_flagBit); - - try - { - if (Others.g_flagReceive == true) - { - //通过IP地址找到对应的Socket - //Others.g_dicSocket[Others.g_ip].Send(buffer.ToArray()); - Others.g_socketSend.Send(buffer.ToArray()); - - Console.WriteLine(BitConverter.ToString(buffer.ToArray())); - EveryDayLog.WriteDZ("上位机进行时间同步操作,指令为:" + BitConverter.ToString(buffer.ToArray())); - - //流水号+1 - g_serialSyncTime++; - } - else - { - Console.WriteLine("连接已断开!"); - } - } - catch (Exception ex) - { - Console.WriteLine("ReturnSyncTimeError:" + ex.ToString()); - EveryDayLog.WriteDZ("上位机进行时间同步操作失败,错误信息为:" + ex.Message); - EveryDayLog.WriteErrorDZ("上位机进行时间同步操作失败,错误信息为:" + ex.Message); - - Others.g_socketSend.Close(); - //Others.g_dicSocket.Remove(Others.g_ip); - Others.g_flagReceive = false; - //Console.WriteLine("ReturnSyncTimeError:" + Others.g_ip + "\r" + DateTime.Now); - CallInvokeUIUpdate("UpdatelblState", "连接断开"); - } - - //数据库插入 - g_sqlRecordTime = DateTime.Now; - g_sqlDeviceName = "时间同步"; - sqlSerialNum = BitConverter.ToString(new byte[2] { dataTemp[15], dataTemp[16] }); - numb = sqlSerialNum.Split('-'); - sqlSerialNum = numb[0] + numb[1]; - cycleTime = 0; - - while (cycleTime < 3) - { - string sqlId = IdHelper.GetId(); - num = 0; - - string sql = $"insert into tb_synctime(id,record_time,equipment_type,equipment_id,version_number,serialnumber,synctime) values('{sqlId}','{g_sqlRecordTime}','{g_sqlTerminalEquipmentType}','{g_sqlTerminalEquipmentId}','{g_sqlVersionNumber}','{sqlSerialNum}','{g_sqlSyncTime}');"; - try - { - num = MySQL.ExecuteSql(sql); - } - catch (Exception ex) - { - Console.WriteLine("InsertSyncTimeError:" + ex.ToString()); - EveryDayLog.WriteErrorDZ("InsertSyncTimeError:" + ex.ToString()); - } - - if (num > 0) - { - Console.WriteLine("平台服务器时间插入成功!" + DateTime.Now); - break; - } - else - { - Console.WriteLine("平台服务器时间插入失败,重新进行插入!" + DateTime.Now); - EveryDayLog.WriteErrorDZ("平台服务器时间插入失败,重新进行插入!"); - } - - cycleTime++; - Thread.Sleep(1); - } - } - - //接收电子腔工作状态信息 - else if (dataTemp[1] == 0x01 && dataTemp[2] == 0x00) - { - Others.dzReceiveStateTimes++; - - workStatusInfoDataForm.g_flagRequestWorkData = true; - workStatusInfoDataForm.btnGetNewInfo.Enabled = true; - workStatusInfoDataForm.g_timerRequestWorkData.Stop(); - - if (Others.requestData[0] == true) - { - Others.receiveData[0] = true; - } - - g_sqlDeviceName = "电子腔工作状态"; - - byte number = dataTemp[17]; - - //数据解析 - float inputVoltage = (dataTemp[18] == 0xff && dataTemp[19] == 0xff && dataTemp[20] == 0xff && dataTemp[21] == 0xff) ? 0f : BitConverter.ToSingle(new byte[] { dataTemp[21], dataTemp[20], dataTemp[19], dataTemp[18] }, 0) / 1000f * 201f; - float inputCurrent = (dataTemp[22] == 0xff && dataTemp[23] == 0xff && dataTemp[24] == 0xff && dataTemp[25] == 0xff) ? 0f : BitConverter.ToSingle(new byte[] { dataTemp[25], dataTemp[24], dataTemp[23], dataTemp[22] }, 0) / 1000f; - inputCurrent = 2.5f * (2.5f - inputCurrent); - //inputCurrent = (inputCurrent - 0.333f <= 0) ? 0 : (inputCurrent - 0.333f); - float outputVoltage48 = (dataTemp[26] == 0xff && dataTemp[27] == 0xff && dataTemp[28] == 0xff && dataTemp[29] == 0xff) ? 0f : BitConverter.ToSingle(new byte[] { dataTemp[29], dataTemp[28], dataTemp[27], dataTemp[26] }, 0) / 1000f * 21; - float outputCurrent48 = (dataTemp[30] == 0xff && dataTemp[31] == 0xff && dataTemp[32] == 0xff && dataTemp[33] == 0xff) ? 0f : BitConverter.ToSingle(new byte[] { dataTemp[33], dataTemp[32], dataTemp[31], dataTemp[30] }, 0) / 1000f; - outputCurrent48 = 5f * (2.5f - outputCurrent48); - outputCurrent48 = (outputCurrent48 - 0.333f <= 0) ? 0 : (outputCurrent48 - 0.333f); - float outputVoltage24 = (dataTemp[34] == 0xff && dataTemp[35] == 0xff && dataTemp[36] == 0xff && dataTemp[37] == 0xff) ? 0f : BitConverter.ToSingle(new byte[] { dataTemp[37], dataTemp[36], dataTemp[35], dataTemp[34] }, 0) / 1000f * 11; - float outputCurrent24 = (dataTemp[38] == 0xff && dataTemp[39] == 0xff && dataTemp[40] == 0xff && dataTemp[41] == 0xff) ? 0f : BitConverter.ToSingle(new byte[] { dataTemp[41], dataTemp[40], dataTemp[39], dataTemp[38] }, 0) / 1000f; - outputCurrent24 = 5f * (2.5f - outputCurrent24); - outputCurrent24 = (outputCurrent24 - 0.333f <= 0) ? 0 : (outputCurrent24 - 0.333f); - float outputVoltage12 = (dataTemp[42] == 0xff && dataTemp[43] == 0xff && dataTemp[44] == 0xff && dataTemp[45] == 0xff) ? 0f : BitConverter.ToSingle(new byte[] { dataTemp[45], dataTemp[44], dataTemp[43], dataTemp[42] }, 0) / 1000f * 6; - float outputCurrent12 = (dataTemp[46] == 0xff && dataTemp[47] == 0xff && dataTemp[48] == 0xff && dataTemp[49] == 0xff) ? 0f : BitConverter.ToSingle(new byte[] { dataTemp[49], dataTemp[48], dataTemp[47], dataTemp[46] }, 0) / 1000f; - outputCurrent12 = 5f * (2.5f - outputCurrent12); - outputCurrent12 = (outputCurrent12 - 0.333f <= 0) ? 0 : (outputCurrent12 - 0.333f); - float inputGround375 = (dataTemp[50] == 0xff && dataTemp[51] == 0xff && dataTemp[52] == 0xff && dataTemp[53] == 0xff) ? 0f : BitConverter.ToSingle(new byte[] { dataTemp[53], dataTemp[52], dataTemp[51], dataTemp[50] }, 0); - float inputGround48 = (dataTemp[54] == 0xff && dataTemp[55] == 0xff && dataTemp[56] == 0xff && dataTemp[57] == 0xff) ? 0f : BitConverter.ToSingle(new byte[] { dataTemp[57], dataTemp[56], dataTemp[55], dataTemp[54] }, 0); - float inputGround24 = (dataTemp[58] == 0xff && dataTemp[59] == 0xff && dataTemp[60] == 0xff && dataTemp[61] == 0xff) ? 0f : BitConverter.ToSingle(new byte[] { dataTemp[61], dataTemp[60], dataTemp[59], dataTemp[58] }, 0); - float inputGround12 = (dataTemp[62] == 0xff && dataTemp[63] == 0xff && dataTemp[64] == 0xff && dataTemp[65] == 0xff) ? 0f : BitConverter.ToSingle(new byte[] { dataTemp[65], dataTemp[64], dataTemp[63], dataTemp[62] }, 0); - float temperature = (dataTemp[66] == 0xff && dataTemp[67] == 0xff && dataTemp[68] == 0xff && dataTemp[69] == 0xff) ? 0f : BitConverter.ToSingle(new byte[] { dataTemp[69], dataTemp[68], dataTemp[67], dataTemp[66] }, 0); - float pitch = (dataTemp[70] == 0xff && dataTemp[71] == 0xff && dataTemp[72] == 0xff && dataTemp[73] == 0xff) ? 0f : BitConverter.ToSingle(new byte[] { dataTemp[73], dataTemp[72], dataTemp[71], dataTemp[70] }, 0); - float roll = (dataTemp[74] == 0xff && dataTemp[75] == 0xff && dataTemp[76] == 0xff && dataTemp[77] == 0xff) ? 0f : BitConverter.ToSingle(new byte[] { dataTemp[77], dataTemp[76], dataTemp[75], dataTemp[74] }, 0); - float yaw = (dataTemp[78] == 0xff && dataTemp[79] == 0xff && dataTemp[80] == 0xff && dataTemp[81] == 0xff) ? 0f : BitConverter.ToSingle(new byte[] { dataTemp[81], dataTemp[80], dataTemp[79], dataTemp[78] }, 0); - float humidity = (dataTemp[82] == 0xff && dataTemp[83] == 0xff && dataTemp[84] == 0xff && dataTemp[85] == 0xff) ? 0f : BitConverter.ToSingle(new byte[] { dataTemp[85], dataTemp[84], dataTemp[83], dataTemp[82] }, 0); - float leak1 = (dataTemp[86] == 0xff && dataTemp[87] == 0xff && dataTemp[88] == 0xff && dataTemp[89] == 0xff) ? 0f : BitConverter.ToSingle(new byte[] { dataTemp[89], dataTemp[88], dataTemp[87], dataTemp[86] }, 0); - float leak2 = (dataTemp[90] == 0xff && dataTemp[91] == 0xff && dataTemp[92] == 0xff && dataTemp[93] == 0xff) ? 0f : BitConverter.ToSingle(new byte[] { dataTemp[93], dataTemp[92], dataTemp[91], dataTemp[90] }, 0); - string leak = ""; //leak2为实际所接漏水,但存储在leak1字段 - if (leak2 > 100f) - leak = "漏水"; else - leak = "未漏水"; - - uint pressure = (dataTemp[94] == 0xff && dataTemp[95] == 0xff && dataTemp[96] == 0xff && dataTemp[97] == 0xff) ? 0 : BitConverter.ToUInt32(new byte[] { dataTemp[97], dataTemp[96], dataTemp[95], dataTemp[94] }, 0); - - string groundState375 = ""; - //if (dataTemp[98] == 0x00) - //{ - groundState375 = "正常"; - //} - //else if (dataTemp[98] == 0x01) - //{ - // groundState375 = "负极接地电阻异常"; - //} - //else if (dataTemp[98] == 0x02) - //{ - // groundState375 = "正极接地电阻异常"; - //} - - string groundState48 = ""; - //if (dataTemp[99] == 0x00) - //{ - groundState48 = "正常"; - //} - //else if (dataTemp[99] == 0x01) - //{ - // groundState48 = "负极接地电阻异常"; - //} - //else if (dataTemp[99] == 0x02) - //{ - // groundState48 = "正极接地电阻异常"; - //} - - string groundState24 = ""; - //if (dataTemp[100] == 0x00) - //{ - groundState24 = "正常"; - //} - //else if (dataTemp[100] == 0x01) - //{ - // groundState24 = "负极接地电阻异常"; - //} - //else if (dataTemp[100] == 0x02) - //{ - // groundState24 = "正极接地电阻异常"; - //} - - string groundState12 = ""; - //if (dataTemp[101] == 0x00) - //{ - groundState12 = "正常"; - //} - //else if (dataTemp[101] == 0x01) - //{ - // groundState12 = "负极接地电阻异常"; - //} - //else if (dataTemp[101] == 0x02) - //{ - // groundState12 = "正极接地电阻异常"; - //} - - //string output = "输入电压:" + inputVoltage + "\r" + "输入电流:" + inputCurrent + "\r" + "48V输出电压:" + outputVoltage48 - // + "\r" + "48V输出电流:" + outputCurrent48 + "\r" + "24V输出电压:" + outputVoltage24 + "\r" + "24V输出电流:" + outputCurrent24 + "\r" + - // "12V输出电压:" + outputVoltage12 + "\r" + "12V输出电流:" + outputCurrent12 + "\r" + "375V输入接地绝缘值:" + inputGround375 + "\r" + "375V输入接地绝缘状态:" + groundState375 - // + "\r" + "48V输入接地绝缘值:" + inputGround48 + "\r" + "48V输入接地绝缘状态:" + groundState48 + "\r" + "24V输入接地绝缘值:" + inputGround24 + "\r" + "24V输入接地绝缘状态:" + groundState24 + "\r" + "12V输入接地绝缘值:" - // + inputGround12 + "\r" + "12V输入接地绝缘状态:" + groundState12 + "\r" + "温度:" + temperature + "\r" + "X轴角度:" + pitch + "\r" + "Y轴角度:" + roll + "\r" + "Z轴角度:" - // + yaw + "\r" + "内部湿度:" + humidity + "\r" + "漏水1:" + leak1 + "\r" + "漏水2:" + leak2 + "\r" + "内部气压:" + pressure; - //Console.WriteLine(output); - - #region 数据存储 - string message = "通信正常"; - - //数据存储 - g_sqlRecordTime = DateTime.Now; - sqlSerialNum = BitConverter.ToString(new byte[2] { dataTemp[15], dataTemp[16] }); - numb = sqlSerialNum.Split('-'); - sqlSerialNum = numb[0] + numb[1]; - cycleTime = 0; - - while (cycleTime < 3) { - string sqlId = IdHelper.GetId(); - num = 0; - - string sql = $"insert into tb_workstateinfo_data(id,record_time,equipment_type,equipment_id,version_number,serialnumber,number,voltage," + - $"current,voltage48,current48,voltage24,current24,voltage12,current12,ground_state375,ground_state48," + - $"ground_state24,ground_state12,temp,pitch,roll,yaw,humidity,leak1,leak2,pressure,error_code) " + - $"values('{sqlId}','{g_sqlRecordTime}','{g_sqlTerminalEquipmentType}','{g_sqlTerminalEquipmentId}','{g_sqlVersionNumber}','{sqlSerialNum}','{number}',FORMAT('{inputVoltage}',2)," + - $"FORMAT('{inputCurrent}',2),FORMAT('{outputVoltage48}',2),FORMAT('{outputCurrent48}',2),FORMAT('{outputVoltage24}',2),FORMAT('{outputCurrent24}',2),FORMAT('{outputVoltage12}',2),FORMAT('{outputCurrent12}',2)," + - $"'{groundState375}'," + - $"'{groundState48}','{groundState24}','{groundState12}',FORMAT('{temperature}',2),FORMAT('{pitch}',2),FORMAT('{roll}',2),FORMAT('{yaw}',2)," + - $"FORMAT('{humidity}',2),'{leak}','{leak2}','{pressure}','{message}');"; - try - { - num = MySQL.ExecuteSql(sql); - } - catch (Exception ex) - { - Console.WriteLine("WorkStatusInformationError:" + ex.ToString()); - EveryDayLog.WriteErrorDZ("WorkStatusInformationError:" + ex.ToString()); - } - - if (num > 0) - { - Console.WriteLine("电子腔工作状态信息插入成功!" + DateTime.Now); - break; - } - else - { - Console.WriteLine("电子腔工作状态信息插入失败,重新进行插入!" + DateTime.Now); - EveryDayLog.WriteErrorDZ("电子腔工作状态信息插入失败,重新进行插入!"); - } - - cycleTime++; - Thread.Sleep(1); + newDataTemp[j] = newDataTemp[i]; } - #endregion - - //平台通用应答 - TerminalAnswerVic(new byte[2] { dataTemp[1], dataTemp[2] }, new byte[2] { dataTemp[15], dataTemp[16] }); - - - #region 异常数据 - ////数据异常 - //if (inputVoltage < Limit.DZInputVoltageMin || inputVoltage > Limit.DZInputVoltageMax || inputCurrent < Limit.DZInputCurrentMin || inputCurrent > Limit.DZInputCurrentMax || - // outputVoltage48 < Limit.DZOutputVoltage48Min || outputVoltage48 > Limit.DZOutputVoltage48Max || outputCurrent48 < Limit.DZOutputCurrent48Min || outputCurrent48 > Limit.DZOutputCurrent48Max || - // outputVoltage24 < Limit.DZOutputVoltage24Min || outputVoltage24 > Limit.DZOutputVoltage24Max || outputCurrent24 < Limit.DZOutputCurrent24Min || outputCurrent24 > Limit.DZOutputCurrent24Max || - // outputVoltage12 < Limit.DZOutputVoltage12Min || outputVoltage12 > Limit.DZOutputVoltage12Max || outputCurrent12 < Limit.DZOutputCurrent12Min || outputCurrent12 > Limit.DZOutputCurrent12Max || - // temperature < Limit.DZTemperatureMin || temperature > Limit.DZTemperatureMax || pitch < Limit.DZGestureXMin || pitch > Limit.DZGestureXMax || - // roll < Limit.DZGestureYMin || roll > Limit.DZGestureYMax || yaw < Limit.DZGestureZMin || yaw > Limit.DZGestureZMax|| - // humidityLimit.DZHumidityMax|| leak2Limit.DZLeakMax|| - // pressureLimit.DZPressureMax) - //{ - // Others.dzReceiveStateAbnormalDataTimes++; - - // //数据存储 - // g_sqlRecordTime = DateTime.Now; - // sqlSerialNum = BitConverter.ToString(new byte[2] { dataTemp[15], dataTemp[16] }); - // numb = sqlSerialNum.Split('-'); - // sqlSerialNum = numb[0] + numb[1]; - // cycleTime = 0; - - // while (cycleTime < 3) - // { - // string sqlId = IdHelper.GetId(); - // num = 0; - - // string sql = $"insert into tb_workstateinfo_abnormaldata(id,record_time,equipment_type,equipment_id,version_number,serialnumber,number,voltage," + - // $"current,voltage48,current48,voltage24,current24,voltage12,current12,ground_state375,ground_state48," + - // $"ground_state24,ground_state12,temp,pitch,roll,yaw,humidity,leak1,leak2,pressure) " + - // $"values('{sqlId}','{g_sqlRecordTime}','{g_sqlTerminalEquipmentType}','{g_sqlTerminalEquipmentId}','{g_sqlVersionNumber}','{sqlSerialNum}','{number}',FORMAT('{inputVoltage}',2)," + - // $"FORMAT('{inputCurrent}',2),FORMAT('{outputVoltage48}',2),FORMAT('{outputCurrent48}',2),FORMAT('{outputVoltage24}',2),FORMAT('{outputCurrent24}',2),FORMAT('{outputVoltage12}',2),FORMAT('{outputCurrent12}',2)," + - // $"'{groundState375}','{groundState48}','{groundState24}','{groundState12}',FORMAT('{temperature}',2),FORMAT('{pitch}',2),FORMAT('{roll}',2),FORMAT('{yaw}',2)," + - // $"FORMAT('{humidity}',2),'{leak1}','{leak2}','{pressure}');"; - // try - // { - // num = MySQL.ExecuteSql(sql); - // } - // catch (Exception ex) - // { - // Console.WriteLine("WorkStatusAbnormalInformationError:" + ex.ToString()); - //EveryDayLog.WriteErrorDZ("WorkStatusAbnormalInformationError:" + ex.ToString()); - // } - - // if (num > 0) - // { - // Console.WriteLine("电子腔异常工作状态信息插入成功!" + DateTime.Now); - // break; - // } - // else - // { - // Console.WriteLine("电子腔异常工作状态信息插入失败,重新进行插入!" + DateTime.Now); - //EveryDayLog.WriteErrorDZ("电子腔异常工作状态信息插入失败,重新进行插入!"); - // } - - // cycleTime++; - // Thread.Sleep(1); - // } - - //} - #endregion + j++; } - //接收电子腔输出端口状态 - else if (dataTemp[1] == 0x01 && dataTemp[2] == 0x01) + byte[] dataTemp = new byte[j]; + for (int i = 0; i < j; i++) { - Others.dzReceiveStateTimes++; + dataTemp[i] = newDataTemp[i]; + } + #endregion - outputStatusInfoDataForm.g_flagRequestOutputData = true; - outputStatusInfoDataForm.btnGetNewInfo.Enabled = true; - outputPortStateData.btnGetNewInfo.Enabled = true; - outputStatusInfoDataForm.g_timerRequestOutputData.Stop(); + byte newCheckCode; + g_checkBuffer.Clear(); - if (Others.requestData[0] == true) + //进行CRC校验,判断消息是否错误 + for (int i = 1; i < dataTemp.Length - 2; i++) + { + g_checkBuffer.Add(dataTemp[i]); + } + newCheckCode = Others.CRC(g_checkBuffer.ToArray()); + + //CRC校验通过 + if (newCheckCode == dataTemp[dataTemp.Length - 2] && dataTemp[3] == 0x00 && dataTemp[4] == 0x00 && dataTemp[5] == 0x00 && dataTemp[6] == 0xc9 && dataTemp[7] == 0x00 && dataTemp[8] == 0x00 && dataTemp[9] == 0x00 && dataTemp[10] == 0x01) + { + //终端通用应答 + if (dataTemp[1] == 0x00 && dataTemp[2] == 0x00) { - Others.receiveData[0] = true; - } - - g_sqlDeviceName = "电子腔输出端口状态"; - - byte number = dataTemp[17]; - - //数据解析 - //float reOutputVoltage48 = BitConverter.ToSingle(new byte[] { dataTemp[21], dataTemp[20], dataTemp[19], dataTemp[18] }, 0) / 1000f; - float reOutputCurrent48 = BitConverter.ToSingle(new byte[] { dataTemp[25], dataTemp[24], dataTemp[23], dataTemp[22] }, 0) / 1000f; - reOutputCurrent48 = 5f * (2.5f - reOutputCurrent48); - reOutputCurrent48 = (Others.isRe48Work) ? reOutputCurrent48 : 0f; - byte rePortState48 = dataTemp[26]; - //float reOutputVoltage24 = BitConverter.ToSingle(new byte[] { dataTemp[30], dataTemp[29], dataTemp[28], dataTemp[27] }, 0) / 1000f; - float reOutputCurrent24 = BitConverter.ToSingle(new byte[] { dataTemp[34], dataTemp[33], dataTemp[32], dataTemp[31] }, 0) / 1000f; - reOutputCurrent24 = 5f * (2.5f - reOutputCurrent24); - reOutputCurrent24 = (Others.isRe24Work) ? reOutputCurrent24 : 0f; - byte rePortState24 = dataTemp[35]; - //float reOutputVoltage12 = BitConverter.ToSingle(new byte[] { dataTemp[39], dataTemp[38], dataTemp[37], dataTemp[36] }, 0) / 1000f; - float reOutputCurrent12 = BitConverter.ToSingle(new byte[] { dataTemp[43], dataTemp[42], dataTemp[41], dataTemp[40] }, 0) / 1000f; - reOutputCurrent12 = 5f * (2.5f - reOutputCurrent12); - reOutputCurrent12 = (Others.isRe12Work) ? reOutputCurrent12 : 0f; - byte rePortState12 = dataTemp[44]; - //float outputVoltageMulti = BitConverter.ToSingle(new byte[] { dataTemp[48], dataTemp[47], dataTemp[46], dataTemp[45] }, 0) / 1000f; - float outputCurrentMulti = BitConverter.ToSingle(new byte[] { dataTemp[52], dataTemp[51], dataTemp[50], dataTemp[49] }, 0) / 1000f; - outputCurrentMulti = 5f * (2.5f - outputCurrentMulti); - outputCurrentMulti = (Others.isEXO2Work) ? (tool.GetRandNum(20, 120) / 1000f) : 0f; - byte multiPortState = dataTemp[53]; - //float outputVoltageCTD = BitConverter.ToSingle(new byte[] { dataTemp[57], dataTemp[56], dataTemp[55], dataTemp[54] }, 0) / 1000f; - float outputCurrentCTD = BitConverter.ToSingle(new byte[] { dataTemp[61], dataTemp[60], dataTemp[59], dataTemp[58] }, 0) / 1000f; - outputCurrentCTD = 5f * (2.5f - outputCurrentCTD); - outputCurrentCTD = (Others.isCTDWork) ? (tool.GetRandNum(13, 18) / 1000f) : 0f; - byte ctdPortState = dataTemp[62]; - //float outputVoltageADCP = BitConverter.ToSingle(new byte[] { dataTemp[66], dataTemp[65], dataTemp[64], dataTemp[63] }, 0) / 1000f; - float outputCurrentADCP = BitConverter.ToSingle(new byte[] { dataTemp[70], dataTemp[69], dataTemp[68], dataTemp[67] }, 0) / 1000f; - outputCurrentADCP = 5f * (2.5f - outputCurrentADCP); - outputCurrentADCP = (Others.isADCPWork) ? (tool.GetRandNum(583, 643) / 1000f) : 0f; - byte adcpPortState = dataTemp[71]; - //float outputVoltageUV1 = BitConverter.ToSingle(new byte[] { dataTemp[75], dataTemp[74], dataTemp[73], dataTemp[72] }, 0) / 1000f; - float outputCurrentUV1 = BitConverter.ToSingle(new byte[] { dataTemp[79], dataTemp[78], dataTemp[77], dataTemp[76] }, 0) / 1000f; - outputCurrentUV1 = 5f * (2.5f - outputCurrentUV1); - outputCurrentUV1 = (Others.isUV1Work) ? outputCurrentUV1 : 0f; - byte uv1PortState = dataTemp[80]; - //float outputVoltageUV2 = BitConverter.ToSingle(new byte[] { dataTemp[84], dataTemp[83], dataTemp[82], dataTemp[81] }, 0) / 1000f; - float outputCurrentUV2 = BitConverter.ToSingle(new byte[] { dataTemp[88], dataTemp[87], dataTemp[86], dataTemp[85] }, 0) / 1000f; - outputCurrentUV2 = 5f * (2.5f - outputCurrentUV2); - outputCurrentUV2 = (Others.isUV2Work) ? outputCurrentUV2 : 0f; - byte uv2PortState = dataTemp[89]; - //float outputVoltageUV3 = BitConverter.ToSingle(new byte[] { dataTemp[93], dataTemp[92], dataTemp[91], dataTemp[90] }, 0) / 1000f; - float outputCurrentUV3 = BitConverter.ToSingle(new byte[] { dataTemp[97], dataTemp[96], dataTemp[95], dataTemp[94] }, 0) / 1000f; - outputCurrentUV3 = 5f * (2.5f - outputCurrentUV3); - outputCurrentUV3 = (Others.isUV3Work) ? outputCurrentUV3 : 0f; - byte uv3PortState = dataTemp[98]; - //float outputVoltageUV4 = BitConverter.ToSingle(new byte[] { dataTemp[102], dataTemp[101], dataTemp[100], dataTemp[99] }, 0) / 1000f; - float outputCurrentUV4 = BitConverter.ToSingle(new byte[] { dataTemp[106], dataTemp[105], dataTemp[104], dataTemp[103] }, 0) / 1000f; - outputCurrentUV4 = 5f * (2.5f - outputCurrentUV4); - outputCurrentUV4 = (Others.isUV4Work) ? outputCurrentUV4 : 0f; - byte uv4PortState = dataTemp[107]; - //float outputVoltageCO2 = BitConverter.ToSingle(new byte[] { dataTemp[111], dataTemp[110], dataTemp[109], dataTemp[108] }, 0) / 1000f; - float outputCurrentCO2 = BitConverter.ToSingle(new byte[] { dataTemp[115], dataTemp[114], dataTemp[113], dataTemp[112] }, 0) / 1000f; - outputCurrentCO2 = 5f * (2.5f - outputCurrentCO2); - outputCurrentCO2 = (Others.isCO2Work) ? (tool.GetRandNum(453, 513) / 1000f) : 0f; - byte co2PortState = dataTemp[116]; - float outputVoltageIma = BitConverter.ToSingle(new byte[] { dataTemp[120], dataTemp[119], dataTemp[118], dataTemp[117] }, 0) / 1000f * 11; - float outputCurrentIma = BitConverter.ToSingle(new byte[] { dataTemp[124], dataTemp[123], dataTemp[122], dataTemp[121] }, 0) / 1000f; - outputCurrentIma = 5f * (2.5f - outputCurrentIma); - byte imaPortState = dataTemp[125]; - - //string output = "48V预留端口输出电流:" + reOutputCurrent48 + "\r" + "48V预留端口工作状态:" + Others.StatusJudgment(rePortState48) - // + "\r" + "24V预留端口输出电流:" + reOutputCurrent24 + "\r" + "24V预留端口工作状态:" + Others.StatusJudgment(rePortState24) - // + "\r" + "12V预留端口输出电流:" + reOutputCurrent12 + "\r" + "12V预留端口工作状态:" + Others.StatusJudgment(rePortState12) - // + "\r" + "端口输出(多参数)电流:" + outputCurrentMulti + "\r" + "端口输出(多参数)工作状态:" + Others.StatusJudgment(multiPortState) - // + "\r" + "端口输出(CTD)电流:" + outputCurrentCTD + "\r" + "端口输出(CTD)工作状态:" + Others.StatusJudgment(ctdPortState) - // + "\r" + "端口输出(ADCP)电流:" + outputCurrentADCP + "\r" + "端口输出(ADCP)工作状态:" + Others.StatusJudgment(adcpPortState) - // + "\r" + "端口输出(UV灯1)电流:" + outputCurrentUV1 + "\r" + "端口输出(UV灯1)工作过状态:" + Others.StatusJudgment(uv1PortState) - // + "\r" + "端口输出(UV灯2)电流:" + outputCurrentUV2 + "\r" + "端口输出(UV灯2)工作过状态:" + Others.StatusJudgment(uv2PortState) - // + "\r" + "端口输出(UV灯3)电流:" + outputCurrentUV3 + "\r" + "端口输出(UV灯3)工作过状态:" + Others.StatusJudgment(uv3PortState) - // + "\r" + "端口输出(UV灯4)电流:" + outputCurrentUV4 + "\r" + "端口输出(UV灯4)工作过状态:" + Others.StatusJudgment(uv4PortState) - // + "\r" + "端口输出(CO2)电流:" + outputCurrentCO2 + "\r" + "端口输出(CO2)工作状态:" + Others.StatusJudgment(co2PortState) - // + "\r" + "端口输出(影像处理腔)电流:" + outputCurrentIma + "\r" + "端口输出(影像处理腔)工作状态:" + Others.StatusJudgment(imaPortState); - //Console.WriteLine(output); - - #region 数据存储 - //数据存储 - g_sqlRecordTime = DateTime.Now; - sqlSerialNum = BitConverter.ToString(new byte[2] { dataTemp[15], dataTemp[16] }); - numb = sqlSerialNum.Split('-'); - sqlSerialNum = numb[0] + numb[1]; - cycleTime = 0; - - while (cycleTime < 3) - { - string sqlId = IdHelper.GetId(); - num = 0; - - //string sql = $"insert into tb_outputstateinfo_data(id,record_time,equipment_type,equipment_id,version_number,serialnumber,number,revoltage48," + - // $"recurrent48,revoltage24,recurrent24,revoltage12,recurrent12,voltage_multi,current_multi,voltage_ctd,current_ctd,voltage_adcp," + - // $"current_adcp,voltage_uv1,current_uv1,voltage_uv2,current_uv2,voltage_uv3,current_uv3,voltage_uv4,current_uv4,voltage_co2,current_co2,camvidvoltage,camvidcurrent) " + - // $"values('{sqlId}','{g_sqlRecordTime}','{g_sqlTerminalEquipmentType}','{g_sqlTerminalEquipmentId}','{g_sqlVersionNumber}','{sqlSerialNum}','{number}',FORMAT('{reOutputVoltage48}',2)," + - // $"FORMAT('{reOutputCurrent48}',2),FORMAT('{reOutputVoltage24}',2),FORMAT('{reOutputCurrent24}',2),FORMAT('{reOutputVoltage12}',2),FORMAT('{reOutputCurrent12}',2),FORMAT('{outputVoltageMulti}',2)," + - // $"FORMAT('{outputCurrentMulti}',2),FORMAT('{outputVoltageCTD}',2)," + - // $"FORMAT('{outputCurrentCTD}',2),FORMAT('{outputVoltageADCP}',2),FORMAT('{outputCurrentADCP}',2),FORMAT('{outputVoltageUV1}',2),FORMAT('{outputCurrentUV1}',2),FORMAT('{outputVoltageUV2}',2),FORMAT('{outputCurrentUV2}',2)," + - // $"FORMAT('{outputVoltageUV3}',2),FORMAT('{outputCurrentUV3}',2)," + - // $"FORMAT('{outputVoltageUV4}',2),FORMAT('{outputCurrentUV4}',2),FORMAT('{outputVoltageCO2}',2),FORMAT('{outputCurrentCO2}',2),FORMAT('{outputVoltageIma}',2),FORMAT('{outputCurrentIma}',2));"; - - string sql = $"insert into tb_outputstateinfo_data(id,record_time,equipment_type,equipment_id,version_number,serialnumber,number," + - $"recurrent48,recurrent24,recurrent12,current_multi,current_ctd," + - $"current_adcp,current_uv1,current_uv2,current_uv3,current_uv4,current_co2,camvidvoltage) " + - $"values('{sqlId}','{g_sqlRecordTime}','{g_sqlTerminalEquipmentType}','{g_sqlTerminalEquipmentId}','{g_sqlVersionNumber}','{sqlSerialNum}','{number}'," + - $"FORMAT('{reOutputCurrent48}',2),FORMAT('{reOutputCurrent24}',2),FORMAT('{reOutputCurrent12}',2),FORMAT('{outputCurrentMulti}',2)," + - $"FORMAT('{outputCurrentCTD}',2),FORMAT('{outputCurrentADCP}',2),FORMAT('{outputCurrentUV1}',2),FORMAT('{outputCurrentUV2}',2)," + - $"FORMAT('{outputCurrentUV3}',2),FORMAT('{outputCurrentUV4}',2),FORMAT('{outputCurrentCO2}',2),FORMAT('{outputVoltageIma}',2));"; - - try + //平台设置线路供电 + if (dataTemp[19] == 0x81 && dataTemp[20] == 0x00) { - num = MySQL.ExecuteSql(sql); - } - catch (Exception ex) - { - Console.WriteLine("OutputStatusInformationError:" + ex.ToString()); - EveryDayLog.WriteErrorDZ("OutputStatusInformationError:" + ex.ToString()); - } + g_terminalResult = dataTemp[21]; + Console.WriteLine("继电控制结果为:" + g_terminalResult + "/" + DateTime.Now); + EveryDayLog.WriteDZ("继电控制结果为:" + g_terminalResult); - if (num > 0) - { - Console.WriteLine("电子腔输出端口状态信息插入成功!" + DateTime.Now); - break; - } - else - { - Console.WriteLine("电子腔输出端口状态信息插入失败,重新进行插入!" + DateTime.Now); - EveryDayLog.WriteErrorDZ("电子腔输出端口状态信息插入失败,重新进行插入!"); - } - - cycleTime++; - Thread.Sleep(1); - } - - string sql2; - g_sqlRecordTime = DateTime.Now; - cycleTime = 0; - - try - { - string sql1 = $"select * from tb_stateinfo_state order by record_time desc limit 1;"; - MySqlDataReader dataReader = MySQL.ExecuteReader(sql1); - if (dataReader.Read()) - { - while (cycleTime < 3) + //回复成功 + if (g_terminalResult == 0) { - sqlId = IdHelper.GetId(); - num = 0; + //修改控件的状态 + if (Others.allStates[0] == 0x00 && otherSettingForm.rdoOpenCTD.Checked) + otherSettingForm.rdoCloseCTD.Checked = true; + else if (Others.allStates[0] == 0x01 && otherSettingForm.rdoCloseCTD.Checked) + otherSettingForm.rdoOpenCTD.Checked = true; + if (Others.allStates[1] == 0x00 && otherSettingForm.rdoOpenMulti.Checked) + otherSettingForm.rdoCloseMulti.Checked = true; + else if (Others.allStates[1] == 0x01 && otherSettingForm.rdoCloseMulti.Checked) + otherSettingForm.rdoOpenMulti.Checked = true; + if (Others.allStates[2] == 0x00 && otherSettingForm.rdoOpenCO2.Checked) + otherSettingForm.rdoCloseCO2.Checked = true; + else if (Others.allStates[2] == 0x01 && otherSettingForm.rdoCloseCO2.Checked) + otherSettingForm.rdoOpenCO2.Checked = true; + if (Others.allStates[3] == 0x00 && otherSettingForm.rdoOpenADCP.Checked) + otherSettingForm.rdoCloseADCP.Checked = true; + else if (Others.allStates[3] == 0x01 && otherSettingForm.rdoCloseADCP.Checked) + otherSettingForm.rdoOpenADCP.Checked = true; + if (Others.allStates[4] == 0x00 && relayControlForm.rdoOpenUV1.Checked) + relayControlForm.rdoCloseUV1.Checked = true; + else if (Others.allStates[4] == 0x01 && relayControlForm.rdoCloseUV1.Checked) + relayControlForm.rdoOpenUV1.Checked = true; + if (Others.allStates[5] == 0x00 && relayControlForm.rdoOpenUV2.Checked) + relayControlForm.rdoCloseUV2.Checked = true; + else if (Others.allStates[5] == 0x01 && relayControlForm.rdoCloseUV2.Checked) + relayControlForm.rdoOpenUV2.Checked = true; + if (Others.allStates[6] == 0x00 && relayControlForm.rdoOpenUV3.Checked) + relayControlForm.rdoCloseUV3.Checked = true; + else if (Others.allStates[6] == 0x01 && relayControlForm.rdoCloseUV3.Checked) + relayControlForm.rdoOpenUV3.Checked = true; + if (Others.allStates[7] == 0x00 && relayControlForm.rdoOpenUV4.Checked) + relayControlForm.rdoCloseUV4.Checked = true; + else if (Others.allStates[7] == 0x01 && relayControlForm.rdoCloseUV4.Checked) + relayControlForm.rdoOpenUV4.Checked = true; + if (Others.allStates[8] == 0x00 && relayControlForm.rdoOpen48.Checked) + relayControlForm.rdoClose48.Checked = true; + else if (Others.allStates[8] == 0x01 && relayControlForm.rdoClose48.Checked) + relayControlForm.rdoOpen48.Checked = true; + if (Others.allStates[9] == 0x00 && relayControlForm.rdoOpen24.Checked) + relayControlForm.rdoClose24.Checked = true; + else if (Others.allStates[9] == 0x01 && relayControlForm.rdoClose24.Checked) + relayControlForm.rdoOpen24.Checked = true; + if (Others.allStates[10] == 0x00 && relayControlForm.rdoOpen12.Checked) + relayControlForm.rdoClose12.Checked = true; + else if (Others.allStates[10] == 0x01 && relayControlForm.rdoClose12.Checked) + relayControlForm.rdoOpen12.Checked = true; - sql2 = $"insert into tb_stateinfo_state(id,record_time,equipment_type,equipment_id,version_number,serialnumber,number,pathstate_re48,state_re48,pathstate_re24,state_re24,pathstate_re12,state_re12," + - $"pathstate_multi,state_multi,pathstate_ctd,state_ctd,pathstate_adcp,state_adcp,pathstate_uv1,state_uv1,pathstate_uv2,state_uv2,pathstate_uv3,state_uv3,pathstate_uv4,state_uv4,pathstate_co2,state_co2,pathstate_image,state_image) values('{sqlId}','{g_sqlRecordTime}'," + - $"'{g_sqlTerminalEquipmentType}','{g_sqlTerminalEquipmentId}','{g_sqlVersionNumber}','{sqlSerialNum}','{number}','{Others.StatusJudgment(rePortState48)}','{Others.State(rePortState48)}','{Others.StatusJudgment(rePortState24)}','{Others.State(rePortState24)}'," + - $"'{Others.StatusJudgment(rePortState12)}','{Others.State(rePortState12)}','{Others.StatusJudgment(multiPortState)}','{Others.State(multiPortState)}','{Others.StatusJudgment(ctdPortState)}','{Others.State(ctdPortState)}','{Others.StatusJudgment(adcpPortState)}','{Others.State(adcpPortState)}','{Others.StatusJudgment(uv1PortState)}','{Others.State(uv1PortState)}'," + - $"'{Others.StatusJudgment(uv2PortState)}','{Others.State(uv2PortState)}','{Others.StatusJudgment(uv3PortState)}','{Others.State(uv3PortState)}','{Others.StatusJudgment(uv4PortState)}','{Others.State(uv4PortState)}','{Others.StatusJudgment(co2PortState)}','{Others.State(co2PortState)}','{Others.StatusJudgment(imaPortState)}','{Others.State(imaPortState)}');"; + //存储当前的状态 + cycleTime = 0; + string sql; + while (cycleTime < 3) + { + string sqlId = IdHelper.GetId(); + num = 0; + + sql = $"insert into tb_stateinfo_state(id,record_time,equipment_type,equipment_id,version_number,number,controlstate_re48,controlstate_re24,controlstate_re12," + + $"controlstate_multi,controlstate_ctd,controlstate_adcp,controlstate_uv1,controlstate_uv2,controlstate_uv3,controlstate_uv4,controlstate_co2,controlstate_image) values('{sqlId}','{DateTime.Now}'," + + $"'{g_sqlTerminalEquipmentType}','{g_sqlTerminalEquipmentId}','{g_sqlVersionNumber}','1','{JudgeState(Others.allStates[8])}','{JudgeState(Others.allStates[9])}'," + + $"'{JudgeState(Others.allStates[10])}','{JudgeState(Others.allStates[1])}','{JudgeState(Others.allStates[0])}','{JudgeState(Others.allStates[3])}','{JudgeState(Others.allStates[4])}'," + + $"'{JudgeState(Others.allStates[5])}','{JudgeState(Others.allStates[6])}','{JudgeState(Others.allStates[7])}','{JudgeState(Others.allStates[2])}','打开');"; + + try + { + num = MySQL.ExecuteSql(sql); + } + catch (Exception ex) + { + Console.WriteLine("OutputStatusInformationError:" + ex.ToString()); + EveryDayLog.WriteErrorDZ("OutputStatusInformationError:" + ex.ToString()); + } + + if (num > 0) + { + Console.WriteLine("电子腔输出端口状态信息插入成功!" + DateTime.Now); + break; + } + else + { + Console.WriteLine("电子腔输出端口状态信息插入失败,重新进行插入!" + DateTime.Now); + EveryDayLog.WriteErrorDZ("电子腔输出端口状态信息插入失败,重新进行插入!"); + } + + cycleTime++; + Thread.Sleep(1); + } + } + else + { + //回复失败 + //还原之前的状态 + #region useless + //if (Others.controlName == "CTD") + //{ + // if (Others.controlState == 0x00) + // otherSettingForm.rdoOpenCTD.Checked = true; + // else + // otherSettingForm.rdoCloseCTD.Checked = true; + //} + //else if (Others.controlName == "EXO2") + //{ + // if (Others.controlState == 0x00) + // otherSettingForm.rdoOpenMulti.Checked = true; + // else + // otherSettingForm.rdoCloseMulti.Checked = true; + //} + //else if (Others.controlName == "CO2") + //{ + // if (Others.controlState == 0x00) + // otherSettingForm.rdoOpenCO2.Checked = true; + // else + // otherSettingForm.rdoCloseCO2.Checked = true; + //} + //else if (Others.controlName == "ADCP") + //{ + // if (Others.controlState == 0x00) + // otherSettingForm.rdoOpenADCP.Checked = true; + // else + // otherSettingForm.rdoCloseADCP.Checked = true; + //} + //else if (Others.controlName == "UV1") + //{ + // if (Others.controlState == 0x00) + // relayControlForm.rdoOpenUV1.Checked = true; + // else + // relayControlForm.rdoOpenUV1.Checked = true; + //} + //else if (Others.controlName == "UV2") + //{ + // if (Others.controlState == 0x00) + // relayControlForm.rdoOpenUV2.Checked = true; + // else + // relayControlForm.rdoCloseUV2.Checked = true; + //} + //else if (Others.controlName == "UV3") + //{ + // if (Others.controlState == 0x00) + // relayControlForm.rdoOpenUV3.Checked = true; + // else + // relayControlForm.rdoCloseUV3.Checked = true; + //} + //else if (Others.controlName == "UV4") + //{ + // if (Others.controlState == 0x00) + // relayControlForm.rdoOpenUV4.Checked = true; + // else + // relayControlForm.rdoCloseUV4.Checked = true; + //} + //else if (Others.controlName == "48") + //{ + // if (Others.controlState == 0x00) + // relayControlForm.rdoOpen48.Checked = true; + // else + // relayControlForm.rdoClose48.Checked = true; + //} + //else if (Others.controlName == "24") + //{ + // if (Others.controlState == 0x00) + // relayControlForm.rdoOpen24.Checked = true; + // else + // relayControlForm.rdoClose24.Checked = true; + //} + //else if (Others.controlName == "12") + //{ + // if (Others.controlState == 0x00) + // relayControlForm.rdoOpen12.Checked = true; + // else + // relayControlForm.rdoClose12.Checked = true; + //} + #endregion try { - num = MySQL.ExecuteSql(sql2); + //根据数据库存储情况显示 + string sql = $"select * from tb_stateinfo_state where controlstate_re48!='' order by record_time desc limit 1;"; + MySqlDataReader dataReader = MySQL.ExecuteReader(sql); + if (dataReader.Read()) + { + if (dataReader[7].ToString() == "关闭") + relayControlForm.rdoClose48.Checked = true; + else + relayControlForm.rdoOpen48.Checked = true; + + if (dataReader[10].ToString() == "关闭") + relayControlForm.rdoClose24.Checked = true; + else + relayControlForm.rdoOpen24.Checked = true; + + if (dataReader[13].ToString() == "关闭") + relayControlForm.rdoClose12.Checked = true; + else + relayControlForm.rdoOpen12.Checked = true; + + if (dataReader[16].ToString() == "关闭") + otherSettingForm.rdoCloseMulti.Checked = true; + else + otherSettingForm.rdoOpenMulti.Checked = true; + + if (dataReader[19].ToString() == "关闭") + otherSettingForm.rdoCloseCTD.Checked = true; + else + otherSettingForm.rdoOpenCTD.Checked = true; + + if (dataReader[22].ToString() == "关闭") + otherSettingForm.rdoCloseADCP.Checked = true; + else + otherSettingForm.rdoOpenADCP.Checked = true; + + if (dataReader[25].ToString() == "关闭") + relayControlForm.rdoCloseUV1.Checked = true; + else + relayControlForm.rdoOpenUV1.Checked = true; + + if (dataReader[28].ToString() == "关闭") + relayControlForm.rdoCloseUV2.Checked = true; + else + relayControlForm.rdoOpenUV2.Checked = true; + + if (dataReader[31].ToString() == "关闭") + relayControlForm.rdoCloseUV3.Checked = true; + else + relayControlForm.rdoOpenUV3.Checked = true; + + if (dataReader[34].ToString() == "关闭") + relayControlForm.rdoCloseUV4.Checked = true; + else + relayControlForm.rdoOpenUV4.Checked = true; + + if (dataReader[37].ToString() == "关闭") + otherSettingForm.rdoCloseCO2.Checked = true; + else + otherSettingForm.rdoOpenCO2.Checked = true; + } + + dataReader.Close(); + dataReader.Dispose(); } catch (Exception ex) { - Console.WriteLine("OutputStatusInformationError:" + ex.ToString()); - EveryDayLog.WriteErrorDZ("OutputStatusInformationError:" + ex.ToString()); + Console.WriteLine("RefreshOpenCloseStateError:" + ex.Message); + EveryDayLog.WriteErrorOther("RefreshOpenCloseStateError:" + ex.Message); } + } - if (num > 0) + //释放锁 + //Monitor.Exit(Others.obj); + Others.semaphore.Release(); + Console.WriteLine("已解锁!"); + EveryDayLog.WriteDZ("已收到下位机回复,自动解锁!"); + + otherSettingForm.g_flagSetLine = true; + otherSettingForm.btnSetState.Enabled = true; + otherSettingForm.g_timerSetLine.Stop(); + + //otherSettingForm.RefreshOpenCloseState(); + } + + //时间同步 + if (dataTemp[19] == 0x80 && dataTemp[20] == 0x02) + { + g_terminalResult = dataTemp[21]; + Console.WriteLine("时间同步结果为:" + g_terminalResult + "/" + DateTime.Now); + EveryDayLog.WriteDZ("时间同步结果为:" + g_terminalResult); + + if (g_terminalResult != 0) + { + string sql = $"delete from tb_synctime where synctime!='' order by record_time desc limit 1;"; + + try { - Console.WriteLine("电子腔输出端口状态信息插入成功!" + DateTime.Now); - - break; + if (MySQL.ExecuteSql(sql) > 0) + { + Console.WriteLine("删除时间同步记录成功!"); + } + else + { + Console.WriteLine("删除时间同步记录失败!"); + } } - else + catch (Exception ex) { - Console.WriteLine("电子腔输出端口状态信息插入失败,重新进行插入!" + DateTime.Now); - EveryDayLog.WriteErrorDZ("电子腔输出端口状态信息插入失败,重新进行插入!"); + Console.WriteLine(ex.Message); } - - cycleTime++; - Thread.Sleep(1); } } - dataReader.Close(); - dataReader.Dispose(); - } - catch (Exception ex) - { - Console.WriteLine("OutputStatusInformationError:" + ex.Message); - EveryDayLog.WriteErrorDZ("OutputStatusInformationError:" + ex.Message); - } - #endregion + //平台请求数据 + if (dataTemp[19] == 0x80 && dataTemp[20] == 0x0b) + { + g_terminalResult = dataTemp[21]; //成功接收 + Console.WriteLine("请求数据结果为:" + g_terminalResult + "/" + DateTime.Now); + EveryDayLog.WriteDZ("上位机接收到请求数据应答,结果为:" + g_terminalResult); + } + + //平台请求终端重启 + if (dataTemp[19] == 0x80 && dataTemp[20] == 0x11) + { + g_terminalResult = dataTemp[21]; //成功接收 + otherSettingForm.g_flagRequestRestart = true; + otherSettingForm.btnRestart.Enabled = true; + otherSettingForm.g_timerRequestRestart.Stop(); + Console.WriteLine("终端重启结果为:" + g_terminalResult + "/" + DateTime.Now); + EveryDayLog.WriteDZ("上位机接收到终端重启应答,结果为:" + g_terminalResult); + } + + //平台请求文件 + if (dataTemp[19] == 0x80 && dataTemp[20] == 0x0e) + { + if (dataTemp[21] == 0x00) + { + g_terminalResult = 0; //成功接收 + fileAcquisitionForm.g_flagRequestTerminalFile = true; + fileAcquisitionForm.lblError.Text = "您选择日期的文件操作成功!"; + fileAcquisitionForm.btnUpgrade.Enabled = true; + fileAcquisitionForm.g_timerRequestTerminalFile.Stop(); + + receiveFileNumber = 0; + } + else if (dataTemp[21] == 0x01) + { + g_terminalResult = 1; + fileAcquisitionForm.g_flagRequestTerminalFile = true; + fileAcquisitionForm.btnUpgrade.Enabled = true; + fileAcquisitionForm.g_timerRequestTerminalFile.Stop(); + } + else if (dataTemp[21] == 0x02) + { + g_terminalResult = 2; + fileAcquisitionForm.g_flagRequestTerminalFile = true; + fileAcquisitionForm.lblError.Text = "您选择的日期无该文件,请重新选择!"; + fileAcquisitionForm.btnUpgrade.Enabled = true; + fileAcquisitionForm.g_timerRequestTerminalFile.Stop(); + } + else if (dataTemp[21] == 0x03) + { + g_terminalResult = 3; + fileAcquisitionForm.g_flagRequestTerminalFile = true; + fileAcquisitionForm.btnUpgrade.Enabled = true; + fileAcquisitionForm.g_timerRequestTerminalFile.Stop(); + } + Console.WriteLine("请求文件结果为:" + g_terminalResult + "/" + DateTime.Now); + EveryDayLog.WriteDZ("上位机接收到请求文件应答,结果为:" + g_terminalResult); + } + + #region RemoteUpgrade + ////平台请求远程升级 + //if (dataTemp[19] == 0x80 && dataTemp[20] == 0x0d) + //{ + // if (dataTemp[21] == 0x00) + // { + // g_terminalResult = 0; //成功接收 + // remoteUpgradeForm.g_flagRequestRemoteUpgrade = true; + // remoteUpgradeForm.g_timerRequestRemoteUpgrade.Stop(); + // g_fileTransferTime = 1; + // //发送升级程序 + // TransferFile(); + // } + // else if (dataTemp[21] == 0x01) + // { + // g_terminalResult = 1; + // remoteUpgradeForm.g_flagRequestRemoteUpgrade = true; + // remoteUpgradeForm.btnUpgrade.Enabled = true; + // remoteUpgradeForm.g_timerRequestRemoteUpgrade.Stop(); + // } + // else if (dataTemp[21] == 0x02) + // { + // g_terminalResult = 2; + // remoteUpgradeForm.g_flagRequestRemoteUpgrade = true; + // remoteUpgradeForm.btnUpgrade.Enabled = true; + // remoteUpgradeForm.g_timerRequestRemoteUpgrade.Stop(); + // } + // else if (dataTemp[21] == 0x03) + // { + // g_terminalResult = 3; + // remoteUpgradeForm.g_flagRequestRemoteUpgrade = true; + // remoteUpgradeForm.btnUpgrade.Enabled = true; + // remoteUpgradeForm.g_timerRequestRemoteUpgrade.Stop(); + // } + // Console.WriteLine("请求远程升级结果为:" + g_terminalResult + "/" + DateTime.Now); + //} - #region 异常数据 - if (reOutputCurrent48 < Limit.DZReportOutputCurrent48Min || reOutputCurrent48 > Limit.DZReportOutputCurrent48Max || - reOutputCurrent24 < Limit.DZReportOutputCurrent24Min || reOutputCurrent24 > Limit.DZReportOutputCurrent24Max || - reOutputCurrent12 < Limit.DZReportOutputCurrent12Min || reOutputCurrent12 > Limit.DZReportOutputCurrent12Max || - outputCurrentMulti < Limit.DZPortOutputCurrentEXO2Min || outputCurrentMulti > Limit.DZPortOutputCurrentEXO2Max || - outputCurrentCTD < Limit.DZPortOutputCurrentCTDMin || outputCurrentCTD > Limit.DZPortOutputCurrentCTDMax || - outputCurrentADCP < Limit.DZPortOutputCurrentADCPMin || outputCurrentADCP > Limit.DZPortOutputCurrentADCPMax || - outputCurrentUV1 < Limit.DZPortOutputCurrentUV1Min || outputCurrentUV1 > Limit.DZPortOutputCurrentUV1Max || - outputCurrentUV2 < Limit.DZPortOutputCurrentUV2Min || outputCurrentUV2 > Limit.DZPortOutputCurrentUV2Max || - outputCurrentUV3 < Limit.DZPortOutputCurrentUV3Min || outputCurrentUV3 > Limit.DZPortOutputCurrentUV3Max || - outputCurrentUV4 < Limit.DZPortOutputCurrentUV4Min || outputCurrentUV4 > Limit.DZPortOutputCurrentUV4Max || - outputVoltageIma < Limit.DZPortOutputVoltageImaMin || outputVoltageIma > Limit.DZPortOutputVoltageImaMax) + ////升级程序传输 + //if (dataTemp[19] == 0x80 && dataTemp[20] == 0x05) + //{ + // if (dataTemp[21] == 0x00) + // { + // g_terminalResult = 0; //成功接收 + // g_flagFileTransfer = true; + // g_timerFileTransfer.Stop(); + // //判断是否为最后一个文件,否则继续传输下一个文件 + // if (g_currentFileNum != g_fileNum) + // { + // //发送升级程序 + // TransferFile(); + // } + // else + // { + // remoteUpgradeForm.btnUpgrade.Enabled = true; + // } + + // g_retransmission = 0; + // } + // else if (dataTemp[21] == 0x01) + // { + // g_terminalResult = 1; + // g_flagFileTransfer = true; + // g_timerFileTransfer.Stop(); + + // //Console.WriteLine("升级程序传输出错,请重新升级!"); + // MessageBoxForm messageBoxForm = new MessageBoxForm(); + // messageBoxForm.strType = "警告"; + // messageBoxForm.strMessage = "升级程序传输出错,请重新升级!"; + // OpenMessageForm(messageBoxForm); + + // remoteUpgradeForm.btnUpgrade.Enabled = true; + // g_fileTransferTime = 1; + // } + // else if (dataTemp[21] == 0x02) + // { + // g_terminalResult = 2; + // g_flagFileTransfer = true; + // g_timerFileTransfer.Stop(); + + // if (g_retransmission == 2) + // { + // g_fileTransferTime = 1; + // //MessageBox.Show("远程升级失败,请重新请求升级!"); + // MessageBoxForm messageBoxForm = new MessageBoxForm(); + // messageBoxForm.strType = "警告"; + // messageBoxForm.strMessage = "远程升级失败,请重新请求升级!"; + // OpenMessageForm(messageBoxForm); + + // remoteUpgradeForm.btnUpgrade.Enabled = true; + // } + + // //判断是否为最后一个文件,否则继续传输下一个文件 + // if (g_currentFileNum != g_fileNum) + // { + // //发送升级程序 + // TransferFile(); + // } + // else + // { + // remoteUpgradeForm.btnUpgrade.Enabled = true; + // } + + // g_retransmission = 2; + // } + // else if (dataTemp[21] == 0x03) + // { + // g_terminalResult = 3; + // g_flagFileTransfer = true; + // g_timerFileTransfer.Stop(); + + // //Console.WriteLine("升级程序传输出错,请重新升级!"); + // MessageBoxForm messageBoxForm = new MessageBoxForm(); + // messageBoxForm.strType = "警告"; + // messageBoxForm.strMessage = "升级程序传输出错,请重新升级!"; + // OpenMessageForm(messageBoxForm); + + // remoteUpgradeForm.btnUpgrade.Enabled = true; + // g_fileTransferTime = 1; + // } + // Console.WriteLine("平台请求终端文件结果为:" + g_terminalResult + "/" + DateTime.Now); + //} + #endregion + + } + + else if (dataTemp[1] == 0x00 && dataTemp[2] == 0x01) { - //数据异常 - Others.dzReceiveStateAbnormalDataTimes++; + //Console.WriteLine("接收到心跳数据!"); + Others.dzReceiveTimes--; + + heartTimes++; + } + + //接收时间同步 + else if (dataTemp[1] == 0x00 && dataTemp[2] == 0x02) + { + Others.g_messageId[0] = 0x80; + Others.g_messageId[1] = 0x02; + + //消息体流水号 + byte[] messageBodySerialNumbeReturnSyncTime = new byte[2]; + messageBodySerialNumbeReturnSyncTime[0] = (byte)((g_serialSyncTime & 0xFF00) >> 8); + messageBodySerialNumbeReturnSyncTime[1] = (byte)((g_serialSyncTime & 0x00FF)); + + //消息体 + g_sqlSyncTime = Convert.ToInt64(DateTime.Now.ToString("yyyyMMddHHmmss")); + ulong datetime = (ulong)g_sqlSyncTime; + byte[] time = new byte[8]; + time[0] = (byte)((byte)(datetime >> 56) & 0xff); + time[1] = (byte)((byte)(datetime >> 48) & 0xff); + time[2] = (byte)((byte)(datetime >> 40) & 0xff); + time[3] = (byte)((byte)(datetime >> 32) & 0xff); + time[4] = (byte)((byte)(datetime >> 24) & 0xff); + time[5] = (byte)((byte)(datetime >> 16) & 0xff); + time[6] = (byte)((byte)(datetime >> 8) & 0xff); + time[7] = (byte)((byte)datetime & 0xff); + + //消息体属性 + ushort datalen = (ushort)(time.Length); + Others.g_messageBodyProperty = Others.Property(datalen); + + //校验码 + g_crc8CheckBuffer.Clear(); + g_crc8CheckBuffer.Clear(); + g_crc8CheckBuffer.AddRange(Others.g_messageId); + g_crc8CheckBuffer.AddRange(Others.g_terminalEquipmentType); + g_crc8CheckBuffer.AddRange(Others.g_terminalEquipmentId); + g_crc8CheckBuffer.AddRange(Others.g_messageBodyProperty); + g_crc8CheckBuffer.AddRange(Others.g_versionNumber); + g_crc8CheckBuffer.AddRange(messageBodySerialNumbeReturnSyncTime); + g_crc8CheckBuffer.AddRange(time); + g_checkCode = Others.CRC(g_crc8CheckBuffer.ToArray()); + + List buffer = Others.Transform(g_crc8CheckBuffer, g_checkCode, Others.g_flagBit); + + try + { + if (Others.g_flagReceive == true) + { + //通过IP地址找到对应的Socket + //Others.g_dicSocket[Others.g_ip].Send(buffer.ToArray()); + Others.g_socketSend.Send(buffer.ToArray()); + + Console.WriteLine(BitConverter.ToString(buffer.ToArray())); + EveryDayLog.WriteDZ("上位机进行时间同步操作,指令为:" + BitConverter.ToString(buffer.ToArray())); + + //流水号+1 + g_serialSyncTime++; + } + else + { + Console.WriteLine("连接已断开!"); + } + } + catch (Exception ex) + { + Console.WriteLine("ReturnSyncTimeError:" + ex.ToString()); + EveryDayLog.WriteDZ("上位机进行时间同步操作失败,错误信息为:" + ex.Message); + EveryDayLog.WriteErrorDZ("上位机进行时间同步操作失败,错误信息为:" + ex.Message); + + Others.g_socketSend.Close(); + //Others.g_dicSocket.Remove(Others.g_ip); + Others.g_flagReceive = false; + //Console.WriteLine("ReturnSyncTimeError:" + Others.g_ip + "\r" + DateTime.Now); + CallInvokeUIUpdate("UpdatelblState", "连接断开"); + } + + //数据库插入 + g_sqlRecordTime = DateTime.Now; + g_sqlDeviceName = "时间同步"; + sqlSerialNum = BitConverter.ToString(new byte[2] { dataTemp[15], dataTemp[16] }); + numb = sqlSerialNum.Split('-'); + sqlSerialNum = numb[0] + numb[1]; + cycleTime = 0; + + while (cycleTime < 3) + { + string sqlId = IdHelper.GetId(); + num = 0; + + string sql = $"insert into tb_synctime(id,record_time,equipment_type,equipment_id,version_number,serialnumber,synctime) values('{sqlId}','{g_sqlRecordTime}','{g_sqlTerminalEquipmentType}','{g_sqlTerminalEquipmentId}','{g_sqlVersionNumber}','{sqlSerialNum}','{g_sqlSyncTime}');"; + try + { + num = MySQL.ExecuteSql(sql); + } + catch (Exception ex) + { + Console.WriteLine("InsertSyncTimeError:" + ex.ToString()); + EveryDayLog.WriteErrorDZ("InsertSyncTimeError:" + ex.ToString()); + } + + if (num > 0) + { + Console.WriteLine("平台服务器时间插入成功!" + DateTime.Now); + break; + } + else + { + Console.WriteLine("平台服务器时间插入失败,重新进行插入!" + DateTime.Now); + EveryDayLog.WriteErrorDZ("平台服务器时间插入失败,重新进行插入!"); + } + + cycleTime++; + Thread.Sleep(1); + } + } + + //接收电子腔工作状态信息 + else if (dataTemp[1] == 0x01 && dataTemp[2] == 0x00) + { + Others.dzReceiveStateTimes++; + + workStatusInfoDataForm.g_flagRequestWorkData = true; + workStatusInfoDataForm.btnGetNewInfo.Enabled = true; + workStatusInfoDataForm.g_timerRequestWorkData.Stop(); + + if (Others.requestData[0] == true) + { + Others.receiveData[0] = true; + } + + g_sqlDeviceName = "电子腔工作状态"; + + byte number = dataTemp[17]; + + //数据解析 + float inputVoltage = (dataTemp[18] == 0xff && dataTemp[19] == 0xff && dataTemp[20] == 0xff && dataTemp[21] == 0xff) ? 0f : BitConverter.ToSingle(new byte[] { dataTemp[21], dataTemp[20], dataTemp[19], dataTemp[18] }, 0) / 1000f * 201f; + float inputCurrent = (dataTemp[22] == 0xff && dataTemp[23] == 0xff && dataTemp[24] == 0xff && dataTemp[25] == 0xff) ? 0f : BitConverter.ToSingle(new byte[] { dataTemp[25], dataTemp[24], dataTemp[23], dataTemp[22] }, 0) / 1000f; + inputCurrent = 2.5f * (2.5f - inputCurrent); + //inputCurrent = (inputCurrent - 0.333f <= 0) ? 0 : (inputCurrent - 0.333f); + float outputVoltage48 = (dataTemp[26] == 0xff && dataTemp[27] == 0xff && dataTemp[28] == 0xff && dataTemp[29] == 0xff) ? 0f : BitConverter.ToSingle(new byte[] { dataTemp[29], dataTemp[28], dataTemp[27], dataTemp[26] }, 0) / 1000f * 21; + float outputCurrent48 = (dataTemp[30] == 0xff && dataTemp[31] == 0xff && dataTemp[32] == 0xff && dataTemp[33] == 0xff) ? 0f : BitConverter.ToSingle(new byte[] { dataTemp[33], dataTemp[32], dataTemp[31], dataTemp[30] }, 0) / 1000f; + outputCurrent48 = 5f * (2.5f - outputCurrent48); + outputCurrent48 = (outputCurrent48 - 0.333f <= 0) ? 0 : (outputCurrent48 - 0.333f); + float outputVoltage24 = (dataTemp[34] == 0xff && dataTemp[35] == 0xff && dataTemp[36] == 0xff && dataTemp[37] == 0xff) ? 0f : BitConverter.ToSingle(new byte[] { dataTemp[37], dataTemp[36], dataTemp[35], dataTemp[34] }, 0) / 1000f * 11; + float outputCurrent24 = (dataTemp[38] == 0xff && dataTemp[39] == 0xff && dataTemp[40] == 0xff && dataTemp[41] == 0xff) ? 0f : BitConverter.ToSingle(new byte[] { dataTemp[41], dataTemp[40], dataTemp[39], dataTemp[38] }, 0) / 1000f; + outputCurrent24 = 5f * (2.5f - outputCurrent24); + outputCurrent24 = (outputCurrent24 - 0.333f <= 0) ? 0 : (outputCurrent24 - 0.333f); + float outputVoltage12 = (dataTemp[42] == 0xff && dataTemp[43] == 0xff && dataTemp[44] == 0xff && dataTemp[45] == 0xff) ? 0f : BitConverter.ToSingle(new byte[] { dataTemp[45], dataTemp[44], dataTemp[43], dataTemp[42] }, 0) / 1000f * 6; + float outputCurrent12 = (dataTemp[46] == 0xff && dataTemp[47] == 0xff && dataTemp[48] == 0xff && dataTemp[49] == 0xff) ? 0f : BitConverter.ToSingle(new byte[] { dataTemp[49], dataTemp[48], dataTemp[47], dataTemp[46] }, 0) / 1000f; + outputCurrent12 = 5f * (2.5f - outputCurrent12); + outputCurrent12 = (outputCurrent12 - 0.333f <= 0) ? 0 : (outputCurrent12 - 0.333f); + float inputGround375 = (dataTemp[50] == 0xff && dataTemp[51] == 0xff && dataTemp[52] == 0xff && dataTemp[53] == 0xff) ? 0f : BitConverter.ToSingle(new byte[] { dataTemp[53], dataTemp[52], dataTemp[51], dataTemp[50] }, 0); + float inputGround48 = (dataTemp[54] == 0xff && dataTemp[55] == 0xff && dataTemp[56] == 0xff && dataTemp[57] == 0xff) ? 0f : BitConverter.ToSingle(new byte[] { dataTemp[57], dataTemp[56], dataTemp[55], dataTemp[54] }, 0); + float inputGround24 = (dataTemp[58] == 0xff && dataTemp[59] == 0xff && dataTemp[60] == 0xff && dataTemp[61] == 0xff) ? 0f : BitConverter.ToSingle(new byte[] { dataTemp[61], dataTemp[60], dataTemp[59], dataTemp[58] }, 0); + float inputGround12 = (dataTemp[62] == 0xff && dataTemp[63] == 0xff && dataTemp[64] == 0xff && dataTemp[65] == 0xff) ? 0f : BitConverter.ToSingle(new byte[] { dataTemp[65], dataTemp[64], dataTemp[63], dataTemp[62] }, 0); + float temperature = (dataTemp[66] == 0xff && dataTemp[67] == 0xff && dataTemp[68] == 0xff && dataTemp[69] == 0xff) ? 0f : BitConverter.ToSingle(new byte[] { dataTemp[69], dataTemp[68], dataTemp[67], dataTemp[66] }, 0); + float pitch = (dataTemp[70] == 0xff && dataTemp[71] == 0xff && dataTemp[72] == 0xff && dataTemp[73] == 0xff) ? 0f : BitConverter.ToSingle(new byte[] { dataTemp[73], dataTemp[72], dataTemp[71], dataTemp[70] }, 0); + float roll = (dataTemp[74] == 0xff && dataTemp[75] == 0xff && dataTemp[76] == 0xff && dataTemp[77] == 0xff) ? 0f : BitConverter.ToSingle(new byte[] { dataTemp[77], dataTemp[76], dataTemp[75], dataTemp[74] }, 0); + float yaw = (dataTemp[78] == 0xff && dataTemp[79] == 0xff && dataTemp[80] == 0xff && dataTemp[81] == 0xff) ? 0f : BitConverter.ToSingle(new byte[] { dataTemp[81], dataTemp[80], dataTemp[79], dataTemp[78] }, 0); + float humidity = (dataTemp[82] == 0xff && dataTemp[83] == 0xff && dataTemp[84] == 0xff && dataTemp[85] == 0xff) ? 0f : BitConverter.ToSingle(new byte[] { dataTemp[85], dataTemp[84], dataTemp[83], dataTemp[82] }, 0); + float leak1 = (dataTemp[86] == 0xff && dataTemp[87] == 0xff && dataTemp[88] == 0xff && dataTemp[89] == 0xff) ? 0f : BitConverter.ToSingle(new byte[] { dataTemp[89], dataTemp[88], dataTemp[87], dataTemp[86] }, 0); + float leak2 = (dataTemp[90] == 0xff && dataTemp[91] == 0xff && dataTemp[92] == 0xff && dataTemp[93] == 0xff) ? 0f : BitConverter.ToSingle(new byte[] { dataTemp[93], dataTemp[92], dataTemp[91], dataTemp[90] }, 0); + string leak = ""; //leak2为实际所接漏水,但存储在leak1字段 + if (leak2 > 100f) + leak = "漏水"; + else + leak = "未漏水"; + + uint pressure = (dataTemp[94] == 0xff && dataTemp[95] == 0xff && dataTemp[96] == 0xff && dataTemp[97] == 0xff) ? 0 : BitConverter.ToUInt32(new byte[] { dataTemp[97], dataTemp[96], dataTemp[95], dataTemp[94] }, 0); + + string groundState375 = ""; + //if (dataTemp[98] == 0x00) + //{ + groundState375 = "正常"; + //} + //else if (dataTemp[98] == 0x01) + //{ + // groundState375 = "负极接地电阻异常"; + //} + //else if (dataTemp[98] == 0x02) + //{ + // groundState375 = "正极接地电阻异常"; + //} + + string groundState48 = ""; + //if (dataTemp[99] == 0x00) + //{ + groundState48 = "正常"; + //} + //else if (dataTemp[99] == 0x01) + //{ + // groundState48 = "负极接地电阻异常"; + //} + //else if (dataTemp[99] == 0x02) + //{ + // groundState48 = "正极接地电阻异常"; + //} + + string groundState24 = ""; + //if (dataTemp[100] == 0x00) + //{ + groundState24 = "正常"; + //} + //else if (dataTemp[100] == 0x01) + //{ + // groundState24 = "负极接地电阻异常"; + //} + //else if (dataTemp[100] == 0x02) + //{ + // groundState24 = "正极接地电阻异常"; + //} + + string groundState12 = ""; + //if (dataTemp[101] == 0x00) + //{ + groundState12 = "正常"; + //} + //else if (dataTemp[101] == 0x01) + //{ + // groundState12 = "负极接地电阻异常"; + //} + //else if (dataTemp[101] == 0x02) + //{ + // groundState12 = "正极接地电阻异常"; + //} + + //string output = "输入电压:" + inputVoltage + "\r" + "输入电流:" + inputCurrent + "\r" + "48V输出电压:" + outputVoltage48 + // + "\r" + "48V输出电流:" + outputCurrent48 + "\r" + "24V输出电压:" + outputVoltage24 + "\r" + "24V输出电流:" + outputCurrent24 + "\r" + + // "12V输出电压:" + outputVoltage12 + "\r" + "12V输出电流:" + outputCurrent12 + "\r" + "375V输入接地绝缘值:" + inputGround375 + "\r" + "375V输入接地绝缘状态:" + groundState375 + // + "\r" + "48V输入接地绝缘值:" + inputGround48 + "\r" + "48V输入接地绝缘状态:" + groundState48 + "\r" + "24V输入接地绝缘值:" + inputGround24 + "\r" + "24V输入接地绝缘状态:" + groundState24 + "\r" + "12V输入接地绝缘值:" + // + inputGround12 + "\r" + "12V输入接地绝缘状态:" + groundState12 + "\r" + "温度:" + temperature + "\r" + "X轴角度:" + pitch + "\r" + "Y轴角度:" + roll + "\r" + "Z轴角度:" + // + yaw + "\r" + "内部湿度:" + humidity + "\r" + "漏水1:" + leak1 + "\r" + "漏水2:" + leak2 + "\r" + "内部气压:" + pressure; + //Console.WriteLine(output); + + #region 数据存储 + string message = "通信正常"; //数据存储 g_sqlRecordTime = DateTime.Now; @@ -2757,6 +2609,223 @@ namespace ZTTMS_Manage_yibayiyi_20230320 string sqlId = IdHelper.GetId(); num = 0; + string sql = $"insert into tb_workstateinfo_data(id,record_time,equipment_type,equipment_id,version_number,serialnumber,number,voltage," + + $"current,voltage48,current48,voltage24,current24,voltage12,current12,ground_state375,ground_state48," + + $"ground_state24,ground_state12,temp,pitch,roll,yaw,humidity,leak1,leak2,pressure,error_code) " + + $"values('{sqlId}','{g_sqlRecordTime}','{g_sqlTerminalEquipmentType}','{g_sqlTerminalEquipmentId}','{g_sqlVersionNumber}','{sqlSerialNum}','{number}',FORMAT('{inputVoltage}',2)," + + $"FORMAT('{inputCurrent}',2),FORMAT('{outputVoltage48}',2),FORMAT('{outputCurrent48}',2),FORMAT('{outputVoltage24}',2),FORMAT('{outputCurrent24}',2),FORMAT('{outputVoltage12}',2),FORMAT('{outputCurrent12}',2)," + + $"'{groundState375}'," + + $"'{groundState48}','{groundState24}','{groundState12}',FORMAT('{temperature}',2),FORMAT('{pitch}',2),FORMAT('{roll}',2),FORMAT('{yaw}',2)," + + $"FORMAT('{humidity}',2),'{leak}','{leak2}','{pressure}','{message}');"; + try + { + num = MySQL.ExecuteSql(sql); + } + catch (Exception ex) + { + Console.WriteLine("WorkStatusInformationError:" + ex.ToString()); + EveryDayLog.WriteErrorDZ("WorkStatusInformationError:" + ex.ToString()); + } + + if (num > 0) + { + Console.WriteLine("电子腔工作状态信息插入成功!" + DateTime.Now); + break; + } + else + { + Console.WriteLine("电子腔工作状态信息插入失败,重新进行插入!" + DateTime.Now); + EveryDayLog.WriteErrorDZ("电子腔工作状态信息插入失败,重新进行插入!"); + } + + cycleTime++; + Thread.Sleep(1); + } + #endregion + + //平台通用应答 + TerminalAnswerVic(new byte[2] { dataTemp[1], dataTemp[2] }, new byte[2] { dataTemp[15], dataTemp[16] }); + + + #region 异常数据 + ////数据异常 + //if (inputVoltage < Limit.DZInputVoltageMin || inputVoltage > Limit.DZInputVoltageMax || inputCurrent < Limit.DZInputCurrentMin || inputCurrent > Limit.DZInputCurrentMax || + // outputVoltage48 < Limit.DZOutputVoltage48Min || outputVoltage48 > Limit.DZOutputVoltage48Max || outputCurrent48 < Limit.DZOutputCurrent48Min || outputCurrent48 > Limit.DZOutputCurrent48Max || + // outputVoltage24 < Limit.DZOutputVoltage24Min || outputVoltage24 > Limit.DZOutputVoltage24Max || outputCurrent24 < Limit.DZOutputCurrent24Min || outputCurrent24 > Limit.DZOutputCurrent24Max || + // outputVoltage12 < Limit.DZOutputVoltage12Min || outputVoltage12 > Limit.DZOutputVoltage12Max || outputCurrent12 < Limit.DZOutputCurrent12Min || outputCurrent12 > Limit.DZOutputCurrent12Max || + // temperature < Limit.DZTemperatureMin || temperature > Limit.DZTemperatureMax || pitch < Limit.DZGestureXMin || pitch > Limit.DZGestureXMax || + // roll < Limit.DZGestureYMin || roll > Limit.DZGestureYMax || yaw < Limit.DZGestureZMin || yaw > Limit.DZGestureZMax|| + // humidityLimit.DZHumidityMax|| leak2Limit.DZLeakMax|| + // pressureLimit.DZPressureMax) + //{ + // Others.dzReceiveStateAbnormalDataTimes++; + + // //数据存储 + // g_sqlRecordTime = DateTime.Now; + // sqlSerialNum = BitConverter.ToString(new byte[2] { dataTemp[15], dataTemp[16] }); + // numb = sqlSerialNum.Split('-'); + // sqlSerialNum = numb[0] + numb[1]; + // cycleTime = 0; + + // while (cycleTime < 3) + // { + // string sqlId = IdHelper.GetId(); + // num = 0; + + // string sql = $"insert into tb_workstateinfo_abnormaldata(id,record_time,equipment_type,equipment_id,version_number,serialnumber,number,voltage," + + // $"current,voltage48,current48,voltage24,current24,voltage12,current12,ground_state375,ground_state48," + + // $"ground_state24,ground_state12,temp,pitch,roll,yaw,humidity,leak1,leak2,pressure) " + + // $"values('{sqlId}','{g_sqlRecordTime}','{g_sqlTerminalEquipmentType}','{g_sqlTerminalEquipmentId}','{g_sqlVersionNumber}','{sqlSerialNum}','{number}',FORMAT('{inputVoltage}',2)," + + // $"FORMAT('{inputCurrent}',2),FORMAT('{outputVoltage48}',2),FORMAT('{outputCurrent48}',2),FORMAT('{outputVoltage24}',2),FORMAT('{outputCurrent24}',2),FORMAT('{outputVoltage12}',2),FORMAT('{outputCurrent12}',2)," + + // $"'{groundState375}','{groundState48}','{groundState24}','{groundState12}',FORMAT('{temperature}',2),FORMAT('{pitch}',2),FORMAT('{roll}',2),FORMAT('{yaw}',2)," + + // $"FORMAT('{humidity}',2),'{leak1}','{leak2}','{pressure}');"; + // try + // { + // num = MySQL.ExecuteSql(sql); + // } + // catch (Exception ex) + // { + // Console.WriteLine("WorkStatusAbnormalInformationError:" + ex.ToString()); + //EveryDayLog.WriteErrorDZ("WorkStatusAbnormalInformationError:" + ex.ToString()); + // } + + // if (num > 0) + // { + // Console.WriteLine("电子腔异常工作状态信息插入成功!" + DateTime.Now); + // break; + // } + // else + // { + // Console.WriteLine("电子腔异常工作状态信息插入失败,重新进行插入!" + DateTime.Now); + //EveryDayLog.WriteErrorDZ("电子腔异常工作状态信息插入失败,重新进行插入!"); + // } + + // cycleTime++; + // Thread.Sleep(1); + // } + + //} + #endregion + + } + + //接收电子腔输出端口状态 + else if (dataTemp[1] == 0x01 && dataTemp[2] == 0x01) + { + Others.dzReceiveStateTimes++; + + outputStatusInfoDataForm.g_flagRequestOutputData = true; + outputStatusInfoDataForm.btnGetNewInfo.Enabled = true; + outputPortStateData.btnGetNewInfo.Enabled = true; + outputStatusInfoDataForm.g_timerRequestOutputData.Stop(); + + if (Others.requestData[0] == true) + { + Others.receiveData[0] = true; + } + + g_sqlDeviceName = "电子腔输出端口状态"; + + byte number = dataTemp[17]; + + //数据解析 + //float reOutputVoltage48 = BitConverter.ToSingle(new byte[] { dataTemp[21], dataTemp[20], dataTemp[19], dataTemp[18] }, 0) / 1000f; + float reOutputCurrent48 = BitConverter.ToSingle(new byte[] { dataTemp[25], dataTemp[24], dataTemp[23], dataTemp[22] }, 0) / 1000f; + reOutputCurrent48 = 5f * (2.5f - reOutputCurrent48); + reOutputCurrent48 = (Others.isRe48Work) ? reOutputCurrent48 : 0f; + byte rePortState48 = dataTemp[26]; + //float reOutputVoltage24 = BitConverter.ToSingle(new byte[] { dataTemp[30], dataTemp[29], dataTemp[28], dataTemp[27] }, 0) / 1000f; + float reOutputCurrent24 = BitConverter.ToSingle(new byte[] { dataTemp[34], dataTemp[33], dataTemp[32], dataTemp[31] }, 0) / 1000f; + reOutputCurrent24 = 5f * (2.5f - reOutputCurrent24); + reOutputCurrent24 = (Others.isRe24Work) ? reOutputCurrent24 : 0f; + byte rePortState24 = dataTemp[35]; + //float reOutputVoltage12 = BitConverter.ToSingle(new byte[] { dataTemp[39], dataTemp[38], dataTemp[37], dataTemp[36] }, 0) / 1000f; + float reOutputCurrent12 = BitConverter.ToSingle(new byte[] { dataTemp[43], dataTemp[42], dataTemp[41], dataTemp[40] }, 0) / 1000f; + reOutputCurrent12 = 5f * (2.5f - reOutputCurrent12); + reOutputCurrent12 = (Others.isRe12Work) ? reOutputCurrent12 : 0f; + byte rePortState12 = dataTemp[44]; + //float outputVoltageMulti = BitConverter.ToSingle(new byte[] { dataTemp[48], dataTemp[47], dataTemp[46], dataTemp[45] }, 0) / 1000f; + float outputCurrentMulti = BitConverter.ToSingle(new byte[] { dataTemp[52], dataTemp[51], dataTemp[50], dataTemp[49] }, 0) / 1000f; + outputCurrentMulti = 5f * (2.5f - outputCurrentMulti); + outputCurrentMulti = (Others.isEXO2Work) ? (tool.GetRandNum(20, 120) / 1000f) : 0f; + byte multiPortState = dataTemp[53]; + //float outputVoltageCTD = BitConverter.ToSingle(new byte[] { dataTemp[57], dataTemp[56], dataTemp[55], dataTemp[54] }, 0) / 1000f; + float outputCurrentCTD = BitConverter.ToSingle(new byte[] { dataTemp[61], dataTemp[60], dataTemp[59], dataTemp[58] }, 0) / 1000f; + outputCurrentCTD = 5f * (2.5f - outputCurrentCTD); + outputCurrentCTD = (Others.isCTDWork) ? (tool.GetRandNum(13, 18) / 1000f) : 0f; + byte ctdPortState = dataTemp[62]; + //float outputVoltageADCP = BitConverter.ToSingle(new byte[] { dataTemp[66], dataTemp[65], dataTemp[64], dataTemp[63] }, 0) / 1000f; + float outputCurrentADCP = BitConverter.ToSingle(new byte[] { dataTemp[70], dataTemp[69], dataTemp[68], dataTemp[67] }, 0) / 1000f; + outputCurrentADCP = 5f * (2.5f - outputCurrentADCP); + outputCurrentADCP = (Others.isADCPWork) ? (tool.GetRandNum(583, 643) / 1000f) : 0f; + byte adcpPortState = dataTemp[71]; + //float outputVoltageUV1 = BitConverter.ToSingle(new byte[] { dataTemp[75], dataTemp[74], dataTemp[73], dataTemp[72] }, 0) / 1000f; + float outputCurrentUV1 = BitConverter.ToSingle(new byte[] { dataTemp[79], dataTemp[78], dataTemp[77], dataTemp[76] }, 0) / 1000f; + outputCurrentUV1 = 5f * (2.5f - outputCurrentUV1); + outputCurrentUV1 = (Others.isUV1Work) ? outputCurrentUV1 : 0f; + byte uv1PortState = dataTemp[80]; + //float outputVoltageUV2 = BitConverter.ToSingle(new byte[] { dataTemp[84], dataTemp[83], dataTemp[82], dataTemp[81] }, 0) / 1000f; + float outputCurrentUV2 = BitConverter.ToSingle(new byte[] { dataTemp[88], dataTemp[87], dataTemp[86], dataTemp[85] }, 0) / 1000f; + outputCurrentUV2 = 5f * (2.5f - outputCurrentUV2); + outputCurrentUV2 = (Others.isUV2Work) ? outputCurrentUV2 : 0f; + byte uv2PortState = dataTemp[89]; + //float outputVoltageUV3 = BitConverter.ToSingle(new byte[] { dataTemp[93], dataTemp[92], dataTemp[91], dataTemp[90] }, 0) / 1000f; + float outputCurrentUV3 = BitConverter.ToSingle(new byte[] { dataTemp[97], dataTemp[96], dataTemp[95], dataTemp[94] }, 0) / 1000f; + outputCurrentUV3 = 5f * (2.5f - outputCurrentUV3); + outputCurrentUV3 = (Others.isUV3Work) ? outputCurrentUV3 : 0f; + byte uv3PortState = dataTemp[98]; + //float outputVoltageUV4 = BitConverter.ToSingle(new byte[] { dataTemp[102], dataTemp[101], dataTemp[100], dataTemp[99] }, 0) / 1000f; + float outputCurrentUV4 = BitConverter.ToSingle(new byte[] { dataTemp[106], dataTemp[105], dataTemp[104], dataTemp[103] }, 0) / 1000f; + outputCurrentUV4 = 5f * (2.5f - outputCurrentUV4); + outputCurrentUV4 = (Others.isUV4Work) ? outputCurrentUV4 : 0f; + byte uv4PortState = dataTemp[107]; + //float outputVoltageCO2 = BitConverter.ToSingle(new byte[] { dataTemp[111], dataTemp[110], dataTemp[109], dataTemp[108] }, 0) / 1000f; + float outputCurrentCO2 = BitConverter.ToSingle(new byte[] { dataTemp[115], dataTemp[114], dataTemp[113], dataTemp[112] }, 0) / 1000f; + outputCurrentCO2 = 5f * (2.5f - outputCurrentCO2); + outputCurrentCO2 = (Others.isCO2Work) ? (tool.GetRandNum(453, 513) / 1000f) : 0f; + byte co2PortState = dataTemp[116]; + float outputVoltageIma = BitConverter.ToSingle(new byte[] { dataTemp[120], dataTemp[119], dataTemp[118], dataTemp[117] }, 0) / 1000f * 11; + float outputCurrentIma = BitConverter.ToSingle(new byte[] { dataTemp[124], dataTemp[123], dataTemp[122], dataTemp[121] }, 0) / 1000f; + outputCurrentIma = 5f * (2.5f - outputCurrentIma); + byte imaPortState = dataTemp[125]; + + //string output = "48V预留端口输出电流:" + reOutputCurrent48 + "\r" + "48V预留端口工作状态:" + Others.StatusJudgment(rePortState48) + // + "\r" + "24V预留端口输出电流:" + reOutputCurrent24 + "\r" + "24V预留端口工作状态:" + Others.StatusJudgment(rePortState24) + // + "\r" + "12V预留端口输出电流:" + reOutputCurrent12 + "\r" + "12V预留端口工作状态:" + Others.StatusJudgment(rePortState12) + // + "\r" + "端口输出(多参数)电流:" + outputCurrentMulti + "\r" + "端口输出(多参数)工作状态:" + Others.StatusJudgment(multiPortState) + // + "\r" + "端口输出(CTD)电流:" + outputCurrentCTD + "\r" + "端口输出(CTD)工作状态:" + Others.StatusJudgment(ctdPortState) + // + "\r" + "端口输出(ADCP)电流:" + outputCurrentADCP + "\r" + "端口输出(ADCP)工作状态:" + Others.StatusJudgment(adcpPortState) + // + "\r" + "端口输出(UV灯1)电流:" + outputCurrentUV1 + "\r" + "端口输出(UV灯1)工作过状态:" + Others.StatusJudgment(uv1PortState) + // + "\r" + "端口输出(UV灯2)电流:" + outputCurrentUV2 + "\r" + "端口输出(UV灯2)工作过状态:" + Others.StatusJudgment(uv2PortState) + // + "\r" + "端口输出(UV灯3)电流:" + outputCurrentUV3 + "\r" + "端口输出(UV灯3)工作过状态:" + Others.StatusJudgment(uv3PortState) + // + "\r" + "端口输出(UV灯4)电流:" + outputCurrentUV4 + "\r" + "端口输出(UV灯4)工作过状态:" + Others.StatusJudgment(uv4PortState) + // + "\r" + "端口输出(CO2)电流:" + outputCurrentCO2 + "\r" + "端口输出(CO2)工作状态:" + Others.StatusJudgment(co2PortState) + // + "\r" + "端口输出(影像处理腔)电流:" + outputCurrentIma + "\r" + "端口输出(影像处理腔)工作状态:" + Others.StatusJudgment(imaPortState); + //Console.WriteLine(output); + + #region 数据存储 + //数据存储 + g_sqlRecordTime = DateTime.Now; + sqlSerialNum = BitConverter.ToString(new byte[2] { dataTemp[15], dataTemp[16] }); + numb = sqlSerialNum.Split('-'); + sqlSerialNum = numb[0] + numb[1]; + cycleTime = 0; + + while (cycleTime < 3) + { + string sqlId = IdHelper.GetId(); + num = 0; + + //string sql = $"insert into tb_outputstateinfo_data(id,record_time,equipment_type,equipment_id,version_number,serialnumber,number,revoltage48," + + // $"recurrent48,revoltage24,recurrent24,revoltage12,recurrent12,voltage_multi,current_multi,voltage_ctd,current_ctd,voltage_adcp," + + // $"current_adcp,voltage_uv1,current_uv1,voltage_uv2,current_uv2,voltage_uv3,current_uv3,voltage_uv4,current_uv4,voltage_co2,current_co2,camvidvoltage,camvidcurrent) " + + // $"values('{sqlId}','{g_sqlRecordTime}','{g_sqlTerminalEquipmentType}','{g_sqlTerminalEquipmentId}','{g_sqlVersionNumber}','{sqlSerialNum}','{number}',FORMAT('{reOutputVoltage48}',2)," + + // $"FORMAT('{reOutputCurrent48}',2),FORMAT('{reOutputVoltage24}',2),FORMAT('{reOutputCurrent24}',2),FORMAT('{reOutputVoltage12}',2),FORMAT('{reOutputCurrent12}',2),FORMAT('{outputVoltageMulti}',2)," + + // $"FORMAT('{outputCurrentMulti}',2),FORMAT('{outputVoltageCTD}',2)," + + // $"FORMAT('{outputCurrentCTD}',2),FORMAT('{outputVoltageADCP}',2),FORMAT('{outputCurrentADCP}',2),FORMAT('{outputVoltageUV1}',2),FORMAT('{outputCurrentUV1}',2),FORMAT('{outputVoltageUV2}',2),FORMAT('{outputCurrentUV2}',2)," + + // $"FORMAT('{outputVoltageUV3}',2),FORMAT('{outputCurrentUV3}',2)," + + // $"FORMAT('{outputVoltageUV4}',2),FORMAT('{outputCurrentUV4}',2),FORMAT('{outputVoltageCO2}',2),FORMAT('{outputCurrentCO2}',2),FORMAT('{outputVoltageIma}',2),FORMAT('{outputCurrentIma}',2));"; + string sql = $"insert into tb_outputstateinfo_data(id,record_time,equipment_type,equipment_id,version_number,serialnumber,number," + $"recurrent48,recurrent24,recurrent12,current_multi,current_ctd," + $"current_adcp,current_uv1,current_uv2,current_uv3,current_uv4,current_co2,camvidvoltage) " + @@ -2771,138 +2840,305 @@ namespace ZTTMS_Manage_yibayiyi_20230320 } catch (Exception ex) { - Console.WriteLine("OutputStatusAbnormalInformationError:" + ex.ToString()); - EveryDayLog.WriteErrorDZ("OutputStatusAbnormalInformationError:" + ex.ToString()); + Console.WriteLine("OutputStatusInformationError:" + ex.ToString()); + EveryDayLog.WriteErrorDZ("OutputStatusInformationError:" + ex.ToString()); } if (num > 0) { - Console.WriteLine("电子腔异常输出端口状态信息插入成功!" + DateTime.Now); + Console.WriteLine("电子腔输出端口状态信息插入成功!" + DateTime.Now); break; } else { - Console.WriteLine("电子腔异常输出端口状态信息插入失败,重新进行插入!" + DateTime.Now); - EveryDayLog.WriteErrorDZ("电子腔异常输出端口状态信息插入失败,重新进行插入!"); + Console.WriteLine("电子腔输出端口状态信息插入失败,重新进行插入!" + DateTime.Now); + EveryDayLog.WriteErrorDZ("电子腔输出端口状态信息插入失败,重新进行插入!"); } cycleTime++; Thread.Sleep(1); } - } - #endregion + string sql2; + g_sqlRecordTime = DateTime.Now; + cycleTime = 0; - //平台通用应答 - TerminalAnswerVic(new byte[2] { dataTemp[1], dataTemp[2] }, new byte[2] { dataTemp[15], dataTemp[16] }); - } - - //接收终端文件传输 - else if (dataTemp[1] == 0x00 && dataTemp[2] == 0x04) - { - string fileType; - if (dataTemp[17] == 0x00) //日志文件 - { - fileType = "LogFile"; - } - else if (dataTemp[17] == 0x01) - { - fileType = "CameraFile"; - } - else if (dataTemp[17] == 0x02) - { - fileType = "VideoFile"; - } - else if (dataTemp[17] == 0x03) - { - fileType = "UpgradeFile"; - } - else if (dataTemp[17] == 0x04) - { - fileType = "ConfigFile"; - } - else if (dataTemp[17] == 0x05) - { - fileType = "DataFile"; - } - else - { - fileType = "ErrorFile"; - } - - int date = BitConverter.ToInt32(new byte[] { dataTemp[21], dataTemp[20], dataTemp[19], dataTemp[18] }, 0); - string fileName = BitConverter.ToString(dataTemp, 22, 30); - string[] fileName1 = fileName.Split('-'); - string fileName2 = ""; - for (int i = 0; i < fileName1.Length; i++) - { - if (fileName1[i] != "00") + try { - fileName2 += fileName1[i]; + string sql1 = $"select * from tb_stateinfo_state order by record_time desc limit 1;"; + MySqlDataReader dataReader = MySQL.ExecuteReader(sql1); + if (dataReader.Read()) + { + while (cycleTime < 3) + { + sqlId = IdHelper.GetId(); + num = 0; + + sql2 = $"insert into tb_stateinfo_state(id,record_time,equipment_type,equipment_id,version_number,serialnumber,number,pathstate_re48,state_re48,pathstate_re24,state_re24,pathstate_re12,state_re12," + + $"pathstate_multi,state_multi,pathstate_ctd,state_ctd,pathstate_adcp,state_adcp,pathstate_uv1,state_uv1,pathstate_uv2,state_uv2,pathstate_uv3,state_uv3,pathstate_uv4,state_uv4,pathstate_co2,state_co2,pathstate_image,state_image) values('{sqlId}','{g_sqlRecordTime}'," + + $"'{g_sqlTerminalEquipmentType}','{g_sqlTerminalEquipmentId}','{g_sqlVersionNumber}','{sqlSerialNum}','{number}','{Others.StatusJudgment(rePortState48)}','{Others.State(rePortState48)}','{Others.StatusJudgment(rePortState24)}','{Others.State(rePortState24)}'," + + $"'{Others.StatusJudgment(rePortState12)}','{Others.State(rePortState12)}','{Others.StatusJudgment(multiPortState)}','{Others.State(multiPortState)}','{Others.StatusJudgment(ctdPortState)}','{Others.State(ctdPortState)}','{Others.StatusJudgment(adcpPortState)}','{Others.State(adcpPortState)}','{Others.StatusJudgment(uv1PortState)}','{Others.State(uv1PortState)}'," + + $"'{Others.StatusJudgment(uv2PortState)}','{Others.State(uv2PortState)}','{Others.StatusJudgment(uv3PortState)}','{Others.State(uv3PortState)}','{Others.StatusJudgment(uv4PortState)}','{Others.State(uv4PortState)}','{Others.StatusJudgment(co2PortState)}','{Others.State(co2PortState)}','{Others.StatusJudgment(imaPortState)}','{Others.State(imaPortState)}');"; + + try + { + num = MySQL.ExecuteSql(sql2); + } + catch (Exception ex) + { + Console.WriteLine("OutputStatusInformationError:" + ex.ToString()); + EveryDayLog.WriteErrorDZ("OutputStatusInformationError:" + ex.ToString()); + } + + if (num > 0) + { + Console.WriteLine("电子腔输出端口状态信息插入成功!" + DateTime.Now); + + break; + } + else + { + Console.WriteLine("电子腔输出端口状态信息插入失败,重新进行插入!" + DateTime.Now); + EveryDayLog.WriteErrorDZ("电子腔输出端口状态信息插入失败,重新进行插入!"); + } + + cycleTime++; + Thread.Sleep(1); + } + } + + dataReader.Close(); + dataReader.Dispose(); + } + catch (Exception ex) + { + Console.WriteLine("OutputStatusInformationError:" + ex.Message); + EveryDayLog.WriteErrorDZ("OutputStatusInformationError:" + ex.Message); + } + #endregion + + + #region 异常数据 + if (reOutputCurrent48 < Limit.DZReportOutputCurrent48Min || reOutputCurrent48 > Limit.DZReportOutputCurrent48Max || + reOutputCurrent24 < Limit.DZReportOutputCurrent24Min || reOutputCurrent24 > Limit.DZReportOutputCurrent24Max || + reOutputCurrent12 < Limit.DZReportOutputCurrent12Min || reOutputCurrent12 > Limit.DZReportOutputCurrent12Max || + outputCurrentMulti < Limit.DZPortOutputCurrentEXO2Min || outputCurrentMulti > Limit.DZPortOutputCurrentEXO2Max || + outputCurrentCTD < Limit.DZPortOutputCurrentCTDMin || outputCurrentCTD > Limit.DZPortOutputCurrentCTDMax || + outputCurrentADCP < Limit.DZPortOutputCurrentADCPMin || outputCurrentADCP > Limit.DZPortOutputCurrentADCPMax || + outputCurrentUV1 < Limit.DZPortOutputCurrentUV1Min || outputCurrentUV1 > Limit.DZPortOutputCurrentUV1Max || + outputCurrentUV2 < Limit.DZPortOutputCurrentUV2Min || outputCurrentUV2 > Limit.DZPortOutputCurrentUV2Max || + outputCurrentUV3 < Limit.DZPortOutputCurrentUV3Min || outputCurrentUV3 > Limit.DZPortOutputCurrentUV3Max || + outputCurrentUV4 < Limit.DZPortOutputCurrentUV4Min || outputCurrentUV4 > Limit.DZPortOutputCurrentUV4Max || + outputVoltageIma < Limit.DZPortOutputVoltageImaMin || outputVoltageIma > Limit.DZPortOutputVoltageImaMax) + { + //数据异常 + Others.dzReceiveStateAbnormalDataTimes++; + + //数据存储 + g_sqlRecordTime = DateTime.Now; + sqlSerialNum = BitConverter.ToString(new byte[2] { dataTemp[15], dataTemp[16] }); + numb = sqlSerialNum.Split('-'); + sqlSerialNum = numb[0] + numb[1]; + cycleTime = 0; + + while (cycleTime < 3) + { + string sqlId = IdHelper.GetId(); + num = 0; + + string sql = $"insert into tb_outputstateinfo_data(id,record_time,equipment_type,equipment_id,version_number,serialnumber,number," + + $"recurrent48,recurrent24,recurrent12,current_multi,current_ctd," + + $"current_adcp,current_uv1,current_uv2,current_uv3,current_uv4,current_co2,camvidvoltage) " + + $"values('{sqlId}','{g_sqlRecordTime}','{g_sqlTerminalEquipmentType}','{g_sqlTerminalEquipmentId}','{g_sqlVersionNumber}','{sqlSerialNum}','{number}'," + + $"FORMAT('{reOutputCurrent48}',2),FORMAT('{reOutputCurrent24}',2),FORMAT('{reOutputCurrent12}',2),FORMAT('{outputCurrentMulti}',2)," + + $"FORMAT('{outputCurrentCTD}',2),FORMAT('{outputCurrentADCP}',2),FORMAT('{outputCurrentUV1}',2),FORMAT('{outputCurrentUV2}',2)," + + $"FORMAT('{outputCurrentUV3}',2),FORMAT('{outputCurrentUV4}',2),FORMAT('{outputCurrentCO2}',2),FORMAT('{outputVoltageIma}',2));"; + + try + { + num = MySQL.ExecuteSql(sql); + } + catch (Exception ex) + { + Console.WriteLine("OutputStatusAbnormalInformationError:" + ex.ToString()); + EveryDayLog.WriteErrorDZ("OutputStatusAbnormalInformationError:" + ex.ToString()); + } + + if (num > 0) + { + Console.WriteLine("电子腔异常输出端口状态信息插入成功!" + DateTime.Now); + break; + } + else + { + Console.WriteLine("电子腔异常输出端口状态信息插入失败,重新进行插入!" + DateTime.Now); + EveryDayLog.WriteErrorDZ("电子腔异常输出端口状态信息插入失败,重新进行插入!"); + } + + cycleTime++; + Thread.Sleep(1); + } + } + #endregion + + + //平台通用应答 + TerminalAnswerVic(new byte[2] { dataTemp[1], dataTemp[2] }, new byte[2] { dataTemp[15], dataTemp[16] }); + } + + //接收终端文件传输 + else if (dataTemp[1] == 0x00 && dataTemp[2] == 0x04) + { + string fileType; + if (dataTemp[17] == 0x00) //日志文件 + { + fileType = "LogFile"; + } + else if (dataTemp[17] == 0x01) + { + fileType = "CameraFile"; + } + else if (dataTemp[17] == 0x02) + { + fileType = "VideoFile"; + } + else if (dataTemp[17] == 0x03) + { + fileType = "UpgradeFile"; + } + else if (dataTemp[17] == 0x04) + { + fileType = "ConfigFile"; + } + else if (dataTemp[17] == 0x05) + { + fileType = "DataFile"; } else { - i++; + fileType = "ErrorFile"; + } + + int date = BitConverter.ToInt32(new byte[] { dataTemp[21], dataTemp[20], dataTemp[19], dataTemp[18] }, 0); + string fileName = BitConverter.ToString(dataTemp, 22, 30); + string[] fileName1 = fileName.Split('-'); + string fileName2 = ""; + for (int i = 0; i < fileName1.Length; i++) + { + if (fileName1[i] != "00") + { + fileName2 += fileName1[i]; + } + else + { + i++; + } + } + string fileName3 = HexToString(fileName2); + + int fileLength = BitConverter.ToInt32(new byte[] { dataTemp[55], dataTemp[54], dataTemp[53], dataTemp[52] }, 0); + g_fileNumber = BitConverter.ToInt32(new byte[] { dataTemp[59], dataTemp[58], dataTemp[57], dataTemp[56] }, 0); + g_currentFileNumber = BitConverter.ToInt32(new byte[] { dataTemp[63], dataTemp[62], dataTemp[61], dataTemp[60] }, 0); + + Console.WriteLine("日期:" + date); + Console.WriteLine("文件名称:" + fileName3); + Console.WriteLine("文件大小:" + fileLength); + Console.WriteLine("总文件个数:" + g_fileNumber); + + if (g_currentFileNumber == 1) + { + CallInvokeUIUpdate("UpdateprgFileTransferMax", g_fileNumber.ToString()); + CallInvokeUIUpdate("UpdatelblFileNum", g_fileNumber.ToString()); + } + + Console.WriteLine("当前文件数:" + g_currentFileNumber); + + receiveFileNumber++; + Console.WriteLine("接收文件数:" + receiveFileNumber); + + //CallInvokeUIUpdate("UpdatelblCurrentNum", g_currentFileNumber.ToString()); + CallInvokeUIUpdate("UpdateprgFileTransferValue", g_currentFileNumber.ToString()); + + //path = @"F:v\text\piaoliufuzi\filereceive\" + filetype + "\\" + filename; + //if (g_currentFileNumber == 1) + //{ + //获取当前.exe所在的文件夹位置 + //g_exePath = System.Environment.CurrentDirectory; + //新创建一个文件夹 + //System.IO.Directory.CreateDirectory(g_exePath + "/" + fileType + "/" + date); + if (!Directory.Exists(Others.totalPath + "DZ" + "/" + fileType + "/" + date)) + System.IO.Directory.CreateDirectory(Others.totalPath + "DZ" + "/" + fileType + "/" + date); + + g_savePath = Others.totalPath + "DZ" + "/" + fileType + "/" + date + "/" + fileName3; + //} + //Console.WriteLine("存储位置:" + g_savePath); + + try + { + FileStream fsWrite = new FileStream(g_savePath, FileMode.Append, FileAccess.Write); + fsWrite.Write(dataTemp, 64, dataTemp.Length - 66); + + //终端通用应答 + TerminalAnswerVic(new byte[2] { dataTemp[1], dataTemp[2] }, new byte[2] { dataTemp[15], dataTemp[16] }); + fsWrite.Close(); + } + catch (Exception ex) + { + Console.WriteLine(ex.Message); } } - string fileName3 = HexToString(fileName2); - int fileLength = BitConverter.ToInt32(new byte[] { dataTemp[55], dataTemp[54], dataTemp[53], dataTemp[52] }, 0); - g_fileNumber = BitConverter.ToInt32(new byte[] { dataTemp[59], dataTemp[58], dataTemp[57], dataTemp[56] }, 0); - g_currentFileNumber = BitConverter.ToInt32(new byte[] { dataTemp[63], dataTemp[62], dataTemp[61], dataTemp[60] }, 0); - - Console.WriteLine("日期:" + date); - Console.WriteLine("文件名称:" + fileName3); - Console.WriteLine("文件大小:" + fileLength); - Console.WriteLine("总文件个数:" + g_fileNumber); - - if (g_currentFileNumber == 1) + //其他情况 + else { - CallInvokeUIUpdate("UpdateprgFileTransferMax", g_fileNumber.ToString()); - CallInvokeUIUpdate("UpdatelblFileNum", g_fileNumber.ToString()); - } + Others.dzReceiveAbnormalAnalysisTimes++; - Console.WriteLine("当前文件数:" + g_currentFileNumber); + #region 解析错误指令存储 + sqlTime = DateTime.Now; + sqlSerialNum = BitConverter.ToString(new byte[2] { newDataTemp[15], newDataTemp[16] }); + numb = sqlSerialNum.Split('-'); + sqlSerialNum = numb[0] + numb[1]; + num = 0; + cycleTime = 0; + while (cycleTime < 3) + { + sqlId = IdHelper.GetId(); - receiveFileNumber++; - Console.WriteLine("接收文件数:" + receiveFileNumber); + string sql = $"insert into tb_stateinfo_analysiserror(id,record_time,equipment_type,equipment_id,version_number,serialnumber,code) " + + $"values('{sqlId}','{sqlTime}','{g_sqlTerminalEquipmentType}','{g_sqlTerminalEquipmentId}','{g_sqlVersionNumber}','{sqlSerialNum}','{BitConverter.ToString(newDataTemp)}');"; + try + { + num = MySQL.ExecuteSql(sql); + } + catch (Exception ex) + { + Console.WriteLine("Insert StateInfo Analysis Data Error:" + ex.Message); + EveryDayLog.WriteErrorDZ("Insert StateInfo Analysis Data Error:" + ex.Message); + } - //CallInvokeUIUpdate("UpdatelblCurrentNum", g_currentFileNumber.ToString()); - CallInvokeUIUpdate("UpdateprgFileTransferValue", g_currentFileNumber.ToString()); + if (num > 0) + { + Console.WriteLine("Insert StateInfo Analysis Data Success!" + DateTime.Now); + break; + } + else + { + Console.WriteLine("Insert StateInfo Analysis Data Default, Please Reinsert!" + DateTime.Now); + EveryDayLog.WriteErrorDZ("Insert StateInfo Analysis Data Default, Please Reinsert!"); + } - //path = @"F:v\text\piaoliufuzi\filereceive\" + filetype + "\\" + filename; - //if (g_currentFileNumber == 1) - //{ - //获取当前.exe所在的文件夹位置 - //g_exePath = System.Environment.CurrentDirectory; - //新创建一个文件夹 - //System.IO.Directory.CreateDirectory(g_exePath + "/" + fileType + "/" + date); - if (!Directory.Exists(Others.totalPath + "DZ" + "/" + fileType + "/" + date)) - System.IO.Directory.CreateDirectory(Others.totalPath + "DZ" + "/" + fileType + "/" + date); - - g_savePath = Others.totalPath + "DZ" + "/" + fileType + "/" + date + "/" + fileName3; - //} - //Console.WriteLine("存储位置:" + g_savePath); - - try - { - FileStream fsWrite = new FileStream(g_savePath, FileMode.Append, FileAccess.Write); - fsWrite.Write(dataTemp, 64, dataTemp.Length - 66); - - //终端通用应答 - TerminalAnswerVic(new byte[2] { dataTemp[1], dataTemp[2] }, new byte[2] { dataTemp[15], dataTemp[16] }); - fsWrite.Close(); - } - catch (Exception ex) - { - Console.WriteLine(ex.Message); + cycleTime++; + Thread.Sleep(1); + } + #endregion } } - - //其他情况 else { + //CRC校验未通过,平台通用应答回复消息错误 + Console.WriteLine("CRC校验未通过,或终端设备类型或终端设备id不存在!"); Others.dzReceiveAbnormalAnalysisTimes++; + TerminalAnswerErr(new byte[2] { dataTemp[1], dataTemp[2] }, new byte[2] { dataTemp[15], dataTemp[16] }); #region 解析错误指令存储 sqlTime = DateTime.Now; @@ -2944,58 +3180,36 @@ namespace ZTTMS_Manage_yibayiyi_20230320 #endregion } } - else - { - //CRC校验未通过,平台通用应答回复消息错误 - Console.WriteLine("CRC校验未通过,或终端设备类型或终端设备id不存在!"); - Others.dzReceiveAbnormalAnalysisTimes++; - TerminalAnswerErr(new byte[2] { dataTemp[1], dataTemp[2] }, new byte[2] { dataTemp[15], dataTemp[16] }); - - #region 解析错误指令存储 - sqlTime = DateTime.Now; - sqlSerialNum = BitConverter.ToString(new byte[2] { newDataTemp[15], newDataTemp[16] }); - numb = sqlSerialNum.Split('-'); - sqlSerialNum = numb[0] + numb[1]; - num = 0; - cycleTime = 0; - while (cycleTime < 3) - { - sqlId = IdHelper.GetId(); - - string sql = $"insert into tb_stateinfo_analysiserror(id,record_time,equipment_type,equipment_id,version_number,serialnumber,code) " + - $"values('{sqlId}','{sqlTime}','{g_sqlTerminalEquipmentType}','{g_sqlTerminalEquipmentId}','{g_sqlVersionNumber}','{sqlSerialNum}','{BitConverter.ToString(newDataTemp)}');"; - try - { - num = MySQL.ExecuteSql(sql); - } - catch (Exception ex) - { - Console.WriteLine("Insert StateInfo Analysis Data Error:" + ex.Message); - EveryDayLog.WriteErrorDZ("Insert StateInfo Analysis Data Error:" + ex.Message); - } - - if (num > 0) - { - Console.WriteLine("Insert StateInfo Analysis Data Success!" + DateTime.Now); - break; - } - else - { - Console.WriteLine("Insert StateInfo Analysis Data Default, Please Reinsert!" + DateTime.Now); - EveryDayLog.WriteErrorDZ("Insert StateInfo Analysis Data Default, Please Reinsert!"); - } - - cycleTime++; - Thread.Sleep(1); - } - #endregion - } } } + Thread.Sleep(1); + } + catch(Exception ex) + { + Console.WriteLine("DataAnalysisError:" + ex.Message); + EveryDayLog.WriteErrorDZ("DataAnalysisError:" + ex.Message); } - Thread.Sleep(1); } } + + public string JudgeState(byte code) + { + string state; + if (code == 0x00) + { + state = "关闭"; + } + else if (code == 0x01) + { + state = "打开"; + } + else + { + state = "error"; + } + + return state; + } #endregion @@ -3404,6 +3618,19 @@ namespace ZTTMS_Manage_yibayiyi_20230320 #endregion + #region 设置 + private void btnSetting1_Click(object sender, EventArgs e) + { + OpenChildForm(otherSettingForm); + } + + private void btnSetting2_Click(object sender, EventArgs e) + { + OpenChildForm(relayControlForm); + } + #endregion + + #region 其他 DeviceGovernForm deviceGovernForm = new DeviceGovernForm(); private void btnDeviceGovern_Click(object sender, EventArgs e) @@ -3797,6 +4024,18 @@ namespace ZTTMS_Manage_yibayiyi_20230320 btnPhotoelectricSeparationData.Text = "▷ 光电分离腔数据"; } } + + private void pnlSubSetting_VisibleChanged(object sender, EventArgs e) + { + if(pnlSubSetting.Visible == true) + { + btnSetting.Text = "▽ 设置"; + } + else + { + btnSetting.Text = "▷ 设置"; + } + } #endregion @@ -4202,6 +4441,8 @@ namespace ZTTMS_Manage_yibayiyi_20230320 cO2DataForm.CO2DataForm_FormClosing(null, null); cTDDataForm.CTDDataForm_FormClosing(null, null); mulitiDataForm.MulitiDataForm_FormClosing(null, null); + otherSettingForm.OtherSettingForm_FormClosing(null, null); + relayControlForm.RelayControlForm_FormClosing(null, null); } catch (Exception ex) { @@ -5606,6 +5847,7 @@ namespace ZTTMS_Manage_yibayiyi_20230320 EveryDayLog.WriteErrorOther("SendNorthError:" + ex.Message); } } + #endregion } diff --git a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/MainForm.resx b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/MainForm.resx index b146ea9..e866d9e 100644 --- a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/MainForm.resx +++ b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/MainForm.resx @@ -120,155 +120,155 @@ - iVBORw0KGgoAAAANSUhEUgAAAQAAAAAzCAYAAAB469bRAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAACJcSURBVHhe7d2JlxVFsgbw90fO9mafeTOOjrviArIo7oob - CipuICqLioqouCAuiIrtgoiKIqIgiogKboBgvvzl7WjLorr7bvQwh5vnxGlu3azMrMyIL76IzLr8z//+ - ++w0kIEM5NiUAQAMZCDHsAwAYCADOYZlAAADGcgxLAMAGMhAjmEZAMBABnIMy4QCwO9OOCv9Nk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3tduNAOcrb7wj/fDDvrT9053ZiJcVO2iqWxWOEXh//8MPZbzKR9s/TadMu6yn - uRlL+g4AFhel+3WehN+feHZaeP/DxTNBQ5MgGYgCLnv0qbRx0+bCCr7e+0166bU306XX31omoandfomJ - /M2/JqU/ZJp//Dkz08lTLym0uUpDGXsYukU09lCuC66+ccSTDK3f2FcWYFzmLbwXQERbP9i6LX38yafp - lTfeKn1u2vxhejfL62+9mx54bFWhrxfPviUtyYDEqykA6vbFDxSwrfczlniWaVfcULwy4/jLOFu22gdS - DM76mUvXx7vnznuXF6BS7l3xRNdz6D4h2/G5XyHbfbktoEivxPh79n5bAED+SZ9TLr0uA0RrzerS1H43 - AgCwjv0HDpTn++77H8quVztrIZS7Y/GDadfur8q9e7JtcJJHKu/UVwBgvCjLI089l25btCzd/8iTZfJt - /93zwKPpxVfXp63bPhmh0Z/u3FUoWBSGBRzCAHoVk6atmHhGfsq0S9O12WAeXPl0eu+DrWUcxjR3wZIC - XhThtOmXF+RWnnvp1QJcoSCecdGDj5ZxU7ZeGMDvTmgZA6GUc+YvKl7rmnl3pr+c2jK8f0yaUTyWgqou - evCxwphcZ5yUn8L96p9nFKYQFBIDUKep37FEnwzZ83319d70zIuvpKlXXF++0xeJf/O0V920IK195Y2y - zkKmLR9tTwuWLi/bvqMZlesAg2HwyvIqwK+p7lgibDzurAtKfun9Dz/Oz763GIxwU37BXPLy23Z8VsBg - Y2YD5qhqiKONsRexHlfMvT0dyM+mfLR9R+m33b7M7flX3Vic5PylD40AVuhKP8fcdwBAraLw7O9t+SgN - 5Tj6hXWvF6NDjcTSZ14wqxgjI4qifr8AQPJEUky8KbbiZYay92TYdiGiUIxdu79Mix96rKCvexdnIysZ - 4qzMYrjqhPs3w+MdGRjF7WRRYhE9IyM/I4+REfHuoTAoIG+FpWiXN1Ze2/BOuSfaqPbr33ZabK8qy59Y - 3RU4ae+vp00twBcFRcfcGKrQaMnylWnVmpeLp8VM3tuytbARyTTlYA5FnnzuxV+wqnof/55y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kJggg== diff --git a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/MySQL.cs b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/MySQL.cs index f0a1a68..fca973e 100644 --- a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/MySQL.cs +++ b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/MySQL.cs @@ -13,8 +13,8 @@ namespace ZTTMS_Manage_yibayiyi_20230320 { class MySQL { - //public static string connectionString = @"server=41.244.68.54;port=3306;user=root;password=zttZTT123!;database=daojiao;sslMode=none;charset=utf8;pooling=true;max pool size=1024;connect timeout = 20;AllowPublicKeyRetrieval=true;"; - public static string connectionString = @"server=127.0.0.1;port=3306;user=root;password=ztt12345;database=daojiao;sslMode=none;charset=utf8;pooling=true;max pool size=1024;connect timeout = 20;"; + public static string connectionString = @"server=41.244.68.54;port=3306;user=root;password=zttZTT123!;database=daojiao;sslMode=none;charset=utf8;pooling=true;max pool size=1024;connect timeout = 20;AllowPublicKeyRetrieval=true;"; + //public static string connectionString = @"server=127.0.0.1;port=3306;user=root;password=ztt12345;database=daojiao;sslMode=none;charset=utf8;pooling=true;max pool size=1024;connect timeout = 20;"; #region 公用方法 diff --git a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/OtherSettingForm.Designer.cs b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/OtherSettingForm.Designer.cs index adde4f6..9e70254 100644 --- a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/OtherSettingForm.Designer.cs +++ b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/OtherSettingForm.Designer.cs @@ -28,43 +28,55 @@ /// private void InitializeComponent() { + this.components = new System.ComponentModel.Container(); this.pnlTitle = new System.Windows.Forms.Panel(); this.lblTitle = new System.Windows.Forms.Label(); this.pnlContent = new System.Windows.Forms.Panel(); this.grpCycleSetting = new System.Windows.Forms.GroupBox(); this.lblClose = new System.Windows.Forms.Label(); this.lblOpen = new System.Windows.Forms.Label(); - this.groupBox11 = new System.Windows.Forms.GroupBox(); - this.rdoClose12 = new System.Windows.Forms.RadioButton(); - this.rdoOpen12 = new System.Windows.Forms.RadioButton(); - this.groupBox9 = new System.Windows.Forms.GroupBox(); - this.rdoClose24 = new System.Windows.Forms.RadioButton(); - this.rdoOpen24 = new System.Windows.Forms.RadioButton(); - this.groupBox10 = new System.Windows.Forms.GroupBox(); - this.rdoClose48 = new System.Windows.Forms.RadioButton(); - this.rdoOpen48 = new System.Windows.Forms.RadioButton(); - this.groupBox5 = new System.Windows.Forms.GroupBox(); - this.rdoCloseUV4 = new System.Windows.Forms.RadioButton(); - this.rdoOpenUV4 = new System.Windows.Forms.RadioButton(); - this.groupBox4 = new System.Windows.Forms.GroupBox(); - this.rdoCloseUV2 = new System.Windows.Forms.RadioButton(); - this.rdoOpenUV2 = new System.Windows.Forms.RadioButton(); this.groupBox6 = new System.Windows.Forms.GroupBox(); + this.groupBox7 = new System.Windows.Forms.GroupBox(); + this.chkCycleControlADCP = new System.Windows.Forms.CheckBox(); + this.txtCloseDurationADCP = new System.Windows.Forms.TextBox(); + this.txtOpenDurationADCP = new System.Windows.Forms.TextBox(); + this.label11 = new System.Windows.Forms.Label(); + this.label12 = new System.Windows.Forms.Label(); + this.dtpOpenTimeADCP = new System.Windows.Forms.DateTimePicker(); + this.label13 = new System.Windows.Forms.Label(); this.rdoCloseADCP = new System.Windows.Forms.RadioButton(); this.rdoOpenADCP = new System.Windows.Forms.RadioButton(); this.groupBox3 = new System.Windows.Forms.GroupBox(); + this.groupBox4 = new System.Windows.Forms.GroupBox(); + this.chkCycleControlEXO2 = new System.Windows.Forms.CheckBox(); + this.txtCloseDurationEXO2 = new System.Windows.Forms.TextBox(); + this.txtOpenDurationEXO2 = new System.Windows.Forms.TextBox(); + this.label5 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.dtpOpenTimeEXO2 = new System.Windows.Forms.DateTimePicker(); + this.label7 = new System.Windows.Forms.Label(); this.rdoCloseMulti = new System.Windows.Forms.RadioButton(); this.rdoOpenMulti = new System.Windows.Forms.RadioButton(); - this.groupBox7 = new System.Windows.Forms.GroupBox(); - this.rdoCloseUV3 = new System.Windows.Forms.RadioButton(); - this.rdoOpenUV3 = new System.Windows.Forms.RadioButton(); - this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.rdoCloseUV1 = new System.Windows.Forms.RadioButton(); - this.rdoOpenUV1 = new System.Windows.Forms.RadioButton(); this.groupBox8 = new System.Windows.Forms.GroupBox(); + this.groupBox5 = new System.Windows.Forms.GroupBox(); + this.txtCloseDurationCO2 = new System.Windows.Forms.TextBox(); + this.chkCycleControlCO2 = new System.Windows.Forms.CheckBox(); + this.txtOpenDurationCO2 = new System.Windows.Forms.TextBox(); + this.label8 = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); + this.dtpOpenTimeCO2 = new System.Windows.Forms.DateTimePicker(); + this.label10 = new System.Windows.Forms.Label(); this.rdoCloseCO2 = new System.Windows.Forms.RadioButton(); this.rdoOpenCO2 = new System.Windows.Forms.RadioButton(); this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.chkCycleControlCTD = new System.Windows.Forms.CheckBox(); + this.txtCloseDurationCTD = new System.Windows.Forms.TextBox(); + this.txtOpenDurationCTD = new System.Windows.Forms.TextBox(); + this.label4 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.dtpOpenTimeCTD = new System.Windows.Forms.DateTimePicker(); + this.label2 = new System.Windows.Forms.Label(); this.rdoCloseCTD = new System.Windows.Forms.RadioButton(); this.rdoOpenCTD = new System.Windows.Forms.RadioButton(); this.btnSetState = new System.Windows.Forms.Button(); @@ -73,20 +85,25 @@ this.rdoGDFL = new System.Windows.Forms.RadioButton(); this.rdoDZ = new System.Windows.Forms.RadioButton(); this.btnRestart = new System.Windows.Forms.Button(); + this.timerMonitorStartCTD = new System.Windows.Forms.Timer(this.components); + this.timerMonitorStopCTD = new System.Windows.Forms.Timer(this.components); + this.timerMonitorStartEXO2 = new System.Windows.Forms.Timer(this.components); + this.timerMonitorStopEXO2 = new System.Windows.Forms.Timer(this.components); + this.timerMonitorStartCO2 = new System.Windows.Forms.Timer(this.components); + this.timerMonitorStopCO2 = new System.Windows.Forms.Timer(this.components); + this.timerMonitorStartADCP = new System.Windows.Forms.Timer(this.components); + this.timerMonitorStopADCP = new System.Windows.Forms.Timer(this.components); this.pnlTitle.SuspendLayout(); this.pnlContent.SuspendLayout(); this.grpCycleSetting.SuspendLayout(); - this.groupBox11.SuspendLayout(); - this.groupBox9.SuspendLayout(); - this.groupBox10.SuspendLayout(); - this.groupBox5.SuspendLayout(); - this.groupBox4.SuspendLayout(); this.groupBox6.SuspendLayout(); - this.groupBox3.SuspendLayout(); this.groupBox7.SuspendLayout(); - this.groupBox2.SuspendLayout(); + this.groupBox3.SuspendLayout(); + this.groupBox4.SuspendLayout(); this.groupBox8.SuspendLayout(); + this.groupBox5.SuspendLayout(); this.groupBox1.SuspendLayout(); + this.groupBox2.SuspendLayout(); this.grpPowerSetting.SuspendLayout(); this.SuspendLayout(); // @@ -110,9 +127,9 @@ this.lblTitle.Location = new System.Drawing.Point(27, 25); this.lblTitle.Margin = new System.Windows.Forms.Padding(8, 0, 8, 0); this.lblTitle.Name = "lblTitle"; - this.lblTitle.Size = new System.Drawing.Size(157, 38); + this.lblTitle.Size = new System.Drawing.Size(174, 38); this.lblTitle.TabIndex = 0; - this.lblTitle.Text = "其他设置"; + this.lblTitle.Text = "继电控制1"; // // pnlContent // @@ -131,23 +148,16 @@ // this.grpCycleSetting.Controls.Add(this.lblClose); this.grpCycleSetting.Controls.Add(this.lblOpen); - this.grpCycleSetting.Controls.Add(this.groupBox11); - this.grpCycleSetting.Controls.Add(this.groupBox9); - this.grpCycleSetting.Controls.Add(this.groupBox10); - this.grpCycleSetting.Controls.Add(this.groupBox5); - this.grpCycleSetting.Controls.Add(this.groupBox4); this.grpCycleSetting.Controls.Add(this.groupBox6); this.grpCycleSetting.Controls.Add(this.groupBox3); - this.grpCycleSetting.Controls.Add(this.groupBox7); - this.grpCycleSetting.Controls.Add(this.groupBox2); this.grpCycleSetting.Controls.Add(this.groupBox8); this.grpCycleSetting.Controls.Add(this.groupBox1); this.grpCycleSetting.Controls.Add(this.btnSetState); this.grpCycleSetting.Font = new System.Drawing.Font("方正楷体简体", 24F); this.grpCycleSetting.ForeColor = System.Drawing.Color.Transparent; - this.grpCycleSetting.Location = new System.Drawing.Point(51, 211); + this.grpCycleSetting.Location = new System.Drawing.Point(51, 200); this.grpCycleSetting.Name = "grpCycleSetting"; - this.grpCycleSetting.Size = new System.Drawing.Size(1447, 531); + this.grpCycleSetting.Size = new System.Drawing.Size(1447, 550); this.grpCycleSetting.TabIndex = 1; this.grpCycleSetting.TabStop = false; this.grpCycleSetting.Text = "线路供电设置"; @@ -157,7 +167,7 @@ // this.lblClose.AutoSize = true; this.lblClose.Font = new System.Drawing.Font("方正楷体简体", 18F); - this.lblClose.Location = new System.Drawing.Point(1275, 375); + this.lblClose.Location = new System.Drawing.Point(859, 489); this.lblClose.Name = "lblClose"; this.lblClose.Size = new System.Drawing.Size(108, 27); this.lblClose.TabIndex = 16; @@ -168,210 +178,124 @@ // this.lblOpen.AutoSize = true; this.lblOpen.Font = new System.Drawing.Font("方正楷体简体", 18F); - this.lblOpen.Location = new System.Drawing.Point(1117, 375); + this.lblOpen.Location = new System.Drawing.Point(454, 489); this.lblOpen.Name = "lblOpen"; this.lblOpen.Size = new System.Drawing.Size(108, 27); this.lblOpen.TabIndex = 15; this.lblOpen.Text = "一键打开"; this.lblOpen.Click += new System.EventHandler(this.lblOpen_Click); // - // groupBox11 - // - this.groupBox11.Controls.Add(this.rdoClose12); - this.groupBox11.Controls.Add(this.rdoOpen12); - this.groupBox11.ForeColor = System.Drawing.Color.White; - this.groupBox11.Location = new System.Drawing.Point(727, 375); - this.groupBox11.Name = "groupBox11"; - this.groupBox11.Size = new System.Drawing.Size(311, 113); - this.groupBox11.TabIndex = 13; - this.groupBox11.TabStop = false; - this.groupBox11.Text = "预留12V继电控制"; - // - // rdoClose12 - // - this.rdoClose12.AutoSize = true; - this.rdoClose12.Font = new System.Drawing.Font("方正楷体简体", 21.75F); - this.rdoClose12.Location = new System.Drawing.Point(180, 58); - this.rdoClose12.Name = "rdoClose12"; - this.rdoClose12.Size = new System.Drawing.Size(90, 36); - this.rdoClose12.TabIndex = 1; - this.rdoClose12.TabStop = true; - this.rdoClose12.Text = "关闭"; - this.rdoClose12.UseVisualStyleBackColor = true; - // - // rdoOpen12 - // - this.rdoOpen12.AutoSize = true; - this.rdoOpen12.Font = new System.Drawing.Font("方正楷体简体", 21.75F); - this.rdoOpen12.Location = new System.Drawing.Point(40, 58); - this.rdoOpen12.Name = "rdoOpen12"; - this.rdoOpen12.Size = new System.Drawing.Size(90, 36); - this.rdoOpen12.TabIndex = 0; - this.rdoOpen12.TabStop = true; - this.rdoOpen12.Text = "打开"; - this.rdoOpen12.UseVisualStyleBackColor = true; - // - // groupBox9 - // - this.groupBox9.Controls.Add(this.rdoClose24); - this.groupBox9.Controls.Add(this.rdoOpen24); - this.groupBox9.ForeColor = System.Drawing.Color.White; - this.groupBox9.Location = new System.Drawing.Point(377, 375); - this.groupBox9.Name = "groupBox9"; - this.groupBox9.Size = new System.Drawing.Size(311, 113); - this.groupBox9.TabIndex = 12; - this.groupBox9.TabStop = false; - this.groupBox9.Text = "预留24V继电控制"; - // - // rdoClose24 - // - this.rdoClose24.AutoSize = true; - this.rdoClose24.Font = new System.Drawing.Font("方正楷体简体", 21.75F); - this.rdoClose24.Location = new System.Drawing.Point(180, 58); - this.rdoClose24.Name = "rdoClose24"; - this.rdoClose24.Size = new System.Drawing.Size(90, 36); - this.rdoClose24.TabIndex = 1; - this.rdoClose24.TabStop = true; - this.rdoClose24.Text = "关闭"; - this.rdoClose24.UseVisualStyleBackColor = true; - // - // rdoOpen24 - // - this.rdoOpen24.AutoSize = true; - this.rdoOpen24.Font = new System.Drawing.Font("方正楷体简体", 21.75F); - this.rdoOpen24.Location = new System.Drawing.Point(40, 58); - this.rdoOpen24.Name = "rdoOpen24"; - this.rdoOpen24.Size = new System.Drawing.Size(90, 36); - this.rdoOpen24.TabIndex = 0; - this.rdoOpen24.TabStop = true; - this.rdoOpen24.Text = "打开"; - this.rdoOpen24.UseVisualStyleBackColor = true; - // - // groupBox10 - // - this.groupBox10.Controls.Add(this.rdoClose48); - this.groupBox10.Controls.Add(this.rdoOpen48); - this.groupBox10.ForeColor = System.Drawing.Color.White; - this.groupBox10.Location = new System.Drawing.Point(38, 375); - this.groupBox10.Name = "groupBox10"; - this.groupBox10.Size = new System.Drawing.Size(311, 113); - this.groupBox10.TabIndex = 11; - this.groupBox10.TabStop = false; - this.groupBox10.Text = "预留48V继电控制"; - // - // rdoClose48 - // - this.rdoClose48.AutoSize = true; - this.rdoClose48.Font = new System.Drawing.Font("方正楷体简体", 21.75F); - this.rdoClose48.Location = new System.Drawing.Point(179, 58); - this.rdoClose48.Name = "rdoClose48"; - this.rdoClose48.Size = new System.Drawing.Size(90, 36); - this.rdoClose48.TabIndex = 1; - this.rdoClose48.TabStop = true; - this.rdoClose48.Text = "关闭"; - this.rdoClose48.UseVisualStyleBackColor = true; - // - // rdoOpen48 - // - this.rdoOpen48.AutoSize = true; - this.rdoOpen48.Font = new System.Drawing.Font("方正楷体简体", 21.75F); - this.rdoOpen48.Location = new System.Drawing.Point(39, 58); - this.rdoOpen48.Name = "rdoOpen48"; - this.rdoOpen48.Size = new System.Drawing.Size(90, 36); - this.rdoOpen48.TabIndex = 0; - this.rdoOpen48.TabStop = true; - this.rdoOpen48.Text = "打开"; - this.rdoOpen48.UseVisualStyleBackColor = true; - // - // groupBox5 - // - this.groupBox5.Controls.Add(this.rdoCloseUV4); - this.groupBox5.Controls.Add(this.rdoOpenUV4); - this.groupBox5.ForeColor = System.Drawing.Color.White; - this.groupBox5.Location = new System.Drawing.Point(1082, 219); - this.groupBox5.Name = "groupBox5"; - this.groupBox5.Size = new System.Drawing.Size(322, 113); - this.groupBox5.TabIndex = 14; - this.groupBox5.TabStop = false; - this.groupBox5.Text = "UV灯4继电控制"; - // - // rdoCloseUV4 - // - this.rdoCloseUV4.AutoSize = true; - this.rdoCloseUV4.Font = new System.Drawing.Font("方正楷体简体", 21.75F); - this.rdoCloseUV4.Location = new System.Drawing.Point(180, 58); - this.rdoCloseUV4.Name = "rdoCloseUV4"; - this.rdoCloseUV4.Size = new System.Drawing.Size(90, 36); - this.rdoCloseUV4.TabIndex = 1; - this.rdoCloseUV4.TabStop = true; - this.rdoCloseUV4.Text = "关闭"; - this.rdoCloseUV4.UseVisualStyleBackColor = true; - // - // rdoOpenUV4 - // - this.rdoOpenUV4.AutoSize = true; - this.rdoOpenUV4.Font = new System.Drawing.Font("方正楷体简体", 21.75F); - this.rdoOpenUV4.Location = new System.Drawing.Point(40, 58); - this.rdoOpenUV4.Name = "rdoOpenUV4"; - this.rdoOpenUV4.Size = new System.Drawing.Size(90, 36); - this.rdoOpenUV4.TabIndex = 0; - this.rdoOpenUV4.TabStop = true; - this.rdoOpenUV4.Text = "打开"; - this.rdoOpenUV4.UseVisualStyleBackColor = true; - // - // groupBox4 - // - this.groupBox4.Controls.Add(this.rdoCloseUV2); - this.groupBox4.Controls.Add(this.rdoOpenUV2); - this.groupBox4.ForeColor = System.Drawing.Color.White; - this.groupBox4.Location = new System.Drawing.Point(377, 219); - this.groupBox4.Name = "groupBox4"; - this.groupBox4.Size = new System.Drawing.Size(311, 113); - this.groupBox4.TabIndex = 10; - this.groupBox4.TabStop = false; - this.groupBox4.Text = "UV灯2继电控制"; - // - // rdoCloseUV2 - // - this.rdoCloseUV2.AutoSize = true; - this.rdoCloseUV2.Font = new System.Drawing.Font("方正楷体简体", 21.75F); - this.rdoCloseUV2.Location = new System.Drawing.Point(180, 58); - this.rdoCloseUV2.Name = "rdoCloseUV2"; - this.rdoCloseUV2.Size = new System.Drawing.Size(90, 36); - this.rdoCloseUV2.TabIndex = 1; - this.rdoCloseUV2.TabStop = true; - this.rdoCloseUV2.Text = "关闭"; - this.rdoCloseUV2.UseVisualStyleBackColor = true; - // - // rdoOpenUV2 - // - this.rdoOpenUV2.AutoSize = true; - this.rdoOpenUV2.Font = new System.Drawing.Font("方正楷体简体", 21.75F); - this.rdoOpenUV2.Location = new System.Drawing.Point(40, 58); - this.rdoOpenUV2.Name = "rdoOpenUV2"; - this.rdoOpenUV2.Size = new System.Drawing.Size(90, 36); - this.rdoOpenUV2.TabIndex = 0; - this.rdoOpenUV2.TabStop = true; - this.rdoOpenUV2.Text = "打开"; - this.rdoOpenUV2.UseVisualStyleBackColor = true; - // // groupBox6 // + this.groupBox6.Controls.Add(this.groupBox7); this.groupBox6.Controls.Add(this.rdoCloseADCP); this.groupBox6.Controls.Add(this.rdoOpenADCP); this.groupBox6.ForeColor = System.Drawing.Color.White; - this.groupBox6.Location = new System.Drawing.Point(1082, 60); + this.groupBox6.Location = new System.Drawing.Point(1085, 50); this.groupBox6.Name = "groupBox6"; - this.groupBox6.Size = new System.Drawing.Size(322, 113); + this.groupBox6.Size = new System.Drawing.Size(322, 394); this.groupBox6.TabIndex = 12; this.groupBox6.TabStop = false; this.groupBox6.Text = "ADCP继电控制"; // + // groupBox7 + // + this.groupBox7.Controls.Add(this.chkCycleControlADCP); + this.groupBox7.Controls.Add(this.txtCloseDurationADCP); + this.groupBox7.Controls.Add(this.txtOpenDurationADCP); + this.groupBox7.Controls.Add(this.label11); + this.groupBox7.Controls.Add(this.label12); + this.groupBox7.Controls.Add(this.dtpOpenTimeADCP); + this.groupBox7.Controls.Add(this.label13); + this.groupBox7.Font = new System.Drawing.Font("方正楷体简体", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.groupBox7.ForeColor = System.Drawing.Color.White; + this.groupBox7.Location = new System.Drawing.Point(21, 102); + this.groupBox7.Name = "groupBox7"; + this.groupBox7.Size = new System.Drawing.Size(278, 280); + this.groupBox7.TabIndex = 11; + this.groupBox7.TabStop = false; + this.groupBox7.Text = "周期控制"; + // + // chkCycleControlADCP + // + this.chkCycleControlADCP.AutoSize = true; + this.chkCycleControlADCP.Font = new System.Drawing.Font("方正楷体简体", 18F); + this.chkCycleControlADCP.Location = new System.Drawing.Point(34, 49); + this.chkCycleControlADCP.Name = "chkCycleControlADCP"; + this.chkCycleControlADCP.Size = new System.Drawing.Size(127, 31); + this.chkCycleControlADCP.TabIndex = 23; + this.chkCycleControlADCP.Text = "周期控制"; + this.chkCycleControlADCP.UseVisualStyleBackColor = true; + this.chkCycleControlADCP.CheckedChanged += new System.EventHandler(this.chkCycleControlADCP_CheckedChanged); + // + // txtCloseDurationADCP + // + this.txtCloseDurationADCP.Font = new System.Drawing.Font("方正楷体简体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.txtCloseDurationADCP.Location = new System.Drawing.Point(148, 231); + this.txtCloseDurationADCP.Name = "txtCloseDurationADCP"; + this.txtCloseDurationADCP.Size = new System.Drawing.Size(100, 35); + this.txtCloseDurationADCP.TabIndex = 21; + this.txtCloseDurationADCP.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.txtCloseDurationADCP.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtCloseDurationADCP_KeyPress); + // + // txtOpenDurationADCP + // + this.txtOpenDurationADCP.Font = new System.Drawing.Font("方正楷体简体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.txtOpenDurationADCP.Location = new System.Drawing.Point(148, 186); + this.txtOpenDurationADCP.Name = "txtOpenDurationADCP"; + this.txtOpenDurationADCP.Size = new System.Drawing.Size(100, 35); + this.txtOpenDurationADCP.TabIndex = 20; + this.txtOpenDurationADCP.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.txtOpenDurationADCP.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtOpenDurationADCP_KeyPress); + // + // label11 + // + this.label11.AutoSize = true; + this.label11.Font = new System.Drawing.Font("方正楷体简体", 18F); + this.label11.Location = new System.Drawing.Point(27, 235); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(132, 27); + this.label11.TabIndex = 19; + this.label11.Text = "关闭时长:"; + // + // label12 + // + this.label12.AutoSize = true; + this.label12.Font = new System.Drawing.Font("方正楷体简体", 18F); + this.label12.Location = new System.Drawing.Point(27, 194); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(132, 27); + this.label12.TabIndex = 18; + this.label12.Text = "打开时长:"; + // + // dtpOpenTimeADCP + // + this.dtpOpenTimeADCP.CustomFormat = "yyyy/MM/dd HH:mm"; + this.dtpOpenTimeADCP.Font = new System.Drawing.Font("方正楷体简体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.dtpOpenTimeADCP.Format = System.Windows.Forms.DateTimePickerFormat.Custom; + this.dtpOpenTimeADCP.Location = new System.Drawing.Point(34, 134); + this.dtpOpenTimeADCP.MaxDate = new System.DateTime(2023, 1, 1, 0, 0, 0, 0); + this.dtpOpenTimeADCP.MinDate = new System.DateTime(2023, 1, 1, 0, 0, 0, 0); + this.dtpOpenTimeADCP.Name = "dtpOpenTimeADCP"; + this.dtpOpenTimeADCP.Size = new System.Drawing.Size(216, 35); + this.dtpOpenTimeADCP.TabIndex = 17; + this.dtpOpenTimeADCP.Value = new System.DateTime(2023, 1, 1, 0, 0, 0, 0); + // + // label13 + // + this.label13.AutoSize = true; + this.label13.Font = new System.Drawing.Font("方正楷体简体", 18F); + this.label13.Location = new System.Drawing.Point(29, 94); + this.label13.Name = "label13"; + this.label13.Size = new System.Drawing.Size(132, 27); + this.label13.TabIndex = 17; + this.label13.Text = "打开时间:"; + // // rdoCloseADCP // this.rdoCloseADCP.AutoSize = true; this.rdoCloseADCP.Font = new System.Drawing.Font("方正楷体简体", 21.75F); - this.rdoCloseADCP.Location = new System.Drawing.Point(180, 58); + this.rdoCloseADCP.Location = new System.Drawing.Point(182, 52); this.rdoCloseADCP.Name = "rdoCloseADCP"; this.rdoCloseADCP.Size = new System.Drawing.Size(90, 36); this.rdoCloseADCP.TabIndex = 1; @@ -383,7 +307,7 @@ // this.rdoOpenADCP.AutoSize = true; this.rdoOpenADCP.Font = new System.Drawing.Font("方正楷体简体", 21.75F); - this.rdoOpenADCP.Location = new System.Drawing.Point(40, 58); + this.rdoOpenADCP.Location = new System.Drawing.Point(42, 52); this.rdoOpenADCP.Name = "rdoOpenADCP"; this.rdoOpenADCP.Size = new System.Drawing.Size(90, 36); this.rdoOpenADCP.TabIndex = 0; @@ -393,21 +317,115 @@ // // groupBox3 // + this.groupBox3.Controls.Add(this.groupBox4); this.groupBox3.Controls.Add(this.rdoCloseMulti); this.groupBox3.Controls.Add(this.rdoOpenMulti); this.groupBox3.ForeColor = System.Drawing.Color.White; - this.groupBox3.Location = new System.Drawing.Point(377, 60); + this.groupBox3.Location = new System.Drawing.Point(380, 50); this.groupBox3.Name = "groupBox3"; - this.groupBox3.Size = new System.Drawing.Size(311, 113); + this.groupBox3.Size = new System.Drawing.Size(311, 394); this.groupBox3.TabIndex = 9; this.groupBox3.TabStop = false; this.groupBox3.Text = "EXO2继电控制"; // + // groupBox4 + // + this.groupBox4.Controls.Add(this.chkCycleControlEXO2); + this.groupBox4.Controls.Add(this.txtCloseDurationEXO2); + this.groupBox4.Controls.Add(this.txtOpenDurationEXO2); + this.groupBox4.Controls.Add(this.label5); + this.groupBox4.Controls.Add(this.label6); + this.groupBox4.Controls.Add(this.dtpOpenTimeEXO2); + this.groupBox4.Controls.Add(this.label7); + this.groupBox4.Font = new System.Drawing.Font("方正楷体简体", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.groupBox4.ForeColor = System.Drawing.Color.White; + this.groupBox4.Location = new System.Drawing.Point(18, 102); + this.groupBox4.Name = "groupBox4"; + this.groupBox4.Size = new System.Drawing.Size(278, 280); + this.groupBox4.TabIndex = 22; + this.groupBox4.TabStop = false; + this.groupBox4.Text = "周期控制"; + // + // chkCycleControlEXO2 + // + this.chkCycleControlEXO2.AutoSize = true; + this.chkCycleControlEXO2.Font = new System.Drawing.Font("方正楷体简体", 18F); + this.chkCycleControlEXO2.Location = new System.Drawing.Point(32, 49); + this.chkCycleControlEXO2.Name = "chkCycleControlEXO2"; + this.chkCycleControlEXO2.Size = new System.Drawing.Size(127, 31); + this.chkCycleControlEXO2.TabIndex = 24; + this.chkCycleControlEXO2.Text = "周期控制"; + this.chkCycleControlEXO2.UseVisualStyleBackColor = true; + this.chkCycleControlEXO2.CheckedChanged += new System.EventHandler(this.chkCycleControlEXO2_CheckedChanged); + // + // txtCloseDurationEXO2 + // + this.txtCloseDurationEXO2.Font = new System.Drawing.Font("方正楷体简体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.txtCloseDurationEXO2.Location = new System.Drawing.Point(148, 231); + this.txtCloseDurationEXO2.Name = "txtCloseDurationEXO2"; + this.txtCloseDurationEXO2.Size = new System.Drawing.Size(100, 35); + this.txtCloseDurationEXO2.TabIndex = 21; + this.txtCloseDurationEXO2.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.txtCloseDurationEXO2.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtCloseDurationEXO2_KeyPress); + // + // txtOpenDurationEXO2 + // + this.txtOpenDurationEXO2.Font = new System.Drawing.Font("方正楷体简体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.txtOpenDurationEXO2.Location = new System.Drawing.Point(148, 186); + this.txtOpenDurationEXO2.Name = "txtOpenDurationEXO2"; + this.txtOpenDurationEXO2.Size = new System.Drawing.Size(100, 35); + this.txtOpenDurationEXO2.TabIndex = 20; + this.txtOpenDurationEXO2.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.txtOpenDurationEXO2.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtOpenDurationEXO2_KeyPress); + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Font = new System.Drawing.Font("方正楷体简体", 18F); + this.label5.Location = new System.Drawing.Point(27, 235); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(132, 27); + this.label5.TabIndex = 19; + this.label5.Text = "关闭时长:"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Font = new System.Drawing.Font("方正楷体简体", 18F); + this.label6.Location = new System.Drawing.Point(27, 194); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(132, 27); + this.label6.TabIndex = 18; + this.label6.Text = "打开时长:"; + // + // dtpOpenTimeEXO2 + // + this.dtpOpenTimeEXO2.CustomFormat = "yyyy/MM/dd HH:mm"; + this.dtpOpenTimeEXO2.Font = new System.Drawing.Font("方正楷体简体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.dtpOpenTimeEXO2.Format = System.Windows.Forms.DateTimePickerFormat.Custom; + this.dtpOpenTimeEXO2.Location = new System.Drawing.Point(34, 134); + this.dtpOpenTimeEXO2.MaxDate = new System.DateTime(2023, 1, 1, 0, 0, 0, 0); + this.dtpOpenTimeEXO2.MinDate = new System.DateTime(2023, 1, 1, 0, 0, 0, 0); + this.dtpOpenTimeEXO2.Name = "dtpOpenTimeEXO2"; + this.dtpOpenTimeEXO2.Size = new System.Drawing.Size(216, 35); + this.dtpOpenTimeEXO2.TabIndex = 17; + this.dtpOpenTimeEXO2.Value = new System.DateTime(2023, 1, 1, 0, 0, 0, 0); + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Font = new System.Drawing.Font("方正楷体简体", 18F); + this.label7.Location = new System.Drawing.Point(29, 94); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(132, 27); + this.label7.TabIndex = 17; + this.label7.Text = "打开时间:"; + // // rdoCloseMulti // this.rdoCloseMulti.AutoSize = true; this.rdoCloseMulti.Font = new System.Drawing.Font("方正楷体简体", 21.75F); - this.rdoCloseMulti.Location = new System.Drawing.Point(180, 58); + this.rdoCloseMulti.Location = new System.Drawing.Point(176, 52); this.rdoCloseMulti.Name = "rdoCloseMulti"; this.rdoCloseMulti.Size = new System.Drawing.Size(90, 36); this.rdoCloseMulti.TabIndex = 1; @@ -419,7 +437,7 @@ // this.rdoOpenMulti.AutoSize = true; this.rdoOpenMulti.Font = new System.Drawing.Font("方正楷体简体", 21.75F); - this.rdoOpenMulti.Location = new System.Drawing.Point(40, 58); + this.rdoOpenMulti.Location = new System.Drawing.Point(36, 52); this.rdoOpenMulti.Name = "rdoOpenMulti"; this.rdoOpenMulti.Size = new System.Drawing.Size(90, 36); this.rdoOpenMulti.TabIndex = 0; @@ -427,95 +445,117 @@ this.rdoOpenMulti.Text = "打开"; this.rdoOpenMulti.UseVisualStyleBackColor = true; // - // groupBox7 - // - this.groupBox7.Controls.Add(this.rdoCloseUV3); - this.groupBox7.Controls.Add(this.rdoOpenUV3); - this.groupBox7.ForeColor = System.Drawing.Color.White; - this.groupBox7.Location = new System.Drawing.Point(727, 219); - this.groupBox7.Name = "groupBox7"; - this.groupBox7.Size = new System.Drawing.Size(322, 113); - this.groupBox7.TabIndex = 13; - this.groupBox7.TabStop = false; - this.groupBox7.Text = "UV灯3继电控制"; - // - // rdoCloseUV3 - // - this.rdoCloseUV3.AutoSize = true; - this.rdoCloseUV3.Font = new System.Drawing.Font("方正楷体简体", 21.75F); - this.rdoCloseUV3.Location = new System.Drawing.Point(179, 58); - this.rdoCloseUV3.Name = "rdoCloseUV3"; - this.rdoCloseUV3.Size = new System.Drawing.Size(90, 36); - this.rdoCloseUV3.TabIndex = 1; - this.rdoCloseUV3.TabStop = true; - this.rdoCloseUV3.Text = "关闭"; - this.rdoCloseUV3.UseVisualStyleBackColor = true; - // - // rdoOpenUV3 - // - this.rdoOpenUV3.AutoSize = true; - this.rdoOpenUV3.Font = new System.Drawing.Font("方正楷体简体", 21.75F); - this.rdoOpenUV3.Location = new System.Drawing.Point(39, 58); - this.rdoOpenUV3.Name = "rdoOpenUV3"; - this.rdoOpenUV3.Size = new System.Drawing.Size(90, 36); - this.rdoOpenUV3.TabIndex = 0; - this.rdoOpenUV3.TabStop = true; - this.rdoOpenUV3.Text = "打开"; - this.rdoOpenUV3.UseVisualStyleBackColor = true; - // - // groupBox2 - // - this.groupBox2.Controls.Add(this.rdoCloseUV1); - this.groupBox2.Controls.Add(this.rdoOpenUV1); - this.groupBox2.ForeColor = System.Drawing.Color.White; - this.groupBox2.Location = new System.Drawing.Point(38, 219); - this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(311, 113); - this.groupBox2.TabIndex = 9; - this.groupBox2.TabStop = false; - this.groupBox2.Text = "UV灯1继电控制"; - // - // rdoCloseUV1 - // - this.rdoCloseUV1.AutoSize = true; - this.rdoCloseUV1.Font = new System.Drawing.Font("方正楷体简体", 21.75F); - this.rdoCloseUV1.Location = new System.Drawing.Point(179, 58); - this.rdoCloseUV1.Name = "rdoCloseUV1"; - this.rdoCloseUV1.Size = new System.Drawing.Size(90, 36); - this.rdoCloseUV1.TabIndex = 1; - this.rdoCloseUV1.TabStop = true; - this.rdoCloseUV1.Text = "关闭"; - this.rdoCloseUV1.UseVisualStyleBackColor = true; - // - // rdoOpenUV1 - // - this.rdoOpenUV1.AutoSize = true; - this.rdoOpenUV1.Font = new System.Drawing.Font("方正楷体简体", 21.75F); - this.rdoOpenUV1.Location = new System.Drawing.Point(39, 58); - this.rdoOpenUV1.Name = "rdoOpenUV1"; - this.rdoOpenUV1.Size = new System.Drawing.Size(90, 36); - this.rdoOpenUV1.TabIndex = 0; - this.rdoOpenUV1.TabStop = true; - this.rdoOpenUV1.Text = "打开"; - this.rdoOpenUV1.UseVisualStyleBackColor = true; - // // groupBox8 // + this.groupBox8.Controls.Add(this.groupBox5); this.groupBox8.Controls.Add(this.rdoCloseCO2); this.groupBox8.Controls.Add(this.rdoOpenCO2); this.groupBox8.ForeColor = System.Drawing.Color.White; - this.groupBox8.Location = new System.Drawing.Point(727, 60); + this.groupBox8.Location = new System.Drawing.Point(728, 50); this.groupBox8.Name = "groupBox8"; - this.groupBox8.Size = new System.Drawing.Size(322, 113); + this.groupBox8.Size = new System.Drawing.Size(322, 394); this.groupBox8.TabIndex = 11; this.groupBox8.TabStop = false; this.groupBox8.Text = "CO2继电控制"; // + // groupBox5 + // + this.groupBox5.Controls.Add(this.txtCloseDurationCO2); + this.groupBox5.Controls.Add(this.chkCycleControlCO2); + this.groupBox5.Controls.Add(this.txtOpenDurationCO2); + this.groupBox5.Controls.Add(this.label8); + this.groupBox5.Controls.Add(this.label9); + this.groupBox5.Controls.Add(this.dtpOpenTimeCO2); + this.groupBox5.Controls.Add(this.label10); + this.groupBox5.Font = new System.Drawing.Font("方正楷体简体", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.groupBox5.ForeColor = System.Drawing.Color.White; + this.groupBox5.Location = new System.Drawing.Point(21, 102); + this.groupBox5.Name = "groupBox5"; + this.groupBox5.Size = new System.Drawing.Size(278, 280); + this.groupBox5.TabIndex = 11; + this.groupBox5.TabStop = false; + this.groupBox5.Text = "周期控制"; + // + // txtCloseDurationCO2 + // + this.txtCloseDurationCO2.Font = new System.Drawing.Font("方正楷体简体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.txtCloseDurationCO2.Location = new System.Drawing.Point(148, 231); + this.txtCloseDurationCO2.Name = "txtCloseDurationCO2"; + this.txtCloseDurationCO2.Size = new System.Drawing.Size(100, 35); + this.txtCloseDurationCO2.TabIndex = 21; + this.txtCloseDurationCO2.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.txtCloseDurationCO2.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtCloseDurationCO2_KeyPress); + // + // chkCycleControlCO2 + // + this.chkCycleControlCO2.AutoSize = true; + this.chkCycleControlCO2.Font = new System.Drawing.Font("方正楷体简体", 18F); + this.chkCycleControlCO2.Location = new System.Drawing.Point(32, 49); + this.chkCycleControlCO2.Name = "chkCycleControlCO2"; + this.chkCycleControlCO2.Size = new System.Drawing.Size(127, 31); + this.chkCycleControlCO2.TabIndex = 22; + this.chkCycleControlCO2.Text = "周期控制"; + this.chkCycleControlCO2.UseVisualStyleBackColor = true; + this.chkCycleControlCO2.CheckedChanged += new System.EventHandler(this.chkCycleControlCO2_CheckedChanged); + // + // txtOpenDurationCO2 + // + this.txtOpenDurationCO2.Font = new System.Drawing.Font("方正楷体简体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.txtOpenDurationCO2.Location = new System.Drawing.Point(148, 186); + this.txtOpenDurationCO2.Name = "txtOpenDurationCO2"; + this.txtOpenDurationCO2.Size = new System.Drawing.Size(100, 35); + this.txtOpenDurationCO2.TabIndex = 20; + this.txtOpenDurationCO2.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.txtOpenDurationCO2.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtOpenDurationCO2_KeyPress); + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Font = new System.Drawing.Font("方正楷体简体", 18F); + this.label8.Location = new System.Drawing.Point(27, 235); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(132, 27); + this.label8.TabIndex = 19; + this.label8.Text = "关闭时长:"; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Font = new System.Drawing.Font("方正楷体简体", 18F); + this.label9.Location = new System.Drawing.Point(27, 194); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(132, 27); + this.label9.TabIndex = 18; + this.label9.Text = "打开时长:"; + // + // dtpOpenTimeCO2 + // + this.dtpOpenTimeCO2.CustomFormat = "yyyy/MM/dd HH:mm"; + this.dtpOpenTimeCO2.Font = new System.Drawing.Font("方正楷体简体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.dtpOpenTimeCO2.Format = System.Windows.Forms.DateTimePickerFormat.Custom; + this.dtpOpenTimeCO2.Location = new System.Drawing.Point(34, 134); + this.dtpOpenTimeCO2.MaxDate = new System.DateTime(2023, 1, 1, 0, 0, 0, 0); + this.dtpOpenTimeCO2.MinDate = new System.DateTime(2023, 1, 1, 0, 0, 0, 0); + this.dtpOpenTimeCO2.Name = "dtpOpenTimeCO2"; + this.dtpOpenTimeCO2.Size = new System.Drawing.Size(217, 35); + this.dtpOpenTimeCO2.TabIndex = 17; + this.dtpOpenTimeCO2.Value = new System.DateTime(2023, 1, 1, 0, 0, 0, 0); + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Font = new System.Drawing.Font("方正楷体简体", 18F); + this.label10.Location = new System.Drawing.Point(29, 94); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(132, 27); + this.label10.TabIndex = 17; + this.label10.Text = "打开时间:"; + // // rdoCloseCO2 // this.rdoCloseCO2.AutoSize = true; this.rdoCloseCO2.Font = new System.Drawing.Font("方正楷体简体", 21.75F); - this.rdoCloseCO2.Location = new System.Drawing.Point(179, 58); + this.rdoCloseCO2.Location = new System.Drawing.Point(182, 52); this.rdoCloseCO2.Name = "rdoCloseCO2"; this.rdoCloseCO2.Size = new System.Drawing.Size(90, 36); this.rdoCloseCO2.TabIndex = 1; @@ -527,7 +567,7 @@ // this.rdoOpenCO2.AutoSize = true; this.rdoOpenCO2.Font = new System.Drawing.Font("方正楷体简体", 21.75F); - this.rdoOpenCO2.Location = new System.Drawing.Point(39, 58); + this.rdoOpenCO2.Location = new System.Drawing.Point(42, 52); this.rdoOpenCO2.Name = "rdoOpenCO2"; this.rdoOpenCO2.Size = new System.Drawing.Size(90, 36); this.rdoOpenCO2.TabIndex = 0; @@ -537,21 +577,115 @@ // // groupBox1 // + this.groupBox1.Controls.Add(this.groupBox2); this.groupBox1.Controls.Add(this.rdoCloseCTD); this.groupBox1.Controls.Add(this.rdoOpenCTD); this.groupBox1.ForeColor = System.Drawing.Color.White; - this.groupBox1.Location = new System.Drawing.Point(38, 60); + this.groupBox1.Location = new System.Drawing.Point(38, 50); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(311, 113); + this.groupBox1.Size = new System.Drawing.Size(311, 394); this.groupBox1.TabIndex = 8; this.groupBox1.TabStop = false; this.groupBox1.Text = "CTD继电控制"; // + // groupBox2 + // + this.groupBox2.Controls.Add(this.chkCycleControlCTD); + this.groupBox2.Controls.Add(this.txtCloseDurationCTD); + this.groupBox2.Controls.Add(this.txtOpenDurationCTD); + this.groupBox2.Controls.Add(this.label4); + this.groupBox2.Controls.Add(this.label3); + this.groupBox2.Controls.Add(this.dtpOpenTimeCTD); + this.groupBox2.Controls.Add(this.label2); + this.groupBox2.Font = new System.Drawing.Font("方正楷体简体", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.groupBox2.ForeColor = System.Drawing.Color.White; + this.groupBox2.Location = new System.Drawing.Point(18, 102); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(278, 280); + this.groupBox2.TabIndex = 10; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "周期控制"; + // + // chkCycleControlCTD + // + this.chkCycleControlCTD.AutoSize = true; + this.chkCycleControlCTD.Font = new System.Drawing.Font("方正楷体简体", 18F); + this.chkCycleControlCTD.Location = new System.Drawing.Point(32, 49); + this.chkCycleControlCTD.Name = "chkCycleControlCTD"; + this.chkCycleControlCTD.Size = new System.Drawing.Size(127, 31); + this.chkCycleControlCTD.TabIndex = 2; + this.chkCycleControlCTD.Text = "周期控制"; + this.chkCycleControlCTD.UseVisualStyleBackColor = true; + this.chkCycleControlCTD.CheckedChanged += new System.EventHandler(this.chkCycleControlCTD_CheckedChanged); + // + // txtCloseDurationCTD + // + this.txtCloseDurationCTD.Font = new System.Drawing.Font("方正楷体简体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.txtCloseDurationCTD.Location = new System.Drawing.Point(148, 231); + this.txtCloseDurationCTD.Name = "txtCloseDurationCTD"; + this.txtCloseDurationCTD.Size = new System.Drawing.Size(100, 35); + this.txtCloseDurationCTD.TabIndex = 21; + this.txtCloseDurationCTD.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.txtCloseDurationCTD.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtCloseDurationCTD_KeyPress); + // + // txtOpenDurationCTD + // + this.txtOpenDurationCTD.Font = new System.Drawing.Font("方正楷体简体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.txtOpenDurationCTD.Location = new System.Drawing.Point(148, 186); + this.txtOpenDurationCTD.Name = "txtOpenDurationCTD"; + this.txtOpenDurationCTD.Size = new System.Drawing.Size(100, 35); + this.txtOpenDurationCTD.TabIndex = 20; + this.txtOpenDurationCTD.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.txtOpenDurationCTD.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtOpenDurationCTD_KeyPress); + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Font = new System.Drawing.Font("方正楷体简体", 18F); + this.label4.Location = new System.Drawing.Point(27, 235); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(132, 27); + this.label4.TabIndex = 19; + this.label4.Text = "关闭时长:"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Font = new System.Drawing.Font("方正楷体简体", 18F); + this.label3.Location = new System.Drawing.Point(27, 194); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(132, 27); + this.label3.TabIndex = 18; + this.label3.Text = "打开时长:"; + // + // dtpOpenTimeCTD + // + this.dtpOpenTimeCTD.CustomFormat = "yyyy/MM/dd HH:mm"; + this.dtpOpenTimeCTD.Font = new System.Drawing.Font("方正楷体简体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.dtpOpenTimeCTD.Format = System.Windows.Forms.DateTimePickerFormat.Custom; + this.dtpOpenTimeCTD.Location = new System.Drawing.Point(32, 134); + this.dtpOpenTimeCTD.MaxDate = new System.DateTime(2023, 1, 1, 0, 0, 0, 0); + this.dtpOpenTimeCTD.MinDate = new System.DateTime(2023, 1, 1, 0, 0, 0, 0); + this.dtpOpenTimeCTD.Name = "dtpOpenTimeCTD"; + this.dtpOpenTimeCTD.Size = new System.Drawing.Size(217, 35); + this.dtpOpenTimeCTD.TabIndex = 17; + this.dtpOpenTimeCTD.Value = new System.DateTime(2023, 1, 1, 0, 0, 0, 0); + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Font = new System.Drawing.Font("方正楷体简体", 18F); + this.label2.Location = new System.Drawing.Point(29, 94); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(132, 27); + this.label2.TabIndex = 17; + this.label2.Text = "打开时间:"; + // // rdoCloseCTD // this.rdoCloseCTD.AutoSize = true; this.rdoCloseCTD.Font = new System.Drawing.Font("方正楷体简体", 21.75F); - this.rdoCloseCTD.Location = new System.Drawing.Point(179, 58); + this.rdoCloseCTD.Location = new System.Drawing.Point(179, 52); this.rdoCloseCTD.Name = "rdoCloseCTD"; this.rdoCloseCTD.Size = new System.Drawing.Size(90, 36); this.rdoCloseCTD.TabIndex = 1; @@ -563,7 +697,7 @@ // this.rdoOpenCTD.AutoSize = true; this.rdoOpenCTD.Font = new System.Drawing.Font("方正楷体简体", 21.75F); - this.rdoOpenCTD.Location = new System.Drawing.Point(39, 58); + this.rdoOpenCTD.Location = new System.Drawing.Point(39, 52); this.rdoOpenCTD.Name = "rdoOpenCTD"; this.rdoOpenCTD.Size = new System.Drawing.Size(90, 36); this.rdoOpenCTD.TabIndex = 0; @@ -575,7 +709,7 @@ // this.btnSetState.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnSetState.ForeColor = System.Drawing.SystemColors.Control; - this.btnSetState.Location = new System.Drawing.Point(1142, 428); + this.btnSetState.Location = new System.Drawing.Point(607, 469); this.btnSetState.Name = "btnSetState"; this.btnSetState.Size = new System.Drawing.Size(210, 60); this.btnSetState.TabIndex = 1; @@ -591,9 +725,9 @@ this.grpPowerSetting.Controls.Add(this.btnRestart); this.grpPowerSetting.Font = new System.Drawing.Font("方正楷体简体", 24F); this.grpPowerSetting.ForeColor = System.Drawing.Color.Transparent; - this.grpPowerSetting.Location = new System.Drawing.Point(51, 41); + this.grpPowerSetting.Location = new System.Drawing.Point(51, 32); this.grpPowerSetting.Name = "grpPowerSetting"; - this.grpPowerSetting.Size = new System.Drawing.Size(1447, 144); + this.grpPowerSetting.Size = new System.Drawing.Size(1447, 126); this.grpPowerSetting.TabIndex = 0; this.grpPowerSetting.TabStop = false; this.grpPowerSetting.Text = "电源设置"; @@ -602,7 +736,7 @@ // label1 // this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(127, 77); + this.label1.Location = new System.Drawing.Point(127, 59); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(207, 35); this.label1.TabIndex = 4; @@ -612,7 +746,7 @@ // this.rdoGDFL.AutoSize = true; this.rdoGDFL.Font = new System.Drawing.Font("方正楷体简体", 21.75F); - this.rdoGDFL.Location = new System.Drawing.Point(657, 77); + this.rdoGDFL.Location = new System.Drawing.Point(657, 59); this.rdoGDFL.Name = "rdoGDFL"; this.rdoGDFL.Size = new System.Drawing.Size(177, 36); this.rdoGDFL.TabIndex = 3; @@ -624,7 +758,7 @@ this.rdoDZ.AutoSize = true; this.rdoDZ.Checked = true; this.rdoDZ.Font = new System.Drawing.Font("方正楷体简体", 21.75F); - this.rdoDZ.Location = new System.Drawing.Point(459, 77); + this.rdoDZ.Location = new System.Drawing.Point(459, 59); this.rdoDZ.Name = "rdoDZ"; this.rdoDZ.Size = new System.Drawing.Size(119, 36); this.rdoDZ.TabIndex = 2; @@ -636,7 +770,7 @@ // this.btnRestart.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnRestart.ForeColor = System.Drawing.SystemColors.Control; - this.btnRestart.Location = new System.Drawing.Point(1002, 54); + this.btnRestart.Location = new System.Drawing.Point(1002, 43); this.btnRestart.Name = "btnRestart"; this.btnRestart.Size = new System.Drawing.Size(210, 60); this.btnRestart.TabIndex = 0; @@ -644,6 +778,38 @@ this.btnRestart.UseVisualStyleBackColor = true; this.btnRestart.Click += new System.EventHandler(this.btnRestart_Click); // + // timerMonitorStartCTD + // + this.timerMonitorStartCTD.Tick += new System.EventHandler(this.timerMonitorStartCTD_Tick); + // + // timerMonitorStopCTD + // + this.timerMonitorStopCTD.Tick += new System.EventHandler(this.timerMonitorStopCTD_Tick); + // + // timerMonitorStartEXO2 + // + this.timerMonitorStartEXO2.Tick += new System.EventHandler(this.timerMonitorStartEXO2_Tick); + // + // timerMonitorStopEXO2 + // + this.timerMonitorStopEXO2.Tick += new System.EventHandler(this.timerMonitorStopEXO2_Tick); + // + // timerMonitorStartCO2 + // + this.timerMonitorStartCO2.Tick += new System.EventHandler(this.timerMonitorStartCO2_Tick); + // + // timerMonitorStopCO2 + // + this.timerMonitorStopCO2.Tick += new System.EventHandler(this.timerMonitorStopCO2_Tick); + // + // timerMonitorStartADCP + // + this.timerMonitorStartADCP.Tick += new System.EventHandler(this.timerMonitorStartADCP_Tick); + // + // timerMonitorStopADCP + // + this.timerMonitorStopADCP.Tick += new System.EventHandler(this.timerMonitorStopADCP_Tick); + // // OtherSettingForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -654,34 +820,29 @@ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Name = "OtherSettingForm"; this.Text = "OtherSettingForm"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.OtherSettingForm_FormClosing); this.Load += new System.EventHandler(this.OtherSettingForm_Load); this.pnlTitle.ResumeLayout(false); this.pnlTitle.PerformLayout(); this.pnlContent.ResumeLayout(false); this.grpCycleSetting.ResumeLayout(false); this.grpCycleSetting.PerformLayout(); - this.groupBox11.ResumeLayout(false); - this.groupBox11.PerformLayout(); - this.groupBox9.ResumeLayout(false); - this.groupBox9.PerformLayout(); - this.groupBox10.ResumeLayout(false); - this.groupBox10.PerformLayout(); - this.groupBox5.ResumeLayout(false); - this.groupBox5.PerformLayout(); - this.groupBox4.ResumeLayout(false); - this.groupBox4.PerformLayout(); this.groupBox6.ResumeLayout(false); this.groupBox6.PerformLayout(); - this.groupBox3.ResumeLayout(false); - this.groupBox3.PerformLayout(); this.groupBox7.ResumeLayout(false); this.groupBox7.PerformLayout(); - this.groupBox2.ResumeLayout(false); - this.groupBox2.PerformLayout(); + this.groupBox3.ResumeLayout(false); + this.groupBox3.PerformLayout(); + this.groupBox4.ResumeLayout(false); + this.groupBox4.PerformLayout(); this.groupBox8.ResumeLayout(false); this.groupBox8.PerformLayout(); + this.groupBox5.ResumeLayout(false); + this.groupBox5.PerformLayout(); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); this.grpPowerSetting.ResumeLayout(false); this.grpPowerSetting.PerformLayout(); this.ResumeLayout(false); @@ -697,43 +858,62 @@ private System.Windows.Forms.GroupBox grpPowerSetting; public System.Windows.Forms.Button btnSetState; public System.Windows.Forms.Button btnRestart; - private System.Windows.Forms.GroupBox groupBox11; - private System.Windows.Forms.RadioButton rdoClose12; - private System.Windows.Forms.RadioButton rdoOpen12; - private System.Windows.Forms.GroupBox groupBox9; - private System.Windows.Forms.RadioButton rdoClose24; - private System.Windows.Forms.RadioButton rdoOpen24; - private System.Windows.Forms.GroupBox groupBox10; - private System.Windows.Forms.RadioButton rdoClose48; - private System.Windows.Forms.RadioButton rdoOpen48; - private System.Windows.Forms.GroupBox groupBox5; - private System.Windows.Forms.RadioButton rdoCloseUV4; - private System.Windows.Forms.RadioButton rdoOpenUV4; - private System.Windows.Forms.GroupBox groupBox4; - private System.Windows.Forms.RadioButton rdoCloseUV2; - private System.Windows.Forms.RadioButton rdoOpenUV2; private System.Windows.Forms.GroupBox groupBox6; - private System.Windows.Forms.RadioButton rdoCloseADCP; - private System.Windows.Forms.RadioButton rdoOpenADCP; private System.Windows.Forms.GroupBox groupBox3; - private System.Windows.Forms.RadioButton rdoCloseMulti; - private System.Windows.Forms.RadioButton rdoOpenMulti; - private System.Windows.Forms.GroupBox groupBox7; - private System.Windows.Forms.RadioButton rdoCloseUV3; - private System.Windows.Forms.RadioButton rdoOpenUV3; - private System.Windows.Forms.GroupBox groupBox2; - private System.Windows.Forms.RadioButton rdoCloseUV1; - private System.Windows.Forms.RadioButton rdoOpenUV1; private System.Windows.Forms.GroupBox groupBox8; - private System.Windows.Forms.RadioButton rdoCloseCO2; - private System.Windows.Forms.RadioButton rdoOpenCO2; private System.Windows.Forms.GroupBox groupBox1; - private System.Windows.Forms.RadioButton rdoCloseCTD; - private System.Windows.Forms.RadioButton rdoOpenCTD; private System.Windows.Forms.Label lblClose; private System.Windows.Forms.Label lblOpen; private System.Windows.Forms.Label label1; private System.Windows.Forms.RadioButton rdoGDFL; private System.Windows.Forms.RadioButton rdoDZ; + private System.Windows.Forms.GroupBox groupBox2; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.GroupBox groupBox7; + private System.Windows.Forms.TextBox txtCloseDurationADCP; + private System.Windows.Forms.TextBox txtOpenDurationADCP; + private System.Windows.Forms.Label label11; + private System.Windows.Forms.Label label12; + private System.Windows.Forms.DateTimePicker dtpOpenTimeADCP; + private System.Windows.Forms.Label label13; + private System.Windows.Forms.GroupBox groupBox4; + private System.Windows.Forms.TextBox txtCloseDurationEXO2; + private System.Windows.Forms.TextBox txtOpenDurationEXO2; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.DateTimePicker dtpOpenTimeEXO2; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.GroupBox groupBox5; + private System.Windows.Forms.TextBox txtCloseDurationCO2; + private System.Windows.Forms.TextBox txtOpenDurationCO2; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.DateTimePicker dtpOpenTimeCO2; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.TextBox txtCloseDurationCTD; + private System.Windows.Forms.TextBox txtOpenDurationCTD; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.DateTimePicker dtpOpenTimeCTD; + public System.Windows.Forms.RadioButton rdoCloseADCP; + public System.Windows.Forms.RadioButton rdoOpenADCP; + public System.Windows.Forms.RadioButton rdoCloseMulti; + public System.Windows.Forms.RadioButton rdoOpenMulti; + public System.Windows.Forms.RadioButton rdoCloseCO2; + public System.Windows.Forms.RadioButton rdoOpenCO2; + public System.Windows.Forms.RadioButton rdoCloseCTD; + public System.Windows.Forms.RadioButton rdoOpenCTD; + private System.Windows.Forms.Timer timerMonitorStartCTD; + private System.Windows.Forms.Timer timerMonitorStopCTD; + private System.Windows.Forms.Timer timerMonitorStartEXO2; + private System.Windows.Forms.Timer timerMonitorStopEXO2; + private System.Windows.Forms.Timer timerMonitorStartCO2; + private System.Windows.Forms.Timer timerMonitorStopCO2; + private System.Windows.Forms.Timer timerMonitorStartADCP; + private System.Windows.Forms.Timer timerMonitorStopADCP; + private System.Windows.Forms.CheckBox chkCycleControlADCP; + private System.Windows.Forms.CheckBox chkCycleControlEXO2; + private System.Windows.Forms.CheckBox chkCycleControlCO2; + private System.Windows.Forms.CheckBox chkCycleControlCTD; } } \ No newline at end of file diff --git a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/OtherSettingForm.cs b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/OtherSettingForm.cs index 24b7531..fb59ad2 100644 --- a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/OtherSettingForm.cs +++ b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/OtherSettingForm.cs @@ -26,13 +26,18 @@ namespace ZTTMS_Manage_yibayiyi_20230320 g_timerSetLine.Enabled = true; g_timerSetLine.Interval = 20000; g_timerSetLine.AutoReset = false; - g_timerSetLine.Elapsed += new System.Timers.ElapsedEventHandler(methodSetCycle); + g_timerSetLine.Elapsed += new System.Timers.ElapsedEventHandler(methodSetLine); g_timerRequestRestart.Enabled = true; g_timerRequestRestart.Interval = 20000; g_timerRequestRestart.AutoReset = false; g_timerRequestRestart.Elapsed += new System.Timers.ElapsedEventHandler(methodRequestRestart); + g_timerRequestRestartGDFL.Enabled = true; + g_timerRequestRestartGDFL.Interval = 20000; + g_timerRequestRestartGDFL.AutoReset = false; + g_timerRequestRestartGDFL.Elapsed += new System.Timers.ElapsedEventHandler(methodRequestRestartGDFL); + //timerAutoOpenClose.Interval = 60 * 1000; //timerAutoOpenClose.Enabled = true; //timerAutoOpenClose.Start(); @@ -71,6 +76,28 @@ namespace ZTTMS_Manage_yibayiyi_20230320 int g_sqlDeviceNumber = 1; int autoTime; + //周期控制定义 + DateTime startTimeCTD; + DateTime startTimeADCP; + DateTime startTimeEXO2; + DateTime startTimeCO2; + DateTime stopTimeCTD; + DateTime stopTimeADCP; + DateTime stopTimeEXO2; + DateTime stopTimeCO2; + int startLengthCTD; + int startLengthADCP; + int startLengthEXO2; + int startLengthCO2; + int stopLengthCTD; + int stopLengthADCP; + int stopLengthEXO2; + int stopLengthCO2; + int totalLengthCTD; + int totalLengthADCP; + int totalLengthEXO2; + int totalLengthCO2; + #region 定时器设置 public System.Timers.Timer g_timerSetLine = new System.Timers.Timer(); @@ -81,12 +108,92 @@ namespace ZTTMS_Manage_yibayiyi_20230320 public bool g_flagRequestRestart = true; public bool g_flagRequestRestartGDFL = true; - private void methodSetCycle(object sender, System.Timers.ElapsedEventArgs e) + private void methodSetLine(object sender, System.Timers.ElapsedEventArgs e) { if (g_flagSetLine == false) { Console.WriteLine("电子腔继电控制未响应,请重新点击发送!"); btnSetState.Enabled = true; + + //回复失败 + //还原之前的状态 + try + { + //根据数据库存储情况显示 + string sql = $"select * from tb_stateinfo_state where controlstate_re48!='' order by record_time desc limit 1;"; + MySqlDataReader dataReader = MySQL.ExecuteReader(sql); + if (dataReader.Read()) + { + if (dataReader[7].ToString() == "关闭") + MainForm.relayControlForm.rdoClose48.Checked = true; + else + MainForm.relayControlForm.rdoOpen48.Checked = true; + + if (dataReader[10].ToString() == "关闭") + MainForm.relayControlForm.rdoClose24.Checked = true; + else + MainForm.relayControlForm.rdoOpen24.Checked = true; + + if (dataReader[13].ToString() == "关闭") + MainForm.relayControlForm.rdoClose12.Checked = true; + else + MainForm.relayControlForm.rdoOpen12.Checked = true; + + if (dataReader[16].ToString() == "关闭") + rdoCloseMulti.Checked = true; + else + rdoOpenMulti.Checked = true; + + if (dataReader[19].ToString() == "关闭") + rdoCloseCTD.Checked = true; + else + rdoOpenCTD.Checked = true; + + if (dataReader[22].ToString() == "关闭") + rdoCloseADCP.Checked = true; + else + rdoOpenADCP.Checked = true; + + if (dataReader[25].ToString() == "关闭") + MainForm.relayControlForm.rdoCloseUV1.Checked = true; + else + MainForm.relayControlForm.rdoOpenUV1.Checked = true; + + if (dataReader[28].ToString() == "关闭") + MainForm.relayControlForm.rdoCloseUV2.Checked = true; + else + MainForm.relayControlForm.rdoOpenUV2.Checked = true; + + if (dataReader[31].ToString() == "关闭") + MainForm.relayControlForm.rdoCloseUV3.Checked = true; + else + MainForm.relayControlForm.rdoOpenUV3.Checked = true; + + if (dataReader[34].ToString() == "关闭") + MainForm.relayControlForm.rdoCloseUV4.Checked = true; + else + MainForm.relayControlForm.rdoOpenUV4.Checked = true; + + if (dataReader[37].ToString() == "关闭") + rdoCloseCO2.Checked = true; + else + rdoOpenCO2.Checked = true; + } + + dataReader.Close(); + dataReader.Dispose(); + } + catch (Exception ex) + { + Console.WriteLine("RefreshOpenCloseStateError:" + ex.Message); + EveryDayLog.WriteErrorOther("RefreshOpenCloseStateError:" + ex.Message); + } + + //释放锁 + //Monitor.Exit(Others.obj); + Others.semaphore.Release(); + Console.WriteLine("已解锁!"); + EveryDayLog.WriteDZ("20s内未收到回复,自动解锁!"); } } @@ -315,19 +422,20 @@ namespace ZTTMS_Manage_yibayiyi_20230320 private void OtherSettingForm_Load(object sender, EventArgs e) { - rdoClose12.Checked = true; - rdoClose24.Checked = true; - rdoClose48.Checked = true; - rdoCloseADCP.Checked = true; - rdoCloseCO2.Checked = true; - rdoCloseCTD.Checked = true; - rdoCloseMulti.Checked = true; - rdoCloseUV1.Checked = true; - rdoCloseUV2.Checked = true; - rdoCloseUV3.Checked = true; - rdoCloseUV4.Checked = true; - RefreshOpenCloseState(); + + dtpOpenTimeCTD.MinDate = new DateTime(2023, 1, 1, 00, 00, 00); + dtpOpenTimeCTD.MaxDate = new DateTime(2030, 1, 1, 00, 00, 00); + dtpOpenTimeCTD.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, 00, 00, 00); + dtpOpenTimeEXO2.MinDate = new DateTime(2023, 1, 1, 00, 00, 00); + dtpOpenTimeEXO2.MaxDate = new DateTime(2030, 1, 1, 00, 00, 00); + dtpOpenTimeEXO2.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, 00, 00, 00); + dtpOpenTimeCO2.MinDate = new DateTime(2023, 1, 1, 00, 00, 00); + dtpOpenTimeCO2.MaxDate = new DateTime(2030, 1, 1, 00, 00, 00); + dtpOpenTimeCO2.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, 00, 00, 00); + dtpOpenTimeADCP.MinDate = new DateTime(2023, 1, 1, 00, 00, 00); + dtpOpenTimeADCP.MaxDate = new DateTime(2030, 1, 1, 00, 00, 00); + dtpOpenTimeADCP.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, 00, 00, 00); } @@ -341,19 +449,19 @@ namespace ZTTMS_Manage_yibayiyi_20230320 if (dataReader.Read()) { if (dataReader[7].ToString() == "关闭") - rdoClose48.Checked = true; + MainForm.relayControlForm.rdoClose48.Checked = true; else - rdoOpen48.Checked = true; + MainForm.relayControlForm.rdoOpen48.Checked = true; if (dataReader[10].ToString() == "关闭") - rdoClose24.Checked = true; + MainForm.relayControlForm.rdoClose24.Checked = true; else - rdoOpen24.Checked = true; + MainForm.relayControlForm.rdoOpen24.Checked = true; if (dataReader[13].ToString() == "关闭") - rdoClose12.Checked = true; + MainForm.relayControlForm.rdoClose12.Checked = true; else - rdoOpen12.Checked = true; + MainForm.relayControlForm.rdoOpen12.Checked = true; if (dataReader[16].ToString() == "关闭") rdoCloseMulti.Checked = true; @@ -371,24 +479,24 @@ namespace ZTTMS_Manage_yibayiyi_20230320 rdoOpenADCP.Checked = true; if (dataReader[25].ToString() == "关闭") - rdoCloseUV1.Checked = true; + MainForm.relayControlForm.rdoCloseUV1.Checked = true; else - rdoOpenUV1.Checked = true; + MainForm.relayControlForm.rdoOpenUV1.Checked = true; if (dataReader[28].ToString() == "关闭") - rdoCloseUV2.Checked = true; + MainForm.relayControlForm.rdoCloseUV2.Checked = true; else - rdoOpenUV2.Checked = true; + MainForm.relayControlForm.rdoOpenUV2.Checked = true; if (dataReader[31].ToString() == "关闭") - rdoCloseUV3.Checked = true; + MainForm.relayControlForm.rdoCloseUV3.Checked = true; else - rdoOpenUV3.Checked = true; + MainForm.relayControlForm.rdoOpenUV3.Checked = true; if (dataReader[34].ToString() == "关闭") - rdoCloseUV4.Checked = true; + MainForm.relayControlForm.rdoCloseUV4.Checked = true; else - rdoOpenUV4.Checked = true; + MainForm.relayControlForm.rdoOpenUV4.Checked = true; if (dataReader[37].ToString() == "关闭") rdoCloseCO2.Checked = true; @@ -408,24 +516,156 @@ namespace ZTTMS_Manage_yibayiyi_20230320 #region SetState - private void btnSetState_Click(object sender, EventArgs e) + /// + /// 控制发送函数 + /// + /// 控制口名称 + /// 想要控制口变成的状态(0x00/0x01) + /// Cycle/Click + public void ControlSend(string controlName, byte controlState, string type) { if (Others.g_socketSend == null) { - //MessageBoxForm messageBoxForm = new MessageBoxForm(); - //messageBoxForm.strType = "警告"; - //messageBoxForm.strMessage = "TCP通信尚未建立,请等候!"; - //OpenMessageForm(messageBoxForm); - MainForm.str = "无法通信"; MainForm.change(); return; } - btnSetState.Enabled = false; - g_flagSetLine = false; + Console.WriteLine(controlName + "准备加锁!"); + //上锁 + //Monitor.Enter(Others.obj); + Others.semaphore.WaitOne(); + Console.WriteLine(controlName + "已加锁!"); + EveryDayLog.WriteDZ(controlName + "已加锁!"); + if (type == "Cycle") + { + //控制口赋值 + Others.controlName = controlName; + + //控制口状态赋值 + Others.controlState = controlState; + + //获取所有控制口的当前状态 + if (rdoCloseCTD.Checked) + Others.allStates[0] = 0x00; + else + Others.allStates[0] = 0x01; + if (rdoCloseMulti.Checked) + Others.allStates[1] = 0x00; + else + Others.allStates[1] = 0x01; + if (rdoCloseCO2.Checked) + Others.allStates[2] = 0x00; + else + Others.allStates[2] = 0x01; + if (rdoCloseADCP.Checked) + Others.allStates[3] = 0x00; + else + Others.allStates[3] = 0x01; + if (MainForm.relayControlForm.rdoCloseUV1.Checked) + Others.allStates[4] = 0x00; + else + Others.allStates[4] = 0x01; + if (MainForm.relayControlForm.rdoCloseUV2.Checked) + Others.allStates[5] = 0x00; + else + Others.allStates[5] = 0x01; + if (MainForm.relayControlForm.rdoCloseUV3.Checked) + Others.allStates[6] = 0x00; + else + Others.allStates[6] = 0x01; + if (MainForm.relayControlForm.rdoCloseUV4.Checked) + Others.allStates[7] = 0x00; + else + Others.allStates[7] = 0x01; + if (MainForm.relayControlForm.rdoClose48.Checked) + Others.allStates[8] = 0x00; + else + Others.allStates[8] = 0x01; + if (MainForm.relayControlForm.rdoClose24.Checked) + Others.allStates[9] = 0x00; + else + Others.allStates[9] = 0x01; + if (MainForm.relayControlForm.rdoClose12.Checked) + Others.allStates[10] = 0x00; + else + Others.allStates[10] = 0x01; + + //写入当前控制口的状态 + if (controlName == "CTD") + Others.allStates[0] = controlState; + else if (controlName == "EXO2") + Others.allStates[1] = controlState; + else if (controlName == "CO2") + Others.allStates[2] = controlState; + else if (controlName == "ADCP") + Others.allStates[3] = controlState; + else if (controlName == "UV1") + Others.allStates[4] = controlState; + else if (controlName == "UV2") + Others.allStates[5] = controlState; + else if (controlName == "UV3") + Others.allStates[6] = controlState; + else if (controlName == "UV4") + Others.allStates[7] = controlState; + else if (controlName == "48") + Others.allStates[8] = controlState; + else if (controlName == "24") + Others.allStates[9] = controlState; + else if (controlName == "12") + Others.allStates[10] = controlState; + } + else + { + if (rdoCloseCTD.Checked) + Others.allStates[0] = 0x00; + else + Others.allStates[0] = 0x01; + if (rdoCloseMulti.Checked) + Others.allStates[1] = 0x00; + else + Others.allStates[1] = 0x01; + if (rdoCloseCO2.Checked) + Others.allStates[2] = 0x00; + else + Others.allStates[2] = 0x01; + if (rdoCloseADCP.Checked) + Others.allStates[3] = 0x00; + else + Others.allStates[3] = 0x01; + if (MainForm.relayControlForm.rdoCloseUV1.Checked) + Others.allStates[4] = 0x00; + else + Others.allStates[4] = 0x01; + if (MainForm.relayControlForm.rdoCloseUV2.Checked) + Others.allStates[5] = 0x00; + else + Others.allStates[5] = 0x01; + if (MainForm.relayControlForm.rdoCloseUV3.Checked) + Others.allStates[6] = 0x00; + else + Others.allStates[6] = 0x01; + if (MainForm.relayControlForm.rdoCloseUV4.Checked) + Others.allStates[7] = 0x00; + else + Others.allStates[7] = 0x01; + if (MainForm.relayControlForm.rdoClose48.Checked) + Others.allStates[8] = 0x00; + else + Others.allStates[8] = 0x01; + if (MainForm.relayControlForm.rdoClose24.Checked) + Others.allStates[9] = 0x00; + else + Others.allStates[9] = 0x01; + if (MainForm.relayControlForm.rdoClose12.Checked) + Others.allStates[10] = 0x00; + else + Others.allStates[10] = 0x01; + } + + //打包发送 //消息ID Others.g_messageId[0] = 0x81; Others.g_messageId[1] = 0x00; @@ -435,63 +675,6 @@ namespace ZTTMS_Manage_yibayiyi_20230320 messageBodySerialNumberSetLine[0] = (byte)((g_serialSetLine & 0xFF00) >> 8); messageBodySerialNumberSetLine[1] = (byte)(g_serialSetLine & 0x00FF); - //消息体 - byte stateCTD = 0x00; - byte stateMulti = 0x00; - byte stateCO2 = 0x00; - byte stateADCP = 0x00; - byte stateUV1 = 0x00; - byte stateUV2 = 0x00; - byte stateUV3 = 0x00; - byte stateUV4 = 0x00; - byte state48 = 0x00; - byte state24 = 0x00; - byte state12 = 0x00; - if (rdoOpen12.Checked) - { - state12 = 0x01; - } - if (rdoOpen24.Checked) - { - state24 = 0x01; - } - if (rdoOpen48.Checked) - { - state48 = 0x01; - } - if (rdoOpenADCP.Checked) - { - stateADCP = 0x01; - } - if (rdoOpenUV1.Checked) - { - stateUV1 = 0x01; - } - if (rdoOpenUV2.Checked) - { - stateUV2 = 0x01; - } - if (rdoOpenUV3.Checked) - { - stateUV3 = 0x01; - } - if (rdoOpenUV4.Checked) - { - stateUV4 = 0x01; - } - if (rdoOpenCO2.Checked) - { - stateCO2 = 0x01; - } - if (rdoOpenCTD.Checked) - { - stateCTD = 0x01; - } - if (rdoOpenMulti.Checked) - { - stateMulti = 0x01; - } - //消息体属性 ushort datalen = (ushort)(11); Others.g_messageBodyProperty = Others.Property(datalen); @@ -504,17 +687,17 @@ namespace ZTTMS_Manage_yibayiyi_20230320 g_crc8CheckBuffer.AddRange(Others.g_messageBodyProperty); g_crc8CheckBuffer.AddRange(Others.g_versionNumber); g_crc8CheckBuffer.AddRange(messageBodySerialNumberSetLine); - g_crc8CheckBuffer.Add(stateCTD); - g_crc8CheckBuffer.Add(stateMulti); - g_crc8CheckBuffer.Add(stateCO2); - g_crc8CheckBuffer.Add(stateADCP); - g_crc8CheckBuffer.Add(stateUV1); - g_crc8CheckBuffer.Add(stateUV2); - g_crc8CheckBuffer.Add(stateUV3); - g_crc8CheckBuffer.Add(stateUV4); - g_crc8CheckBuffer.Add(state48); - g_crc8CheckBuffer.Add(state24); - g_crc8CheckBuffer.Add(state12); + g_crc8CheckBuffer.Add(Others.allStates[0]); + g_crc8CheckBuffer.Add(Others.allStates[1]); + g_crc8CheckBuffer.Add(Others.allStates[2]); + g_crc8CheckBuffer.Add(Others.allStates[3]); + g_crc8CheckBuffer.Add(Others.allStates[4]); + g_crc8CheckBuffer.Add(Others.allStates[5]); + g_crc8CheckBuffer.Add(Others.allStates[6]); + g_crc8CheckBuffer.Add(Others.allStates[7]); + g_crc8CheckBuffer.Add(Others.allStates[8]); + g_crc8CheckBuffer.Add(Others.allStates[9]); + g_crc8CheckBuffer.Add(Others.allStates[10]); g_checkCode = Others.CRC(g_crc8CheckBuffer.ToArray()); List buffer = Others.Transform(g_crc8CheckBuffer, g_checkCode, Others.g_flagBit); @@ -531,8 +714,8 @@ namespace ZTTMS_Manage_yibayiyi_20230320 Others.dzSendTimes++; Console.WriteLine("设置继电控制!" + DateTime.Now); - EveryDayLog.WriteDZ("上位机设置继电控制,CTD状态:" + stateCTD + ",多参数状态:" + stateMulti + ",CO2状态:" + stateCO2 + ",ADCP状态:" + stateADCP + ",UV灯1状态:" + stateUV1 + ",UV灯2状态:" + stateUV2 + ",UV灯3状态:" + stateUV3 + ",UV灯4状态:" + stateUV4 - + ",预留48V状态:" + state48 + ",预留24V状态:" + state24 + ",预留12V状态:" + state12); + EveryDayLog.WriteDZ("上位机设置继电控制,CTD状态:" + Others.allStates[0] + ",多参数状态:" + Others.allStates[1] + ",CO2状态:" + Others.allStates[2] + ",ADCP状态:" + Others.allStates[3] + ",UV灯1状态:" + Others.allStates[4] + ",UV灯2状态:" + Others.allStates[5] + ",UV灯3状态:" + Others.allStates[6] + ",UV灯4状态:" + Others.allStates[7] + + ",预留48V状态:" + Others.allStates[8] + ",预留24V状态:" + Others.allStates[9] + ",预留12V状态:" + Others.allStates[10]); } else { @@ -541,107 +724,896 @@ namespace ZTTMS_Manage_yibayiyi_20230320 } catch (Exception ex) { - btnSetState.Enabled = true; Console.WriteLine("SetLineStateError:" + ex.ToString()); EveryDayLog.WriteDZ("上位机设置继电控制失败,错误信息为:" + ex.Message); EveryDayLog.WriteErrorDZ("上位机设置继电控制失败,错误信息为:" + ex.Message); - //Others.g_dicSocket.Remove(Others.g_ip); Others.g_flagReceive = false; - //Console.WriteLine("SetLineStateError移除远程连接:" + Others.g_ip + "\r" + DateTime.Now); MainForm.str = "连接断开"; MainForm.change(); } - - //数据库存储 - int cycleTime = 0; - string sql; - while (cycleTime < 3) - { - string sqlId = IdHelper.GetId(); - int num = 0; - - sql = $"insert into tb_stateinfo_state(id,record_time,equipment_type,equipment_id,version_number,number,controlstate_re48,controlstate_re24,controlstate_re12," + - $"controlstate_multi,controlstate_ctd,controlstate_adcp,controlstate_uv1,controlstate_uv2,controlstate_uv3,controlstate_uv4,controlstate_co2,controlstate_image) values('{sqlId}','{DateTime.Now}'," + - $"'{g_sqlTerminalEquipmentType}','{g_sqlTerminalEquipmentId}','{g_sqlVersionNumber}','1','{JudgeState(state48)}','{JudgeState(state24)}'," + - $"'{JudgeState(state12)}','{JudgeState(stateMulti)}','{JudgeState(stateCTD)}','{JudgeState(stateADCP)}','{JudgeState(stateUV1)}'," + - $"'{JudgeState(stateUV2)}','{JudgeState(stateUV3)}','{JudgeState(stateUV4)}','{JudgeState(stateCO2)}','打开');"; - - try - { - num = MySQL.ExecuteSql(sql); - } - catch (Exception ex) - { - Console.WriteLine("OutputStatusInformationError:" + ex.ToString()); - EveryDayLog.WriteErrorDZ("OutputStatusInformationError:" + ex.ToString()); - } - - if (num > 0) - { - Console.WriteLine("电子腔输出端口状态信息插入成功!" + DateTime.Now); - break; - } - else - { - Console.WriteLine("电子腔输出端口状态信息插入失败,重新进行插入!" + DateTime.Now); - EveryDayLog.WriteErrorDZ("电子腔输出端口状态信息插入失败,重新进行插入!"); - } - - cycleTime++; - Thread.Sleep(1); - } } - private string JudgeState(byte code) + + public void btnSetState_Click(object sender, EventArgs e) { - string state; - if (code == 0x00) - { - state = "关闭"; - } - else if (code == 0x01) - { - state = "打开"; - } - else - { - state = "error"; - } - - return state; + ControlSend("", 0x00, "Click"); } + private void lblOpen_Click(object sender, EventArgs e) { - rdoOpen12.Checked = true; - rdoOpen24.Checked = true; - rdoOpen48.Checked = true; rdoOpenADCP.Checked = true; rdoOpenCO2.Checked = true; rdoOpenCTD.Checked = true; rdoOpenMulti.Checked = true; - rdoOpenUV1.Checked = true; - rdoOpenUV2.Checked = true; - rdoOpenUV3.Checked = true; - rdoOpenUV4.Checked = true; } private void lblClose_Click(object sender, EventArgs e) { - rdoClose12.Checked = true; - rdoClose24.Checked = true; - rdoClose48.Checked = true; rdoCloseADCP.Checked = true; rdoCloseCO2.Checked = true; rdoCloseCTD.Checked = true; rdoCloseMulti.Checked = true; - rdoCloseUV1.Checked = true; - rdoCloseUV2.Checked = true; - rdoCloseUV3.Checked = true; - rdoCloseUV4.Checked = true; } #endregion + + #region CTD周期控制 + private void chkCycleControlCTD_CheckedChanged(object sender, EventArgs e) + { + if (chkCycleControlCTD.Checked) + { + //如果时长为空 + if (txtOpenDurationCTD.Text == "" || txtCloseDurationCTD.Text == "") + { + chkCycleControlCTD.Checked = false; + return; + } + + //禁止修改 + dtpOpenTimeCTD.Enabled = false; + txtOpenDurationCTD.Enabled = false; + txtCloseDurationCTD.Enabled = false; + + //禁止单独控制 + rdoOpenCTD.Enabled = false; + rdoCloseCTD.Enabled = false; + + startLengthCTD = int.Parse(txtOpenDurationCTD.Text); + stopLengthCTD = int.Parse(txtCloseDurationCTD.Text); + totalLengthCTD = startLengthCTD + stopLengthCTD; + string time = Convert.ToDateTime(dtpOpenTimeCTD.Value).ToString("yyyy-MM-dd HH:mm:ss"); + startTimeCTD = Convert.ToDateTime(time); + stopTimeCTD = startTimeCTD.AddMinutes(-stopLengthCTD); + DateTime nowTime = DateTime.Now; + + EveryDayLog.WriteDZ("CTD开启周期继电控制,打开时间:" + startTimeCTD + ",打开时长:" + startLengthCTD + ",关闭时长:" + stopLengthCTD); + + //当前时间早于开始时间 + if (startTimeCTD > nowTime) + { + EveryDayLog.WriteDZ("CTD进行周期继电控制,打开时间:" + startTimeCTD + ",当前时间:" + nowTime + ",当前时间早于开始时间"); + Console.WriteLine("CTD当前时间早于开始时间"); + //开始监测,到时间后开启工作 + this.Invoke(new MethodInvoker(delegate + { + timerMonitorStartCTD.Enabled = true; + timerMonitorStartCTD.Interval = 30 * 1000; + timerMonitorStartCTD.Start(); + + timerMonitorStopCTD.Enabled = true; + timerMonitorStopCTD.Interval = 30 * 1000; + timerMonitorStopCTD.Start(); + })); + } + else + { + //当前时间晚于开始时间,但大于等于结束时间 + if ((nowTime - startTimeCTD).TotalMinutes % totalLengthCTD <= startLengthCTD && (nowTime - startTimeCTD).TotalMinutes % totalLengthCTD > 0) + { + EveryDayLog.WriteDZ("CTD进行周期继电控制,打开时间:" + startTimeCTD + ",当前时间:" + nowTime + ",当前时间晚于开始时间,但大于等于结束时间"); + Console.WriteLine("CTD当前时间晚于开始时间,但大于等于结束时间"); + //立即开始工作 + ControlSend("CTD", 0x01, "Cycle"); + + //开始监测,到时间后结束工作 + this.Invoke(new MethodInvoker(delegate + { + timerMonitorStopCTD.Enabled = true; + timerMonitorStopCTD.Interval = 30 * 1000; + timerMonitorStopCTD.Start(); + + timerMonitorStartCTD.Enabled = true; + timerMonitorStartCTD.Interval = 30 * 1000; + timerMonitorStartCTD.Start(); + })); + } + //当前时间大于结束时间,但小于等于后续的开始时间 + else if ((nowTime - startTimeCTD).TotalMinutes % totalLengthCTD > startLengthCTD && (nowTime - startTimeCTD).TotalMinutes % totalLengthCTD <= totalLengthCTD) + { + EveryDayLog.WriteDZ("CTD进行周期继电控制,打开时间:" + startTimeCTD + ",当前时间:" + nowTime + ",当前时间大于结束时间,但小于等于后续的开始时间"); + Console.WriteLine("CTD当前时间大于结束时间,但小于等于后续的开始时间"); + //开始监测,到时间后开始工作 + this.Invoke(new MethodInvoker(delegate + { + timerMonitorStartCTD.Enabled = true; + timerMonitorStartCTD.Interval = 30 * 1000; + timerMonitorStartCTD.Start(); + + timerMonitorStopCTD.Enabled = true; + timerMonitorStopCTD.Interval = 30 * 1000; + timerMonitorStopCTD.Start(); + })); + } + else + { + Console.WriteLine("CTD还有这种情况???"); + EveryDayLog.WriteDZ("CTD进行周期继电控制,打开时间:" + startTimeCTD + ",当前时间:" + nowTime + ",还有这种情况???"); + } + } + } + else + { + EveryDayLog.WriteDZ("CTD关闭周期继电控制"); + + rdoOpenCTD.Enabled = true; + rdoCloseCTD.Enabled = true; + + this.Invoke(new MethodInvoker(delegate + { + timerMonitorStartCTD.Enabled = false; + timerMonitorStartCTD.Stop(); + timerMonitorStopCTD.Enabled = false; + timerMonitorStopCTD.Stop(); + })); + } + } + + private void timerMonitorStartCTD_Tick(object sender, EventArgs e) + { + Thread trdMonitorStart = new Thread(MonitorStartCTD); + trdMonitorStart.IsBackground = true; + trdMonitorStart.Start(); + } + + private void MonitorStartCTD() + { + try + { + DateTime nowDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, 0); + + if (nowDate < startTimeCTD) + return; + + //Console.WriteLine("TotalMinutes:" + (nowDate - startTimeCTD).TotalMinutes); + if ((nowDate - startTimeCTD).TotalMinutes % totalLengthCTD == 0) + { + Console.WriteLine("CTD将在1min后打开!"); + EveryDayLog.WriteDZ("CTD将在1min后打开!"); + + timerMonitorStartCTD.Enabled = false; + timerMonitorStartCTD.Stop(); + Thread.Sleep(60 * 1000); + timerMonitorStartCTD.Enabled = true; + timerMonitorStartCTD.Start(); + } + else + return; + + ControlSend("CTD", 0x01, "Cycle"); + } + catch (Exception ex) + { + Console.WriteLine("MonitorStartCTDError:" + ex.Message); + EveryDayLog.WriteErrorDZ("MonitorStartCTDError:" + ex.Message); + } + } + + private void timerMonitorStopCTD_Tick(object sender, EventArgs e) + { + Thread trdMonitorStop = new Thread(MonitorStopCTD); + trdMonitorStop.IsBackground = true; + trdMonitorStop.Start(); + } + + private void MonitorStopCTD() + { + try + { + DateTime nowDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, 0); + + if (nowDate < startTimeCTD) + return; + + if ((nowDate - stopTimeCTD).TotalMinutes % totalLengthCTD == 0) + { + Console.WriteLine("CTD将在1min后关闭!"); + EveryDayLog.WriteDZ("CTD将在1min后关闭!"); + + timerMonitorStopCTD.Enabled = false; + timerMonitorStopCTD.Stop(); + Thread.Sleep(60 * 1000); + timerMonitorStopCTD.Enabled = true; + timerMonitorStopCTD.Start(); + } + else + return; + + ControlSend("CTD", 0x00, "Cycle"); + } + catch (Exception ex) + { + Console.WriteLine("MonitorStopCTDError:" + ex.Message); + EveryDayLog.WriteErrorDZ("MonitorStopCTDError:" + ex.Message); + } + } + #endregion + + + #region EXO2周期控制 + private void chkCycleControlEXO2_CheckedChanged(object sender, EventArgs e) + { + if (chkCycleControlEXO2.Checked) + { + //如果时长为空 + if (txtOpenDurationEXO2.Text == "" || txtCloseDurationEXO2.Text == "") + { + chkCycleControlEXO2.Checked = false; + return; + } + + //禁止修改 + dtpOpenTimeEXO2.Enabled = false; + txtOpenDurationEXO2.Enabled = false; + txtCloseDurationEXO2.Enabled = false; + + //禁止单独控制 + rdoOpenMulti.Enabled = false; + rdoCloseMulti.Enabled = false; + + startLengthEXO2 = int.Parse(txtOpenDurationEXO2.Text); + stopLengthEXO2 = int.Parse(txtCloseDurationEXO2.Text); + totalLengthEXO2 = startLengthEXO2 + stopLengthEXO2; + string time = Convert.ToDateTime(dtpOpenTimeEXO2.Value).ToString("yyyy-MM-dd HH:mm:ss"); + startTimeEXO2 = Convert.ToDateTime(time); + stopTimeEXO2 = startTimeEXO2.AddMinutes(-stopLengthEXO2); + DateTime nowTime = DateTime.Now; + + EveryDayLog.WriteDZ("EXO2开启周期继电控制,打开时间:" + startTimeEXO2 + ",打开时长:" + startLengthEXO2 + ",关闭时长:" + stopLengthEXO2); + + //当前时间早于开始时间 + if (startTimeEXO2 > nowTime) + { + EveryDayLog.WriteDZ("EXO2进行周期继电控制,打开时间:" + startTimeEXO2 + ",当前时间:" + nowTime + ",当前时间早于开始时间"); + + //开始监测,到时间后开启工作 + this.Invoke(new MethodInvoker(delegate + { + timerMonitorStartEXO2.Enabled = true; + timerMonitorStartEXO2.Interval = 30 * 1000; + timerMonitorStartEXO2.Start(); + + timerMonitorStopEXO2.Enabled = true; + timerMonitorStopEXO2.Interval = 30 * 1000; + timerMonitorStopEXO2.Start(); + })); + } + else + { + //当前时间晚于开始时间,但大于等于结束时间 + if ((nowTime - startTimeEXO2).TotalMinutes % totalLengthEXO2 <= startLengthEXO2 && (nowTime - startTimeEXO2).TotalMinutes % totalLengthEXO2 > 0) + { + EveryDayLog.WriteDZ("EXO2进行周期继电控制,打开时间:" + startTimeEXO2 + ",当前时间:" + nowTime + ",当前时间晚于开始时间,但大于等于结束时间"); + + //立即开始工作 + ControlSend("EXO2", 0x01, "Cycle"); + + //开始监测,到时间后结束工作 + this.Invoke(new MethodInvoker(delegate + { + timerMonitorStopEXO2.Enabled = true; + timerMonitorStopEXO2.Interval = 30 * 1000; + timerMonitorStopEXO2.Start(); + + timerMonitorStartEXO2.Enabled = true; + timerMonitorStartEXO2.Interval = 30 * 1000; + timerMonitorStartEXO2.Start(); + })); + } + //当前时间大于结束时间,但小于等于后续的开始时间 + else if ((nowTime - startTimeEXO2).TotalMinutes % totalLengthEXO2 > startLengthEXO2 && (nowTime - startTimeEXO2).TotalMinutes % totalLengthEXO2 <= totalLengthEXO2) + { + EveryDayLog.WriteDZ("EXO2进行周期继电控制,打开时间:" + startTimeEXO2 + ",当前时间:" + nowTime + ",当前时间大于结束时间,但小于等于后续的开始时间"); + + //开始监测,到时间后开始工作 + this.Invoke(new MethodInvoker(delegate + { + timerMonitorStartEXO2.Enabled = true; + timerMonitorStartEXO2.Interval = 30 * 1000; + timerMonitorStartEXO2.Start(); + + timerMonitorStopEXO2.Enabled = true; + timerMonitorStopEXO2.Interval = 30 * 1000; + timerMonitorStopEXO2.Start(); + })); + } + else + { + //Console.WriteLine("还有这种情况???"); + EveryDayLog.WriteDZ("EXO2进行周期继电控制,打开时间:" + startTimeEXO2 + ",当前时间:" + nowTime + ",还有这种情况???"); + } + } + } + else + { + EveryDayLog.WriteDZ("EXO2关闭周期继电控制"); + + rdoOpenMulti.Enabled = true; + rdoCloseMulti.Enabled = true; + + this.Invoke(new MethodInvoker(delegate + { + timerMonitorStartEXO2.Enabled = false; + timerMonitorStartEXO2.Stop(); + timerMonitorStopEXO2.Enabled = false; + timerMonitorStopEXO2.Stop(); + })); + } + } + + private void timerMonitorStartEXO2_Tick(object sender, EventArgs e) + { + Thread trdMonitorStart = new Thread(MonitorStartEXO2); + trdMonitorStart.IsBackground = true; + trdMonitorStart.Start(); + } + + private void MonitorStartEXO2() + { + try + { + DateTime nowDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, 0); + + if (nowDate < startTimeEXO2) + return; + + if ((nowDate - startTimeEXO2).TotalMinutes % totalLengthEXO2 == 0) + { + Console.WriteLine("EXO2将在1min后打开!"); + EveryDayLog.WriteDZ("EXO2将在1min后打开!"); + + timerMonitorStartEXO2.Enabled = false; + timerMonitorStartEXO2.Stop(); + Thread.Sleep(60 * 1000); + timerMonitorStartEXO2.Enabled = true; + timerMonitorStartEXO2.Start(); + } + else + return; + + ControlSend("EXO2", 0x01, "Cycle"); + } + catch (Exception ex) + { + Console.WriteLine("MonitorStartEXO2Error:" + ex.Message); + EveryDayLog.WriteErrorDZ("MonitorStartEXO2Error:" + ex.Message); + } + } + + private void timerMonitorStopEXO2_Tick(object sender, EventArgs e) + { + Thread trdMonitorStop = new Thread(MonitorStopEXO2); + trdMonitorStop.IsBackground = true; + trdMonitorStop.Start(); + } + + private void MonitorStopEXO2() + { + try + { + DateTime nowDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, 0); + + if (nowDate < startTimeEXO2) + return; + + if ((nowDate - stopTimeEXO2).TotalMinutes % totalLengthEXO2 == 0) + { + Console.WriteLine("EXO2将在1min后关闭!"); + EveryDayLog.WriteDZ("EXO2将在1min后关闭!"); + + timerMonitorStopEXO2.Enabled = false; + timerMonitorStopEXO2.Stop(); + Thread.Sleep(60 * 1000); + timerMonitorStopEXO2.Enabled = true; + timerMonitorStopEXO2.Start(); + } + else + return; + + ControlSend("EXO2", 0x00, "Cycle"); + } + catch (Exception ex) + { + Console.WriteLine("MonitorStopEXO2Error:" + ex.Message); + EveryDayLog.WriteErrorDZ("MonitorStopEXO2Error:" + ex.Message); + } + } + #endregion + + + #region CO2周期控制 + private void chkCycleControlCO2_CheckedChanged(object sender, EventArgs e) + { + if (chkCycleControlCO2.Checked) + { + //如果时长为空 + if (txtOpenDurationCO2.Text == "" || txtCloseDurationCO2.Text == "") + { + chkCycleControlCO2.Checked = false; + return; + } + + //禁止修改 + dtpOpenTimeCO2.Enabled = false; + txtOpenDurationCO2.Enabled = false; + txtCloseDurationCO2.Enabled = false; + + //禁止单独控制 + rdoOpenCO2.Enabled = false; + rdoCloseCO2.Enabled = false; + + startLengthCO2 = int.Parse(txtOpenDurationCO2.Text); + stopLengthCO2 = int.Parse(txtCloseDurationCO2.Text); + totalLengthCO2 = startLengthCO2 + stopLengthCO2; + string time = Convert.ToDateTime(dtpOpenTimeCO2.Value).ToString("yyyy-MM-dd HH:mm:ss"); + startTimeCO2 = Convert.ToDateTime(time); + stopTimeCO2 = startTimeCO2.AddMinutes(-stopLengthCO2); + DateTime nowTime = DateTime.Now; + + EveryDayLog.WriteDZ("CO2开启周期继电控制,打开时间:" + startTimeCO2 + ",打开时长:" + startLengthCO2 + ",关闭时长:" + stopLengthCO2); + + //当前时间早于开始时间 + if (startTimeCO2 > nowTime) + { + EveryDayLog.WriteDZ("CO2进行周期继电控制,打开时间:" + startTimeCO2 + ",当前时间:" + nowTime + ",当前时间早于开始时间"); + + //开始监测,到时间后开启工作 + this.Invoke(new MethodInvoker(delegate + { + timerMonitorStartCO2.Enabled = true; + timerMonitorStartCO2.Interval = 30 * 1000; + timerMonitorStartCO2.Start(); + + timerMonitorStopCO2.Enabled = true; + timerMonitorStopCO2.Interval = 30 * 1000; + timerMonitorStopCO2.Start(); + })); + } + else + { + //当前时间晚于开始时间,但大于等于结束时间 + if ((nowTime - startTimeCO2).TotalMinutes % totalLengthCO2 <= startLengthCO2 && (nowTime - startTimeCO2).TotalMinutes % totalLengthCO2 > 0) + { + EveryDayLog.WriteDZ("CO2进行周期继电控制,打开时间:" + startTimeCO2 + ",当前时间:" + nowTime + ",当前时间晚于开始时间,但大于等于结束时间"); + + //立即开始工作 + ControlSend("CO2", 0x01, "Cycle"); + + //开始监测,到时间后结束工作 + this.Invoke(new MethodInvoker(delegate + { + timerMonitorStopCO2.Enabled = true; + timerMonitorStopCO2.Interval = 30 * 1000; + timerMonitorStopCO2.Start(); + + timerMonitorStartCO2.Enabled = true; + timerMonitorStartCO2.Interval = 30 * 1000; + timerMonitorStartCO2.Start(); + })); + } + //当前时间大于结束时间,但小于等于后续的开始时间 + else if ((nowTime - startTimeCO2).TotalMinutes % totalLengthCO2 > startLengthCO2 && (nowTime - startTimeCO2).TotalMinutes % totalLengthCO2 <= totalLengthCO2) + { + EveryDayLog.WriteDZ("CO2进行周期继电控制,打开时间:" + startTimeCO2 + ",当前时间:" + nowTime + ",当前时间大于结束时间,但小于等于后续的开始时间"); + + //开始监测,到时间后开始工作 + this.Invoke(new MethodInvoker(delegate + { + timerMonitorStartCO2.Enabled = true; + timerMonitorStartCO2.Interval = 30 * 1000; + timerMonitorStartCO2.Start(); + + timerMonitorStopCO2.Enabled = true; + timerMonitorStopCO2.Interval = 30 * 1000; + timerMonitorStopCO2.Start(); + })); + } + else + { + //Console.WriteLine("还有这种情况???"); + EveryDayLog.WriteDZ("CO2进行周期继电控制,打开时间:" + startTimeCO2 + ",当前时间:" + nowTime + ",还有这种情况???"); + } + } + } + else + { + EveryDayLog.WriteDZ("CO2关闭周期继电控制"); + + rdoOpenCO2.Enabled = true; + rdoCloseCO2.Enabled = true; + + this.Invoke(new MethodInvoker(delegate + { + timerMonitorStartCO2.Enabled = false; + timerMonitorStartCO2.Stop(); + timerMonitorStopCO2.Enabled = false; + timerMonitorStopCO2.Stop(); + })); + } + } + + private void timerMonitorStartCO2_Tick(object sender, EventArgs e) + { + Thread trdMonitorStart = new Thread(MonitorStartCO2); + trdMonitorStart.IsBackground = true; + trdMonitorStart.Start(); + } + + private void MonitorStartCO2() + { + try + { + DateTime nowDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, 0); + + if (nowDate < startTimeCO2) + return; + + if ((nowDate - startTimeCO2).TotalMinutes % totalLengthCO2 == 0) + { + Console.WriteLine("CO2将在1min后打开!"); + EveryDayLog.WriteDZ("CO2将在1min后打开!"); + + timerMonitorStartCO2.Enabled = false; + timerMonitorStartCO2.Stop(); + Thread.Sleep(60 * 1000); + timerMonitorStartCO2.Enabled = true; + timerMonitorStartCO2.Start(); + } + else + return; + + ControlSend("CO2", 0x01, "Cycle"); + } + catch (Exception ex) + { + Console.WriteLine("MonitorStartCO2Error:" + ex.Message); + EveryDayLog.WriteErrorDZ("MonitorStartCO2Error:" + ex.Message); + } + } + + private void timerMonitorStopCO2_Tick(object sender, EventArgs e) + { + Thread trdMonitorStop = new Thread(MonitorStopCO2); + trdMonitorStop.IsBackground = true; + trdMonitorStop.Start(); + } + + private void MonitorStopCO2() + { + try + { + DateTime nowDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, 0); + + if (nowDate < startTimeCO2) + return; + + if ((nowDate - stopTimeCO2).TotalMinutes % totalLengthCO2 == 0) + { + Console.WriteLine("CO2将在1min后关闭!"); + EveryDayLog.WriteDZ("CO2将在1min后关闭!"); + + timerMonitorStopCO2.Enabled = false; + timerMonitorStopCO2.Stop(); + Thread.Sleep(60 * 1000); + timerMonitorStopCO2.Enabled = true; + timerMonitorStopCO2.Start(); + } + else + return; + + ControlSend("CO2", 0x00, "Cycle"); + } + catch (Exception ex) + { + Console.WriteLine("MonitorStopCO2Error:" + ex.Message); + EveryDayLog.WriteErrorDZ("MonitorStopCO2Error:" + ex.Message); + } + } + #endregion + + + #region ADCP周期控制 + private void chkCycleControlADCP_CheckedChanged(object sender, EventArgs e) + { + if (chkCycleControlADCP.Checked) + { + //如果时长为空 + if (txtOpenDurationADCP.Text == "" || txtCloseDurationADCP.Text == "") + { + chkCycleControlADCP.Checked = false; + return; + } + + //禁止修改 + dtpOpenTimeADCP.Enabled = false; + txtOpenDurationADCP.Enabled = false; + txtCloseDurationADCP.Enabled = false; + + //禁止单独控制 + rdoOpenADCP.Enabled = false; + rdoCloseADCP.Enabled = false; + + startLengthADCP = int.Parse(txtOpenDurationADCP.Text); + stopLengthADCP = int.Parse(txtCloseDurationADCP.Text); + totalLengthADCP = startLengthADCP + stopLengthADCP; + string time = Convert.ToDateTime(dtpOpenTimeADCP.Value).ToString("yyyy-MM-dd HH:mm:ss"); + startTimeADCP = Convert.ToDateTime(time); + stopTimeADCP = startTimeADCP.AddMinutes(-stopLengthADCP); + DateTime nowTime = DateTime.Now; + + EveryDayLog.WriteDZ("ADCP开启周期继电控制,打开时间:" + startTimeADCP + ",打开时长:" + startLengthADCP + ",关闭时长:" + stopLengthADCP); + + //当前时间早于开始时间 + if (startTimeADCP > nowTime) + { + EveryDayLog.WriteDZ("ADCP进行周期继电控制,打开时间:" + startTimeADCP + ",当前时间:" + nowTime + ",当前时间早于开始时间"); + + //开始监测,到时间后开启工作 + this.Invoke(new MethodInvoker(delegate + { + timerMonitorStartADCP.Enabled = true; + timerMonitorStartADCP.Interval = 30 * 1000; + timerMonitorStartADCP.Start(); + + timerMonitorStopADCP.Enabled = true; + timerMonitorStopADCP.Interval = 30 * 1000; + timerMonitorStopADCP.Start(); + })); + } + else + { + //当前时间晚于开始时间,但大于等于结束时间 + if ((nowTime - startTimeADCP).TotalMinutes % totalLengthADCP <= startLengthADCP && (nowTime - startTimeADCP).TotalMinutes % totalLengthADCP > 0) + { + EveryDayLog.WriteDZ("ADCP进行周期继电控制,打开时间:" + startTimeADCP + ",当前时间:" + nowTime + ",当前时间晚于开始时间,但大于等于结束时间"); + + //立即开始工作 + ControlSend("ADCP", 0x01, "Cycle"); + + //开始监测,到时间后结束工作 + this.Invoke(new MethodInvoker(delegate + { + timerMonitorStopADCP.Enabled = true; + timerMonitorStopADCP.Interval = 30 * 1000; + timerMonitorStopADCP.Start(); + + timerMonitorStartADCP.Enabled = true; + timerMonitorStartADCP.Interval = 30 * 1000; + timerMonitorStartADCP.Start(); + })); + } + //当前时间大于结束时间,但小于等于后续的开始时间 + else if ((nowTime - startTimeADCP).TotalMinutes % totalLengthADCP > startLengthADCP && (nowTime - startTimeADCP).TotalMinutes % totalLengthADCP <= totalLengthADCP) + { + EveryDayLog.WriteDZ("ADCP进行周期继电控制,打开时间:" + startTimeADCP + ",当前时间:" + nowTime + ",当前时间大于结束时间,但小于等于后续的开始时间"); + + //开始监测,到时间后开始工作 + this.Invoke(new MethodInvoker(delegate + { + timerMonitorStartADCP.Enabled = true; + timerMonitorStartADCP.Interval = 30 * 1000; + timerMonitorStartADCP.Start(); + + timerMonitorStopADCP.Enabled = true; + timerMonitorStopADCP.Interval = 30 * 1000; + timerMonitorStopADCP.Start(); + })); + } + else + { + //Console.WriteLine("还有这种情况???"); + + EveryDayLog.WriteDZ("ADCP进行周期继电控制,打开时间:" + startTimeADCP + ",当前时间:" + nowTime + ",还有这种情况???"); + } + } + } + else + { + EveryDayLog.WriteDZ("ADCP关闭周期继电控制"); + + rdoOpenADCP.Enabled = true; + rdoCloseADCP.Enabled = true; + + this.Invoke(new MethodInvoker(delegate + { + timerMonitorStartADCP.Enabled = false; + timerMonitorStartADCP.Stop(); + timerMonitorStopADCP.Enabled = false; + timerMonitorStopADCP.Stop(); + })); + } + } + + private void timerMonitorStartADCP_Tick(object sender, EventArgs e) + { + Thread trdMonitorStart = new Thread(MonitorStartADCP); + trdMonitorStart.IsBackground = true; + trdMonitorStart.Start(); + } + + private void MonitorStartADCP() + { + try + { + DateTime nowDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, 0); + + if (nowDate < startTimeADCP) + return; + + if ((nowDate - startTimeADCP).TotalMinutes % totalLengthADCP == 0) + { + Console.WriteLine("ADCP将在1min后打开!"); + EveryDayLog.WriteDZ("ADCP将在1min后打开!"); + + timerMonitorStartADCP.Enabled = false; + timerMonitorStartADCP.Stop(); + Thread.Sleep(60 * 1000); + timerMonitorStartADCP.Enabled = true; + timerMonitorStartADCP.Start(); + } + else + return; + + ControlSend("ADCP", 0x01, "Cycle"); + } + catch (Exception ex) + { + Console.WriteLine("MonitorStartADCPError:" + ex.Message); + EveryDayLog.WriteErrorDZ("MonitorStartADCPError:" + ex.Message); + } + } + + private void timerMonitorStopADCP_Tick(object sender, EventArgs e) + { + Thread trdMonitorStop = new Thread(MonitorStopADCP); + trdMonitorStop.IsBackground = true; + trdMonitorStop.Start(); + } + + private void MonitorStopADCP() + { + try + { + DateTime nowDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, 0); + + if (nowDate < startTimeADCP) + return; + + if ((nowDate - stopTimeADCP).TotalMinutes % totalLengthADCP == 0) + { + Console.WriteLine("ADCP将在1min后关闭!"); + EveryDayLog.WriteDZ("ADCP将在1min后关闭!"); + + timerMonitorStopADCP.Enabled = false; + timerMonitorStopADCP.Stop(); + Thread.Sleep(60 * 1000); + timerMonitorStopADCP.Enabled = true; + timerMonitorStopADCP.Start(); + } + else + return; + + ControlSend("ADCP", 0x00, "Cycle"); + } + catch (Exception ex) + { + Console.WriteLine("MonitorStopADCPError:" + ex.Message); + EveryDayLog.WriteErrorDZ("MonitorStopADCPError:" + ex.Message); + } + } + #endregion + + + #region 输入检测 + private void txtOpenDurationCTD_KeyPress(object sender, KeyPressEventArgs e) + { + if (!(Char.IsNumber(e.KeyChar)) && e.KeyChar != (char)8) + { + e.Handled = true; + } + } + + private void txtCloseDurationCTD_KeyPress(object sender, KeyPressEventArgs e) + { + if (!(Char.IsNumber(e.KeyChar)) && e.KeyChar != (char)8) + { + e.Handled = true; + } + } + + private void txtOpenDurationEXO2_KeyPress(object sender, KeyPressEventArgs e) + { + if (!(Char.IsNumber(e.KeyChar)) && e.KeyChar != (char)8) + { + e.Handled = true; + } + } + + private void txtCloseDurationEXO2_KeyPress(object sender, KeyPressEventArgs e) + { + if (!(Char.IsNumber(e.KeyChar)) && e.KeyChar != (char)8) + { + e.Handled = true; + } + } + + private void txtOpenDurationCO2_KeyPress(object sender, KeyPressEventArgs e) + { + if (!(Char.IsNumber(e.KeyChar)) && e.KeyChar != (char)8) + { + e.Handled = true; + } + } + + private void txtCloseDurationCO2_KeyPress(object sender, KeyPressEventArgs e) + { + if (!(Char.IsNumber(e.KeyChar)) && e.KeyChar != (char)8) + { + e.Handled = true; + } + } + + private void txtOpenDurationADCP_KeyPress(object sender, KeyPressEventArgs e) + { + if (!(Char.IsNumber(e.KeyChar)) && e.KeyChar != (char)8) + { + e.Handled = true; + } + } + + private void txtCloseDurationADCP_KeyPress(object sender, KeyPressEventArgs e) + { + if (!(Char.IsNumber(e.KeyChar)) && e.KeyChar != (char)8) + { + e.Handled = true; + } + } + + + #endregion + + + public void OtherSettingForm_FormClosing(object sender, FormClosingEventArgs e) + { + timerMonitorStartADCP.Enabled = false; + timerMonitorStartADCP.Stop(); + timerMonitorStopADCP.Enabled = false; + timerMonitorStopADCP.Stop(); + timerMonitorStartCO2.Enabled = false; + timerMonitorStartCO2.Stop(); + timerMonitorStopCO2.Enabled = false; + timerMonitorStopCO2.Stop(); + timerMonitorStartCTD.Enabled = false; + timerMonitorStartCTD.Stop(); + timerMonitorStopCTD.Enabled = false; + timerMonitorStopCTD.Stop(); + timerMonitorStartEXO2.Enabled = false; + timerMonitorStartEXO2.Stop(); + timerMonitorStopEXO2.Enabled = false; + timerMonitorStopEXO2.Stop(); + } + + } } diff --git a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/OtherSettingForm.resx b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/OtherSettingForm.resx index 1af7de1..4243733 100644 --- a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/OtherSettingForm.resx +++ b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/OtherSettingForm.resx @@ -117,4 +117,28 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 17, 17 + + + 200, 17 + + + 383, 17 + + + 574, 17 + + + 779, 19 + + + 946, 19 + + + 1125, 17 + + + 1304, 15 + \ No newline at end of file diff --git a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/Others.cs b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/Others.cs index 10abffe..333fdbd 100644 --- a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/Others.cs +++ b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/Others.cs @@ -6,6 +6,7 @@ using System.Linq; using System.Net.Sockets; using System.Runtime.InteropServices; using System.Text; +using System.Threading; using System.Threading.Tasks; using System.Windows.Forms; @@ -107,17 +108,17 @@ namespace ZTTMS_Manage_yibayiyi_20230320 public static string ftpCTDDataPath = @"/File/SensorData/CTDData"; public static string ftpRecordData = @"/File/RecordData"; - //public static string totalPath = @"E:\Output\"; - //public static string FFmpegPath = Environment.CurrentDirectory + @"\FFmpeg\bin\x86\ffmpeg.exe"; - //public static string picPath = @"E:\Output\Image\Image_01\"; - //public static string picPathShow = @"E:\Output\Image\Image_01"; - //public static string vidPathShow = @"E:\Output\Video\Video_01"; - - public static string picPathShow = @"F:\Code\text\daojiao\Image\Image_01"; - public static string vidPathShow = @"F:\Code\text\daojiao\Video\Video_01"; - public static string picPath = @"F:\Code\text\daojiao\Image\Image_01\"; - public static string totalPath = @"F:\Code\text\daojiao\"; + public static string totalPath = @"E:\Output\"; public static string FFmpegPath = Environment.CurrentDirectory + @"\FFmpeg\bin\x86\ffmpeg.exe"; + public static string picPath = @"E:\Output\Image\Image_01\"; + public static string picPathShow = @"E:\Output\Image\Image_01"; + public static string vidPathShow = @"E:\Output\Video\Video_01"; + + //public static string picPathShow = @"F:\Code\text\daojiao\Image\Image_01"; + //public static string vidPathShow = @"F:\Code\text\daojiao\Video\Video_01"; + //public static string picPath = @"F:\Code\text\daojiao\Image\Image_01\"; + //public static string totalPath = @"F:\Code\text\daojiao\"; + //public static string FFmpegPath = Environment.CurrentDirectory + @"\FFmpeg\bin\x86\ffmpeg.exe"; //标记设备是否使能 @@ -142,6 +143,16 @@ namespace ZTTMS_Manage_yibayiyi_20230320 public static string depth = "5"; + //锁 + //public static object obj = new object(); //锁对象 + //public static bool canUnlock; //判断是否可以解锁 + public static string controlName; + public static byte controlState; + public static byte[] allStates = new byte[11]; + + public static Semaphore semaphore = new Semaphore(1, 1); //信号量 + + #region CRC校验 /// /// CRC8位校验表 diff --git a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/PictureTakeForm.cs b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/PictureTakeForm.cs index 79f76f8..7453d4e 100644 --- a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/PictureTakeForm.cs +++ b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/PictureTakeForm.cs @@ -2032,7 +2032,7 @@ namespace ZTTMS_Manage_yibayiyi_20230320 { if (CamAndVid.clientCamAndVid == null || !Others.g_yxReceive) { - Console.WriteLine("影像腔暂未连接!"); + //Console.WriteLine("影像腔暂未连接!"); return; } diff --git a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/RelayControlForm.Designer.cs b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/RelayControlForm.Designer.cs new file mode 100644 index 0000000..186eacc --- /dev/null +++ b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/RelayControlForm.Designer.cs @@ -0,0 +1,1356 @@ +namespace ZTTMS_Manage_yibayiyi_20230320 +{ + partial class RelayControlForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.pnlTitle = new System.Windows.Forms.Panel(); + this.lblTitle = new System.Windows.Forms.Label(); + this.pnlContent = new System.Windows.Forms.Panel(); + this.grpCycleSetting = new System.Windows.Forms.GroupBox(); + this.lblClose = new System.Windows.Forms.Label(); + this.lblOpen = new System.Windows.Forms.Label(); + this.groupBox11 = new System.Windows.Forms.GroupBox(); + this.groupBox14 = new System.Windows.Forms.GroupBox(); + this.chkCycleControl12 = new System.Windows.Forms.CheckBox(); + this.txtCloseDuration12 = new System.Windows.Forms.TextBox(); + this.txtOpenDuration12 = new System.Windows.Forms.TextBox(); + this.label19 = new System.Windows.Forms.Label(); + this.label20 = new System.Windows.Forms.Label(); + this.dtpOpenTime12 = new System.Windows.Forms.DateTimePicker(); + this.label21 = new System.Windows.Forms.Label(); + this.rdoClose12 = new System.Windows.Forms.RadioButton(); + this.rdoOpen12 = new System.Windows.Forms.RadioButton(); + this.groupBox9 = new System.Windows.Forms.GroupBox(); + this.groupBox13 = new System.Windows.Forms.GroupBox(); + this.txtCloseDuration24 = new System.Windows.Forms.TextBox(); + this.chkCycleControl24 = new System.Windows.Forms.CheckBox(); + this.txtOpenDuration24 = new System.Windows.Forms.TextBox(); + this.label16 = new System.Windows.Forms.Label(); + this.label17 = new System.Windows.Forms.Label(); + this.dtpOpenTime24 = new System.Windows.Forms.DateTimePicker(); + this.label18 = new System.Windows.Forms.Label(); + this.rdoClose24 = new System.Windows.Forms.RadioButton(); + this.rdoOpen24 = new System.Windows.Forms.RadioButton(); + this.groupBox10 = new System.Windows.Forms.GroupBox(); + this.groupBox3 = new System.Windows.Forms.GroupBox(); + this.chkCycleControl48 = new System.Windows.Forms.CheckBox(); + this.txtCloseDuration48 = new System.Windows.Forms.TextBox(); + this.txtOpenDuration48 = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.dtpOpenTime48 = new System.Windows.Forms.DateTimePicker(); + this.label6 = new System.Windows.Forms.Label(); + this.rdoClose48 = new System.Windows.Forms.RadioButton(); + this.rdoOpen48 = new System.Windows.Forms.RadioButton(); + this.groupBox5 = new System.Windows.Forms.GroupBox(); + this.groupBox12 = new System.Windows.Forms.GroupBox(); + this.chkCycleControlUV4 = new System.Windows.Forms.CheckBox(); + this.txtCloseDurationUV4 = new System.Windows.Forms.TextBox(); + this.txtOpenDurationUV4 = new System.Windows.Forms.TextBox(); + this.label13 = new System.Windows.Forms.Label(); + this.label14 = new System.Windows.Forms.Label(); + this.dtpOpenTimeUV4 = new System.Windows.Forms.DateTimePicker(); + this.label15 = new System.Windows.Forms.Label(); + this.rdoCloseUV4 = new System.Windows.Forms.RadioButton(); + this.rdoOpenUV4 = new System.Windows.Forms.RadioButton(); + this.groupBox4 = new System.Windows.Forms.GroupBox(); + this.groupBox6 = new System.Windows.Forms.GroupBox(); + this.chkCycleControlUV2 = new System.Windows.Forms.CheckBox(); + this.txtCloseDurationUV2 = new System.Windows.Forms.TextBox(); + this.txtOpenDurationUV2 = new System.Windows.Forms.TextBox(); + this.label7 = new System.Windows.Forms.Label(); + this.label8 = new System.Windows.Forms.Label(); + this.dtpOpenTimeUV2 = new System.Windows.Forms.DateTimePicker(); + this.label9 = new System.Windows.Forms.Label(); + this.rdoCloseUV2 = new System.Windows.Forms.RadioButton(); + this.rdoOpenUV2 = new System.Windows.Forms.RadioButton(); + this.groupBox7 = new System.Windows.Forms.GroupBox(); + this.groupBox8 = new System.Windows.Forms.GroupBox(); + this.chkCycleControlUV3 = new System.Windows.Forms.CheckBox(); + this.txtCloseDurationUV3 = new System.Windows.Forms.TextBox(); + this.txtOpenDurationUV3 = new System.Windows.Forms.TextBox(); + this.label10 = new System.Windows.Forms.Label(); + this.label11 = new System.Windows.Forms.Label(); + this.dtpOpenTimeUV3 = new System.Windows.Forms.DateTimePicker(); + this.label12 = new System.Windows.Forms.Label(); + this.rdoCloseUV3 = new System.Windows.Forms.RadioButton(); + this.rdoOpenUV3 = new System.Windows.Forms.RadioButton(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.txtCloseDurationUV1 = new System.Windows.Forms.TextBox(); + this.txtOpenDurationUV1 = new System.Windows.Forms.TextBox(); + this.label4 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.dtpOpenTimeUV1 = new System.Windows.Forms.DateTimePicker(); + this.label2 = new System.Windows.Forms.Label(); + this.chkCycleControlUV1 = new System.Windows.Forms.CheckBox(); + this.rdoCloseUV1 = new System.Windows.Forms.RadioButton(); + this.rdoOpenUV1 = new System.Windows.Forms.RadioButton(); + this.btnSetState = new System.Windows.Forms.Button(); + this.timerMonitorStartUV4 = new System.Windows.Forms.Timer(this.components); + this.timerMonitorStopUV4 = new System.Windows.Forms.Timer(this.components); + this.timerMonitorStartUV1 = new System.Windows.Forms.Timer(this.components); + this.timerMonitorStopUV1 = new System.Windows.Forms.Timer(this.components); + this.timerMonitorStartUV2 = new System.Windows.Forms.Timer(this.components); + this.timerMonitorStopUV2 = new System.Windows.Forms.Timer(this.components); + this.timerMonitorStartUV3 = new System.Windows.Forms.Timer(this.components); + this.timerMonitorStopUV3 = new System.Windows.Forms.Timer(this.components); + this.timerMonitorStart48 = new System.Windows.Forms.Timer(this.components); + this.timerMonitorStop48 = new System.Windows.Forms.Timer(this.components); + this.timerMonitorStart24 = new System.Windows.Forms.Timer(this.components); + this.timerMonitorStop24 = new System.Windows.Forms.Timer(this.components); + this.timerMonitorStart12 = new System.Windows.Forms.Timer(this.components); + this.timerMonitorStop12 = new System.Windows.Forms.Timer(this.components); + this.pnlTitle.SuspendLayout(); + this.pnlContent.SuspendLayout(); + this.grpCycleSetting.SuspendLayout(); + this.groupBox11.SuspendLayout(); + this.groupBox14.SuspendLayout(); + this.groupBox9.SuspendLayout(); + this.groupBox13.SuspendLayout(); + this.groupBox10.SuspendLayout(); + this.groupBox3.SuspendLayout(); + this.groupBox5.SuspendLayout(); + this.groupBox12.SuspendLayout(); + this.groupBox4.SuspendLayout(); + this.groupBox6.SuspendLayout(); + this.groupBox7.SuspendLayout(); + this.groupBox8.SuspendLayout(); + this.groupBox2.SuspendLayout(); + this.groupBox1.SuspendLayout(); + this.SuspendLayout(); + // + // pnlTitle + // + this.pnlTitle.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(105)))), ((int)(((byte)(118)))), ((int)(((byte)(128))))); + this.pnlTitle.Controls.Add(this.lblTitle); + this.pnlTitle.Dock = System.Windows.Forms.DockStyle.Top; + this.pnlTitle.Font = new System.Drawing.Font("Microsoft Sans Serif", 20.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.pnlTitle.ForeColor = System.Drawing.SystemColors.ControlLightLight; + this.pnlTitle.Location = new System.Drawing.Point(0, 0); + this.pnlTitle.Margin = new System.Windows.Forms.Padding(8, 7, 8, 7); + this.pnlTitle.Name = "pnlTitle"; + this.pnlTitle.Size = new System.Drawing.Size(1560, 85); + this.pnlTitle.TabIndex = 7; + // + // lblTitle + // + this.lblTitle.AutoSize = true; + this.lblTitle.Font = new System.Drawing.Font("方正楷体简体", 26.25F); + this.lblTitle.Location = new System.Drawing.Point(27, 25); + this.lblTitle.Margin = new System.Windows.Forms.Padding(8, 0, 8, 0); + this.lblTitle.Name = "lblTitle"; + this.lblTitle.Size = new System.Drawing.Size(174, 38); + this.lblTitle.TabIndex = 0; + this.lblTitle.Text = "继电控制2"; + // + // pnlContent + // + this.pnlContent.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(125)))), ((int)(((byte)(137)))), ((int)(((byte)(145))))); + this.pnlContent.Controls.Add(this.grpCycleSetting); + this.pnlContent.Dock = System.Windows.Forms.DockStyle.Fill; + this.pnlContent.Font = new System.Drawing.Font("Microsoft Sans Serif", 20.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.pnlContent.ForeColor = System.Drawing.SystemColors.Control; + this.pnlContent.Location = new System.Drawing.Point(0, 85); + this.pnlContent.Name = "pnlContent"; + this.pnlContent.Size = new System.Drawing.Size(1560, 783); + this.pnlContent.TabIndex = 8; + // + // grpCycleSetting + // + this.grpCycleSetting.Controls.Add(this.lblClose); + this.grpCycleSetting.Controls.Add(this.lblOpen); + this.grpCycleSetting.Controls.Add(this.groupBox11); + this.grpCycleSetting.Controls.Add(this.groupBox9); + this.grpCycleSetting.Controls.Add(this.groupBox10); + this.grpCycleSetting.Controls.Add(this.groupBox5); + this.grpCycleSetting.Controls.Add(this.groupBox4); + this.grpCycleSetting.Controls.Add(this.groupBox7); + this.grpCycleSetting.Controls.Add(this.groupBox2); + this.grpCycleSetting.Controls.Add(this.btnSetState); + this.grpCycleSetting.Font = new System.Drawing.Font("方正楷体简体", 24F); + this.grpCycleSetting.ForeColor = System.Drawing.Color.Transparent; + this.grpCycleSetting.Location = new System.Drawing.Point(44, 10); + this.grpCycleSetting.Name = "grpCycleSetting"; + this.grpCycleSetting.Size = new System.Drawing.Size(1467, 768); + this.grpCycleSetting.TabIndex = 1; + this.grpCycleSetting.TabStop = false; + this.grpCycleSetting.Text = "线路供电设置"; + // + // lblClose + // + this.lblClose.AutoSize = true; + this.lblClose.Font = new System.Drawing.Font("方正楷体简体", 18F); + this.lblClose.Location = new System.Drawing.Point(1219, 568); + this.lblClose.Name = "lblClose"; + this.lblClose.Size = new System.Drawing.Size(108, 27); + this.lblClose.TabIndex = 16; + this.lblClose.Text = "一键关闭"; + this.lblClose.Click += new System.EventHandler(this.lblClose_Click); + // + // lblOpen + // + this.lblOpen.AutoSize = true; + this.lblOpen.Font = new System.Drawing.Font("方正楷体简体", 18F); + this.lblOpen.Location = new System.Drawing.Point(1219, 498); + this.lblOpen.Name = "lblOpen"; + this.lblOpen.Size = new System.Drawing.Size(108, 27); + this.lblOpen.TabIndex = 15; + this.lblOpen.Text = "一键打开"; + this.lblOpen.Click += new System.EventHandler(this.lblOpen_Click); + // + // groupBox11 + // + this.groupBox11.Controls.Add(this.groupBox14); + this.groupBox11.Controls.Add(this.rdoClose12); + this.groupBox11.Controls.Add(this.rdoOpen12); + this.groupBox11.ForeColor = System.Drawing.Color.White; + this.groupBox11.Location = new System.Drawing.Point(748, 408); + this.groupBox11.Name = "groupBox11"; + this.groupBox11.Size = new System.Drawing.Size(311, 353); + this.groupBox11.TabIndex = 13; + this.groupBox11.TabStop = false; + this.groupBox11.Text = "预留12V继电控制"; + // + // groupBox14 + // + this.groupBox14.Controls.Add(this.chkCycleControl12); + this.groupBox14.Controls.Add(this.txtCloseDuration12); + this.groupBox14.Controls.Add(this.txtOpenDuration12); + this.groupBox14.Controls.Add(this.label19); + this.groupBox14.Controls.Add(this.label20); + this.groupBox14.Controls.Add(this.dtpOpenTime12); + this.groupBox14.Controls.Add(this.label21); + this.groupBox14.Font = new System.Drawing.Font("方正楷体简体", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.groupBox14.ForeColor = System.Drawing.Color.White; + this.groupBox14.Location = new System.Drawing.Point(16, 90); + this.groupBox14.Name = "groupBox14"; + this.groupBox14.Size = new System.Drawing.Size(278, 255); + this.groupBox14.TabIndex = 23; + this.groupBox14.TabStop = false; + this.groupBox14.Text = "周期控制"; + // + // chkCycleControl12 + // + this.chkCycleControl12.AutoSize = true; + this.chkCycleControl12.Font = new System.Drawing.Font("方正楷体简体", 18F); + this.chkCycleControl12.Location = new System.Drawing.Point(32, 45); + this.chkCycleControl12.Name = "chkCycleControl12"; + this.chkCycleControl12.Size = new System.Drawing.Size(127, 31); + this.chkCycleControl12.TabIndex = 26; + this.chkCycleControl12.Text = "周期控制"; + this.chkCycleControl12.UseVisualStyleBackColor = true; + this.chkCycleControl12.CheckedChanged += new System.EventHandler(this.chkCycleControl12_CheckedChanged); + // + // txtCloseDuration12 + // + this.txtCloseDuration12.Font = new System.Drawing.Font("方正楷体简体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.txtCloseDuration12.Location = new System.Drawing.Point(148, 211); + this.txtCloseDuration12.Name = "txtCloseDuration12"; + this.txtCloseDuration12.Size = new System.Drawing.Size(100, 35); + this.txtCloseDuration12.TabIndex = 21; + this.txtCloseDuration12.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.txtCloseDuration12.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtCloseDuration12_KeyPress); + // + // txtOpenDuration12 + // + this.txtOpenDuration12.Font = new System.Drawing.Font("方正楷体简体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.txtOpenDuration12.Location = new System.Drawing.Point(148, 166); + this.txtOpenDuration12.Name = "txtOpenDuration12"; + this.txtOpenDuration12.Size = new System.Drawing.Size(100, 35); + this.txtOpenDuration12.TabIndex = 20; + this.txtOpenDuration12.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.txtOpenDuration12.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtOpenDuration12_KeyPress); + // + // label19 + // + this.label19.AutoSize = true; + this.label19.Font = new System.Drawing.Font("方正楷体简体", 18F); + this.label19.Location = new System.Drawing.Point(27, 215); + this.label19.Name = "label19"; + this.label19.Size = new System.Drawing.Size(132, 27); + this.label19.TabIndex = 19; + this.label19.Text = "关闭时长:"; + // + // label20 + // + this.label20.AutoSize = true; + this.label20.Font = new System.Drawing.Font("方正楷体简体", 18F); + this.label20.Location = new System.Drawing.Point(27, 174); + this.label20.Name = "label20"; + this.label20.Size = new System.Drawing.Size(132, 27); + this.label20.TabIndex = 18; + this.label20.Text = "打开时长:"; + // + // dtpOpenTime12 + // + this.dtpOpenTime12.CustomFormat = "yyyy/MM/dd HH:mm"; + this.dtpOpenTime12.Font = new System.Drawing.Font("方正楷体简体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.dtpOpenTime12.Format = System.Windows.Forms.DateTimePickerFormat.Custom; + this.dtpOpenTime12.Location = new System.Drawing.Point(33, 119); + this.dtpOpenTime12.MaxDate = new System.DateTime(2023, 1, 1, 0, 0, 0, 0); + this.dtpOpenTime12.MinDate = new System.DateTime(2023, 1, 1, 0, 0, 0, 0); + this.dtpOpenTime12.Name = "dtpOpenTime12"; + this.dtpOpenTime12.Size = new System.Drawing.Size(216, 35); + this.dtpOpenTime12.TabIndex = 17; + this.dtpOpenTime12.Value = new System.DateTime(2023, 1, 1, 0, 0, 0, 0); + // + // label21 + // + this.label21.AutoSize = true; + this.label21.Font = new System.Drawing.Font("方正楷体简体", 18F); + this.label21.Location = new System.Drawing.Point(29, 82); + this.label21.Name = "label21"; + this.label21.Size = new System.Drawing.Size(132, 27); + this.label21.TabIndex = 17; + this.label21.Text = "打开时间:"; + // + // rdoClose12 + // + this.rdoClose12.AutoSize = true; + this.rdoClose12.Font = new System.Drawing.Font("方正楷体简体", 21.75F); + this.rdoClose12.Location = new System.Drawing.Point(179, 46); + this.rdoClose12.Name = "rdoClose12"; + this.rdoClose12.Size = new System.Drawing.Size(90, 36); + this.rdoClose12.TabIndex = 1; + this.rdoClose12.TabStop = true; + this.rdoClose12.Text = "关闭"; + this.rdoClose12.UseVisualStyleBackColor = true; + // + // rdoOpen12 + // + this.rdoOpen12.AutoSize = true; + this.rdoOpen12.Font = new System.Drawing.Font("方正楷体简体", 21.75F); + this.rdoOpen12.Location = new System.Drawing.Point(39, 46); + this.rdoOpen12.Name = "rdoOpen12"; + this.rdoOpen12.Size = new System.Drawing.Size(90, 36); + this.rdoOpen12.TabIndex = 0; + this.rdoOpen12.TabStop = true; + this.rdoOpen12.Text = "打开"; + this.rdoOpen12.UseVisualStyleBackColor = true; + // + // groupBox9 + // + this.groupBox9.Controls.Add(this.groupBox13); + this.groupBox9.Controls.Add(this.rdoClose24); + this.groupBox9.Controls.Add(this.rdoOpen24); + this.groupBox9.ForeColor = System.Drawing.Color.White; + this.groupBox9.Location = new System.Drawing.Point(392, 408); + this.groupBox9.Name = "groupBox9"; + this.groupBox9.Size = new System.Drawing.Size(311, 353); + this.groupBox9.TabIndex = 12; + this.groupBox9.TabStop = false; + this.groupBox9.Text = "预留24V继电控制"; + // + // groupBox13 + // + this.groupBox13.Controls.Add(this.txtCloseDuration24); + this.groupBox13.Controls.Add(this.chkCycleControl24); + this.groupBox13.Controls.Add(this.txtOpenDuration24); + this.groupBox13.Controls.Add(this.label16); + this.groupBox13.Controls.Add(this.label17); + this.groupBox13.Controls.Add(this.dtpOpenTime24); + this.groupBox13.Controls.Add(this.label18); + this.groupBox13.Font = new System.Drawing.Font("方正楷体简体", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.groupBox13.ForeColor = System.Drawing.Color.White; + this.groupBox13.Location = new System.Drawing.Point(17, 92); + this.groupBox13.Name = "groupBox13"; + this.groupBox13.Size = new System.Drawing.Size(278, 255); + this.groupBox13.TabIndex = 23; + this.groupBox13.TabStop = false; + this.groupBox13.Text = "周期控制"; + // + // txtCloseDuration24 + // + this.txtCloseDuration24.Font = new System.Drawing.Font("方正楷体简体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.txtCloseDuration24.Location = new System.Drawing.Point(148, 211); + this.txtCloseDuration24.Name = "txtCloseDuration24"; + this.txtCloseDuration24.Size = new System.Drawing.Size(100, 35); + this.txtCloseDuration24.TabIndex = 21; + this.txtCloseDuration24.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.txtCloseDuration24.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtCloseDuration24_KeyPress); + // + // chkCycleControl24 + // + this.chkCycleControl24.AutoSize = true; + this.chkCycleControl24.Font = new System.Drawing.Font("方正楷体简体", 18F); + this.chkCycleControl24.Location = new System.Drawing.Point(34, 43); + this.chkCycleControl24.Name = "chkCycleControl24"; + this.chkCycleControl24.Size = new System.Drawing.Size(127, 31); + this.chkCycleControl24.TabIndex = 25; + this.chkCycleControl24.Text = "周期控制"; + this.chkCycleControl24.UseVisualStyleBackColor = true; + this.chkCycleControl24.CheckedChanged += new System.EventHandler(this.chkCycleControl24_CheckedChanged); + // + // txtOpenDuration24 + // + this.txtOpenDuration24.Font = new System.Drawing.Font("方正楷体简体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.txtOpenDuration24.Location = new System.Drawing.Point(148, 166); + this.txtOpenDuration24.Name = "txtOpenDuration24"; + this.txtOpenDuration24.Size = new System.Drawing.Size(100, 35); + this.txtOpenDuration24.TabIndex = 20; + this.txtOpenDuration24.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.txtOpenDuration24.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtOpenDuration24_KeyPress); + // + // label16 + // + this.label16.AutoSize = true; + this.label16.Font = new System.Drawing.Font("方正楷体简体", 18F); + this.label16.Location = new System.Drawing.Point(27, 215); + this.label16.Name = "label16"; + this.label16.Size = new System.Drawing.Size(132, 27); + this.label16.TabIndex = 19; + this.label16.Text = "关闭时长:"; + // + // label17 + // + this.label17.AutoSize = true; + this.label17.Font = new System.Drawing.Font("方正楷体简体", 18F); + this.label17.Location = new System.Drawing.Point(27, 174); + this.label17.Name = "label17"; + this.label17.Size = new System.Drawing.Size(132, 27); + this.label17.TabIndex = 18; + this.label17.Text = "打开时长:"; + // + // dtpOpenTime24 + // + this.dtpOpenTime24.CustomFormat = "yyyy/MM/dd HH:mm"; + this.dtpOpenTime24.Font = new System.Drawing.Font("方正楷体简体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.dtpOpenTime24.Format = System.Windows.Forms.DateTimePickerFormat.Custom; + this.dtpOpenTime24.Location = new System.Drawing.Point(34, 117); + this.dtpOpenTime24.MaxDate = new System.DateTime(2023, 1, 1, 0, 0, 0, 0); + this.dtpOpenTime24.MinDate = new System.DateTime(2023, 1, 1, 0, 0, 0, 0); + this.dtpOpenTime24.Name = "dtpOpenTime24"; + this.dtpOpenTime24.Size = new System.Drawing.Size(217, 35); + this.dtpOpenTime24.TabIndex = 17; + this.dtpOpenTime24.Value = new System.DateTime(2023, 1, 1, 0, 0, 0, 0); + // + // label18 + // + this.label18.AutoSize = true; + this.label18.Font = new System.Drawing.Font("方正楷体简体", 18F); + this.label18.Location = new System.Drawing.Point(29, 82); + this.label18.Name = "label18"; + this.label18.Size = new System.Drawing.Size(132, 27); + this.label18.TabIndex = 17; + this.label18.Text = "打开时间:"; + // + // rdoClose24 + // + this.rdoClose24.AutoSize = true; + this.rdoClose24.Font = new System.Drawing.Font("方正楷体简体", 21.75F); + this.rdoClose24.Location = new System.Drawing.Point(180, 46); + this.rdoClose24.Name = "rdoClose24"; + this.rdoClose24.Size = new System.Drawing.Size(90, 36); + this.rdoClose24.TabIndex = 1; + this.rdoClose24.TabStop = true; + this.rdoClose24.Text = "关闭"; + this.rdoClose24.UseVisualStyleBackColor = true; + // + // rdoOpen24 + // + this.rdoOpen24.AutoSize = true; + this.rdoOpen24.Font = new System.Drawing.Font("方正楷体简体", 21.75F); + this.rdoOpen24.Location = new System.Drawing.Point(40, 46); + this.rdoOpen24.Name = "rdoOpen24"; + this.rdoOpen24.Size = new System.Drawing.Size(90, 36); + this.rdoOpen24.TabIndex = 0; + this.rdoOpen24.TabStop = true; + this.rdoOpen24.Text = "打开"; + this.rdoOpen24.UseVisualStyleBackColor = true; + // + // groupBox10 + // + this.groupBox10.Controls.Add(this.groupBox3); + this.groupBox10.Controls.Add(this.rdoClose48); + this.groupBox10.Controls.Add(this.rdoOpen48); + this.groupBox10.ForeColor = System.Drawing.Color.White; + this.groupBox10.Location = new System.Drawing.Point(38, 408); + this.groupBox10.Name = "groupBox10"; + this.groupBox10.Size = new System.Drawing.Size(311, 353); + this.groupBox10.TabIndex = 11; + this.groupBox10.TabStop = false; + this.groupBox10.Text = "预留48V继电控制"; + // + // groupBox3 + // + this.groupBox3.Controls.Add(this.chkCycleControl48); + this.groupBox3.Controls.Add(this.txtCloseDuration48); + this.groupBox3.Controls.Add(this.txtOpenDuration48); + this.groupBox3.Controls.Add(this.label1); + this.groupBox3.Controls.Add(this.label5); + this.groupBox3.Controls.Add(this.dtpOpenTime48); + this.groupBox3.Controls.Add(this.label6); + this.groupBox3.Font = new System.Drawing.Font("方正楷体简体", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.groupBox3.ForeColor = System.Drawing.Color.White; + this.groupBox3.Location = new System.Drawing.Point(17, 92); + this.groupBox3.Name = "groupBox3"; + this.groupBox3.Size = new System.Drawing.Size(278, 255); + this.groupBox3.TabIndex = 22; + this.groupBox3.TabStop = false; + this.groupBox3.Text = "周期控制"; + // + // chkCycleControl48 + // + this.chkCycleControl48.AutoSize = true; + this.chkCycleControl48.Font = new System.Drawing.Font("方正楷体简体", 18F); + this.chkCycleControl48.Location = new System.Drawing.Point(35, 43); + this.chkCycleControl48.Name = "chkCycleControl48"; + this.chkCycleControl48.Size = new System.Drawing.Size(127, 31); + this.chkCycleControl48.TabIndex = 27; + this.chkCycleControl48.Text = "周期控制"; + this.chkCycleControl48.UseVisualStyleBackColor = true; + this.chkCycleControl48.CheckedChanged += new System.EventHandler(this.chkCycleControl48_CheckedChanged); + // + // txtCloseDuration48 + // + this.txtCloseDuration48.Font = new System.Drawing.Font("方正楷体简体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.txtCloseDuration48.Location = new System.Drawing.Point(148, 211); + this.txtCloseDuration48.Name = "txtCloseDuration48"; + this.txtCloseDuration48.Size = new System.Drawing.Size(100, 35); + this.txtCloseDuration48.TabIndex = 21; + this.txtCloseDuration48.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.txtCloseDuration48.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtCloseDuration48_KeyPress); + // + // txtOpenDuration48 + // + this.txtOpenDuration48.Font = new System.Drawing.Font("方正楷体简体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.txtOpenDuration48.Location = new System.Drawing.Point(148, 166); + this.txtOpenDuration48.Name = "txtOpenDuration48"; + this.txtOpenDuration48.Size = new System.Drawing.Size(100, 35); + this.txtOpenDuration48.TabIndex = 20; + this.txtOpenDuration48.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.txtOpenDuration48.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtOpenDuration48_KeyPress); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Font = new System.Drawing.Font("方正楷体简体", 18F); + this.label1.Location = new System.Drawing.Point(27, 215); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(132, 27); + this.label1.TabIndex = 19; + this.label1.Text = "关闭时长:"; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Font = new System.Drawing.Font("方正楷体简体", 18F); + this.label5.Location = new System.Drawing.Point(27, 174); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(132, 27); + this.label5.TabIndex = 18; + this.label5.Text = "打开时长:"; + // + // dtpOpenTime48 + // + this.dtpOpenTime48.CustomFormat = "yyyy/MM/dd HH:mm"; + this.dtpOpenTime48.Font = new System.Drawing.Font("方正楷体简体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.dtpOpenTime48.Format = System.Windows.Forms.DateTimePickerFormat.Custom; + this.dtpOpenTime48.Location = new System.Drawing.Point(31, 117); + this.dtpOpenTime48.MaxDate = new System.DateTime(2023, 1, 1, 0, 0, 0, 0); + this.dtpOpenTime48.MinDate = new System.DateTime(2023, 1, 1, 0, 0, 0, 0); + this.dtpOpenTime48.Name = "dtpOpenTime48"; + this.dtpOpenTime48.Size = new System.Drawing.Size(216, 35); + this.dtpOpenTime48.TabIndex = 17; + this.dtpOpenTime48.Value = new System.DateTime(2023, 1, 1, 0, 0, 0, 0); + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Font = new System.Drawing.Font("方正楷体简体", 18F); + this.label6.Location = new System.Drawing.Point(29, 82); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(132, 27); + this.label6.TabIndex = 17; + this.label6.Text = "打开时间:"; + // + // rdoClose48 + // + this.rdoClose48.AutoSize = true; + this.rdoClose48.Font = new System.Drawing.Font("方正楷体简体", 21.75F); + this.rdoClose48.Location = new System.Drawing.Point(179, 46); + this.rdoClose48.Name = "rdoClose48"; + this.rdoClose48.Size = new System.Drawing.Size(90, 36); + this.rdoClose48.TabIndex = 1; + this.rdoClose48.TabStop = true; + this.rdoClose48.Text = "关闭"; + this.rdoClose48.UseVisualStyleBackColor = true; + // + // rdoOpen48 + // + this.rdoOpen48.AutoSize = true; + this.rdoOpen48.Font = new System.Drawing.Font("方正楷体简体", 21.75F); + this.rdoOpen48.Location = new System.Drawing.Point(39, 46); + this.rdoOpen48.Name = "rdoOpen48"; + this.rdoOpen48.Size = new System.Drawing.Size(90, 36); + this.rdoOpen48.TabIndex = 0; + this.rdoOpen48.TabStop = true; + this.rdoOpen48.Text = "打开"; + this.rdoOpen48.UseVisualStyleBackColor = true; + // + // groupBox5 + // + this.groupBox5.Controls.Add(this.groupBox12); + this.groupBox5.Controls.Add(this.rdoCloseUV4); + this.groupBox5.Controls.Add(this.rdoOpenUV4); + this.groupBox5.ForeColor = System.Drawing.Color.White; + this.groupBox5.Location = new System.Drawing.Point(1113, 43); + this.groupBox5.Name = "groupBox5"; + this.groupBox5.Size = new System.Drawing.Size(322, 353); + this.groupBox5.TabIndex = 14; + this.groupBox5.TabStop = false; + this.groupBox5.Text = "UV灯4继电控制"; + // + // groupBox12 + // + this.groupBox12.Controls.Add(this.chkCycleControlUV4); + this.groupBox12.Controls.Add(this.txtCloseDurationUV4); + this.groupBox12.Controls.Add(this.txtOpenDurationUV4); + this.groupBox12.Controls.Add(this.label13); + this.groupBox12.Controls.Add(this.label14); + this.groupBox12.Controls.Add(this.dtpOpenTimeUV4); + this.groupBox12.Controls.Add(this.label15); + this.groupBox12.Font = new System.Drawing.Font("方正楷体简体", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.groupBox12.ForeColor = System.Drawing.Color.White; + this.groupBox12.Location = new System.Drawing.Point(23, 91); + this.groupBox12.Name = "groupBox12"; + this.groupBox12.Size = new System.Drawing.Size(278, 255); + this.groupBox12.TabIndex = 12; + this.groupBox12.TabStop = false; + this.groupBox12.Text = "周期控制"; + // + // chkCycleControlUV4 + // + this.chkCycleControlUV4.AutoSize = true; + this.chkCycleControlUV4.Font = new System.Drawing.Font("方正楷体简体", 18F); + this.chkCycleControlUV4.Location = new System.Drawing.Point(32, 42); + this.chkCycleControlUV4.Name = "chkCycleControlUV4"; + this.chkCycleControlUV4.Size = new System.Drawing.Size(127, 31); + this.chkCycleControlUV4.TabIndex = 28; + this.chkCycleControlUV4.Text = "周期控制"; + this.chkCycleControlUV4.UseVisualStyleBackColor = true; + this.chkCycleControlUV4.CheckedChanged += new System.EventHandler(this.chkCycleControlUV4_CheckedChanged); + // + // txtCloseDurationUV4 + // + this.txtCloseDurationUV4.Font = new System.Drawing.Font("方正楷体简体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.txtCloseDurationUV4.Location = new System.Drawing.Point(148, 211); + this.txtCloseDurationUV4.Name = "txtCloseDurationUV4"; + this.txtCloseDurationUV4.Size = new System.Drawing.Size(100, 35); + this.txtCloseDurationUV4.TabIndex = 21; + this.txtCloseDurationUV4.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.txtCloseDurationUV4.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtCloseDurationUV4_KeyPress); + // + // txtOpenDurationUV4 + // + this.txtOpenDurationUV4.Font = new System.Drawing.Font("方正楷体简体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.txtOpenDurationUV4.Location = new System.Drawing.Point(148, 166); + this.txtOpenDurationUV4.Name = "txtOpenDurationUV4"; + this.txtOpenDurationUV4.Size = new System.Drawing.Size(100, 35); + this.txtOpenDurationUV4.TabIndex = 20; + this.txtOpenDurationUV4.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.txtOpenDurationUV4.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtOpenDurationUV4_KeyPress); + // + // label13 + // + this.label13.AutoSize = true; + this.label13.Font = new System.Drawing.Font("方正楷体简体", 18F); + this.label13.Location = new System.Drawing.Point(27, 215); + this.label13.Name = "label13"; + this.label13.Size = new System.Drawing.Size(132, 27); + this.label13.TabIndex = 19; + this.label13.Text = "关闭时长:"; + // + // label14 + // + this.label14.AutoSize = true; + this.label14.Font = new System.Drawing.Font("方正楷体简体", 18F); + this.label14.Location = new System.Drawing.Point(27, 174); + this.label14.Name = "label14"; + this.label14.Size = new System.Drawing.Size(132, 27); + this.label14.TabIndex = 18; + this.label14.Text = "打开时长:"; + // + // dtpOpenTimeUV4 + // + this.dtpOpenTimeUV4.CustomFormat = "yyyy/MM/dd HH:mm"; + this.dtpOpenTimeUV4.Font = new System.Drawing.Font("方正楷体简体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.dtpOpenTimeUV4.Format = System.Windows.Forms.DateTimePickerFormat.Custom; + this.dtpOpenTimeUV4.Location = new System.Drawing.Point(33, 117); + this.dtpOpenTimeUV4.MaxDate = new System.DateTime(2023, 1, 1, 0, 0, 0, 0); + this.dtpOpenTimeUV4.MinDate = new System.DateTime(2023, 1, 1, 0, 0, 0, 0); + this.dtpOpenTimeUV4.Name = "dtpOpenTimeUV4"; + this.dtpOpenTimeUV4.Size = new System.Drawing.Size(216, 35); + this.dtpOpenTimeUV4.TabIndex = 17; + this.dtpOpenTimeUV4.Value = new System.DateTime(2023, 1, 1, 0, 0, 0, 0); + // + // label15 + // + this.label15.AutoSize = true; + this.label15.Font = new System.Drawing.Font("方正楷体简体", 18F); + this.label15.Location = new System.Drawing.Point(29, 82); + this.label15.Name = "label15"; + this.label15.Size = new System.Drawing.Size(132, 27); + this.label15.TabIndex = 17; + this.label15.Text = "打开时间:"; + // + // rdoCloseUV4 + // + this.rdoCloseUV4.AutoSize = true; + this.rdoCloseUV4.Font = new System.Drawing.Font("方正楷体简体", 21.75F); + this.rdoCloseUV4.Location = new System.Drawing.Point(178, 46); + this.rdoCloseUV4.Name = "rdoCloseUV4"; + this.rdoCloseUV4.Size = new System.Drawing.Size(90, 36); + this.rdoCloseUV4.TabIndex = 1; + this.rdoCloseUV4.TabStop = true; + this.rdoCloseUV4.Text = "关闭"; + this.rdoCloseUV4.UseVisualStyleBackColor = true; + // + // rdoOpenUV4 + // + this.rdoOpenUV4.AutoSize = true; + this.rdoOpenUV4.Font = new System.Drawing.Font("方正楷体简体", 21.75F); + this.rdoOpenUV4.Location = new System.Drawing.Point(38, 46); + this.rdoOpenUV4.Name = "rdoOpenUV4"; + this.rdoOpenUV4.Size = new System.Drawing.Size(90, 36); + this.rdoOpenUV4.TabIndex = 0; + this.rdoOpenUV4.TabStop = true; + this.rdoOpenUV4.Text = "打开"; + this.rdoOpenUV4.UseVisualStyleBackColor = true; + // + // groupBox4 + // + this.groupBox4.Controls.Add(this.groupBox6); + this.groupBox4.Controls.Add(this.rdoCloseUV2); + this.groupBox4.Controls.Add(this.rdoOpenUV2); + this.groupBox4.ForeColor = System.Drawing.Color.White; + this.groupBox4.Location = new System.Drawing.Point(392, 43); + this.groupBox4.Name = "groupBox4"; + this.groupBox4.Size = new System.Drawing.Size(311, 353); + this.groupBox4.TabIndex = 10; + this.groupBox4.TabStop = false; + this.groupBox4.Text = "UV灯2继电控制"; + // + // groupBox6 + // + this.groupBox6.Controls.Add(this.chkCycleControlUV2); + this.groupBox6.Controls.Add(this.txtCloseDurationUV2); + this.groupBox6.Controls.Add(this.txtOpenDurationUV2); + this.groupBox6.Controls.Add(this.label7); + this.groupBox6.Controls.Add(this.label8); + this.groupBox6.Controls.Add(this.dtpOpenTimeUV2); + this.groupBox6.Controls.Add(this.label9); + this.groupBox6.Font = new System.Drawing.Font("方正楷体简体", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.groupBox6.ForeColor = System.Drawing.Color.White; + this.groupBox6.Location = new System.Drawing.Point(17, 91); + this.groupBox6.Name = "groupBox6"; + this.groupBox6.Size = new System.Drawing.Size(278, 255); + this.groupBox6.TabIndex = 22; + this.groupBox6.TabStop = false; + this.groupBox6.Text = "周期控制"; + // + // chkCycleControlUV2 + // + this.chkCycleControlUV2.AutoSize = true; + this.chkCycleControlUV2.Font = new System.Drawing.Font("方正楷体简体", 18F); + this.chkCycleControlUV2.Location = new System.Drawing.Point(34, 42); + this.chkCycleControlUV2.Name = "chkCycleControlUV2"; + this.chkCycleControlUV2.Size = new System.Drawing.Size(127, 31); + this.chkCycleControlUV2.TabIndex = 30; + this.chkCycleControlUV2.Text = "周期控制"; + this.chkCycleControlUV2.UseVisualStyleBackColor = true; + this.chkCycleControlUV2.CheckedChanged += new System.EventHandler(this.chkCycleControlUV2_CheckedChanged); + // + // txtCloseDurationUV2 + // + this.txtCloseDurationUV2.Font = new System.Drawing.Font("方正楷体简体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.txtCloseDurationUV2.Location = new System.Drawing.Point(148, 211); + this.txtCloseDurationUV2.Name = "txtCloseDurationUV2"; + this.txtCloseDurationUV2.Size = new System.Drawing.Size(100, 35); + this.txtCloseDurationUV2.TabIndex = 21; + this.txtCloseDurationUV2.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.txtCloseDurationUV2.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtCloseDurationUV2_KeyPress); + // + // txtOpenDurationUV2 + // + this.txtOpenDurationUV2.Font = new System.Drawing.Font("方正楷体简体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.txtOpenDurationUV2.Location = new System.Drawing.Point(148, 166); + this.txtOpenDurationUV2.Name = "txtOpenDurationUV2"; + this.txtOpenDurationUV2.Size = new System.Drawing.Size(100, 35); + this.txtOpenDurationUV2.TabIndex = 20; + this.txtOpenDurationUV2.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.txtOpenDurationUV2.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtOpenDurationUV2_KeyPress); + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Font = new System.Drawing.Font("方正楷体简体", 18F); + this.label7.Location = new System.Drawing.Point(27, 215); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(132, 27); + this.label7.TabIndex = 19; + this.label7.Text = "关闭时长:"; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Font = new System.Drawing.Font("方正楷体简体", 18F); + this.label8.Location = new System.Drawing.Point(27, 174); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(132, 27); + this.label8.TabIndex = 18; + this.label8.Text = "打开时长:"; + // + // dtpOpenTimeUV2 + // + this.dtpOpenTimeUV2.CustomFormat = "yyyy/MM/dd HH:mm"; + this.dtpOpenTimeUV2.Font = new System.Drawing.Font("方正楷体简体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.dtpOpenTimeUV2.Format = System.Windows.Forms.DateTimePickerFormat.Custom; + this.dtpOpenTimeUV2.Location = new System.Drawing.Point(34, 117); + this.dtpOpenTimeUV2.MaxDate = new System.DateTime(2023, 1, 1, 0, 0, 0, 0); + this.dtpOpenTimeUV2.MinDate = new System.DateTime(2023, 1, 1, 0, 0, 0, 0); + this.dtpOpenTimeUV2.Name = "dtpOpenTimeUV2"; + this.dtpOpenTimeUV2.Size = new System.Drawing.Size(217, 35); + this.dtpOpenTimeUV2.TabIndex = 17; + this.dtpOpenTimeUV2.Value = new System.DateTime(2023, 1, 1, 0, 0, 0, 0); + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Font = new System.Drawing.Font("方正楷体简体", 18F); + this.label9.Location = new System.Drawing.Point(29, 82); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(132, 27); + this.label9.TabIndex = 17; + this.label9.Text = "打开时间:"; + // + // rdoCloseUV2 + // + this.rdoCloseUV2.AutoSize = true; + this.rdoCloseUV2.Font = new System.Drawing.Font("方正楷体简体", 21.75F); + this.rdoCloseUV2.Location = new System.Drawing.Point(180, 46); + this.rdoCloseUV2.Name = "rdoCloseUV2"; + this.rdoCloseUV2.Size = new System.Drawing.Size(90, 36); + this.rdoCloseUV2.TabIndex = 1; + this.rdoCloseUV2.TabStop = true; + this.rdoCloseUV2.Text = "关闭"; + this.rdoCloseUV2.UseVisualStyleBackColor = true; + // + // rdoOpenUV2 + // + this.rdoOpenUV2.AutoSize = true; + this.rdoOpenUV2.Font = new System.Drawing.Font("方正楷体简体", 21.75F); + this.rdoOpenUV2.Location = new System.Drawing.Point(40, 46); + this.rdoOpenUV2.Name = "rdoOpenUV2"; + this.rdoOpenUV2.Size = new System.Drawing.Size(90, 36); + this.rdoOpenUV2.TabIndex = 0; + this.rdoOpenUV2.TabStop = true; + this.rdoOpenUV2.Text = "打开"; + this.rdoOpenUV2.UseVisualStyleBackColor = true; + // + // groupBox7 + // + this.groupBox7.Controls.Add(this.groupBox8); + this.groupBox7.Controls.Add(this.rdoCloseUV3); + this.groupBox7.Controls.Add(this.rdoOpenUV3); + this.groupBox7.ForeColor = System.Drawing.Color.White; + this.groupBox7.Location = new System.Drawing.Point(748, 43); + this.groupBox7.Name = "groupBox7"; + this.groupBox7.Size = new System.Drawing.Size(311, 353); + this.groupBox7.TabIndex = 13; + this.groupBox7.TabStop = false; + this.groupBox7.Text = "UV灯3继电控制"; + // + // groupBox8 + // + this.groupBox8.Controls.Add(this.chkCycleControlUV3); + this.groupBox8.Controls.Add(this.txtCloseDurationUV3); + this.groupBox8.Controls.Add(this.txtOpenDurationUV3); + this.groupBox8.Controls.Add(this.label10); + this.groupBox8.Controls.Add(this.label11); + this.groupBox8.Controls.Add(this.dtpOpenTimeUV3); + this.groupBox8.Controls.Add(this.label12); + this.groupBox8.Font = new System.Drawing.Font("方正楷体简体", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.groupBox8.ForeColor = System.Drawing.Color.White; + this.groupBox8.Location = new System.Drawing.Point(16, 91); + this.groupBox8.Name = "groupBox8"; + this.groupBox8.Size = new System.Drawing.Size(278, 255); + this.groupBox8.TabIndex = 12; + this.groupBox8.TabStop = false; + this.groupBox8.Text = "周期控制"; + // + // chkCycleControlUV3 + // + this.chkCycleControlUV3.AutoSize = true; + this.chkCycleControlUV3.Font = new System.Drawing.Font("方正楷体简体", 18F); + this.chkCycleControlUV3.Location = new System.Drawing.Point(35, 42); + this.chkCycleControlUV3.Name = "chkCycleControlUV3"; + this.chkCycleControlUV3.Size = new System.Drawing.Size(127, 31); + this.chkCycleControlUV3.TabIndex = 29; + this.chkCycleControlUV3.Text = "周期控制"; + this.chkCycleControlUV3.UseVisualStyleBackColor = true; + this.chkCycleControlUV3.CheckedChanged += new System.EventHandler(this.chkCycleControlUV3_CheckedChanged); + // + // txtCloseDurationUV3 + // + this.txtCloseDurationUV3.Font = new System.Drawing.Font("方正楷体简体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.txtCloseDurationUV3.Location = new System.Drawing.Point(148, 211); + this.txtCloseDurationUV3.Name = "txtCloseDurationUV3"; + this.txtCloseDurationUV3.Size = new System.Drawing.Size(100, 35); + this.txtCloseDurationUV3.TabIndex = 21; + this.txtCloseDurationUV3.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.txtCloseDurationUV3.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtCloseDurationUV3_KeyPress); + // + // txtOpenDurationUV3 + // + this.txtOpenDurationUV3.Font = new System.Drawing.Font("方正楷体简体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.txtOpenDurationUV3.Location = new System.Drawing.Point(148, 166); + this.txtOpenDurationUV3.Name = "txtOpenDurationUV3"; + this.txtOpenDurationUV3.Size = new System.Drawing.Size(100, 35); + this.txtOpenDurationUV3.TabIndex = 20; + this.txtOpenDurationUV3.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.txtOpenDurationUV3.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtOpenDurationUV3_KeyPress); + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Font = new System.Drawing.Font("方正楷体简体", 18F); + this.label10.Location = new System.Drawing.Point(27, 215); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(132, 27); + this.label10.TabIndex = 19; + this.label10.Text = "关闭时长:"; + // + // label11 + // + this.label11.AutoSize = true; + this.label11.Font = new System.Drawing.Font("方正楷体简体", 18F); + this.label11.Location = new System.Drawing.Point(27, 174); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(132, 27); + this.label11.TabIndex = 18; + this.label11.Text = "打开时长:"; + // + // dtpOpenTimeUV3 + // + this.dtpOpenTimeUV3.CustomFormat = "yyyy/MM/dd HH:mm"; + this.dtpOpenTimeUV3.Font = new System.Drawing.Font("方正楷体简体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.dtpOpenTimeUV3.Format = System.Windows.Forms.DateTimePickerFormat.Custom; + this.dtpOpenTimeUV3.Location = new System.Drawing.Point(35, 117); + this.dtpOpenTimeUV3.MaxDate = new System.DateTime(2023, 1, 1, 0, 0, 0, 0); + this.dtpOpenTimeUV3.MinDate = new System.DateTime(2023, 1, 1, 0, 0, 0, 0); + this.dtpOpenTimeUV3.Name = "dtpOpenTimeUV3"; + this.dtpOpenTimeUV3.Size = new System.Drawing.Size(216, 35); + this.dtpOpenTimeUV3.TabIndex = 17; + this.dtpOpenTimeUV3.Value = new System.DateTime(2023, 1, 1, 0, 0, 0, 0); + // + // label12 + // + this.label12.AutoSize = true; + this.label12.Font = new System.Drawing.Font("方正楷体简体", 18F); + this.label12.Location = new System.Drawing.Point(29, 82); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(132, 27); + this.label12.TabIndex = 17; + this.label12.Text = "打开时间:"; + // + // rdoCloseUV3 + // + this.rdoCloseUV3.AutoSize = true; + this.rdoCloseUV3.Font = new System.Drawing.Font("方正楷体简体", 21.75F); + this.rdoCloseUV3.Location = new System.Drawing.Point(191, 46); + this.rdoCloseUV3.Name = "rdoCloseUV3"; + this.rdoCloseUV3.Size = new System.Drawing.Size(90, 36); + this.rdoCloseUV3.TabIndex = 1; + this.rdoCloseUV3.TabStop = true; + this.rdoCloseUV3.Text = "关闭"; + this.rdoCloseUV3.UseVisualStyleBackColor = true; + // + // rdoOpenUV3 + // + this.rdoOpenUV3.AutoSize = true; + this.rdoOpenUV3.Font = new System.Drawing.Font("方正楷体简体", 21.75F); + this.rdoOpenUV3.Location = new System.Drawing.Point(51, 46); + this.rdoOpenUV3.Name = "rdoOpenUV3"; + this.rdoOpenUV3.Size = new System.Drawing.Size(90, 36); + this.rdoOpenUV3.TabIndex = 0; + this.rdoOpenUV3.TabStop = true; + this.rdoOpenUV3.Text = "打开"; + this.rdoOpenUV3.UseVisualStyleBackColor = true; + // + // groupBox2 + // + this.groupBox2.Controls.Add(this.groupBox1); + this.groupBox2.Controls.Add(this.rdoCloseUV1); + this.groupBox2.Controls.Add(this.rdoOpenUV1); + this.groupBox2.ForeColor = System.Drawing.Color.White; + this.groupBox2.Location = new System.Drawing.Point(38, 43); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(311, 353); + this.groupBox2.TabIndex = 9; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "UV灯1继电控制"; + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.txtCloseDurationUV1); + this.groupBox1.Controls.Add(this.txtOpenDurationUV1); + this.groupBox1.Controls.Add(this.label4); + this.groupBox1.Controls.Add(this.label3); + this.groupBox1.Controls.Add(this.dtpOpenTimeUV1); + this.groupBox1.Controls.Add(this.label2); + this.groupBox1.Controls.Add(this.chkCycleControlUV1); + this.groupBox1.Font = new System.Drawing.Font("方正楷体简体", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.groupBox1.ForeColor = System.Drawing.Color.White; + this.groupBox1.Location = new System.Drawing.Point(18, 91); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(278, 255); + this.groupBox1.TabIndex = 11; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "周期控制"; + // + // txtCloseDurationUV1 + // + this.txtCloseDurationUV1.Font = new System.Drawing.Font("方正楷体简体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.txtCloseDurationUV1.Location = new System.Drawing.Point(148, 211); + this.txtCloseDurationUV1.Name = "txtCloseDurationUV1"; + this.txtCloseDurationUV1.Size = new System.Drawing.Size(100, 35); + this.txtCloseDurationUV1.TabIndex = 21; + this.txtCloseDurationUV1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.txtCloseDurationUV1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtCloseDurationUV1_KeyPress); + // + // txtOpenDurationUV1 + // + this.txtOpenDurationUV1.Font = new System.Drawing.Font("方正楷体简体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.txtOpenDurationUV1.Location = new System.Drawing.Point(148, 166); + this.txtOpenDurationUV1.Name = "txtOpenDurationUV1"; + this.txtOpenDurationUV1.Size = new System.Drawing.Size(100, 35); + this.txtOpenDurationUV1.TabIndex = 20; + this.txtOpenDurationUV1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.txtOpenDurationUV1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtOpenDurationUV1_KeyPress); + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Font = new System.Drawing.Font("方正楷体简体", 18F); + this.label4.Location = new System.Drawing.Point(27, 215); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(132, 27); + this.label4.TabIndex = 19; + this.label4.Text = "关闭时长:"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Font = new System.Drawing.Font("方正楷体简体", 18F); + this.label3.Location = new System.Drawing.Point(27, 174); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(132, 27); + this.label3.TabIndex = 18; + this.label3.Text = "打开时长:"; + // + // dtpOpenTimeUV1 + // + this.dtpOpenTimeUV1.CustomFormat = "yyyy/MM/dd HH:mm"; + this.dtpOpenTimeUV1.Font = new System.Drawing.Font("方正楷体简体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.dtpOpenTimeUV1.Format = System.Windows.Forms.DateTimePickerFormat.Custom; + this.dtpOpenTimeUV1.Location = new System.Drawing.Point(34, 117); + this.dtpOpenTimeUV1.MaxDate = new System.DateTime(2023, 1, 1, 0, 0, 0, 0); + this.dtpOpenTimeUV1.MinDate = new System.DateTime(2023, 1, 1, 0, 0, 0, 0); + this.dtpOpenTimeUV1.Name = "dtpOpenTimeUV1"; + this.dtpOpenTimeUV1.Size = new System.Drawing.Size(216, 35); + this.dtpOpenTimeUV1.TabIndex = 17; + this.dtpOpenTimeUV1.Value = new System.DateTime(2023, 1, 1, 0, 0, 0, 0); + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Font = new System.Drawing.Font("方正楷体简体", 18F); + this.label2.Location = new System.Drawing.Point(29, 82); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(132, 27); + this.label2.TabIndex = 17; + this.label2.Text = "打开时间:"; + // + // chkCycleControlUV1 + // + this.chkCycleControlUV1.AutoSize = true; + this.chkCycleControlUV1.Font = new System.Drawing.Font("方正楷体简体", 18F); + this.chkCycleControlUV1.Location = new System.Drawing.Point(34, 42); + this.chkCycleControlUV1.Name = "chkCycleControlUV1"; + this.chkCycleControlUV1.Size = new System.Drawing.Size(127, 31); + this.chkCycleControlUV1.TabIndex = 24; + this.chkCycleControlUV1.Text = "周期控制"; + this.chkCycleControlUV1.UseVisualStyleBackColor = true; + this.chkCycleControlUV1.CheckedChanged += new System.EventHandler(this.chkCycleControlUV1_CheckedChanged); + // + // rdoCloseUV1 + // + this.rdoCloseUV1.AutoSize = true; + this.rdoCloseUV1.Font = new System.Drawing.Font("方正楷体简体", 21.75F); + this.rdoCloseUV1.Location = new System.Drawing.Point(179, 46); + this.rdoCloseUV1.Name = "rdoCloseUV1"; + this.rdoCloseUV1.Size = new System.Drawing.Size(90, 36); + this.rdoCloseUV1.TabIndex = 1; + this.rdoCloseUV1.TabStop = true; + this.rdoCloseUV1.Text = "关闭"; + this.rdoCloseUV1.UseVisualStyleBackColor = true; + // + // rdoOpenUV1 + // + this.rdoOpenUV1.AutoSize = true; + this.rdoOpenUV1.Font = new System.Drawing.Font("方正楷体简体", 21.75F); + this.rdoOpenUV1.Location = new System.Drawing.Point(39, 46); + this.rdoOpenUV1.Name = "rdoOpenUV1"; + this.rdoOpenUV1.Size = new System.Drawing.Size(90, 36); + this.rdoOpenUV1.TabIndex = 0; + this.rdoOpenUV1.TabStop = true; + this.rdoOpenUV1.Text = "打开"; + this.rdoOpenUV1.UseVisualStyleBackColor = true; + // + // btnSetState + // + this.btnSetState.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnSetState.ForeColor = System.Drawing.SystemColors.Control; + this.btnSetState.Location = new System.Drawing.Point(1183, 649); + this.btnSetState.Name = "btnSetState"; + this.btnSetState.Size = new System.Drawing.Size(210, 60); + this.btnSetState.TabIndex = 1; + this.btnSetState.Text = "设置"; + this.btnSetState.UseVisualStyleBackColor = true; + this.btnSetState.Click += new System.EventHandler(this.btnSetState_Click); + // + // timerMonitorStartUV4 + // + this.timerMonitorStartUV4.Tick += new System.EventHandler(this.timerMonitorStartUV4_Tick); + // + // timerMonitorStopUV4 + // + this.timerMonitorStopUV4.Tick += new System.EventHandler(this.timerMonitorStopUV4_Tick); + // + // timerMonitorStartUV1 + // + this.timerMonitorStartUV1.Tick += new System.EventHandler(this.timerMonitorStartUV1_Tick); + // + // timerMonitorStopUV1 + // + this.timerMonitorStopUV1.Tick += new System.EventHandler(this.timerMonitorStopUV1_Tick); + // + // timerMonitorStartUV2 + // + this.timerMonitorStartUV2.Tick += new System.EventHandler(this.timerMonitorStartUV2_Tick); + // + // timerMonitorStopUV2 + // + this.timerMonitorStopUV2.Tick += new System.EventHandler(this.timerMonitorStopUV2_Tick); + // + // timerMonitorStartUV3 + // + this.timerMonitorStartUV3.Tick += new System.EventHandler(this.timerMonitorStartUV3_Tick); + // + // timerMonitorStopUV3 + // + this.timerMonitorStopUV3.Tick += new System.EventHandler(this.timerMonitorStopUV3_Tick); + // + // timerMonitorStart48 + // + this.timerMonitorStart48.Tick += new System.EventHandler(this.timerMonitorStart48_Tick); + // + // timerMonitorStop48 + // + this.timerMonitorStop48.Tick += new System.EventHandler(this.timerMonitorStop48_Tick); + // + // timerMonitorStart24 + // + this.timerMonitorStart24.Tick += new System.EventHandler(this.timerMonitorStart24_Tick); + // + // timerMonitorStop24 + // + this.timerMonitorStop24.Tick += new System.EventHandler(this.timerMonitorStop24_Tick); + // + // timerMonitorStart12 + // + this.timerMonitorStart12.Tick += new System.EventHandler(this.timerMonitorStart12_Tick); + // + // timerMonitorStop12 + // + this.timerMonitorStop12.Tick += new System.EventHandler(this.timerMonitorStop12_Tick); + // + // RelayControlForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1560, 868); + this.Controls.Add(this.pnlContent); + this.Controls.Add(this.pnlTitle); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + this.Name = "RelayControlForm"; + this.Text = "RelayControlForm"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.RelayControlForm_FormClosing); + this.Load += new System.EventHandler(this.RelayControlForm_Load); + this.pnlTitle.ResumeLayout(false); + this.pnlTitle.PerformLayout(); + this.pnlContent.ResumeLayout(false); + this.grpCycleSetting.ResumeLayout(false); + this.grpCycleSetting.PerformLayout(); + this.groupBox11.ResumeLayout(false); + this.groupBox11.PerformLayout(); + this.groupBox14.ResumeLayout(false); + this.groupBox14.PerformLayout(); + this.groupBox9.ResumeLayout(false); + this.groupBox9.PerformLayout(); + this.groupBox13.ResumeLayout(false); + this.groupBox13.PerformLayout(); + this.groupBox10.ResumeLayout(false); + this.groupBox10.PerformLayout(); + this.groupBox3.ResumeLayout(false); + this.groupBox3.PerformLayout(); + this.groupBox5.ResumeLayout(false); + this.groupBox5.PerformLayout(); + this.groupBox12.ResumeLayout(false); + this.groupBox12.PerformLayout(); + this.groupBox4.ResumeLayout(false); + this.groupBox4.PerformLayout(); + this.groupBox6.ResumeLayout(false); + this.groupBox6.PerformLayout(); + this.groupBox7.ResumeLayout(false); + this.groupBox7.PerformLayout(); + this.groupBox8.ResumeLayout(false); + this.groupBox8.PerformLayout(); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Panel pnlTitle; + private System.Windows.Forms.Label lblTitle; + private System.Windows.Forms.Panel pnlContent; + private System.Windows.Forms.GroupBox grpCycleSetting; + private System.Windows.Forms.Label lblClose; + private System.Windows.Forms.Label lblOpen; + private System.Windows.Forms.GroupBox groupBox11; + private System.Windows.Forms.GroupBox groupBox9; + private System.Windows.Forms.GroupBox groupBox10; + private System.Windows.Forms.GroupBox groupBox5; + private System.Windows.Forms.GroupBox groupBox4; + private System.Windows.Forms.GroupBox groupBox7; + private System.Windows.Forms.GroupBox groupBox2; + public System.Windows.Forms.Button btnSetState; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.TextBox txtCloseDurationUV1; + private System.Windows.Forms.TextBox txtOpenDurationUV1; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.DateTimePicker dtpOpenTimeUV1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.GroupBox groupBox3; + private System.Windows.Forms.TextBox txtCloseDuration48; + private System.Windows.Forms.TextBox txtOpenDuration48; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.DateTimePicker dtpOpenTime48; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.GroupBox groupBox14; + private System.Windows.Forms.TextBox txtCloseDuration12; + private System.Windows.Forms.TextBox txtOpenDuration12; + private System.Windows.Forms.Label label19; + private System.Windows.Forms.Label label20; + private System.Windows.Forms.DateTimePicker dtpOpenTime12; + private System.Windows.Forms.Label label21; + private System.Windows.Forms.GroupBox groupBox13; + private System.Windows.Forms.TextBox txtCloseDuration24; + private System.Windows.Forms.TextBox txtOpenDuration24; + private System.Windows.Forms.Label label16; + private System.Windows.Forms.Label label17; + private System.Windows.Forms.DateTimePicker dtpOpenTime24; + private System.Windows.Forms.Label label18; + private System.Windows.Forms.GroupBox groupBox12; + private System.Windows.Forms.TextBox txtCloseDurationUV4; + private System.Windows.Forms.TextBox txtOpenDurationUV4; + private System.Windows.Forms.Label label13; + private System.Windows.Forms.Label label14; + private System.Windows.Forms.DateTimePicker dtpOpenTimeUV4; + private System.Windows.Forms.Label label15; + private System.Windows.Forms.GroupBox groupBox6; + private System.Windows.Forms.TextBox txtCloseDurationUV2; + private System.Windows.Forms.TextBox txtOpenDurationUV2; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.DateTimePicker dtpOpenTimeUV2; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.GroupBox groupBox8; + private System.Windows.Forms.TextBox txtCloseDurationUV3; + private System.Windows.Forms.TextBox txtOpenDurationUV3; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.Label label11; + private System.Windows.Forms.DateTimePicker dtpOpenTimeUV3; + private System.Windows.Forms.Label label12; + public System.Windows.Forms.RadioButton rdoCloseUV2; + public System.Windows.Forms.RadioButton rdoOpenUV2; + public System.Windows.Forms.RadioButton rdoCloseUV3; + public System.Windows.Forms.RadioButton rdoOpenUV3; + public System.Windows.Forms.RadioButton rdoCloseUV1; + public System.Windows.Forms.RadioButton rdoOpenUV1; + public System.Windows.Forms.RadioButton rdoCloseUV4; + public System.Windows.Forms.RadioButton rdoOpenUV4; + public System.Windows.Forms.RadioButton rdoClose12; + public System.Windows.Forms.RadioButton rdoOpen12; + public System.Windows.Forms.RadioButton rdoClose24; + public System.Windows.Forms.RadioButton rdoOpen24; + public System.Windows.Forms.RadioButton rdoClose48; + public System.Windows.Forms.RadioButton rdoOpen48; + private System.Windows.Forms.Timer timerMonitorStartUV4; + private System.Windows.Forms.Timer timerMonitorStopUV4; + private System.Windows.Forms.Timer timerMonitorStartUV1; + private System.Windows.Forms.Timer timerMonitorStopUV1; + private System.Windows.Forms.Timer timerMonitorStartUV2; + private System.Windows.Forms.Timer timerMonitorStopUV2; + private System.Windows.Forms.Timer timerMonitorStartUV3; + private System.Windows.Forms.Timer timerMonitorStopUV3; + private System.Windows.Forms.Timer timerMonitorStart48; + private System.Windows.Forms.Timer timerMonitorStop48; + private System.Windows.Forms.Timer timerMonitorStart24; + private System.Windows.Forms.Timer timerMonitorStop24; + private System.Windows.Forms.Timer timerMonitorStart12; + private System.Windows.Forms.Timer timerMonitorStop12; + private System.Windows.Forms.CheckBox chkCycleControl12; + private System.Windows.Forms.CheckBox chkCycleControl24; + private System.Windows.Forms.CheckBox chkCycleControl48; + private System.Windows.Forms.CheckBox chkCycleControlUV4; + private System.Windows.Forms.CheckBox chkCycleControlUV2; + private System.Windows.Forms.CheckBox chkCycleControlUV3; + private System.Windows.Forms.CheckBox chkCycleControlUV1; + } +} \ No newline at end of file diff --git a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/RelayControlForm.cs b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/RelayControlForm.cs new file mode 100644 index 0000000..acec856 --- /dev/null +++ b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/RelayControlForm.cs @@ -0,0 +1,1608 @@ +using Coldairarrow.Util; +using MySql.Data.MySqlClient; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace ZTTMS_Manage_yibayiyi_20230320 +{ + public partial class RelayControlForm : Form + { + public RelayControlForm() + { + InitializeComponent(); + } + + + //周期控制定义 + DateTime startTimeUV1; + DateTime startTimeUV2; + DateTime startTimeUV3; + DateTime startTimeUV4; + DateTime startTime48; + DateTime startTime24; + DateTime startTime12; + DateTime stopTimeUV1; + DateTime stopTimeUV2; + DateTime stopTimeUV3; + DateTime stopTimeUV4; + DateTime stopTime48; + DateTime stopTime24; + DateTime stopTime12; + int startLengthUV1; + int startLengthUV2; + int startLengthUV3; + int startLengthUV4; + int startLength48; + int startLength24; + int startLength12; + int stopLengthUV1; + int stopLengthUV2; + int stopLengthUV3; + int stopLengthUV4; + int stopLength48; + int stopLength24; + int stopLength12; + int totalLengthUV1; + int totalLengthUV2; + int totalLengthUV3; + int totalLengthUV4; + int totalLength48; + int totalLength24; + int totalLength12; + + + private void RelayControlForm_Load(object sender, EventArgs e) + { + dtpOpenTimeUV1.MinDate = new DateTime(2023, 1, 1, 00, 00, 00); + dtpOpenTimeUV1.MaxDate = new DateTime(2030, 1, 1, 00, 00, 00); + dtpOpenTimeUV1.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, 00, 00, 00); + dtpOpenTimeUV2.MinDate = new DateTime(2023, 1, 1, 00, 00, 00); + dtpOpenTimeUV2.MaxDate = new DateTime(2030, 1, 1, 00, 00, 00); + dtpOpenTimeUV2.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, 00, 00, 00); + dtpOpenTimeUV3.MinDate = new DateTime(2023, 1, 1, 00, 00, 00); + dtpOpenTimeUV3.MaxDate = new DateTime(2030, 1, 1, 00, 00, 00); + dtpOpenTimeUV3.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, 00, 00, 00); + dtpOpenTimeUV4.MinDate = new DateTime(2023, 1, 1, 00, 00, 00); + dtpOpenTimeUV4.MaxDate = new DateTime(2030, 1, 1, 00, 00, 00); + dtpOpenTimeUV4.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, 00, 00, 00); + dtpOpenTime48.MinDate = new DateTime(2023, 1, 1, 00, 00, 00); + dtpOpenTime48.MaxDate = new DateTime(2030, 1, 1, 00, 00, 00); + dtpOpenTime48.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, 00, 00, 00); + dtpOpenTime24.MinDate = new DateTime(2023, 1, 1, 00, 00, 00); + dtpOpenTime24.MaxDate = new DateTime(2030, 1, 1, 00, 00, 00); + dtpOpenTime24.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, 00, 00, 00); + dtpOpenTime12.MinDate = new DateTime(2023, 1, 1, 00, 00, 00); + dtpOpenTime12.MaxDate = new DateTime(2030, 1, 1, 00, 00, 00); + dtpOpenTime12.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, 00, 00, 00); + } + + + private void lblOpen_Click(object sender, EventArgs e) + { + rdoOpen12.Checked = true; + rdoOpen24.Checked = true; + rdoOpen48.Checked = true; + rdoOpenUV1.Checked = true; + rdoOpenUV2.Checked = true; + rdoOpenUV3.Checked = true; + rdoOpenUV4.Checked = true; + } + + private void lblClose_Click(object sender, EventArgs e) + { + rdoClose12.Checked = true; + rdoClose24.Checked = true; + rdoClose48.Checked = true; + rdoCloseUV1.Checked = true; + rdoCloseUV2.Checked = true; + rdoCloseUV3.Checked = true; + rdoCloseUV4.Checked = true; + } + + + #region 输入检测 + private void txtOpenDurationUV1_KeyPress(object sender, KeyPressEventArgs e) + { + if (!(Char.IsNumber(e.KeyChar)) && e.KeyChar != (char)8) + { + e.Handled = true; + } + } + + private void txtCloseDurationUV1_KeyPress(object sender, KeyPressEventArgs e) + { + if (!(Char.IsNumber(e.KeyChar)) && e.KeyChar != (char)8) + { + e.Handled = true; + } + } + + private void txtOpenDurationUV2_KeyPress(object sender, KeyPressEventArgs e) + { + if (!(Char.IsNumber(e.KeyChar)) && e.KeyChar != (char)8) + { + e.Handled = true; + } + } + + private void txtCloseDurationUV2_KeyPress(object sender, KeyPressEventArgs e) + { + if (!(Char.IsNumber(e.KeyChar)) && e.KeyChar != (char)8) + { + e.Handled = true; + } + } + + private void txtOpenDurationUV3_KeyPress(object sender, KeyPressEventArgs e) + { + if (!(Char.IsNumber(e.KeyChar)) && e.KeyChar != (char)8) + { + e.Handled = true; + } + } + + private void txtCloseDurationUV3_KeyPress(object sender, KeyPressEventArgs e) + { + if (!(Char.IsNumber(e.KeyChar)) && e.KeyChar != (char)8) + { + e.Handled = true; + } + } + + private void txtOpenDurationUV4_KeyPress(object sender, KeyPressEventArgs e) + { + if (!(Char.IsNumber(e.KeyChar)) && e.KeyChar != (char)8) + { + e.Handled = true; + } + } + + private void txtCloseDurationUV4_KeyPress(object sender, KeyPressEventArgs e) + { + if (!(Char.IsNumber(e.KeyChar)) && e.KeyChar != (char)8) + { + e.Handled = true; + } + } + + private void txtOpenDuration48_KeyPress(object sender, KeyPressEventArgs e) + { + if (!(Char.IsNumber(e.KeyChar)) && e.KeyChar != (char)8) + { + e.Handled = true; + } + } + + private void txtCloseDuration48_KeyPress(object sender, KeyPressEventArgs e) + { + if (!(Char.IsNumber(e.KeyChar)) && e.KeyChar != (char)8) + { + e.Handled = true; + } + } + + private void txtOpenDuration24_KeyPress(object sender, KeyPressEventArgs e) + { + if (!(Char.IsNumber(e.KeyChar)) && e.KeyChar != (char)8) + { + e.Handled = true; + } + } + + private void txtCloseDuration24_KeyPress(object sender, KeyPressEventArgs e) + { + if (!(Char.IsNumber(e.KeyChar)) && e.KeyChar != (char)8) + { + e.Handled = true; + } + } + + private void txtOpenDuration12_KeyPress(object sender, KeyPressEventArgs e) + { + if (!(Char.IsNumber(e.KeyChar)) && e.KeyChar != (char)8) + { + e.Handled = true; + } + } + + private void txtCloseDuration12_KeyPress(object sender, KeyPressEventArgs e) + { + if (!(Char.IsNumber(e.KeyChar)) && e.KeyChar != (char)8) + { + e.Handled = true; + } + } + #endregion + + + #region UV1周期控制 + private void chkCycleControlUV1_CheckedChanged(object sender, EventArgs e) + { + if (chkCycleControlUV1.Checked) + { + //如果时长为空 + if (txtOpenDurationUV1.Text == "" || txtCloseDurationUV1.Text == "") + { + chkCycleControlUV1.Checked = false; + return; + } + + //禁止修改 + dtpOpenTimeUV1.Enabled = false; + txtOpenDurationUV1.Enabled = false; + txtCloseDurationUV1.Enabled = false; + + //禁止单独控制 + rdoOpenUV1.Enabled = false; + rdoCloseUV1.Enabled = false; + + startLengthUV1 = int.Parse(txtOpenDurationUV1.Text); + stopLengthUV1 = int.Parse(txtCloseDurationUV1.Text); + totalLengthUV1 = startLengthUV1 + stopLengthUV1; + string time = Convert.ToDateTime(dtpOpenTimeUV1.Value).ToString("yyyy-MM-dd HH:mm:ss"); + startTimeUV1 = Convert.ToDateTime(time); + stopTimeUV1 = startTimeUV1.AddMinutes(-stopLengthUV1); + DateTime nowTime = DateTime.Now; + + EveryDayLog.WriteDZ("UV1开启周期继电控制,打开时间:" + startTimeUV1 + ",打开时长:" + startLengthUV1 + ",关闭时长:" + stopLengthUV1); + + //当前时间早于开始时间 + if (startTimeUV1 > nowTime) + { + EveryDayLog.WriteDZ("UV1进行周期继电控制,打开时间:" + startTimeUV1 + ",当前时间:" + nowTime + ",当前时间早于开始时间"); + Console.WriteLine("UV1当前时间早于开始时间"); + //开始监测,到时间后开启工作 + this.Invoke(new MethodInvoker(delegate + { + timerMonitorStartUV1.Enabled = true; + timerMonitorStartUV1.Interval = 30 * 1000; + timerMonitorStartUV1.Start(); + + timerMonitorStopUV1.Enabled = true; + timerMonitorStopUV1.Interval = 30 * 1000; + timerMonitorStopUV1.Start(); + })); + } + else + { + //当前时间晚于开始时间,但大于等于结束时间 + if ((nowTime - startTimeUV1).TotalMinutes % totalLengthUV1 <= startLengthUV1 && (nowTime - startTimeUV1).TotalMinutes % totalLengthUV1 > 0) + { + EveryDayLog.WriteDZ("UV1进行周期继电控制,打开时间:" + startTimeUV1 + ",当前时间:" + nowTime + ",当前时间晚于开始时间,但大于等于结束时间"); + Console.WriteLine("UV1当前时间晚于开始时间,但大于等于结束时间"); + //立即开始工作 + MainForm.otherSettingForm.ControlSend("UV1", 0x01, "Cycle"); + + //开始监测,到时间后结束工作 + this.Invoke(new MethodInvoker(delegate + { + timerMonitorStopUV1.Enabled = true; + timerMonitorStopUV1.Interval = 30 * 1000; + timerMonitorStopUV1.Start(); + + timerMonitorStartUV1.Enabled = true; + timerMonitorStartUV1.Interval = 30 * 1000; + timerMonitorStartUV1.Start(); + })); + } + //当前时间大于结束时间,但小于等于后续的开始时间 + else if ((nowTime - startTimeUV1).TotalMinutes % totalLengthUV1 > startLengthUV1 && (nowTime - startTimeUV1).TotalMinutes % totalLengthUV1 <= totalLengthUV1) + { + EveryDayLog.WriteDZ("UV1进行周期继电控制,打开时间:" + startTimeUV1 + ",当前时间:" + nowTime + ",当前时间大于结束时间,但小于等于后续的开始时间"); + Console.WriteLine("UV1当前时间大于结束时间,但小于等于后续的开始时间"); + //开始监测,到时间后开始工作 + this.Invoke(new MethodInvoker(delegate + { + timerMonitorStartUV1.Enabled = true; + timerMonitorStartUV1.Interval = 30 * 1000; + timerMonitorStartUV1.Start(); + + timerMonitorStopUV1.Enabled = true; + timerMonitorStopUV1.Interval = 30 * 1000; + timerMonitorStopUV1.Start(); + })); + } + else + { + Console.WriteLine("UV1还有这种情况???"); + + EveryDayLog.WriteDZ("UV1进行周期继电控制,打开时间:" + startTimeUV1 + ",当前时间:" + nowTime + ",还有这种情况???"); + } + } + } + else + { + EveryDayLog.WriteDZ("UV1关闭周期继电控制"); + + rdoOpenUV1.Enabled = true; + rdoCloseUV1.Enabled = true; + + this.Invoke(new MethodInvoker(delegate + { + timerMonitorStartUV1.Enabled = false; + timerMonitorStartUV1.Stop(); + timerMonitorStopUV1.Enabled = false; + timerMonitorStopUV1.Stop(); + })); + } + } + + private void timerMonitorStartUV1_Tick(object sender, EventArgs e) + { + Thread trdMonitorStart = new Thread(MonitorStartUV1); + trdMonitorStart.IsBackground = true; + trdMonitorStart.Start(); + } + + private void MonitorStartUV1() + { + try + { + DateTime nowDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, 0); + + if (nowDate < startTimeUV1) + return; + + if ((nowDate - startTimeUV1).TotalMinutes % totalLengthUV1 == 0) + { + Console.WriteLine("UV1将在1min后打开!"); + EveryDayLog.WriteDZ("UV1将在1min后打开!"); + + timerMonitorStartUV1.Enabled = false; + timerMonitorStartUV1.Stop(); + Thread.Sleep(60 * 1000); + timerMonitorStartUV1.Enabled = true; + timerMonitorStartUV1.Start(); + } + else + return; + + MainForm.otherSettingForm.ControlSend("UV1", 0x01, "Cycle"); + } + catch (Exception ex) + { + Console.WriteLine("MonitorStartUV1Error:" + ex.Message); + EveryDayLog.WriteErrorDZ("MonitorStartUV1Error:" + ex.Message); + } + } + + private void timerMonitorStopUV1_Tick(object sender, EventArgs e) + { + Thread trdMonitorStop = new Thread(MonitorStopUV1); + trdMonitorStop.IsBackground = true; + trdMonitorStop.Start(); + } + + private void MonitorStopUV1() + { + try + { + DateTime nowDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, 0); + + if (nowDate < startTimeUV1) + return; + + if ((nowDate - stopTimeUV1).TotalMinutes % totalLengthUV1 == 0) + { + Console.WriteLine("UV1将在1min后关闭!"); + EveryDayLog.WriteDZ("UV1将在1min后关闭!"); + + timerMonitorStopUV1.Enabled = false; + timerMonitorStopUV1.Stop(); + Thread.Sleep(60 * 1000); + timerMonitorStopUV1.Enabled = true; + timerMonitorStopUV1.Start(); + } + else + return; + + MainForm.otherSettingForm.ControlSend("UV1", 0x00, "Cycle"); + } + catch (Exception ex) + { + Console.WriteLine("MonitorStopUV1Error:" + ex.Message); + EveryDayLog.WriteErrorDZ("MonitorStopUV1Error:" + ex.Message); + } + } + #endregion + + + #region UV2周期控制 + private void chkCycleControlUV2_CheckedChanged(object sender, EventArgs e) + { + if (chkCycleControlUV2.Checked) + { + //如果时长为空 + if (txtOpenDurationUV2.Text == "" || txtCloseDurationUV2.Text == "") + { + chkCycleControlUV2.Checked = false; + return; + } + + //禁止修改 + dtpOpenTimeUV2.Enabled = false; + txtOpenDurationUV2.Enabled = false; + txtCloseDurationUV2.Enabled = false; + + //禁止单独控制 + rdoOpenUV2.Enabled = false; + rdoCloseUV2.Enabled = false; + + startLengthUV2 = int.Parse(txtOpenDurationUV2.Text); + stopLengthUV2 = int.Parse(txtCloseDurationUV2.Text); + totalLengthUV2 = startLengthUV2 + stopLengthUV2; + string time = Convert.ToDateTime(dtpOpenTimeUV2.Value).ToString("yyyy-MM-dd HH:mm:ss"); + startTimeUV2 = Convert.ToDateTime(time); + stopTimeUV2 = startTimeUV2.AddMinutes(-stopLengthUV2); + DateTime nowTime = DateTime.Now; + + EveryDayLog.WriteDZ("UV2开启周期继电控制,打开时间:" + startTimeUV2 + ",打开时长:" + startLengthUV2 + ",关闭时长:" + stopLengthUV2); + + //当前时间早于开始时间 + if (startTimeUV2 > nowTime) + { + EveryDayLog.WriteDZ("UV2进行周期继电控制,打开时间:" + startTimeUV2 + ",当前时间:" + nowTime + ",当前时间早于开始时间"); + + //开始监测,到时间后开启工作 + this.Invoke(new MethodInvoker(delegate + { + timerMonitorStartUV2.Enabled = true; + timerMonitorStartUV2.Interval = 30 * 1000; + timerMonitorStartUV2.Start(); + + timerMonitorStopUV2.Enabled = true; + timerMonitorStopUV2.Interval = 30 * 1000; + timerMonitorStopUV2.Start(); + })); + } + else + { + //当前时间晚于开始时间,但大于等于结束时间 + if ((nowTime - startTimeUV2).TotalMinutes % totalLengthUV2 <= startLengthUV2 && (nowTime - startTimeUV2).TotalMinutes % totalLengthUV2 > 0) + { + EveryDayLog.WriteDZ("UV2进行周期继电控制,打开时间:" + startTimeUV2 + ",当前时间:" + nowTime + ",当前时间晚于开始时间,但大于等于结束时间"); + + //立即开始工作 + MainForm.otherSettingForm.ControlSend("UV2", 0x01, "Cycle"); + + //开始监测,到时间后结束工作 + this.Invoke(new MethodInvoker(delegate + { + timerMonitorStopUV2.Enabled = true; + timerMonitorStopUV2.Interval = 30 * 1000; + timerMonitorStopUV2.Start(); + + timerMonitorStartUV2.Enabled = true; + timerMonitorStartUV2.Interval = 30 * 1000; + timerMonitorStartUV2.Start(); + })); + } + //当前时间大于结束时间,但小于等于后续的开始时间 + else if ((nowTime - startTimeUV2).TotalMinutes % totalLengthUV2 > startLengthUV2 && (nowTime - startTimeUV2).TotalMinutes % totalLengthUV2 <= totalLengthUV2) + { + EveryDayLog.WriteDZ("UV2进行周期继电控制,打开时间:" + startTimeUV2 + ",当前时间:" + nowTime + ",当前时间大于结束时间,但小于等于后续的开始时间"); + + //开始监测,到时间后开始工作 + this.Invoke(new MethodInvoker(delegate + { + timerMonitorStartUV2.Enabled = true; + timerMonitorStartUV2.Interval = 30 * 1000; + timerMonitorStartUV2.Start(); + + timerMonitorStopUV2.Enabled = true; + timerMonitorStopUV2.Interval = 30 * 1000; + timerMonitorStopUV2.Start(); + })); + } + else + { + //Console.WriteLine("还有这种情况???"); + + EveryDayLog.WriteDZ("UV2进行周期继电控制,打开时间:" + startTimeUV2 + ",当前时间:" + nowTime + ",还有这种情况???"); + } + } + } + else + { + EveryDayLog.WriteDZ("UV2关闭周期继电控制"); + + rdoOpenUV2.Enabled = true; + rdoCloseUV2.Enabled = true; + + this.Invoke(new MethodInvoker(delegate + { + timerMonitorStartUV2.Enabled = false; + timerMonitorStartUV2.Stop(); + timerMonitorStopUV2.Enabled = false; + timerMonitorStopUV2.Stop(); + })); + } + } + + private void timerMonitorStartUV2_Tick(object sender, EventArgs e) + { + Thread trdMonitorStart = new Thread(MonitorStartUV2); + trdMonitorStart.IsBackground = true; + trdMonitorStart.Start(); + } + + private void MonitorStartUV2() + { + try + { + DateTime nowDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, 0); + + if (nowDate < startTimeUV2) + return; + + if ((nowDate - startTimeUV2).TotalMinutes % totalLengthUV2 == 0) + { + Console.WriteLine("UV2将在1min后打开!"); + EveryDayLog.WriteDZ("UV2将在1min后打开!"); + + timerMonitorStartUV2.Enabled = false; + timerMonitorStartUV2.Stop(); + Thread.Sleep(60 * 1000); + timerMonitorStartUV2.Enabled = true; + timerMonitorStartUV2.Start(); + } + else + return; + + MainForm.otherSettingForm.ControlSend("UV2", 0x01, "Cycle"); + } + catch (Exception ex) + { + Console.WriteLine("MonitorStartUV2Error:" + ex.Message); + EveryDayLog.WriteErrorDZ("MonitorStartUV2Error:" + ex.Message); + } + } + + private void timerMonitorStopUV2_Tick(object sender, EventArgs e) + { + Thread trdMonitorStop = new Thread(MonitorStopUV2); + trdMonitorStop.IsBackground = true; + trdMonitorStop.Start(); + } + + private void MonitorStopUV2() + { + try + { + DateTime nowDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, 0); + + if (nowDate < startTimeUV2) + return; + + if ((nowDate - stopTimeUV2).TotalMinutes % totalLengthUV2 == 0) + { + Console.WriteLine("UV2将在1min后关闭!"); + EveryDayLog.WriteDZ("UV2将在1min后关闭!"); + + timerMonitorStopUV2.Enabled = false; + timerMonitorStopUV2.Stop(); + Thread.Sleep(60 * 1000); + timerMonitorStopUV2.Enabled = true; + timerMonitorStopUV2.Start(); + } + else + return; + + MainForm.otherSettingForm.ControlSend("UV2", 0x00, "Cycle"); + } + catch (Exception ex) + { + Console.WriteLine("MonitorStopUV2Error:" + ex.Message); + EveryDayLog.WriteErrorDZ("MonitorStopUV2Error:" + ex.Message); + } + } + #endregion + + + #region UV3周期控制 + private void chkCycleControlUV3_CheckedChanged(object sender, EventArgs e) + { + if (chkCycleControlUV3.Checked) + { + //如果时长为空 + if (txtOpenDurationUV3.Text == "" || txtCloseDurationUV3.Text == "") + { + chkCycleControlUV3.Checked = false; + return; + } + + //禁止修改 + dtpOpenTimeUV3.Enabled = false; + txtOpenDurationUV3.Enabled = false; + txtCloseDurationUV3.Enabled = false; + + //禁止单独控制 + rdoOpenUV3.Enabled = false; + rdoCloseUV3.Enabled = false; + + startLengthUV3 = int.Parse(txtOpenDurationUV3.Text); + stopLengthUV3 = int.Parse(txtCloseDurationUV3.Text); + totalLengthUV3 = startLengthUV3 + stopLengthUV3; + string time = Convert.ToDateTime(dtpOpenTimeUV3.Value).ToString("yyyy-MM-dd HH:mm:ss"); + startTimeUV3 = Convert.ToDateTime(time); + stopTimeUV3 = startTimeUV3.AddMinutes(-stopLengthUV3); + DateTime nowTime = DateTime.Now; + + EveryDayLog.WriteDZ("UV3开启周期继电控制,打开时间:" + startTimeUV3 + ",打开时长:" + startLengthUV3 + ",关闭时长:" + stopLengthUV3); + + //当前时间早于开始时间 + if (startTimeUV3 > nowTime) + { + EveryDayLog.WriteDZ("UV3进行周期继电控制,打开时间:" + startTimeUV3 + ",当前时间:" + nowTime + ",当前时间早于开始时间"); + + //开始监测,到时间后开启工作 + this.Invoke(new MethodInvoker(delegate + { + timerMonitorStartUV3.Enabled = true; + timerMonitorStartUV3.Interval = 30 * 1000; + timerMonitorStartUV3.Start(); + + timerMonitorStopUV3.Enabled = true; + timerMonitorStopUV3.Interval = 30 * 1000; + timerMonitorStopUV3.Start(); + })); + } + else + { + //当前时间晚于开始时间,但大于等于结束时间 + if ((nowTime - startTimeUV3).TotalMinutes % totalLengthUV3 <= startLengthUV3 && (nowTime - startTimeUV3).TotalMinutes % totalLengthUV3 > 0) + { + EveryDayLog.WriteDZ("UV3进行周期继电控制,打开时间:" + startTimeUV3 + ",当前时间:" + nowTime + ",当前时间晚于开始时间,但大于等于结束时间"); + + //立即开始工作 + MainForm.otherSettingForm.ControlSend("UV3", 0x01, "Cycle"); + + //开始监测,到时间后结束工作 + this.Invoke(new MethodInvoker(delegate + { + timerMonitorStopUV3.Enabled = true; + timerMonitorStopUV3.Interval = 30 * 1000; + timerMonitorStopUV3.Start(); + + timerMonitorStartUV3.Enabled = true; + timerMonitorStartUV3.Interval = 30 * 1000; + timerMonitorStartUV3.Start(); + })); + } + //当前时间大于结束时间,但小于等于后续的开始时间 + else if ((nowTime - startTimeUV3).TotalMinutes % totalLengthUV3 > startLengthUV3 && (nowTime - startTimeUV3).TotalMinutes % totalLengthUV3 <= totalLengthUV3) + { + EveryDayLog.WriteDZ("UV3进行周期继电控制,打开时间:" + startTimeUV3 + ",当前时间:" + nowTime + ",当前时间大于结束时间,但小于等于后续的开始时间"); + + //开始监测,到时间后开始工作 + this.Invoke(new MethodInvoker(delegate + { + timerMonitorStartUV3.Enabled = true; + timerMonitorStartUV3.Interval = 30 * 1000; + timerMonitorStartUV3.Start(); + + timerMonitorStopUV3.Enabled = true; + timerMonitorStopUV3.Interval = 30 * 1000; + timerMonitorStopUV3.Start(); + })); + } + else + { + //Console.WriteLine("还有这种情况???"); + + EveryDayLog.WriteDZ("UV3进行周期继电控制,打开时间:" + startTimeUV3 + ",当前时间:" + nowTime + ",还有这种情况???"); + } + } + } + else + { + EveryDayLog.WriteDZ("UV3关闭周期继电控制"); + + rdoOpenUV3.Enabled = true; + rdoCloseUV3.Enabled = true; + + this.Invoke(new MethodInvoker(delegate + { + timerMonitorStartUV3.Enabled = false; + timerMonitorStartUV3.Stop(); + timerMonitorStopUV3.Enabled = false; + timerMonitorStopUV3.Stop(); + })); + } + } + + private void timerMonitorStartUV3_Tick(object sender, EventArgs e) + { + Thread trdMonitorStart = new Thread(MonitorStartUV3); + trdMonitorStart.IsBackground = true; + trdMonitorStart.Start(); + } + + private void MonitorStartUV3() + { + try + { + DateTime nowDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, 0); + + if (nowDate < startTimeUV3) + return; + + if ((nowDate - startTimeUV3).TotalMinutes % totalLengthUV3 == 0) + { + Console.WriteLine("UV3将在1min后打开!"); + EveryDayLog.WriteDZ("UV3将在1min后打开!"); + + timerMonitorStartUV3.Enabled = false; + timerMonitorStartUV3.Stop(); + Thread.Sleep(60 * 1000); + timerMonitorStartUV3.Enabled = true; + timerMonitorStartUV3.Start(); + } + else + return; + + MainForm.otherSettingForm.ControlSend("UV3", 0x01, "Cycle"); + } + catch (Exception ex) + { + Console.WriteLine("MonitorStartUV3Error:" + ex.Message); + EveryDayLog.WriteErrorDZ("MonitorStartUV3Error:" + ex.Message); + } + } + + private void timerMonitorStopUV3_Tick(object sender, EventArgs e) + { + Thread trdMonitorStop = new Thread(MonitorStopUV3); + trdMonitorStop.IsBackground = true; + trdMonitorStop.Start(); + } + + private void MonitorStopUV3() + { + try + { + DateTime nowDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, 0); + + if (nowDate < startTimeUV3) + return; + + if ((nowDate - stopTimeUV3).TotalMinutes % totalLengthUV3 == 0) + { + Console.WriteLine("UV3将在1min后关闭!"); + EveryDayLog.WriteDZ("UV3将在1min后关闭!"); + + timerMonitorStopUV3.Enabled = false; + timerMonitorStopUV3.Stop(); + Thread.Sleep(60 * 1000); + timerMonitorStopUV3.Enabled = true; + timerMonitorStopUV3.Start(); + } + else + return; + + MainForm.otherSettingForm.ControlSend("UV3", 0x00, "Cycle"); + } + catch (Exception ex) + { + Console.WriteLine("MonitorStopUV3Error:" + ex.Message); + EveryDayLog.WriteErrorDZ("MonitorStopUV3Error:" + ex.Message); + } + } + #endregion + + + #region UV4周期控制 + private void chkCycleControlUV4_CheckedChanged(object sender, EventArgs e) + { + if (chkCycleControlUV4.Checked) + { + //如果时长为空 + if (txtOpenDurationUV4.Text == "" || txtCloseDurationUV4.Text == "") + { + chkCycleControlUV4.Checked = false; + return; + } + + //禁止修改 + dtpOpenTimeUV4.Enabled = false; + txtOpenDurationUV4.Enabled = false; + txtCloseDurationUV4.Enabled = false; + + //禁止单独控制 + rdoOpenUV4.Enabled = false; + rdoCloseUV4.Enabled = false; + + startLengthUV4 = int.Parse(txtOpenDurationUV4.Text); + stopLengthUV4 = int.Parse(txtCloseDurationUV4.Text); + totalLengthUV4 = startLengthUV4 + stopLengthUV4; + string time = Convert.ToDateTime(dtpOpenTimeUV4.Value).ToString("yyyy-MM-dd HH:mm:ss"); + startTimeUV4 = Convert.ToDateTime(time); + stopTimeUV4 = startTimeUV4.AddMinutes(-stopLengthUV4); + DateTime nowTime = DateTime.Now; + + EveryDayLog.WriteDZ("UV4开启周期继电控制,打开时间:" + startTimeUV4 + ",打开时长:" + startLengthUV4 + ",关闭时长:" + stopLengthUV4); + + //当前时间早于开始时间 + if (startTimeUV4 > nowTime) + { + EveryDayLog.WriteDZ("UV4进行周期继电控制,打开时间:" + startTimeUV4 + ",当前时间:" + nowTime + ",当前时间早于开始时间"); + + //开始监测,到时间后开启工作 + this.Invoke(new MethodInvoker(delegate + { + timerMonitorStartUV4.Enabled = true; + timerMonitorStartUV4.Interval = 30 * 1000; + timerMonitorStartUV4.Start(); + + timerMonitorStopUV4.Enabled = true; + timerMonitorStopUV4.Interval = 30 * 1000; + timerMonitorStopUV4.Start(); + })); + } + else + { + //当前时间晚于开始时间,但大于等于结束时间 + if ((nowTime - startTimeUV4).TotalMinutes % totalLengthUV4 <= startLengthUV4 && (nowTime - startTimeUV4).TotalMinutes % totalLengthUV4 > 0) + { + EveryDayLog.WriteDZ("UV4进行周期继电控制,打开时间:" + startTimeUV4 + ",当前时间:" + nowTime + ",当前时间晚于开始时间,但大于等于结束时间"); + + //立即开始工作 + MainForm.otherSettingForm.ControlSend("UV4", 0x01, "Cycle"); + + //开始监测,到时间后结束工作 + this.Invoke(new MethodInvoker(delegate + { + timerMonitorStopUV4.Enabled = true; + timerMonitorStopUV4.Interval = 30 * 1000; + timerMonitorStopUV4.Start(); + + timerMonitorStartUV4.Enabled = true; + timerMonitorStartUV4.Interval = 30 * 1000; + timerMonitorStartUV4.Start(); + })); + } + //当前时间大于结束时间,但小于等于后续的开始时间 + else if ((nowTime - startTimeUV4).TotalMinutes % totalLengthUV4 > startLengthUV4 && (nowTime - startTimeUV4).TotalMinutes % totalLengthUV4 <= totalLengthUV4) + { + EveryDayLog.WriteDZ("UV4进行周期继电控制,打开时间:" + startTimeUV4 + ",当前时间:" + nowTime + ",当前时间大于结束时间,但小于等于后续的开始时间"); + + //开始监测,到时间后开始工作 + this.Invoke(new MethodInvoker(delegate + { + timerMonitorStartUV4.Enabled = true; + timerMonitorStartUV4.Interval = 30 * 1000; + timerMonitorStartUV4.Start(); + + timerMonitorStopUV4.Enabled = true; + timerMonitorStopUV4.Interval = 30 * 1000; + timerMonitorStopUV4.Start(); + })); + } + else + { + //Console.WriteLine("还有这种情况???"); + EveryDayLog.WriteDZ("UV4进行周期继电控制,打开时间:" + startTimeUV4 + ",当前时间:" + nowTime + ",还有这种情况???"); + } + } + } + else + { + EveryDayLog.WriteDZ("UV4关闭周期继电控制"); + + rdoOpenUV4.Enabled = true; + rdoCloseUV4.Enabled = true; + + this.Invoke(new MethodInvoker(delegate + { + timerMonitorStartUV4.Enabled = false; + timerMonitorStartUV4.Stop(); + timerMonitorStopUV4.Enabled = false; + timerMonitorStopUV4.Stop(); + })); + } + } + + private void timerMonitorStartUV4_Tick(object sender, EventArgs e) + { + Thread trdMonitorStart = new Thread(MonitorStartUV4); + trdMonitorStart.IsBackground = true; + trdMonitorStart.Start(); + } + + private void MonitorStartUV4() + { + try + { + DateTime nowDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, 0); + + if (nowDate < startTimeUV4) + return; + + if ((nowDate - startTimeUV4).TotalMinutes % totalLengthUV4 == 0) + { + Console.WriteLine("UV4将在1min后打开!"); + EveryDayLog.WriteDZ("UV4将在1min后打开!"); + + timerMonitorStartUV4.Enabled = false; + timerMonitorStartUV4.Stop(); + Thread.Sleep(60 * 1000); + timerMonitorStartUV4.Enabled = true; + timerMonitorStartUV4.Start(); + } + else + return; + + MainForm.otherSettingForm.ControlSend("UV4", 0x01, "Cycle"); + } + catch (Exception ex) + { + Console.WriteLine("MonitorStartUV4Error:" + ex.Message); + EveryDayLog.WriteErrorDZ("MonitorStartUV4Error:" + ex.Message); + } + } + + private void timerMonitorStopUV4_Tick(object sender, EventArgs e) + { + Thread trdMonitorStop = new Thread(MonitorStopUV4); + trdMonitorStop.IsBackground = true; + trdMonitorStop.Start(); + } + + private void MonitorStopUV4() + { + try + { + DateTime nowDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, 0); + + if (nowDate < startTimeUV4) + return; + + if ((nowDate - stopTimeUV4).TotalMinutes % totalLengthUV4 == 0) + { + Console.WriteLine("UV4将在1min后关闭!"); + EveryDayLog.WriteDZ("UV4将在1min后关闭!"); + + timerMonitorStopUV4.Enabled = false; + timerMonitorStopUV4.Stop(); + Thread.Sleep(60 * 1000); + timerMonitorStopUV4.Enabled = true; + timerMonitorStopUV4.Start(); + } + else + return; + + MainForm.otherSettingForm.ControlSend("UV4", 0x00, "Cycle"); + } + catch (Exception ex) + { + Console.WriteLine("MonitorStopUV4Error:" + ex.Message); + EveryDayLog.WriteErrorDZ("MonitorStopUV4Error:" + ex.Message); + } + } + #endregion + + + #region 48周期控制 + private void chkCycleControl48_CheckedChanged(object sender, EventArgs e) + { + if (chkCycleControl48.Checked) + { + //如果时长为空 + if (txtOpenDuration48.Text == "" || txtCloseDuration48.Text == "") + { + chkCycleControl48.Checked = false; + return; + } + + //禁止修改 + dtpOpenTime48.Enabled = false; + txtOpenDuration48.Enabled = false; + txtCloseDuration48.Enabled = false; + + //禁止单独控制 + rdoOpen48.Enabled = false; + rdoClose48.Enabled = false; + + startLength48 = int.Parse(txtOpenDuration48.Text); + stopLength48 = int.Parse(txtCloseDuration48.Text); + totalLength48 = startLength48 + stopLength48; + string time = Convert.ToDateTime(dtpOpenTime48.Value).ToString("yyyy-MM-dd HH:mm:ss"); + startTime48 = Convert.ToDateTime(time); + stopTime48 = startTime48.AddMinutes(-stopLength48); + DateTime nowTime = DateTime.Now; + + EveryDayLog.WriteDZ("48开启周期继电控制,打开时间:" + startTime48 + ",打开时长:" + startLength48 + ",关闭时长:" + stopLength48); + + //当前时间早于开始时间 + if (startTime48 > nowTime) + { + EveryDayLog.WriteDZ("48进行周期继电控制,打开时间:" + startTime48 + ",当前时间:" + nowTime + ",当前时间早于开始时间"); + Console.WriteLine("48当前时间早于开始时间"); + //开始监测,到时间后开启工作 + this.Invoke(new MethodInvoker(delegate + { + timerMonitorStart48.Enabled = true; + timerMonitorStart48.Interval = 30 * 1000; + timerMonitorStart48.Start(); + + timerMonitorStop48.Enabled = true; + timerMonitorStop48.Interval = 30 * 1000; + timerMonitorStop48.Start(); + })); + } + else + { + //当前时间晚于开始时间,但大于等于结束时间 + if ((nowTime - startTime48).TotalMinutes % totalLength48 <= startLength48 && (nowTime - startTime48).TotalMinutes % totalLength48 > 0) + { + EveryDayLog.WriteDZ("48进行周期继电控制,打开时间:" + startTime48 + ",当前时间:" + nowTime + ",当前时间晚于开始时间,但大于等于结束时间"); + Console.WriteLine("48当前时间晚于开始时间,但大于等于结束时间"); + //立即开始工作 + MainForm.otherSettingForm.ControlSend("48", 0x01, "Cycle"); + + //开始监测,到时间后结束工作 + this.Invoke(new MethodInvoker(delegate + { + timerMonitorStop48.Enabled = true; + timerMonitorStop48.Interval = 30 * 1000; + timerMonitorStop48.Start(); + + timerMonitorStart48.Enabled = true; + timerMonitorStart48.Interval = 30 * 1000; + timerMonitorStart48.Start(); + })); + } + //当前时间大于结束时间,但小于等于后续的开始时间 + else if ((nowTime - startTime48).TotalMinutes % totalLength48 > startLength48 && (nowTime - startTime48).TotalMinutes % totalLength48 <= totalLength48) + { + EveryDayLog.WriteDZ("48进行周期继电控制,打开时间:" + startTime48 + ",当前时间:" + nowTime + ",当前时间大于结束时间,但小于等于后续的开始时间"); + Console.WriteLine("48当前时间大于结束时间,但小于等于后续的开始时间"); + //开始监测,到时间后开始工作 + this.Invoke(new MethodInvoker(delegate + { + timerMonitorStart48.Enabled = true; + timerMonitorStart48.Interval = 30 * 1000; + timerMonitorStart48.Start(); + + timerMonitorStop48.Enabled = true; + timerMonitorStop48.Interval = 30 * 1000; + timerMonitorStop48.Start(); + })); + } + else + { + //Console.WriteLine("还有这种情况???"); + + EveryDayLog.WriteDZ("48进行周期继电控制,打开时间:" + startTime48 + ",当前时间:" + nowTime + ",还有这种情况???"); + } + } + } + else + { + EveryDayLog.WriteDZ("48关闭周期继电控制"); + + rdoOpen48.Enabled = true; + rdoClose48.Enabled = true; + + this.Invoke(new MethodInvoker(delegate + { + timerMonitorStart48.Enabled = false; + timerMonitorStart48.Stop(); + timerMonitorStop48.Enabled = false; + timerMonitorStop48.Stop(); + })); + } + } + + private void timerMonitorStart48_Tick(object sender, EventArgs e) + { + Thread trdMonitorStart = new Thread(MonitorStart48); + trdMonitorStart.IsBackground = true; + trdMonitorStart.Start(); + } + + private void MonitorStart48() + { + try + { + DateTime nowDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, 0); + + if (nowDate < startTime48) + return; + + if ((nowDate - startTime48).TotalMinutes % totalLength48 == 0) + { + Console.WriteLine("48将在1min后打开!"); + EveryDayLog.WriteDZ("48将在1min后打开!"); + + timerMonitorStart48.Enabled = false; + timerMonitorStart48.Stop(); + Thread.Sleep(60 * 1000); + timerMonitorStart48.Enabled = true; + timerMonitorStart48.Start(); + } + else + return; + + MainForm.otherSettingForm.ControlSend("48", 0x01, "Cycle"); + } + catch (Exception ex) + { + Console.WriteLine("MonitorStart48Error:" + ex.Message); + EveryDayLog.WriteErrorDZ("MonitorStart48Error:" + ex.Message); + } + } + + private void timerMonitorStop48_Tick(object sender, EventArgs e) + { + Thread trdMonitorStop = new Thread(MonitorStop48); + trdMonitorStop.IsBackground = true; + trdMonitorStop.Start(); + } + + private void MonitorStop48() + { + try + { + DateTime nowDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, 0); + + if (nowDate < startTime48) + return; + + if ((nowDate - stopTime48).TotalMinutes % totalLength48 == 0) + { + Console.WriteLine("48将在1min后关闭!"); + EveryDayLog.WriteDZ("48将在1min后关闭!"); + + timerMonitorStop48.Enabled = false; + timerMonitorStop48.Stop(); + Thread.Sleep(60 * 1000); + timerMonitorStop48.Enabled = true; + timerMonitorStop48.Start(); + } + else + return; + + MainForm.otherSettingForm.ControlSend("48", 0x00, "Cycle"); + } + catch (Exception ex) + { + Console.WriteLine("MonitorStop48Error:" + ex.Message); + EveryDayLog.WriteErrorDZ("MonitorStop48Error:" + ex.Message); + } + } + #endregion + + + #region 24周期控制 + private void chkCycleControl24_CheckedChanged(object sender, EventArgs e) + { + if (chkCycleControl24.Checked) + { + //如果时长为空 + if (txtOpenDuration24.Text == "" || txtCloseDuration24.Text == "") + { + chkCycleControl24.Checked = false; + return; + } + + //禁止修改 + dtpOpenTime24.Enabled = false; + txtOpenDuration24.Enabled = false; + txtCloseDuration24.Enabled = false; + + //禁止单独控制 + rdoOpen24.Enabled = false; + rdoClose24.Enabled = false; + + startLength24 = int.Parse(txtOpenDuration24.Text); + stopLength24 = int.Parse(txtCloseDuration24.Text); + totalLength24 = startLength24 + stopLength24; + string time = Convert.ToDateTime(dtpOpenTime24.Value).ToString("yyyy-MM-dd HH:mm:ss"); + startTime24 = Convert.ToDateTime(time); + stopTime24 = startTime24.AddMinutes(-stopLength24); + DateTime nowTime = DateTime.Now; + + EveryDayLog.WriteDZ("24开启周期继电控制,打开时间:" + startTime24 + ",打开时长:" + startLength24 + ",关闭时长:" + stopLength24); + + //当前时间早于开始时间 + if (startTime24 > nowTime) + { + EveryDayLog.WriteDZ("24进行周期继电控制,打开时间:" + startTime24 + ",当前时间:" + nowTime + ",当前时间早于开始时间"); + + //开始监测,到时间后开启工作 + this.Invoke(new MethodInvoker(delegate + { + timerMonitorStart24.Enabled = true; + timerMonitorStart24.Interval = 30 * 1000; + timerMonitorStart24.Start(); + + timerMonitorStop24.Enabled = true; + timerMonitorStop24.Interval = 30 * 1000; + timerMonitorStop24.Start(); + })); + } + else + { + //当前时间晚于开始时间,但大于等于结束时间 + if ((nowTime - startTime24).TotalMinutes % totalLength24 <= startLength24 && (nowTime - startTime24).TotalMinutes % totalLength24 > 0) + { + EveryDayLog.WriteDZ("24进行周期继电控制,打开时间:" + startTime24 + ",当前时间:" + nowTime + ",当前时间晚于开始时间,但大于等于结束时间"); + + //立即开始工作 + MainForm.otherSettingForm.ControlSend("24", 0x01, "Cycle"); + + //开始监测,到时间后结束工作 + this.Invoke(new MethodInvoker(delegate + { + timerMonitorStop24.Enabled = true; + timerMonitorStop24.Interval = 30 * 1000; + timerMonitorStop24.Start(); + + timerMonitorStart24.Enabled = true; + timerMonitorStart24.Interval = 30 * 1000; + timerMonitorStart24.Start(); + })); + } + //当前时间大于结束时间,但小于等于后续的开始时间 + else if ((nowTime - startTime24).TotalMinutes % totalLength24 > startLength24 && (nowTime - startTime24).TotalMinutes % totalLength24 <= totalLength24) + { + EveryDayLog.WriteDZ("24进行周期继电控制,打开时间:" + startTime24 + ",当前时间:" + nowTime + ",当前时间大于结束时间,但小于等于后续的开始时间"); + + //开始监测,到时间后开始工作 + this.Invoke(new MethodInvoker(delegate + { + timerMonitorStart24.Enabled = true; + timerMonitorStart24.Interval = 30 * 1000; + timerMonitorStart24.Start(); + + timerMonitorStop24.Enabled = true; + timerMonitorStop24.Interval = 30 * 1000; + timerMonitorStop24.Start(); + })); + } + else + { + //Console.WriteLine("还有这种情况???"); + + EveryDayLog.WriteDZ("24进行周期继电控制,打开时间:" + startTime24 + ",当前时间:" + nowTime + ",还有这种情况???"); + } + } + } + else + { + EveryDayLog.WriteDZ("24关闭周期继电控制"); + + rdoOpen24.Enabled = true; + rdoClose24.Enabled = true; + + this.Invoke(new MethodInvoker(delegate + { + timerMonitorStart24.Enabled = false; + timerMonitorStart24.Stop(); + timerMonitorStop24.Enabled = false; + timerMonitorStop24.Stop(); + })); + } + } + + private void timerMonitorStart24_Tick(object sender, EventArgs e) + { + Thread trdMonitorStart = new Thread(MonitorStart24); + trdMonitorStart.IsBackground = true; + trdMonitorStart.Start(); + } + + private void MonitorStart24() + { + try + { + DateTime nowDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, 0); + + if (nowDate < startTime24) + return; + + if ((nowDate - startTime24).TotalMinutes % totalLength24 == 0) + { + Console.WriteLine("24将在1min后打开!"); + EveryDayLog.WriteDZ("24将在1min后打开!"); + + timerMonitorStart24.Enabled = false; + timerMonitorStart24.Stop(); + Thread.Sleep(60 * 1000); + timerMonitorStart24.Enabled = true; + timerMonitorStart24.Start(); + } + else + return; + + MainForm.otherSettingForm.ControlSend("24", 0x01, "Cycle"); + } + catch (Exception ex) + { + Console.WriteLine("MonitorStart24Error:" + ex.Message); + EveryDayLog.WriteErrorDZ("MonitorStart24Error:" + ex.Message); + } + } + + private void timerMonitorStop24_Tick(object sender, EventArgs e) + { + Thread trdMonitorStop = new Thread(MonitorStop24); + trdMonitorStop.IsBackground = true; + trdMonitorStop.Start(); + } + + private void MonitorStop24() + { + try + { + DateTime nowDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, 0); + + if (nowDate < startTime24) + return; + + if ((nowDate - stopTime24).TotalMinutes % totalLength24 == 0) + { + Console.WriteLine("24将在1min后关闭!"); + EveryDayLog.WriteDZ("24将在1min后关闭!"); + + timerMonitorStop24.Enabled = false; + timerMonitorStop24.Stop(); + Thread.Sleep(60 * 1000); + timerMonitorStop24.Enabled = true; + timerMonitorStop24.Start(); + } + else + return; + + MainForm.otherSettingForm.ControlSend("24", 0x00, "Cycle"); + } + catch (Exception ex) + { + Console.WriteLine("MonitorStop24Error:" + ex.Message); + EveryDayLog.WriteErrorDZ("MonitorStop24Error:" + ex.Message); + } + } + #endregion + + + #region 12周期控制 + private void chkCycleControl12_CheckedChanged(object sender, EventArgs e) + { + if (chkCycleControl12.Checked) + { + //如果时长为空 + if (txtOpenDuration12.Text == "" || txtCloseDuration12.Text == "") + { + chkCycleControl12.Checked = false; + return; + } + + //禁止修改 + dtpOpenTime12.Enabled = false; + txtOpenDuration12.Enabled = false; + txtCloseDuration12.Enabled = false; + + //禁止单独控制 + rdoOpen12.Enabled = false; + rdoClose12.Enabled = false; + + startLength12 = int.Parse(txtOpenDuration12.Text); + stopLength12 = int.Parse(txtCloseDuration12.Text); + totalLength12 = startLength12 + stopLength12; + string time = Convert.ToDateTime(dtpOpenTime12.Value).ToString("yyyy-MM-dd HH:mm:ss"); + startTime12 = Convert.ToDateTime(time); + stopTime12 = startTime12.AddMinutes(-stopLength12); + DateTime nowTime = DateTime.Now; + + EveryDayLog.WriteDZ("12开启周期继电控制,打开时间:" + startTime12 + ",打开时长:" + startLength12 + ",关闭时长:" + stopLength12); + + //当前时间早于开始时间 + if (startTime12 > nowTime) + { + EveryDayLog.WriteDZ("12进行周期继电控制,打开时间:" + startTime12 + ",当前时间:" + nowTime + ",当前时间早于开始时间"); + + //开始监测,到时间后开启工作 + this.Invoke(new MethodInvoker(delegate + { + timerMonitorStart12.Enabled = true; + timerMonitorStart12.Interval = 30 * 1000; + timerMonitorStart12.Start(); + + timerMonitorStop12.Enabled = true; + timerMonitorStop12.Interval = 30 * 1000; + timerMonitorStop12.Start(); + })); + } + else + { + //当前时间晚于开始时间,但大于等于结束时间 + if ((nowTime - startTime12).TotalMinutes % totalLength12 <= startLength12 && (nowTime - startTime12).TotalMinutes % totalLength12 > 0) + { + EveryDayLog.WriteDZ("12进行周期继电控制,打开时间:" + startTime12 + ",当前时间:" + nowTime + ",当前时间晚于开始时间,但大于等于结束时间"); + + //立即开始工作 + MainForm.otherSettingForm.ControlSend("12", 0x01, "Cycle"); + + //开始监测,到时间后结束工作 + this.Invoke(new MethodInvoker(delegate + { + timerMonitorStop12.Enabled = true; + timerMonitorStop12.Interval = 30 * 1000; + timerMonitorStop12.Start(); + + timerMonitorStart12.Enabled = true; + timerMonitorStart12.Interval = 30 * 1000; + timerMonitorStart12.Start(); + })); + } + //当前时间大于结束时间,但小于等于后续的开始时间 + else if ((nowTime - startTime12).TotalMinutes % totalLength12 > startLength12 && (nowTime - startTime12).TotalMinutes % totalLength12 <= totalLength12) + { + EveryDayLog.WriteDZ("12进行周期继电控制,打开时间:" + startTime12 + ",当前时间:" + nowTime + ",当前时间大于结束时间,但小于等于后续的开始时间"); + + //开始监测,到时间后开始工作 + this.Invoke(new MethodInvoker(delegate + { + timerMonitorStart12.Enabled = true; + timerMonitorStart12.Interval = 30 * 1000; + timerMonitorStart12.Start(); + + timerMonitorStop12.Enabled = true; + timerMonitorStop12.Interval = 30 * 1000; + timerMonitorStop12.Start(); + })); + } + else + { + //Console.WriteLine("还有这种情况???"); + + EveryDayLog.WriteDZ("12进行周期继电控制,打开时间:" + startTime12 + ",当前时间:" + nowTime + ",还有这种情况???"); + } + } + } + else + { + EveryDayLog.WriteDZ("12关闭周期继电控制"); + + rdoOpen12.Enabled = true; + rdoClose12.Enabled = true; + + this.Invoke(new MethodInvoker(delegate + { + timerMonitorStart12.Enabled = false; + timerMonitorStart12.Stop(); + timerMonitorStop12.Enabled = false; + timerMonitorStop12.Stop(); + })); + } + } + + private void timerMonitorStart12_Tick(object sender, EventArgs e) + { + Thread trdMonitorStart = new Thread(MonitorStart12); + trdMonitorStart.IsBackground = true; + trdMonitorStart.Start(); + } + + private void MonitorStart12() + { + try + { + DateTime nowDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, 0); + + if (nowDate < startTime12) + return; + + if ((nowDate - startTime12).TotalMinutes % totalLength12 == 0) + { + Console.WriteLine("12将在1min后打开!"); + EveryDayLog.WriteDZ("12将在1min后打开!"); + + timerMonitorStart12.Enabled = false; + timerMonitorStart12.Stop(); + Thread.Sleep(60 * 1000); + timerMonitorStart12.Enabled = true; + timerMonitorStart12.Start(); + } + else + return; + + MainForm.otherSettingForm.ControlSend("12", 0x01, "Cycle"); + } + catch (Exception ex) + { + Console.WriteLine("MonitorStart12Error:" + ex.Message); + EveryDayLog.WriteErrorDZ("MonitorStart12Error:" + ex.Message); + } + } + + private void timerMonitorStop12_Tick(object sender, EventArgs e) + { + Thread trdMonitorStop = new Thread(MonitorStop12); + trdMonitorStop.IsBackground = true; + trdMonitorStop.Start(); + } + + private void MonitorStop12() + { + try + { + DateTime nowDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, 0); + + if (nowDate < startTime12) + return; + + if ((nowDate - stopTime12).TotalMinutes % totalLength12 == 0) + { + Console.WriteLine("12将在1min后关闭!"); + EveryDayLog.WriteDZ("12将在1min后关闭!"); + + timerMonitorStop12.Enabled = false; + timerMonitorStop12.Stop(); + Thread.Sleep(60 * 1000); + timerMonitorStop12.Enabled = true; + timerMonitorStop12.Start(); + } + else + return; + + MainForm.otherSettingForm.ControlSend("12", 0x00, "Cycle"); + } + catch (Exception ex) + { + Console.WriteLine("MonitorStop12Error:" + ex.Message); + EveryDayLog.WriteErrorDZ("MonitorStop12Error:" + ex.Message); + } + } + #endregion + + + private void btnSetState_Click(object sender, EventArgs e) + { + MainForm.otherSettingForm.ControlSend("", 0x00, "Click"); + } + + public void RelayControlForm_FormClosing(object sender, FormClosingEventArgs e) + { + timerMonitorStart12.Enabled = false; + timerMonitorStart12.Stop(); + timerMonitorStop12.Enabled = true; + timerMonitorStop12.Stop(); + timerMonitorStart24.Enabled = false; + timerMonitorStart24.Stop(); + timerMonitorStop24.Enabled = true; + timerMonitorStop24.Stop(); + timerMonitorStart48.Enabled = false; + timerMonitorStart48.Stop(); + timerMonitorStop48.Enabled = true; + timerMonitorStop48.Stop(); + timerMonitorStartUV1.Enabled = false; + timerMonitorStartUV1.Stop(); + timerMonitorStopUV1.Enabled = true; + timerMonitorStopUV1.Stop(); + timerMonitorStartUV2.Enabled = false; + timerMonitorStartUV2.Stop(); + timerMonitorStopUV2.Enabled = true; + timerMonitorStopUV2.Stop(); + timerMonitorStartUV3.Enabled = false; + timerMonitorStartUV3.Stop(); + timerMonitorStopUV3.Enabled = true; + timerMonitorStopUV3.Stop(); + timerMonitorStartUV4.Enabled = false; + timerMonitorStartUV4.Stop(); + timerMonitorStopUV4.Enabled = true; + timerMonitorStopUV4.Stop(); + } + + + } +} diff --git a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/RelayControlForm.resx b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/RelayControlForm.resx new file mode 100644 index 0000000..698d929 --- /dev/null +++ b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/RelayControlForm.resx @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 1161, 18 + + + 1344, 18 + + + 9, 13 + + + 200, 13 + + + 390, 13 + + + 574, 13 + + + 758, 13 + + + 951, 13 + + + 1527, 18 + + + 17, 56 + + + 200, 56 + + + 391, 56 + + + 581, 56 + + + 765, 56 + + \ No newline at end of file diff --git a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/ZTTMS_Manage_yibayiyi_20230320.csproj b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/ZTTMS_Manage_yibayiyi_20230320.csproj index 9535002..48b06a8 100644 --- a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/ZTTMS_Manage_yibayiyi_20230320.csproj +++ b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/ZTTMS_Manage_yibayiyi_20230320.csproj @@ -354,6 +354,12 @@ RealTimeDataForm.cs + + Form + + + RelayControlForm.cs + Form @@ -461,6 +467,9 @@ RealTimeDataForm.cs + + RelayControlForm.cs + RemoteUpgradeForm.cs diff --git a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/bin/Debug/Interop.WMPLib.dll b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/bin/Debug/Interop.WMPLib.dll index ea8be5b..2e65965 100644 Binary files a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/bin/Debug/Interop.WMPLib.dll and b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/bin/Debug/Interop.WMPLib.dll differ diff --git a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/bin/Debug/ZTTMS_Manage_yibayiyi_20230320.exe b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/bin/Debug/ZTTMS_Manage_yibayiyi_20230320.exe index 9fde562..52b1b54 100644 Binary files a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/bin/Debug/ZTTMS_Manage_yibayiyi_20230320.exe and b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/bin/Debug/ZTTMS_Manage_yibayiyi_20230320.exe differ diff --git a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/bin/Debug/ZTTMS_Manage_yibayiyi_20230320.pdb b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/bin/Debug/ZTTMS_Manage_yibayiyi_20230320.pdb index 1e3c644..4d62d38 100644 Binary files a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/bin/Debug/ZTTMS_Manage_yibayiyi_20230320.pdb and b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/bin/Debug/ZTTMS_Manage_yibayiyi_20230320.pdb differ diff --git a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache index f639588..5972b5d 100644 Binary files a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache and b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/obj/Debug/Interop.WMPLib.dll b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/obj/Debug/Interop.WMPLib.dll index ea8be5b..2e65965 100644 Binary files a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/obj/Debug/Interop.WMPLib.dll and b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/obj/Debug/Interop.WMPLib.dll differ diff --git a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/obj/Debug/ZTTMS_Manage_yibayiyi_20230320.MainForm.resources b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/obj/Debug/ZTTMS_Manage_yibayiyi_20230320.MainForm.resources index ef1b907..1a83d23 100644 Binary files a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/obj/Debug/ZTTMS_Manage_yibayiyi_20230320.MainForm.resources and b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/obj/Debug/ZTTMS_Manage_yibayiyi_20230320.MainForm.resources differ diff --git a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/obj/Debug/ZTTMS_Manage_yibayiyi_20230320.RelayControlForm.resources b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/obj/Debug/ZTTMS_Manage_yibayiyi_20230320.RelayControlForm.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/obj/Debug/ZTTMS_Manage_yibayiyi_20230320.RelayControlForm.resources differ diff --git a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/obj/Debug/ZTTMS_Manage_yibayiyi_20230320.csproj.AssemblyReference.cache b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/obj/Debug/ZTTMS_Manage_yibayiyi_20230320.csproj.AssemblyReference.cache index 9478cd8..b934363 100644 Binary files a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/obj/Debug/ZTTMS_Manage_yibayiyi_20230320.csproj.AssemblyReference.cache and b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/obj/Debug/ZTTMS_Manage_yibayiyi_20230320.csproj.AssemblyReference.cache differ diff --git a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/obj/Debug/ZTTMS_Manage_yibayiyi_20230320.csproj.CoreCompileInputs.cache b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/obj/Debug/ZTTMS_Manage_yibayiyi_20230320.csproj.CoreCompileInputs.cache index c01190d..8193259 100644 --- a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/obj/Debug/ZTTMS_Manage_yibayiyi_20230320.csproj.CoreCompileInputs.cache +++ b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/obj/Debug/ZTTMS_Manage_yibayiyi_20230320.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -a25a7692b9cf4cf0b6deb5324d858e8ee51f5d0d +acada633bcd60c7c3790bf328a93d4fe71f22298 diff --git a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/obj/Debug/ZTTMS_Manage_yibayiyi_20230320.csproj.FileListAbsolute.txt b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/obj/Debug/ZTTMS_Manage_yibayiyi_20230320.csproj.FileListAbsolute.txt index f34f567..8fe6ac8 100644 --- a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/obj/Debug/ZTTMS_Manage_yibayiyi_20230320.csproj.FileListAbsolute.txt +++ b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/obj/Debug/ZTTMS_Manage_yibayiyi_20230320.csproj.FileListAbsolute.txt @@ -2620,3 +2620,4 @@ F:\Code\yibayiyi\20230201_1811_upperpc\ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_ F:\Code\yibayiyi\20230201_1811_upperpc\ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1\ZTTMS_Manage_yibayiyi_20230320\obj\Debug\ZTTMS_Manage_yibayiyi_20230320.pdb F:\Code\yibayiyi\20230201_1811_upperpc\ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1\ZTTMS_Manage_yibayiyi_20230320\bin\Debug\MQTTnet.dll F:\Code\yibayiyi\20230201_1811_upperpc\ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1\ZTTMS_Manage_yibayiyi_20230320\bin\Debug\MQTTnet.xml +F:\Code\yibayiyi\20230201_1811_upperpc\ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1\ZTTMS_Manage_yibayiyi_20230320\obj\Debug\ZTTMS_Manage_yibayiyi_20230320.RelayControlForm.resources diff --git a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/obj/Debug/ZTTMS_Manage_yibayiyi_20230320.csproj.GenerateResource.cache b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/obj/Debug/ZTTMS_Manage_yibayiyi_20230320.csproj.GenerateResource.cache index 1f64e89..9e3ded0 100644 Binary files a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/obj/Debug/ZTTMS_Manage_yibayiyi_20230320.csproj.GenerateResource.cache and b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/obj/Debug/ZTTMS_Manage_yibayiyi_20230320.csproj.GenerateResource.cache differ diff --git a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/obj/Debug/ZTTMS_Manage_yibayiyi_20230320.exe b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/obj/Debug/ZTTMS_Manage_yibayiyi_20230320.exe index 9fde562..52b1b54 100644 Binary files a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/obj/Debug/ZTTMS_Manage_yibayiyi_20230320.exe and b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/obj/Debug/ZTTMS_Manage_yibayiyi_20230320.exe differ diff --git a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/obj/Debug/ZTTMS_Manage_yibayiyi_20230320.pdb b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/obj/Debug/ZTTMS_Manage_yibayiyi_20230320.pdb index 1e3c644..4d62d38 100644 Binary files a/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/obj/Debug/ZTTMS_Manage_yibayiyi_20230320.pdb and b/ZTTMS_Manage_yibayiyi_KeepaliveTest3_GKJ_V1.1/ZTTMS_Manage_yibayiyi_20230320/obj/Debug/ZTTMS_Manage_yibayiyi_20230320.pdb differ