예제 #1
0
        public VmTruck CreateTruckForScheduledArrival(JwTimestamp expectedArrivalLocalTs)
        {
            JwTimestamp expectedDepartureLocalTs = ComputeScheduledDepartureLocalTimestampFromScheduledArrival(expectedArrivalLocalTs);

            VmTruck truck = new VmTruck();
            truck.ExpectedDepartureLocalTs = expectedDepartureLocalTs;
            truck.CarrierCode = CarrierCode;
            truck.Number = FlightNumber;
            truck.OriginAirportCode = OriginAirportCode;
            truck.DestinationAirportCode = DestinationAirportCode;

            return truck;
        }
예제 #2
0
        public void HandleIdentifyTruck(VmScheduledTruck scheduledTruck, JwDate scheduledArrivalDate)
        {
            JwTimestamp expectedArrivalTs = scheduledTruck.GetScheduledArrivalTimestampForScheduledArrivalDate(scheduledArrivalDate);
            VmTruck truck = scheduledTruck.CreateTruckForScheduledArrival(expectedArrivalTs);

            truck.ActualDepartureLocalTs = truck.ExpectedDepartureLocalTs.GetTimestampCopy();
            truck.ActualArrivalLocalTs =  expectedArrivalTs.GetTimestampCopy();

            Truck = truck;

            JwTimestamp nowLocalTs = JwTimestamp.CreateNowLocal();

            if( nowLocalTs.IsBefore(truck.ActualArrivalLocalTs) )
            {

                truck.ActualArrivalLocalTs = nowLocalTs;
                //err - removed at request of AA, the only user of this feature.  Waiting for beta testing
                //completion (and acceptance) to remove the following line.
            //                truck.ActualDepartureLocalTs = scheduledTruck.InferActualDepartureFromActualArrival(nowLocalTs);

                JwDuration tooEarlyThreshold = nowLocalTs.Difference(expectedArrivalTs);
                if( tooEarlyThreshold.GetTotalMinutes() > VmProperties.Default.GetEarlyTruckAllowanceMinutes() )
                {
                    ShowWarnOfEarlyArrivalPanel();
                    return;
                }
            }

            ShowActualsPanel();
        }