Commit 79e944f8 刘韬

1

1 个父辈 82303d25
此文件类型无法预览
...@@ -284,13 +284,15 @@ namespace OnlineStore ...@@ -284,13 +284,15 @@ namespace OnlineStore
} }
private static void PreControlLanaguage(Control partentControl, string className) private static void PreControlLanaguage(Control partentControl, string className)
{ {
string newStr = ""; if (className.IndexOf('_') < 0)
//Con_GetTxt(partentControl, out string title); {
//string newStr = GetString(GetTextIdStr(className, partentControl.Name), title); Con_GetTxt(partentControl, out string title);
//if (!newStr.Equals("")) string newStr = GetString(GetTextIdStr(className, partentControl.Name), title);
//{ if (!newStr.Equals(""))
//Con_SetTxt(partentControl, newStr.Replace("\\n", "\n")); {
//} Con_SetTxt(partentControl, newStr.Replace("\\n", "\n"));
}
}
foreach (Control con in partentControl.Controls) foreach (Control con in partentControl.Controls)
{ {
string txt = ""; string txt = "";
...@@ -303,7 +305,7 @@ namespace OnlineStore ...@@ -303,7 +305,7 @@ namespace OnlineStore
if (Con_GetTxt(con, out txt)) if (Con_GetTxt(con, out txt))
{ {
newStr = GetString(GetTextIdStr(className, con.Name), txt); var newStr = GetString(GetTextIdStr(className, con.Name), txt);
if (!newStr.Equals("")) if (!newStr.Equals(""))
{ {
Con_SetTxt(con, newStr.Replace("\\n", "\n")); Con_SetTxt(con, newStr.Replace("\\n", "\n"));
......
...@@ -85,7 +85,7 @@ namespace OnlineStore.Common ...@@ -85,7 +85,7 @@ namespace OnlineStore.Common
public static MyConfig<string> Runtime_Posid = ""; public static MyConfig<string> Runtime_Posid = "";
public static MyConfig<string> Runtime_RFID = ""; public static MyConfig<string> Runtime_RFID = "";
public static MyConfig<string> Runtime_PN = ""; public static MyConfig<string> Runtime_PN = "";
public static MyConfig<string> Runtime_WareCode = "";
......
...@@ -106,6 +106,7 @@ ...@@ -106,6 +106,7 @@
<Compile Include="theMachine\MainMachine _Common.cs" /> <Compile Include="theMachine\MainMachine _Common.cs" />
<Compile Include="theMachine\MainMachine _AutoInOutTest.cs" /> <Compile Include="theMachine\MainMachine _AutoInOutTest.cs" />
<Compile Include="theMachine\MainMachine_Labeling.cs" /> <Compile Include="theMachine\MainMachine_Labeling.cs" />
<Compile Include="theMachine\MainMachine_RFIDSelftest.cs" />
<Compile Include="theMachine\MainMachine_StoreDemo.cs" /> <Compile Include="theMachine\MainMachine_StoreDemo.cs" />
<Compile Include="theMachine\MainMachine _IOMonitor.cs" /> <Compile Include="theMachine\MainMachine _IOMonitor.cs" />
<Compile Include="theMachine\MainMachine _LedProcess.cs" /> <Compile Include="theMachine\MainMachine _LedProcess.cs" />
......
...@@ -189,7 +189,8 @@ namespace DeviceLibrary ...@@ -189,7 +189,8 @@ namespace DeviceLibrary
string bitmapfilename = ""; string bitmapfilename = "";
if (cameraNameList == null || cameraNameList.Count <= 0) if (cameraNameList == null || cameraNameList.Count <= 0)
{ {
throw new Exception("CameraScan方法没有传入相机名称."); return new List<CodeInfo>();
//throw new Exception("CameraScan方法没有传入相机名称.");
} }
try try
...@@ -385,5 +386,122 @@ namespace DeviceLibrary ...@@ -385,5 +386,122 @@ namespace DeviceLibrary
return ""; return "";
} }
} }
static Bitmap bufferBmp = null;
[HandleProcessCorruptedStateExceptions]
public static bool TakePicture(List<string> cameraNameList)
{
if (cameraNameList == null || cameraNameList.Count <= 0)
{
return false;
}
try
{
var cameraName = cameraNameList[0];
int retrytime = 0;
retry:
LogUtil.info($"【" + cameraName + "】开始取图片");
if (cameraName.Trim().Equals(""))
{
return false;
}
DateTime startTime = DateTime.Now;
try
{
_ = Camera._cam.CaptureOnImage(cameraName, out bufferBmp, true);
if (bufferBmp == null)
{
if (retrytime > 2)
return false;
retrytime++;
LoadCamera(true);
LogUtil.info($"bitmap为空重试第{retrytime}次");
Task.Delay(1500).Wait();
goto retry;
}
LogUtil.info(" 【" + cameraName + "】取图片完成:"+(DateTime.Now- startTime).TotalSeconds.ToString());
return true;
}
catch (AccessViolationException e)
{
LogUtil.error(" 扫码出现AccessViolationException异常,关闭相机【" + cameraName + "】:" + e.ToString());
Camera._cam.Close(cameraName);
}
catch (Exception ex)
{
LogUtil.error(" 扫码出错:" + ex.ToString());
}
finally
{
}
}
catch (AccessViolationException e)
{
LogUtil.error(" 扫码出现AccessViolationException异常:" + e.ToString());
//throw new Exception("扫码出现AccessViolationException异常");
// GC.Collect();
}
catch (Exception ex)
{
LogUtil.error(" 扫码出错:" + ex.ToString());
//throw new Exception("扫码出错");
}
return false;
}
[HandleProcessCorruptedStateExceptions]
public static List<CodeInfo> ScanCode()
{
HashSet<string> codestr = new HashSet<string>();
List<CodeInfo> codeList = new List<CodeInfo>();
string bitmapfilename = "";
DateTime startTime = DateTime.Now;
try
{
if (bufferBmp == null) {
LogUtil.error("没有缓存的图像");
return new List<CodeInfo>();
}
string r = "";
RemoteDecodeHelper.RemoteDecodeParam remoteDecodeParam = new RemoteDecodeHelper.RemoteDecodeParam
{
codeTypeList = codeTypeList.ToArray(),
codeCount = QRCodeCount,
timeout = CodeTimeOut
};
List<CodeInfo> cc = new List<CodeInfo>();
cc = RemoteDecodeHelper.DecodeRequest(bufferBmp, remoteDecodeParam);
if (cc != null)
{
lock (codeList)
{
cc.ForEach((c) =>
{
c.CodeStr = CodeManager.ReplaceCode(c.CodeStr);
if (!codestr.Contains(c.CodeStr))
{
codeList.Add(c);
codestr.Add(c.CodeStr);
r += "##" + c.CodeStr;
}
});
}
}
else
{
bitmapfilename = SaveImageToFile("mimo", "", bufferBmp);
}
LogUtil.info(" 扫码完成【" + FormUtil.GetSpanStr(DateTime.Now - startTime) + "】 :" + r);
}
catch (Exception ex)
{
LogUtil.error(" 扫码出错:" + ex.ToString());
}
return codeList;
}
} }
} }
...@@ -41,7 +41,13 @@ namespace DeviceLibrary ...@@ -41,7 +41,13 @@ namespace DeviceLibrary
Resume(); Resume();
LogUtil.info($"{Name},设置{High}=Low"); LogUtil.info($"{Name},设置{High}=Low");
} }
public bool IsHigh {
get => IOManager.IOValue(High).Equals(IO_VALUE.HIGH);
}
public bool IsLow
{
get => IOManager.IOValue(Low).Equals(IO_VALUE.HIGH);
}
public void Pause() public void Pause()
{ {
LogUtil.info($"{Name},停止运行"); LogUtil.info($"{Name},停止运行");
......
...@@ -82,7 +82,7 @@ namespace DeviceLibrary ...@@ -82,7 +82,7 @@ namespace DeviceLibrary
if (!axisBean.IsServeoOn) if (!axisBean.IsServeoOn)
axisBean.Open(true, out string msg); axisBean.Open(true, out string msg);
axisBean.RelMove(len, (double)upspeed); axisBean.RelMove(len, (double)upspeed);
moveInfo.log($"{checkio}"); //moveInfo.log($"{checkio}");
while (!IOManager.IOValue(checkio).Equals(IO_VALUE.HIGH)) while (!IOManager.IOValue(checkio).Equals(IO_VALUE.HIGH))
{ {
Task.Delay(30).Wait(); Task.Delay(30).Wait();
...@@ -101,6 +101,7 @@ namespace DeviceLibrary ...@@ -101,6 +101,7 @@ namespace DeviceLibrary
Task.Delay(100).Wait(); Task.Delay(100).Wait();
axisBean.SuddenStop(); axisBean.SuddenStop();
moveInfo.log($"{axisBean.AxisName},转到位"); moveInfo.log($"{axisBean.AxisName},转到位");
degreeAdd = 0;
return true; return true;
} }
finally finally
...@@ -114,8 +115,8 @@ namespace DeviceLibrary ...@@ -114,8 +115,8 @@ namespace DeviceLibrary
}); });
} }
public Task TurnWork; public Task TurnWork;
public void TurnDegree(int degree) { public Task TurnDegree(int degree) {
TurnWork=Task.Run(()=> return TurnWork=Task.Run(()=>
{ {
if (IOManager.IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW)) if (IOManager.IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW))
...@@ -135,7 +136,7 @@ namespace DeviceLibrary ...@@ -135,7 +136,7 @@ namespace DeviceLibrary
{ {
TurnToEnd(true).Wait(); TurnToEnd(true).Wait();
} }
moveInfo.log($"len:{len}"); //moveInfo.log($"len:{len}");
axisBean.RelMove(len*-1, (double)upspeed); axisBean.RelMove(len*-1, (double)upspeed);
Task.Delay(50).Wait(); Task.Delay(50).Wait();
while (axisBean.IsBusy) { while (axisBean.IsBusy) {
...@@ -216,6 +217,8 @@ namespace DeviceLibrary ...@@ -216,6 +217,8 @@ namespace DeviceLibrary
TurnToEnd(true, true).Wait(); TurnToEnd(true, true).Wait();
TurnToEnd(false, false).Wait(); TurnToEnd(false, false).Wait();
TurnToEnd(true, true).Wait(); TurnToEnd(true, true).Wait();
//TurnToEnd(false, false).Wait();
//TurnDegree(-20).Wait();
RobotManage.mainMachine.CylinderMove(null, IO_Type.Tin_Dock_Rotate_Release, IO_Type.Tin_Dock_Rotate_Clamp, IO_VALUE.LOW); RobotManage.mainMachine.CylinderMove(null, IO_Type.Tin_Dock_Rotate_Release, IO_Type.Tin_Dock_Rotate_Clamp, IO_VALUE.LOW);
while (!IOManager.IOValue(IO_Type.Tin_Dock_Rotate_Release).Equals(IO_VALUE.HIGH)) while (!IOManager.IOValue(IO_Type.Tin_Dock_Rotate_Release).Equals(IO_VALUE.HIGH))
{ {
...@@ -225,9 +228,11 @@ namespace DeviceLibrary ...@@ -225,9 +228,11 @@ namespace DeviceLibrary
TurnToEnd(false).Wait(); TurnToEnd(false).Wait();
}); });
} }
public void TurnRound2()
int degreeAdd = 0;
public Task LockAndTurnDegree(int degree)
{ {
TurnWork = Task.Run(() => return TurnWork = Task.Run(() =>
{ {
if (IOManager.IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW)) if (IOManager.IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW))
...@@ -238,51 +243,49 @@ namespace DeviceLibrary ...@@ -238,51 +243,49 @@ namespace DeviceLibrary
if (!axisBean.IsServeoOn) if (!axisBean.IsServeoOn)
axisBean.Open(true, out string msg); axisBean.Open(true, out string msg);
var len = (int)(StrokeLength / 90 * 45); var len = (int)(StrokeLength / 90 * degree);
if (Math.Abs(degreeAdd + degree) > 90)
{
if (len > 0) if (len > 0)
{ {
TurnToEnd(false).Wait(); TurnToEnd(true).Wait();
}
moveInfo.log($"len:{len}"); }
axisBean.RelMove(len * -1, (double)upspeed); else if (len < 0)
Task.Delay(50).Wait();
while (axisBean.IsBusy)
{ {
Task.Delay(50).Wait(); TurnToEnd(false).Wait();
}
} }
RobotManage.mainMachine.CylinderMove(null, IO_Type.Tin_Dock_Rotate_Release, IO_Type.Tin_Dock_Rotate_Clamp, IO_VALUE.HIGH); RobotManage.mainMachine.CylinderMove(null, IO_Type.Tin_Dock_Rotate_Release, IO_Type.Tin_Dock_Rotate_Clamp, IO_VALUE.HIGH);
while (!IOManager.IOValue(IO_Type.Tin_Dock_Rotate_Clamp).Equals(IO_VALUE.HIGH)) while (!IOManager.IOValue(IO_Type.Tin_Dock_Rotate_Clamp).Equals(IO_VALUE.HIGH))
{ {
Task.Delay(100).Wait(); Task.Delay(30).Wait();
} }
//moveInfo.log($"len:{len}");
axisBean.RelMove(len * -1, (double)upspeed); axisBean.RelMove(len * -1, (double)upspeed);
Task.Delay(50).Wait(); Task.Delay(50).Wait();
while (axisBean.IsBusy) while (axisBean.IsBusy)
{ {
Task.Delay(50).Wait(); Task.Delay(50).Wait();
} }
axisBean.RelMove(len * 2, (double)upspeed); degreeAdd += degree;
Task.Delay(50).Wait(); });
while (axisBean.IsBusy)
{
Task.Delay(50).Wait();
} }
axisBean.RelMove(len * -1, (double)upspeed); public Task UnLock()
Task.Delay(50).Wait();
while (axisBean.IsBusy)
{ {
Task.Delay(50).Wait(); return TurnWork = Task.Run(() =>
}
RobotManage.mainMachine.CylinderMove(null, IO_Type.Tin_Dock_Rotate_Release, IO_Type.Tin_Dock_Rotate_Clamp, IO_VALUE.LOW);
while (!IOManager.IOValue(IO_Type.Tin_Dock_Rotate_Release).Equals(IO_VALUE.HIGH))
{ {
Task.Delay(100).Wait(); if (IOManager.IOValue(IO_Type.SuddenStop_BTN).Equals(IO_VALUE.LOW))
{
moveInfo.log($"急停未解除");
return;
} }
if (!axisBean.IsServeoOn)
axisBean.Open(true, out string msg);
TurnToEnd(false).Wait(); TurnToEnd(false).Wait();
}); });
} }
public void SetWaitResultInfo(MoveInfo moveInfo) public void SetWaitResultInfo(MoveInfo moveInfo)
{ {
......
...@@ -351,26 +351,26 @@ namespace DeviceLibrary ...@@ -351,26 +351,26 @@ namespace DeviceLibrary
if (dataMap.ContainsKey(ParamDefine.openInLock) && dataMap[ParamDefine.openInLock].Equals(ParamDefine.doit)) if (dataMap.ContainsKey(ParamDefine.openInLock) && dataMap[ParamDefine.openInLock].Equals(ParamDefine.doit))
{ {
LogUtil.info(StoreName + "收到服务器命令:openInLock=doit"); LogUtil.info(StoreName + "收到服务器命令:openInLock=doit");
IOManager.IOMove(IO_Type.Entry_Drawer_Lock,IO_VALUE.HIGH); IOManager.IOMove(IO_Type.Entry_Drawer_Lock,IO_VALUE.LOW);
result = ""; result = "";
} }
else if (dataMap.ContainsKey(ParamDefine.closeInLock) && dataMap[ParamDefine.closeInLock].Equals(ParamDefine.doit)) else if (dataMap.ContainsKey(ParamDefine.closeInLock) && dataMap[ParamDefine.closeInLock].Equals(ParamDefine.doit))
{ {
LogUtil.info(StoreName + "收到服务器命令:closeInLock=doit"); LogUtil.info(StoreName + "收到服务器命令:closeInLock=doit");
IOManager.IOMove(IO_Type.Entry_Drawer_Lock, IO_VALUE.LOW); IOManager.IOMove(IO_Type.Entry_Drawer_Lock, IO_VALUE.HIGH);
result = ""; result = "";
} }
if (dataMap.ContainsKey(ParamDefine.openOutLock) && dataMap[ParamDefine.openOutLock].Equals(ParamDefine.doit)) if (dataMap.ContainsKey(ParamDefine.openOutLock) && dataMap[ParamDefine.openOutLock].Equals(ParamDefine.doit))
{ {
LogUtil.info(StoreName + "收到服务器命令:openOutLock=doit"); LogUtil.info(StoreName + "收到服务器命令:openOutLock=doit");
IOManager.IOMove(IO_Type.Out_Drawer_Lock, IO_VALUE.HIGH); IOManager.IOMove(IO_Type.Out_Drawer_Lock, IO_VALUE.LOW);
result = ""; result = "";
} }
else if (dataMap.ContainsKey(ParamDefine.closeOutLock) && dataMap[ParamDefine.closeOutLock].Equals(ParamDefine.doit)) else if (dataMap.ContainsKey(ParamDefine.closeOutLock) && dataMap[ParamDefine.closeOutLock].Equals(ParamDefine.doit))
{ {
LogUtil.info(StoreName + "收到服务器命令:closeOutLock=doit"); LogUtil.info(StoreName + "收到服务器命令:closeOutLock=doit");
IOManager.IOMove(IO_Type.Out_Drawer_Lock, IO_VALUE.LOW); IOManager.IOMove(IO_Type.Out_Drawer_Lock, IO_VALUE.HIGH);
result = ""; result = "";
} }
if (!result.Equals("")) if (!result.Equals(""))
...@@ -406,11 +406,11 @@ namespace DeviceLibrary ...@@ -406,11 +406,11 @@ namespace DeviceLibrary
else if (IOManager.IOValue(IO_Type.Entry_Drawer_Lock).Equals(IO_VALUE.HIGH) else if (IOManager.IOValue(IO_Type.Entry_Drawer_Lock).Equals(IO_VALUE.HIGH)
&& RobotManage.mainMachine.StoreMoveInfo.MoveStep == MoveStep.Wait) && RobotManage.mainMachine.StoreMoveInfo.MoveStep == MoveStep.Wait)
{ {
map[ParamDefine.inDoorStatus] = ParamDefine.open; map[ParamDefine.inDoorStatus] = ParamDefine.close;
}else if (IOManager.IOValue(IO_Type.Entry_Drawer_Lock).Equals(IO_VALUE.LOW) }else if (IOManager.IOValue(IO_Type.Entry_Drawer_Lock).Equals(IO_VALUE.LOW)
&& RobotManage.mainMachine.StoreMoveInfo.MoveStep == MoveStep.Wait) && RobotManage.mainMachine.StoreMoveInfo.MoveStep == MoveStep.Wait)
{ {
map[ParamDefine.inDoorStatus] = ParamDefine.close; map[ParamDefine.inDoorStatus] = ParamDefine.open;
} }
if (IOManager.IOValue(IO_Type.Out_Drawer).Equals(IO_VALUE.LOW)) if (IOManager.IOValue(IO_Type.Out_Drawer).Equals(IO_VALUE.LOW))
{ {
...@@ -419,12 +419,12 @@ namespace DeviceLibrary ...@@ -419,12 +419,12 @@ namespace DeviceLibrary
else if (IOManager.IOValue(IO_Type.Out_Drawer_Lock).Equals(IO_VALUE.HIGH) else if (IOManager.IOValue(IO_Type.Out_Drawer_Lock).Equals(IO_VALUE.HIGH)
&& RobotManage.mainMachine.StoreMoveInfo.MoveStep == MoveStep.Wait) && RobotManage.mainMachine.StoreMoveInfo.MoveStep == MoveStep.Wait)
{ {
map[ParamDefine.outDoorStatus] = ParamDefine.open; map[ParamDefine.outDoorStatus] = ParamDefine.close;
} }
else if (IOManager.IOValue(IO_Type.Out_Drawer_Lock).Equals(IO_VALUE.LOW) else if (IOManager.IOValue(IO_Type.Out_Drawer_Lock).Equals(IO_VALUE.LOW)
&& RobotManage.mainMachine.StoreMoveInfo.MoveStep == MoveStep.Wait) && RobotManage.mainMachine.StoreMoveInfo.MoveStep == MoveStep.Wait)
{ {
map[ParamDefine.outDoorStatus] = ParamDefine.close; map[ParamDefine.outDoorStatus] = ParamDefine.open;
} }
...@@ -652,7 +652,7 @@ namespace DeviceLibrary ...@@ -652,7 +652,7 @@ namespace DeviceLibrary
public string msg { get; set; } public string msg { get; set; }
public Dictionary<string, string> data { get; set; } public Dictionary<string, object> data { get; set; }
} }
/// <summary> /// <summary>
///1=设备联机(正常就绪)(入库后,BOX恢复原始状态)(出库后,移载装置恢复原始状态), ///1=设备联机(正常就绪)(入库后,BOX恢复原始状态)(出库后,移载装置恢复原始状态),
......
...@@ -72,7 +72,7 @@ namespace DeviceLibrary ...@@ -72,7 +72,7 @@ namespace DeviceLibrary
WareCode = "NG"; WareCode = "NG";
To = to.clone(); To = to.clone();
MoveInfo.NewMove(MoveStep.StoreTS20); MoveInfo.NewMove(MoveStep.StoreTS20);
MoveInfo.log($"{storeMoveType}:开始运输料盘,直接到:{to.posid}"); MoveInfo.log($"{storeMoveType}:开始运输物料,直接到:{to.posid}");
MoveInfo.MoveParam.PosID = $"NA=>{To.posid}"; MoveInfo.MoveParam.PosID = $"NA=>{To.posid}";
} }
else else
...@@ -82,7 +82,7 @@ namespace DeviceLibrary ...@@ -82,7 +82,7 @@ namespace DeviceLibrary
To = to.clone(); To = to.clone();
ignoreFixtureCheck = Common.IsNeedIgnoreFixtureCheck(WareCode); ignoreFixtureCheck = Common.IsNeedIgnoreFixtureCheck(WareCode);
MoveInfo.NewMove(MoveStep.StoreTS01); MoveInfo.NewMove(MoveStep.StoreTS01);
MoveInfo.log($"{storeMoveType}:开始运输料盘,从:{from.posid},到:{to.posid},WareCode:{WareCode},ignoreFixtureCheck:{ignoreFixtureCheck}"); MoveInfo.log($"{storeMoveType}:开始运输物料,从:{from.posid},到:{to.posid},WareCode:{WareCode},ignoreFixtureCheck:{ignoreFixtureCheck}");
MoveInfo.MoveParam.PosID = $"{From.posid}=>{To.posid}"; MoveInfo.MoveParam.PosID = $"{From.posid}=>{To.posid}";
MoveInfo.MoveParam.ReelOnFixture = From.Reel.ReelOnFixture; MoveInfo.MoveParam.ReelOnFixture = From.Reel.ReelOnFixture;
...@@ -91,7 +91,7 @@ namespace DeviceLibrary ...@@ -91,7 +91,7 @@ namespace DeviceLibrary
FromCheckOffset = CalcOffset(From.posid); FromCheckOffset = CalcOffset(From.posid);
ToCheckOffset = CalcOffset(To.posid); ToCheckOffset = CalcOffset(To.posid);
MoveInfo.MoveParam.WareCode = WareCode; MoveInfo.MoveParam.WareCode = WareCode;
MoveInfo.log($"确认检查偏移: FromCheckOffset={FromCheckOffset},ToCheckOffset={ToCheckOffset}"); //MoveInfo.log($"确认检查偏移: FromCheckOffset={FromCheckOffset},ToCheckOffset={ToCheckOffset}");
ErrMsgTxt = ""; ErrMsgTxt = "";
return true; return true;
//thread = new Thread(new ThreadStart(Run)); //thread = new Thread(new ThreadStart(Run));
...@@ -112,27 +112,26 @@ namespace DeviceLibrary ...@@ -112,27 +112,26 @@ namespace DeviceLibrary
Msg.add("", MsgLevel.info, ErrInfo.X09_Clear); Msg.add("", MsgLevel.info, ErrInfo.X09_Clear);
IgnoreX09 = false; IgnoreX09 = false;
MoveInfo.NextMoveStep(MoveStep.StoreTS02); MoveInfo.NextMoveStep(MoveStep.StoreTS02);
MoveInfo.log($"{storeMoveType}:检查安全状态"); MoveInfo.log($"{storeMoveType}:开始");
break; break;
case MoveStep.StoreTS02: case MoveStep.StoreTS02:
if (MoveInfo.MoveParam.ReelOnFixture) {
MoveInfo.NextMoveStep(MoveStep.StoreTS08);
MoveInfo.log($"{storeMoveType}:料盘已在料叉上");
}
else
{
MoveInfo.NextMoveStep(MoveStep.StoreTS03); MoveInfo.NextMoveStep(MoveStep.StoreTS03);
if (From.posid != MainMachine.LabelP) if (From.posid != MainMachine.LabelP)
Z_Axis.AbsMove(MoveInfo, Config.Z_Axis_P1, Config.Z_Axis_P1_speed); Z_Axis.AbsMove(MoveInfo, Config.Z_Axis_P1, Config.Z_Axis_P1_speed);
MoveInfo.log($"{storeMoveType}:Z轴返回待机点P1"); //MoveInfo.log($"{storeMoveType}:Z轴返回待机点P1");
}
break; break;
case MoveStep.StoreTS03: case MoveStep.StoreTS03:
if (MoveInfo.MoveParam.ReelOnFixture)
{
MoveInfo.NextMoveStep(MoveStep.StoreTS08);
MoveInfo.log($"{storeMoveType}:物料已在夹爪上");
}else
MoveInfo.NextMoveStep(MoveStep.StoreTS04); MoveInfo.NextMoveStep(MoveStep.StoreTS04);
Y_Axis.AbsMove(MoveInfo, From.Y_Axis_P2 + FromCheckOffset, Config.Y_Axis_P1_speed); Y_Axis.AbsMove(MoveInfo, From.Y_Axis_P2 + FromCheckOffset, Config.Y_Axis_P1_speed);
MoveInfo.log($"{storeMoveType}:Y轴到达取料点偏移点{From.Y_Axis_P2}+{FromCheckOffset}"); //MoveInfo.log($"{storeMoveType}:Y轴到达取料点偏移点");
X_Axis.AbsMove(MoveInfo, From.X_Axis_P2, Config.X_Axis_P1_speed); X_Axis.AbsMove(MoveInfo, From.X_Axis_P2, Config.X_Axis_P1_speed);
MoveInfo.log($"{storeMoveType}:X轴到达取料检测{From.X_Axis_P2}"); MoveInfo.log($"{storeMoveType}:XY轴到达取料检测,X:{From.X_Axis_P2},Y:{From.Y_Axis_P2}+{FromCheckOffset}");
break; break;
case MoveStep.StoreTS04: case MoveStep.StoreTS04:
if (CheckPosStatus(MoveInfo, From.posid)) if (CheckPosStatus(MoveInfo, From.posid))
...@@ -142,7 +141,7 @@ namespace DeviceLibrary ...@@ -142,7 +141,7 @@ namespace DeviceLibrary
if (zp2 < 0) if (zp2 < 0)
zp2 = 0; zp2 = 0;
Z_Axis.AbsMove(MoveInfo, zp2, Config.Z_Axis_P1_speed); Z_Axis.AbsMove(MoveInfo, zp2, Config.Z_Axis_P1_speed);
MoveInfo.log($"{storeMoveType}:Z轴到达取料前点{From.Z_Axis_P2}"); MoveInfo.log($"{storeMoveType}:Z轴到达取料前点,{From.Z_Axis_P2}");
RobotManage.mainMachine.CylinderMove(MoveInfo, IO_Type.Taking_Release, IO_Type.Taking_Clamp, IO_VALUE.LOW); RobotManage.mainMachine.CylinderMove(MoveInfo, IO_Type.Taking_Release, IO_Type.Taking_Clamp, IO_VALUE.LOW);
MoveInfo.log($"{storeMoveType}:松开夹爪"); MoveInfo.log($"{storeMoveType}:松开夹爪");
IgnoreX09 = false; IgnoreX09 = false;
...@@ -160,7 +159,7 @@ namespace DeviceLibrary ...@@ -160,7 +159,7 @@ namespace DeviceLibrary
Msg.add("", MsgLevel.info, ErrInfo.X09_Clear); Msg.add("", MsgLevel.info, ErrInfo.X09_Clear);
IgnoreX09 = false; IgnoreX09 = false;
MoveInfo.NextMoveStep(MoveStep.StoreTS06); MoveInfo.NextMoveStep(MoveStep.StoreTS06);
MoveInfo.log($"{storeMoveType}:检测有料"); MoveInfo.log($"{storeMoveType}:检测有料");
} }
break; break;
case MoveStep.StoreTS06: case MoveStep.StoreTS06:
...@@ -177,7 +176,7 @@ namespace DeviceLibrary ...@@ -177,7 +176,7 @@ namespace DeviceLibrary
case MoveStep.StoreTS08: case MoveStep.StoreTS08:
MoveInfo.NextMoveStep(MoveStep.StoreTS09); MoveInfo.NextMoveStep(MoveStep.StoreTS09);
RobotManage.mainMachine.CylinderMove(MoveInfo, IO_Type.Taking_Release, IO_Type.Taking_Clamp, IO_VALUE.HIGH); RobotManage.mainMachine.CylinderMove(MoveInfo, IO_Type.Taking_Release, IO_Type.Taking_Clamp, IO_VALUE.HIGH);
Setting_Init.Runtime_Posid = To.posid; //Setting_Init.Runtime_Posid = To.posid;
if (storeMoveType== StoreMoveType.InStore && To.posid==MainMachine.LabelP) if (storeMoveType== StoreMoveType.InStore && To.posid==MainMachine.LabelP)
Setting_Init.Runtime_Step = Runtime_StepE.InToLabel; Setting_Init.Runtime_Step = Runtime_StepE.InToLabel;
if (storeMoveType == StoreMoveType.InStore && To.posid != MainMachine.LabelP) if (storeMoveType == StoreMoveType.InStore && To.posid != MainMachine.LabelP)
...@@ -189,6 +188,9 @@ namespace DeviceLibrary ...@@ -189,6 +188,9 @@ namespace DeviceLibrary
break; break;
case MoveStep.StoreTS09: case MoveStep.StoreTS09:
MoveInfo.NextMoveStep(MoveStep.StoreTS10); MoveInfo.NextMoveStep(MoveStep.StoreTS10);
if (From.posid == MainMachine.LabelP && To.posid== MainMachine.RFIDP)
Z_Axis.AbsMove(MoveInfo, To.Z_Axis_P3, Config.Z_Axis_P1_speed);
else
Z_Axis.AbsMove(MoveInfo, Config.Z_Axis_P1, Config.Z_Axis_P1_speed); Z_Axis.AbsMove(MoveInfo, Config.Z_Axis_P1, Config.Z_Axis_P1_speed);
MoveInfo.log($"{storeMoveType}:Z轴到达待机点"); MoveInfo.log($"{storeMoveType}:Z轴到达待机点");
break; break;
...@@ -201,9 +203,8 @@ namespace DeviceLibrary ...@@ -201,9 +203,8 @@ namespace DeviceLibrary
case MoveStep.StoreTS20: case MoveStep.StoreTS20:
MoveInfo.NextMoveStep(MoveStep.StoreTS21); MoveInfo.NextMoveStep(MoveStep.StoreTS21);
Y_Axis.AbsMove(MoveInfo, To.Y_Axis_P2+ ToCheckOffset, Config.Y_Axis_P1_speed); Y_Axis.AbsMove(MoveInfo, To.Y_Axis_P2+ ToCheckOffset, Config.Y_Axis_P1_speed);
MoveInfo.log($"{storeMoveType}:Y轴到达目的地偏移点:{To.Y_Axis_P2}+{ToCheckOffset}");
X_Axis.AbsMove(MoveInfo, To.X_Axis_P2, Config.X_Axis_P1_speed); X_Axis.AbsMove(MoveInfo, To.X_Axis_P2, Config.X_Axis_P1_speed);
MoveInfo.log($"{storeMoveType}:X轴到达目的地检测:{To.X_Axis_P2}"); MoveInfo.log($"{storeMoveType}:XY轴到达目的地检测,X:{To.X_Axis_P2},Y:{To.Y_Axis_P2}+{ToCheckOffset}");
break; break;
case MoveStep.StoreTS21: case MoveStep.StoreTS21:
if (CheckPosStatus(MoveInfo, To.posid)) { if (CheckPosStatus(MoveInfo, To.posid)) {
...@@ -213,6 +214,12 @@ namespace DeviceLibrary ...@@ -213,6 +214,12 @@ namespace DeviceLibrary
case MoveStep.StoreTS22: case MoveStep.StoreTS22:
MoveInfo.NextMoveStep(MoveStep.StoreTS23); MoveInfo.NextMoveStep(MoveStep.StoreTS23);
MoveInfo.log($"{storeMoveType}:Z轴到达入库前点"); MoveInfo.log($"{storeMoveType}:Z轴到达入库前点");
if (From.posid == MainMachine.LabelP && To.posid == MainMachine.RFIDP)
{
MoveInfo.NextMoveStep(MoveStep.StoreTS29);
MoveInfo.log("LabelP=>RFIDP 直接结束");
}
else
{ {
var zp2 = To.Z_Axis_P3 - 205000; var zp2 = To.Z_Axis_P3 - 205000;
if (zp2 < 0) if (zp2 < 0)
...@@ -288,7 +295,7 @@ namespace DeviceLibrary ...@@ -288,7 +295,7 @@ namespace DeviceLibrary
break; break;
case MoveStep.StoreTS29: case MoveStep.StoreTS29:
MoveInfo.log($"{storeMoveType}:转移料盘完成"); MoveInfo.log($"{storeMoveType}:转移物料完成");
MoveInfo.EndMove(); MoveInfo.EndMove();
ErrMsgTxt = ""; ErrMsgTxt = "";
To.posid = ""; To.posid = "";
...@@ -351,21 +358,36 @@ namespace DeviceLibrary ...@@ -351,21 +358,36 @@ namespace DeviceLibrary
} }
else if (Regex.IsMatch(posid,"^S[A-G]")) else if (Regex.IsMatch(posid,"^S[A-G]"))
{ {
if (RobotManage.mainMachine.TPMove.IsLow)
return true;
else
{
RobotManage.mainMachine.TPMove.ToLow(moveInfo); RobotManage.mainMachine.TPMove.ToLow(moveInfo);
moveInfo.log($"{posid},上层库位移至左侧"); moveInfo.log($"{posid},上层库位移至左侧");
return true; return false;
}
} }
else if (Regex.IsMatch(posid, "^S[H-N][1-6]$")) else if (Regex.IsMatch(posid, "^S[H-N][1-6]$"))
{ {
if (RobotManage.mainMachine.TPMove.IsHigh)
return true;
else
{
RobotManage.mainMachine.TPMove.ToHigh(moveInfo); RobotManage.mainMachine.TPMove.ToHigh(moveInfo);
moveInfo.log($"{posid},上层库位移至右侧"); moveInfo.log($"{posid},上层库位移至右侧");
return true; return false;
}
} }
else if (Regex.IsMatch(posid, "^S[H-N]([7-9]|\\d{2})$")) else if (Regex.IsMatch(posid, "^S[H-N]([7-9]|\\d{2})$"))
{ {
if (RobotManage.mainMachine.TPMove.IsLow)
return true;
else
{
RobotManage.mainMachine.TPMove.ToLow(moveInfo); RobotManage.mainMachine.TPMove.ToLow(moveInfo);
moveInfo.log($"{posid},上层库位移至左侧"); moveInfo.log($"{posid},上层库位移至左侧");
return true; return false;
}
} }
else { else {
//moveInfo.log($"{posid},未知库位"); //moveInfo.log($"{posid},未知库位");
......
...@@ -123,10 +123,8 @@ namespace DeviceLibrary ...@@ -123,10 +123,8 @@ namespace DeviceLibrary
} }
} }
static List<int> TestStorePoint(Bitmap bmp, TestStorePointPort tp) public static List<int> TestStorePoint(Bitmap bmp, TestStorePointPort tp)
{ {
if (bmp == null)
return new List<int>();
//TestStorePointEvent?.Invoke(tp, bmp); //TestStorePointEvent?.Invoke(tp, bmp);
...@@ -137,6 +135,8 @@ namespace DeviceLibrary ...@@ -137,6 +135,8 @@ namespace DeviceLibrary
} }
List<Point> points = CameraData[Name].ObjectPoint; List<Point> points = CameraData[Name].ObjectPoint;
if (bmp == null)
return new List<int>(points.Count);
List<int> haslist = new List<int>(); List<int> haslist = new List<int>();
var bd = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly, bmp.PixelFormat); var bd = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.ReadOnly, bmp.PixelFormat);
...@@ -148,9 +148,9 @@ namespace DeviceLibrary ...@@ -148,9 +148,9 @@ namespace DeviceLibrary
p.X = p.X - 8; p.X = p.X - 8;
p.Y = p.Y - 8; p.Y = p.Y - 8;
var cl = new List<ColorHSV>(); var cl = new List<ColorHSV>();
for (int j = 0; j < 16; j++) for (int j = 0; j < 32; j++)
{ {
for (int k = 0; k < 16; k++) for (int k = 0; k < 32; k++)
{ {
var x = p.X + j; var x = p.X + j;
var y = p.Y + k; var y = p.Y + k;
...@@ -257,11 +257,11 @@ namespace DeviceLibrary ...@@ -257,11 +257,11 @@ namespace DeviceLibrary
int errlinecount = 0; int errlinecount = 0;
try { try {
for (int i = 0; i < height; i++) for (int i = 0; i < height; i=i+2)
{ {
int linecount = 0; int linecount = 0;
for (int j = 0; j < width; j++) for (int j = 0; j < width; j=j+3)
{ {
var x = Start.X+ j; var x = Start.X+ j;
var y = Start.Y + height - i; var y = Start.Y + height - i;
...@@ -281,7 +281,7 @@ namespace DeviceLibrary ...@@ -281,7 +281,7 @@ namespace DeviceLibrary
Marshal.WriteByte(bd.Scan0, addr, 0); Marshal.WriteByte(bd.Scan0, addr, 0);
} }
} }
if (linecount < width * 0.6) if (linecount*3 < width * 0.6)
{ {
errlinecount++; errlinecount++;
HeightCount = 0; HeightCount = 0;
...@@ -293,7 +293,7 @@ namespace DeviceLibrary ...@@ -293,7 +293,7 @@ namespace DeviceLibrary
} }
else { else {
HeightCount++; HeightCount++;
if (HeightCount > 50) { if (HeightCount*2 > 50) {
return true; return true;
} }
} }
......
...@@ -14,9 +14,34 @@ namespace DeviceLibrary ...@@ -14,9 +14,34 @@ namespace DeviceLibrary
{ {
partial class MainMachine partial class MainMachine
{ {
bool MaterialDoorOpen = false; public bool LeftDoorOpen = false;
public bool RightDoorOpen = false;
public bool PrintDoorOpen = false;
void ioMonitor() void ioMonitor()
{ {
//if (!PrintDoorOpen && IOValue(IO_Type.PrinterDoor_Check).Equals(IO_VALUE.HIGH))
//{
// IOMove(IO_Type.PrinterDoor_Lock, IO_VALUE.HIGH);
//}
//else
//{
// PrintDoorOpen = false;
//}
//if (!LeftDoorOpen && IOValue(IO_Type.LeftDoor_Check).Equals(IO_VALUE.LOW))
//{
// IOMove(IO_Type.LeftDoor_Lock, IO_VALUE.HIGH);
//}
//else {
// LeftDoorOpen = false;
//}
//if (!RightDoorOpen && IOValue(IO_Type.RightDoor_Check).Equals(IO_VALUE.LOW))
//{
// IOMove(IO_Type.RightDoor_Lock, IO_VALUE.HIGH);
//}
//else
//{
// RightDoorOpen = false;
//}
if (IOValue(IO_Type.Airpressure_Check).Equals(IO_VALUE.LOW)) { if (IOValue(IO_Type.Airpressure_Check).Equals(IO_VALUE.LOW)) {
Msg.add(crc.GetString("Res0079","未检测到气压信号."), MsgLevel.warning); Msg.add(crc.GetString("Res0079","未检测到气压信号."), MsgLevel.warning);
} }
......
...@@ -18,6 +18,7 @@ namespace DeviceLibrary ...@@ -18,6 +18,7 @@ namespace DeviceLibrary
{ {
Led AlarmLed; Led AlarmLed;
Led StandbyLed; Led StandbyLed;
Led RunningLed;
public Dictionary<MachineLedStateE, Dictionary<LedColor, LedState>> MachineLedState = new Dictionary<MachineLedStateE, Dictionary<LedColor, LedState>>(); public Dictionary<MachineLedStateE, Dictionary<LedColor, LedState>> MachineLedState = new Dictionary<MachineLedStateE, Dictionary<LedColor, LedState>>();
public Dictionary<MachineLedStateE, string> MachineLedStateName = new Dictionary<MachineLedStateE, string>(); public Dictionary<MachineLedStateE, string> MachineLedStateName = new Dictionary<MachineLedStateE, string>();
...@@ -82,11 +83,11 @@ namespace DeviceLibrary ...@@ -82,11 +83,11 @@ namespace DeviceLibrary
MachineLedStateName[MachineLedStateE.SystemPause] = crc.GetString("Res0084","暂停"); MachineLedStateName[MachineLedStateE.SystemPause] = crc.GetString("Res0084","暂停");
MachineLedState.Add(MachineLedStateE.SystemPause, nls(LedState.blink, LedState.off, LedState.blink)); MachineLedState.Add(MachineLedStateE.SystemPause, nls(LedState.blink, LedState.off, LedState.blink));
//温湿度超限30分钟. 红闪,黄闪 //温湿度超限30分钟. 红闪,黄闪
MachineLedStateName[MachineLedStateE.THoutRangeOver30m] = crc.GetString("Res0085","温湿度超限30分钟"); //MachineLedStateName[MachineLedStateE.THoutRangeOver30m] = crc.GetString("Res0085","温湿度超限30分钟");
MachineLedState.Add(MachineLedStateE.THoutRangeOver30m, nls(LedState.blink, LedState.blink, LedState.none)); //MachineLedState.Add(MachineLedStateE.THoutRangeOver30m, nls(LedState.blink, LedState.blink, LedState.none));
//温湿度超限 绿闪黄闪 //温湿度超限 绿闪黄闪
MachineLedStateName[MachineLedStateE.THoutRange] = crc.GetString("Res0086","温湿度超限"); //MachineLedStateName[MachineLedStateE.THoutRange] = crc.GetString("Res0086","温湿度超限");
MachineLedState.Add(MachineLedStateE.THoutRange, nls(LedState.none, LedState.blink, LedState.blink)); //MachineLedState.Add(MachineLedStateE.THoutRange, nls(LedState.none, LedState.blink, LedState.blink));
//进出库, 绿亮,黄闪 //进出库, 绿亮,黄闪
MachineLedStateName[MachineLedStateE.InOut] = crc.GetString("Res0087","出入库中"); MachineLedStateName[MachineLedStateE.InOut] = crc.GetString("Res0087","出入库中");
MachineLedState.Add(MachineLedStateE.InOut, nls(LedState.none, LedState.blink, LedState.on)); MachineLedState.Add(MachineLedStateE.InOut, nls(LedState.none, LedState.blink, LedState.on));
...@@ -111,7 +112,7 @@ namespace DeviceLibrary ...@@ -111,7 +112,7 @@ namespace DeviceLibrary
foreach (var ledcolor in ledcfg.Keys) foreach (var ledcolor in ledcfg.Keys)
{ {
if (!Led.LedColors.ContainsKey(ledcolor) || ledcfg[ledcolor] == LedState.none) if (!Led.LedColors.ContainsKey(ledcolor) || ledcfg[ledcolor] == LedState.none)
return; continue;
Led.LedColors[ledcolor].LedState = ledcfg[ledcolor]; Led.LedColors[ledcolor].LedState = ledcfg[ledcolor];
} }
} }
...@@ -137,22 +138,6 @@ namespace DeviceLibrary ...@@ -137,22 +138,6 @@ namespace DeviceLibrary
//StandbyLed.LedState = LedState.blink; //StandbyLed.LedState = LedState.blink;
ProcessLefCfg(MachineLedStateE.InOut); ProcessLefCfg(MachineLedStateE.InOut);
} }
//温度超限 绿亮 黄闪
if (IsTHoutRange())
{
//RunningLed.LedState = LedState.on;
//StandbyLed.LedState = LedState.blink;
ProcessLefCfg(MachineLedStateE.THoutRange);
}
//温度超限30分钟 绿亮 黄闪 红闪
if (IsTHoutRangeOver30m())
{
//RunningLed.LedState = LedState.on;
//StandbyLed.LedState = LedState.blink;
//AlarmLed.LedState = LedState.blink;
ProcessLefCfg(MachineLedStateE.THoutRangeOver30m);
}
//系统暂停,说明书未定义, 绿闪, 红闪 //系统暂停,说明书未定义, 绿闪, 红闪
if (!canRunning || UserPause) if (!canRunning || UserPause)
{ {
......
using CodeLibrary;
using OnlineStore;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
namespace DeviceLibrary
{
partial class MainMachine
{
List<string> DemoTestList;
int DemoTestIndex = 0;
int DemoTestCount = 0;
void TFIDSelfTestProcess()
{
if (CheckWait(StoreMoveInfo))
return;
//常规上料扫码流程
switch (StoreMoveInfo.MoveStep)
{
case MoveStep.Wait:
break;
case MoveStep.StoreIn01:
DemoTestList = CameraPointTest.GetThingStoreName(TestStorePointPort.上层左侧);
if (DemoTestList.Count == 0)
return;
DemoTestIndex = 0;
break;
case MoveStep.StoreOut10:
if (IOValue(IO_Type.Out_Drawer).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.Out_Drawer_Lock).Equals(IO_VALUE.HIGH))
{
StoreMoveInfo.NextMoveStep(MoveStep.StoreOut11);
}
else if (IOValue(IO_Type.Out_Drawer).Equals(IO_VALUE.LOW) && IOValue(IO_Type.Out_Drawer_Lock).Equals(IO_VALUE.HIGH))
{
IOMove(IO_Type.Out_Drawer_Lock, IO_VALUE.LOW);
}
else if (IOValue(IO_Type.Out_Drawer).Equals(IO_VALUE.LOW))
{
Msg.add("出库任务正在执行,请关好抽屉", MsgLevel.warning);
}
else {
IOMove(IO_Type.Out_Drawer_Lock, IO_VALUE.HIGH);
}
break;
case MoveStep.StoreOut11:
StoreMoveInfo.NextMoveStep(MoveStep.StoreOut12);
var from = CSVPositionReader<ACStorePosition>.GetPositon(DemoTestList[DemoTestIndex]);
var to = CSVPositionReader<ACStorePosition>.GetPositon(RFIDP);
boxTransport.Start(new BoxStorePosition(Config, from, StoreMoveInfo.MoveParam), new BoxStorePosition(Config, to, StoreMoveInfo.MoveParam), StoreMoveType.OutStore, true);
StoreMoveInfo.log($"开始转运出库");
break;
case MoveStep.StoreOut12:
if (boxTransport.IsComplateOrFree)
{
bool issame = false;
string ds="";
for (int i = 0; i < 15; i++)
{
if (RobotManage.RFID.ReadEPC(12, out byte[] data))
{
if (data[0] != 0xFF)
{
ds = Encoding.ASCII.GetString(data).Trim();
if (StoreMoveInfo.MoveParam.WareCode.IndexOf(ds)>-1)
{
StoreMoveInfo.MoveParam.RFID = ds;
StoreMoveInfo.log("读取到 RFID:" + ds + " , "+ RobotManage.RFID.HexBuff(data));
issame = true;
break;
}
}
}
Thread.Sleep(200);
}
if (!issame)
{
//StoreMoveInfo.log("读取到 RFID:" + ds);
//Msg.add("读取到的RFID与物料信息不符:" + ds, MsgLevel.alarm);
//RobotManage.UserPause("读取到的RFID与物料信息不符");
}
StoreMoveInfo.NextMoveStep(MoveStep.StoreOut13);
from = CSVPositionReader<ACStorePosition>.GetPositon(RFIDP);
to = CSVPositionReader<ACStorePosition>.GetPositon(DemoTestList[DemoTestIndex]);
StoreMoveInfo.MoveParam.ReelOnFixture = true;
boxTransport.Start(new BoxStorePosition(Config, from, StoreMoveInfo.MoveParam), new BoxStorePosition(Config, to, StoreMoveInfo.MoveParam), StoreMoveType.OutStore, true);
StoreMoveInfo.log($"开始转运出库");
}
break;
case MoveStep.StoreOut13:
if (boxTransport.IsComplateOrFree)
{
StoreMoveInfo.NextMoveStep(MoveStep.StoreOut11);
DemoTestIndex++;
if (DemoTestIndex >= DemoTestList.Count)
DemoTestIndex = 0;
DemoTestCount++;
}
break;
default:
StoreMoveInfo.log($"未找到对应步骤:{StoreMoveInfo.MoveStep}");
break;
}
}
}
}
\ No newline at end of file \ No newline at end of file
...@@ -61,6 +61,7 @@ namespace DeviceLibrary ...@@ -61,6 +61,7 @@ namespace DeviceLibrary
StoreIn08, StoreIn08,
StoreIn09, StoreIn09,
StoreOut10, //出库 StoreOut10, //出库
StoreOut10_1,
StoreOut_NGPre, StoreOut_NGPre,
StoreOut11, StoreOut11,
StoreOut12, StoreOut12,
...@@ -114,6 +115,7 @@ namespace DeviceLibrary ...@@ -114,6 +115,7 @@ namespace DeviceLibrary
Labeling02, Labeling02,
Labeling03, Labeling03,
Labeling04, Labeling04,
Labeling04a,
Labeling05, Labeling05,
Labeling06, Labeling06,
Labeling07, Labeling07,
......
...@@ -44,6 +44,8 @@ namespace TheMachine ...@@ -44,6 +44,8 @@ namespace TheMachine
this.tabc = new System.Windows.Forms.TabControl(); this.tabc = new System.Windows.Forms.TabControl();
this.tabP1 = new System.Windows.Forms.TabPage(); this.tabP1 = new System.Windows.Forms.TabPage();
this.pnl = new System.Windows.Forms.Panel(); this.pnl = new System.Windows.Forms.Panel();
this.btn_rightsafedoorunlock = new System.Windows.Forms.Button();
this.btn_leftsafedoorunlock = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button(); this.button3 = new System.Windows.Forms.Button();
this.button4 = new System.Windows.Forms.Button(); this.button4 = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button(); this.button1 = new System.Windows.Forms.Button();
...@@ -52,7 +54,6 @@ namespace TheMachine ...@@ -52,7 +54,6 @@ namespace TheMachine
this.stateView = new System.Windows.Forms.ListView(); this.stateView = new System.Windows.Forms.ListView();
this.cb_IgnoreSafecheck = new System.Windows.Forms.CheckBox(); this.cb_IgnoreSafecheck = new System.Windows.Forms.CheckBox();
this.pictureBox2 = new System.Windows.Forms.PictureBox(); this.pictureBox2 = new System.Windows.Forms.PictureBox();
this.cb_IgnoreGratingSignal = new System.Windows.Forms.CheckBox();
this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.cb_EnableBuzzer = new System.Windows.Forms.CheckBox(); this.cb_EnableBuzzer = new System.Windows.Forms.CheckBox();
this.btn_IgnoreX09 = new System.Windows.Forms.Button(); this.btn_IgnoreX09 = new System.Windows.Forms.Button();
...@@ -60,6 +61,7 @@ namespace TheMachine ...@@ -60,6 +61,7 @@ namespace TheMachine
this.listView1 = new System.Windows.Forms.ListView(); this.listView1 = new System.Windows.Forms.ListView();
this.btn_stop = new System.Windows.Forms.Button(); this.btn_stop = new System.Windows.Forms.Button();
this.btn_run = new System.Windows.Forms.Button(); this.btn_run = new System.Windows.Forms.Button();
this.btn_printsafedoorunlock = new System.Windows.Forms.Button();
this.menuStrip1.SuspendLayout(); this.menuStrip1.SuspendLayout();
this.tabc.SuspendLayout(); this.tabc.SuspendLayout();
this.tabP1.SuspendLayout(); this.tabP1.SuspendLayout();
...@@ -197,6 +199,9 @@ namespace TheMachine ...@@ -197,6 +199,9 @@ namespace TheMachine
// //
// pnl // pnl
// //
this.pnl.Controls.Add(this.btn_printsafedoorunlock);
this.pnl.Controls.Add(this.btn_rightsafedoorunlock);
this.pnl.Controls.Add(this.btn_leftsafedoorunlock);
this.pnl.Controls.Add(this.button3); this.pnl.Controls.Add(this.button3);
this.pnl.Controls.Add(this.button4); this.pnl.Controls.Add(this.button4);
this.pnl.Controls.Add(this.button1); this.pnl.Controls.Add(this.button1);
...@@ -204,7 +209,6 @@ namespace TheMachine ...@@ -204,7 +209,6 @@ namespace TheMachine
this.pnl.Controls.Add(this.groupBox1); this.pnl.Controls.Add(this.groupBox1);
this.pnl.Controls.Add(this.cb_IgnoreSafecheck); this.pnl.Controls.Add(this.cb_IgnoreSafecheck);
this.pnl.Controls.Add(this.pictureBox2); this.pnl.Controls.Add(this.pictureBox2);
this.pnl.Controls.Add(this.cb_IgnoreGratingSignal);
this.pnl.Controls.Add(this.pictureBox1); this.pnl.Controls.Add(this.pictureBox1);
this.pnl.Controls.Add(this.cb_EnableBuzzer); this.pnl.Controls.Add(this.cb_EnableBuzzer);
this.pnl.Controls.Add(this.btn_IgnoreX09); this.pnl.Controls.Add(this.btn_IgnoreX09);
...@@ -215,6 +219,30 @@ namespace TheMachine ...@@ -215,6 +219,30 @@ namespace TheMachine
this.pnl.Size = new System.Drawing.Size(1000, 576); this.pnl.Size = new System.Drawing.Size(1000, 576);
this.pnl.TabIndex = 273; this.pnl.TabIndex = 273;
// //
// btn_rightsafedoorunlock
//
this.btn_rightsafedoorunlock.BackColor = System.Drawing.Color.White;
this.btn_rightsafedoorunlock.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_rightsafedoorunlock.Location = new System.Drawing.Point(808, 332);
this.btn_rightsafedoorunlock.Name = "btn_rightsafedoorunlock";
this.btn_rightsafedoorunlock.Size = new System.Drawing.Size(139, 56);
this.btn_rightsafedoorunlock.TabIndex = 275;
this.btn_rightsafedoorunlock.Text = "右侧防护门解锁";
this.btn_rightsafedoorunlock.UseVisualStyleBackColor = false;
this.btn_rightsafedoorunlock.Click += new System.EventHandler(this.button2_Click_1);
//
// btn_leftsafedoorunlock
//
this.btn_leftsafedoorunlock.BackColor = System.Drawing.Color.White;
this.btn_leftsafedoorunlock.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_leftsafedoorunlock.Location = new System.Drawing.Point(808, 271);
this.btn_leftsafedoorunlock.Name = "btn_leftsafedoorunlock";
this.btn_leftsafedoorunlock.Size = new System.Drawing.Size(139, 55);
this.btn_leftsafedoorunlock.TabIndex = 276;
this.btn_leftsafedoorunlock.Text = "左侧防护门解锁";
this.btn_leftsafedoorunlock.UseVisualStyleBackColor = false;
this.btn_leftsafedoorunlock.Click += new System.EventHandler(this.button5_Click_1);
//
// button3 // button3
// //
this.button3.BackColor = System.Drawing.Color.White; this.button3.BackColor = System.Drawing.Color.White;
...@@ -312,18 +340,6 @@ namespace TheMachine ...@@ -312,18 +340,6 @@ namespace TheMachine
this.pictureBox2.DoubleClick += new System.EventHandler(this.pictureBox1_DoubleClick); this.pictureBox2.DoubleClick += new System.EventHandler(this.pictureBox1_DoubleClick);
this.pictureBox2.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseDown); this.pictureBox2.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseDown);
// //
// cb_IgnoreGratingSignal
//
this.cb_IgnoreGratingSignal.AutoSize = true;
this.cb_IgnoreGratingSignal.Location = new System.Drawing.Point(607, 78);
this.cb_IgnoreGratingSignal.Name = "cb_IgnoreGratingSignal";
this.cb_IgnoreGratingSignal.Size = new System.Drawing.Size(125, 25);
this.cb_IgnoreGratingSignal.TabIndex = 2;
this.cb_IgnoreGratingSignal.Text = "忽略安全光栅";
this.cb_IgnoreGratingSignal.UseVisualStyleBackColor = true;
this.cb_IgnoreGratingSignal.Visible = false;
this.cb_IgnoreGratingSignal.CheckedChanged += new System.EventHandler(this.cb_IgnoreGratingSignal_CheckedChanged);
//
// pictureBox1 // pictureBox1
// //
this.pictureBox1.BackColor = System.Drawing.Color.Gainsboro; this.pictureBox1.BackColor = System.Drawing.Color.Gainsboro;
...@@ -411,6 +427,18 @@ namespace TheMachine ...@@ -411,6 +427,18 @@ namespace TheMachine
this.btn_run.UseVisualStyleBackColor = true; this.btn_run.UseVisualStyleBackColor = true;
this.btn_run.Click += new System.EventHandler(this.btn_run_Click); this.btn_run.Click += new System.EventHandler(this.btn_run_Click);
// //
// btn_printsafedoorunlock
//
this.btn_printsafedoorunlock.BackColor = System.Drawing.Color.White;
this.btn_printsafedoorunlock.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_printsafedoorunlock.Location = new System.Drawing.Point(808, 394);
this.btn_printsafedoorunlock.Name = "btn_printsafedoorunlock";
this.btn_printsafedoorunlock.Size = new System.Drawing.Size(139, 56);
this.btn_printsafedoorunlock.TabIndex = 277;
this.btn_printsafedoorunlock.Text = "打印维护门解锁";
this.btn_printsafedoorunlock.UseVisualStyleBackColor = false;
this.btn_printsafedoorunlock.Click += new System.EventHandler(this.button2_Click_2);
//
// Form1 // Form1
// //
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
...@@ -457,7 +485,6 @@ namespace TheMachine ...@@ -457,7 +485,6 @@ namespace TheMachine
private System.Windows.Forms.ListView stateView; private System.Windows.Forms.ListView stateView;
private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.CheckBox cb_IgnoreSafecheck; private System.Windows.Forms.CheckBox cb_IgnoreSafecheck;
private System.Windows.Forms.CheckBox cb_IgnoreGratingSignal;
private System.Windows.Forms.ToolStripMenuItem 二维码识别调试ToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem 二维码识别调试ToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripMenuItem 关于ToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem 关于ToolStripMenuItem;
...@@ -475,6 +502,9 @@ namespace TheMachine ...@@ -475,6 +502,9 @@ namespace TheMachine
private System.Windows.Forms.Button btn_entrylock; private System.Windows.Forms.Button btn_entrylock;
private System.Windows.Forms.Button button3; private System.Windows.Forms.Button button3;
private System.Windows.Forms.Button button4; private System.Windows.Forms.Button button4;
private System.Windows.Forms.Button btn_rightsafedoorunlock;
private System.Windows.Forms.Button btn_leftsafedoorunlock;
private System.Windows.Forms.Button btn_printsafedoorunlock;
} }
} }
...@@ -265,13 +265,13 @@ namespace TheMachine ...@@ -265,13 +265,13 @@ namespace TheMachine
//RobotManage.Config = (Robot_Config)CSVConfigReader.LoadConfig(RobotManage.Config); //RobotManage.Config = (Robot_Config)CSVConfigReader.LoadConfig(RobotManage.Config);
addTablePage(); addTablePage();
RobotManage.LoadDebug(); RobotManage.LoadDebug();
cb_IgnoreGratingSignal.Visible = true; //cb_IgnoreGratingSignal.Visible = true;
cb_IgnoreSafecheck.Visible = true; cb_IgnoreSafecheck.Visible = true;
} }
else else
{ {
cb_IgnoreGratingSignal.Checked = false; //cb_IgnoreGratingSignal.Checked = false;
cb_IgnoreGratingSignal.Visible = false; //cb_IgnoreGratingSignal.Visible = false;
cb_IgnoreSafecheck.Checked = false; cb_IgnoreSafecheck.Checked = false;
cb_IgnoreSafecheck.Visible = false; cb_IgnoreSafecheck.Visible = false;
var tc = tabc.TabPages.Count; var tc = tabc.TabPages.Count;
...@@ -701,5 +701,23 @@ namespace TheMachine ...@@ -701,5 +701,23 @@ namespace TheMachine
{ {
IOManager.IOMove(IO_Type.Out_Drawer_Lock, IO_VALUE.LOW); IOManager.IOMove(IO_Type.Out_Drawer_Lock, IO_VALUE.LOW);
} }
private void button5_Click_1(object sender, EventArgs e)
{
IOManager.IOMove(IO_Type.LeftDoor_Lock, IO_VALUE.LOW);
RobotManage.mainMachine.LeftDoorOpen = true;
}
private void button2_Click_1(object sender, EventArgs e)
{
IOManager.IOMove(IO_Type.RightDoor_Lock, IO_VALUE.LOW);
RobotManage.mainMachine.RightDoorOpen = true;
}
private void button2_Click_2(object sender, EventArgs e)
{
IOManager.IOMove(IO_Type.PrinterDoor_Lock, IO_VALUE.LOW);
RobotManage.mainMachine.PrintDoorOpen = true;
}
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -25,11 +25,12 @@ namespace TheMachine ...@@ -25,11 +25,12 @@ namespace TheMachine
static void Main() static void Main()
{ {
CameraPointTest.Init(); CameraPointTest.Init();
//CameraPointTest.ScanRectangle(); //CameraPointTest.ScanRectangle();
//var bmpfile = @"D:\rick\vs\SO20031_TinStorage\料架照片\106_监控点1_106_20221125194616_31932401.bmp"; //var bmpfile = @"D:\rick\vs\SO20031_TinStorage\TheMachine\bin\Debug\test.bmp";
//var bmp = new Bitmap(bmpfile); //var bmp = new Bitmap(bmpfile);
//var r = Common.CalcStoreBMP(bmp,4, 5); //var r = CameraPointTest.TestStorePoint(bmp, TestStorePointPort.入口);
//var l= Common.TestStorePoint(bmp, r);
_ = new Mutex(true, Application.ProductName, out bool ret); _ = new Mutex(true, Application.ProductName, out bool ret);
if (!ret) if (!ret)
{ {
......
...@@ -137,7 +137,9 @@ namespace TheMachine ...@@ -137,7 +137,9 @@ namespace TheMachine
private void btn_labeledit_Click(object sender, EventArgs e) private void btn_labeledit_Click(object sender, EventArgs e)
{ {
RobotManage.printerHelper.EditLabel(); PrintLabel.FrmLabel frmLabel = new PrintLabel.FrmLabel();
crc.LanguageProcess(frmLabel, "FrmLabel");
frmLabel.ShowDialog();
loadlabellist(); loadlabellist();
} }
void loadlabellist() void loadlabellist()
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!