예제 #1
0
        // ²âÊÔ 3 ¸ö×èµ²µã
        public List <Vertex> test3Stop(MGraph pMGraph)
        {
            StopPoint pStopPoint = null;

            pStopPoint = new StopPoint();
            pMGraph.addStopPoint(1, 0, pStopPoint);

            pStopPoint = new StopPoint();
            pMGraph.addStopPoint(1, 1, pStopPoint);

            pStopPoint = new StopPoint();
            pMGraph.addStopPoint(1, 2, pStopPoint);

            List <Vertex> vertList;

            if (pMGraph.isPathCacheValid(0, 8))
            {
                vertList = pMGraph.getShortestPathFromPathCache(0, 8);
            }
            else
            {
                vertList = pMGraph.getOrCreateShortestPath(0, 8);
            }

            return(vertList);
        }
        public async Task <StopPointViewModel> CreateViewModelAsync(StopPoint stopPoint)
        {
            var viewModel = new StopPointViewModel();

            await UpdateViewModelAsync(stopPoint, viewModel);

            return(viewModel);
        }
예제 #3
0
        public bool ShouldStopAtThisLine(string module, ExecutionFrame currentFrame)
        {
            bool mustStop = false;

            switch (_currentState)
            {
            case DebugState.Running:
                mustStop = HitBreakpointOnLine(module, currentFrame);
                break;

            case DebugState.SteppingIn:
                mustStop = true;
                break;

            case DebugState.SteppingOut:
            case DebugState.SteppingOver:
                mustStop = FrameIsInStopList(currentFrame);
                // по пути следования все равно может встретиться breakpoint
                if (!mustStop && HitBreakpointOnLine(module, currentFrame))
                {
                    _currentState = DebugState.Running;     //для правильной причины останова (см. ниже)
                    mustStop      = true;
                }
                break;
            }

            if (mustStop)
            {
                // здесь мы уже останавливались
                if (_lastStopPoint.frame != currentFrame || _lastStopPoint.line != currentFrame.LineNumber)
                {
                    if (_currentState == DebugState.Running)
                    {
                        LastStopReason = MachineStopReason.Breakpoint;
                    }
                    else
                    {
                        LastStopReason = MachineStopReason.Step;
                    }

                    _lastStopPoint = new StopPoint()
                    {
                        frame = currentFrame,
                        line  = currentFrame.LineNumber
                    };
                    _currentState = DebugState.Running;
                }
                else
                {
                    mustStop = false;
                }
            }

            return(mustStop);
        }
        public async Task CreateViewModel()
        {
            var model = new StopPoint
            {
                Name = "A"
            };


            var viewModelFactory = new StopPointViewModelFactory();
            var viewModel        = await viewModelFactory.CreateViewModelAsync(model);

            Assert.Equal(model.Name, viewModel.Name);

            Assert.Empty(viewModel);
        }
예제 #5
0
        /// <summary>
        /// Полное копирование текущего объекта
        /// </summary>
        /// <returns>Полная копия объекта</returns>
        public ScheduleCompleteSegment FullCopy()
        {
            var result = new ScheduleCompleteSegment();

            result.AircraftType        = AircraftType;
            result.ArrivalDaysChange   = ArrivalDaysChange;
            result.ArrivalTime         = ArrivalTime;
            result.ArrivalTimeString   = ArrivalTimeString;
            result.Charterer           = Charterer;
            result.DepartureDaysChange = DepartureDaysChange;
            result.DepartureTime       = DepartureTime;
            result.DepartureTimeString = DepartureTimeString;
            result.EndDate             = EndDate;
            result.ETicket             = ETicket;
            result.FlightNumber        = FlightNumber;
            result.FlightTime          = FlightTime;
            result.ID          = ID;
            result.MarkAirline = MarkAirline;
            result.OpAirline   = OpAirline;
            result.StartDate   = StartDate;

            if (ArrAirp != null)
            {
                result.ArrAirp             = new AirportInformation();
                result.ArrAirp.AirportCode = ArrAirp.AirportCode;
                result.ArrAirp.CityCode    = ArrAirp.CityCode;
                result.ArrAirp.Terminal    = ArrAirp.Terminal;
                result.ArrAirp.UTC         = ArrAirp.UTC;
            }

            if (DepAirp != null)
            {
                result.DepAirp             = new AirportInformation();
                result.DepAirp.AirportCode = DepAirp.AirportCode;
                result.DepAirp.CityCode    = DepAirp.CityCode;
                result.DepAirp.Terminal    = DepAirp.Terminal;
                result.DepAirp.UTC         = DepAirp.UTC;
            }

            if (BaseClasses != null && BaseClasses.Count > 0)
            {
                result.BaseClasses = new List <BaseClass>();
                BaseClasses.ForEach(bc => { result.BaseClasses.Add(bc); });
            }

            if (OperatedDaysOfWeek != null && OperatedDaysOfWeek.Count > 0)
            {
                result.OperatedDaysOfWeek = new DaysOfWeekList();
                OperatedDaysOfWeek.ForEach(dow => { result.OperatedDaysOfWeek.Add(dow); });
            }

            if (StopPoints != null && StopPoints.Count > 0)
            {
                result.StopPoints = new List <StopPoint>();

                foreach (var stopPoint in StopPoints)
                {
                    var point = new StopPoint();

                    point.AirportCode = stopPoint.AirportCode;
                    point.ArrDateTime = stopPoint.ArrDateTime;
                    point.CityCode    = stopPoint.CityCode;
                    point.DepDateTime = stopPoint.DepDateTime;
                    point.Terminal    = stopPoint.Terminal;
                    point.UTC         = stopPoint.UTC;

                    result.StopPoints.Add(point);
                }
            }

            return(result);
        }
        public void SaveStop(StopPoint stopPoint)
        {
            BsonDocument stopData = new BsonDocument
            {
                { "Code", stopPoint.code },
                { "Longitude", stopPoint.longitude },
                { "Latitude", stopPoint.latitude }
            };

            Stops.Save(stopData);
        }
예제 #7
0
 internal void Continue()
 {
     _lastStopPoint = default(StopPoint);
 }
        public Task UpdateViewModelAsync(StopPoint stopPoint, StopPointViewModel stopPointViewModel)
        {
            stopPointViewModel.Name = stopPoint.Name;

            return(Task.CompletedTask);
        }
예제 #9
0
 public BusStopInfo(StopPoint stopPoint)
 {
     Name        = stopPoint.commonName;
     Predictions = tflApi.GetSortedArrivals(stopPoint.id).Take(5);
 }