Commit 0b688069 LN

agv增加cancelState

1 个父辈 8c704242
...@@ -323,6 +323,7 @@ namespace OnlineStore.ACPackingStore ...@@ -323,6 +323,7 @@ namespace OnlineStore.ACPackingStore
} }
RFIDManager.Close(); RFIDManager.Close();
AgvClient.Dispose();
} }
private void btnClearLog_Click(object sender, EventArgs e) private void btnClearLog_Click(object sender, EventArgs e)
{ {
......
...@@ -141,14 +141,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -141,14 +141,14 @@ namespace OnlineStore.DeviceLibrary
return false; return false;
} }
LogInfo("开始启动,启动时间:" + StartTime.ToString()); LogInfo("开始启动,启动时间:" + StartTime.ToString());
// if (IsDebug) // if (IsDebug)
{ //{
//连接AGV调度 // //连接AGV调度
if (!AgvClient.ISConnected()) // if (!AgvClient.ISConnected())
{ // {
AgvClient.Init(); // AgvClient.Init();
} // }
} //}
AutoInout.StopAuto(); AutoInout.StopAuto();
mainTimer.Enabled = false; mainTimer.Enabled = false;
alarmType = StoreAlarmType.None; alarmType = StoreAlarmType.None;
...@@ -170,8 +170,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -170,8 +170,8 @@ namespace OnlineStore.DeviceLibrary
storeRunStatus = StoreRunStatus.HomeMoving; storeRunStatus = StoreRunStatus.HomeMoving;
storeStatus = StoreStatus.ResetMove; storeStatus = StoreStatus.ResetMove;
//启动温湿度服务器 //启动温湿度服务器
HumitureController.Init(Config.Humiture_Port); HumitureController.Init(Config.Humiture_Port);
ReturnHome(); ReturnHome();
StartTime = DateTime.Now; StartTime = DateTime.Now;
mainTimer.Enabled = true; mainTimer.Enabled = true;
......
...@@ -85,6 +85,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -85,6 +85,9 @@ namespace OnlineStore.DeviceLibrary
IOMove(IO_Type.RunSign_HddLed, IO_VALUE.LOW); IOMove(IO_Type.RunSign_HddLed, IO_VALUE.LOW);
mainTimer.Enabled = true; mainTimer.Enabled = true;
canStart = true; canStart = true;
//连接AGV调度
AgvClient.Init();
}); });
} }
...@@ -137,11 +140,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -137,11 +140,10 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info(Name + "开始启动,连接agv调度,连接rfid,启动时间:" + StartTime.ToString()); LogUtil.info(Name + "开始启动,连接agv调度,连接rfid,启动时间:" + StartTime.ToString());
storeRunStatus = StoreRunStatus.HomeMoving; storeRunStatus = StoreRunStatus.HomeMoving;
StartTime = DateTime.Now; StartTime = DateTime.Now;
//连接AGV调度 AgvClient.SetCancelState(false);
if (!AgvClient.ISConnected()) //if (!AgvClient.ISConnected())
{ //{
AgvClient.Init(); //}
}
RFIDManager.Open(rfidList.ToArray()); RFIDManager.Open(rfidList.ToArray());
mainTimer.Enabled = false; mainTimer.Enabled = false;
...@@ -197,7 +199,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -197,7 +199,7 @@ namespace OnlineStore.DeviceLibrary
{ {
mainTimer.Enabled = false; mainTimer.Enabled = false;
ledProcessTimer.Enabled = false; ledProcessTimer.Enabled = false;
AgvClient.SetCancelState(true);
//停止运行时,把阻挡气缸上升 //停止运行时,把阻挡气缸上升
StopMove(); StopMove();
foreach (AC_BOX_Bean equip in BoxMap.Values) foreach (AC_BOX_Bean equip in BoxMap.Values)
......
...@@ -15,7 +15,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -15,7 +15,7 @@ namespace OnlineStore.DeviceLibrary
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private static string ServerIp = ConfigAppSettings.GetValue(Setting_Init.AgvServerIp); private static string ServerIp = ConfigAppSettings.GetValue(Setting_Init.AgvServerIp);
private static Asa.Client2 agvClient; private static Asa.Client2 agvClient;
public static Dictionary<string, Asa.ClientAction> actionMap = new Dictionary<string, Asa.ClientAction>(); private static Dictionary<string, Asa.ClientAction> actionMap = new Dictionary<string, Asa.ClientAction>();
public static List<string> NodeList = new List<string>(); public static List<string> NodeList = new List<string>();
private static bool isInit = false; private static bool isInit = false;
public static void Init() public static void Init()
...@@ -26,6 +26,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -26,6 +26,7 @@ namespace OnlineStore.DeviceLibrary
{ {
isInit = true; isInit = true;
agvClient = new Asa.Client2(ServerIp); agvClient = new Asa.Client2(ServerIp);
agvClient.CancelState = true;
agvClient.Log += AgvClient_Log; agvClient.Log += AgvClient_Log;
agvClient.Arrive += AgvClient_Arrive; agvClient.Arrive += AgvClient_Arrive;
agvClient.Ready += AgvClient_Ready; agvClient.Ready += AgvClient_Ready;
...@@ -49,7 +50,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -49,7 +50,10 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error("初始化agvClient " + ServerIp + " 出错:"+ ex.ToString()); LogUtil.error("初始化agvClient " + ServerIp + " 出错:"+ ex.ToString());
} }
} }
public static void SetCancelState(bool isCancel)
{
agvClient.CancelState = isCancel;
}
public static Dictionary<string, DateTime> closeDoorTimeMap = new Dictionary<string, DateTime>(); public static Dictionary<string, DateTime> closeDoorTimeMap = new Dictionary<string, DateTime>();
private static void AgvClient_CloseDoor(string id, byte[] content) private static void AgvClient_CloseDoor(string id, byte[] content)
{ {
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!