コード例 #1
0
ファイル: CommonSensors.cs プロジェクト: cail/hobd
        public void Activate(SensorRegistry registry)
        {
            CoreSensor s;

            // CommonDistanceRun
            s = new hobd.DistanceSensor()
            {
                ID = "Common.DistanceRun",
                Name = "DistanceRun",

            };

            s.Units = "km";

            registry.Add(s);

            // CommonAcceleration
            s = new hobd.GSensor()
            {
                ID = "Common.Acceleration",
                Name = "Acceleration",

            };

            s.Units = "m/s^2";

            registry.Add(s);

            // CommonFuelConsumed
            s = new hobd.FuelConsumedSensor()
            {
                ID = "Common.FuelConsumed",
                Name = "FuelConsumed",

            };

            s.Units = "liters";

            registry.Add(s);

            // CommonFuelEconomy_trip
            s = new hobd.FuelEconomyTripSensor()
            {
                ID = "Common.FuelEconomy_trip",
                Name = "FuelEconomy_trip",

            };

            s.Units = "lph";

            registry.Add(s);

            // CommonTripTime
            s = new hobd.TripTime()
            {
                ID = "Common.TripTime",
                Name = "TripTime",

            };

            s.Units = "seconds";

            registry.Add(s);

            // CommonIdleTime
            s = new hobd.IdleTime()
            {
                ID = "Common.IdleTime",
                Name = "IdleTime",

            };

            s.Units = "seconds";

            registry.Add(s);

            // CommonSpeed
            s = new hobd.SpeedCorrectionSensor()
            {
                ID = "Common.Speed",
                Name = "Speed",

            };

            registry.Add(s);
        }
コード例 #2
0
        public void Activate(SensorRegistry registry)
        {
            CoreSensor s;

            // CommonDistanceRun
            s = new hobd.DistanceSensor()
            {
                ID   = "Common.DistanceRun",
                Name = "DistanceRun",
            };

            s.Units = "km";

            registry.Add(s);

            // CommonAcceleration
            s = new hobd.GSensor()
            {
                ID   = "Common.Acceleration",
                Name = "Acceleration",
            };

            s.Units = "m/s^2";

            registry.Add(s);

            // CommonFuelConsumed
            s = new hobd.FuelConsumedSensor()
            {
                ID   = "Common.FuelConsumed",
                Name = "FuelConsumed",
            };

            s.Units = "liters";

            registry.Add(s);

            // CommonFuelEconomy_trip
            s = new hobd.FuelEconomyTripSensor()
            {
                ID   = "Common.FuelEconomy_trip",
                Name = "FuelEconomy_trip",
            };

            s.Units = "lph";

            registry.Add(s);

            // CommonTripTime
            s = new hobd.TripTime()
            {
                ID   = "Common.TripTime",
                Name = "TripTime",
            };

            s.Units = "seconds";

            registry.Add(s);

            // CommonIdleTime
            s = new hobd.IdleTime()
            {
                ID   = "Common.IdleTime",
                Name = "IdleTime",
            };

            s.Units = "seconds";

            registry.Add(s);

            // CommonSpeed
            s = new hobd.SpeedCorrectionSensor()
            {
                ID   = "Common.Speed",
                Name = "Speed",
            };

            registry.Add(s);
        }