Commit 20ca437b 张东亮

1、入料机构机器人取完料等待问题。2、fr331和fr336兼容问题。3、存储机构入库时移栽x轴动作不同步

1 个父辈 6563da7e
正在显示 34 个修改的文件 包含 568 行增加276 行删除
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion> <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic> <Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
......
...@@ -135,5 +135,6 @@ namespace OnlineStore.Common ...@@ -135,5 +135,6 @@ namespace OnlineStore.Common
public const string LabelInImgAngle_CamA = "LabelInImgAngle_CamA"; public const string LabelInImgAngle_CamA = "LabelInImgAngle_CamA";
public const string LabelInImgAngle_CamB = "LabelInImgAngle_CamB"; public const string LabelInImgAngle_CamB = "LabelInImgAngle_CamB";
public const string UseLabelCheck = "UseLabelCheck"; public const string UseLabelCheck = "UseLabelCheck";
public const string UseFR336P = "UseFR336P";
} }
} }
{
"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.120.122",
"User": "admin",
"Password": "Acc123456",
"Port": 8000
},
{
"Name": "box_B",
"IP": "192.168.108.22",
"User": "admin",
"Password": "Acc123456",
"Port": 8000
}
]
}
\ No newline at end of file \ No newline at end of file
...@@ -5,7 +5,7 @@ PRO,0,设备是否处于调试状态(1=调试,0=正常),IsDebug,0,,,,,,,,, ...@@ -5,7 +5,7 @@ PRO,0,设备是否处于调试状态(1=调试,0=正常),IsDebug,0,,,,,,,,,
PRO,0,是否使用夹爪(1=使用夹爪,0=用吸盘),UseClampJaw,0,,,,,,,,,,,, PRO,0,是否使用夹爪(1=使用夹爪,0=用吸盘),UseClampJaw,0,,,,,,,,,,,,
PRO,0,上料口扫码的相机名称(多个用#分隔),CameraNameList_Shelf,GigE:MV-CE200-10GC (00E70964538),,,,,,,,,,,, PRO,0,上料口扫码的相机名称(多个用#分隔),CameraNameList_Shelf,GigE:MV-CE200-10GC (00E70964538),,,,,,,,,,,,
,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,
PRO,0,周转箱-RFID-IP,PRO_RFIP_001,192.168.101.103#192.168.101.104,,,,,,,,,,,, PRO,0,周转箱-RFID-IP,PRO_RFIP_001,192.168.107.7#192.168.101.104,,,,,,,,,,,,
,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,
PRO,0,AGV小车站号名称_靠近电器板侧,AgvName_A,2#A-1-2,,,,,,,,,,,, PRO,0,AGV小车站号名称_靠近电器板侧,AgvName_A,2#A-1-2,,,,,,,,,,,,
PRO,0,AGV小车站号名称_靠近墙侧,AgvName_B,1#A-1-1,,,,,,,,,,,, PRO,0,AGV小车站号名称_靠近墙侧,AgvName_B,1#A-1-1,,,,,,,,,,,,
......
...@@ -38,6 +38,9 @@ ...@@ -38,6 +38,9 @@
<Prefer32Bit>false</Prefer32Bit> <Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Asa.Camera.VisionLib">
<HintPath>..\..\dll\Asa.Camera.VisionLib.dll</HintPath>
</Reference>
<Reference Include="CodeLibrary"> <Reference Include="CodeLibrary">
<HintPath>..\..\dll\CodeLibrary.dll</HintPath> <HintPath>..\..\dll\CodeLibrary.dll</HintPath>
</Reference> </Reference>
...@@ -66,6 +69,9 @@ ...@@ -66,6 +69,9 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="Config\Camera.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Config\slidePos.data"> <None Include="Config\slidePos.data">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None> </None>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<item key="LabelName" ver="10" value="lizhen" /> <item key="LabelName" ver="10" value="lizhen" />
<item key="AngleChange " ver="10" value="83" /> <item key="AngleChange " ver="10" value="83" />
<!--二维码类型列表配置,用#分割,一维码=Barcode 二维码: QR Code#Data Matrix ECC 200#Micro QR Code--> <!--二维码类型列表配置,用#分割,一维码=Barcode 二维码: QR Code#Data Matrix ECC 200#Micro QR Code-->
<item key="CodeType" value="Data Matrix ECC 200#QR Code"/> <item key="CodeType" value="Data Matrix ECC 200"/>
<!--二维码参数文件所在路径,文件名与二维码类型名一样--> <!--二维码参数文件所在路径,文件名与二维码类型名一样-->
<item key="CodeParamPath" value="\CodeParam\"/> <item key="CodeParamPath" value="\CodeParam\"/>
<!--有效码数量--> <!--有效码数量-->
......
...@@ -85,7 +85,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -85,7 +85,7 @@ namespace OnlineStore.DeviceLibrary
} }
return new List<string>(); return new List<string>();
} }
static bool useFR336P = ConfigAppSettings.GetBoolValue(Setting_Init.UseFR336P, false);
public static RFIDData ReadRFID(string ip) public static RFIDData ReadRFID(string ip)
{ {
try try
...@@ -99,7 +99,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -99,7 +99,12 @@ namespace OnlineStore.DeviceLibrary
RFIDData data; RFIDData data;
if (rtn) if (rtn)
{ {
val = Encoding.UTF8.GetString(new byte[] { outValue[0], outValue[1], outValue[2], outValue[3], outValue[8], outValue[9], outValue[10] })?.Trim() ?? ""; if (useFR336P)
{
val = Encoding.UTF8.GetString(new byte[] { outValue[0], outValue[1], outValue[2], outValue[3], outValue[4], outValue[5], outValue[6] })?.Trim() ?? "";
}
else
val = Encoding.UTF8.GetString(new byte[] { outValue[0], outValue[1], outValue[2], outValue[3], outValue[8], outValue[9], outValue[10] })?.Trim() ?? "";
data = new RFIDData(val); data = new RFIDData(val);
data.ReadResult = rtn ? RfidResult.读取成功 : RfidResult.读取失败; data.ReadResult = rtn ? RfidResult.读取成功 : RfidResult.读取失败;
return data; return data;
......
...@@ -149,30 +149,30 @@ namespace OnlineStore.DeviceLibrary ...@@ -149,30 +149,30 @@ namespace OnlineStore.DeviceLibrary
string r = ""; string r = "";
bool eyemNoCode = false; bool eyemNoCode = false;
Task eyemtask = Task.Factory.StartNew(delegate { //Task eyemtask = Task.Factory.StartNew(delegate {
List<CodeInfo> tlci = EyemDecode.ModelDecoder(ref bmp); // List<CodeInfo> tlci = EyemDecode.ModelDecoder(ref bmp);
foreach (CodeInfo code in tlci) // foreach (CodeInfo code in tlci)
{ // {
//LogUtil.info(deviceName + " 【" + cameraName + "】[eyemDecode]" + code.CodeType + "(X: " + code.X + ",Y: " + code.Y + ") " + code.CodeStr); // //LogUtil.info(deviceName + " 【" + cameraName + "】[eyemDecode]" + code.CodeType + "(X: " + code.X + ",Y: " + code.Y + ") " + code.CodeStr);
string str = CodeManager.ReplaceCode(code.CodeStr); // string str = CodeManager.ReplaceCode(code.CodeStr);
if (!codeList.Contains(str)) // if (!codeList.Contains(str))
{ // {
codeList.Add(str); // codeList.Add(str);
r = r + "##eyem|" + code.CodeType + "|" + str; // r = r + "##eyem|" + code.CodeType + "|" + str;
if (!findRightCode) // if (!findRightCode)
{ // {
findRightCode = HasRightCode(str); // findRightCode = HasRightCode(str);
} // }
} // }
} // }
}); //});
//最多等待60秒 ////最多等待60秒
bool taskResult = eyemtask.Wait(60000); //bool taskResult = eyemtask.Wait(60000);
if (!taskResult) //if (!taskResult)
{ //{
LogUtil.error(deviceName + " 【" + cameraName + "】eyem扫码超时"); // LogUtil.error(deviceName + " 【" + cameraName + "】eyem扫码超时");
eyemNoCode = true; // eyemNoCode = true;
} //}
if (!isPreScan) if (!isPreScan)
{ {
...@@ -181,7 +181,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -181,7 +181,7 @@ namespace OnlineStore.DeviceLibrary
try try
{ {
List<CodeInfo> cc = new List<CodeInfo>(); List<CodeInfo> cc = new List<CodeInfo>();
eyemNoCode = true; // eyemNoCode = true;
RemoteDecodeHelper.RemoteDecodeParam remoteDecodeParam = new RemoteDecodeHelper.RemoteDecodeParam RemoteDecodeHelper.RemoteDecodeParam remoteDecodeParam = new RemoteDecodeHelper.RemoteDecodeParam
{ {
...@@ -255,10 +255,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -255,10 +255,10 @@ namespace OnlineStore.DeviceLibrary
nameStr = "eyem"; nameStr = "eyem";
} }
if (!taskResult) //if (!taskResult)
{ //{
nameStr = "eyemTimeOut"; // nameStr = "eyemTimeOut";
} //}
SaveImageToFile(deviceName, cameraName + nameStr, bmp); SaveImageToFile(deviceName, cameraName + nameStr, bmp);
} }
......
...@@ -11,12 +11,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -11,12 +11,13 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
public class Label_LZ public class Label_LZ
{ {
public Label_LZ(string liaohao, string mianbie, string jitai,string line) public Label_LZ(string liaohao, string mianbie, string jitai,string line,string slot="slot",string subslot="subslot")
{ {
this.pn = $"料 号:{liaohao}"; this.pn = $"料 号:{liaohao}";
this.side = $"{mianbie}"; this.side = $"{mianbie}";
this.line = $"线 别:{line} /{this.side}"; this.line = $"线 别:{line} /{this.side}";
this.station = $"机 台:{jitai}"; this.station = $"机 台:{jitai}";
this.slot = $"站 别:{slot}{subslot}";
this.shijian = $"时 间:{DateTime.Now.ToString()}"; this.shijian = $"时 间:{DateTime.Now.ToString()}";
} }
public Label_LZ() { } public Label_LZ() { }
...@@ -24,6 +25,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -24,6 +25,14 @@ namespace OnlineStore.DeviceLibrary
public string pn { get; set; } = ""; public string pn { get; set; } = "";
public string line { get; set; } = ""; public string line { get; set; } = "";
/// <summary> /// <summary>
/// 站位
/// </summary>
public string slot { get; set; }
/// <summary>
/// 点位
/// </summary>
public string subslot { get; set; }
/// <summary>
/// 线别 /// 线别
/// </summary> /// </summary>
public string side { get; set; } = ""; public string side { get; set; } = "";
...@@ -42,7 +51,21 @@ namespace OnlineStore.DeviceLibrary ...@@ -42,7 +51,21 @@ namespace OnlineStore.DeviceLibrary
public string ToStr() public string ToStr()
{ {
return $"二维码:{barcode},需求单:{hSerial},料号:{pn},机台:{station},面别:{side},线别:{line}"; return $"二维码:{barcode},需求单:{hSerial},料号:{pn},机台:{station},面别:{side},线别:{line},站位:{slot},点位:{subslot}";
}
/// <summary>
/// 拷贝一个新的实例
/// </summary>
/// <returns></returns>
public Label_LZ ToCopy()
{
Label_LZ posInfo = new Label_LZ();
System.Reflection.PropertyInfo[] info1 = posInfo.GetType().GetProperties();
System.Reflection.PropertyInfo[] info2 = this.GetType().GetProperties();
for (int i = 0; i < info1.Length; i++)
info1[i].SetValue(posInfo, info2[i].GetValue(this));
return posInfo;
} }
} }
} }
...@@ -73,6 +73,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -73,6 +73,7 @@ namespace OnlineStore.DeviceLibrary
text.Add("jt", content.station); text.Add("jt", content.station);
text.Add("sj", content.shijian); text.Add("sj", content.shijian);
text.Add("xb", content.line); text.Add("xb", content.line);
text.Add("zb", content.slot);
return print.PrintPreview(text); return print.PrintPreview(text);
} }
public bool IsReadyPrint(out string msg) public bool IsReadyPrint(out string msg)
......
...@@ -16,6 +16,51 @@ namespace OnlineStore.DeviceLibrary ...@@ -16,6 +16,51 @@ namespace OnlineStore.DeviceLibrary
public class SServerManager public class SServerManager
{ {
#region 立臻料仓接口 #region 立臻料仓接口
static string Addr_getOutStateInfo = "/service/store/innerBox/getOutStateInfo";
/// <summary>
/// 根据料仓编号获取料仓两个出料口料箱信息
/// </summary>
/// <param name="cid">料仓cid</param>
/// <returns></returns>
public static List<BoxTaskInfo> GetOutStateInfo()
{
try
{
string msg = "";
Dictionary<string, string> map = new Dictionary<string, string>();
map.Add("cid", StoreManager.XLRStore.Config.CID);
string server = GetAddr(Addr_getOutStateInfo, map);
DateTime startTime = DateTime.Now;
string resultStr = HttpHelper.Get(server);
ServerData4 serverResult = JsonHelper.DeserializeJsonToObject<ServerData4>(resultStr);
if (serverResult == null)
{
msg = $"GetOutStateInfo" + "没有收到服务器反馈";
}
else if (serverResult.code.Equals(0).Equals(false))
{
// code: 0为正常,其他为异常, msg: 消息, data: 为空
msg = $" GetOutStateInfo【{JsonHelper.SerializeObject(serverResult)}】";
if (!msg.Equals(""))
{
LogUtil.error(msg);
return null;
}
}
else
{
msg = $" GetOutStateInfo【{JsonHelper.SerializeObject(serverResult)}】";
LogUtil.debug(msg);
return serverResult.data;
}
}
catch (Exception ex)
{
LogUtil.error("GetOutStateInfo", ex);
}
return null;
}
static string Addr_UploadLocInfo = "/service/store/innerBox/updateLocInfo"; static string Addr_UploadLocInfo = "/service/store/innerBox/updateLocInfo";
/// <summary> /// <summary>
/// A 出库更新任务状态 -OK /// A 出库更新任务状态 -OK
...@@ -23,15 +68,19 @@ namespace OnlineStore.DeviceLibrary ...@@ -23,15 +68,19 @@ namespace OnlineStore.DeviceLibrary
/// <param name="barcode">料盘条码</param> /// <param name="barcode">料盘条码</param>
/// <param name="status"></param> /// <param name="status"></param>
/// <returns></returns> /// <returns></returns>
public static BoxTaskInfo UploadLocInfo(string barcode, string status, string loc = "") public static BoxTaskInfo UploadLocInfo(string barcode, string status, string loc = "",string hSerial="",string outlet="",string boxSide="")
{ {
try try
{ {
string msg = ""; string msg = "";
Dictionary<string, string> map = new Dictionary<string, string>(); Dictionary<string, string> map = new Dictionary<string, string>();
map.Add("cid", StoreManager.XLRStore.Config.CID);
map.Add("barcode", barcode); map.Add("barcode", barcode);
map.Add("status", status); map.Add("status", status);
map.Add("loc", loc); map.Add("loc", loc);
map.Add("hSerial", hSerial);
map.Add("outlet", outlet);
map.Add("boxSide", boxSide);
string server = GetAddr(Addr_UploadLocInfo, map); string server = GetAddr(Addr_UploadLocInfo, map);
DateTime startTime = DateTime.Now; DateTime startTime = DateTime.Now;
string resultStr = HttpHelper.Get(server); string resultStr = HttpHelper.Get(server);
...@@ -969,9 +1018,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -969,9 +1018,9 @@ namespace OnlineStore.DeviceLibrary
//private static string Addr_ShelfFinish = "/rest/api/qisda/device/putShelfFinished"; //private static string Addr_ShelfFinish = "/rest/api/qisda/device/putShelfFinished";
public static BoxTaskInfo ShelfFinish(string rfid, string barcode = "", BoxTaskInfo boxTaskInfo = null) public static BoxTaskInfo ShelfFinish(string rfid, string barcode = "", Label_LZ label_LZ = null,string outlet="",string boxside="",int remainTaskCount=-1)
{ {
LogUtil.info($"BoxFinish rifd【{rfid}】barcode【{barcode}】hSerial【{boxTaskInfo?.hSerial ?? ""}】remainTaskCount【{boxTaskInfo?.remainTaskCount ?? -1}】"); LogUtil.info($"BoxFinish rifd【{rfid}】barcode【{barcode}】outlet【{outlet}】boxside【{boxside}】 hSerial【{label_LZ?.hSerial ?? ""}】remainTaskCount【{remainTaskCount}】");
BoxTaskInfo task = new BoxTaskInfo(); BoxTaskInfo task = new BoxTaskInfo();
//task.boxLoc = rfid; //task.boxLoc = rfid;
...@@ -1091,26 +1140,69 @@ namespace OnlineStore.DeviceLibrary ...@@ -1091,26 +1140,69 @@ namespace OnlineStore.DeviceLibrary
/// 目的地 /// 目的地
/// </summary> /// </summary>
public string line { get; set; } = ""; public string line { get; set; } = "";
public string cid { get; set; }
/// <summary> /// <summary>
/// 当前料箱隔口内侧已放入 /// 出口位置,A或者B
/// </summary> /// </summary>
public int inCount { get; set; } = -1; public string outlet { get; set; }
public int outCount { get; set; } = -1; /// <summary>
//public bool IsValid() /// 当前料箱隔口内侧T
//{ /// </summary>
// if (bigEmpty != -1 && smallEmpty != -1) public int boxTCount { get; set; } = -1;
// { /// <summary>
// return true; /// 当前料箱隔口外侧B
// } /// </summary>
// return false; public int boxBCount { get; set; } = -1;
//} /// <summary>
/// 料箱rfid
/// </summary>
public string rfid { get; set; }
public string ToStr() public string ToStr()
{ {
return $"内侧格口已有数量:{inCount},外侧格口已有数量;{outCount}; 需求单:{hSerial},剩余任务数={remainTaskCount}," + return $"内侧T已有数量:{boxTCount},外侧B已有数量;{boxBCount}; 需求单:{hSerial},剩余任务数={remainTaskCount}," +
$"剩余料架数:{rackTaskCount},目的地:{line}"; $"剩余料架数:{rackTaskCount},目的地:{line}";
} }
} }
/// <summary>
/// 出口料箱信息
/// </summary>
public class BoxInfo
{
/// <summary>
/// 出口位置,A或者B
/// </summary>
public string outlet { get; set; }
/// <summary>
/// 料仓cid
/// </summary>
public string cid { get; set; }
/// <summary>
/// 料箱rfid
/// </summary>
public string rfid { get; set; }
/// <summary>
/// 需求单号
/// </summary>
public string hSerial { get; set; } = "";
/// <summary>
/// 目的线体
/// </summary>
public string line { get; set; } = "";
/// <summary>
/// 当前料箱隔口内侧T
/// </summary>
public int boxTCount { get; set; } = -1;
/// <summary>
/// 当前料箱隔口外侧B
/// </summary>
public int boxBCount { get; set; } = -1;
public string ToStr()
{
return $"出口位置:{outlet},箱号:{rfid},需求单:{hSerial},内侧T已有数量:{boxTCount},外侧B已有数量;{boxBCount}," +
$"目的地:{line}";
}
}
public class AlarmMsg public class AlarmMsg
{ {
...@@ -1207,6 +1299,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -1207,6 +1299,14 @@ namespace OnlineStore.DeviceLibrary
public List<Label_LZ> data { get; set; } public List<Label_LZ> data { get; set; }
} }
public class ServerData4
{
public int code { get; set; }
public string msg { get; set; }
public List<BoxTaskInfo> data { get; set; }
}
public class AfterPutData public class AfterPutData
{ {
//>>` {"code": 0, "msg":"ok", "data":{"cutPackageTask":"0","urgentPackageTask":"20","cutTask":"21","urgentTask":"22"}} ` //>>` {"code": 0, "msg":"ok", "data":{"cutPackageTask":"0","urgentPackageTask":"20","cutTask":"21","urgentTask":"22"}} `
......
...@@ -63,6 +63,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -63,6 +63,7 @@ namespace OnlineStore.DeviceLibrary
/// 3=B侧周转箱内侧,4=B侧周转箱外 /// 3=B侧周转箱内侧,4=B侧周转箱外
/// </summary> /// </summary>
public int ShelfType { get; set; } = 1; public int ShelfType { get; set; } = 1;
public Label_LZ Label_LZ { get; set; }
} }
/// <summary> /// <summary>
/// 出入库料盘信息 /// 出入库料盘信息
......
...@@ -17,7 +17,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -17,7 +17,6 @@ namespace OnlineStore.DeviceLibrary
{ {
public bool IsDebug = false; public bool IsDebug = false;
public bool MoveStop = false; public bool MoveStop = false;
protected int TimerMaxSeconds = 3;
public bool AxisAlarmFlag = false;//轴报警异常标识 public bool AxisAlarmFlag = false;//轴报警异常标识
protected void SetAllTimer(bool open) protected void SetAllTimer(bool open)
...@@ -152,10 +151,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -152,10 +151,10 @@ namespace OnlineStore.DeviceLibrary
} }
BaseTimerProcess(); BaseTimerProcess();
if (TimerMaxSeconds > 3 && runStatus >= RunStatus.Runing) //if (TimerMaxSeconds > 3 && runStatus >= RunStatus.Runing)
{ //{
TimerMaxSeconds = 3; // TimerMaxSeconds = 3;
} //}
} }
catch (Exception ex) catch (Exception ex)
{ {
......
...@@ -263,8 +263,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -263,8 +263,7 @@ namespace OnlineStore.DeviceLibrary
return false; return false;
} }
bool rtn = false; bool rtn = false;
Task task = Task.Factory.StartNew(new Action(() => { rtn = OpenAllAxis(); })); rtn = OpenAllAxis();
task.Wait();
if (!rtn) if (!rtn)
{ {
CloseAllAxis(); CloseAllAxis();
...@@ -287,8 +286,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -287,8 +286,7 @@ namespace OnlineStore.DeviceLibrary
{ {
StopMove(); StopMove();
bool rtn = false; bool rtn = false;
Task task = Task.Factory.StartNew(new Action(() => { rtn = OpenAllAxis(); })); rtn = OpenAllAxis();
task.Wait();
if (!rtn) if (!rtn)
{ {
CloseAllAxis(); CloseAllAxis();
...@@ -318,6 +316,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -318,6 +316,7 @@ namespace OnlineStore.DeviceLibrary
private void StartReset() private void StartReset()
{ {
if (!CanReset()) if (!CanReset())
{
if (System.Windows.Forms.MessageBox.Show("检测到可能的撞机风险,抽屉没有挂在进出轴上才能复位,是否继续?", "警告", if (System.Windows.Forms.MessageBox.Show("检测到可能的撞机风险,抽屉没有挂在进出轴上才能复位,是否继续?", "警告",
System.Windows.Forms.MessageBoxButtons.YesNo).Equals(System.Windows.Forms.DialogResult.No)) System.Windows.Forms.MessageBoxButtons.YesNo).Equals(System.Windows.Forms.DialogResult.No))
{ {
...@@ -326,6 +325,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -326,6 +325,8 @@ namespace OnlineStore.DeviceLibrary
LogInfo($"复位 {MoveInfo.SLog} :确认取消"); LogInfo($"复位 {MoveInfo.SLog} :确认取消");
return; return;
} }
}
if (!CheckTrayState(out string msg)) if (!CheckTrayState(out string msg))
{ {
System.Windows.Forms.MessageBox.Show($"{msg},不允许启动/复位", "警告", System.Windows.Forms.MessageBox.Show($"{msg},不允许启动/复位", "警告",
...@@ -343,8 +344,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -343,8 +344,6 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(StepEnum.BOX_H001_Wait); MoveInfo.NextMoveStep(StepEnum.BOX_H001_Wait);
AutoInout.StopAuto(); AutoInout.StopAuto();
LogInfo($"复位 {MoveInfo.SLog} :存储机构轴开始复位"); LogInfo($"复位 {MoveInfo.SLog} :存储机构轴开始复位");
//停止记录
StopRecord();
isInPro = false; isInPro = false;
} }
...@@ -760,7 +759,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -760,7 +759,7 @@ namespace OnlineStore.DeviceLibrary
bool result = waitAOutStoreList.TryDequeue(out param); bool result = waitAOutStoreList.TryDequeue(out param);
if (result && param != null) if (result && param != null)
{ {
LogInfo("执行A面排队的出库【" + param.PosInfo.ToStr() + "】"); //LogInfo("执行A面排队的出库【" + param.PosInfo.ToStr() + "】");
StartExecuctOut(param); StartExecuctOut(param);
return; return;
} }
...@@ -771,7 +770,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -771,7 +770,7 @@ namespace OnlineStore.DeviceLibrary
bool result = waitAOutStoreList.TryDequeue(out param); bool result = waitAOutStoreList.TryDequeue(out param);
if (result && param != null) if (result && param != null)
{ {
LogInfo("执行A面排队的出库【" + param.PosInfo.ToStr() + "】"); //LogInfo("执行A面排队的出库【" + param.PosInfo.ToStr() + "】");
StartExecuctOut(param); StartExecuctOut(param);
return; return;
} }
...@@ -789,7 +788,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -789,7 +788,7 @@ namespace OnlineStore.DeviceLibrary
bool result = waitBOutStoreList.TryDequeue(out param); bool result = waitBOutStoreList.TryDequeue(out param);
if (result && param != null) if (result && param != null)
{ {
LogInfo("执行B面排队的出库【" + param.PosInfo.ToStr() + "】"); //LogInfo("执行B面排队的出库【" + param.PosInfo.ToStr() + "】");
StartExecuctOut(param); StartExecuctOut(param);
return; return;
} }
...@@ -800,7 +799,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -800,7 +799,7 @@ namespace OnlineStore.DeviceLibrary
bool result = waitBOutStoreList.TryDequeue(out param); bool result = waitBOutStoreList.TryDequeue(out param);
if (result && param != null) if (result && param != null)
{ {
LogInfo("执行B面排队的出库【" + param.PosInfo.ToStr() + "】"); //LogInfo("执行B面排队的出库【" + param.PosInfo.ToStr() + "】");
StartExecuctOut(param); StartExecuctOut(param);
return; return;
} }
...@@ -888,7 +887,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -888,7 +887,7 @@ namespace OnlineStore.DeviceLibrary
LogInfo("启动完成,A皮带线有料盘,启动线体处理"); LogInfo("启动完成,A皮带线有料盘,启动线体处理");
StartLineARun(new InOutParam(BufferDataManager.ALineStoreInfo)); StartLineARun(new InOutParam(BufferDataManager.ALineStoreInfo));
} }
else if (BufferDataManager.BLineStoreInfo != null) if (BufferDataManager.BLineStoreInfo != null)
{ {
LogInfo("启动完成,B皮带线有料盘,启动线体处理"); LogInfo("启动完成,B皮带线有料盘,启动线体处理");
StartLineBRun(new InOutParam(BufferDataManager.BLineStoreInfo)); StartLineBRun(new InOutParam(BufferDataManager.BLineStoreInfo));
...@@ -959,8 +958,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -959,8 +958,6 @@ namespace OnlineStore.DeviceLibrary
ComAxis_A.SuddenStop(); ComAxis_A.SuddenStop();
CloseAllAxis(); CloseAllAxis();
//停止记录
StopRecord();
} }
...@@ -1031,7 +1028,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1031,7 +1028,7 @@ namespace OnlineStore.DeviceLibrary
string outMsg = ""; string outMsg = "";
if (!axis.Open(true, out outMsg)) if (!axis.Open(true, out outMsg))
{ {
LogUtil.error(outMsg); SetWarnMsg(Name + outMsg);
return false; return false;
} }
} }
......
...@@ -16,45 +16,141 @@ namespace OnlineStore.DeviceLibrary ...@@ -16,45 +16,141 @@ namespace OnlineStore.DeviceLibrary
{ {
partial class BoxEquip partial class BoxEquip
{ {
public const string boxACamName = "box_A"; public const string boxACamName = "box_A";
public const string boxBCamName = "box_B"; public const string boxBCamName = "box_B";
Thread[] camerathread;
bool IsOpen = false;
Asa.Camera.VisionLib camera;
bool loadCameraState = false; bool loadCameraState = false;
public delegate void CameraAcqEventHandler(CameraArgs cameraArgs);
public event CameraAcqEventHandler camera_event;
public void RegisterCameraGrabImage(CameraAcqEventHandler grabbedEventHandler)
{
camera_event += grabbedEventHandler;
}
void LoadCameraConfig(string id = "") void LoadCameraConfig(string id = "")
{ {
if (loadCameraState) Task.Factory.StartNew(new Action(() =>
return;
string path = Application.StartupPath+@"\Config\IPCamera.json";
if (!File.Exists(path))
{ {
LogUtil.error(Name + "找不到监控相机配置文件:" + path); if (loadCameraState)
} return;
string path = @".\Config\Camera.json";
if (!File.Exists(path))
{
LogUtil.error(Name + "找不到监控相机配置文件" + path);
}
camera = new Asa.Camera.VisionLib(path);
camerathread = new Thread[2];
//pictureBox1.Image = bmp;
StartCamera();
loadCameraState = true;
}));
IPCameraManager.LoadConfig(path);
loadCameraState = true;
} }
public void RegisterCameraAGrabImage(ImageGrabbedEventHandler grabbedEventHandler) void StartCamera()
{ {
IPCameraManager.GetCamera(boxACamName).ImageGrabbed += grabbedEventHandler; camera.Open(boxACamName);
IPCameraManager.GetCamera(boxACamName).StartLive(); camera.Open(boxBCamName);
IsOpen = true;
camerathread[0] = new Thread(new ParameterizedThreadStart(startMonitor));
camerathread[0].IsBackground = true;
camerathread[0].Start(boxACamName);
camerathread[1] = new Thread(new ParameterizedThreadStart(startMonitor));
camerathread[1].IsBackground = true;
camerathread[1].Start(boxBCamName);
}
void startMonitor(object obj)
{
if (!loadCameraState)
{
LogUtil.error(obj + " 监控相机初始化失败,无法开启");
return;
}
string name = (string)obj;
try
{
while (IsOpen)
{
Bitmap bmp = AcqImage(name);
if (bmp != null)
camera_event?.Invoke(new CameraArgs(name, bmp));
Thread.Sleep(300);
}
}
catch
{ }
} }
public void RegisterCameraBGrabImage(ImageGrabbedEventHandler grabbedEventHandler) void StopCamera()
{ {
IPCameraManager.GetCamera(boxBCamName).ImageGrabbed += grabbedEventHandler; IsOpen = false;
IPCameraManager.GetCamera(boxBCamName).StartLive(); camera.Close();
camera.Dispose();
} }
public Bitmap AcqImage(string camName)
public void UnRegisterCameraAGrabImage(ImageGrabbedEventHandler grabbedEventHandler)
{ {
IPCameraManager.GetCamera(boxACamName).ImageGrabbed -= grabbedEventHandler; Bitmap bitmap = camera.GetImage(camName);
IPCameraManager.GetCamera(boxACamName).StopLive(); return bitmap;
} }
public void UnRegisterCameraBGrabImage(ImageGrabbedEventHandler grabbedEventHandler) }
public class CameraArgs : EventArgs
{
/// <summary>
/// 相机名
/// </summary>
public string CamName { get; set; }
/// <summary>
/// 相机采集的图片
/// </summary>
public Bitmap Image { get; set; }
public CameraArgs(string name, Bitmap img)
{ {
IPCameraManager.GetCamera(boxBCamName).ImageGrabbed -= grabbedEventHandler; CamName = name;
IPCameraManager.GetCamera(boxBCamName).StopLive(); Image = img;
} }
void StartRecord() { }
void StopRecord() { }
} }
//partial class BoxEquip
//{
// public const string boxACamName = "box_A";
// public const string boxBCamName = "box_B";
// bool loadCameraState = false;
// void LoadCameraConfig(string id = "")
// {
// if (loadCameraState)
// return;
// string path = Application.StartupPath+@"\Config\IPCamera.json";
// if (!File.Exists(path))
// {
// LogUtil.error(Name + "找不到监控相机配置文件:" + path);
// }
// IPCameraManager.LoadConfig(path);
// loadCameraState = true;
// }
// public void RegisterCameraAGrabImage(ImageGrabbedEventHandler grabbedEventHandler)
// {
// IPCameraManager.GetCamera(boxACamName).ImageGrabbed += grabbedEventHandler;
// IPCameraManager.GetCamera(boxACamName).StartLive();
// }
// public void RegisterCameraBGrabImage(ImageGrabbedEventHandler grabbedEventHandler)
// {
// IPCameraManager.GetCamera(boxBCamName).ImageGrabbed += grabbedEventHandler;
// IPCameraManager.GetCamera(boxBCamName).StartLive();
// }
// public void UnRegisterCameraAGrabImage(ImageGrabbedEventHandler grabbedEventHandler)
// {
// IPCameraManager.GetCamera(boxACamName).ImageGrabbed -= grabbedEventHandler;
// IPCameraManager.GetCamera(boxACamName).StopLive();
// }
// public void UnRegisterCameraBGrabImage(ImageGrabbedEventHandler grabbedEventHandler)
// {
// IPCameraManager.GetCamera(boxBCamName).ImageGrabbed -= grabbedEventHandler;
// IPCameraManager.GetCamera(boxBCamName).StopLive();
// }
// void StartRecord() { }
// void StopRecord() { }
//}
} }
...@@ -444,15 +444,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -444,15 +444,14 @@ namespace OnlineStore.DeviceLibrary
MoveAxisToP1(); MoveAxisToP1();
PullAxis_UpdownToP1(); PullAxis_UpdownToP1();
UpdownAxisTo_P3_P9(); UpdownAxisTo_P3_P9();
XAxis_To_P1(); //XAxis_To_P1();
BothXAxis_To_P1();
} }
else else
{ {
SetBoxStatus(DeviceStatus.StoreOnline, RunStatus.Runing); SetBoxStatus(DeviceStatus.StoreOnline, RunStatus.Runing);
LogInfo($"入库 {MoveInfo.SLog}:入库结束[{MoveInfo.MoveParam.PosInfo.PosId}][耗时:{(DateTime.Now - startTime).TotalSeconds.ToString("f2")}秒][{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"); LogInfo($"入库 {MoveInfo.SLog}:入库结束[{MoveInfo.MoveParam.PosInfo.PosId}][耗时:{(DateTime.Now - startTime).TotalSeconds.ToString("f2")}秒][{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
MoveInfo.EndMove(); MoveInfo.EndMove();
//停止记录
StopRecord();
AutoInout.InOutEndProcess(this, MoveType.InStore); AutoInout.InOutEndProcess(this, MoveType.InStore);
} }
...@@ -472,8 +471,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -472,8 +471,6 @@ namespace OnlineStore.DeviceLibrary
SetBoxStatus(DeviceStatus.StoreOnline, RunStatus.Runing); SetBoxStatus(DeviceStatus.StoreOnline, RunStatus.Runing);
LogInfo($"入库 {MoveInfo.SLog}:入库结束[{MoveInfo.MoveParam.PosInfo.PosId}][耗时:{(DateTime.Now - startTime).TotalSeconds.ToString("f2")}秒][{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"); LogInfo($"入库 {MoveInfo.SLog}:入库结束[{MoveInfo.MoveParam.PosInfo.PosId}][耗时:{(DateTime.Now - startTime).TotalSeconds.ToString("f2")}秒][{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
MoveInfo.EndMove(); MoveInfo.EndMove();
//停止记录
StopRecord();
AutoInout.InOutEndProcess(this, MoveType.InStore); AutoInout.InOutEndProcess(this, MoveType.InStore);
break; break;
} }
......
...@@ -161,13 +161,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -161,13 +161,10 @@ namespace OnlineStore.DeviceLibrary
LogInfo($"出库 {MoveInfoLineA.SLog}:料盘到达线体末端,出库完成[{MoveInfoLineA.MoveParam.PosInfo.GetPosSide()}面]"); LogInfo($"出库 {MoveInfoLineA.SLog}:料盘到达线体末端,出库完成[{MoveInfoLineA.MoveParam.PosInfo.GetPosSide()}面]");
break; break;
case StepEnum.Line_08_Finish: case StepEnum.Line_08_Finish:
SetBoxStatus(DeviceStatus.StoreOnline, RunStatus.Runing);
MoveInfoLineA.EndMove(); MoveInfoLineA.EndMove();
break; break;
default: default:
LogUtil.error($"MoveInfoLineA 未找到处理:{MoveInfoLineA.SLog}"); LogUtil.error($"MoveInfoLineA 未找到处理:{MoveInfoLineA.SLog}");
SetBoxStatus(DeviceStatus.StoreOnline, RunStatus.Runing);
MoveInfoLineA.EndMove(); MoveInfoLineA.EndMove();
break; break;
} }
......
...@@ -156,12 +156,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -156,12 +156,10 @@ namespace OnlineStore.DeviceLibrary
LogInfo($"出库 {MoveInfoLineB.SLog}:料盘到达线体末端,出库完成[{MoveInfoLineB.MoveParam.PosInfo.GetPosSide()}面]"); LogInfo($"出库 {MoveInfoLineB.SLog}:料盘到达线体末端,出库完成[{MoveInfoLineB.MoveParam.PosInfo.GetPosSide()}面]");
break; break;
case StepEnum.Line_08_Finish: case StepEnum.Line_08_Finish:
SetBoxStatus(DeviceStatus.StoreOnline, RunStatus.Runing);
MoveInfoLineB.EndMove(); MoveInfoLineB.EndMove();
break; break;
default: default:
LogUtil.error($"MoveInfoLineB 未找到处理:{MoveInfoLineB.SLog}"); LogUtil.error($"MoveInfoLineB 未找到处理:{MoveInfoLineB.SLog}");
SetBoxStatus(DeviceStatus.StoreOnline, RunStatus.Runing);
MoveInfoLineB.EndMove(); MoveInfoLineB.EndMove();
break; break;
} }
......
...@@ -302,6 +302,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -302,6 +302,7 @@ namespace OnlineStore.DeviceLibrary
//if (MoveInfo.MoveParam.PosInfoBack == null) //if (MoveInfo.MoveParam.PosInfoBack == null)
{ {
MoveInfo.NextMoveStep(StepEnum.SO_20_Finish); MoveInfo.NextMoveStep(StepEnum.SO_20_Finish);
BothXAxis_To_P1();
LogInfo($"出库 {MoveInfo.SLog}:出库结束[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");//另一面料叉无料, LogInfo($"出库 {MoveInfo.SLog}:出库结束[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");//另一面料叉无料,
} }
//else //else
...@@ -320,8 +321,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -320,8 +321,6 @@ namespace OnlineStore.DeviceLibrary
case StepEnum.SO_20_Finish: case StepEnum.SO_20_Finish:
SetBoxStatus(DeviceStatus.StoreOnline, RunStatus.Runing); SetBoxStatus(DeviceStatus.StoreOnline, RunStatus.Runing);
MoveInfo.EndMove(); MoveInfo.EndMove();
//停止记录
StopRecord();
AutoInout.InOutEndProcess(this, MoveType.OutStore); AutoInout.InOutEndProcess(this, MoveType.OutStore);
break; break;
} }
......
...@@ -752,6 +752,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -752,6 +752,11 @@ namespace OnlineStore.DeviceLibrary
msg += $"B侧拉取机构拉钩检测信号亮,"; msg += $"B侧拉取机构拉钩检测信号亮,";
hookB = true; hookB = true;
} }
if(hookA || hookB)
{
return false;
}
bool atBside = false; bool atBside = false;
bool atAside = false; bool atAside = false;
for (int i = 1; i <= trayBColumns.Length; i++) for (int i = 1; i <= trayBColumns.Length; i++)
...@@ -949,7 +954,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -949,7 +954,7 @@ namespace OnlineStore.DeviceLibrary
break; break;
} }
if (res == 0) if (res == 0)
LogInfo($"列{res}信号已屏蔽"); LogInfo($"列{name}信号已屏蔽");
return res == 0 ? true : false; return res == 0 ? true : false;
} }
#endregion #endregion
...@@ -1043,8 +1048,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -1043,8 +1048,6 @@ namespace OnlineStore.DeviceLibrary
param.MoveP = new LineMoveP(Config, param.PosInfo.PosId); param.MoveP = new LineMoveP(Config, param.PosInfo.PosId);
// LogInfo("LoadInoutParam:" + JsonHelper.SerializeObject(param.MoveP)); // LogInfo("LoadInoutParam:" + JsonHelper.SerializeObject(param.MoveP));
MoveInfo.NewMove(MoveType.InStore, param); MoveInfo.NewMove(MoveType.InStore, param);
///开始记录
StartRecord();
SetBoxStatus(DeviceStatus.InStoreExecute, RunStatus.Busy, param.PosInfo.PosId, param.PosInfo.barcode); SetBoxStatus(DeviceStatus.InStoreExecute, RunStatus.Busy, param.PosInfo.PosId, param.PosInfo.barcode);
if (param.PosInfoBack != null) if (param.PosInfoBack != null)
MoveInfo.NextMoveStep(StepEnum.SIB_00_StartInstore); MoveInfo.NextMoveStep(StepEnum.SIB_00_StartInstore);
...@@ -1244,7 +1247,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1244,7 +1247,7 @@ namespace OnlineStore.DeviceLibrary
reviceList = (from m in reviceList where m.PosInfo.PosId.Equals(param.PosInfo.PosId) select m).ToList<InOutParam>(); reviceList = (from m in reviceList where m.PosInfo.PosId.Equals(param.PosInfo.PosId) select m).ToList<InOutParam>();
if (reviceList.Count == 0) if (reviceList.Count == 0)
{ {
LogInfo(" 执行出库【" + param.PosInfo.ToStr() + "】失败,加入等待队列"); //LogInfo(" 执行出库【" + param.PosInfo.ToStr() + "】失败,加入等待队列");
if (param.PosInfo.GetPosSide().Equals("A")) if (param.PosInfo.GetPosSide().Equals("A"))
{ {
waitAOutStoreList.Enqueue(param); waitAOutStoreList.Enqueue(param);
...@@ -1292,8 +1295,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -1292,8 +1295,6 @@ namespace OnlineStore.DeviceLibrary
SetBoxStatus(DeviceStatus.OutStoreExecute, RunStatus.Busy, param.PosInfo.PosId, param.PosInfo.barcode); SetBoxStatus(DeviceStatus.OutStoreExecute, RunStatus.Busy, param.PosInfo.PosId, param.PosInfo.barcode);
MoveInfo.NewMove(MoveType.OutStore, param); MoveInfo.NewMove(MoveType.OutStore, param);
LogInfo("启动出库【" + param.PosInfo.ToStr() + "】 "); LogInfo("启动出库【" + param.PosInfo.ToStr() + "】 ");
///开始记录
StartRecord();
//LogInfo("LoadInoutParam:" + JsonHelper.SerializeObject(param.MoveP)); //LogInfo("LoadInoutParam:" + JsonHelper.SerializeObject(param.MoveP));
MoveInfo.NextMoveStep(StepEnum.SO_00_StartOutstore); MoveInfo.NextMoveStep(StepEnum.SO_00_StartOutstore);
AxisAlarmFlag = false; AxisAlarmFlag = false;
......
...@@ -66,6 +66,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -66,6 +66,9 @@ namespace OnlineStore.DeviceLibrary
//加载周转箱 //加载周转箱
BoxA = new TurnoverBox("周转箱A", RFIDIP[0], config); BoxA = new TurnoverBox("周转箱A", RFIDIP[0], config);
BoxB = new TurnoverBox("周转箱B", RFIDIP[1], config); BoxB = new TurnoverBox("周转箱B", RFIDIP[1], config);
turnoverBoxes = new List<TurnoverBox>();
turnoverBoxes.Add(BoxA);
turnoverBoxes.Add(BoxB);
initRobot(); initRobot();
MoveInfo = new DeviceMoveInfo(Name); MoveInfo = new DeviceMoveInfo(Name);
BatchMove = new BatchMoveBean(Config, BatchAxis, 1); BatchMove = new BatchMoveBean(Config, BatchAxis, 1);
...@@ -274,7 +277,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -274,7 +277,6 @@ namespace OnlineStore.DeviceLibrary
msg += "MoveT:" + MoveInfo.MoveType + "\n"; msg += "MoveT:" + MoveInfo.MoveType + "\n";
msg += "MoveS:" + MoveInfo.MoveStep + "\n"; msg += "MoveS:" + MoveInfo.MoveStep + "\n";
msg += "StepMsg:" + StepMsg + "\n"; msg += "StepMsg:" + StepMsg + "\n";
msg += "BoxInfo:" + boxTaskInfo?.ToStr() + "\n";
msg += "ReelInfo:" + PrintLabel?.LabelInfo?.ToStr() + "\n"; msg += "ReelInfo:" + PrintLabel?.LabelInfo?.ToStr() + "\n";
return msg; return msg;
} }
...@@ -300,7 +302,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -300,7 +302,7 @@ namespace OnlineStore.DeviceLibrary
{ {
} }
PrintLabel.PrinteLabelProcess(); // PrintLabel.PrinteLabelProcess();
if (MoveInfo.MoveType.Equals(MoveType.None) && NoErrorAlarm()) if (MoveInfo.MoveType.Equals(MoveType.None) && NoErrorAlarm())
{ {
if (IsDebug) return; if (IsDebug) return;
...@@ -632,11 +634,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -632,11 +634,11 @@ namespace OnlineStore.DeviceLibrary
private void SecurityAccessReset() private void SecurityAccessReset()
{ {
if (!baseConfig.DIList.ContainsKey(IO_Type.NGDoor_Limit)) if (!baseConfig.DIList.ContainsKey(IO_Type.Shelf_SafetyRasterSignal))
{ {
return; return;
} }
if (!baseConfig.DIList.ContainsKey(IO_Type.FrontDoor_Limit)) if (!baseConfig.DIList.ContainsKey(IO_Type.TurnoverBox_SafetyRasterSignal))
{ {
return; return;
} }
......
...@@ -82,7 +82,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -82,7 +82,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(StepEnum.II64_UpdownToP11); MoveInfo.NextMoveStep(StepEnum.II64_UpdownToP11);
MoveLog($"入料->A侧"); MoveLog($"入料->A侧");
} }
#region 入库 #region 入库
private DateTime startInTime = DateTime.Now; private DateTime startInTime = DateTime.Now;
public override bool StartInstore(InOutParam param) public override bool StartInstore(InOutParam param)
...@@ -102,7 +102,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -102,7 +102,7 @@ namespace OnlineStore.DeviceLibrary
runStatus = RunStatus.Busy; runStatus = RunStatus.Busy;
MoveInfo.NewMove(MoveType.InStore, param); MoveInfo.NewMove(MoveType.InStore, param);
startInTime = DateTime.Now; startInTime = DateTime.Now;
if(IsInSafePos()) if (IsInSafePos())
{ {
MoveInfo.NextMoveStep(StepEnum.II00_ToShelfArea); MoveInfo.NextMoveStep(StepEnum.II00_ToShelfArea);
To入料口(); To入料口();
...@@ -165,7 +165,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -165,7 +165,7 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.IsStep(StepEnum.II06_WaitHeight)) else if (MoveInfo.IsStep(StepEnum.II06_WaitHeight))
{ {
BatchMoveBean moveBean = BatchMove; BatchMoveBean moveBean = BatchMove;
if (moveBean.LastHeight > 0) //if (moveBean.LastHeight > 0)
{ {
ClearTimeoutAlarm("获取料盘高度完成超时"); ClearTimeoutAlarm("获取料盘高度完成超时");
int Height = 8;//moveBean.LastHeight; int Height = 8;//moveBean.LastHeight;
...@@ -180,10 +180,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -180,10 +180,10 @@ namespace OnlineStore.DeviceLibrary
MoveLog($"入库取料{shelf}{MoveInfo.SLog}: 料盘尺寸{width}X{Height}"); MoveLog($"入库取料{shelf}{MoveInfo.SLog}: 料盘尺寸{width}X{Height}");
II13_GetPosId(); II13_GetPosId();
} }
else if (MoveInfo.IsTimeOut(60)) //else if (MoveInfo.IsTimeOut(60))
{ //{
MoveTimeOut(MoveInfo, "" + moveBean.Name + "获取料盘高度完成"); // MoveTimeOut(MoveInfo, "" + moveBean.Name + "获取料盘高度完成");
} //}
} }
else if (MoveInfo.IsStep(StepEnum.II08_GetPosId)) else if (MoveInfo.IsStep(StepEnum.II08_GetPosId))
{ {
...@@ -223,7 +223,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -223,7 +223,7 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
if(CheckOutStore()) if (CheckOutStore())
{ {
MoveInfo.NextMoveStep(StepEnum.II81_ToNgArea); MoveInfo.NextMoveStep(StepEnum.II81_ToNgArea);
ToNG(); ToNG();
...@@ -346,7 +346,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -346,7 +346,7 @@ namespace OnlineStore.DeviceLibrary
} }
else if (MoveInfo.IsStep(StepEnum.II85_BackToP1)) else if (MoveInfo.IsStep(StepEnum.II85_BackToP1))
{ {
// if (shelf.Equals(1)) // if (shelf.Equals(1))
{ {
MoveLog($" 入料->NG箱放料结束"); MoveLog($" 入料->NG箱放料结束");
MoveInfo.EndMove(); MoveInfo.EndMove();
...@@ -360,7 +360,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -360,7 +360,7 @@ namespace OnlineStore.DeviceLibrary
/// ///
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
bool CheckLineEnd(InOutPosInfo posInfo,string ioType) bool CheckLineEnd(InOutPosInfo posInfo, string ioType)
{ {
return (posInfo != null && IOValue(ioType).Equals(IO_VALUE.HIGH)); return (posInfo != null && IOValue(ioType).Equals(IO_VALUE.HIGH));
} }
...@@ -411,7 +411,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -411,7 +411,7 @@ namespace OnlineStore.DeviceLibrary
//判断是A还是B //判断是A还是B
if (lastPosInfo.IsNG) if (lastPosInfo.IsNG)
{ {
if(NGBox.CanPutIn(out string msg)) if (NGBox.CanPutIn(out string msg))
{ {
MoveInfo.NextMoveStep(StepEnum.II81_ToNgArea); MoveInfo.NextMoveStep(StepEnum.II81_ToNgArea);
ClearSpecifiedAlarm("无法放料"); ClearSpecifiedAlarm("无法放料");
...@@ -537,16 +537,16 @@ namespace OnlineStore.DeviceLibrary ...@@ -537,16 +537,16 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(StepEnum.II05_WaitAxisCheck); MoveInfo.NextMoveStep(StepEnum.II05_WaitAxisCheck);
MoveLog($"入库取料, 等待定位料盘信号消失,通知料串料盘已离开"); MoveLog($"入库取料, 等待定位料盘信号消失,通知料串料盘已离开");
if (IOValue(IO_Type.Shelf_ReelCheck).Equals(IO_VALUE.LOW)) if (IOValue(IO_Type.Shelf_ReelCheck).Equals(IO_VALUE.LOW))
{ {
MoveInfo.NextMoveStep(StepEnum.II06_WaitHeight); MoveInfo.NextMoveStep(StepEnum.II06_WaitHeight);
BatchMove.GetTrayOK(); BatchMove.GetTrayOK();
} }
else else
{ {
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Shelf_ReelCheck, IO_VALUE.LOW)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Shelf_ReelCheck, IO_VALUE.LOW));
} }
} }
#endregion #endregion
} }
......
...@@ -12,8 +12,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -12,8 +12,9 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
partial class InputEquip partial class InputEquip
{ {
public TurnoverBox BoxA; public TurnoverBox BoxA;
public TurnoverBox BoxB; public TurnoverBox BoxB;
public List<TurnoverBox> turnoverBoxes;
/// <summary> /// <summary>
/// 周转箱A的编号 /// 周转箱A的编号
/// </summary> /// </summary>
......
...@@ -48,11 +48,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -48,11 +48,13 @@ namespace OnlineStore.DeviceLibrary
/// 周转箱线体反转 /// 周转箱线体反转
/// </summary> /// </summary>
string DO_LineBackRun = "TurnoverBoxA_LineBackRun"; string DO_LineBackRun = "TurnoverBoxA_LineBackRun";
public string outLet = "A";
public TurnoverBox(string name, string rfidIp, InputEquip_Config inputEquip_Config) public TurnoverBox(string name, string rfidIp, InputEquip_Config inputEquip_Config)
{ {
Name = name; Name = name;
if (name.Contains("B")) if (name.Contains("B"))
{ {
outLet = "B";
DI_SafetyRasterSignal = "TurnoverBoxB_SafetyRasterSignal"; DI_SafetyRasterSignal = "TurnoverBoxB_SafetyRasterSignal";
DI_FrontCheck = "TurnoverBoxB_FrontCheck"; DI_FrontCheck = "TurnoverBoxB_FrontCheck";
DI_InPlaceCheck = "TurnoverBoxB_InPlaceCheck"; DI_InPlaceCheck = "TurnoverBoxB_InPlaceCheck";
...@@ -66,20 +68,17 @@ namespace OnlineStore.DeviceLibrary ...@@ -66,20 +68,17 @@ namespace OnlineStore.DeviceLibrary
} }
public string GetMoveStr() public string GetMoveStr()
{ {
return $"料箱:{BoxId} " + $"【格口最大数量:{MaxCntOnSide}】" + BoxTaskInfo?.ToStr() ?? ""; return $"料箱:{BoxId} " + $"【格口最大数量:{MaxCntOnSide}】【" + (BoxTaskInfo?.ToStr() ?? "") + "】";
} }
public void StartReset() public void StartReset()
{ {
WarnMsg = ""; WarnMsg = "";
bool needLeave = false; bool needLeave = false;
if (ReadBoxId()) ReadBoxId();
BoxTaskInfo = SServerManager.GetBoxStatusInfo(config.CID, BoxId); GetBoxTaskInfo();
resetCnt();
if (BoxTaskInfo != null) if (BoxTaskInfo != null)
{ {
CntInSideA = BoxTaskInfo.inCount > 0 ? BoxTaskInfo.inCount : 0; needLeave = (BoxTaskInfo.boxTCount >= MaxCntOnSide || BoxTaskInfo.boxBCount >= MaxCntOnSide || BoxTaskInfo.remainTaskCount <= 0);
CntInSideB = BoxTaskInfo.outCount > 0 ? BoxTaskInfo.outCount : 0;
needLeave = CntInSideA >= MaxCntOnSide || CntInSideB >= MaxCntOnSide || (!string.IsNullOrEmpty(BoxTaskInfo.hSerial) && BoxTaskInfo.remainTaskCount == 0);
} }
ProcessShelfOut = false; ProcessShelfOut = false;
ProcessShelfEnter = false; ProcessShelfEnter = false;
...@@ -94,16 +93,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -94,16 +93,12 @@ namespace OnlineStore.DeviceLibrary
if (needLeave) if (needLeave)
{ {
NeedLeave(); NeedLeave();
LogUtil.info($"复位 {Name}已满/无剩余任务,需要离开。{BoxTaskInfo?.ToStr()??""}");
} }
}); });
} }
void resetCnt()
{
CntInSideA = 0;
CntInSideB = 0;
}
public void LineRun(DeviceMoveInfo moveInfo = null) public void LineRun(DeviceMoveInfo moveInfo = null)
{ {
IOManager.IOMove(DO_LineBackRun, IO_VALUE.LOW, config.Id); IOManager.IOMove(DO_LineBackRun, IO_VALUE.LOW, config.Id);
...@@ -187,7 +182,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -187,7 +182,7 @@ namespace OnlineStore.DeviceLibrary
} }
//再转动8000 //再转动8000
//Thread.Sleep(8000); //Thread.Sleep(8000);
// Complete(); // Complete();
while (!AgvNode.status.Equals(NodeStatus.Complete)) while (!AgvNode.status.Equals(NodeStatus.Complete))
{ {
...@@ -279,17 +274,17 @@ namespace OnlineStore.DeviceLibrary ...@@ -279,17 +274,17 @@ namespace OnlineStore.DeviceLibrary
FinishEnter(); FinishEnter();
//等待200毫秒后停止转动 //等待200毫秒后停止转动
//Thread.Sleep(3000); //Thread.Sleep(3000);
resetCnt();
LogUtil.info(logName + "等待3000后,停止链条转动"); LogUtil.info(logName + "等待3000后,停止链条转动");
LineStopRun(); LineStopRun();
GetBoxTaskInfo();
//if (ReadBoxId())
//{
// //SServerManager.BoxTakeAway(BoxId);
// //Thread.Sleep(1000);
// // BoxTaskInfo = SServerManager.GetBoxStatusInfo(config.CID, BoxId);
//}
if (ReadBoxId())
{
SServerManager.BoxTakeAway(BoxId);
Thread.Sleep(1000);
BoxTaskInfo = SServerManager.GetBoxStatusInfo(config.CID, BoxId);
}
ProcessShelfEnter = false; ProcessShelfEnter = false;
LogUtil.info(logName + " 结束"); LogUtil.info(logName + " 结束");
} }
...@@ -321,34 +316,34 @@ namespace OnlineStore.DeviceLibrary ...@@ -321,34 +316,34 @@ namespace OnlineStore.DeviceLibrary
} }
public Node AgvNode { get; set; } public Node AgvNode { get; set; }
/// <summary> /// <summary>
/// A侧数量 /// 是否有空位置
/// </summary> /// </summary>
public int CntInSideA { get; set; } /// <returns></returns>
/// <summary> public bool HasEmptyPos(int boxT, int boxB)
/// B侧数量
/// </summary>
public int CntInSideB { get; set; }
public bool CanPutIn(out string msg)
{ {
msg = ""; return boxT < MaxCntOnSide && boxB < MaxCntOnSide;
if (InHandlingAGVSig())
{
msg = Name + " 正在进出料,不允许放料";
return false;
}
if (!BoxId.StartsWith("CN"))
{
msg = Name + " 未读到rfid,不允许放料";
return false;
}
bool rtn = CntInSideA < MaxCntOnSide && CntInSideB < MaxCntOnSide;
if (!rtn)
{
msg = Name + $" 格口数量已满,不允许放料。当前数量:【内侧={CntInSideA}】【外侧={CntInSideB}】";
NeedLeave();
}
return rtn;
} }
//public bool CanPutIn(out string msg)
//{
// msg = "";
// if (InHandlingAGVSig())
// {
// msg = Name + " 正在进出料,不允许放料";
// return false;
// }
// if (!BoxId.StartsWith("CN"))
// {
// msg = Name + " 未读到rfid,不允许放料";
// return false;
// }
// bool rtn = CntInSideT < MaxCntOnSide && CntInSideB < MaxCntOnSide;
// if (!rtn)
// {
// msg = Name + $" 格口数量已满,不允许放料。当前数量:【内侧={CntInSideT}】【外侧={CntInSideB}】";
// NeedLeave();
// }
// return rtn;
//}
//public bool CheckState(Label_LZ labelInfo, InOutParam param, out BoxTaskInfo boxTaskInfo, out string warnMsg) //public bool CheckState(Label_LZ labelInfo, InOutParam param, out BoxTaskInfo boxTaskInfo, out string warnMsg)
//{ //{
// boxTaskInfo = BoxTaskInfo; // boxTaskInfo = BoxTaskInfo;
...@@ -485,19 +480,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -485,19 +480,12 @@ namespace OnlineStore.DeviceLibrary
public void PutReelIn(int side) public void PutReelIn(int side)
{ {
WarnMsg = ""; WarnMsg = "";
if (side % 2 != 0) bool rtn = false;
{ //BoxTaskInfo = SServerManager.GetBoxStatusInfo(config.CID, BoxId);
CntInSideA++;
}
else
{
CntInSideB++;
}
bool rtn = CntInSideA >= MaxCntOnSide || CntInSideB >= MaxCntOnSide;
BoxTaskInfo = SServerManager.GetBoxStatusInfo(config.CID, BoxId);
bool hasRemain = true; bool hasRemain = true;
if (BoxTaskInfo != null) if (BoxTaskInfo != null)
{ {
rtn = BoxTaskInfo.boxBCount >= MaxCntOnSide || BoxTaskInfo.boxTCount >= MaxCntOnSide;
hasRemain = (BoxTaskInfo.remainTaskCount > 0 ? true : false); hasRemain = (BoxTaskInfo.remainTaskCount > 0 ? true : false);
} }
if (AutoClearBoxBind) if (AutoClearBoxBind)
...@@ -512,16 +500,25 @@ namespace OnlineStore.DeviceLibrary ...@@ -512,16 +500,25 @@ namespace OnlineStore.DeviceLibrary
else if (rtn || !hasRemain) else if (rtn || !hasRemain)
{ {
NeedLeave(); NeedLeave();
LogUtil.info($"{Name}已满/无剩余任务,需要离开。{BoxTaskInfo?.ToStr()??""}");
} }
} }
public void GetBoxTaskInfo() public void GetBoxTaskInfo()
{ {
if (ReadBoxId()) if (ReadBoxId())
BoxTaskInfo = SServerManager.GetBoxStatusInfo(config.CID, BoxId); {
List<BoxTaskInfo> boxInfos = SServerManager.GetOutStateInfo();
UpdateBoxInfo(boxInfos);
}
}
public void UpdateBoxInfo(List<BoxTaskInfo> boxInfos)
{
if (boxInfos == null) return;
BoxTaskInfo = boxInfos.Find(s => outLet.Equals(s.outlet));
} }
/// <summary> /// <summary>
/// 箱子任务信息 /// 任务信息
/// </summary> /// </summary>
public BoxTaskInfo BoxTaskInfo { get; set; } public BoxTaskInfo BoxTaskInfo { get; set; }
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<configSections> <configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" /> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
</configSections> </configSections>
<log4net> <log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender"> <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="logs/main/XLR-SO1131.log" /> <file value="logs/main/XLR-SO1131.log"/>
<param name="Encoding" value="UTF-8" /> <param name="Encoding" value="UTF-8"/>
<appendToFile value="true" /> <appendToFile value="true"/>
<rollingStyle value="Date" /> <rollingStyle value="Date"/>
<datePattern value="yyyy-MM-dd" /> <datePattern value="yyyy-MM-dd"/>
<layout type="log4net.Layout.PatternLayout"> <layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date][%t]%-5p %m%n" /> <conversionPattern value="[%date][%t]%-5p %m%n"/>
</layout> </layout>
</appender> </appender>
<appender name="TheRFID" type="log4net.Appender.RollingFileAppender"> <appender name="TheRFID" type="log4net.Appender.RollingFileAppender">
<file value="logs/rfid/TheRFID-line.log" /> <file value="logs/rfid/TheRFID-line.log"/>
<param name="Encoding" value="UTF-8" /> <param name="Encoding" value="UTF-8"/>
<appendToFile value="true" /> <appendToFile value="true"/>
<rollingStyle value="Date" /> <rollingStyle value="Date"/>
<datePattern value="yyyy-MM-dd" /> <datePattern value="yyyy-MM-dd"/>
<layout type="log4net.Layout.PatternLayout"> <layout type="log4net.Layout.PatternLayout">
<conversionPattern value="[%date][%t]%-5p %m%n" /> <conversionPattern value="[%date][%t]%-5p %m%n"/>
</layout> </layout>
</appender> </appender>
<appender name="jaka" type="log4net.Appender.RollingFileAppender"> <appender name="jaka" type="log4net.Appender.RollingFileAppender">
...@@ -55,12 +55,12 @@ ...@@ -55,12 +55,12 @@
</layout> </layout>
</appender> </appender>
<logger name="RollingLogFileAppender"> <logger name="RollingLogFileAppender">
<level value="all" /> <level value="all"/>
<appender-ref ref="RollingLogFileAppender" /> <appender-ref ref="RollingLogFileAppender"/>
</logger> </logger>
<logger name="TheRFID"> <logger name="TheRFID">
<level value="all" /> <level value="all"/>
<appender-ref ref="TheRFID" /> <appender-ref ref="TheRFID"/>
</logger> </logger>
<logger name="jaka"> <logger name="jaka">
<level value="info"/> <level value="info"/>
...@@ -76,20 +76,20 @@ ...@@ -76,20 +76,20 @@
</logger> </logger>
</log4net> </log4net>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" /> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup> </startup>
<runtime> <runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" culture="neutral" /> <assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-2.0.12.0" newVersion="2.0.12.0" /> <bindingRedirect oldVersion="0.0.0.0-2.0.12.0" newVersion="2.0.12.0"/>
</dependentAssembly> </dependentAssembly>
</assemblyBinding> </assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" /> <bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0"/>
</dependentAssembly> </dependentAssembly>
</assemblyBinding> </assemblyBinding>
</runtime> </runtime>
</configuration>
\ No newline at end of file \ No newline at end of file
</configuration>
...@@ -46,14 +46,7 @@ namespace OnlineStore.XLRStore ...@@ -46,14 +46,7 @@ namespace OnlineStore.XLRStore
Application.Exit(); Application.Exit();
return; return;
} }
LoadStoreData(); LoadStoreData();
this.Opacity = 100;
this.Visible = true;
this.notifyIcon1.Visible = false;
this.ShowInTaskbar = true;
this.Cursor = Cursors.Default;
if (StoreManager.DisSecurityAccess) if (StoreManager.DisSecurityAccess)
{ {
禁用安全光栅ToolStripMenuItem.Text = gouStr + "禁用安全光栅"; 禁用安全光栅ToolStripMenuItem.Text = gouStr + "禁用安全光栅";
...@@ -72,6 +65,11 @@ namespace OnlineStore.XLRStore ...@@ -72,6 +65,11 @@ namespace OnlineStore.XLRStore
} }
//tabControl1.TabPages.Remove(tabPage5); //tabControl1.TabPages.Remove(tabPage5);
timer1.Start(); timer1.Start();
this.Opacity = 100;
this.Visible = true;
this.notifyIcon1.Visible = false;
this.ShowInTaskbar = true;
this.Cursor = Cursors.Default;
} }
private FrmInputEquip inputEquip = null; private FrmInputEquip inputEquip = null;
private FrmBoxEquip box = null; private FrmBoxEquip box = null;
...@@ -544,7 +542,7 @@ namespace OnlineStore.XLRStore ...@@ -544,7 +542,7 @@ namespace OnlineStore.XLRStore
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("XLRStore timer",ex); LogUtil.error("XLRStore timer", ex);
} }
} }
......
...@@ -11,6 +11,7 @@ using System.Threading.Tasks; ...@@ -11,6 +11,7 @@ using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using OnlineStore.DeviceLibrary; using OnlineStore.DeviceLibrary;
using System.Runtime.ExceptionServices; using System.Runtime.ExceptionServices;
using System.ComponentModel;
namespace OnlineStore.XLRStore namespace OnlineStore.XLRStore
{ {
...@@ -56,6 +57,8 @@ namespace OnlineStore.XLRStore ...@@ -56,6 +57,8 @@ namespace OnlineStore.XLRStore
[HandleProcessCorruptedStateExceptions] [HandleProcessCorruptedStateExceptions]
static void Main(string[] Args) static void Main(string[] Args)
{ {
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException); Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
...@@ -105,7 +108,6 @@ namespace OnlineStore.XLRStore ...@@ -105,7 +108,6 @@ namespace OnlineStore.XLRStore
Application.Run(new FrmXLRStore()); Application.Run(new FrmXLRStore());
} }
} }
private static void CurrentDomain_FirstChanceException(object sender, System.Runtime.ExceptionServices.FirstChanceExceptionEventArgs e) private static void CurrentDomain_FirstChanceException(object sender, System.Runtime.ExceptionServices.FirstChanceExceptionEventArgs e)
{ {
// LogUnhandledException("CurrentDomain_FirstChanceException", e); // LogUnhandledException("CurrentDomain_FirstChanceException", e);
......
...@@ -12,7 +12,7 @@ namespace OnlineStore.XLRStore.Properties { ...@@ -12,7 +12,7 @@ namespace OnlineStore.XLRStore.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.2.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.3.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
......
...@@ -43,48 +43,52 @@ namespace OnlineStore.XLRStore ...@@ -43,48 +43,52 @@ namespace OnlineStore.XLRStore
chbDebug.Checked = boxBean.IsDebug; chbDebug.Checked = boxBean.IsDebug;
FrmPosDebug frmPosDebug = new FrmPosDebug(); FrmPosDebug frmPosDebug = new FrmPosDebug();
AddForm(tabControl1, " 库位调试 ", frmPosDebug); AddForm(tabControl1, " 库位调试 ", frmPosDebug);
boxBean.RegisterCameraAGrabImage(BoxBean_camera_A_event); boxBean.RegisterCameraGrabImage(BoxBean_camera_event);
boxBean.RegisterCameraBGrabImage(BoxBean_camera_B_event);
IsLoad = true; IsLoad = true;
} }
/// <summary> /// <summary>
/// 监控相机A采集图像事件 /// 监控相机A采集图像事件
/// </summary> /// </summary>
/// <param name="cameraArgs"></param> /// <param name="cameraArgs"></param>
private void BoxBean_camera_A_event(IPCameraEventArgs cameraArgs) private void BoxBean_camera_event(CameraArgs cameraArgs)
{ {
if (!this.IsHandleCreated) return; if (!this.IsHandleCreated) return;
try try
{ {
this.Invoke(new Action(() => this.Invoke(new Action(() =>
{ {
if (!groupBox2.Text.Contains("-")) //if (!groupBox2.Text.Contains("-"))
groupBox2.Text = $"A相机-{cameraArgs.IP}-ch{cameraArgs.ChannelNum}"; // groupBox2.Text = $"A相机-{cameraArgs.IP}-ch{cameraArgs.ChannelNum}";
//pictureBox1.Image = null; //pictureBox1.Image = null;
pictureBox1.Image = (Image)cameraArgs.Image.Clone(); if (BoxEquip.boxACamName.Equals(cameraArgs.CamName))
pictureBox1.Image = (Image)cameraArgs.Image.Clone();
else
{
pictureBox2.Image = (Image)cameraArgs.Image.Clone();
}
})); }));
} }
catch catch
{
}
}
private void BoxBean_camera_B_event(IPCameraEventArgs cameraArgs)
{
if (!this.IsHandleCreated) return;
try
{ {
this.Invoke(new Action(() =>
{
if (!groupBox5.Text.Contains("-"))
groupBox5.Text = $"B相机-{cameraArgs.IP}-ch{cameraArgs.ChannelNum}";
//pictureBox2.Image = null;
pictureBox2.Image = (Image)cameraArgs.Image.Clone();
}));
} }
catch { }
} }
//private void BoxBean_camera_B_event(IPCameraEventArgs cameraArgs)
//{
// if (!this.IsHandleCreated) return;
// try
// {
// this.Invoke(new Action(() =>
// {
// if (!groupBox5.Text.Contains("-"))
// groupBox5.Text = $"B相机-{cameraArgs.IP}-ch{cameraArgs.ChannelNum}";
// //pictureBox2.Image = null;
// pictureBox2.Image = (Image)cameraArgs.Image.Clone();
// }));
// }
// catch { }
//}
protected Dictionary<string, IOTextControl> DIControlList = new Dictionary<string, IOTextControl>(); protected Dictionary<string, IOTextControl> DIControlList = new Dictionary<string, IOTextControl>();
protected Dictionary<string, IOTextControl> DOControlList = new Dictionary<string, IOTextControl>(); protected Dictionary<string, IOTextControl> DOControlList = new Dictionary<string, IOTextControl>();
protected void ReadIOList() protected void ReadIOList()
......
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
this.panBase = new System.Windows.Forms.Panel(); this.panBase = new System.Windows.Forms.Panel();
this.chbMoveStop = new System.Windows.Forms.CheckBox(); this.chbMoveStop = new System.Windows.Forms.CheckBox();
this.lblWarnMsg = new System.Windows.Forms.Label(); this.lblWarnMsg = new System.Windows.Forms.Label();
this.btnResetShelf = new System.Windows.Forms.Button();
this.chbDebug = new System.Windows.Forms.CheckBox(); this.chbDebug = new System.Windows.Forms.CheckBox();
this.lblAgvInfo = new System.Windows.Forms.Label(); this.lblAgvInfo = new System.Windows.Forms.Label();
this.btnShelfOut = new System.Windows.Forms.Button(); this.btnShelfOut = new System.Windows.Forms.Button();
...@@ -238,7 +237,6 @@ ...@@ -238,7 +237,6 @@
this.panBase.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.panBase.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panBase.Controls.Add(this.chbMoveStop); this.panBase.Controls.Add(this.chbMoveStop);
this.panBase.Controls.Add(this.lblWarnMsg); this.panBase.Controls.Add(this.lblWarnMsg);
this.panBase.Controls.Add(this.btnResetShelf);
this.panBase.Controls.Add(this.chbDebug); this.panBase.Controls.Add(this.chbDebug);
this.panBase.Controls.Add(this.lblAgvInfo); this.panBase.Controls.Add(this.lblAgvInfo);
this.panBase.Controls.Add(this.btnShelfOut); this.panBase.Controls.Add(this.btnShelfOut);
...@@ -277,20 +275,6 @@ ...@@ -277,20 +275,6 @@
this.lblWarnMsg.Text = "等待启动"; this.lblWarnMsg.Text = "等待启动";
this.lblWarnMsg.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.lblWarnMsg.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
// //
// btnResetShelf
//
this.btnResetShelf.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnResetShelf.BackColor = System.Drawing.Color.White;
this.btnResetShelf.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnResetShelf.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnResetShelf.Location = new System.Drawing.Point(680, 251);
this.btnResetShelf.Name = "btnResetShelf";
this.btnResetShelf.Size = new System.Drawing.Size(128, 40);
this.btnResetShelf.TabIndex = 326;
this.btnResetShelf.Text = "重置料箱信息";
this.btnResetShelf.UseVisualStyleBackColor = false;
this.btnResetShelf.Click += new System.EventHandler(this.btnResetShelf_Click);
//
// chbDebug // chbDebug
// //
this.chbDebug.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.chbDebug.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
...@@ -395,7 +379,6 @@ ...@@ -395,7 +379,6 @@
private System.Windows.Forms.Button LineBack_A; private System.Windows.Forms.Button LineBack_A;
private System.Windows.Forms.Button LineStart_A; private System.Windows.Forms.Button LineStart_A;
protected System.Windows.Forms.CheckBox chbDebug; protected System.Windows.Forms.CheckBox chbDebug;
protected System.Windows.Forms.Button btnResetShelf;
protected System.Windows.Forms.CheckBox chbMoveStop; protected System.Windows.Forms.CheckBox chbMoveStop;
private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Button button1; private System.Windows.Forms.Button button1;
......
...@@ -143,11 +143,11 @@ namespace OnlineStore.XLRStore ...@@ -143,11 +143,11 @@ namespace OnlineStore.XLRStore
} }
private void btnResetShelf_Click(object sender, EventArgs e) //private void btnResetShelf_Click(object sender, EventArgs e)
{ //{
moveBean.ClearBoxInfo(true); // moveBean.ClearBoxInfo(true);
LogUtil.info(moveBean.Name + "点击:" + btnResetShelf.Text + ";【" + moveBean.BoxId + "】"); // LogUtil.info(moveBean.Name + "点击:" + btnResetShelf.Text + ";【" + moveBean.BoxId + "】");
} //}
private void chbMoveStop_CheckedChanged(object sender, EventArgs e) private void chbMoveStop_CheckedChanged(object sender, EventArgs e)
{ {
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!