Commit 0248b4f6 LN

从接口获取是否需要测值

1 个父辈 b54bda76
......@@ -204,28 +204,28 @@ namespace OnlineStore.DeviceLibrary
// WorkLog(" 右侧入口入料,直接放到XRay:" + MoveInfo.MoveParam.ToStr());
//}
//else if (SServerManager.CanConnect())
//{
// Task task = Task.Factory.StartNew(delegate
// {
// int needPosition = 0;
// string msg = SServerManager.Get_VMICheckRLC(Name, MoveInfo.MoveParam.WareCode, out needPosition);
else if (SServerManager.CanConnect())
{
Task task = Task.Factory.StartNew(delegate
{
int needPosition = 0;
string msg = SServerManager.Get_VMICheckRLC(Name, MoveInfo.MoveParam.WareCode, out needPosition);
// if (needPosition >= 1 && needPosition <= 3)
// {
// MoveInfo.MoveParam.TargetPosType = needPosition;
// WorkLog(" 【" + MoveInfo.MoveParam.WareCode + "】通过接口获取目标位置:" + needPosition);
// }
// // else if (!msg.Equals("") || needPosition.Equals(0))
// else
// {
// WorkLog(" 【" + MoveInfo.MoveParam.WareCode + "】获取是否测值失败:" + msg);
// MoveInfo.MoveParam.TargetPosType = 1;
// MoveInfo.MoveParam.IsNgReel = true;
// MoveInfo.MoveParam.NgMsg = msg;
// }
// });
//}
if (needPosition >= 1 && needPosition <= 3)
{
MoveInfo.MoveParam.TargetPosType = needPosition;
WorkLog(" 【" + MoveInfo.MoveParam.WareCode + "】通过接口获取目标位置:" + needPosition);
}
// else if (!msg.Equals("") || needPosition.Equals(0))
else
{
WorkLog(" 【" + MoveInfo.MoveParam.WareCode + "】获取是否测值失败:" + msg);
MoveInfo.MoveParam.TargetPosType = 1;
MoveInfo.MoveParam.IsNgReel = true;
MoveInfo.MoveParam.NgMsg = msg;
}
});
}
else
{
if (MoveInfo.MoveParam.TargetPosType.Equals(0))
......
......@@ -339,6 +339,7 @@ namespace OnlineStore.DeviceLibrary
return true;
}
private Task printTask = null;
private bool NeedPrint = ConfigAppSettings.GetIntValue(Setting_Init.NeedPrintLabel).Equals(1);
protected override void LabellingProcess()
{
......@@ -359,11 +360,15 @@ namespace OnlineStore.DeviceLibrary
SecMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
if (NeedPrint)
{
Task.Factory.StartNew(delegate
printTask = Task.Factory.StartNew(delegate
{
StartPrintLabel(SecMoveInfo.MoveParam.WareCode, SecMoveInfo.MoveParam.WareCount.ToString());
});
}
else
{
printTask = null;
}
LabelXAxis.AbsMove(SecMoveInfo, Config.LabelX_P2, Config.LabelX_P2Speed);
LabelYAxis.AbsMove(SecMoveInfo, Config.LabelY_P2, Config.LabelY_P2Speed);
LabelRAxis.AbsMove(SecMoveInfo, Config.LabelR_P2, Config.LabelR_P2Speed);
......@@ -372,17 +377,26 @@ namespace OnlineStore.DeviceLibrary
else if (SecMoveInfo.IsStep(StepEnum.OL03_PrintLabel))
{
bool isPrintOk = RobotManager.LastPrintStatus.Equals(Asa.PrintLabel.PrinterStatus.Idle);
bool isTimeOut = SecMoveInfo.IsTimeOut(60);
bool isTimeOut = SecMoveInfo.IsTimeOut(120);
if (printTask == null || printTask.IsCompleted)
{
if (isPrintOk || isTimeOut || (!NeedPrint))
{
SecMoveInfo.NextMoveStep(StepEnum.OL05_TakeBack);
SecWorkLog("贴标: 打印结束[" + RobotManager.LastPrintStatus + "][" + (isTimeOut ? "超时60秒" : "") + "],取码气缸后退");
SecWorkLog("贴标: 打印结束[" + RobotManager.LastPrintStatus + "][" + (isTimeOut ? "超时120秒" : "") + "],取码气缸后退");
CylinderMove(SecMoveInfo, IO_Type.TakeCode_Forward, IO_Type.TakeCode_Back);
}
}else if (MoveInfo.IsTimeOut(120))
{
WarnMsg = SecMoveInfo.Name + "[" + SecMoveInfo.MoveStep + "]" + "等待 打印标签完成(OL03_PrintLabel) 超时[" + FormUtil.GetSpanStr(SecMoveInfo.StepSpan()) + "]";
LogUtil.error(WarnMsg, SecMoveInfo.ErrorLogType);
Alarm(AlarmType.IoSingleTimeOut);
}
}
else if (SecMoveInfo.IsStep(StepEnum.OL05_TakeBack))
{
printTask = null;
SecMoveInfo.NextMoveStep(StepEnum.OL07_ZToP2);
SecWorkLog("贴标: Z轴到取标签点P2");
LabelZAxis.AbsMove(SecMoveInfo, Config.LabelZ_P2, Config.LabelZ_P2Speed);
......@@ -512,6 +526,7 @@ namespace OnlineStore.DeviceLibrary
{
try
{
LogUtil.info("调用 打印标签 StartPrintLabel ,[" + wareCode + "] [" + wareCount + "] ");
Dictionary<string, string> text = new Dictionary<string, string>();
text.Add("aa", wareCode);
text.Add("bb", wareCount );
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!