Beispiel #1
0
        private async Task <ChargerWindow> GetChargerWindow(LedManager ledManager, string carNumber, FareRule fareRule, InOutTypeEnum inOutType,
                                                            IRepository <CarTypes, long> repositoryCarTypes,
                                                            IParkBoxOptions parkBoxOptions,
                                                            IRepository <CarPort, long> repositoryCarPort,
                                                            IVehicleFlow vehicleFlow,
                                                            IDeviceable deviceable,
                                                            IRepository <FareRule> repositoryFareRule,
                                                            IRepository <RangeTime> repositoryRangeTime,
                                                            ManualResetEvent manualResetEvent)
        {
            ChargerWindow chargerWindow = null;
            await Application.Current.Dispatcher.BeginInvoke((Action)(() =>
            {
                chargerWindow = new ChargerWindow(ledManager, carNumber, fareRule, inOutType, repositoryCarTypes, parkBoxOptions, repositoryCarPort, vehicleFlow, deviceable, repositoryFareRule, repositoryRangeTime, manualResetEvent);
            }));

            return(chargerWindow);
        }
Beispiel #2
0
        public ChargerWindow(LedManager ledManager, string carNumber, FareRule fareRule, InOutTypeEnum inOutType,
                             IRepository <CarTypes, long> repositoryCarTypes,
                             IParkBoxOptions parkBoxOptions,
                             IRepository <CarPort, long> repositoryCarPort,
                             IVehicleFlow vehicleFlow,
                             IDeviceable deviceable,
                             IRepository <FareRule> repositoryFareRule,
                             IRepository <RangeTime> repositoryRangeTime,
                             ManualResetEvent manualResetEvent) : this(ledManager, fareRule, repositoryCarTypes, parkBoxOptions, repositoryCarPort, vehicleFlow, deviceable, repositoryFareRule, repositoryRangeTime, manualResetEvent)
        {
            var inTime = DateTime.Now;
            var list   = _vehicleFlow.LevenshteinDistance(parkBoxOptions.ParkId, carNumber);

            chargerViewModel.InTime    = chargerViewModel.OutTime = inTime;
            chargerViewModel.CarNumber = carNumber;
            CarOutModel = new CarOutModel()
            {
                CarInRecord = new CarInRecord()
                {
                    CarNumber = carNumber, InTime = inTime, ParkId = deviceable.EntranceDto.ParkLevel.Park.Id
                }, OutTime = inTime, ParkId = deviceable.EntranceDto.ParkLevel.Park.Id
            };
            AddMenu(list);
            txt_CarType.Text = "无在场记录,请匹配场内车辆";
        }