Commit 1c77410c LN

扫码修改。hy9逻辑修改。大料逻辑优化

1 个父辈 bc9097e3
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件太大,无法显示。
此文件类型无法预览
......@@ -121,9 +121,21 @@
<Compile Include="server\LineServer.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="eyemLib.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="halcon.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="libdmtx.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="opencv_world420.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="zxing.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Common\Common.csproj">
......
......@@ -897,6 +897,25 @@ namespace OnlineStore.DeviceLibrary
return true;
}
}
else if (tray.InOrOutStore.Equals(2))
{
//紧急料,分盘料直接横移
if (tray.InoutPar.cutReel || tray.InoutPar.urgentReel)
{
return true;
}
else
{
if (tray.InoutPar.smallReel)
{
if (tray.InoutPar.rfidLoc >= 70 && tray.InoutPar.rfidLoc <= 72)
{
// 70,71,72时只能分配到3 / 4号皮带线;
return true;
}
}
}
}
}
}
......
......@@ -497,9 +497,9 @@ namespace OnlineStore.DeviceLibrary
bool isFull = TrayManager.TrayIsFull(currTrayNum);
if (isFull)
{
return false ;
return false;
}
bool moveOk = (IsBigStore() && MoveInfo.MoveStep >= LineMoveStep.MO_55_CylinderUp) || MoveInfo.MoveStep >= LineMoveStep.MO_57_CylinderAfter;
bool moveOk = (IsBigStore() && MoveInfo.MoveStep >= LineMoveStep.MO_56_ClampCheck && MoveInfo.IsInWait.Equals(false)) || MoveInfo.MoveStep >= LineMoveStep.MO_57_CylinderAfter;
if (MoveInfo.MoveType.Equals(LineMoveType.OutStore) && moveOk
&& (!MoveInfo.IsStep(LineMoveStep.MO_60_CylinderUp)))
{
......@@ -518,7 +518,7 @@ namespace OnlineStore.DeviceLibrary
{
return false;
}
bool moveOk = (IsBigStore() && MoveInfo.MoveStep >= LineMoveStep.MO_55_CylinderUp) || MoveInfo.MoveStep >= LineMoveStep.MO_57_CylinderAfter;
bool moveOk = (IsBigStore() && MoveInfo.MoveStep >= LineMoveStep.MO_56_ClampCheck && MoveInfo.IsInWait.Equals(false)) || MoveInfo.MoveStep >= LineMoveStep.MO_57_CylinderAfter;
if (MoveInfo.MoveType.Equals(LineMoveType.OutStore) && moveOk
&& (!MoveInfo.IsStep(LineMoveStep.MO_60_CylinderUp)))
{
......
......@@ -120,12 +120,13 @@ namespace OnlineStore.DeviceLibrary
{
LogUtil.info(deviceName + " 【" + cameraName + "】开始取图片");
}
Bitmap bmp = null;
HalconDotNet.HObject ho_Image = null;
bool findRightCode = false;
try
{
ho_Image = Camera._cam.CaptureOnImage(cameraName );
if ( ho_Image == null)
ho_Image = Camera._cam.CaptureOnImage(cameraName, out bmp);
if (ho_Image == null)
{
LogUtil.error(deviceName + " 【" + cameraName + "】取图片失败[" + Camera._cam.ErrInfo + "],关闭相机");
CloseCamera(cameraName);
......@@ -133,41 +134,64 @@ namespace OnlineStore.DeviceLibrary
}
LogUtil.debug(deviceName + " 【" + cameraName + "】取图片完成,开始扫码");
List<CodeInfo> cc = new List<CodeInfo>();
string r = "";
foreach (string codeType in codeTypeList)
List<CodeInfo> tlci = EyemDecode.Decoder(ref bmp);
bool eyemNoCode = false;
foreach (CodeInfo code in tlci)
{
//判断是否是一维码
if (codeType.ToLower().Equals("barcode"))
{
cc = HDCodeHelper.DecodeBarCode(ho_Image);
}
else
LogUtil.info(deviceName + " 【" + cameraName + "】[eyemDecode]" + code.CodeType + "(X: " + code.X + ",Y: " + code.Y + ") " + code.CodeStr);
string str = CodeManager.ReplaceCode(code.CodeStr);
if (!codeList.Contains(str))
{
cc = HDCodeHelper.DecodeCode(ho_Image, codeType, GetCodeParamFilePath(codeType), codeCount, timeOut);
codeList.Add(str);
r = r + "##eyem|" + code.CodeType + "|" + str;
if (!findRightCode)
{
findRightCode = HasRightCode(str);
}
}
foreach (CodeInfo c in cc)
}
List<CodeInfo> cc = new List<CodeInfo>();
if (!findRightCode)
{
eyemNoCode = true;
foreach (string codeType in codeTypeList)
{
string str = CodeManager.ReplaceCode(c.CodeStr);
if (!codeList.Contains(str))
//判断是否是一维码
if (codeType.ToLower().Equals("barcode"))
{
codeList.Add(str);
r = r + "##" + str;
if (!findRightCode)
cc = HDCodeHelper.DecodeBarCode(ho_Image);
}
else
{
cc = HDCodeHelper.DecodeCode(ho_Image, codeType, GetCodeParamFilePath(codeType), codeCount, timeOut);
}
foreach (CodeInfo c in cc)
{
string str = CodeManager.ReplaceCode(c.CodeStr);
if (!codeList.Contains(str))
{
findRightCode = HasRightCode(str);
codeList.Add(str);
r = r + "##halcon|" + codeType + "|" + str;
if (!findRightCode)
{
findRightCode = HasRightCode(str);
}
}
}
}
if (findRightCodeBreak && findRightCode)
{
break;
if (findRightCodeBreak && findRightCode)
{
break;
}
}
}
if (!findRightCode&& SaveErrorImageToFile.Equals(1))
//if (!findRightCode && SaveErrorImageToFile.Equals(1))
if ( !findRightCode)
{
SaveImageToFile(deviceName, cameraName, ho_Image);
SaveImageToFile(deviceName, cameraName + (eyemNoCode ? "eyem" : ""), bmp);
}
if (deviceName != "" || r != "")
{
......@@ -209,7 +233,6 @@ namespace OnlineStore.DeviceLibrary
}
return codeList;
}
private static int SaveErrorImageToFile = ConfigAppSettings.GetIntValue(Setting_Init.SaveErrorImageToFile);
private static void SaveImageToFile(string deviceName, string cameraName, HalconDotNet.HObject bitmap)
......
此文件类型无法预览
此文件类型无法预览
此文件太大,无法显示。
此文件类型无法预览
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!