Exemplo 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");
            }
        }
Exemplo n.º 2
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);
            });
        }
Exemplo n.º 3
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());
            }
        }
Exemplo n.º 4
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);
        }