Ejemplo n.º 1
0
        private void onSearchSubmit(Base sender, EventArgs arguments)
        {
            String tag = text_manual_name.Text.ToUpper();

            if (String.IsNullOrWhiteSpace(tag))
            {
                return;
            }
            var vehicle = ComputerVehicleController.LookupVehicle(tag);


            if (vehicle != null && vehicle.Validate())
            {
                text_manual_name.ClearError();
                list_manual_results.AddVehicle(vehicle);
                ComputerVehicleController.LastSelected = vehicle;
                this.ShowDetailsView();
            }
            else if (vehicle != null)
            {
                text_manual_name.Error("The vehicle no longer exists");
            }
            else
            {
                text_manual_name.Error("No vehicles found");
            }
        }
        public override void InitializeLayout()
        {
            base.InitializeLayout();
            this.Position = this.GetLaunchPosition();
            this.Window.DisableResizing();
            Function.LogDebug("Populating ALPR list");
            AlprDetectedVehicles.Clear();
            PopulateAnprList();
            list_collected_tags.AllowMultiSelect = false;
            list_manual_results.AllowMultiSelect = false;
            list_collected_tags.RowSelected     += onListItemSelected;
            list_manual_results.RowSelected     += onListItemSelected;
            text_manual_name.SubmitPressed      += onSearchSubmit;
            Function.LogDebug("Checking currently pulled over");
            var currentPullover = ComputerVehicleController.CurrentlyPulledOver;

            if (currentPullover != null && AlprDetectedVehicles.Find(x => x.Vehicle == currentPullover.Vehicle) == null)
            {
                AlprDetectedVehicles.Add(currentPullover);
            }
            foreach (var vehicle in AlprDetectedVehicles)
            {
                list_collected_tags.AddVehicle(vehicle);
                ComputerReportsController.generateRandomHistory(vehicle);
            }
        }
Ejemplo n.º 3
0
        public override void InitializeLayout()
        {
            base.InitializeLayout();
            this.Position = this.GetLaunchPosition();
            this.Window.DisableResizing();
            Function.LogDebug("Populating ALPR list");
            PopulateAnprList();
            list_collected_tags.AllowMultiSelect = false;
            list_manual_results.AllowMultiSelect = false;
            list_collected_tags.RowSelected     += onListItemSelected;
            list_manual_results.RowSelected     += onListItemSelected;
            text_manual_name.SubmitPressed      += onSearchSubmit;
            Function.LogDebug("Checking currently pulled over");
            var currentPullover = ComputerVehicleController.CurrentlyPulledOver;

            if (currentPullover != null)
            {
                list_collected_tags.AddVehicle(currentPullover);
            }
        }