Ejemplo n.º 1
0
        public override void GeneratePossibleResourceStatus()
        {
            foreach (Movement m in DataRepository.MovementList)
            {
                if (!(m is TrainSegmentMovement))
                {
                    continue;
                }

                if (((TrainSegmentMovement)m).OnSegment.BindingBlockingSection != this)
                {
                    continue;
                }

                BlockSectionStatus OccupiedBSStatus = new BlockSectionStatus()
                {
                    HandlingMovement = m
                };
                PossibleResourceStatus.Add(OccupiedBSStatus);
            }

            BlockSectionStatus NonOccupiedBSStatus = new BlockSectionStatus()
            {
                HandlingMovement = null
            };

            PossibleResourceStatus.Add(NonOccupiedBSStatus);
        }
Ejemplo n.º 2
0
        public override void GeneratePossibleResourceStatus()
        {
            foreach (Movement m in DataRepository.MovementList)
            {
                if (m is VehicleWaitingMovement)
                {
                    VehicleWaitingMovement vwm = m as VehicleWaitingMovement;
                    if (vwm.BindingVehicle == this)
                    {
                        VehicleStatus status = new VehicleStatus()
                        {
                            Location = vwm.FromLocation, HandlingMovement = m
                        };
                        PossibleResourceStatus.Add(status);
                    }
                }
                else if (m is TrainSegmentMovement)
                {
                    VehicleStatus status = new VehicleStatus()
                    {
                        Location = m.FromLocation, HandlingMovement = m
                    };
                    PossibleResourceStatus.Add(status);

                    status = new VehicleStatus()
                    {
                        Location = m.ToLocation, HandlingMovement = m
                    };
                    PossibleResourceStatus.Add(status);

                    status = new VehicleStatus()
                    {
                        Location = Parameters.VirtualOnWayLocation, HandlingMovement = m
                    };
                    PossibleResourceStatus.Add(status);
                }
            }
        }