Beispiel #1
0
        private void PopulateAnprList()
        {
            ComputerVehicleController.ALPR_Detected
            //.GroupBy(x => x.Vehicle)
            //.Select(x => x.Last())
            .Where(x => x.Vehicle.Exists())
            .Select(x =>
            {
                var data = ComputerVehicleController.LookupVehicle(x.Vehicle);

                if (data == null)
                {
                    Function.Log("ALPR integration issue.. data missing from LookupVehicle");
                    return(null);
                }
                VehiclePersona vehiclePersona = data.VehiclePersona;
                if (!String.IsNullOrWhiteSpace(x.Message))
                {
                    vehiclePersona.Alert = x.Message;
                    data.VehiclePersona  = vehiclePersona;
                }

                return(data);
            })
            //.Where(x => x != null && x.Validate())
            .ToList()
            .ForEach(x =>
            {
                list_collected_tags.AddVehicle(x);
            });
        }
Beispiel #2
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");
            }
        }
Beispiel #3
0
 private void ActionSelected(Base sender, ItemSelectedEventArgs arguments)
 {
     if (arguments.SelectedItem == null || arguments.SelectedItem.Name.Equals("Placeholder"))
     {
         return;
     }
     switch (arguments.SelectedItem.Name)
     {
     case "Blip":
         Function.LogDebug("ActionSelected Blip Vehicle");
         ComputerVehicleController.BlipVehicle(Vehicle, System.Drawing.Color.Yellow);
         break;
     }
 }
        private void OnQuickAction(object sender, QuickActions action)
        {
            switch (action)
            {
            case QuickActions.BLIP_VEHICLE:
                Function.LogDebug("ActionSelected Blip Vehicle");
                ComputerVehicleController.BlipVehicle(Vehicle, System.Drawing.Color.Yellow);
                break;

            case QuickActions.CREATE_TRAFFIC_CITATION:
                ComputerReportsController.ShowTrafficCitationCreate(null, DetailedEntity.Entity);
                break;

            case QuickActions.CREATE_ARREST_REPORT_FOR_DRIVER:
                ComputerReportsController.ShowArrestReportCreate(DetailedEntity.Entity, null);
                break;
            }
        }
Beispiel #5
0
        private void PopulateAnprList()
        {
            try {
                ComputerVehicleController.ALPR_Detected
                //.GroupBy(x => x.Vehicle)
                //.Select(x => x.Last())
                .Where(x => x.Vehicle)
                .GroupBy(x => x.Vehicle.LicensePlate)
                .Select(x => x.FirstOrDefault())
                .Select(x =>
                {
                    var data = ComputerVehicleController.LookupVehicle(x.Vehicle);

                    if (data == null)
                    {
                        Function.Log("ALPR integration issue.. data missing from LookupVehicle");
                        return(null);
                    }
                    if (!String.IsNullOrWhiteSpace(x.Message))
                    {
                        //@TODO may have to come back to this
                        //vehiclePersona.Alert = x.Message;
                        //  data.VehiclePersona = vehiclePersona;
                    }

                    return(data);
                })
                //.Where(x => x != null && x.Validate())
                .ToList()
                .ForEach(x =>
                {
                    list_collected_tags.AddVehicle(x);
                });
            }
            catch (Exception e)
            {
                Function.Log(e.ToString());
            }
        }
        private void VehicleViewQuickActionSelected(object sender, ComputerVehicleDetails.QuickActions action)
        {
            switch (action)
            {
            case ComputerVehicleDetails.QuickActions.BLIP_VEHICLE:
            {
                ComputerVehicleController.BlipVehicle(DetailedEntity.Entity.Vehicle, System.Drawing.Color.Yellow);
                return;
            }

            case ComputerVehicleDetails.QuickActions.CREATE_TRAFFIC_CITATION:
            {
                ComputerReportsController.ShowTrafficCitationCreate(Globals.PendingTrafficCitation, DetailedEntity.Entity, PedCreateTrafficCitationActions);
                return;
            }

            case ComputerVehicleDetails.QuickActions.CREATE_ARREST_REPORT_FOR_DRIVER:
            {
                ComputerReportsController.ShowArrestReportCreate(DetailedEntity.Entity, PedCreateArrestReportActions);
                return;
            }
            }
        }
Beispiel #7
0
        private void OnAlprVanillaMessage(object sender, ALPR_Arguments e)
        {
            if (e.Vehicle == null || !e.Vehicle.Exists())
            {
                return;
            }
            var data = ComputerVehicleController.LookupVehicle(e.Vehicle);

            if (data == null)
            {
                return;
            }

            if (!data.IsPersistent)
            {
                data.IsPersistent = true;
            }

            var vehiclePersona = data.VehiclePersona;

            vehiclePersona.Alert = e.Message;
            data.VehiclePersona  = vehiclePersona;
            if (list_collected_tags.RowCount >= 6)
            {
                var entry = list_collected_tags[0];
                var first = entry.UserData as ComputerPlusEntity;
                if (first != null && first.Validate() && first.IsPersistent)
                {
                    first.IsPersistent = false;
                }
                while (list_collected_tags.RowCount >= 6)
                {
                    list_collected_tags.RemoveRow(0);
                }
            }
            list_collected_tags.AddVehicle(data);
        }
Beispiel #8
0
 private void ShowDetailsView()
 {
     ComputerVehicleController.ShowVehicleDetails();
     this.Close();
 }