Commit 056990ed LN

增加出库模拟功能

1 个父辈 523d9c9a
......@@ -968,7 +968,7 @@ namespace OnlineStore.DeviceLibrary
return false;
}
if (lineConn.CanStartOut())
if (lineConn.CanStartOut()&&(!IsDebug))
{
return true;
}
......
......@@ -566,6 +566,7 @@ namespace OnlineStore.DeviceLibrary
string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosInfo.ShelfPosId : "";
LogInfo(" 【" + posId + "】 整个流程结束,耗时【" + FormUtil.GetSpanStr(span) + "】!");
MoveInfo.EndMove();
storeStatus = StoreStatus.StoreOnline;
storeRunStatus = StoreRunStatus.Runing;
}
#endregion
......
......@@ -112,7 +112,7 @@ namespace OnlineStore.DeviceLibrary
return JsonHelper.SerializeObject(store) + "\r";
}
private void HandlerMsg(string message)
public void HandlerMsg(string message)
{
try
{
......@@ -131,18 +131,29 @@ namespace OnlineStore.DeviceLibrary
if (cmd.Equals(cmd_startIn))
{
LogUtil.info("[" + CID + "]收到流水线消息:" + message);
InOutPosInfo inout = new InOutPosInfo(reviceInfo.WareCode, "", reviceInfo.PlateH, reviceInfo.PlateW, reviceInfo.IsNg, reviceInfo.PosId,reviceInfo.rfid);
InOutPosInfo inout = new InOutPosInfo(reviceInfo.WareCode, "", reviceInfo.PlateH, reviceInfo.PlateW, reviceInfo.IsNg, reviceInfo.PosId, reviceInfo.rfid);
string logName = "收到流水线命令【 " + inout.ToStr() + "】:";
if (DoorPosInfo != null)
{
LogUtil.error(logName + ",清理DoorPosInfo:" + DoorPosInfo.ToStr());
DoorPosInfo = null;
}
//直接存入缓存
LogUtil.error(logName + "缓存到DoorPosInfo中");
DoorPosInfo = inout;
//如果信息一直,不需要处理
if (inout.BoxPosId.Equals(DoorPosInfo.BoxPosId) && inout.barcode.Equals(DoorPosInfo.barcode) && inout.ShelfPosId.Equals(DoorPosInfo.ShelfPosId) && inout.IsNg.Equals(DoorPosInfo.IsNg))
{
}
else
{
LogUtil.error(logName + ",清理DoorPosInfo:" + DoorPosInfo.ToStr() + ",把新数据缓存到DoorPosInfo中");
DoorPosInfo = inout;
}
}
else
{
//直接存入缓存
LogUtil.info(logName + "缓存到DoorPosInfo中");
DoorPosInfo = inout;
}
}
else if (cmd.Equals(cmd_updateDebug))
{
......@@ -155,7 +166,7 @@ namespace OnlineStore.DeviceLibrary
}
else if (cmd.Equals(cmd_checStartIn))
{
LogUtil.info("[" + CID + "]收到流水线验证消息:" + message);
LogUtil.info("[" + CID + "]收到流水线验证消息:" + message);
}
}
}
......
......@@ -187,7 +187,7 @@ namespace OnlineStore.DeviceLibrary
string logName = "http :URL:" + url + " , ";
DateTime startTime = DateTime.Now;
string json = HttpHelper.Post(url, "", 10000);
LogUtil.debug(logName + ",Response:" + json + ",耗时【" + FormUtil.GetSpanStr(DateTime.Now - startTime) + "】");
LogUtil.info(logName + ",Response:" + json + ",耗时【" + FormUtil.GetSpanStr(DateTime.Now - startTime) + "】");
if (string.IsNullOrWhiteSpace(json))
{
return tray;
......
......@@ -132,6 +132,8 @@
this.toolStripSeparator15 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripSeparator16 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripSeparator17 = new System.Windows.Forms.ToolStripSeparator();
this.txtMoni = new System.Windows.Forms.TextBox();
this.btnMoni = new System.Windows.Forms.Button();
this.tabControl1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.groupBox2.SuspendLayout();
......@@ -206,7 +208,7 @@
this.logBox.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.logBox.Location = new System.Drawing.Point(4, 127);
this.logBox.Name = "logBox";
this.logBox.Size = new System.Drawing.Size(970, 438);
this.logBox.Size = new System.Drawing.Size(970, 311);
this.logBox.TabIndex = 278;
this.logBox.Text = "";
this.logBox.VisibleChanged += new System.EventHandler(this.logBox_VisibleChanged);
......@@ -225,48 +227,54 @@
//
// groupBox2
//
this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox2.Controls.Add(this.btnMoni);
this.groupBox2.Controls.Add(this.txtMoni);
this.groupBox2.Controls.Add(this.button6);
this.groupBox2.Controls.Add(this.button3);
this.groupBox2.Controls.Add(this.button5);
this.groupBox2.Location = new System.Drawing.Point(460, 82);
this.groupBox2.Location = new System.Drawing.Point(6, 481);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(476, 78);
this.groupBox2.Size = new System.Drawing.Size(968, 78);
this.groupBox2.TabIndex = 276;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "流水线通信测试";
this.groupBox2.Visible = false;
//
// button6
//
this.button6.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button6.Location = new System.Drawing.Point(317, 32);
this.button6.Location = new System.Drawing.Point(235, 0);
this.button6.Name = "button6";
this.button6.Size = new System.Drawing.Size(100, 33);
this.button6.TabIndex = 275;
this.button6.Text = "发送";
this.button6.UseVisualStyleBackColor = true;
this.button6.Visible = false;
this.button6.Click += new System.EventHandler(this.button6_Click);
//
// button3
//
this.button3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button3.Location = new System.Drawing.Point(64, 31);
this.button3.Location = new System.Drawing.Point(23, 0);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(100, 33);
this.button3.TabIndex = 273;
this.button3.Text = "连接";
this.button3.UseVisualStyleBackColor = true;
this.button3.Visible = false;
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// button5
//
this.button5.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button5.Location = new System.Drawing.Point(193, 32);
this.button5.Location = new System.Drawing.Point(129, 0);
this.button5.Name = "button5";
this.button5.Size = new System.Drawing.Size(100, 33);
this.button5.TabIndex = 274;
this.button5.Text = "停止";
this.button5.UseVisualStyleBackColor = true;
this.button5.Visible = false;
this.button5.Click += new System.EventHandler(this.button5_Click);
//
// lblThisSta
......@@ -1233,19 +1241,19 @@
// toolStripMenuItem2
//
this.toolStripMenuItem2.Name = "toolStripMenuItem2";
this.toolStripMenuItem2.Size = new System.Drawing.Size(176, 26);
this.toolStripMenuItem2.Size = new System.Drawing.Size(180, 26);
this.toolStripMenuItem2.Text = "启用调试";
this.toolStripMenuItem2.Click += new System.EventHandler(this.toolStripMenuItem2_Click);
//
// toolStripSeparator6
//
this.toolStripSeparator6.Name = "toolStripSeparator6";
this.toolStripSeparator6.Size = new System.Drawing.Size(173, 6);
this.toolStripSeparator6.Size = new System.Drawing.Size(177, 6);
//
// 板卡调试ToolStripMenuItem
//
this.板卡调试ToolStripMenuItem.Name = "板卡调试ToolStripMenuItem";
this.板卡调试ToolStripMenuItem.Size = new System.Drawing.Size(176, 26);
this.板卡调试ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.板卡调试ToolStripMenuItem.Text = "板卡调试";
this.板卡调试ToolStripMenuItem.Visible = false;
this.板卡调试ToolStripMenuItem.Click += new System.EventHandler(this.板卡调试ToolStripMenuItem_Click);
......@@ -1253,25 +1261,25 @@
// toolStripSeparator7
//
this.toolStripSeparator7.Name = "toolStripSeparator7";
this.toolStripSeparator7.Size = new System.Drawing.Size(173, 6);
this.toolStripSeparator7.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator7.Visible = false;
//
// 打开设备照明ToolStripMenuItem
//
this.打开设备照明ToolStripMenuItem.Name = "打开设备照明ToolStripMenuItem";
this.打开设备照明ToolStripMenuItem.Size = new System.Drawing.Size(176, 26);
this.打开设备照明ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.打开设备照明ToolStripMenuItem.Text = "打开设备照明";
this.打开设备照明ToolStripMenuItem.Click += new System.EventHandler(this.打开设备照明ToolStripMenuItem_Click);
//
// toolStripSeparator14
//
this.toolStripSeparator14.Name = "toolStripSeparator14";
this.toolStripSeparator14.Size = new System.Drawing.Size(173, 6);
this.toolStripSeparator14.Size = new System.Drawing.Size(177, 6);
//
// 关闭设备照明ToolStripMenuItem
//
this.关闭设备照明ToolStripMenuItem.Name = "关闭设备照明ToolStripMenuItem";
this.关闭设备照明ToolStripMenuItem.Size = new System.Drawing.Size(176, 26);
this.关闭设备照明ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.关闭设备照明ToolStripMenuItem.Text = "关闭设备照明";
this.关闭设备照明ToolStripMenuItem.Click += new System.EventHandler(this.关闭设备照明ToolStripMenuItem_Click);
//
......@@ -1408,6 +1416,29 @@
this.toolStripSeparator17.Name = "toolStripSeparator17";
this.toolStripSeparator17.Size = new System.Drawing.Size(177, 6);
//
// txtMoni
//
this.txtMoni.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtMoni.Location = new System.Drawing.Point(129, 32);
this.txtMoni.Name = "txtMoni";
this.txtMoni.Size = new System.Drawing.Size(825, 26);
this.txtMoni.TabIndex = 276;
this.txtMoni.Text = "\"Cmd\":\"starIn\",\"CanOutStore\":0,\"PosId\":\"\",\"PlateH\":12,\"PlateW\":13,\"WareCode\":\"=13" +
"x12=13172G620;GS1MWG_R2_00001;GS1M;;1124;7500##=13x12=998168*35030238*1124*7500*" +
"000035714##\",\"rfid\":\"B102\",\"IsNg\":true";
//
// btnMoni
//
this.btnMoni.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnMoni.Location = new System.Drawing.Point(23, 25);
this.btnMoni.Name = "btnMoni";
this.btnMoni.Size = new System.Drawing.Size(100, 33);
this.btnMoni.TabIndex = 277;
this.btnMoni.Text = "模拟";
this.btnMoni.UseVisualStyleBackColor = true;
this.btnMoni.Click += new System.EventHandler(this.btnMoni_Click);
//
// FrmEquip
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
......@@ -1429,6 +1460,7 @@
this.tabPage2.ResumeLayout(false);
this.tabPage2.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.tabPage3.ResumeLayout(false);
this.groupInout.ResumeLayout(false);
this.groupInout.PerformLayout();
......@@ -1550,6 +1582,8 @@
private System.Windows.Forms.ToolStripMenuItem s2复位ToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator17;
private System.Windows.Forms.ToolStripMenuItem s3复位ToolStripMenuItem;
private System.Windows.Forms.TextBox txtMoni;
private System.Windows.Forms.Button btnMoni;
}
}
......@@ -189,7 +189,7 @@ namespace OnlineStore.ACSingleStore
if (LineConnect.DoorPosInfo != null)
{
string msg = "出料口物料:" + LineConnect.DoorPosInfo.ToStr()+"\r\n"+"料架信息:"+equip.CurrTray.ToStr();
string msg = "出料口物料:" + LineConnect.DoorPosInfo?.ToStr()+"\r\n"+"料架信息:"+equip.CurrTray?.ToStr();
lblWarnMsg.Text = msg;
}
}
......@@ -1160,5 +1160,12 @@ namespace OnlineStore.ACSingleStore
}
equip.StationMap[3].Reset();
}
private void btnMoni_Click(object sender, EventArgs e)
{
string text = txtMoni.Text.Trim();
LogUtil.info("点击模拟按钮:" + text);
equip.lineConn.HandlerMsg(text);
}
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!