RegisterProvider() public method

public RegisterProvider ( SensorProvider provider ) : void
provider SensorProvider
return void
示例#1
0
        public static void ReloadVehicle()
        {
            var vehicle = config.GetVehicle(config.Vehicle);

            if (vehicle == null)
            {
                Logger.error("HOBD", "Bad configuration: can't find vehicle " + config.Vehicle);
                vehicle = ConfigVehicleData.defaultVehicle;
            }

            Registry = new SensorRegistry();
            Registry.VehicleParameters = vehicle.Parameters;

            vehicle.Sensors.ForEach((provider) =>
            {
                Logger.trace("HOBD", "RegisterProvider: " + provider);
                try{
                    Registry.RegisterProvider(provider);
                }catch (Exception e) {
                    Logger.error("HOBD", "bad provider", e);
                }
            });

            EngineConnect();
        }
示例#2
0
        public static void ReloadVehicle()
        {
            var vehicle = config.GetVehicle(config.Vehicle);

            if (vehicle == null){
                Logger.error("HOBD", "Bad configuration: can't find vehicle " + config.Vehicle);
                vehicle = ConfigVehicleData.defaultVehicle;
            }

            Registry = new SensorRegistry();
            Registry.VehicleParameters = vehicle.Parameters;

            vehicle.Sensors.ForEach((provider) =>
                    {
                        Logger.trace("HOBD", "RegisterProvider: "+ provider);
                        try{
                            Registry.RegisterProvider(provider);
                        }catch(Exception e){
                            Logger.error("HOBD", "bad provider", e);
                        }
                    });

            EngineConnect();
        }