/// <summary> /// /// </summary> /// <param name="index"></param> /// <param name="pushTime"> 开始推焦时间</param> /// <param name="tjc">是否为工作车</param> public PsInfo(int index, string pushTime, Tjc tjc) { List <Vehicle> lstVehical = tjc.JobCar ? Communication.TJobCarLst : Communication.NonJobCarLst; bool valid = index >= 0 ? true : false; DateTime invalidTime = Convert.ToDateTime("2012-04-03 13:14"); TPushPlan pNull = new TPushPlan(1, 1, 1, invalidTime); TPushPlan p = new TPushPlan(); p = valid ? CokeRoom.PushPlan[index] : (CokeRoom.PushPlan.Count > 0 ? new TPushPlan(CokeRoom.PushPlan[0]) : pNull); //20170923 PushPlan.Count==0时如何处理? PlanRoom = p.RoomNum; //计划炉号 ActualRoom = (byte)tjc.RoomNum; //pInfo.实际炉号 = (byte)lst[0].RoomNum; //pInfo.实际推焦时间 = Convert.ToDateTime(now); ActualPushTime = Convert.ToDateTime(pushTime); //pInfo.预定出焦时间 = p.PushTime; PlanPushTime = p.PushTime; //pInfo.上次装煤时间 = p.StokingTime;//默认值 LastStokingTime = p.StokingTime; //pInfo.规定结焦时间 = p.standardBurnTime; StandardBurnTime = p.StandardBurnTime; //pInfo.计划结焦时间 = p.BurnTime; PlanBurnTime = p.BurnTime; //pInfo.实际结焦时间 = (int)(Convert.ToDateTime(now) - p.StokingTime).TotalMinutes; ActualBurnTime = (int)(Convert.ToDateTime(pushTime) - p.StokingTime).TotalMinutes; //pInfo.时段 = (byte)p.Period; Period = (byte)p.Period; //pInfo.班组 = (byte)p.Group; Group = (byte)p.Group; DwTogetherInfo tInfo = tjc.JobCar ? Communication.JobCarTogetherInfo : Communication.NonJobCarTogetherInfo; //pInfo.Push联锁信息 = tInfo.InfoToInt; LockInfo = tInfo.InfoToInt; //pInfo.联锁 = tInfo.PushTogether ? (byte?)1 : 0; Lock = (byte)(tInfo.PushTogether ? 1 : 0); //pInfo.Push工作车序列 = (short)(lst[0].CarNum * 100 + lst[1].CarNum * 10 + lst[2].CarNum); Cars = (short)(lstVehical[0].CarNum * 100 + lstVehical[1].CarNum * 10 + lstVehical[2].CarNum); //推拦熄煤箭头:20170601 暂设置为固定值16;当工作推焦车出焦时,有三工作车得到箭头;非工作车时,置零 //pInfo.Push对中序列 = null; CarsReady = ArrowsToInt(lstVehical[0].Arrows, lstVehical[1].Arrows, lstVehical[2].Arrows);//箭头指示:前四位bit为推焦车的箭头,接下来四位拦焦车箭头,最后四位熄焦车箭头;共占12bit //pInfo.Push推焦车地址 = lst[0].DataRead.PhysicalAddr; TAddr = lstVehical[0].DataRead.PhysicalAddr; //pInfo.Push拦焦车地址 = lst[1].DataRead.PhysicalAddr; LAddr = lstVehical[1].DataRead.PhysicalAddr; //pInfo.Push熄焦车地址 = lst[2].DataRead.PhysicalAddr; XAddr = lstVehical[2].DataRead.PhysicalAddr; //pInfo.Push推焦车炉号 = lst[0].RoomNum; TRoom = lstVehical[0].RoomNum; //pInfo.Push拦焦车炉号 = lst[1].RoomNum; LRoom = lstVehical[1].RoomNum; //pInfo.Push熄焦车炉号 = lst[2].RoomNum; XRoom = lstVehical[2].RoomNum; //pInfo.Push车辆通讯状态 = null;//20170601 通讯状态暂未处理;设备的顺序:PLC,触摸屏,无线模块,解码器,每辆车占4bit,共计8辆车, CommStatus = 0;//20170601 通讯状态暂未处理 PlanIndex = index; PlanCount = CokeRoom.PushPlan.Count; BeginTime = DateTime.Now; RecAddr(); }
private void IniMJobAndNonJobCar() { TMJob = new Tjc(1); MJob = new Mc(1); MJobCarLst = new List <Vehicle>(); MJobCarLst.AddRange(new Vehicle[] { TMJob, MJob }); TMNonJob = new Tjc(2); MNonJob = new Mc(2); MNonJobCarLst = new List <Vehicle>(); MNonJobCarLst.AddRange(new Vehicle[] { TMNonJob, MNonJob }); }
private void IniJobAndNonJobCar() { TJob = new Tjc(1); LJob = new Ljc(1); XJob = new Xjc(1); TJobCarLst = new List <Vehicle>(); TJobCarLst.AddRange(new Vehicle[] { TJob, LJob, XJob }); TNonJob = new Vehicles.Tjc(2); LNonJob = new Ljc(2); XNonJob = new Xjc(2); NonJobCarLst = new List <Vehicle>(); NonJobCarLst.AddRange(new Vehicle[] { TNonJob, LNonJob, XNonJob }); }
private void CurPlotter_Loaded(object sender, RoutedEventArgs e) { T = (Tjc)Communication.CarsLst[TCarIndex]; pushPoleGraph = plotter.AddLineGraph(pushPoleDS, Colors.Green, 2, "推焦杆长"); pushCurGraph = plotter.AddLineGraph(pushCurDS, Colors.Red, 2, "推焦电流"); pingPoleGraph = plotter.AddLineGraph(pingPoleDS, Colors.Yellow, 2, "平煤杆长"); pingCurGraph = plotter.AddLineGraph(pingCurDS, Colors.Black, 2, "平煤电流"); plotter.Viewport.FitToView(); plotterTimer.Tick += PlotterTimer_Tick; plotterTimer.Interval = TimeSpan.FromMilliseconds(200); plotterTimer.Start(); }
private void TBinding() { Tjc t1 = (Tjc)Communication.CarsLst[0]; Tjc t2 = (Tjc)Communication.CarsLst[1]; UnitBinding(tjc, t1, t2); DataReadCellBinding(tPushCur, "PushCur", t1, t2); DataReadCellBinding(tPingCur, "PingCur", t1, t2); DataReadCellBinding(tPushPole, "PushPoleLength", t1, t2); DataReadCellBinding(tPingPole, "PingPoleLength", t1, t2); BoolCellBinding(tAskPush, "PushRequest", t1, t2); BoolCellBinding(tDoorOpen, "DoorOpen", t1, t2); BoolCellBinding(tPushLock, "PushTogether", t1, t2); BoolCellBinding(tPickDoorLock, "PickDoorTogether", t1, t2); BoolCellBinding(tPushBegin, "PushBegin", t1, t2); BoolCellBinding(tPushEnd, "PushEnd", t1, t2); BoolCellBinding(tPingBegin, "PingBegin", t1, t2); BoolCellBinding(tPingEnd, "PingEnd", t1, t2); BoolCellBinding(tPushForward, "PushPoleForward", t1, t2); BoolCellBinding(tPause, "PushPolePause", t1, t2); BoolCellBinding(tPushEndFlag, "PushEndFlag", t1, t2); BoolCellBinding(tPMDoorOpen, "PMDoorOpen", t1, t2); }