示例#1
0
        private void LoadSecondStation()
        {
            stationElements_1_ = StationElements.Open("StationElements1.xml");
            stationTopoloty_1_ = new StationTopoloty();
            stationTopoloty_1_.Open("StationTopoloty1.xml", stationElements_1_.Elements);

            foreach (var item in stationElements_1_.Elements)
            {
                item.Top  += 55;
                item.Left += 1450;
            }

            stationElements_1_.AddElementsToCanvas(MainCanvas);
        }
示例#2
0
 public void AddObstacleCollection(StationElements StationElements, List <ObstacleInfo> Obstacle, string Section)
 {
     foreach (var element in StationElements.Elements)
     {
         if (element is RailSwitch && (element as RailSwitch).SectionName.Substring(0, 3) == Section.Substring(0, 3) && (element as RailSwitch).Name == Section.Substring(4))
         {
             ObstacleInfo railSwitchObstacle = new ObstacleInfo();
             railSwitchObstacle.NC_Obstacle    = 4;
             railSwitchObstacle.NID_Obstacle   = (ushort)Convert.ToInt16((element as RailSwitch).SectionName.Substring(0, 3));
             railSwitchObstacle.Q_Obstacle_Now = ((element as RailSwitch).IsPositionNormal == true ? Convert.ToByte(1) : Convert.ToByte(2));
             railSwitchObstacle.Q_Obstacle_CI  = railSwitchObstacle.Q_Obstacle_Now;
             Obstacle.Add(railSwitchObstacle);
         }
     }
 }
示例#3
0
 private void LoadGraphicElements(string path)
 {
     stationElements_ = StationElements.Open(path);
     stationElements_.AddElementsToCanvas(MainCanvas);
 }