Commit a3f88ef6 LN

bug修改

1 个父辈 4be05867
...@@ -84,17 +84,20 @@ namespace OnlineStore.DeviceLibrary ...@@ -84,17 +84,20 @@ namespace OnlineStore.DeviceLibrary
public override bool Reset() public override bool Reset()
{ {
StopMove(); SetAllTimer(false);
StopMove();
if (!OpenAllAxis()) if (!OpenAllAxis())
{ {
CloseAllAxis(); CloseAllAxis();
SetAllTimer(true);
return false; return false;
} }
LogInfo("Reset 开始重置 "); LogInfo("Reset 开始重置 ");
runStatus = RobotRunStatus.Reset; runStatus = RobotRunStatus.Reset;
MoveInfo.NewMove(RobotMoveType.Reset); MoveInfo.NewMove(RobotMoveType.Reset);
StartReset(); StartReset();
SetAllTimer(true);
return true; return true;
} }
...@@ -177,7 +180,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -177,7 +180,8 @@ namespace OnlineStore.DeviceLibrary
} }
else if (MoveInfo.IsStep(StepEnum.IR09_WaitBatchMove)) else if (MoveInfo.IsStep(StepEnum.IR09_WaitBatchMove))
{ {
if (LeftBatchMove.MoveInfo.MoveType.Equals(RobotMoveType.None) && RightBatchMove.MoveInfo.MoveType.Equals(RobotMoveType.None)) if ((LeftBatchMove.MoveInfo.MoveType.Equals(RobotMoveType.None) || LeftBatchMove.MoveInfo.MoveType.Equals(RobotMoveType.Working))
&& (RightBatchMove.MoveInfo.MoveType.Equals(RobotMoveType.None) || RightBatchMove.MoveInfo.MoveType.Equals(RobotMoveType.Working)))
{ {
WorkLog("复位完成"); WorkLog("复位完成");
runStatus = RobotRunStatus.Runing; runStatus = RobotRunStatus.Runing;
...@@ -185,18 +189,18 @@ namespace OnlineStore.DeviceLibrary ...@@ -185,18 +189,18 @@ namespace OnlineStore.DeviceLibrary
} }
else if (MoveInfo.IsTimeOut(180)) else if (MoveInfo.IsTimeOut(180))
{ {
if (!LeftBatchMove.MoveInfo.MoveType.Equals(RobotMoveType.None)) if (!LeftBatchMove.MoveInfo.MoveType.Equals(RobotMoveType.None) && (!LeftBatchMove.MoveInfo.MoveType.Equals(RobotMoveType.Working)))
{ {
WarnMsg =Name+ "等待" + LeftBatchMove.Name + "复位完成超时[" + MoveInfo.TimeOutSeconds + "]秒"; WarnMsg = Name + "等待" + LeftBatchMove.Name + "复位完成超时[" + MoveInfo.TimeOutSeconds + "]秒";
LogUtil.error( WarnMsg, MoveInfo.ErrorLogType); LogUtil.error(WarnMsg, MoveInfo.ErrorLogType);
Alarm(AlarmType.IoSingleTimeOut); Alarm(AlarmType.IoSingleTimeOut);
} }
else else
{ {
WarnMsg = Name + "等待" + LeftBatchMove.Name + "复位完成超时[" + MoveInfo.TimeOutSeconds + "]秒"; WarnMsg = Name + "等待" + LeftBatchMove.Name + "复位完成超时[" + MoveInfo.TimeOutSeconds + "]秒";
LogUtil.error( WarnMsg); LogUtil.error(WarnMsg);
Alarm(AlarmType.IoSingleTimeOut); Alarm(AlarmType.IoSingleTimeOut);
} }
} }
} }
} }
......
...@@ -85,6 +85,18 @@ namespace OnlineStore.DeviceLibrary ...@@ -85,6 +85,18 @@ namespace OnlineStore.DeviceLibrary
LastXRayState = "xRay.Open(" + Config.XRay_Port + "," + lastData + ")=" + xresult; LastXRayState = "xRay.Open(" + Config.XRay_Port + "," + lastData + ")=" + xresult;
LogUtil.info(Name + "xRay.Open(" + Config.XRay_Port + "," + lastData + ")=" + xresult); LogUtil.info(Name + "xRay.Open(" + Config.XRay_Port + "," + lastData + ")=" + xresult);
if (!System.IO.Directory.Exists(path1_tif))
{
System.IO.Directory.CreateDirectory(path1_tif);
}
if (!System.IO.Directory.Exists(path2_png))
{
System.IO.Directory.CreateDirectory(path2_png);
}
if (!System.IO.Directory.Exists(path3_out))
{
System.IO.Directory.CreateDirectory(path3_out);
}
} }
catch (Exception ex) catch (Exception ex)
{ {
......
...@@ -154,10 +154,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -154,10 +154,11 @@ namespace OnlineStore.DeviceLibrary
else else
{ {
MoveInfo.NextMoveStep(StepEnum.XW08_DoorClose); MoveInfo.NextMoveStep(StepEnum.XW08_DoorClose);
WorkLog("料盘处理:左侧门关闭,右侧门关闭,挡停放行,准备开始点料"); WorkLog("料盘处理:左侧门关闭,右侧门关闭,准备开始点料");
//WorkLog("料盘处理:左侧门关闭,右侧门关闭,挡停放行,准备开始点料");
CylinderMove(MoveInfo, IO_Type.X_InDoor_Down, IO_Type.X_InDoor_Up); CylinderMove(MoveInfo, IO_Type.X_InDoor_Down, IO_Type.X_InDoor_Up);
CylinderMove(MoveInfo, IO_Type.X_OutDoor_Down, IO_Type.X_OutDoor_Up); CylinderMove(MoveInfo, IO_Type.X_OutDoor_Down, IO_Type.X_OutDoor_Up);
CylinderMove(MoveInfo, IO_Type.X_StopCylinder_Down, IO_Type.X_StopCylinder_Up); // CylinderMove(MoveInfo, IO_Type.X_StopCylinder_Down, IO_Type.X_StopCylinder_Up);
} }
} }
...@@ -174,7 +175,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -174,7 +175,7 @@ namespace OnlineStore.DeviceLibrary
InXWork = false; InXWork = false;
WorkLog("点料:未启用X射线点料,模拟点料结果:" + count + ""); WorkLog("点料:未启用X射线点料,模拟点料结果:" + count + "");
if (Work_ReelInfo.WareCount <= 0) if (Work_ReelInfo.WareCount <= 0)
{ {
Work_ReelInfo.WareCount = count; Work_ReelInfo.WareCount = count;
MoveInfo.MoveParam.SetReelInfo(Work_ReelInfo); MoveInfo.MoveParam.SetReelInfo(Work_ReelInfo);
} }
...@@ -315,39 +316,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -315,39 +316,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(StepEnum.XW13_GetXRayImage); MoveInfo.NextMoveStep(StepEnum.XW13_GetXRayImage);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(8000)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(8000));
WorkLog("点料:清理" + path1_tif + "内容,开始获取X射线图形 "); WorkLog("点料:清理" + path1_tif + "内容,开始获取X射线图形 ");
//string lastData = DateTime.Now.ToString("yyyy-MM-dd");
//ConfigAppSettings.SaveValue(Setting_Init.XRay_Data, lastData);
//ClearFilePath();
//carerayImage.GetImage();
//carerayImage.WindowWidth = Config.WindowWidth;
//carerayImage.WindowLevel = Config.WindowLevel;
//Bitmap bmp = carerayImage.Get48bImage();
//lastFileName =Work_ReelInfo.GetRealId()+"-"+ DateTime.Now.ToString("yyyyMMddHHmmss") + ".png";
//string fileP = path1_tif + @"\" + lastFileName;
//bmp.Save(fileP, System.Drawing.Imaging.ImageFormat.Png);
//string backFile = path_XRAY + lastFileName;
//try
//{
// bmp.Save(backFile, System.Drawing.Imaging.ImageFormat.Png);
//}
//catch (Exception ex)
//{
// LogUtil.error("X图片备份到【" + backFile + "】错误:" + ex.ToString());
//}
//WorkLog("点料:获取X射线图形,保存到: " + fileP + ",备份到:" + backFile + ",记录时间" + lastData + ",停止X射线");
//GetImageEvent?.Invoke(bmp);
//bool result = xRay.Stop();
//if (!result)
//{
// LogUtil.error(" xRay.Stop() 第一次失败,再次调用Stop");
// result = xRay.Stop();
// if (!result)
// {
// LogUtil.error(" xRay.Stop()失败:" + result);
// }
//}
CapImage(); CapImage();
MoveInfo.EndStepWait(); MoveInfo.EndStepWait();
} }
...@@ -467,11 +436,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -467,11 +436,13 @@ namespace OnlineStore.DeviceLibrary
} }
private void ClearFilePath() private void ClearFilePath()
{ {
try try
{ {
if (System.IO.Directory.Exists(path1_tif))
System.IO.Directory.Delete(path1_tif, true); {
System.IO.Directory.Delete(path1_tif, true);
}
} }
catch (Exception ex) catch (Exception ex)
{ {
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!