/// <summary> /// 货柜信息 /// </summary> public BoxRpt BoxInfo(int box) { BoxRpt boxRpt = new BoxRpt(); int colcount = JPBoxConfigUtil.GetColcount(m_com); HuoDaoRpt huoDaoRpt = base.GET_HUODAO((byte)box); int i = 0; foreach (HuoDaoInfo huoDaoInfo in huoDaoRpt.HuoDaoInfoList) { i++; RoadRpt roadRpt = new RoadRpt(); roadRpt.Floor = ((i - 1) / colcount) + 1; roadRpt.Num = ((i - 1) % colcount) + 1; roadRpt.IsOK = huoDaoInfo.HuoDaoSt == HuoDaoSt.正常 ? true : false; switch (huoDaoInfo.HuoDaoSt) { case HuoDaoSt.货道不存在: roadRpt.ErrorMsg = "货道不存在"; break; case HuoDaoSt.暂不可用: roadRpt.ErrorMsg = "货道暂不可用"; break; case HuoDaoSt.故障: roadRpt.ErrorMsg = "货道故障"; break; } roadRpt.Remainder = huoDaoInfo.Remainder; boxRpt.RoadCollection.RoadList.Add(roadRpt); } return(boxRpt); }
/// <summary> /// 货柜信息 /// </summary> /// <param name="com">货柜串口号</param> /// <param name="box">货柜号</param> public BoxRpt BoxInfo(string com, int box) { BoxRpt boxRpt; try { IMachine machine = MachineFactory.GetMachine(com); boxRpt = machine.BoxInfo(box); } catch (Exception ex) { boxRpt = new BoxRpt(); boxRpt.HasError = true; boxRpt.ErrorMsg = ex.Message; FileLogger.LogError("获取货柜信息失败" + ex.Message); } return(boxRpt); }
/// <summary> /// 货柜信息 /// </summary> public BoxRpt BoxInfo(int box) { BoxRpt boxRpt = new BoxRpt(); //机器设备状态 BoxStatus boxStatus = base.QueryBoxStatus(box); boxRpt.BoxStatus += string.Format("机器设备状态:\r\n{0}\r\n", boxStatus.ToString()); //制冷压缩机/风机/照明/除雾/广告灯/工控机等设备状态 EquipmentsStatus equipmentsStatus = base.QueryEquipmentsStatus(box); boxRpt.BoxStatus += string.Format("制冷压缩机/风机/照明/除雾/广告灯/工控机等设备状态:\r\n{0}\r\n", equipmentsStatus.ToString()); //制冷压缩机/照明/除雾/广告灯/工控机等设备控制策略参数 EquipmentInfo equipmentAll = base.QueryEquipmentAll(box); boxRpt.BoxSetup += equipmentAll.ToString(); //货道信息 RoadModelCollection roadModelCollection = JMBoxConfigUtil.GetRoadsConfig(box); foreach (RoadModel road in roadModelCollection.RoadList) { RoadInfo roadInfo = base.QueryRoadInfo(box, road.Floor, road.Num); RoadRpt roadRpt = new RoadRpt(); roadRpt.Floor = road.Floor; roadRpt.Num = road.Num; roadRpt.IsOK = roadInfo.IsOK; roadRpt.ErrorMsg = roadInfo.ErrorMsg; roadRpt.Price = roadInfo.Price; boxRpt.RoadCollection.RoadList.Add(roadRpt); } boxRpt.RoadCollection.FloorCount = roadModelCollection.FloorCount; return(boxRpt); }