private void SendInMission(AgvInMissonModel mission) { SendLogEvent?.Invoke(new StationClientState { State = StationClientStateEnum.INFO, Message = "入库请求:" + mission.Type.EnumToString() }.ToString()); SendSingnalrEvent?.Invoke(AgvSendActionEnum.SendInMission.EnumToString(), mission); }
public bool CanRequest() { agv_inmissions_atpreplace = missionContext.undo_inmissions.Where(x => x.Process == AgvMissonProcessEnum.AGVATPREPLACE).FirstOrDefault(); var agv_inmissions_atpreplace_last = missionContext.undo_inmissions.Where(x => x.CarryProcess > CarryMissonProcessEnum.NEW && x.CarryProcess < CarryMissonProcessEnum.CLOSE || x.Process == AgvMissonProcessEnum.AGVATPLACE).FirstOrDefault(); return(agv_inmissions_atpreplace != null && agv_inmissions_atpreplace_last == null); }
public bool CanRequest() { if ((missionContext.undo_inmissions.Count + missionContext.undo_outmissions.Count) < 2) { new_inmission = missionContext.MissionInNodes.Where(x => x.Process == AgvMissonProcessEnum.NEW && x.CarryProcess == CarryMissonProcessEnum.NEW).FirstOrDefault(); return(new_inmission != null); } return(false); }
public void PushInMission(AgvInMissonModel mission) { var count = missionContext.MissionInNodes.Where(x => x.Id == mission.Id && (x.Process != AgvMissonProcessEnum.CLOSE || x.CarryProcess != CarryMissonProcessEnum.CLOSE)).Count(); if (count == 0) { mission.AgvProcessChangeEvent += (s, e) => AgvMissonChangeEvent?.Invoke(s, e); AgvMissonChangeEvent?.Invoke(mission, true); missionContext.MissionInNodes.Add(mission); SendAgvMissonEvent?.Invoke(mission); } }
public void OnAgvInMissonEvent(AgvInMissonModel mission) { //毛坯空箱回库 if (mission.Id.Equals(Station_Id + "_EMPTYOUT")) { if (mission.Process == AgvMissonProcessEnum.AGVPICKEDANDLEAVE && mission.Process != AgvMissonProcessEnum.CANCEL & mission.Process != AgvMissonProcessEnum.CANCELED) { bool empty_out = false; var ret_empty_out = StationDevice.GetEmptyOutState(ref empty_out); if (ret_empty_out == true && empty_out == true) { StationDevice.SetEmptyOutFin(true); bool empty_out_confirm = true; while (empty_out_confirm) { ret_empty_out = StationDevice.GetEmptyOutState(ref empty_out_confirm); if (ret_empty_out == true && empty_out_confirm == false) { StationDevice.SetEmptyOutFin(false); } Thread.Sleep(1000); } } } } //成品回库 if (mission.Id.Equals(Station_Id + "_FINOUT")) { if (mission.Process == AgvMissonProcessEnum.AGVPICKEDANDLEAVE && mission.Process != AgvMissonProcessEnum.CANCEL & mission.Process != AgvMissonProcessEnum.CANCELED) { bool fin_out = false; var ret_fin_out = StationDevice.GetFinOutState(ref fin_out); if (ret_fin_out == true && fin_out == true) { StationDevice.SetFinOutFin(true); bool fin_out_confirm = true; while (fin_out_confirm) { ret_fin_out = StationDevice.GetFinOutState(ref fin_out_confirm); if (ret_fin_out == true && fin_out_confirm == false) { StationDevice.SetFinOutFin(false); } Thread.Sleep(1000); } } } } }
//料库执行入库 private bool WareHouseInMission(AgvInMissonModel mission) { if (missionContext.carryDevice as RightCarryService.TestControlDevice != null) { mission.CarryProcess = CarryMissonProcessEnum.FINISHED; return(true); } TestRightCarryService <IControlDevice> carry = new TestRightCarryService <IControlDevice>(missionContext.carryDevice); var ret = carry.CarryIn(mission.ProductId, mission.MaterialId); if (ret == false) { mission.Process = AgvMissonProcessEnum.CANCEL; mission.CarryProcess = CarryMissonProcessEnum.CANCEL; carry.ReleaseLock(); return(false); } mission.CarryProcess = CarryMissonProcessEnum.FINISHED; carry.ReleaseLock(); return(true); }
private void SendMissonOrder(AgvMissonModel message) { var hubContext2 = GlobalHost.ConnectionManager.GetHubContext <NoticeHub>(); try { var client = new Client(StaticData.AppHostConfig.AgvServiceUrl); string id = $"{message.Id}_{ message.TimeId}"; StaticData.OrderName.Add(id); var order = new AgvInMissonModel() { Id = message.Id }.AgvMissonToTransportOrder(); client.TransportOrders2(id, order); hubContext2.Clients.All.queryOrder(id); } catch (Exception ex) { hubContext2.Clients.All.pushSystemMessage($"AGV调度服务连接失败,异常信息:{ex.Message}", new { state = false }); } }
public bool CanRequest() { agvcancel_inmission = missionContext.MissionInNodes.Where(x => x.Process == AgvMissonProcessEnum.CANCEL).FirstOrDefault(); return(agvcancel_inmission != null); }
public bool CanRequest() { carrycancel_inmission = missionContext.MissionInNodes.Where(x => x.CarryProcess == CarryMissonProcessEnum.CANCEL).FirstOrDefault(); return(carrycancel_inmission != null); }
public receiveInMissionFinMessage(AgvInMissonModel model) { Model = model; }
public SendMissonInOrder(AgvInMissonModel model) { Model = model; }
public SendInMissionFinMessage(AgvInMissonModel model) { Model = model; }
public SendInMission(AgvInMissonModel model) { Model = model; }
public bool CanRequest() { warehouse_inmission = missionContext.undo_inmissions.Where(x => x.Process == AgvMissonProcessEnum.FINISHED && x.CarryProcess == CarryMissonProcessEnum.NEW).FirstOrDefault(); return(warehouse_inmission != null); }
public bool CanRequest() { agv_inmission = missionContext.undo_inmissions.Where(x => x.Process == AgvMissonProcessEnum.START).FirstOrDefault(); return(agv_inmission != null); }
public void SendInMissionFinMessage(AgvInMissonModel message) { Clients.All.receiveInMissionFinMessage(message); }
public bool CanRequest() { currentMisson = missionContext.MissionInNodes.FirstOrDefault(x => x.CarryProcess == CarryMissonProcessEnum.FINISHED && x.Process > AgvMissonProcessEnum.AGVPLACEDANDLEAVE); return(currentMisson != null); }
public bool CanRequest() { agvfinished_inmission = missionContext.MissionInNodes.Where(x => x.Process == AgvMissonProcessEnum.FINISHED && x.CarryProcess > CarryMissonProcessEnum.NEW).FirstOrDefault(); return(agvfinished_inmission != null); }