diff --git a/ControlMonitorClient/FrmControlMonitor.cs b/ControlMonitorClient/FrmControlMonitor.cs index 441b5f2..58e3ec9 100644 --- a/ControlMonitorClient/FrmControlMonitor.cs +++ b/ControlMonitorClient/FrmControlMonitor.cs @@ -1015,5 +1015,10 @@ namespace wcfControlMonitorClient { } + + private void button61_Click(object sender, EventArgs e) + { + + } } } \ No newline at end of file diff --git a/ControlMonitorClient/FrmControlMonitor.designer.cs b/ControlMonitorClient/FrmControlMonitor.designer.cs index f8445fb..0449b0f 100644 --- a/ControlMonitorClient/FrmControlMonitor.designer.cs +++ b/ControlMonitorClient/FrmControlMonitor.designer.cs @@ -96,6 +96,15 @@ this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabPage1 = new System.Windows.Forms.TabPage(); this.plAccessorial1 = new System.Windows.Forms.Panel(); + this.label105 = new System.Windows.Forms.Label(); + this.label104 = new System.Windows.Forms.Label(); + this.label114 = new System.Windows.Forms.Label(); + this.textBox112 = new System.Windows.Forms.TextBox(); + this.textBox78 = new System.Windows.Forms.TextBox(); + this.textBox77 = new System.Windows.Forms.TextBox(); + this.pictureBox3 = new System.Windows.Forms.PictureBox(); + this.pictureBox2 = new System.Windows.Forms.PictureBox(); + this.pictureBox26 = new System.Windows.Forms.PictureBox(); this.textBox98 = new System.Windows.Forms.TextBox(); this.textBox97 = new System.Windows.Forms.TextBox(); this.textBox96 = new System.Windows.Forms.TextBox(); @@ -418,15 +427,8 @@ this.label91 = new System.Windows.Forms.Label(); this.label43 = new System.Windows.Forms.Label(); this.label44 = new System.Windows.Forms.Label(); - this.label114 = new System.Windows.Forms.Label(); - this.textBox77 = new System.Windows.Forms.TextBox(); - this.pictureBox26 = new System.Windows.Forms.PictureBox(); - this.pictureBox2 = new System.Windows.Forms.PictureBox(); - this.textBox78 = new System.Windows.Forms.TextBox(); - this.label104 = new System.Windows.Forms.Label(); - this.pictureBox3 = new System.Windows.Forms.PictureBox(); - this.textBox112 = new System.Windows.Forms.TextBox(); - this.label105 = new System.Windows.Forms.Label(); + this.button60 = new System.Windows.Forms.Button(); + this.button61 = new System.Windows.Forms.Button(); pictureBox14 = new System.Windows.Forms.PictureBox(); pictureBox13 = new System.Windows.Forms.PictureBox(); pictureBox12 = new System.Windows.Forms.PictureBox(); @@ -440,6 +442,9 @@ this.tabControl1.SuspendLayout(); this.tabPage1.SuspendLayout(); this.plAccessorial1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox26)).BeginInit(); this.panel10.SuspendLayout(); this.panel15.SuspendLayout(); this.panel5.SuspendLayout(); @@ -463,9 +468,6 @@ ((System.ComponentModel.ISupportInitialize)(this.pB14001)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pB14002)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox26)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit(); this.SuspendLayout(); // // pictureBox14 @@ -1454,6 +1456,8 @@ this.plAccessorial1.Controls.Add(this.label5); this.plAccessorial1.Controls.Add(this.button42); this.plAccessorial1.Controls.Add(this.label41); + this.plAccessorial1.Controls.Add(this.button61); + this.plAccessorial1.Controls.Add(this.button60); this.plAccessorial1.Controls.Add(this.button57); this.plAccessorial1.Controls.Add(this.button36); this.plAccessorial1.Controls.Add(this.label31); @@ -1477,6 +1481,120 @@ this.plAccessorial1.Size = new System.Drawing.Size(1910, 1022); this.plAccessorial1.TabIndex = 5825; // + // label105 + // + this.label105.AutoSize = true; + this.label105.BackColor = System.Drawing.Color.Transparent; + this.label105.Enabled = false; + this.label105.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label105.Location = new System.Drawing.Point(45, 620); + this.label105.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label105.Name = "label105"; + this.label105.Size = new System.Drawing.Size(107, 15); + this.label105.TabIndex = 8357; + this.label105.Text = "11001联机停车"; + // + // label104 + // + this.label104.AutoSize = true; + this.label104.BackColor = System.Drawing.Color.Transparent; + this.label104.Enabled = false; + this.label104.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label104.Location = new System.Drawing.Point(28, 271); + this.label104.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label104.Name = "label104"; + this.label104.Size = new System.Drawing.Size(107, 15); + this.label104.TabIndex = 8357; + this.label104.Text = "11002联机停车"; + // + // label114 + // + this.label114.AutoSize = true; + this.label114.BackColor = System.Drawing.Color.Transparent; + this.label114.Enabled = false; + this.label114.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label114.Location = new System.Drawing.Point(29, 58); + this.label114.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label114.Name = "label114"; + this.label114.Size = new System.Drawing.Size(107, 15); + this.label114.TabIndex = 8357; + this.label114.Text = "11003联机停车"; + // + // textBox112 + // + this.textBox112.BackColor = System.Drawing.Color.White; + this.textBox112.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.textBox112.Location = new System.Drawing.Point(64, 709); + this.textBox112.Margin = new System.Windows.Forms.Padding(4); + this.textBox112.Multiline = true; + this.textBox112.Name = "textBox112"; + this.textBox112.Size = new System.Drawing.Size(52, 15); + this.textBox112.TabIndex = 8356; + this.textBox112.Tag = "11005.6"; + this.textBox112.Text = "已急停"; + // + // textBox78 + // + this.textBox78.BackColor = System.Drawing.Color.White; + this.textBox78.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.textBox78.Location = new System.Drawing.Point(47, 360); + this.textBox78.Margin = new System.Windows.Forms.Padding(4); + this.textBox78.Multiline = true; + this.textBox78.Name = "textBox78"; + this.textBox78.Size = new System.Drawing.Size(52, 15); + this.textBox78.TabIndex = 8356; + this.textBox78.Tag = "11005.6"; + this.textBox78.Text = "已急停"; + // + // textBox77 + // + this.textBox77.BackColor = System.Drawing.Color.White; + this.textBox77.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.textBox77.Location = new System.Drawing.Point(48, 147); + this.textBox77.Margin = new System.Windows.Forms.Padding(4); + this.textBox77.Multiline = true; + this.textBox77.Name = "textBox77"; + this.textBox77.Size = new System.Drawing.Size(52, 15); + this.textBox77.TabIndex = 8356; + this.textBox77.Tag = "11005.6"; + this.textBox77.Text = "已急停"; + // + // pictureBox3 + // + this.pictureBox3.Image = global::wcfControlMonitorClient.Properties.Resources.stop_0; + this.pictureBox3.Location = new System.Drawing.Point(64, 655); + this.pictureBox3.Margin = new System.Windows.Forms.Padding(4); + this.pictureBox3.Name = "pictureBox3"; + this.pictureBox3.Size = new System.Drawing.Size(53, 47); + this.pictureBox3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox3.TabIndex = 8355; + this.pictureBox3.TabStop = false; + this.pictureBox3.Tag = "11001"; + // + // pictureBox2 + // + this.pictureBox2.Image = global::wcfControlMonitorClient.Properties.Resources.stop_0; + this.pictureBox2.Location = new System.Drawing.Point(47, 306); + this.pictureBox2.Margin = new System.Windows.Forms.Padding(4); + this.pictureBox2.Name = "pictureBox2"; + this.pictureBox2.Size = new System.Drawing.Size(53, 47); + this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox2.TabIndex = 8355; + this.pictureBox2.TabStop = false; + this.pictureBox2.Tag = "11002"; + // + // pictureBox26 + // + this.pictureBox26.Image = global::wcfControlMonitorClient.Properties.Resources.stop_0; + this.pictureBox26.Location = new System.Drawing.Point(48, 93); + this.pictureBox26.Margin = new System.Windows.Forms.Padding(4); + this.pictureBox26.Name = "pictureBox26"; + this.pictureBox26.Size = new System.Drawing.Size(53, 47); + this.pictureBox26.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox26.TabIndex = 8355; + this.pictureBox26.TabStop = false; + this.pictureBox26.Tag = "11003"; + // // textBox98 // this.textBox98.BackColor = System.Drawing.Color.Blue; @@ -5438,119 +5556,32 @@ this.label44.TabIndex = 3219; this.label44.Tag = "17001"; // - // label114 - // - this.label114.AutoSize = true; - this.label114.BackColor = System.Drawing.Color.Transparent; - this.label114.Enabled = false; - this.label114.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label114.Location = new System.Drawing.Point(29, 58); - this.label114.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label114.Name = "label114"; - this.label114.Size = new System.Drawing.Size(107, 15); - this.label114.TabIndex = 8357; - this.label114.Text = "11003联机停车"; - // - // textBox77 - // - this.textBox77.BackColor = System.Drawing.Color.White; - this.textBox77.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.textBox77.Location = new System.Drawing.Point(48, 147); - this.textBox77.Margin = new System.Windows.Forms.Padding(4); - this.textBox77.Multiline = true; - this.textBox77.Name = "textBox77"; - this.textBox77.Size = new System.Drawing.Size(52, 15); - this.textBox77.TabIndex = 8356; - this.textBox77.Tag = "11005.6"; - this.textBox77.Text = "已急停"; - // - // pictureBox26 - // - this.pictureBox26.Image = global::wcfControlMonitorClient.Properties.Resources.stop_0; - this.pictureBox26.Location = new System.Drawing.Point(48, 93); - this.pictureBox26.Margin = new System.Windows.Forms.Padding(4); - this.pictureBox26.Name = "pictureBox26"; - this.pictureBox26.Size = new System.Drawing.Size(53, 47); - this.pictureBox26.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; - this.pictureBox26.TabIndex = 8355; - this.pictureBox26.TabStop = false; - this.pictureBox26.Tag = "11003"; - // - // pictureBox2 - // - this.pictureBox2.Image = global::wcfControlMonitorClient.Properties.Resources.stop_0; - this.pictureBox2.Location = new System.Drawing.Point(47, 306); - this.pictureBox2.Margin = new System.Windows.Forms.Padding(4); - this.pictureBox2.Name = "pictureBox2"; - this.pictureBox2.Size = new System.Drawing.Size(53, 47); - this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; - this.pictureBox2.TabIndex = 8355; - this.pictureBox2.TabStop = false; - this.pictureBox2.Tag = "11002"; - // - // textBox78 - // - this.textBox78.BackColor = System.Drawing.Color.White; - this.textBox78.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.textBox78.Location = new System.Drawing.Point(47, 360); - this.textBox78.Margin = new System.Windows.Forms.Padding(4); - this.textBox78.Multiline = true; - this.textBox78.Name = "textBox78"; - this.textBox78.Size = new System.Drawing.Size(52, 15); - this.textBox78.TabIndex = 8356; - this.textBox78.Tag = "11005.6"; - this.textBox78.Text = "已急停"; - // - // label104 - // - this.label104.AutoSize = true; - this.label104.BackColor = System.Drawing.Color.Transparent; - this.label104.Enabled = false; - this.label104.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label104.Location = new System.Drawing.Point(28, 271); - this.label104.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label104.Name = "label104"; - this.label104.Size = new System.Drawing.Size(107, 15); - this.label104.TabIndex = 8357; - this.label104.Text = "11002联机停车"; - // - // pictureBox3 - // - this.pictureBox3.Image = global::wcfControlMonitorClient.Properties.Resources.stop_0; - this.pictureBox3.Location = new System.Drawing.Point(64, 655); - this.pictureBox3.Margin = new System.Windows.Forms.Padding(4); - this.pictureBox3.Name = "pictureBox3"; - this.pictureBox3.Size = new System.Drawing.Size(53, 47); - this.pictureBox3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; - this.pictureBox3.TabIndex = 8355; - this.pictureBox3.TabStop = false; - this.pictureBox3.Tag = "11001"; - // - // textBox112 - // - this.textBox112.BackColor = System.Drawing.Color.White; - this.textBox112.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.textBox112.Location = new System.Drawing.Point(64, 709); - this.textBox112.Margin = new System.Windows.Forms.Padding(4); - this.textBox112.Multiline = true; - this.textBox112.Name = "textBox112"; - this.textBox112.Size = new System.Drawing.Size(52, 15); - this.textBox112.TabIndex = 8356; - this.textBox112.Tag = "11005.6"; - this.textBox112.Text = "已急停"; - // - // label105 - // - this.label105.AutoSize = true; - this.label105.BackColor = System.Drawing.Color.Transparent; - this.label105.Enabled = false; - this.label105.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label105.Location = new System.Drawing.Point(45, 620); - this.label105.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label105.Name = "label105"; - this.label105.Size = new System.Drawing.Size(107, 15); - this.label105.TabIndex = 8357; - this.label105.Text = "11001联机停车"; + // button60 + // + this.button60.BackColor = System.Drawing.SystemColors.GradientInactiveCaption; + this.button60.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.button60.Location = new System.Drawing.Point(360, 429); + this.button60.Margin = new System.Windows.Forms.Padding(4); + this.button60.Name = "button60"; + this.button60.Size = new System.Drawing.Size(31, 158); + this.button60.TabIndex = 5913; + this.button60.Tag = "18102"; + this.button60.Text = "快速卷帘门2"; + this.button60.UseVisualStyleBackColor = false; + // + // button61 + // + this.button61.BackColor = System.Drawing.SystemColors.GradientInactiveCaption; + this.button61.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.button61.Location = new System.Drawing.Point(1395, 427); + this.button61.Margin = new System.Windows.Forms.Padding(4); + this.button61.Name = "button61"; + this.button61.Size = new System.Drawing.Size(38, 145); + this.button61.TabIndex = 5913; + this.button61.Tag = "18101"; + this.button61.Text = "快速卷帘门 1"; + this.button61.UseVisualStyleBackColor = false; + this.button61.Click += new System.EventHandler(this.button61_Click); // // FrmControlMonitor // @@ -5582,6 +5613,9 @@ this.tabPage1.ResumeLayout(false); this.plAccessorial1.ResumeLayout(false); this.plAccessorial1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox26)).EndInit(); this.panel10.ResumeLayout(false); this.panel10.PerformLayout(); this.panel15.ResumeLayout(false); @@ -5608,9 +5642,6 @@ ((System.ComponentModel.ISupportInitialize)(this.pB14001)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pB14002)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox26)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -6010,6 +6041,8 @@ private System.Windows.Forms.TextBox textBox78; private System.Windows.Forms.PictureBox pictureBox3; private System.Windows.Forms.PictureBox pictureBox2; + private System.Windows.Forms.Button button61; + private System.Windows.Forms.Button button60; //private System.Windows.Forms.Button button132; diff --git a/WcfControlMonitorHost/CStaticClass.cs b/WcfControlMonitorHost/CStaticClass.cs index 997f89d..edbfe41 100644 --- a/WcfControlMonitorHost/CStaticClass.cs +++ b/WcfControlMonitorHost/CStaticClass.cs @@ -4,6 +4,7 @@ using System.Text; using System.Data; using DBFactory; + namespace wcfControlMonitorClient { /// diff --git a/WcfControlMonitorHost/FrmHost.cs b/WcfControlMonitorHost/FrmHost.cs index 1bb842b..045d6e6 100644 --- a/WcfControlMonitorHost/FrmHost.cs +++ b/WcfControlMonitorHost/FrmHost.cs @@ -1724,7 +1724,11 @@ namespace wcfControlMonitorClient timer2.Enabled = true; } } - + /// + /// 定时器:定时发送出入库模式 + /// + /// + /// private void InOutModelChange_Tick(object sender, EventArgs e) { if (MITurnOn.Checked == false) return; diff --git a/WcfControlMonitorLib/CCallService.cs b/WcfControlMonitorLib/CCallService.cs index a160fb8..b1c2607 100644 --- a/WcfControlMonitorLib/CCallService.cs +++ b/WcfControlMonitorLib/CCallService.cs @@ -563,52 +563,52 @@ namespace WcfControlMonitorLib } #endregion - #region IN_DATA 入库 民航二所 - public class IN_DATA - //JSON格式业务数据 - { - /// - /// - /// - public string taskId { get; set; } - /// - /// - /// - public string containerCode { get; set; } - /// - /// - /// - public string sourceAddress { get; set; } - /// - /// - /// - public string targetAddress { get; set; } - /// - /// - /// - public string tasklevel { get; set; } + //#region IN_DATA 入库 民航二所 + //public class IN_DATA + ////JSON格式业务数据 + //{ + // /// + // /// + // /// + // public string taskId { get; set; } + // /// + // /// + // /// + // public string containerCode { get; set; } + // /// + // /// + // /// + // public string sourceAddress { get; set; } + // /// + // /// + // /// + // public string targetAddress { get; set; } + // /// + // /// + // /// + // public string tasklevel { get; set; } - } - #endregion + //} + //#endregion - #region IN_RES 入库返回 + //#region IN_RES 入库返回 - public class IN_RES //JSON格式业务数据 - { - public string code { get; set; }//处理状态。00,成功,01异常 - public string msg { get; set; }//返回消息 - public string taskId { get; set; } - } - #endregion + //public class IN_RES //JSON格式业务数据 + //{ + // public string code { get; set; }//处理状态。00,成功,01异常 + // public string msg { get; set; }//返回消息 + // public string taskId { get; set; } + //} + //#endregion - #region CANCEL_DATA WMS取消任务 + #region CANCEL_DATA WMS取消任务 山东时代 public class WMS_WCS_PARAM_CANCEL { public string taskId { get; set; }//任务编号(索引) public string msgTime { get; set; }// } - #endregion + public class WCS_WMS_PARAM_CANCEL { @@ -617,7 +617,7 @@ namespace WcfControlMonitorLib public object data { get; set; } } - + #endregion #region CANCEL_RES_Priority WMS调整任务优先级 @@ -932,24 +932,24 @@ namespace WcfControlMonitorLib } #endregion - #region DELETE_TASK_DATA 向管理申请删除任务 - public class DELETE_TASK_DATA - { + //#region DELETE_TASK_DATA 向管理申请删除任务 + //public class DELETE_TASK_DATA + //{ - public string taskId { get; set; }//任务编号(索引) - public string containerCode { get; set; }//条码 + // public string taskId { get; set; }//任务编号(索引) + // public string containerCode { get; set; }//条码 - } - #endregion + //} + //#endregion - #region DELETE_TASK_RES 取消任务返回 - public class DELETE_TASK_RES - { - public string code { get; set; }//状态(0 成功,1 失败) - public string msg { get; set; }//返回消息,描述信息 - public string taskId { get; set; } - } - #endregion + //#region DELETE_TASK_RES 取消任务返回 + //public class DELETE_TASK_RES + //{ + // public string code { get; set; }//状态(0 成功,1 失败) + // public string msg { get; set; }//返回消息,描述信息 + // public string taskId { get; set; } + //} + //#endregion @@ -1345,8 +1345,10 @@ namespace WcfControlMonitorLib static CCommonFunction ccf = new CCommonFunction(); static Thread mythread; static Thread mythreadUpdatestatus; + static Thread threadAGVStatusSend; static bool exitThread = false; static bool exitThreadInRequestDeal = false; + static bool exitThreadInAGVPLCAsk = false; static CGetState cgs = new CGetState(); static string _CCallServiceError = "";//监控调度类错误说明 @@ -1445,29 +1447,6 @@ namespace WcfControlMonitorLib } } - public static void EndListen() - {//20091107 - exitThread = true; - - if (mythread != null) - { - - mythread.Abort(); - mythread = null; - } - - - exitThreadInRequestDeal = true; - - if (mythreadUpdatestatus != null) - { - - mythreadUpdatestatus.Abort(); - mythreadUpdatestatus = null; - } - - } - private static void BeginListenUpdatestatus() {//20091107 while (!exitThreadInRequestDeal) @@ -1485,12 +1464,12 @@ namespace WcfControlMonitorLib for (int i = 0; i < dataInRequest.Count; i++) { CommonClassLib.CCarryConvert.WriteDarkCasket("CallService", "inboundApply", "准备开始调用wms服务:", $"Barcode:{dataInRequest[i]["STOCK_BARCODE"]},站台{dataInRequest[i]["DEVICE_CODE"]}"); - ResultMessage result= RequestToWMS(dataInRequest[i]["STOCK_BARCODE"].ToString(), dataInRequest[i]["DEVICE_CODE"].ToString(), "2", out InboundApplyBack resp_data); + ResultMessage result = RequestToWMS(dataInRequest[i]["STOCK_BARCODE"].ToString(), dataInRequest[i]["DEVICE_CODE"].ToString(), "2", out InboundApplyBack resp_data); if (result.sResult) { //成功 - IO_CONTROL iO_CONTROL = new IO_CONTROL(resp_data.data,DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); + IO_CONTROL iO_CONTROL = new IO_CONTROL(resp_data.data, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); iO_CONTROL.Insert_IOCONTROL();//暂不考虑插入失败的情况 写入IO入库任务 - CommonClassLib.CCarryConvert.WriteDarkCasket("CallService", "inboundApply", "开始调用wms服务成功败:", $"返回信息{resp_data.data}:{resp_data.msg}"); + CommonClassLib.CCarryConvert.WriteDarkCasket("CallService", "inboundApply", "开始调用wms服务成功败:", $"返回信息{resp_data.data}:{resp_data.msg}"); } else { @@ -1500,7 +1479,7 @@ namespace WcfControlMonitorLib DataView dataBackTask = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; IO_CONTROL iO_CONTROL = new IO_CONTROL(dataInRequest[i]["DEVICE_CODE"].ToString(), dataBackTask[0]["F_EndDevice"].ToString(), dataInRequest[i]["STOCK_BARCODE"].ToString()); iO_CONTROL.Insert_IOCONTROL();//暂不考虑插入失败的情况 写入IO入库任务 - CommonClassLib.CCarryConvert.WriteDarkCasket("CallService", "inboundApply", "开始调用wms服务失败:", $"返回报错{resp_data.data}:{resp_data.msg}"); + CommonClassLib.CCarryConvert.WriteDarkCasket("CallService", "inboundApply", "开始调用wms服务失败:", $"返回报错{resp_data.data}:{resp_data.msg}"); } } } @@ -1516,6 +1495,54 @@ namespace WcfControlMonitorLib } } } + + + private static void BeginListenAgvData(){ + while (!exitThreadInAGVPLCAsk) + { + try { + DataView dv = new DataView(); DataView dvl = new DataView(); + string dtime = DateTime.Now.ToString("u"); + dtime = dtime.Substring(0, dtime.Length - 1); + sql.Clear(); + sql.Append("select * from T_AGVIOStation ");//查询还未发送给WMS但是任务状态已经是拆分完的状态的任务 数据库加一个IsSendLCS字段 + DataView data = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView; + for (int i=0; i < data.Count;i++) { + Model.MDevice md = Model.CGetInfo.GetDeviceInfo(Convert.ToInt32(dv[i]["F_DeviceIndex"])); + if (md.RunState.ToString()!= data[i]["F_AGVStatus"].ToString())//当前状态和数据库不一样,则下发数据 + { + SControlMonitor sControl = new SControlMonitor(); + sControl.WriteDBDataConveyor(Convert.ToInt32(dv[i]["F_DeviceIndex"]), "DB2", dv[i]["F_AGVStatus"].ToString(), out string errtext); + } + } + } + catch(Exception ex) { + } + } + } + public static void EndListen() + {//20091107 + exitThread = true; + + if (mythread != null) + { + + mythread.Abort(); + mythread = null; + } + + + exitThreadInRequestDeal = true; + + if (mythreadUpdatestatus != null) + { + + mythreadUpdatestatus.Abort(); + mythreadUpdatestatus = null; + } + + } + public static void StartListen() { //LayerStatus.LAYER.Clear(); @@ -1536,9 +1563,29 @@ namespace WcfControlMonitorLib mythreadUpdatestatus = new Thread(new ThreadStart(BeginListenUpdatestatus)); // mythreadUpdatestatus.IsBackground = true; mythreadUpdatestatus.Start(); + + + + } + public static void StartListenPLC() { + exitThreadInAGVPLCAsk = false; + threadAGVStatusSend = new Thread(new ThreadStart(BeginListenAgvData)); // + threadAGVStatusSend.IsBackground = true; + threadAGVStatusSend.Start(); + } + public static void EndListenPLC() + { + exitThreadInAGVPLCAsk = true; + + if (threadAGVStatusSend != null) + { + + threadAGVStatusSend.Abort(); + threadAGVStatusSend = null; + } } } - public class ResultMessage { + public class ResultMessage {//通用返回信息类 public bool sResult { get; set; } public string message { get; set; } } @@ -1548,6 +1595,7 @@ namespace WcfControlMonitorLib } + #region IOControl public class IO_CONTROL { static DBOperator dbo = CStaticClass.dbo; @@ -1851,4 +1899,5 @@ namespace WcfControlMonitorLib public string sql; public string des; } + #endregion } diff --git a/WcfControlMonitorLib/SControlMonitor.cs b/WcfControlMonitorLib/SControlMonitor.cs index 48a8fa4..7898066 100644 --- a/WcfControlMonitorLib/SControlMonitor.cs +++ b/WcfControlMonitorLib/SControlMonitor.cs @@ -2810,7 +2810,7 @@ namespace WcfControlMonitorLib CStaticClass.ReConnect(); SocketsTCPIP.CClientTCPIP.InitAllClientTCPIP(); CParsePLCData.StartListen(); - + CCallService.StartListenPLC();//山东时代 CUpdateIoControl.StartListen(); // NewWrieDarkCasket 位置1 OPCClient.CCommonOPCClient.CreateSubscriptionGroup(); @@ -2852,7 +2852,8 @@ namespace WcfControlMonitorLib //SocketsTCPIP.CClientTCPIP.SendDeviceOrder -= new CSendDeviceOrderEventHandler(CClientTCPIP_SendDeviceOrder); //SocketsTCPIP.CClientTCPIP.EndConnect(); CParsePLCData.EndListen(); - CUpdateIoControl.EndListen(); // NewWrieDarkCasket 位置2 + CUpdateIoControl.EndListen(); // NewWrieDarkCasket 位置2' + CCallService.EndListenPLC();//山东时代 return true; } catch @@ -4925,7 +4926,7 @@ namespace WcfControlMonitorLib CUpdateIoControl.EndListen(); //民航二所 CCallService.EndListen();//民航二所 结束调用管理系统接口 - + CCallService.EndListenPLC();//山东时代 //Application.Exit(); return true; } @@ -8176,7 +8177,7 @@ namespace WcfControlMonitorLib } /// - /// 直接向DB区写数据 + /// 直接向DB区写数据 lzm 20250317 /// /// /// DB1,DB2 @@ -8194,7 +8195,7 @@ namespace WcfControlMonitorLib StringBuilder[] wv = { new StringBuilder("") }; StringBuilder[] wn = { new StringBuilder("") }; wn[0].Clear(); - wn[0].Append(DBBlock).Append(".").Append(Convert.ToString(md.Dbw1Address + 18)).Append(",i");//第22个字节写1 民航二所 + wn[0].Append(DBBlock).Append(".").Append(Convert.ToString(md.Dbw1Address + 18)).Append(",i");//第18个字节写1 山东时代 wv[0].Clear(); wv[0].Append(Wdata); sdo = CommModeCreate.CreateSendDeviceOrder(deviceIndex); @@ -8212,7 +8213,7 @@ namespace WcfControlMonitorLib } /// - /// 直接向DB区写数据 + /// 直接向DB区写数据 输送线 lzm /// /// /// DB1,DB2 @@ -8230,7 +8231,7 @@ namespace WcfControlMonitorLib StringBuilder[] wv = { new StringBuilder("") }; StringBuilder[] wn = { new StringBuilder("") }; wn[0].Clear(); - wn[0].Append(DBBlock).Append(".").Append(Convert.ToString(md.Dbw1Address + 1)).Append(",i");//第22个字节写1 民航二所 + wn[0].Append(DBBlock).Append(".").Append(Convert.ToString(md.Dbw1Address + 1)).Append(",i");// wv[0].Clear(); wv[0].Append(Wdata); sdo = CommModeCreate.CreateSendDeviceOrder(deviceIndex); @@ -8873,6 +8874,10 @@ namespace WcfControlMonitorLib } } + /// + /// 出入库模式修改 + /// + /// public bool SendInOutMessageToPlc() { DataView dv = new DataView();