{
public:
- ExampleSourcePlugin();
- string uuid();
- void setProperty(VehicleProperty::Property, boost::any);
+ ExampleSourcePlugin(): AbstractSource(nullptr, map<string, string>()) {}
+ ExampleSourcePlugin(AbstractRoutingEngine* re, map<string, string> config);
+
+ const string uuid();
+ void getPropertyAsync(AsyncPropertyReply *reply);
+ void getRangePropertyAsync(AsyncRangePropertyReply *reply);
+ AsyncPropertyReply * setProperty(AsyncSetPropertyRequest request);
void subscribeToPropertyChanges(VehicleProperty::Property property);
void unsubscribeToPropertyChanges(VehicleProperty::Property property);
PropertyList supported();
+
+ int supportedOperations();
+
+ void supportedChanged(const PropertyList &) {}
+
+ void randomizeProperties();
+
+ PropertyInfo getPropertyInfo(const VehicleProperty::Property & property)
+ {
+ if(propertyInfoMap.find(property) != propertyInfoMap.end())
+ return propertyInfoMap[property];
+
+ return PropertyInfo::invalid();
+ }
private:
+
+ void addPropertySupport(VehicleProperty::Property property, Zone::Type zone);
+
+ std::map<VehicleProperty::Property, PropertyInfo> propertyInfoMap;
+ std::map<Zone::Type, Airbag::Status> airbagStatus;
+ std::map<Zone::Type, bool> acStatus;
PropertyList mRequests;
+ PropertyList mSupported;
+ uint16_t velocity;
+ uint16_t engineSpeed;
+
+ VehicleProperty::VehicleSpeedType vel;
+ VehicleProperty::EngineSpeedType es;
+ VehicleProperty::AccelerationXType ac;
+ VehicleProperty::SteeringWheelAngleType swa;
+ VehicleProperty::TransmissionShiftPositionType tsp;
+ VehicleProperty::TransmissionGearPositionType tgp;
+ VehicleProperty::ThrottlePositionType tp;
+ VehicleProperty::EngineCoolantTemperatureType ec;
+ VehicleProperty::MachineGunTurretStatusType mgt;
};
#endif // EXAMPLEPLUGIN_H