Commit eb08dc23 LN

1

1 个父辈 82abb114
......@@ -331,11 +331,12 @@
日志操作类
</summary>
</member>
<member name="M:Asa.IOModule.LogFile.#ctor(System.String)">
<member name="M:Asa.IOModule.LogFile.#ctor(System.String,System.String)">
<summary>
日志
</summary>
<param name="path">文件夹路径</param>
<param name="args"></param>
</member>
<member name="M:Asa.IOModule.LogFile.Close">
<summary>
......
......@@ -107,7 +107,7 @@
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(766, 708);
this.ClientSize = new System.Drawing.Size(961, 708);
this.Controls.Add(this.btnExit);
this.Controls.Add(this.btnUpdate);
this.Controls.Add(this.lblMsg);
......
......@@ -133,7 +133,8 @@ namespace OnlineStore.AssemblyLine
AddHealder("BOX_CID", 80);
AddHealder("BOX报警", 100);
AddHealder("更新时间", 80);
AddHealder("BOX状态", listView1.Size.Width - 100 - 80 - 80 - 100 - 100 - 100 -40- 8);
AddHealder("BOX状态", 100);
//AddHealder("BOX状态", listView1.Size.Width - 100 - 80 - 80 - 100 - 100 - 100 -40- 8);
foreach (MoveEquip move in lineBean.MoveEquipMap.Values)
{
ListViewItem lvi = new ListViewItem();
......
......@@ -417,7 +417,7 @@ namespace OnlineStore.DeviceLibrary
//判断是哪个工位有料架
if (IOValue(IO_Type.SL_Location_Check).Equals(IO_VALUE.HIGH))
{
FI_07_ShelfLocationUP();
FI_04_WaitTime();
}
else
{
......@@ -427,17 +427,15 @@ namespace OnlineStore.DeviceLibrary
}
return true ;
}
/// <summary>
/// 检测到上料工位有料架,缓冲阻挡上升,定位气缸上升,准备入料
/// </summary>
private void FI_07_ShelfLocationUP()
private void FI_04_WaitTime()
{
//定位工位有料架,直接开始入料
MoveInfo.NextMoveStep(LineMoveStep.FI_07_LocationCylinder_Up);
InStoreLog(" 定位工位检测到料架: " + MoveInfo.SLog + " 缓冲阻挡上升, 定位气缸上升");
IOMove(IO_Type.SL_Buffer_StopDown, IO_VALUE.LOW);//缓冲阻挡下降
CylinderMove(MoveInfo, IO_Type.SL_LocationCylinder_Down, IO_Type.SW4_LocationCylinder_Up);
//定位工位有料架,等待1秒后再次检测
MoveInfo.NextMoveStep(LineMoveStep.FI_04_WaitTime);
InStoreLog(" 定位工位检测到料架: " + MoveInfo.SLog + " 等待1秒再次检测");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
}
private void LineInStoreProcess()
{
IOMove(IO_Type.SL_Line_Run, IO_VALUE.LOW);
......@@ -445,7 +443,7 @@ namespace OnlineStore.DeviceLibrary
//判断是哪个工位有料架
if (IOValue(IO_Type.SL_Location_Check).Equals(IO_VALUE.HIGH))
{
FI_07_ShelfLocationUP();
FI_04_WaitTime();
}
//阻挡工位有料架,流水线转动一个工位
else if (IOValue(IO_Type.SL_Stop_Check).Equals(IO_VALUE.HIGH))
......@@ -508,7 +506,31 @@ namespace OnlineStore.DeviceLibrary
{
LineInStoreProcess();
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_04_WaitTime))
{
if (IOValue(IO_Type.SL_Location_Check).Equals(IO_VALUE.HIGH))
{
//定位工位有料架,直接开始入料
MoveInfo.NextMoveStep(LineMoveStep.FI_07_LocationCylinder_Up);
InStoreLog(" 定位工位检测到料架: " + MoveInfo.SLog + " 缓冲阻挡上升, 定位气缸上升");
IOMove(IO_Type.SL_Buffer_StopDown, IO_VALUE.LOW);//缓冲阻挡下降
CylinderMove(MoveInfo, IO_Type.SL_LocationCylinder_Down, IO_Type.SW4_LocationCylinder_Up);
}
else
{
MoveInfo.EndMove();
runStatus = LineRunStatus.Runing;
LogUtil.info(" 未检测到料架,入料结束");
}
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_05_WaitS))
{
//定位工位有料架,直接开始入料
MoveInfo.NextMoveStep(LineMoveStep.FI_07_LocationCylinder_Up);
InStoreLog(" 定位工位检测到料架: " + MoveInfo.SLog + " 缓冲阻挡上升, 定位气缸上升");
IOMove(IO_Type.SL_Buffer_StopDown, IO_VALUE.LOW);//缓冲阻挡下降
CylinderMove(MoveInfo, IO_Type.SL_LocationCylinder_Down, IO_Type.SW4_LocationCylinder_Up);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_07_LocationCylinder_Up))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_08_BatchAxisToP2);
......@@ -545,20 +567,24 @@ namespace OnlineStore.DeviceLibrary
if (IOValue(IO_Type.SL_MoveCylinder_Give).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.SL_MoveCylinder_Take).Equals(IO_VALUE.LOW))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_13_ScanCode);
InStoreLog(" 料盘移栽" + MoveInfo.SLog + ":开始扫码:暂时不扫码");
bool isScan = ConfigAppSettings.GetIntValue(Setting_Init.NeedScanCode).Equals(1);
InStoreLog(" 料盘移栽" + MoveInfo.SLog + ":开始扫码:是否需要扫码【"+isScan+"】");
LastCodeList = new List<string>();
//MoveInfo.WaitList.Add(WaitResultInfo.WaitFeedScanCode());
//MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(5000));
//Task<List<string>> scanTask = Task.Factory.StartNew(delegate
//{
// LastCodeList = CodeManager.CameraScan(Config.GetCameraList());
// if (LastCodeList.Count <= 0)
// {
// LastCodeList = CodeManager.CameraScan(Config.GetCameraList());
// }
// return LastCodeList;
//});
if (isScan)
{
MoveInfo.WaitList.Add(WaitResultInfo.WaitFeedScanCode());
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(5000));
Task<List<string>> scanTask = Task.Factory.StartNew(delegate
{
LastCodeList = CodeManager.CameraScan(Config.GetCameraList());
if (LastCodeList.Count <= 0)
{
LastCodeList = CodeManager.CameraScan(Config.GetCameraList());
}
return LastCodeList;
});
}
}
else
{
......@@ -770,7 +796,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.EndMove();
runStatus = LineRunStatus.Runing;
// MoveInfo.NextMoveStep(LineMoveStep.FI_39_OutLineRun);
InStoreLog(" 上料完成, ,料架到达出口处, 通知AGV取空料架, 入料流程结束");
InStoreLog(" 上料完成,料架到达出口处, 通知AGV取空料架, 入料流程结束");
AgvClient.ReadyEmpty(Config.AgvOutName);
}
......
......@@ -131,7 +131,7 @@ namespace OnlineStore.DeviceLibrary
{
// Create new modbus master and add event functions
aioBox = new AIOBOX();
//aioBox.LogPath( Application.StartupPath+@"\logs\aio\");
aioBox.LogPath( Application.StartupPath+@"\logs\aio\");
aioBox.IP = ioIp;
// bool rtn = aioBox.AutoIP(ioIp);
......
......@@ -558,20 +558,27 @@ namespace OnlineStore.DeviceLibrary
/// 入口流水线转动,等待入料检测信号消失
/// </summary>
FI_03_LineStart = 11003,
/// <summary>
/// 入口流水线转动,等待阻挡气缸信号到位
/// 入口流水线转动,等待定位工位信号稳定1秒
/// </summary>
FI_04_LineRunCheck= 11004,
FI_04_WaitTime = 11004,
/// <summary>
/// 入口流水线转动,等待入料阻挡信号消失
/// </summary>
FI_05_LineStart = 11005,
/// 入口流水线转动,等待定位工位信号稳定1秒
/// </summary>
FI_05_WaitS = 11005,
///// <summary>
///// 入口流水线转动,等待阻挡气缸信号到位
///// </summary>
//FI_04_LineRunCheck= 11004,
///// <summary>
///// 入口流水线转动,等待入料阻挡信号消失
///// </summary>
//FI_05_LineStart = 11005,
/// <summary>
/// 入口流水线转动,等待定位工位检测到位
/// </summary>
FI_06_LineRunCheck = 11006,
///// <summary>
///// 入口流水线转动,等待定位工位检测到位
///// </summary>
//FI_06_LineRunCheck = 11006,
/// <summary>
///入料检测: 工位检测信号,定位气缸上升
......
......@@ -284,11 +284,7 @@ namespace OnlineStore.DeviceLibrary
}
return false;
}
private static bool SendStrToClient(TcpClientBean client, string sendMsg)
{
if (client != null && client.ClientSocket.Connected)
......@@ -322,6 +318,10 @@ namespace OnlineStore.DeviceLibrary
{
ClientMap.Remove(id);
}
else
{
LogUtil.info("有新的料仓连接上,料仓ID【" + id + "】,地址【" + client.AddStr + "】");
}
ClientMap.Add(id, client);
}
}
......@@ -344,22 +344,21 @@ namespace OnlineStore.DeviceLibrary
private static bool ProcessMsg(TcpClientBean client, string msg)
{
IPEndPoint clientipe = (IPEndPoint)client.ClientSocket.RemoteEndPoint;
string add = clientipe.Address.ToString();
// string[] msgArray = msg.Split(cmd_spilt);
msg = msg.Replace("\r", "");
LogUtil.info("收到【" + add + "】的消息【" + msg + "】");
LogUtil.debug("收到【" + client.AddStr + "】的消息【" + msg + "】");
StoreSendBean storeSMsg = JsonHelper.DeserializeJsonToObject<StoreSendBean>(msg);
if (storeSMsg == null)
{
LogUtil.error("收到【" + add + "】的消息【" + msg + "】,解析失败");
LogUtil.error("收到【" + client.AddStr + "】的消息【" + msg + "】,解析失败");
}
else
{
int id = storeSMsg.StoreId;
BoxInfo box = new BoxInfo(storeSMsg.StoreId, storeSMsg.Cid, storeSMsg.Seq, storeSMsg.SStatus, storeSMsg.SRunStatus, storeSMsg.DoorHasTray, storeSMsg.AlarmType, storeSMsg.WaitInStoreList);
SaveBoxClient(id, box, client);
SaveBoxClient(id, box, client );
string cmd = storeSMsg.Cmd;
if (cmd.StartsWith(cmd_heart))
......@@ -367,7 +366,7 @@ namespace OnlineStore.DeviceLibrary
}
else if (cmd.StartsWith(cmd_outend))
{
LogUtil.info("收到【" + add + "】的出库完成消息【" + msg + "】");
LogUtil.info("收到【" + client.AddStr + "】的出库完成消息【" + msg + "】");
string posId = storeSMsg.PosId;
int plateH = Convert.ToInt32(storeSMsg.PlateH.Trim());
int plateW = Convert.ToInt32(storeSMsg.PlateW.Trim());
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!