20 #ifndef VEHICLEPROPERTY_H
21 #define VEHICLEPROPERTY_H
30 #include "abstractpropertytype.h"
31 #include "mappropertytype.hpp"
34 namespace ButtonEvents {
35 enum ButtonEventType {
41 Preset1Button = 1 << 4,
42 Preset2Button = 1 << 5,
43 Preset3Button = 1 << 6,
44 Preset4Button = 1 << 7,
46 NavigateUpButton = 1 << 9,
47 NavigateDownButton = 1 << 10,
48 NavigateLeftButton = 1 << 11,
49 NavigateRightButton = 1 << 12
53 namespace TurnSignals {
63 namespace Transmission {
64 enum TransmissionPositions
101 extern const char* Park;
102 extern const char* Reverse;
103 extern const char* Neutral;
104 extern const char* Low;
105 extern const char* Drive;
106 extern const char* Overdrive;
139 UnknownPosition = -1,
195 extern const char * Closed;
196 extern const char * Open;
197 extern const char * Ajar;
239 enum AirflowDirection
250 extern const char * FloorPanel;
251 extern const char * FloorDuct;
252 extern const char * Bilevel;
253 extern const char * DefrostFloor;
277 namespace Measurement
287 #include <boost/preprocessor/comma.hpp>
289 #define PROPERTYTYPE(property, propertyType, baseClass, valueType) \
290 class propertyType : public baseClass { \
291 public: propertyType(): baseClass(property) {} \
292 propertyType(valueType val) : baseClass(property, val) {} \
293 using baseClass::operator=; \
296 #define PROPERTYTYPE1(property, propertyType, baseClass, valueType) \
297 class propertyType : public baseClass { \
298 public: propertyType(): baseClass(#property) {} \
299 propertyType(valueType val) : baseClass(#property, val) {} \
302 #define PROPERTYTYPEBASIC(property, valueType) \
303 class property ## Type : public BasicPropertyType<valueType> { \
304 public: property ## Type(): BasicPropertyType(property) {} \
305 property ## Type(valueType val) : BasicPropertyType(property, val) {} \
306 using BasicPropertyType<valueType>::operator=; \
309 #define PROPERTYTYPEBASIC1(property, valueType) \
310 class property ## Type : public BasicPropertyType<valueType> { \
311 public: property ## Type(): BasicPropertyType( #property) {} \
312 property ## Type(valueType val) : BasicPropertyType(#property, val) {} \
315 #define PROPERTYTYPENOVAL(property, propertyType, baseClass) \
316 class propertyType : public baseClass { \
317 public: propertyType(): baseClass(property) {} \
323 typedef std::vector<std::string> PropertyList;
324 typedef std::set<std::string> PropertySet;
343 typedef std::string Property;
356 static const Property VehicleSpeed;
375 PROPERTYTYPE(TransmissionShiftPosition, TransmissionShiftPositionType,
376 BasicPropertyType<Transmission::TransmissionPositions>, Transmission::TransmissionPositions )
387 static const Property TransmissionGearPosition;
388 PROPERTYTYPE(TransmissionGearPosition, TransmissionGearPositionType,
389 BasicPropertyType<Transmission::TransmissionPositions>, Transmission::TransmissionPositions)
393 static const Property TransmissionMode;
401 static const Property TransmissionModeW3C;
405 static const Property ThrottlePosition;
414 static const Property WheelBrakePressure;
426 PROPERTYTYPEBASIC(SteeringWheelAngleW3C, int16_t)
430 PROPERTYTYPEBASIC(TurnSignal, TurnSignals::TurnSignalType)
441 static const Property EngineCoolantTemperature;
449 PROPERTYTYPEBASIC(MachineGunTurretStatus,
bool)
464 static const Property MassAirFlow;
483 static const Property BatteryCurrent;
488 PROPERTYTYPEBASIC(BatteryChargeLevel, uint16_t)
491 static const Property InteriorTemperature;
495 static const Property ExteriorTemperature;
504 static const Property EngineOilRemaining;
509 static const Property
VIN;
510 PROPERTYTYPE(VIN, VINType, StringPropertyType, std::
string)
514 static const Property
WMI;
515 PROPERTYTYPE(WMI, WMIType, StringPropertyType, std::
string)
520 PROPERTYTYPEBASIC(TirePressure, uint16_t)
524 PROPERTYTYPEBASIC(TirePressureLow,
bool)
528 PROPERTYTYPEBASIC(TireTemperature, int16_t)
533 static const Property VehiclePowerMode;
537 static const Property TripMeters;
541 static const Property CruiseControlActive;
545 static const Property CruiseControlSpeed;
549 static const Property LightHead;
551 static const Property LightRightTurn;
553 static const Property LightLeftTurn;
555 static const Property LightBrake;
557 static const Property LightFog;
559 static const Property LightHazard;
561 static const Property LightParking;
563 static const Property LightHighBeam;
565 static const Property LightAutomatic;
566 PROPERTYTYPEBASIC(LightAutomatic,
bool)
567 static const Property LightDynamicHighBeam;
568 PROPERTYTYPEBASIC(LightDynamicHighBeam,
bool)
571 static const Property InteriorLightDriver;
573 static const Property InteriorLightCenter;
575 static const Property InteriorLightPassenger;
578 static const Property EngineLoad;
581 static const Property Horn;
584 static const Property FuelLevel;
587 static const Property FuelRange;
590 static const Property FuelConsumption;
593 static const Property FuelEconomy;
596 static const Property FuelAverageEconomy;
599 static const Property FuelAverageConsumption;
600 PROPERTYTYPEBASIC(FuelAverageConsumption, uint)
602 static const Property FuelTimeSinceRestart;
603 PROPERTYTYPEBASIC(FuelTimeSinceRestart, uint)
605 static const Property FuelConsumptionSinceRestart;
606 PROPERTYTYPEBASIC(FuelConsumptionSinceRestart, uint)
608 static const Property FuelType;
611 static const Property FuelPositionSide;
614 static const Property ExteriorBrightness;
617 static const Property Latitude;
620 static const Property Longitude;
623 static const Property Altitude;
626 static const Property Direction;
629 static const Property VehicleWidth;
631 static const Property VehicleHeight;
633 static const Property VehicleLength;
637 static const Property VehicleType;
641 static const Property DoorsPerRow;
645 static const Property TransmissionGearType;
649 static const Property FrontWheelRadius;
651 static const Property RearWheelRadius;
655 static const Property WheelTrack;
659 static const Property BrakePressure;
660 PROPERTYTYPEBASIC(BrakePressure, uint16_t)
665 PROPERTYTYPEBASIC(Odometer, uint)
667 static const Property DistanceTotal;
668 PROPERTYTYPEBASIC(DistanceTotal, uint)
671 PROPERTYTYPEBASIC(DistanceSinceStart, uint)
675 static const Property TransmissionFluidLevel;
676 PROPERTYTYPEBASIC(TransmissionFluidLevel, uint16_t)
682 PROPERTYTYPEBASIC(BrakeFluidLevel, uint16_t)
688 PROPERTYTYPEBASIC(WasherFluidLevel, uint16_t)
696 PROPERTYTYPEBASIC(SecurityAlertStatus, Security::Status)
703 PROPERTYTYPEBASIC(ParkingBrakeStatus,
bool)
710 PROPERTYTYPEBASIC(ParkingLightStatus,
bool)
717 PROPERTYTYPEBASIC(HazardLightStatus,
bool)
720 static const Property AntilockBrakingSystem;
721 PROPERTYTYPEBASIC(AntilockBrakingSystem,
bool)
724 static const Property TractionControlSystem;
725 PROPERTYTYPEBASIC(TractionControlSystem,
bool)
728 static const Property VehicleTopSpeedLimit;
729 PROPERTYTYPEBASIC(VehicleTopSpeedLimit,uint16_t)
732 static const Property AirbagStatus;
733 PROPERTYTYPEBASIC(AirbagStatus, Airbag::Status)
737 PROPERTYTYPEBASIC(DoorStatus, Door::Status)
742 PROPERTYTYPE(DoorStatusW3C, DoorStatusW3CType, StringPropertyType, std::
string)
744 static const Property DoorLockStatus;
745 PROPERTYTYPEBASIC(DoorLockStatus,
bool)
747 static const Property ChildLockStatus;
748 PROPERTYTYPEBASIC(ChildLockStatus,
bool)
750 static const Property SeatBeltStatus;
751 PROPERTYTYPEBASIC(SeatBeltStatus,
bool)
753 static const Property WindowLockStatus;
754 PROPERTYTYPEBASIC(WindowLockStatus,
bool)
756 static const Property OccupantStatus;
757 PROPERTYTYPEBASIC(OccupantStatus, Seat::Occupant)
759 static const Property ObstacleDistance;
760 PROPERTYTYPEBASIC(ObstacleDistance,
double)
762 static const Property RainSensor;
763 PROPERTYTYPEBASIC(RainSensor, uint16_t)
766 static const Property WindshieldWiper;
767 PROPERTYTYPEBASIC(WindshieldWiper,Window::WiperSpeed)
772 PROPERTYTYPEBASIC(AirflowDirection,HVAC::AirflowDirection)
774 static const Property AirflowDirectionW3C;
775 PROPERTYTYPE(AirflowDirectionW3C, AirflowDirectionW3CType, StringPropertyType, std::
string)
777 static const Property FanSpeed;
778 PROPERTYTYPEBASIC(FanSpeed, uint16_t)
780 static const Property TargetTemperature;
781 PROPERTYTYPEBASIC(TargetTemperature,
int)
783 static const Property AirConditioning;
784 PROPERTYTYPEBASIC(AirConditioning,
bool)
786 static const Property AirRecirculation;
787 PROPERTYTYPEBASIC(AirRecirculation,
bool)
789 static const Property Heater;
790 PROPERTYTYPEBASIC(Heater,
bool)
794 PROPERTYTYPEBASIC(Defrost,
bool )
796 static const Property DefrostWindow;
797 PROPERTYTYPEBASIC(DefrostWindow,
bool )
799 static const Property DefrostMirror;
800 PROPERTYTYPEBASIC(DefrostMirror,
bool )
802 static const Property SteeringWheelHeater;
803 PROPERTYTYPEBASIC(SteeringWheelHeater,
bool)
806 static const Property SeatHeater;
807 PROPERTYTYPEBASIC(SeatHeater,
int)
810 static const Property SeatCooler;
811 PROPERTYTYPEBASIC(SeatCooler,
bool)
814 static const Property WindowStatus;
815 PROPERTYTYPEBASIC(WindowStatus, uint16_t)
817 static const Property Sunroof;
818 PROPERTYTYPEBASIC(Sunroof, uint16_t)
821 static const Property SunroofTilt;
822 PROPERTYTYPEBASIC(SunroofTilt,uint16_t)
825 static const Property ConvertibleRoof;
826 PROPERTYTYPEBASIC(ConvertibleRoof,
bool)
829 static const Property NightMode;
830 PROPERTYTYPEBASIC(NightMode,
bool)
832 static const Property DrivingMode;
833 PROPERTYTYPEBASIC(DrivingMode, Driving::Mode)
835 static const Property DrivingModeW3C;
836 PROPERTYTYPEBASIC(DrivingModeW3C,
bool)
838 static const Property KeyId;
839 PROPERTYTYPE(KeyId, KeyIdType, StringPropertyType, std::
string)
841 static const Property Language;
842 PROPERTYTYPE(Language, LanguageType, StringPropertyType, std::
string)
844 static const Property MeasurementSystem;
845 PROPERTYTYPEBASIC(MeasurementSystem, Measurement::Type)
847 static const Property MirrorSettingPan;
848 static const Property MirrorSettingTilt;
850 PROPERTYTYPEBASIC(MirrorSettingPan, uint16_t)
851 PROPERTYTYPEBASIC(MirrorSettingTilt, uint16_t)
853 static const Property SteeringWheelPositionSlide;
854 static const Property SteeringWheelPositionTilt;
856 PROPERTYTYPEBASIC(SteeringWheelPositionSlide, uint16_t)
857 PROPERTYTYPEBASIC(SteeringWheelPositionTilt, uint16_t)
859 static const Property SeatPositionRecline;
860 static const Property SeatPositionSlide;
861 static const Property SeatPositionCushionHeight;
862 static const Property SeatPositionHeadrest;
863 static const Property SeatPositionBackCushion;
864 static const Property SeatPositionSideCushion;
866 PROPERTYTYPEBASIC(SeatPositionRecline, uint16_t)
867 PROPERTYTYPEBASIC(SeatPositionSlide, uint16_t)
868 PROPERTYTYPEBASIC(SeatPositionCushionHeight, uint16_t)
869 PROPERTYTYPEBASIC(SeatPositionHeadrest, uint16_t)
870 PROPERTYTYPEBASIC(SeatPositionBackCushion, uint16_t)
871 PROPERTYTYPEBASIC(SeatPositionSideCushion, uint16_t)
873 static const Property DashboardIllumination;
874 PROPERTYTYPEBASIC(DashboardIllumination, uint16_t)
876 static const Property GeneratedVehicleSoundMode;
877 PROPERTYTYPEBASIC(GeneratedVehicleSoundMode, Vehicle::SoundMode)
879 static const Property DriverId;
880 PROPERTYTYPE(DriverId, DriverIdType, StringPropertyType, std::
string)
931 static VehicleProperty* thereCanOnlyBeOne;
936 static PropertyList mCapabilities;
937 static PropertyList mCustomProperties;
940 #endif // VEHICLEPROPERTY_H
static const Property WheelBrake
Definition: vehicleproperty.h:410
static const Property AccelerationY
Definition: vehicleproperty.h:456
static const Property NoValue
Various property types:
Definition: vehicleproperty.h:353
static const Property ParkingLightStatus
Definition: vehicleproperty.h:709
static const Property TurnSignal
Definition: vehicleproperty.h:429
Definition: abstractpropertytype.h:69
static const Property WMI
Definition: vehicleproperty.h:514
static const Property DoorStatus
TODO: deprecate in 0.13. Use DoorStatusW3C.
Definition: vehicleproperty.h:736
static const Property AccelerationX
Definition: vehicleproperty.h:452
Definition: abstractpropertytype.h:662
static const Property TireTemperature
Definition: vehicleproperty.h:527
static const Property EngineOilTemperature
Definition: vehicleproperty.h:500
static const Property Defrost
TODO: deprecated. remove in 0.13.
Definition: vehicleproperty.h:793
static const Property ButtonEvent
Definition: vehicleproperty.h:469
static const Property BatteryVoltage
Definition: vehicleproperty.h:479
static const Property HazardLightStatus
Definition: vehicleproperty.h:716
Definition: vehicleproperty.h:326
static const Property AccelerationZ
Definition: vehicleproperty.h:460
std::function< AbstractPropertyType *(void)> PropertyTypeFactoryCallback
PropertyTypeFactoryCallback callback used to construct a AbstractPropertyType for a property...
Definition: vehicleproperty.h:349
static const Property SecurityAlertStatus
Definition: vehicleproperty.h:695
PROPERTYTYPE(TransmissionShiftPosition, TransmissionShiftPositionType, BasicPropertyType< Transmission::TransmissionPositions >, Transmission::TransmissionPositions) static const Property TransmissionGearPosition
static const Property EngineCoolantLevel
Definition: vehicleproperty.h:444
static const Property AirIntakeTemperature
Definition: vehicleproperty.h:474
static const Property TirePressureLow
Definition: vehicleproperty.h:523
static const Property BatteryChargeLevel
Definition: vehicleproperty.h:487
static PropertyList customProperties()
customProperties
Definition: vehicleproperty.cpp:376
static const Property ParkingBrakeStatus
Definition: vehicleproperty.h:702
static const Property VIN
Definition: vehicleproperty.h:509
static void shutdown()
destroys static instance of VehicleProperty. This should be called at application shutdown ...
Definition: vehicleproperty.cpp:360
static void factory()
factory constructs a static instance of VehicleProperty. This should be called once before VehiclePro...
Definition: vehicleproperty.cpp:354
static const Property MachineGunTurretStatus
Definition: vehicleproperty.h:448
static const Property Odometer
TODO: deprecated. remove in 0.13. Use DistanceTotal.
Definition: vehicleproperty.h:664
static const Property SteeringWheelAngleW3C
TODO: Rename to "SteeringWheel" in 0.13.
Definition: vehicleproperty.h:425
Definition: abstractpropertytype.h:395
static const Property EngineSpeed
Definition: vehicleproperty.h:361
static const Property DoorStatusW3C
Definition: vehicleproperty.h:741
static const Property EngineOilPressure
Definition: vehicleproperty.h:437
static const Property SteeringWheelAngle
Definition: vehicleproperty.h:421
Definition: abstractpropertytype.h:588
static AbstractPropertyType * getPropertyTypeForPropertyNameValue(Property name, std::string value="")
getPropertyTypeForPropertyNameValue returns an AbstractPropertyType* for the property name with the v...
Definition: vehicleproperty.cpp:381
static const Property DistanceSinceStart
Definition: vehicleproperty.h:670
static const Property BrakeFluidLevel
Definition: vehicleproperty.h:681
static const Property TirePressure
Definition: vehicleproperty.h:519
static const Property ClutchStatus
Definition: vehicleproperty.h:433
static const Property AirflowDirection
TODO: Deprecated. Remove in 0.13.
Definition: vehicleproperty.h:771
static PropertyList capabilities()
capabilities
Definition: vehicleproperty.cpp:371
static const Property TransmissionShiftPosition
Definition: vehicleproperty.h:374
static const Property WasherFluidLevel
Definition: vehicleproperty.h:687