Commit fa509bfd 张东亮

存储机构调试

1 个父辈 583fca65
正在显示 62 个修改的文件 包含 555 行增加246 行删除
此文件类型无法预览
此文件类型无法预览
{
"CodeOrder": "HalconOnly",
"Halcon": {
"CodeType": "All",
"Zoom1DCode": 1.5,
"Zoom2DCode": 1.5
},
"EyemLib": {
"CodeType": "All",
"BlockSize": 11,
"RangeC": 5,
"SymbolMin": 128,
"SymbolMax": 215
},
"Region": {
"monitor": {
"Aplan": [{
"RegionName": "one",
"X": 133,
"Y": 167,
"Width": 396,
"Height": 456,
"Ratio": 0.5
}, {
"RegionName": "two",
"X": 555,
"Y": 170,
"Width": 390,
"Height": 450,
"Ratio": 0.6
}],
"Bplan": [{
"RegionName": "one",
"X": 927,
"Y": 278,
"Width": 396,
"Height": 456,
"Ratio": 0.5
}, {
"RegionName": "two",
"X": 1353,
"Y": 276,
"Width": 396,
"Height": 456,
"Ratio": 0.5
}],
"C计划": [{
"RegionName": "name1",
"X": 940,
"Y": 320,
"Width": 410,
"Height": 410,
"Ratio": 0.4
}]
},
"monitor2": {
"key1": [{
"RegionName": "one",
"X": 967,
"Y": 288,
"Width": 396,
"Height": 456,
"Ratio": 0.5
}]
}
},
"HIKIPCamera": [{
"Name": "monitor",
"IP": "192.168.10.64",
"User": "admin",
"Password": "qwert2asdfg",
"Port": 8000
}]
}
\ No newline at end of file \ No newline at end of file
此文件太大,无法显示。
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
{
"CodeOrder": "HalconOnly",
"Halcon": {
"CodeType": "All",
"Zoom1DCode": 1.5,
"Zoom2DCode": 1.5
},
"EyemLib": {
"CodeType": "All",
"BlockSize": 11,
"RangeC": 5,
"SymbolMin": 128,
"SymbolMax": 215
},
"Region": {
"monitor": {
"Aplan": [{
"RegionName": "one",
"X": 133,
"Y": 167,
"Width": 396,
"Height": 456,
"Ratio": 0.5
}, {
"RegionName": "two",
"X": 555,
"Y": 170,
"Width": 390,
"Height": 450,
"Ratio": 0.6
}],
"Bplan": [{
"RegionName": "one",
"X": 927,
"Y": 278,
"Width": 396,
"Height": 456,
"Ratio": 0.5
}, {
"RegionName": "two",
"X": 1353,
"Y": 276,
"Width": 396,
"Height": 456,
"Ratio": 0.5
}],
"C计划": [{
"RegionName": "name1",
"X": 940,
"Y": 320,
"Width": 410,
"Height": 410,
"Ratio": 0.4
}]
},
"monitor2": {
"key1": [{
"RegionName": "one",
"X": 967,
"Y": 288,
"Width": 396,
"Height": 456,
"Ratio": 0.5
}]
}
},
"HIKIPCamera": [ {
"Name": "box_A",
"IP": "192.168.107.21",
"User": "admin",
"Pwd": "Acc123",
"Port": "8000"
},
{
"Name": "box_B",
"IP": "192.168.108.22",
"User": "admin",
"Pwd": "Acc123",
"Port": "8000"
}
]
}
\ No newline at end of file \ No newline at end of file
...@@ -23,6 +23,7 @@ PRO,0,抽屉列数,Drawer_Columns,6,,,,,,,,,,,, ...@@ -23,6 +23,7 @@ PRO,0,抽屉列数,Drawer_Columns,6,,,,,,,,,,,,
,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,
PRO,0,行走机构_待机点P1,MoveAxis_P1,100,,,,,,,,,,,, PRO,0,行走机构_待机点P1,MoveAxis_P1,100,,,,,,,,,,,,
PRO,0,行走机构_进出料机构取放点P2,MoveAxis_P2,100,,,,,,,,,,,, PRO,0,行走机构_进出料机构取放点P2,MoveAxis_P2,100,,,,,,,,,,,,
PRO,0,行走机构_安全位置,MoveAxis_SafePos,100,,,,,,,,,,,,
,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,
PRO,0,料斗拉取进出轴_待机点P1,PullAxis_Inout_P1,100,,,,,,,,,,,, PRO,0,料斗拉取进出轴_待机点P1,PullAxis_Inout_P1,100,,,,,,,,,,,,
,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,
...@@ -110,3 +111,17 @@ PRO,0,B面移栽旋转轴_P3速度,MiddleAxis_B_P3_Speed,108,,,,,,,,,,,, ...@@ -110,3 +111,17 @@ PRO,0,B面移栽旋转轴_P3速度,MiddleAxis_B_P3_Speed,108,,,,,,,,,,,,
PRO,0,B面移栽压紧轴_P1速度,ComAxis_B_P1_Speed,108,,,,,,,,,,,, PRO,0,B面移栽压紧轴_P1速度,ComAxis_B_P1_Speed,108,,,,,,,,,,,,
PRO,0,B面移栽压紧轴_P2速度,ComAxis_B_P2_Speed,108,,,,,,,,,,,, PRO,0,B面移栽压紧轴_P2速度,ComAxis_B_P2_Speed,108,,,,,,,,,,,,
PRO,0,B面移栽压紧轴_P3速度,ComAxis_B_P3_Speed,108,,,,,,,,,,,, PRO,0,B面移栽压紧轴_P3速度,ComAxis_B_P3_Speed,108,,,,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,0,A面第一列信号屏蔽(0=屏蔽,1=开启),A_Col1_Sig_Shield,0,,,,,,,,,,,,
PRO,0,A面第二列信号屏蔽(0=屏蔽,1=开启),A_Col2_Sig_Shield,0,,,,,,,,,,,,
PRO,0,A面第三列信号屏蔽(0=屏蔽,1=开启),A_Col3_Sig_Shield,0,,,,,,,,,,,,
PRO,0,A面第四列信号屏蔽(0=屏蔽,1=开启),A_Col4_Sig_Shield,0,,,,,,,,,,,,
PRO,0,A面第五列信号屏蔽(0=屏蔽,1=开启),A_Col5_Sig_Shield,0,,,,,,,,,,,,
PRO,0,A面第六列信号屏蔽(0=屏蔽,1=开启),A_Col6_Sig_Shield,0,,,,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,0,B面第一列信号屏蔽(0=屏蔽,1=开启),B_Col1_Sig_Shield,0,,,,,,,,,,,,
PRO,0,B面第二列信号屏蔽(0=屏蔽,1=开启),B_Col2_Sig_Shield,0,,,,,,,,,,,,
PRO,0,B面第三列信号屏蔽(0=屏蔽,1=开启),B_Col3_Sig_Shield,0,,,,,,,,,,,,
PRO,0,B面第四列信号屏蔽(0=屏蔽,1=开启),B_Col4_Sig_Shield,0,,,,,,,,,,,,
PRO,0,B面第五列信号屏蔽(0=屏蔽,1=开启),B_Col5_Sig_Shield,0,,,,,,,,,,,,
PRO,0,B面第六列信号屏蔽(0=屏蔽,1=开启),B_Col6_Sig_Shield,0,,,,,,,,,,,,
\ No newline at end of file \ No newline at end of file
{
"HIKIPCamera":
[
{
"Name":"box_A",
"IP":"192.168.9.64",
"User":"admin",
"Pwd":"acc12345678",
"Port":"8000"
},
{"Name":"box_B",
"IP":"192.168.9.65",
"User":"admin",
"Pwd":"acc12345678",
"Port":"8000"
}
]
}
\ No newline at end of file \ No newline at end of file
...@@ -36,8 +36,8 @@ ...@@ -36,8 +36,8 @@
<Prefer32Bit>false</Prefer32Bit> <Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Asa.HIK.IPCamera"> <Reference Include="Asa.Camera.VisionLib">
<HintPath>..\..\dll\Asa.HIK.IPCamera.dll</HintPath> <HintPath>..\..\dll\Camera\Asa.Camera.VisionLib.dll</HintPath>
</Reference> </Reference>
<Reference Include="Asa.RFID.HiStation"> <Reference Include="Asa.RFID.HiStation">
<HintPath>..\..\dll\RFID\Asa.RFID.HiStation.dll</HintPath> <HintPath>..\..\dll\RFID\Asa.RFID.HiStation.dll</HintPath>
...@@ -62,6 +62,9 @@ ...@@ -62,6 +62,9 @@
<Reference Include="log4net, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL"> <Reference Include="log4net, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\..\packages\log4net.2.0.12\lib\net45\log4net.dll</HintPath> <HintPath>..\..\packages\log4net.2.0.12\lib\net45\log4net.dll</HintPath>
</Reference> </Reference>
<Reference Include="MvCameraControl.Net">
<HintPath>..\..\dll\MvCameraControl.Net.dll</HintPath>
</Reference>
<Reference Include="Neotel.Rmaxis"> <Reference Include="Neotel.Rmaxis">
<HintPath>..\..\dll\Rmaxis\Neotel.Rmaxis.dll</HintPath> <HintPath>..\..\dll\Rmaxis\Neotel.Rmaxis.dll</HintPath>
</Reference> </Reference>
...@@ -158,12 +161,6 @@ ...@@ -158,12 +161,6 @@
<Content Include="libdmtx.dll"> <Content Include="libdmtx.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="MvCameraControl.Net.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="MvCameraControl.Net.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="opencv_world420.dll"> <Content Include="opencv_world420.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
...@@ -212,7 +209,7 @@ ...@@ -212,7 +209,7 @@
<Content Include="Config\linePositions.csv"> <Content Include="Config\linePositions.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<None Include="Config\box_Cameras.json"> <None Include="Config\Camera.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<None Include="packages.config" /> <None Include="packages.config" />
......
...@@ -14,6 +14,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -14,6 +14,10 @@ namespace OnlineStore.DeviceLibrary
public ConfigMoveAxis Config = null; public ConfigMoveAxis Config = null;
public static int TimeoutInterval = 500; public static int TimeoutInterval = 500;
/// <summary> /// <summary>
/// 是否需要回零
/// </summary>
public bool IsNeedHome = false;
/// <summary>
/// 正常工作过程中判断位置是否到达时使用 /// 正常工作过程中判断位置是否到达时使用
/// </summary> /// </summary>
public int LastPosition = 0; public int LastPosition = 0;
...@@ -101,10 +105,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -101,10 +105,14 @@ namespace OnlineStore.DeviceLibrary
} }
public void HomeMove(DeviceMoveInfo MoveInfo) public void HomeMove(DeviceMoveInfo MoveInfo)
{ {
Config.TargetPosition = 0; if(IsNeedHome)
LogUtil.info(AxisName + "speed[" + Config.TargetSpeed + "]开始原点返回"); {
MoveInfo.WaitList.Add(WaitResultInfo.WaitAxis(Config, true)); Config.TargetPosition = 0;
AxisManager.instance.HomeMove(Config.DeviceName, (short)Config.GetAxisValue(), Config.HomeHighSpeed,Config.HomeLowSpeed,Config.HomeAddSpeed); LogUtil.info(AxisName + "speed[" + Config.TargetSpeed + "]开始原点返回");
MoveInfo.WaitList.Add(WaitResultInfo.WaitAxis(Config, true));
AxisManager.instance.HomeMove(Config.DeviceName, (short)Config.GetAxisValue(), Config.HomeHighSpeed, Config.HomeLowSpeed, Config.HomeAddSpeed);
}
} }
/// <summary> /// <summary>
...@@ -121,6 +129,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -121,6 +129,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.WaitList.Add(WaitResultInfo.WaitAxis(Config, targetPosition, targetSpeed)); MoveInfo.WaitList.Add(WaitResultInfo.WaitAxis(Config, targetPosition, targetSpeed));
Config.TargetPosition = targetPosition; Config.TargetPosition = targetPosition;
AxisManager.instance.AbsMove(Config.DeviceName, Config.GetAxisValue(), targetPosition, targetSpeed,Config.AddSpeed,Config.DelSpeed); AxisManager.instance.AbsMove(Config.DeviceName, Config.GetAxisValue(), targetPosition, targetSpeed,Config.AddSpeed,Config.DelSpeed);
LogUtil.info($"{this.AxisName} AbsMove To [{targetPosition}] [speed={targetSpeed}]");
} }
} }
......
...@@ -53,6 +53,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -53,6 +53,8 @@ namespace OnlineStore.DeviceLibrary
} }
private static void LoadCamera(bool isReLoad) private static void LoadCamera(bool isReLoad)
{ {
string[] names = null;
if (isReLoad || Camera._cam == null) if (isReLoad || Camera._cam == null)
{ {
try try
...@@ -63,14 +65,15 @@ namespace OnlineStore.DeviceLibrary ...@@ -63,14 +65,15 @@ namespace OnlineStore.DeviceLibrary
} }
Camera.Type = CameraType.HIK; Camera.Type = CameraType.HIK;
Camera._cam.Load(); Camera._cam.Load();
names = Camera._cam.Name;
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("加载HIK相机出错:", ex); LogUtil.error("加载HIK相机出错:", ex);
} }
} }
string[] names = Camera._cam.Name;
//string[] names = Camera._cam.Name;
if (names != null) if (names != null)
{ {
......
...@@ -129,7 +129,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -129,7 +129,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
/// BOX复位:AB面移栽x轴原点返回 /// BOX复位:AB面移栽x轴原点返回
/// </summary> /// </summary>
BOX_H05_XAxis_AB_Home, BOX_H05_XAxis_AB_UpDown_Home,
/// <summary> /// <summary>
/// BOX复位:行走机构、移栽升降轴、AB面移栽旋转轴原点返回 /// BOX复位:行走机构、移栽升降轴、AB面移栽旋转轴原点返回
/// </summary> /// </summary>
...@@ -162,7 +162,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -162,7 +162,10 @@ namespace OnlineStore.DeviceLibrary
///料仓出库:料斗拉取进出轴先运动到P1,料斗拉取升降轴运动到P1 ///料仓出库:料斗拉取进出轴先运动到P1,料斗拉取升降轴运动到P1
/// </summary> /// </summary>
SO_01_PullAxis_Ready, SO_01_PullAxis_Ready,
/// <summary>
///料仓出库:未在安全位置,行走机构先运动到P1
/// </summary>
SO_01_MoveAxis_Ready,
/// <summary> /// <summary>
/// 料仓出库:所有轴运行到库位: /// 料仓出库:所有轴运行到库位:
/// 1. 移栽升降轴到AB料屉上方过度点 /// 1. 移栽升降轴到AB料屉上方过度点
...@@ -217,10 +220,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -217,10 +220,14 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
SO_10_LiftTray, SO_10_LiftTray,
/// <summary> /// <summary>
/// 料仓出库:推到抽屉提取点,料斗拉取进出轴到P2(A/B面料屉提取点)同时检测X04-X09=1 /// 料仓出库:推到抽屉提取点,料斗拉取进出轴到P2(A/B面料屉提取点)
/// </summary> /// </summary>
SO_11_PushTray, SO_11_PushTray,
/// <summary> /// <summary>
/// 料仓出库:放下料屉,料斗拉取升降轴到P2(料屉提取水平点)同时检测X04-X09=1
/// </summary>
SO_12_PutTrayMiddle,
/// <summary>
/// 料仓出库:放下料屉,料斗拉取升降轴到P4(料屉提取低点) /// 料仓出库:放下料屉,料斗拉取升降轴到P4(料屉提取低点)
/// /// </summary> /// /// </summary>
SO_12_PutTrayDown, SO_12_PutTrayDown,
...@@ -278,6 +285,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -278,6 +285,10 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
SI_01_PullAxis_Ready, SI_01_PullAxis_Ready,
/// <summary> /// <summary>
///料仓入库:未在安全位置,行走机构先运动到P1
/// </summary>
SI_01_MoveAxis_Ready,
/// <summary>
/// 料仓入库:到料盘暂存区 /// 料仓入库:到料盘暂存区
/// 1. 行走机构到P2(进出料机构取放点) /// 1. 行走机构到P2(进出料机构取放点)
/// 2. 移栽升降轴到P3(A上暂存区取料低点) /// 2. 移栽升降轴到P3(A上暂存区取料低点)
...@@ -354,10 +365,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -354,10 +365,14 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
SI_16_LiftTray, SI_16_LiftTray,
/// <summary> /// <summary>
/// 料仓入库:推到抽屉提取点,料斗拉取进出轴到P2(A/B面料屉提取点)同时检测X04-X09=1 /// 料仓入库:推到抽屉提取点,料斗拉取进出轴到P2(A/B面料屉提取点)
/// </summary> /// </summary>
SI_17_PushTray, SI_17_PushTray,
/// <summary> /// <summary>
/// 料仓入库:料屉水平,料斗拉取升降轴到料屉提取水平点,同时检测X04-X09=1
/// </summary>
SI_18_PutTrayMiddle,
/// <summary>
/// 料仓入库:放下料屉,料斗拉取升降轴到P4(料屉提取低点) /// 料仓入库:放下料屉,料斗拉取升降轴到P4(料屉提取低点)
/// </summary> /// </summary>
SI_18_PutTrayDown, SI_18_PutTrayDown,
......
...@@ -57,8 +57,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -57,8 +57,8 @@ namespace OnlineStore.DeviceLibrary
/// 入料机构从哪个料串取料,或出库放到哪个料串 /// 入料机构从哪个料串取料,或出库放到哪个料串
/// 0=未知,1=A侧料串,2=B侧料串 /// 0=未知,1=A侧料串,2=B侧料串
/// </summary> /// </summary>
public int ShelfType{ get; set; }=0; public int ShelfType { get; set; } = 0;
} }
/// <summary> /// <summary>
/// 出入库料盘信息 /// 出入库料盘信息
/// </summary> /// </summary>
...@@ -164,14 +164,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -164,14 +164,11 @@ namespace OnlineStore.DeviceLibrary
// 01:表示在抽屉中的第几行 // 01:表示在抽屉中的第几行
//02:表示在抽屉中的第几列 //02:表示在抽屉中的第几列
/// </summary> /// </summary>
public string PosSide public string GetPosSide()
{ {
get if (PosId.Substring(2, 2).Equals("AA")) return "A";
{ else if (PosId.Substring(2, 2).Equals("BB")) return "B";
if (PosId.Substring(2, 2).Equals("AA")) return "A"; return "";
else if (PosId.Substring(2, 2).Equals("BB")) return "B";
return "";
}
} }
/// <summary> /// <summary>
/// 检查库位是否存在 /// 检查库位是否存在
...@@ -270,7 +267,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -270,7 +267,7 @@ namespace OnlineStore.DeviceLibrary
Updown_P7_P13 = position.Updown_P7_P13; Updown_P7_P13 = position.Updown_P7_P13;
XAxis_AB_P3 = position.XAxis_AB_P3; XAxis_AB_P3 = position.XAxis_AB_P3;
ComAxis_AB_P2 = position.ComAxis_AB_P2; ComAxis_AB_P2 = position.ComAxis_AB_P2;
ComAxis_AB_P3 = position.XAxis_AB_P3; ComAxis_AB_P3 = position.ComAxis_AB_P3;
MoveAxis_P3 = position.MoveAxis_P3; MoveAxis_P3 = position.MoveAxis_P3;
} }
/// <summary> /// <summary>
......
...@@ -61,6 +61,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -61,6 +61,9 @@ namespace OnlineStore.DeviceLibrary
/// B面移栽压紧轴 /// B面移栽压紧轴
/// </summary> /// </summary>
public AxisBean ComAxis_B = null; public AxisBean ComAxis_B = null;
/// <summary>
/// 是否需要回零
/// </summary>
public AxisBean[] moveAxisArray; public AxisBean[] moveAxisArray;
//温湿度 //温湿度
public HumitureBean humBean = null; public HumitureBean humBean = null;
...@@ -198,7 +201,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -198,7 +201,7 @@ namespace OnlineStore.DeviceLibrary
LogInfo("开始 原点返回: "); LogInfo("开始 原点返回: ");
StartReset(); StartReset();
SetConnectServerTimer(true); //SetConnectServerTimer(true);
SetAllTimer(true); SetAllTimer(true);
return true; return true;
} }
...@@ -266,54 +269,57 @@ namespace OnlineStore.DeviceLibrary ...@@ -266,54 +269,57 @@ namespace OnlineStore.DeviceLibrary
if (!PullAxis_Updown.IsInPosition(Config.PullAxis_Updown_P1) && !PullAxis_Updown.IsInPosition(Config.PullAxis_Updown_P2)) if (!PullAxis_Updown.IsInPosition(Config.PullAxis_Updown_P1) && !PullAxis_Updown.IsInPosition(Config.PullAxis_Updown_P2))
{ {
MoveInfo.NextMoveStep(StepEnum.BOX_H02_PullAxis_UpDownToP1); MoveInfo.NextMoveStep(StepEnum.BOX_H02_PullAxis_UpDownToP1);
LogInfo($"存储机构复位 {MoveInfo.SLog}:当前料屉拉取升降轴不在在料屉待机点/提取低点,升降轴先到待机点P1:{Config.PullAxis_Updown_P1}"); LogInfo($"复位 {MoveInfo.SLog}:当前料屉拉取升降轴不在在料屉待机点/提取低点,先到低点,移栽升降轴到料屉上方过渡点");
PullAxis_Updown.AbsMove(MoveInfo, Config.PullAxis_Updown_P1, Config.PullAxis_Updown_P1_Speed); PullAxis_UpdownToLowP4();
UpdownAxisTo_P6_P12();
} }
else else
{ {
MoveInfo.NextMoveStep(StepEnum.BOX_H03_PullAxis_InoutHome); MoveInfo.NextMoveStep(StepEnum.BOX_H03_PullAxis_InoutHome);
LogInfo($"存储机构复位 {MoveInfo.SLog}:料屉拉取进出轴回原点"); LogInfo($"复位 {MoveInfo.SLog}:料屉拉取进出轴回原点");
PullAxis_Inout.HomeMove(MoveInfo); PullAxis_Inout.HomeMove(MoveInfo);
} }
break; break;
case StepEnum.BOX_H02_PullAxis_UpDownToP1: case StepEnum.BOX_H02_PullAxis_UpDownToP1:
MoveInfo.NextMoveStep(StepEnum.BOX_H03_PullAxis_InoutHome); MoveInfo.NextMoveStep(StepEnum.BOX_H03_PullAxis_InoutHome);
LogInfo($"存储机构复位 {MoveInfo.SLog}:料屉拉取进出轴回原点"); LogInfo($"复位 {MoveInfo.SLog}:料屉拉取进出轴回原点");
PullAxis_Inout.HomeMove(MoveInfo); PullAxis_Inout.HomeMove(MoveInfo);
break; break;
case StepEnum.BOX_H03_PullAxis_InoutHome: case StepEnum.BOX_H03_PullAxis_InoutHome:
MoveInfo.NextMoveStep(StepEnum.BOX_H04_PullAxis_Updown_ABComAxis_Home); MoveInfo.NextMoveStep(StepEnum.BOX_H04_PullAxis_Updown_ABComAxis_Home);
LogInfo($"存储机构复位 {MoveInfo.SLog}:料屉拉取升降轴、AB面压紧轴回原点"); LogInfo($"复位 {MoveInfo.SLog}:料屉拉取升降轴、AB面压紧轴回原点");
if (!IsMoveAxisInSafePos())
MoveAxis.AbsMove(MoveInfo, Config.MoveAxis_SafePos, Config.MoveAxis_P1_Speed);
PullAxis_Inout.HomeMove(MoveInfo); PullAxis_Inout.HomeMove(MoveInfo);
ComAxis_A.HomeMove(MoveInfo); ComAxis_A.HomeMove(MoveInfo);
ComAxis_B.HomeMove(MoveInfo); ComAxis_B.HomeMove(MoveInfo);
break; break;
case StepEnum.BOX_H04_PullAxis_Updown_ABComAxis_Home: case StepEnum.BOX_H04_PullAxis_Updown_ABComAxis_Home:
MoveInfo.NextMoveStep(StepEnum.BOX_H05_XAxis_AB_Home); MoveInfo.NextMoveStep(StepEnum.BOX_H05_XAxis_AB_UpDown_Home);
LogInfo($"存储机构复位 {MoveInfo.SLog}:AB面移栽X轴回原点"); LogInfo($"复位 {MoveInfo.SLog}:AB面移栽X轴回原点、移栽升降轴");
PullAxis_Inout.HomeMove(MoveInfo); PullAxis_Inout.HomeMove(MoveInfo);
XAxis_A.HomeMove(MoveInfo); XAxis_A.HomeMove(MoveInfo);
XAxis_B.HomeMove(MoveInfo); XAxis_B.HomeMove(MoveInfo);
UpdownAxis.HomeMove(MoveInfo);
break; break;
case StepEnum.BOX_H05_XAxis_AB_Home: case StepEnum.BOX_H05_XAxis_AB_UpDown_Home:
MoveInfo.NextMoveStep(StepEnum.BOX_H06_OtherAxis_Home); MoveInfo.NextMoveStep(StepEnum.BOX_H06_OtherAxis_Home);
LogInfo($"存储机构复位 {MoveInfo.SLog}:行走机构、移栽升降轴、AB面移栽旋转轴回原点"); LogInfo($"复位 {MoveInfo.SLog}:行走机构、AB面移栽旋转轴回原点");
MoveAxis.HomeMove(MoveInfo); MoveAxis.HomeMove(MoveInfo);
UpdownAxis.HomeMove(MoveInfo);
MiddleAxis_A.HomeMove(MoveInfo); MiddleAxis_A.HomeMove(MoveInfo);
MiddleAxis_B.HomeMove(MoveInfo); MiddleAxis_B.HomeMove(MoveInfo);
break; break;
case StepEnum.BOX_H06_OtherAxis_Home: case StepEnum.BOX_H06_OtherAxis_Home:
LogInfo($"存储机构复位 {MoveInfo.SLog}:所有轴回零完成"); LogInfo($"复位 {MoveInfo.SLog}:所有轴回零完成");
AllAxisStartMoveToP1(); AllAxisStartMoveToP1();
break; break;
//回待机位 //回待机位
case StepEnum.BOX_R01_PullAxis_UpDownToP1: case StepEnum.BOX_R01_PullAxis_UpDownToP1:
MoveInfo.NextMoveStep(StepEnum.BOX_R02_PullAxis_InOut_ABComAxis_ToP1); MoveInfo.NextMoveStep(StepEnum.BOX_R02_PullAxis_InOut_ABComAxis_ToP1);
LogInfo($"存储机构复位 {MoveInfo.SLog}:料屉拉取进出轴、AB面压紧轴返回待机位P1"); LogInfo($"复位 {MoveInfo.SLog}:料屉拉取进出轴、AB面压紧轴返回待机位P1");
PullAxis_Inout.AbsMove(MoveInfo, Config.PullAxis_Inout_P1, Config.PullAxis_Inout_P1_Speed); PullAxis_Inout.AbsMove(MoveInfo, Config.PullAxis_Inout_P1, Config.PullAxis_Inout_P1_Speed);
ComAxis_A.AbsMove(MoveInfo, Config.ComAxis_A_P1, Config.ComAxis_A_P1_Speed); ComAxis_A.AbsMove(MoveInfo, Config.ComAxis_A_P1, Config.ComAxis_A_P1_Speed);
ComAxis_B.AbsMove(MoveInfo, Config.ComAxis_B_P1, Config.ComAxis_B_P1_Speed); ComAxis_B.AbsMove(MoveInfo, Config.ComAxis_B_P1, Config.ComAxis_B_P1_Speed);
...@@ -321,20 +327,23 @@ namespace OnlineStore.DeviceLibrary ...@@ -321,20 +327,23 @@ namespace OnlineStore.DeviceLibrary
case StepEnum.BOX_R02_PullAxis_InOut_ABComAxis_ToP1: case StepEnum.BOX_R02_PullAxis_InOut_ABComAxis_ToP1:
MoveInfo.NextMoveStep(StepEnum.BOX_R03_XAxis_AB_ToP1); MoveInfo.NextMoveStep(StepEnum.BOX_R03_XAxis_AB_ToP1);
LogInfo($"存储机构复位 {MoveInfo.SLog}:AB面移栽X轴返回待机位P1"); LogInfo($"复位 {MoveInfo.SLog}:AB面移栽X轴返回待机位P1");
XAxis_A.AbsMove(MoveInfo, Config.XAxis_A_P1, Config.XAxis_A_P1_Speed); XAxis_A.AbsMove(MoveInfo, Config.XAxis_A_P1, Config.XAxis_A_P1_Speed);
XAxis_B.AbsMove(MoveInfo, Config.XAxis_B_P1, Config.XAxis_B_P1_Speed); XAxis_B.AbsMove(MoveInfo, Config.XAxis_B_P1, Config.XAxis_B_P1_Speed);
break; break;
case StepEnum.BOX_R03_XAxis_AB_ToP1: case StepEnum.BOX_R03_XAxis_AB_ToP1:
MoveInfo.NextMoveStep(StepEnum.BOX_R04_OtherAxisToP1); MoveInfo.NextMoveStep(StepEnum.BOX_R04_OtherAxisToP1);
LogInfo($"存储机构复位 {MoveInfo.SLog}:行走机构、移栽升降轴、AB面移栽旋转轴返回待机位P1"); LogInfo($"复位 {MoveInfo.SLog}:行走机构、移栽升降轴、AB面移栽旋转轴返回待机位P1");
MoveAxis.AbsMove(MoveInfo, Config.MoveAxis_P1, Config.MoveAxis_P1_Speed); MoveAxis.AbsMove(MoveInfo, Config.MoveAxis_P1, Config.MoveAxis_P1_Speed);
UpdownAxis.AbsMove(MoveInfo, Config.Updown_P1, Config.Updown_P1_Speed); UpdownAxis.AbsMove(MoveInfo, Config.Updown_P1, Config.Updown_P1_Speed);
MiddleAxis_A.AbsMove(MoveInfo, Config.MiddleAxis_A_P1, Config.MiddleAxis_A_P1_Speed);
MiddleAxis_B.AbsMove(MoveInfo, Config.MiddleAxis_B_P1, Config.MiddleAxis_B_P1_Speed);
break; break;
case StepEnum.BOX_R04_OtherAxisToP1: case StepEnum.BOX_R04_OtherAxisToP1:
LogInfo($"存储机构复位 {MoveInfo.SLog}:所有轴到达待机位完成"); LogInfo($"复位 {MoveInfo.SLog}:所有轴到达待机位完成");
SetBoxStatus(DeviceStatus.None, RunStatus.Runing); SetBoxStatus(DeviceStatus.None, RunStatus.Runing);
MoveInfo.EndMove(); MoveInfo.EndMove();
break; break;
...@@ -342,9 +351,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -342,9 +351,9 @@ namespace OnlineStore.DeviceLibrary
} }
private void AllAxisStartMoveToP1() private void AllAxisStartMoveToP1()
{ {
SetBoxStatus(DeviceStatus.ResetMove,RunStatus.Reset); SetBoxStatus(DeviceStatus.ResetMove, RunStatus.Reset);
MoveInfo.NextMoveStep(StepEnum.BOX_R01_PullAxis_UpDownToP1); MoveInfo.NextMoveStep(StepEnum.BOX_R01_PullAxis_UpDownToP1);
LogInfo($"存储机构复位 {MoveInfo.SLog}:料屉拉取升降轴返回待机位P1"); LogInfo($"复位 {MoveInfo.SLog}:料屉拉取升降轴返回待机位P1");
PullAxis_Updown.AbsMove(MoveInfo, Config.PullAxis_Updown_P1, Config.PullAxis_Updown_P1_Speed); PullAxis_Updown.AbsMove(MoveInfo, Config.PullAxis_Updown_P1, Config.PullAxis_Updown_P1_Speed);
} }
...@@ -358,7 +367,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -358,7 +367,7 @@ namespace OnlineStore.DeviceLibrary
{ {
TimeSpan timeSpanA = DateTime.Now - dtUpperA; TimeSpan timeSpanA = DateTime.Now - dtUpperA;
//检测A上暂存区是否有料盘 //检测A上暂存区是否有料盘
if(IOValue(IO_Type.UpperArea_Check_A).Equals(IO_VALUE.HIGH)) if (IOValue(IO_Type.UpperArea_Check_A).Equals(IO_VALUE.HIGH))
{ {
if (timeSpanA.TotalSeconds >= SigLastTime) if (timeSpanA.TotalSeconds >= SigLastTime)
StartInstore(new InOutParam(BufferDataManager.AInStoreInfo)); StartInstore(new InOutParam(BufferDataManager.AInStoreInfo));
...@@ -431,7 +440,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -431,7 +440,7 @@ namespace OnlineStore.DeviceLibrary
{ {
return; return;
} }
if(runStatus.Equals(RunStatus.Runing)) if (runStatus.Equals(RunStatus.Runing))
{ {
ExecuteOutListProcess(); ExecuteOutListProcess();
} }
...@@ -460,7 +469,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -460,7 +469,7 @@ namespace OnlineStore.DeviceLibrary
return; return;
} }
////若BOX和出料都没有在等待Io的过程中则此Io超时异常可能已经处理过 ////若BOX和出料都没有在等待Io的过程中则此Io超时异常可能已经处理过
if ( MoveInfo.IsInWait.Equals(false) && NoErrorAlarm()) if (MoveInfo.IsInWait.Equals(false) && NoErrorAlarm())
{ {
LogUtil.info(Name + "清理信号超时报警【" + WarnMsg + "】 "); LogUtil.info(Name + "清理信号超时报警【" + WarnMsg + "】 ");
alarmType = AlarmType.None; alarmType = AlarmType.None;
...@@ -498,8 +507,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -498,8 +507,8 @@ namespace OnlineStore.DeviceLibrary
SetConnectServerTimer(false); SetConnectServerTimer(false);
SetAllTimer(false); SetAllTimer(false);
StopMove(); StopMove();
SetBoxStatus(DeviceStatus.None,RunStatus.Wait); SetBoxStatus(DeviceStatus.None, RunStatus.Wait);
StopCamera(); //StopCamera();
} }
public override string GetMoveStr() public override string GetMoveStr()
...@@ -507,7 +516,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -507,7 +516,8 @@ namespace OnlineStore.DeviceLibrary
string msg = ""; string msg = "";
int tLength = 15; int tLength = 15;
msg += "runS: " + runStatus + "\n"; msg += "runStatus: " + runStatus + "\n";
msg += "runStep: " + MoveInfo.MoveStep + "\n";
msg += "alarm: " + alarmType + "\n"; msg += "alarm: " + alarmType + "\n";
...@@ -565,7 +575,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -565,7 +575,7 @@ namespace OnlineStore.DeviceLibrary
return false; return false;
} }
} }
return false; return true;
} }
public void CloseAllAxis() public void CloseAllAxis()
......
...@@ -55,11 +55,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -55,11 +55,11 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
/// <param name="pos">位置</param> /// <param name="pos">位置</param>
/// <returns></returns> /// <returns></returns>
private int CamPosSide(string pos) private string CamPosSide(string pos)
{ {
if (pos.Substring(2, 2).Equals("AA")) return 0; if (pos.Substring(2, 2).Equals("AA")) return "box_A";
else if (pos.Substring(2, 2).Equals("BB")) return 1; else if (pos.Substring(2, 2).Equals("BB")) return "box_B";
return 0; return "box_A";
} }
/// <summary> /// <summary>
/// 获取轴的负限位 /// 获取轴的负限位
...@@ -95,7 +95,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -95,7 +95,7 @@ namespace OnlineStore.DeviceLibrary
if (Math.Abs(Config.Drawer_X - eyemOcsFXYR.fX) < Config.Drawer_X_Error) if (Math.Abs(Config.Drawer_X - eyemOcsFXYR.fX) < Config.Drawer_X_Error)
return true; return true;
LogInfo($"存储机构-视觉对位 {MoveInfo.SLog}:Mark点X轴坐标{eyemOcsFXYR.fX},模板Mark点X轴坐标{Config.Drawer_X},X轴偏差{(Config.Drawer_X - eyemOcsFXYR.fX)}," + LogInfo($"存储机构-视觉对位 {MoveInfo.SLog}:Mark点X轴坐标{eyemOcsFXYR.fX},模板Mark点X轴坐标{Config.Drawer_X},X轴偏差{(Config.Drawer_X - eyemOcsFXYR.fX)}," +
$"行走机构相对移动{(Config.Drawer_X - eyemOcsFXYR.fX) * autoFindPos.XCoeffOfCoorToPulse}[{MoveInfo.MoveParam.PosInfo.PosSide}面]"); $"行走机构相对移动{(Config.Drawer_X - eyemOcsFXYR.fX) * autoFindPos.XCoeffOfCoorToPulse}[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
MoveAxis.AbsMove(MoveInfo, Convert.ToInt32(MoveAxis.GetAclPosition() + (Config.Drawer_X - eyemOcsFXYR.fX) * autoFindPos.XCoeffOfCoorToPulse), Config.MoveAxis_P1_Speed / 2); MoveAxis.AbsMove(MoveInfo, Convert.ToInt32(MoveAxis.GetAclPosition() + (Config.Drawer_X - eyemOcsFXYR.fX) * autoFindPos.XCoeffOfCoorToPulse), Config.MoveAxis_P1_Speed / 2);
return false; return false;
} }
...@@ -105,7 +105,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -105,7 +105,7 @@ namespace OnlineStore.DeviceLibrary
return true; return true;
UpdownAxis.AbsMove(MoveInfo, Convert.ToInt32(UpdownAxis.GetAclPosition() + (Config.Drawer_Y - eyemOcsFXYR.fY) * autoFindPos.YCoeffOfCoorToPulse), Config.Updown_P1_Speed / 2); UpdownAxis.AbsMove(MoveInfo, Convert.ToInt32(UpdownAxis.GetAclPosition() + (Config.Drawer_Y - eyemOcsFXYR.fY) * autoFindPos.YCoeffOfCoorToPulse), Config.Updown_P1_Speed / 2);
LogInfo($"存储机构-视觉对位 {MoveInfo.SLog}:Mark点Y轴坐标{eyemOcsFXYR.fY},模板Mark点Y轴坐标{Config.Drawer_Y},Y轴偏差{(Config.Drawer_Y - eyemOcsFXYR.fY)}," + LogInfo($"存储机构-视觉对位 {MoveInfo.SLog}:Mark点Y轴坐标{eyemOcsFXYR.fY},模板Mark点Y轴坐标{Config.Drawer_Y},Y轴偏差{(Config.Drawer_Y - eyemOcsFXYR.fY)}," +
$"移栽升降轴相对移动{(Config.Drawer_Y - eyemOcsFXYR.fY) * autoFindPos.YCoeffOfCoorToPulse}[{MoveInfo.MoveParam.PosInfo.PosSide}面]"); $"移栽升降轴相对移动{(Config.Drawer_Y - eyemOcsFXYR.fY) * autoFindPos.YCoeffOfCoorToPulse}[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
return false; return false;
} }
...@@ -157,7 +157,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -157,7 +157,7 @@ namespace OnlineStore.DeviceLibrary
else else
{ {
LogInfo($"存储机构-视觉对位 {MoveInfo.SLog}:库位[{item}]保存成功[{MoveInfo.MoveParam.PosInfo.PosSide}面]"); LogInfo($"存储机构-视觉对位 {MoveInfo.SLog}:库位[{item}]保存成功[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
} }
return result; return result;
} }
...@@ -169,7 +169,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -169,7 +169,7 @@ namespace OnlineStore.DeviceLibrary
{ {
MoveInfo.EndMove(); MoveInfo.EndMove();
if (MoveInfo.MoveParam != null) if (MoveInfo.MoveParam != null)
LogInfo($"存储机构-视觉对位 {MoveInfo.SLog}:对位结束[{MoveInfo.MoveParam.PosInfo.PosSide}面]"); LogInfo($"存储机构-视觉对位 {MoveInfo.SLog}:对位结束[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
} }
EyemOcsFXYR ocsFXYR; EyemOcsFXYR ocsFXYR;
public void AutoFindPosProcess() public void AutoFindPosProcess()
...@@ -189,18 +189,18 @@ namespace OnlineStore.DeviceLibrary ...@@ -189,18 +189,18 @@ namespace OnlineStore.DeviceLibrary
case StepEnum.SA_01_Pos_Start_Find_Pos: case StepEnum.SA_01_Pos_Start_Find_Pos:
MoveInfo.NextMoveStep(StepEnum.SA_02_Pos_To_Drawer_StartPoint); MoveInfo.NextMoveStep(StepEnum.SA_02_Pos_To_Drawer_StartPoint);
LogInfo($"存储机构-视觉对位 {MoveInfo.SLog}:到抽屉起始点," + LogInfo($"存储机构-视觉对位 {MoveInfo.SLog}:到抽屉起始点," +
$"行走机构到抽屉起始点,移栽升降轴到抽屉起始点[{MoveInfo.MoveParam.PosInfo.PosSide}面]"); $"行走机构到抽屉起始点,移栽升降轴到抽屉起始点[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
ToDrawer_StartPoint(); ToDrawer_StartPoint();
break; break;
case StepEnum.SA_02_Pos_To_Drawer_StartPoint: case StepEnum.SA_02_Pos_To_Drawer_StartPoint:
//取图 //取图
//Bitmap bitmap = null; //Bitmap bitmap = null;
AcqImage(CamPosSide(MoveInfo.MoveParam.PosInfo.PosId), out Bitmap bitmap); Bitmap bitmap=AcqImage(CamPosSide(MoveInfo.MoveParam.PosInfo.PosId));
int res = AutoFindPos.GetMarkInfo(bitmap, out ocsFXYR); int res = AutoFindPos.GetMarkInfo(bitmap, out ocsFXYR);
if (res == 0) if (res == 0)
{ {
MoveInfo.NextMoveStep(StepEnum.SA_03_Pos_AcqImg); MoveInfo.NextMoveStep(StepEnum.SA_03_Pos_AcqImg);
LogInfo($"存储机构-视觉对位 {MoveInfo.SLog}:取图[{MoveInfo.MoveParam.PosInfo.PosSide}面]"); LogInfo($"存储机构-视觉对位 {MoveInfo.SLog}:取图[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
} }
else if (res == -4) else if (res == -4)
{ {
...@@ -259,19 +259,19 @@ namespace OnlineStore.DeviceLibrary ...@@ -259,19 +259,19 @@ namespace OnlineStore.DeviceLibrary
case StepEnum.SA_06_Neg_Start_Find_Pos: case StepEnum.SA_06_Neg_Start_Find_Pos:
MoveInfo.NextMoveStep(StepEnum.SA_07_Neg_To_Drawer_StartPoint); MoveInfo.NextMoveStep(StepEnum.SA_07_Neg_To_Drawer_StartPoint);
LogInfo($"存储机构-视觉对位 {MoveInfo.SLog}:到抽屉起始点," + LogInfo($"存储机构-视觉对位 {MoveInfo.SLog}:到抽屉起始点," +
$"行走机构到抽屉起始点,移栽升降轴到抽屉起始点[{MoveInfo.MoveParam.PosInfo.PosSide}面]"); $"行走机构到抽屉起始点,移栽升降轴到抽屉起始点[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
ToDrawer_StartPoint(); ToDrawer_StartPoint();
break; break;
case StepEnum.SA_07_Neg_To_Drawer_StartPoint: case StepEnum.SA_07_Neg_To_Drawer_StartPoint:
//取图 //取图
//Bitmap bitmap1 = null; //Bitmap bitmap1 = null;
AcqImage(CamPosSide(MoveInfo.MoveParam.PosInfo.PosId), out Bitmap bitmap1); Bitmap bitmap1=AcqImage(CamPosSide(MoveInfo.MoveParam.PosInfo.PosId));
int res1 = AutoFindPos.GetMarkInfo(bitmap1, out ocsFXYR); int res1 = AutoFindPos.GetMarkInfo(bitmap1, out ocsFXYR);
if (res1 == 0) if (res1 == 0)
{ {
MoveInfo.NextMoveStep(StepEnum.SA_08_Neg_AcqImg); MoveInfo.NextMoveStep(StepEnum.SA_08_Neg_AcqImg);
LogInfo($"存储机构-视觉对位 {MoveInfo.SLog}:取图[{MoveInfo.MoveParam.PosInfo.PosSide}面]"); LogInfo($"存储机构-视觉对位 {MoveInfo.SLog}:取图[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
} }
else if (res1 == -4) else if (res1 == -4)
{ {
......
...@@ -13,34 +13,35 @@ namespace OnlineStore.DeviceLibrary ...@@ -13,34 +13,35 @@ namespace OnlineStore.DeviceLibrary
partial class BoxEquip partial class BoxEquip
{ {
Thread[] camerathread; Thread[] camerathread;
Asa.HIK.IPCamera camera; bool IsOpen = false;
Asa.Camera.VisionLib camera;
bool loadCameraState = false; bool loadCameraState = false;
public delegate void CameraAcqEventHandler(CameraArgs cameraArgs); public delegate void CameraAcqEventHandler(CameraArgs cameraArgs);
public event CameraAcqEventHandler camera_event; public event CameraAcqEventHandler camera_event;
void LoadCameraConfig(string id = "") void LoadCameraConfig(string id = "")
{ {
string path = @".\Config\box_Cameras.json"; string path = @".\Config\Camera.json";
if (!File.Exists(path)) if (!File.Exists(path))
{ {
LogUtil.error(Name + "找不到监控相机配置文件" + path); LogUtil.error(Name + "找不到监控相机配置文件" + path);
} }
camera = new Asa.HIK.IPCamera(path);
bool rtn = camera.Load();
if (!rtn)
LogUtil.error(Name + "加载监控相机配置文件失败");
camerathread = new Thread[camera.Count]; camera = new Asa.Camera.VisionLib(path);
camerathread = new Thread[2];
//pictureBox1.Image = bmp; //pictureBox1.Image = bmp;
loadCameraState = true; loadCameraState = true;
} }
void StartCamera() void StartCamera()
{ {
for (int i = 0; i < camera.Count; i++) camera.Open("box_A");
{ camera.Open("box_B");
camerathread[i] = new Thread(new ParameterizedThreadStart(startMonitor)); IsOpen = true;
camerathread[i].IsBackground = true; camerathread[0] = new Thread(new ParameterizedThreadStart(startMonitor));
camerathread[i].Start(i); camerathread[0].IsBackground = true;
} camerathread[0].Start("box_A");
camerathread[1] = new Thread(new ParameterizedThreadStart(startMonitor));
camerathread[1].IsBackground = true;
camerathread[1].Start("box_B");
} }
void startMonitor(object obj) void startMonitor(object obj)
...@@ -50,59 +51,42 @@ namespace OnlineStore.DeviceLibrary ...@@ -50,59 +51,42 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(Name + "监控相机初始化失败,无法开启"); LogUtil.error(Name + "监控相机初始化失败,无法开启");
return; return;
} }
int idx = (int)obj; string name = (string)obj;
var rtn = camera.Open(idx); while (IsOpen)
if (!rtn)
LogUtil.error(Name + "打开监控" + idx + "相机失败");
while (camera.IsOpen[idx])
{ {
rtn = camera.GrabOne(idx, out Bitmap bmp); Bitmap bmp = AcqImage(name);
if (rtn) LogUtil.info($"{name} 取图");
if (bmp != null)
{ {
camera_event?.Invoke(new CameraArgs(idx, bmp)); camera_event?.Invoke(new CameraArgs(name, bmp));
} }
Thread.Sleep(1000 / 10); Thread.Sleep(3000 / 10);
} }
} }
void StopCamera() void StopCamera()
{ {
for (int i = 0; i < camera.Count; i++) IsOpen = false;
{ camera.Close();
try
{
if (camera.IsOpen[i])
{
camera.Close(i);
camerathread[i].Join();
}
}
catch (Exception e)
{
LogUtil.error($"关闭[{i}]相机失败", e);
}
}
camera.Dispose(); camera.Dispose();
} }
public bool AcqImage(int idx,out Bitmap img) public Bitmap AcqImage(string camName)
{ {
return camera.GrabOne(idx, out img); return camera.GetImage(camName);
} }
} }
public class CameraArgs : EventArgs public class CameraArgs : EventArgs
{ {
/// <summary> /// <summary>
/// 相机序号 /// 相机
/// </summary> /// </summary>
public int Index { get; set; } public string CamName { get; set; }
/// <summary> /// <summary>
/// 相机采集的图片 /// 相机采集的图片
/// </summary> /// </summary>
public Bitmap Image { get; set; } public Bitmap Image { get; set; }
public CameraArgs(int idx, Bitmap img) public CameraArgs(string name, Bitmap img)
{ {
Index = idx; CamName = name;
Image = img; Image = img;
} }
} }
......
...@@ -425,7 +425,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -425,7 +425,7 @@ namespace OnlineStore.DeviceLibrary
return false; return false;
} }
} }
return false; return true;
} }
public void CloseAllAxis() public void CloseAllAxis()
......
...@@ -410,7 +410,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -410,7 +410,7 @@ namespace OnlineStore.DeviceLibrary
MoveLog($"入库取料{shelf}{MoveInfo.SLog}: NG料{LastPosInfo.ToStr()} 升降轴到P8(NG料区放料高点){Config.Updown_P8_NGH}"); MoveLog($"入库取料{shelf}{MoveInfo.SLog}: NG料{LastPosInfo.ToStr()} 升降轴到P8(NG料区放料高点){Config.Updown_P8_NGH}");
UpdownAxis.AbsMove(MoveInfo, Config.Updown_P8_NGH, Config.Updown_P8_Speed); UpdownAxis.AbsMove(MoveInfo, Config.Updown_P8_NGH, Config.Updown_P8_Speed);
} }
else if (LastPosInfo.PosSide.Equals("A")) else if (LastPosInfo.GetPosSide().Equals("A"))
{ {
MoveInfo.NextMoveStep(StepEnum.II41_WaitNoReel); MoveInfo.NextMoveStep(StepEnum.II41_WaitNoReel);
MoveLog($"入库取料{shelf}{MoveInfo.SLog}: A侧入库料{LastPosInfo.ToStr()} 等待A上暂存区无料"); MoveLog($"入库取料{shelf}{MoveInfo.SLog}: A侧入库料{LastPosInfo.ToStr()} 等待A上暂存区无料");
......
...@@ -131,6 +131,12 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -131,6 +131,12 @@ namespace OnlineStore.LoadCSVLibrary
public int MoveAxis_P2 { get; set; } public int MoveAxis_P2 { get; set; }
/// <summary> /// <summary>
/// PRO,0,行走机构_安全位置,MoveAxis_SafePos,100,,,,,,,,,,,,
/// </summary>
[ConfigProAttribute("MoveAxis_SafePos")]
public int MoveAxis_SafePos { get; set; }
/// <summary>
/// PRO,0,料斗拉取进出轴_待机点P1,PullAxis_Inout_P1,100,,,,,,,,,,,, /// PRO,0,料斗拉取进出轴_待机点P1,PullAxis_Inout_P1,100,,,,,,,,,,,,
/// </summary> /// </summary>
[ConfigProAttribute("PullAxis_Inout_P1")] [ConfigProAttribute("PullAxis_Inout_P1")]
...@@ -565,5 +571,69 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -565,5 +571,69 @@ namespace OnlineStore.LoadCSVLibrary
[ConfigProAttribute("Humiture_Port", true)] [ConfigProAttribute("Humiture_Port", true)]
public string Humiture_Port { get; set; } public string Humiture_Port { get; set; }
#endregion #endregion
#region 列信号开启
/// <summary>
/// A面第一列信号屏蔽
/// </summary>
[ConfigProAttribute("A_Col1_Sig_Shield", false)]
public int A_Col1_Sig_Shield { get; set; }
/// <summary>
/// A面第二列信号屏蔽
/// </summary>
[ConfigProAttribute("A_Col2_Sig_Shield", false)]
public int A_Col2_Sig_Shield { get; set; }
/// <summary>
/// A面第三列信号屏蔽
/// </summary>
[ConfigProAttribute("A_Col3_Sig_Shield", false)]
public int A_Col3_Sig_Shield { get; set; }
/// <summary>
/// A面第四列信号屏蔽
/// </summary>
[ConfigProAttribute("A_Col4_Sig_Shield", false)]
public int A_Col4_Sig_Shield { get; set; }
/// <summary>
/// A面第五列信号屏蔽
/// </summary>
[ConfigProAttribute("A_Col5_Sig_Shield", false)]
public int A_Col5_Sig_Shield { get; set; }
/// <summary>
/// A面第六列信号屏蔽
/// </summary>
[ConfigProAttribute("A_Col6_Sig_Shield", false)]
public int A_Col6_Sig_Shield { get; set; }
/// <summary>
/// B面第一列信号屏蔽
/// </summary>
[ConfigProAttribute("B_Col1_Sig_Shield", false)]
public int B_Col1_Sig_Shield { get; set; }
/// <summary>
/// B面第二列信号屏蔽
/// </summary>
[ConfigProAttribute("B_Col2_Sig_Shield", false)]
public int B_Col2_Sig_Shield { get; set; }
/// <summary>
/// B面第三列信号屏蔽
/// </summary>
[ConfigProAttribute("B_Col3_Sig_Shield", false)]
public int B_Col3_Sig_Shield { get; set; }
/// <summary>
/// B面第四列信号屏蔽
/// </summary>
[ConfigProAttribute("B_Col4_Sig_Shield", false)]
public int B_Col4_Sig_Shield { get; set; }
/// <summary>
/// B面第五列信号屏蔽
/// </summary>
[ConfigProAttribute("B_Col5_Sig_Shield", false)]
public int B_Col5_Sig_Shield { get; set; }
/// <summary>
/// B面第六列信号屏蔽
/// </summary>
[ConfigProAttribute("B_Col6_Sig_Shield", false)]
public int B_Col6_Sig_Shield { get; set; }
#endregion
} }
} }
...@@ -92,6 +92,26 @@ ...@@ -92,6 +92,26 @@
<conversionPattern value="[%date][%t]%-5p %m%n" /> <conversionPattern value="[%date][%t]%-5p %m%n" />
</layout> </layout>
</appender> </appender>
<logger name="CameraVisionLib">
<level value="Debug"/>
<appender-ref ref="CameraVisionLib"/>
</logger>
<appender name="CameraVisionLib" type="log4net.Appender.RollingFileAppender">
<param name="File" value="logs\\CameraVisionLib.log" />
<param name="Encoding" value="UTF-8"/>
<param name="AppendToFile" value="true" />
<param name="RollingStyle" value="Date" />
<param name="DatePattern" value="yyyy-MM-dd" />
<param name="MaxSizeRollBackups" value="100" />
<param name="MaxFileSize" value="10240" />
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="[%d][%t][%c:%L]%-5p %m%n" />
</layout>
</appender>
<logger name="CameraVisionLib">
<level value="debug" />
<appender-ref ref="CameraVisionLib" />
</logger>
<logger name="RollingLogFileAppender"> <logger name="RollingLogFileAppender">
<level value="Info" /> <level value="Info" />
<appender-ref ref="RollingLogFileAppender" /> <appender-ref ref="RollingLogFileAppender" />
......
...@@ -75,7 +75,7 @@ namespace OnlineStore.XLRStore ...@@ -75,7 +75,7 @@ namespace OnlineStore.XLRStore
inputEquip = new FrmInputEquip(StoreManager.XLRStore.inputEquip); inputEquip = new FrmInputEquip(StoreManager.XLRStore.inputEquip);
AddForm(" 入料机构 ", inputEquip); AddForm(" 入料机构 ", inputEquip);
box = new FrmBoxEquip(StoreManager.XLRStore.boxEquip); box = new FrmBoxEquip(StoreManager.XLRStore.boxEquip);
AddForm(" 储机构 ", box); AddForm(" 储机构 ", box);
托盘初始化ToolStripMenuItem.Visible = ConfigAppSettings.GetIntValue(Setting_Init.OpenRFIDWrite).Equals(1); 托盘初始化ToolStripMenuItem.Visible = ConfigAppSettings.GetIntValue(Setting_Init.OpenRFIDWrite).Equals(1);
...@@ -251,7 +251,7 @@ namespace OnlineStore.XLRStore ...@@ -251,7 +251,7 @@ namespace OnlineStore.XLRStore
private void ExitApp() private void ExitApp()
{ {
DialogResult result = MessageBox.Show("是否确定退出流水线客户端?", "提示", MessageBoxButtons.YesNo); DialogResult result = MessageBox.Show("是否确定退出客户端?", "提示", MessageBoxButtons.YesNo);
if (result.Equals(DialogResult.Yes)) if (result.Equals(DialogResult.Yes))
{ {
try try
......
...@@ -70,6 +70,9 @@ ...@@ -70,6 +70,9 @@
<Reference Include="log4net, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL"> <Reference Include="log4net, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\..\packages\log4net.2.0.12\lib\net45\log4net.dll</HintPath> <HintPath>..\..\packages\log4net.2.0.12\lib\net45\log4net.dll</HintPath>
</Reference> </Reference>
<Reference Include="MvCameraControl.Net">
<HintPath>..\..\dll\MvCameraControl.Net.dll</HintPath>
</Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
......
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox(); this.textBox1 = new System.Windows.Forms.TextBox();
this.tabPage2 = new System.Windows.Forms.TabPage(); this.tabPage2 = new System.Windows.Forms.TabPage();
this.label22 = new System.Windows.Forms.Label();
this.button14 = new System.Windows.Forms.Button(); this.button14 = new System.Windows.Forms.Button();
this.button13 = new System.Windows.Forms.Button(); this.button13 = new System.Windows.Forms.Button();
this.label21 = new System.Windows.Forms.Label(); this.label21 = new System.Windows.Forms.Label();
...@@ -94,7 +95,6 @@ ...@@ -94,7 +95,6 @@
this.button2 = new System.Windows.Forms.Button(); this.button2 = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button(); this.button1 = new System.Windows.Forms.Button();
this.timer1 = new System.Windows.Forms.Timer(this.components); this.timer1 = new System.Windows.Forms.Timer(this.components);
this.label22 = new System.Windows.Forms.Label();
this.tableLayoutPanel1.SuspendLayout(); this.tableLayoutPanel1.SuspendLayout();
this.tabControl1.SuspendLayout(); this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout(); this.tabPage1.SuspendLayout();
...@@ -366,9 +366,18 @@ ...@@ -366,9 +366,18 @@
this.tabPage2.Padding = new System.Windows.Forms.Padding(3); this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(786, 316); this.tabPage2.Size = new System.Drawing.Size(786, 316);
this.tabPage2.TabIndex = 1; this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "配置模板抽屉位置"; this.tabPage2.Text = "配置抽屉位置";
this.tabPage2.UseVisualStyleBackColor = true; this.tabPage2.UseVisualStyleBackColor = true;
// //
// label22
//
this.label22.AutoSize = true;
this.label22.Location = new System.Drawing.Point(289, 265);
this.label22.Name = "label22";
this.label22.Size = new System.Drawing.Size(98, 17);
this.label22.TabIndex = 14;
this.label22.Text = "获取mark点结果";
//
// button14 // button14
// //
this.button14.Location = new System.Drawing.Point(570, 140); this.button14.Location = new System.Drawing.Point(570, 140);
...@@ -742,7 +751,7 @@ ...@@ -742,7 +751,7 @@
this.button2.Name = "button2"; this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(146, 41); this.button2.Size = new System.Drawing.Size(146, 41);
this.button2.TabIndex = 1; this.button2.TabIndex = 1;
this.button2.Text = "②配置模板抽屉位置"; this.button2.Text = "②配置抽屉位置";
this.button2.UseVisualStyleBackColor = true; this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click); this.button2.Click += new System.EventHandler(this.button2_Click);
// //
...@@ -761,15 +770,6 @@ ...@@ -761,15 +770,6 @@
this.timer1.Interval = 1000; this.timer1.Interval = 1000;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick); this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
// //
// label22
//
this.label22.AutoSize = true;
this.label22.Location = new System.Drawing.Point(289, 265);
this.label22.Name = "label22";
this.label22.Size = new System.Drawing.Size(98, 17);
this.label22.TabIndex = 14;
this.label22.Text = "获取mark点结果";
//
// FrmAutoFindPos // FrmAutoFindPos
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
......
...@@ -275,13 +275,13 @@ namespace OnlineStore.XLRStore ...@@ -275,13 +275,13 @@ namespace OnlineStore.XLRStore
bool rtn = false ; bool rtn = false ;
if(posSide.Equals("AA")) if(posSide.Equals("AA"))
{ {
rtn=boxEquip.AcqImage(0,out bitmap); bitmap = boxEquip.AcqImage("box_A");
} }
else else
{ {
rtn = boxEquip.AcqImage(1, out bitmap); bitmap = boxEquip.AcqImage("box_B");
} }
if(rtn) if(bitmap!=null)
{ {
int res = AutoFindPos.GetMarkInfo(bitmap, out eyemLib_Sharp.EyemLibDemo.EyemOcsFXYR eyemOcsFXYR); int res = AutoFindPos.GetMarkInfo(bitmap, out eyemLib_Sharp.EyemLibDemo.EyemOcsFXYR eyemOcsFXYR);
if (res == 0) if (res == 0)
......
...@@ -52,11 +52,12 @@ namespace OnlineStore.XLRStore ...@@ -52,11 +52,12 @@ namespace OnlineStore.XLRStore
/// <param name="cameraArgs"></param> /// <param name="cameraArgs"></param>
private void BoxBean_camera_event(CameraArgs cameraArgs) private void BoxBean_camera_event(CameraArgs cameraArgs)
{ {
if(cameraArgs.Index.Equals(0)) LogUtil.info($"事件触发{cameraArgs.CamName} 取图");
if(cameraArgs.CamName.Equals("box_A"))
{ {
pictureBox1.Image = cameraArgs.Image; pictureBox1.Image = cameraArgs.Image;
} }
else if(cameraArgs.Index.Equals(1)) else if(cameraArgs.CamName.Equals("box_B"))
{ {
pictureBox2.Image = cameraArgs.Image; pictureBox2.Image = cameraArgs.Image;
} }
...@@ -204,80 +205,89 @@ namespace OnlineStore.XLRStore ...@@ -204,80 +205,89 @@ namespace OnlineStore.XLRStore
{ {
btnIgnoreCam.Visible = false; btnIgnoreCam.Visible = false;
} }
// ReadIOList(); ReadIOList();
// ReadBtnDO(); //ReadBtnDO();
// clampJawControl1.UpdateSta(); // clampJawControl1.UpdateSta();
// lblName.BackColor = boxBean.GetShowColor(); lblName.BackColor = boxBean.GetShowColor();
// if (boxBean.runStatus > RunStatus.Wait) if (boxBean.runStatus > RunStatus.Wait)
// { {
// if (btnStart.Enabled) if (btnStart.Enabled)
// { {
// FormStatus(true); FormStatus(true);
// } }
// } }
// else else
// { {
// if (!btnStart.Enabled) if (!btnStart.Enabled)
// { {
// FormStatus(false); FormStatus(false);
// } }
// } }
// if (boxBean.MoveInfo.MoveType.Equals(MoveType.InStore) || boxBean.MoveInfo.MoveType.Equals(MoveType.OutStore)) if (boxBean.MoveInfo.MoveType.Equals(MoveType.InStore) || boxBean.MoveInfo.MoveType.Equals(MoveType.OutStore))
// { {
// if (!boxBean.OnlyProOutTray) // if (!boxBean.OnlyProOutTray)
// { {
// lblInoutInfo.Text = (boxBean.MoveInfo.MoveType.Equals(MoveType.InStore) ? "入库:" : "出库:") + boxBean.MoveInfo.MoveParam.ToStr(); lblInoutInfo.Text = (boxBean.MoveInfo.MoveType.Equals(MoveType.InStore) ? "入库:" : "出库:") + boxBean.MoveInfo.MoveParam.PosInfo.ToStr();
// } }
// else //else
// { //{
// lblInoutInfo.Text = "出料:" + boxBean.MoveInfo.MoveParam.ToStr(); // lblInoutInfo.Text = "出料:" + boxBean.MoveInfo.MoveParam.PosInfo.ToStr();
// } //}
// } }
// else else
// { {
// lblInoutInfo.Text = ""; lblInoutInfo.Text = "";
// } }
// lblMoveInfo.Text = boxBean.GetMoveStr() + "料仓类型:" + (boxBean.Config.IsBigTray.Equals(1) ? "大料盘" : "小料盘"); lblMoveInfo.Text = boxBean.GetMoveStr();//+ "料仓类型:" + (boxBean.Config.IsBigTray.Equals(1) ? "大料盘" : "小料盘");
// string canOut = StoreManager.XLRStore.CanOutStore(boxBean.DeviceID) ? "可出库" : "不可出库"; //string canOut = boxBean.CanOutStore(boxBean.DeviceID) ? "可出库" : "不可出库";
// lblStoreStatus.Text = KTK_Store.GetRunStr(boxBean.runStatus) + "(" + canOut + ")"; lblStoreStatus.Text = DeviceBase.GetRunStr(boxBean.runStatus);// + "(" + canOut + ")";
// lblThisSta.Text = boxBean.WarnMsg; lblThisSta.Text =boxBean.WarnMsg;
// string text = ""; string text = "";
// if (!boxBean.OnlyProOutTray) // if (!boxBean.OnlyProOutTray)
// { {
// List<InOutParam> ps = new List<InOutParam>(boxBean.waitInStoreList); //List<InOutParam> ps = new List<InOutParam>(boxBean.waitInStoreList);
// if (ps.Count > 0) //if (ps.Count > 0)
// { //{
// text = "等待入库列表:\r"; // text = "等待入库列表:\r";
// foreach (InOutParam param in ps) // foreach (InOutParam param in ps)
// { // {
// text += param.ToStr() + "\r"; // text += param.ToStr() + "\r";
// } // }
// } //}
// else //else
// { {
// ps = new List<InOutParam>(boxBean.waitOutStoreList); List<InOutParam> psA = new List<InOutParam>(boxBean.waitAOutStoreList);
// if (ps.Count > 0) if (psA.Count > 0)
// { {
// text = "等待出库列表:\r"; text = "A面等待出库列表:\r";
// foreach (InOutParam param in ps) foreach (InOutParam param in psA)
// { {
// text += param.ToStr() + "\r"; text += param.PosInfo.ToStr() + "\r";
// } }
// } }
// } List<InOutParam> psB = new List<InOutParam>(boxBean.waitBOutStoreList);
// } if (psB.Count > 0)
// if (!lblInstoreList.Text.Equals(text)) {
// { text = "B面等待出库列表:\r";
// lblInstoreList.Text = text; foreach (InOutParam param in psB)
// } {
// if (boxBean.IsNoReelAlarm() && (!boxBean.ClampEmptyMove)) text += param.PosInfo.ToStr() + "\r";
// { }
// btnHlhasReel.Visible = true; }
// } }
// else }
// { if (!lblInstoreList.Text.Equals(text))
// btnHlhasReel.Visible = false; {
// } lblInstoreList.Text = text;
}
//if (boxBean.IsNoReelAlarm() && (!boxBean.ClampEmptyMove))
//{
// btnHlhasReel.Visible = true;
//}
//else
//{
// btnHlhasReel.Visible = false;
//}
} }
catch (Exception ex) catch (Exception ex)
{ {
...@@ -410,7 +420,8 @@ namespace OnlineStore.XLRStore ...@@ -410,7 +420,8 @@ namespace OnlineStore.XLRStore
private void btnStop_Click(object sender, EventArgs e) private void btnStop_Click(object sender, EventArgs e)
{ {
LogUtil.info(boxBean.Name + "点击:停止"); LogUtil.info(boxBean.Name + "点击:停止");
StopRun(); System.Threading.Tasks.Task.Factory.StartNew(StopRun);
//StopRun();
} }
private void btnReset_Click(object sender, EventArgs e) private void btnReset_Click(object sender, EventArgs e)
{ {
...@@ -491,16 +502,17 @@ namespace OnlineStore.XLRStore ...@@ -491,16 +502,17 @@ namespace OnlineStore.XLRStore
private void btnDebugAxis_Click(object sender, EventArgs e) private void btnDebugAxis_Click(object sender, EventArgs e)
{ {
//boxBean.IsDebug
if (frmAxisMove == null) if (frmAxisMove == null)
{ {
frmAxisMove = new FrmAxisMove(boxBean.IsDebug); frmAxisMove = new FrmAxisMove(true);
frmAxisMove.Show(); frmAxisMove.Show();
} }
else else
{ {
if (frmAxisMove.IsDisposed) if (frmAxisMove.IsDisposed)
{ {
frmAxisMove = new FrmAxisMove(boxBean.IsDebug); frmAxisMove = new FrmAxisMove(true);
frmAxisMove.Show(); frmAxisMove.Show();
} }
else else
......
...@@ -583,9 +583,9 @@ ...@@ -583,9 +583,9 @@
this.btnDelMove.BackColor = System.Drawing.SystemColors.Control; this.btnDelMove.BackColor = System.Drawing.SystemColors.Control;
this.btnDelMove.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnDelMove.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnDelMove.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnDelMove.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnDelMove.Location = new System.Drawing.Point(303, 180); this.btnDelMove.Location = new System.Drawing.Point(312, 181);
this.btnDelMove.Name = "btnDelMove"; this.btnDelMove.Name = "btnDelMove";
this.btnDelMove.Size = new System.Drawing.Size(140, 45); this.btnDelMove.Size = new System.Drawing.Size(146, 45);
this.btnDelMove.TabIndex = 332; this.btnDelMove.TabIndex = 332;
this.btnDelMove.Text = "点动-(上升)"; this.btnDelMove.Text = "点动-(上升)";
this.btnDelMove.UseVisualStyleBackColor = false; this.btnDelMove.UseVisualStyleBackColor = false;
...@@ -641,7 +641,7 @@ ...@@ -641,7 +641,7 @@
this.btnAddMove.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnAddMove.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnAddMove.Location = new System.Drawing.Point(160, 180); this.btnAddMove.Location = new System.Drawing.Point(160, 180);
this.btnAddMove.Name = "btnAddMove"; this.btnAddMove.Name = "btnAddMove";
this.btnAddMove.Size = new System.Drawing.Size(140, 45); this.btnAddMove.Size = new System.Drawing.Size(146, 45);
this.btnAddMove.TabIndex = 330; this.btnAddMove.TabIndex = 330;
this.btnAddMove.Text = "点动+(下降)"; this.btnAddMove.Text = "点动+(下降)";
this.btnAddMove.UseVisualStyleBackColor = false; this.btnAddMove.UseVisualStyleBackColor = false;
......
...@@ -147,23 +147,59 @@ namespace OnlineStore.XLRStore ...@@ -147,23 +147,59 @@ namespace OnlineStore.XLRStore
txtAxisDeviceName.Text = PortName; txtAxisDeviceName.Text = PortName;
txtAxisValue.Text = SlvAddr.ToString(); txtAxisValue.Text = SlvAddr.ToString();
Color color = Color.Black; Color color = Color.Black;
if (cmbAxis.SelectedIndex.Equals(0))
{ switch (cmbAxis.Items[cmbAxis.SelectedIndex].ToString())
btnAddMove.Text = "点动+(下降)";
btnDelMove.Text = "点动-(上升)";
color = Color.Blue;
}
else if (cmbAxis.SelectedIndex.Equals(1))
{ {
btnAddMove.Text = "点动+(上升)"; case "行走机构":
btnDelMove.Text = "点动-(下降)"; btnAddMove.Text = "点动+(前进)";
//txtASpeed.Text = "1000"; btnDelMove.Text = "点动-(后退)";
//txtjogSpeed.Text = "1000"; break;
color = Color.Green; case "料斗拉取进出轴":
btnAddMove.Text = "点动+(左移A侧)";
btnDelMove.Text = "点动-(右移B侧)";
break;
case "移栽升降轴":
case "料斗拉取升降轴":
btnAddMove.Text = "点动+(上升)";
btnDelMove.Text = "点动-(下降)";
break;
case "A面移栽X轴":
case "B面移栽X轴":
btnAddMove.Text = "点动+(后退)";
btnDelMove.Text = "点动-(前进)";
break;
case "A面移栽旋转轴":
case "B面移栽旋转轴":
btnAddMove.Text = "点动+(叉子水平)";
btnDelMove.Text = "点动-(叉子垂直)";
break;
case "A面移栽压紧轴":
case "B面移栽压紧轴":
btnAddMove.Text = "点动+(放松)";
btnDelMove.Text = "点动-(夹紧)";
break;
default:
btnAddMove.Text = "点动+";
btnDelMove.Text = "点动-";
break;
} }
txtASpeed.Text =(currSelAxis.TargetSpeed/2).ToString(); //if (cmbAxis.SelectedIndex.Equals(0))
txtMiddleSpeed.Text = (currSelAxis.TargetSpeed / 2).ToString(); //{
// btnAddMove.Text = "点动+(下降)";
// btnDelMove.Text = "点动-(上升)";
// color = Color.Blue;
//}
//else if (cmbAxis.SelectedIndex.Equals(1))
//{
// btnAddMove.Text = "点动+(上升)";
// btnDelMove.Text = "点动-(下降)";
// //txtASpeed.Text = "1000";
// //txtjogSpeed.Text = "1000";
// color = Color.Green;
//}
txtASpeed.Text =(currSelAxis.TargetSpeed).ToString();
txtMiddleSpeed.Text = (currSelAxis.TargetSpeed).ToString();
btnOpenAxis.ForeColor = color; btnOpenAxis.ForeColor = color;
btnCloseAxis.ForeColor = color; btnCloseAxis.ForeColor = color;
btnAxisAMove.ForeColor = color; btnAxisAMove.ForeColor = color;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!