Commit 8a19a2a0 LN

单盘入库使用参考库位尺寸。

1 个父辈 06cd90e7
......@@ -44,9 +44,11 @@
this.btnOutStore = new System.Windows.Forms.Button();
this.lblTemp = new System.Windows.Forms.Label();
this.groupBox6 = new System.Windows.Forms.GroupBox();
this.lblSingleSize = new System.Windows.Forms.Label();
this.btnClearBuzzer = new System.Windows.Forms.Button();
this.btnSingleTrayIn = new System.Windows.Forms.Button();
this.lblBatchMsg = new System.Windows.Forms.Label();
this.lblWarnMsg = new System.Windows.Forms.Label();
this.btnOpenDoor = new System.Windows.Forms.Button();
this.lblWaitTragGo = new System.Windows.Forms.Label();
this.btnWaitTrgGo = new System.Windows.Forms.Button();
......@@ -66,7 +68,6 @@
this.chbDebug = new System.Windows.Forms.CheckBox();
this.lblThisSta = new System.Windows.Forms.Label();
this.chbAuto = new System.Windows.Forms.CheckBox();
this.lblWarnMsg = new System.Windows.Forms.Label();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.picAxis4 = new System.Windows.Forms.PictureBox();
this.picPPoint = new System.Windows.Forms.PictureBox();
......@@ -450,6 +451,7 @@
//
this.groupBox6.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox6.Controls.Add(this.lblSingleSize);
this.groupBox6.Controls.Add(this.btnClearBuzzer);
this.groupBox6.Controls.Add(this.btnSingleTrayIn);
this.groupBox6.Controls.Add(this.lblBatchMsg);
......@@ -471,6 +473,17 @@
this.groupBox6.TabStop = false;
this.groupBox6.Text = "批量上下料操作";
//
// lblSingleSize
//
this.lblSingleSize.AutoSize = true;
this.lblSingleSize.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblSingleSize.ForeColor = System.Drawing.Color.Black;
this.lblSingleSize.Location = new System.Drawing.Point(331, 242);
this.lblSingleSize.Name = "lblSingleSize";
this.lblSingleSize.Size = new System.Drawing.Size(80, 17);
this.lblSingleSize.TabIndex = 258;
this.lblSingleSize.Text = "单盘入库尺寸";
//
// btnClearBuzzer
//
this.btnClearBuzzer.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
......@@ -505,6 +518,18 @@
this.lblBatchMsg.TabIndex = 233;
this.lblBatchMsg.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// lblWarnMsg
//
this.lblWarnMsg.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lblWarnMsg.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblWarnMsg.ForeColor = System.Drawing.Color.Red;
this.lblWarnMsg.Location = new System.Drawing.Point(7, -16);
this.lblWarnMsg.Name = "lblWarnMsg";
this.lblWarnMsg.Size = new System.Drawing.Size(1218, 40);
this.lblWarnMsg.TabIndex = 224;
this.lblWarnMsg.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// btnOpenDoor
//
this.btnOpenDoor.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
......@@ -732,18 +757,6 @@
this.chbAuto.UseVisualStyleBackColor = true;
this.chbAuto.CheckedChanged += new System.EventHandler(this.chbAuto_CheckedChanged);
//
// lblWarnMsg
//
this.lblWarnMsg.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.lblWarnMsg.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblWarnMsg.ForeColor = System.Drawing.Color.Red;
this.lblWarnMsg.Location = new System.Drawing.Point(7, -16);
this.lblWarnMsg.Name = "lblWarnMsg";
this.lblWarnMsg.Size = new System.Drawing.Size(1218, 40);
this.lblWarnMsg.TabIndex = 224;
this.lblWarnMsg.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// tabPage2
//
this.tabPage2.Controls.Add(this.picAxis4);
......@@ -2017,7 +2030,7 @@
// uc_boxdebug1
//
this.uc_boxdebug1.Location = new System.Drawing.Point(6, 6);
this.uc_boxdebug1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.uc_boxdebug1.Margin = new System.Windows.Forms.Padding(4);
this.uc_boxdebug1.Name = "uc_boxdebug1";
this.uc_boxdebug1.Size = new System.Drawing.Size(1076, 596);
this.uc_boxdebug1.TabIndex = 0;
......@@ -2647,6 +2660,7 @@
private System.Windows.Forms.TabPage tabPage6;
private ACSingleStore.useControl.uc_boxdebug uc_boxdebug1;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.Label lblSingleSize;
}
}
......@@ -265,7 +265,21 @@ namespace OnlineStore.AutoInOutStore
LanguageProcess();
SetImage();
LoadSStr();
}
private void LoadSStr()
{
//单盘入库尺寸;
string defaultPosId = ConfigAppSettings.GetValue(Setting_Init.SinglePosId).Trim();
AutoStorePosition ktkPosition = CSVPositionReader<AutoStorePosition>.GetPositon(defaultPosId);
if (ktkPosition != null)
{
lblSingleSize.Text = "单盘入库参考尺寸:" + ktkPosition.BagWidth + "X" + ktkPosition.BagHeight+ "["+defaultPosId+"]";
}
else
{
lblSingleSize.Text = "";
}
}
private void SetImage()
{
......@@ -1548,6 +1562,8 @@ namespace OnlineStore.AutoInOutStore
private void btnClearBuzzer_Click(object sender, EventArgs e)
{
IOManager.IOMove(IO_Type.Buzzer_Sign, IO_VALUE.LOW);
InOutStoreParam param = AutomaticBaiting.GetInStoreParam("TEST", "");
MessageBox.Show(param == null ? "失败" : param.PositionNum);
}
private void btnStart_Click(object sender, EventArgs e)
......@@ -1636,6 +1652,7 @@ namespace OnlineStore.AutoInOutStore
if (result.Equals(DialogResult.OK))
{
ConfigAppSettings.SaveValue(Setting_Init.SinglePosId, selectPositionNum);
LoadSStr();
}
}
}
......
......@@ -836,10 +836,11 @@ namespace OnlineStore.DeviceLibrary
}
else
{
InStoreLog("入库:SIS_39 获取入库库位号 ");
InStoreLog($"入库:SIS_39 获取入库库位号 ,{StoreMove.MoveParam.PlagtW}X{StoreMove.MoveParam.PlateH}");
StoreMove.NextMoveStep(StoreMoveStep.SIS_39_GetPosId);
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(10000));//最多等待十秒
InOutStoreParam param = AutomaticBaiting.GetInStoreParam("单盘入库", AutomaticBaiting.ProcessMsg());
InOutStoreParam param = AutomaticBaiting.GetInStoreParam("单盘入库", AutomaticBaiting.ProcessMsg(StoreMove.MoveParam.PlagtW, StoreMove.MoveParam.PlateH), true);
if (param == null)
{
SingleSendOut("从服务器获取入库信息失败");
......
......@@ -512,7 +512,7 @@ namespace OnlineStore.DeviceLibrary
GetPosTask = null;
GetPosTask = Task.Factory.StartNew(delegate ()
{
GetInStorePosId(ProcessMsg());
GetInStorePosId(ProcessMsg(LastWidth,LastHeight));
});
}
}
......
......@@ -404,8 +404,16 @@ namespace OnlineStore.DeviceLibrary
IOManager.IOMove(highType, IO_VALUE.HIGH);
}
private static string LastSendCode = "";
public static string ProcessMsg()
public static string ProcessMsg(int width, int height)
{
if (width <= 0)
{
width = LastWidth;
}
if (height <= 0)
{
height = LastHeight;
}
string msg = "";
//string[] codeArray = LastCode.Split(new string[] { spiltStr});
if (LastCodeList.Count > 0)
......@@ -418,7 +426,7 @@ namespace OnlineStore.DeviceLibrary
string codeSize = StoreManager.Config.GetCodeSize(ref code);
if (String.IsNullOrEmpty(codeSize))
{
msg = msg + "=1+0x0-" + LastWidth + "x" + LastHeight + "=" + code + spiltStr;
msg = msg + "=1+0x0-" + width + "x" + height + "=" + code + spiltStr;
}
else
{
......@@ -429,7 +437,7 @@ namespace OnlineStore.DeviceLibrary
}
else if (!LastCode.Equals(""))
{
msg = msg + "=1+0x0-" + LastWidth + "x" + LastHeight + "=" + LastCode + spiltStr;
msg = msg + "=1+0x0-" + width + "x" + height + "=" + LastCode + spiltStr;
}
msg = CodeManager.ReplaceCode(msg);
LastSendCode = msg;
......@@ -494,7 +502,7 @@ namespace OnlineStore.DeviceLibrary
}
}
public static InOutStoreParam GetInStoreParam(string LogName, string message)
public static InOutStoreParam GetInStoreParam(string LogName, string message,bool isSingieIn=false )
{
//message = CodeManager.ReplaceCode(message);
if (message.Equals("") || string.IsNullOrEmpty(message))
......@@ -504,19 +512,19 @@ namespace OnlineStore.DeviceLibrary
return null;
}
if (StoreManager.Store.storeRunStatus.Equals(StoreRunStatus.Wait))
if (StoreManager.Store.storeRunStatus.Equals(StoreRunStatus.Wait)&&(!LogName.Equals("TEST")))
{
LogUtil.info(LogName + "【 " + message + "】,设备未启动,不需要发送服务器");
return null;
}
LogUtil.info(LogName + "【 " + message + "】,发送给服务器获取入库PosID");
LogUtil.info(LogName + "【 " + message + "】,发送给服务器获取入库PosID,"+( isSingieIn?"单盘入库":""));
Operation operation = StoreManager.Store.getLineBoxStatus();
operation.op = 1;
operation.data.Add("code", message);
operation.data.Add("boxId", StoreManager.Store.StoreID.ToString());
if (LastHeight.Equals(0) && LastWidth.Equals(0))
if (isSingieIn)
{
//singleIn 单盘入库
operation.data.Add("singleIn", "true");
......@@ -532,6 +540,11 @@ namespace OnlineStore.DeviceLibrary
LogUtil.debug("添加自动入库库位号:" + autoposId);
}
string server = ConfigAppSettings.GetValue(Setting_Init.http_server);
if (LogName.Equals("TEST"))
{
operation.status = 1;
operation.boxStatus[1].status = 1;
}
Operation resultOperation = HttpHelper.PostOP(StoreManager.GetPostApi(server), operation, 2000);
if (resultOperation == null)
......@@ -549,6 +562,7 @@ namespace OnlineStore.DeviceLibrary
if (data != null && data.ContainsKey(ParamDefine.posId) && data.ContainsKey(ParamDefine.plateH) && data.ContainsKey(ParamDefine.plateW))
{
string posId = data[ParamDefine.posId];
LogUtil.info(LogName + "服务器反馈 二维码【" + message + "】【" + autoposId + "】 :posId=" + posId);
try
{
......@@ -568,6 +582,7 @@ namespace OnlineStore.DeviceLibrary
AutoStorePosition position = CSVPositionReader<AutoStorePosition>.GetPositon(posId);
if (position == null)
{
LogUtil.error(LogName + "二维码【" + message + "】从服务器获取到库位号:"+ posId + ", 库位号不存在");
SetWarnMsgAndLog(ResourceControl.InStoreNoPosition, message, posId);
return null;
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!