private void SetEB() { Num = 0; foreach (var PSDoor in InPSDoors) { PSDoor psdoor = PSDoor as PSDoor; if (psdoor.IsEB != Info[Num]) { psdoor.IsEB = Info[Num]; //UpdateDevice(psdoor); } Num++; } }
private void SetPSDoor() { Num = 0; foreach (var PSDoor in InPSDoors) { PSDoor psdoor = PSDoor as PSDoor; if (psdoor.IsOpen != Info[Num]) { psdoor.IsOpen = Info[Num]; UpdateDevice(psdoor); } Num++; } }
public LoadSectionRelay() { List <string> list = new List <string>(); using (StreamReader sr = new StreamReader("src\\SectionRelay.txt", Encoding.Default)) { String line; while ((line = sr.ReadLine()) != null) { list.Add(line); } } foreach (var line in list) { string[] item = line.Split(':'); string secID = item[0].Split('_')[1]; int sectionID = Convert.ToInt16(secID); string[] psdID = System.Text.RegularExpressions.Regex.Split(item[1], @"\s+"); int psdoorID = Convert.ToInt16(psdID[1].Split('_')[2]); Section section = MainWindow.stationElements_.Elements.Find((GraphicElement element) => { if (element is Section) { if ((element as Section).ID == sectionID) { return(true); } } return(false); }) as Section; PSDoor psdoor = MainWindow.stationElements_.Elements.Find((GraphicElement element) => { if (element is PSDoor) { if ((element as PSDoor).ID == psdoorID) { return(true); } } return(false); }) as PSDoor; section.RelayPSDoor = psdoor; } }
private void GetDoorInfo() { bool shouldDoorOpen = unPack.GetByte() == 1 ? true : false; trainInfo.PSDoor = shouldDoorOpen; if (trainInfo.HeadPosition is Section) { if ((trainInfo.HeadPosition as Section).LogicCount == 1) { PSDoor psdoor = Load.FindDoor.FindRelayPSDoor(trainInfo.HeadPosition as Section); if (psdoor != null) { psdoor.ShouldOpen = shouldDoorOpen; } } } }