Commit 2b73e912 LN

增加单盘出库相机扫码拍照功能。

1 个父辈 24878c85
...@@ -636,13 +636,19 @@ ...@@ -636,13 +636,19 @@
区域特征 区域特征
</summary> </summary>
</member> </member>
<member name="M:Asa.Region.Feature.#ctor(System.String,System.String)"> <member name="M:Asa.Region.Feature.#ctor(System.String,System.String,System.String)">
<summary> <summary>
区域特征 区域特征
</summary> </summary>
<param name="configPath"></param> <param name="configPath"></param>
<param name="cameraName"></param>
<param name="logName"></param> <param name="logName"></param>
</member> </member>
<member name="P:Asa.Region.Feature.CameraName">
<summary>
相机名称
</summary>
</member>
<member name="M:Asa.Region.Feature.OriginalImage(System.Drawing.Bitmap)"> <member name="M:Asa.Region.Feature.OriginalImage(System.Drawing.Bitmap)">
<summary> <summary>
原始图像 原始图像
...@@ -699,6 +705,12 @@ ...@@ -699,6 +705,12 @@
相机数量 相机数量
</summary> </summary>
</member> </member>
<member name="M:Asa.Camera.VisionLib.GetCameraName">
<summary>
获取相机名称
</summary>
<returns></returns>
</member>
<member name="M:Asa.Camera.VisionLib.Open"> <member name="M:Asa.Camera.VisionLib.Open">
<summary> <summary>
打开 打开
...@@ -715,6 +727,13 @@ ...@@ -715,6 +727,13 @@
</summary> </summary>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Asa.Camera.VisionLib.GetImage(System.String)">
<summary>
获取当前图像
</summary>
<param name="cameraName"></param>
<returns></returns>
</member>
<member name="M:Asa.Camera.VisionLib.SaveImage(System.String,System.String,System.Drawing.Imaging.ImageFormat)"> <member name="M:Asa.Camera.VisionLib.SaveImage(System.String,System.String,System.Drawing.Imaging.ImageFormat)">
<summary> <summary>
保存当前图像 保存当前图像
...@@ -723,6 +742,15 @@ ...@@ -723,6 +742,15 @@
<param name="fileName">文件名,不带扩展名</param> <param name="fileName">文件名,不带扩展名</param>
<param name="format">图像类型</param> <param name="format">图像类型</param>
</member> </member>
<member name="M:Asa.Camera.VisionLib.SaveImage(System.String,System.String,System.String,System.Drawing.Imaging.ImageFormat)">
<summary>
保存当前图像
</summary>
<param name="cameraName">相机名称</param>
<param name="path">文件夹路径</param>
<param name="fileName">文件名,不带扩展名</param>
<param name="format">图像类型</param>
</member>
<member name="M:Asa.Camera.VisionLib.GetBarCodeText(System.Collections.Generic.List{System.Drawing.Bitmap}@)"> <member name="M:Asa.Camera.VisionLib.GetBarCodeText(System.Collections.Generic.List{System.Drawing.Bitmap}@)">
<summary> <summary>
从相机图像获取条码 从相机图像获取条码
...@@ -730,6 +758,14 @@ ...@@ -730,6 +758,14 @@
<param name="image"></param> <param name="image"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Asa.Camera.VisionLib.GetBarCodeText(System.String,System.Drawing.Bitmap@)">
<summary>
从相机图像获取条码
</summary>
<param name="cameraName"></param>
<param name="image"></param>
<returns></returns>
</member>
<member name="M:Asa.Camera.VisionLib.GetBarCodeText(System.Drawing.Bitmap)"> <member name="M:Asa.Camera.VisionLib.GetBarCodeText(System.Drawing.Bitmap)">
<summary> <summary>
从给定的图像中获取条码文本 从给定的图像中获取条码文本
...@@ -751,6 +787,14 @@ ...@@ -751,6 +787,14 @@
<param name="image"></param> <param name="image"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Asa.Camera.VisionLib.GetBarCode(System.String,System.Drawing.Bitmap@)">
<summary>
从相机图像获取条码
</summary>
<param name="cameraName"></param>
<param name="image"></param>
<returns></returns>
</member>
<member name="M:Asa.Camera.VisionLib.GetBarCode(System.Drawing.Bitmap)"> <member name="M:Asa.Camera.VisionLib.GetBarCode(System.Drawing.Bitmap)">
<summary> <summary>
从给定的图像中获取条码 从给定的图像中获取条码
...@@ -786,6 +830,23 @@ ...@@ -786,6 +830,23 @@
<param name="exist"></param> <param name="exist"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="F:Asa.Camera.FrmOpenCamera.components">
<summary>
Required designer variable.
</summary>
</member>
<member name="M:Asa.Camera.FrmOpenCamera.Dispose(System.Boolean)">
<summary>
Clean up any resources being used.
</summary>
<param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
</member>
<member name="M:Asa.Camera.FrmOpenCamera.InitializeComponent">
<summary>
Required method for Designer support - do not modify
the contents of this method with the code editor.
</summary>
</member>
<member name="F:Asa.Camera.FrmSetting.components"> <member name="F:Asa.Camera.FrmSetting.components">
<summary> <summary>
Required designer variable. Required designer variable.
......
{
"CodeOrder":"HalconOnly",
"Halcon":
{
"CodeType":"All",
"Zoom1DCode":"1.5",
"Zoom2DCode":"1.5"
},
"EyemLib":
{
"CodeType":"All",
"BlockSize":"11",
"RangeC":"5",
"SymbolMin":"128",
"SymbolMax":"215"
},
"Region":
[
{
"Name":"LeftTop",
"X":"0",
"Y":"0",
"Width":"1000",
"Height":"1000",
"Ratio":"0.3"
},
{
"Name":"RightTop",
"X":"500",
"Y":"0",
"Width":"110",
"Height":"110",
"Ratio":"0.4"
}
],
"HIKIPCamera":
[
{
"Name":"monitor",
"IP":"192.168.1.64",
"User":"admin",
"Pwd":"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":[{"CameraName":"monitor","RegionName":"LeftTop","X":76,"Y":172,"Width":416,"Height":479,"Ratio":0.5},{"CameraName":"monitor","RegionName":"RightTop","X":555,"Y":170,"Width":286,"Height":202,"Ratio":0.4},{"CameraName":"monitor","RegionName":"name1","X":526,"Y":424,"Width":640,"Height":375,"Ratio":0.7}],"HIKIPCamera":[{"Name":"monitor","IP":"192.168.1.64","Port":"8000","User":"admin","Pwd":"qwert2asdfg"},{"Name":"photoCamera","IP":"192.168.1.121","Port":"8000","User":"admin","Pwd":"admin123"}]}
\ No newline at end of file \ No newline at end of file
...@@ -224,6 +224,10 @@ namespace OnlineStore.Common ...@@ -224,6 +224,10 @@ namespace OnlineStore.Common
public static string rfidLoc = "rfidLoc"; public static string rfidLoc = "rfidLoc";
public static string barcode = "barcode"; public static string barcode = "barcode";
/// <summary>
/// 是否是单个出库,true表示单个出库,其他都是批量出库
/// </summary>
public static string singleOut = "singleOut";
} }
} }
...@@ -37,3 +37,4 @@ PRO,,每次吹气的时间(分钟),BlowAir_Time,10,,,,,,,,,,,, ...@@ -37,3 +37,4 @@ PRO,,每次吹气的时间(分钟),BlowAir_Time,10,,,,,,,,,,,,
PRO,,两次吹气间隔(分钟),BlowAir_Interval,10,,, ,,,,,,,,, PRO,,两次吹气间隔(分钟),BlowAir_Interval,10,,, ,,,,,,,,,
PRO,,温湿度端口号,Humiture_Port,COM5,,,,,,,,,,,, PRO,,温湿度端口号,Humiture_Port,COM5,,,,,,,,,,,,
PRO,,仓门口相机名称,Camera_Name,,,,,,,,,,,,, PRO,,仓门口相机名称,Camera_Name,,,,,,,,,,,,,
PRO,,拍照相机名称,PhotoCamera_Name,,,,,,,,,,,,,
...@@ -37,3 +37,4 @@ PRO,,每次吹气的时间(分钟),BlowAir_Time,10,,,,,,,,,,,, ...@@ -37,3 +37,4 @@ PRO,,每次吹气的时间(分钟),BlowAir_Time,10,,,,,,,,,,,,
PRO,,两次吹气间隔(分钟),BlowAir_Interval,10,,, ,,,,,,,,, PRO,,两次吹气间隔(分钟),BlowAir_Interval,10,,, ,,,,,,,,,
PRO,,温湿度端口号,Humiture_Port,COM5,,,,,,,,,,,, PRO,,温湿度端口号,Humiture_Port,COM5,,,,,,,,,,,,
PRO,,仓门口相机名称,Camera_Name,monitor,,,,,,,,,,,, PRO,,仓门口相机名称,Camera_Name,monitor,,,,,,,,,,,,
PRO,,拍照相机名称,PhotoCamera_Name,monitor,,,,,,,,,,,,
...@@ -1324,6 +1324,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1324,6 +1324,7 @@ namespace OnlineStore.DeviceLibrary
string rfid = data.ContainsKey(ParamDefine.rfid) ? data[ParamDefine.rfid] : ""; string rfid = data.ContainsKey(ParamDefine.rfid) ? data[ParamDefine.rfid] : "";
int rfidLoc = FormUtil.GetIntData(data, ParamDefine.rfidLoc); int rfidLoc = FormUtil.GetIntData(data, ParamDefine.rfidLoc);
string barcode = data.ContainsKey(ParamDefine.barcode) ? data[ParamDefine.barcode] : ""; string barcode = data.ContainsKey(ParamDefine.barcode) ? data[ParamDefine.barcode] : "";
bool singleOut= FormUtil.GetBoolData(data, ParamDefine.singleOut);
//urgentReel: true 表示紧急料,需要出到料串上 //urgentReel: true 表示紧急料,需要出到料串上
//cutReel: true 表示分盘料,需要出到料串上 //cutReel: true 表示分盘料,需要出到料串上
//smallReel: true 小料(7x8),放置到小料架上 //smallReel: true 小料(7x8),放置到小料架上
...@@ -1342,7 +1343,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1342,7 +1343,7 @@ namespace OnlineStore.DeviceLibrary
int plateW = StrToInt(plateWStr); int plateW = StrToInt(plateWStr);
int plateH = StrToInt(plateHStr); int plateH = StrToInt(plateHStr);
InOutPosInfo intouInfo = new InOutPosInfo(barcode, posId, plateW, plateH, urgentReel, cutReel, smallReel, rfid, rfidLoc); InOutPosInfo intouInfo = new InOutPosInfo(barcode, posId, plateW, plateH, urgentReel, cutReel, smallReel, rfid, rfidLoc, singleOut);
//根据发送的posId获取位置列表 //根据发送的posId获取位置列表
ACStorePosition position = CSVPositionReader<ACStorePosition>.GetPositon(posId); ACStorePosition position = CSVPositionReader<ACStorePosition>.GetPositon(posId);
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
using OnlineStore.LoadCSVLibrary; using OnlineStore.LoadCSVLibrary;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing.Imaging;
using System.IO;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
...@@ -264,6 +266,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -264,6 +266,9 @@ namespace OnlineStore.DeviceLibrary
//{ //{
// LogUtil.debug("等待height=" + wait.HeightValue + "完成"); // LogUtil.debug("等待height=" + wait.HeightValue + "完成");
//} //}
}else if (wait.WaitType == 8)
{
wait.IsEnd = VisionComp( out Dictionary<string, bool> exist);
} }
if (wait.IsEnd) if (wait.IsEnd)
{ {
...@@ -592,6 +597,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -592,6 +597,7 @@ namespace OnlineStore.DeviceLibrary
#region 出库 #region 出库
private bool EmptyOut = false;
private DateTime startOutStoreTime = DateTime.Now; private DateTime startOutStoreTime = DateTime.Now;
/// <summary> /// <summary>
/// 开始出库运动 /// 开始出库运动
...@@ -612,6 +618,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -612,6 +618,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error( Name + " 启动出库【" + posId + "】出错,叉子料盘检测有料"); LogUtil.error( Name + " 启动出库【" + posId + "】出错,叉子料盘检测有料");
return false; return false;
} }
EmptyOut = false;
storeStatus = StoreStatus.OutStoreExecute; storeStatus = StoreStatus.OutStoreExecute;
LogInfo( "启动出库【" + posId + "】 " ); LogInfo( "启动出库【" + posId + "】 " );
storeRunStatus = StoreRunStatus.Busy; storeRunStatus = StoreRunStatus.Busy;
...@@ -680,6 +687,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -680,6 +687,7 @@ namespace OnlineStore.DeviceLibrary
{ {
if (IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.LOW)) if (IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.LOW))
{ {
EmptyOut = true ;
string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosInfo.PosId : ""; string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosInfo.PosId : "";
CodeMsg = "出库[" + posId + "]叉子从库位退出后,未检测到料叉有料"; CodeMsg = "出库[" + posId + "]叉子从库位退出后,未检测到料叉有料";
LogUtil.error(CodeMsg); LogUtil.error(CodeMsg);
...@@ -725,6 +733,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -725,6 +733,11 @@ namespace OnlineStore.DeviceLibrary
#region 出库定位动作 #region 出库定位动作
else if (MoveInfo.MoveStep == StoreMoveStep.SOL_11_MoveToBag) else if (MoveInfo.MoveStep == StoreMoveStep.SOL_11_MoveToBag)
{ {
//TODO 如果是空出需要拍张照片1保存
if (MoveInfo.MoveParam.PosInfo.singleOut)
{
CamerSaveImg(MoveInfo.MoveParam.PosInfo.PosId, 1);
}
MoveInfo.NextMoveStep(StoreMoveStep.SOL_12_InoutToP3); MoveInfo.NextMoveStep(StoreMoveStep.SOL_12_InoutToP3);
int p = MoveInfo.MoveParam.LocationPos.InOutAxis_Position_P3; int p = MoveInfo.MoveParam.LocationPos.InOutAxis_Position_P3;
OutStoreLog("出库定位:进出轴到P3(库位取放料点)[" + p + "] "); OutStoreLog("出库定位:进出轴到P3(库位取放料点)[" + p + "] ");
...@@ -784,6 +797,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -784,6 +797,11 @@ namespace OnlineStore.DeviceLibrary
} }
else if (MoveInfo.MoveStep == StoreMoveStep.SOL_20_InoutToP1) else if (MoveInfo.MoveStep == StoreMoveStep.SOL_20_InoutToP1)
{ {
//TODO 如果是空出需要拍张照片2保存
if (MoveInfo.MoveParam.PosInfo.singleOut)
{
CamerSaveImg(MoveInfo.MoveParam.PosInfo.PosId, 2);
}
SO_21_ToDoorP(); SO_21_ToDoorP();
} }
...@@ -830,36 +848,31 @@ namespace OnlineStore.DeviceLibrary ...@@ -830,36 +848,31 @@ namespace OnlineStore.DeviceLibrary
} }
else if (MoveInfo.MoveStep == StoreMoveStep.SO_26_CloseDoor) else if (MoveInfo.MoveStep == StoreMoveStep.SO_26_CloseDoor)
{ {
MoveInfo.NextMoveStep(StoreMoveStep.SO_27_CheckTray); if (IOValue(IO_Type.TrayCheck_Door).Equals(IO_VALUE.HIGH))
OutStoreLog("出库:检测料仓门口料盘信号 "); {
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Door, IO_VALUE.HIGH)); SO_28_GoBack();
//OutStoreLog("出库:检测料仓门口料盘信号 ,最多1000");
//MoveInfo.OneWaitCanEndStep = true;
//MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
//MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Door, IO_VALUE.HIGH));
} }
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.SO_27_CheckTray)) else if (VisionComp(out Dictionary<string, bool> exist))
{ {
//bool isCancel = false; SO_28_GoBack();
//if (IOValue(IO_Type.TrayCheck_Door).Equals(IO_VALUE.LOW)) }
//{ else
// string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosInfo.PosId : "";
// string barcode = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosInfo.barcode : "";
// CodeMsg = "" + posId + "_" + barcode + "_空出";
// LogUtil.error(CodeMsg + ",取消出库任务");
// StoreManager.cancelOutTask(barcode);
// isCancel = true;
//}
//else
{ {
//发送消息给流水线 MoveInfo.NextMoveStep(StoreMoveStep.SO_27_CheckTray);
SendOutStoreEnd(MoveInfo); //OutStoreLog("出库:检测料仓门口料盘信号 ");
//MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Door, IO_VALUE.HIGH));
//MoveInfo.WaitList.Add(WaitResultInfo.WaitVisionComp());
//MoveInfo.OneWaitCanEndStep = true;
OutStoreLog("出库:检测料仓门口料盘信号 ,最多1000");
MoveInfo.OneWaitCanEndStep = true;
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Door, IO_VALUE.HIGH));
} }
MoveInfo.NextMoveStep(StoreMoveStep.SO_28_GoBack); }
OutStoreLog("出库:轴2至P1(待机点)[" + MoveInfo.MoveParam.MoveP.UpDown_P1 + "] ,关闭舱门"); else if (MoveInfo.MoveStep.Equals(StoreMoveStep.SO_27_CheckTray))
ACAxisMove(Config.UpDown_Axis, MoveInfo.MoveParam.MoveP.UpDown_P1, Config.UpDownAxis_P1_Speed); {
CloseDoor(); SO_28_GoBack();
} }
else if (MoveInfo.MoveStep == StoreMoveStep.SO_28_GoBack) else if (MoveInfo.MoveStep == StoreMoveStep.SO_28_GoBack)
...@@ -894,6 +907,77 @@ namespace OnlineStore.DeviceLibrary ...@@ -894,6 +907,77 @@ namespace OnlineStore.DeviceLibrary
} }
} }
private void SO_28_GoBack()
{
bool isCancel = false;
if (IOValue(IO_Type.TrayCheck_Door).Equals(IO_VALUE.LOW))
{
string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosInfo.PosId : "";
string barcode = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosInfo.barcode : "";
//再次检测
bool hasReel = VisionComp(out Dictionary<string, bool> exist);
if (hasReel)
{
LogUtil.error(Name + "" + posId + "_" + barcode + "_料盘到仓门口未检测到信号,但视觉识别有料盘");
}
else
{
if (EmptyOut)
{
CodeMsg = "" + posId + "_" + barcode + "_空出";
LogUtil.error(CodeMsg + ",取消出库任务");
StoreManager.cancelOutTask(barcode);
isCancel = true;
}
else
{
LogUtil.error(Name + "" + posId + "_" + barcode + "_料盘到仓门口未检测到信号");
}
}
}
//未取消任务时,移栽还需要出库
if(!isCancel)
{
//发送消息给流水线
SendOutStoreEnd(MoveInfo);
}
MoveInfo.NextMoveStep(StoreMoveStep.SO_28_GoBack);
OutStoreLog("出库:轴2至P1(待机点)[" + MoveInfo.MoveParam.MoveP.UpDown_P1 + "] ,关闭舱门");
ACAxisMove(Config.UpDown_Axis, MoveInfo.MoveParam.MoveP.UpDown_P1, Config.UpDownAxis_P1_Speed);
CloseDoor();
}
public string CamerSaveImg( string PosId="Test", int imgNum = 0)
{
//判断是否需要拍照
try
{
if (StoreManager.Store.vision != null)
{
if (!String.IsNullOrEmpty(Config.PhotoCamera_Name))
{
string pathName = @"D:\image\" + DateTime.Now.ToString("yyyyMMdd")+@"\";
string photoName = PosId + "_" + imgNum + "_" + DateTime.Now.ToString("HHmmss");
if (!Directory.Exists(pathName))
{
Directory.CreateDirectory(pathName);
}
StoreManager.Store.vision.SaveImage(Config.PhotoCamera_Name, pathName, photoName, ImageFormat.Png);
LogUtil.info("CamerSaveImg 【" + PosId + "_" + imgNum + "】 保存图片:" + pathName + "" + photoName);
return pathName + photoName;
}
}
}
catch (Exception ex)
{
LogUtil.error("CamerSaveImg 【" + PosId + "_" + imgNum + "】 出错:" + ex.ToString());
}
return "";
}
public bool OutCheckAlarm() public bool OutCheckAlarm()
{ {
if (alarmType.Equals(StoreAlarmType.IoSingleTimeOut) && MoveInfo.MoveType.Equals(StoreMoveType.OutStore) && MoveInfo.MoveStep.Equals(StoreMoveStep.SO_27_CheckTray)) if (alarmType.Equals(StoreAlarmType.IoSingleTimeOut) && MoveInfo.MoveType.Equals(StoreMoveType.OutStore) && MoveInfo.MoveStep.Equals(StoreMoveStep.SO_27_CheckTray))
......
...@@ -79,7 +79,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -79,7 +79,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
public class InOutPosInfo public class InOutPosInfo
{ {
public InOutPosInfo(string barcode, string posId, int platew =0, int plateh =0, bool urgentReel = false , bool cutReel = false, bool smallReel = false, string rfid = "", int rfidLoc = 0) public InOutPosInfo(string barcode, string posId, int platew = 0, int plateh = 0, bool urgentReel = false, bool cutReel = false, bool smallReel = false, string rfid = "", int rfidLoc = 0, bool singleOut = false)
{ {
this.barcode = barcode; this.barcode = barcode;
this.PosId = posId; this.PosId = posId;
...@@ -90,6 +90,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -90,6 +90,7 @@ namespace OnlineStore.DeviceLibrary
this.smallReel = smallReel; this.smallReel = smallReel;
this.rfid = rfid; this.rfid = rfid;
this.rfidLoc = rfidLoc; this.rfidLoc = rfidLoc;
this.singleOut = singleOut;
} }
/// <summary> /// <summary>
...@@ -133,10 +134,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -133,10 +134,12 @@ namespace OnlineStore.DeviceLibrary
/// 大料时,架位1 - 6优先走1 / 2号皮带线, 7 - 12优先走3/ 4号皮带线 /// 大料时,架位1 - 6优先走1 / 2号皮带线, 7 - 12优先走3/ 4号皮带线
/// </summary> /// </summary>
public int rfidLoc { get; set; } public int rfidLoc { get; set; }
public bool singleOut = false;
public string ToStr() public string ToStr()
{ {
return " [" + barcode + "] [" + PosId + "] [" + PlateW + "x" + PlateH + "],urgentReel [" + urgentReel return " [" + barcode + "] [" + PosId + "] [" + PlateW + "x" + PlateH + "],urgentReel [" + urgentReel
+ "],cutReel [" + cutReel + "],smallReel [" + smallReel + "],rfid [" + rfid + "],rfidLoc [" + rfidLoc + "]"; + "],cutReel [" + cutReel + "],smallReel [" + smallReel + "],rfid [" + rfid + "],rfidLoc [" + rfidLoc + "],singleOut["+ singleOut + "]";
} }
} }
} }
...@@ -215,7 +215,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -215,7 +215,14 @@ namespace OnlineStore.DeviceLibrary
wait.IsEnd = false; wait.IsEnd = false;
return wait; return wait;
} }
public static WaitResultInfo WaitVisionComp()
{
WaitResultInfo wait = new WaitResultInfo();
wait.CanWhileMoveCount = 0;
wait.WaitType = 8;
wait.IsEnd = false;
return wait;
}
//public static WaitResultInfo WaitHeight(int height) //public static WaitResultInfo WaitHeight(int height)
//{ //{
// WaitResultInfo wait = new WaitResultInfo(); // WaitResultInfo wait = new WaitResultInfo();
...@@ -259,6 +266,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -259,6 +266,9 @@ namespace OnlineStore.DeviceLibrary
}else if (WaitType == 7) }else if (WaitType == 7)
{ {
return "料盘高度【" + HeightValue + "】 "; return "料盘高度【" + HeightValue + "】 ";
}else if (WaitType == 8)
{
return "视觉识别门口有料";
} }
else else
{ {
...@@ -319,6 +329,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -319,6 +329,8 @@ namespace OnlineStore.DeviceLibrary
public int AxisOrgValue = 0; public int AxisOrgValue = 0;
public DateTime LastHasOrgTime = DateTime.Now; public DateTime LastHasOrgTime = DateTime.Now;
} }
public enum StoreMoveType public enum StoreMoveType
{ {
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
<add key="Tool_P6_Offset" value="30" /> <add key="Tool_P6_Offset" value="30" />
<add key="Tool_TargetSpeed" value="20" /> <add key="Tool_TargetSpeed" value="20" />
<add key="Tool_TargetPosition" value="60" /> <add key="Tool_TargetPosition" value="60" />
<add key ="VisionConfigFile" value="\Barcode.json" /> <add key ="VisionConfigFile" value="\Camera.json" />
</appSettings> </appSettings>
<log4net> <log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender"> <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
......
{
"CodeOrder":"HalconOnly",
"Halcon":
{
"CodeType":"All",
"Zoom1DCode":"1.5",
"Zoom2DCode":"1.5"
},
"EyemLib":
{
"CodeType":"All",
"BlockSize":"11",
"RangeC":"5",
"SymbolMin":"128",
"SymbolMax":"215"
},
"Region":
[
{
"Name":"LeftTop",
"X":"0",
"Y":"0",
"Width":"1000",
"Height":"1000",
"Ratio":"0.3"
},
{
"Name":"RightTop",
"X":"500",
"Y":"0",
"Width":"110",
"Height":"110",
"Ratio":"0.4"
}
],
"HIKIPCamera":
[
{
"Name":"monitor",
"IP":"192.168.1.64",
"User":"admin",
"Pwd":"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":[{"CameraName":"monitor","RegionName":"LeftTop","X":76,"Y":172,"Width":416,"Height":479,"Ratio":0.5},{"CameraName":"monitor","RegionName":"RightTop","X":555,"Y":170,"Width":286,"Height":202,"Ratio":0.4},{"CameraName":"monitor","RegionName":"name1","X":526,"Y":424,"Width":640,"Height":375,"Ratio":0.7}],"HIKIPCamera":[{"Name":"monitor","IP":"192.168.1.64","Port":"8000","User":"admin","Pwd":"qwert2asdfg"},{"Name":"photoCamera","IP":"192.168.1.121","Port":"8000","User":"admin","Pwd":"admin123"}]}
\ No newline at end of file \ No newline at end of file
...@@ -47,6 +47,7 @@ namespace OnlineStore.ACSingleStore ...@@ -47,6 +47,7 @@ namespace OnlineStore.ACSingleStore
bool isShow = (!String.IsNullOrEmpty(boxBean.Config.Camera_Name)); bool isShow = (!String.IsNullOrEmpty(boxBean.Config.Camera_Name));
btnFcomp.Visible = isShow; btnFcomp.Visible = isShow;
btnForig.Visible = isShow; btnForig.Visible = isShow;
btnImgSave.Visible = (!String.IsNullOrEmpty(boxBean.Config.PhotoCamera_Name));
LoadOk = true; LoadOk = true;
} }
private void LoadStore() private void LoadStore()
...@@ -1169,5 +1170,11 @@ namespace OnlineStore.ACSingleStore ...@@ -1169,5 +1170,11 @@ namespace OnlineStore.ACSingleStore
MessageBox.Show(str); MessageBox.Show(str);
} }
} }
private void btnImgSave_Click(object sender, EventArgs e)
{
string msg = boxBean.CamerSaveImg();
MessageBox.Show(msg);
}
} }
} }
...@@ -192,7 +192,7 @@ ...@@ -192,7 +192,7 @@
<EmbeddedResource Include="userControl\AxisMoveControl.resx"> <EmbeddedResource Include="userControl\AxisMoveControl.resx">
<DependentUpon>AxisMoveControl.cs</DependentUpon> <DependentUpon>AxisMoveControl.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<None Include="Barcode.json"> <None Include="Camera.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<None Include="Properties\Settings.settings"> <None Include="Properties\Settings.settings">
...@@ -277,6 +277,7 @@ ...@@ -277,6 +277,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup /> <ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<ProjectExtensions />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild"> <Target Name="BeforeBuild">
......
...@@ -94,6 +94,7 @@ ...@@ -94,6 +94,7 @@
BoxConfig增加配置: BoxConfig增加配置:
PRO,,仓门口相机名称,Camera_Name,monitor,,,,,,,,,,,, PRO,,仓门口相机名称,Camera_Name,monitor,,,,,,,,,,,,
PRO,,拍照相机名称,PhotoCamera_Name,monitor,,,,,,,,,,,,
HCSingleStore.exe.config增加配置: HCSingleStore.exe.config增加配置:
<add key ="VisionConfigFile" value="\Barcode.json" /> <add key ="VisionConfigFile" value="\Barcode.json" />
\ No newline at end of file \ No newline at end of file
...@@ -240,6 +240,11 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -240,6 +240,11 @@ namespace OnlineStore.LoadCSVLibrary
public string Camera_Name { get; set; } public string Camera_Name { get; set; }
/// <summary>
/// PRO,,拍照相机名称,PhotoCamera_Name,,,,,,,,,,,,,
/// </summary>
[ConfigProAttribute("PhotoCamera_Name", false)]
public string PhotoCamera_Name { get; set; }
private Dictionary<int, int> CompP2Map = null; private Dictionary<int, int> CompP2Map = null;
public Dictionary<int, int> LoadCompP2Map() public Dictionary<int, int> LoadCompP2Map()
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!