if( (isFiltered != filteredSourceSinkMap.end() && filteredSourceSinkMap[sink][property] == uuid) || isFiltered == filteredSourceSinkMap.end())
{
/// FIXME: Set this here just in case a source neglects to:
- value->sourceUuid = uuid;
+
+ if(value->sourceUuid != uuid)
+ {
+ DebugOut(DebugOut::Warning)<<"Source not setting uuid for property "<<value->name<<endl;
+ value->sourceUuid = uuid;
+ }
sink->propertyChanged(property, value, uuid);
}
properties[property->name()] = property;
- if(!ListPlusPlus<string>(&mimplementedProperties).contains(property->name()))
+ if(!ListPlusPlus<string>(&mimplementedProperties).contains(property->ambPropertyName()))
{
- mimplementedProperties.push_back(property->name());
+ std::string pname = property->ambPropertyName();
+ mimplementedProperties.push_back(pname);
}
}
#include "debugout.h"
#include "abstractpropertytype.h"
#include "abstractroutingengine.h"
+#include "vehicleproperty.h"
class AbstractDBusInterface;
return mPropertyName;
}
+ virtual VehicleProperty::Property ambPropertyName()
+ {
+ return mAmbPropertyName;
+ }
+
virtual Access access()
{
return mAccess;
boost::any mAnyValue;
string mPropertyName;
+ VehicleProperty::Property mAmbPropertyName;
string mSignature;
SetterFunc mSetterFunc;
Access mAccess;
std::string signature = g_variant_get_type_string(temp->toVariant());
- propertyDBusMap[prop] = new VariantType(re, signature, prop, VariantType::ReadWrite, this);
+ propertyDBusMap[prop] = new VariantType(re, signature, prop, prop, VariantType::ReadWrite, this);
delete temp;
}
- supportedChanged(re->supported());
+
}
boost::algorithm::erase_all(objectPath, "-");
- if(!zones.size())
- {
-
- T* t = new T(re, connection);
-
- objectPath += "/" + t->objectName();
- t->setObjectPath(objectPath);
- t->setSourceFilter(source);
- t->unregisterObject();
- t->supportedChanged(re->supported());
- }
-
for(auto zoneItr = zones.begin(); zoneItr != zones.end(); zoneItr++)
{
Zone::Type zone = (*zoneItr).first;
boost::algorithm::erase_all(objectPath, "-");
- if(!zones.size())
- {
-
- T* t = new T(prop, re, connection);
-
- objectPath += "/" + t->objectName();
- t->setObjectPath(objectPath);
- t->setSourceFilter(source);
- t->unregisterObject();
- t->supportedChanged(re->supported());
- }
-
for(auto zoneItr = zones.begin(); zoneItr != zones.end(); zoneItr++)
{
Zone::Type zone = (*zoneItr).first;
/// Create objects for unimplemented properties:
PropertyList capabilitiesList = VehicleProperty::capabilities();
+ PropertyList implemented = AbstractDBusInterface::implementedProperties();
for (auto itr = capabilitiesList.begin(); itr != capabilitiesList.end(); itr++)
{
VehicleProperty::Property prop = *itr;
- PropertyList implemented = AbstractDBusInterface::implementedProperties();
-
if(!ListPlusPlus<VehicleProperty::Property>(&implemented).contains(prop))
{
exportProperty<UncategorizedPropertyInterface>(prop, iface->re, connection);
template <typename T>
void wantProperty(VehicleProperty::Property property, std::string propertyName, std::string signature, AbstractProperty::Access access)
{
- propertyDBusMap[property] = new VariantType(routingEngine, signature, property, access, this);
+ propertyDBusMap[property] = new VariantType(routingEngine, signature, property, propertyName, access, this);
}
void wantPropertyString(VehicleProperty::Property property, std::string propertyName, std::string signature, AbstractProperty::Access access)
{
- propertyDBusMap[property] = new VariantType(routingEngine, signature, property, access, this);
+ propertyDBusMap[property] = new VariantType(routingEngine, signature, property, propertyName, access, this);
}
void wantPropertyVariant(VehicleProperty::Property property, std::string propertyName, std::string signature, AbstractProperty::Access access)
{
- propertyDBusMap[property] = new VariantType(routingEngine, signature, property, access, this);
+ propertyDBusMap[property] = new VariantType(routingEngine, signature, property, propertyName, access, this);
}
PropertyDBusMap propertyDBusMap;
wantPropertyVariant(VehicleProperty::AntilockBrakingSystem, "AntilockBrakingSystem", "b", AbstractProperty::Read);
- supportedChanged(re->supported());
+
}
};
wantPropertyVariant(VehicleProperty::TractionControlSystem, "TractionControlSystem", "b", AbstractProperty::Read);
- supportedChanged(re->supported());
+
}
};
wantPropertyVariant(VehicleProperty::VehicleTopSpeedLimit, "VehicleTopSpeedLimit", "q", AbstractProperty::Read);
- supportedChanged(re->supported());
+
}
};
wantPropertyVariant(VehicleProperty::AirbagStatus, "AirbagStatus", "y", AbstractProperty::Read);
- //supportedChanged(re->supported());
+ //
}
};
**/
wantPropertyVariant(VehicleProperty::DoorLockStatus, "ChildLockStatus", "b", AbstractProperty::Read);
- supportedChanged(re->supported());
+
}
};
wantPropertyVariant(VehicleProperty::SeatBeltStatus, "SeatBeltStatus", "a(yb)", AbstractProperty::Read);
- supportedChanged(re->supported());
+
}
};
wantPropertyVariant(VehicleProperty::OccupantStatus, "OccupantStatus", "a(yy)", AbstractProperty::Read);
- supportedChanged(re->supported());
+
}
};
wantPropertyVariant(VehicleProperty::ObstacleDistance, "ObstacleDistance", "a{yd}", AbstractProperty::Read);
- supportedChanged(re->supported());
+
}
};
* @attributeComment \brief Must return the brightness outside the vehicle in lux.
*/
wantPropertyVariant(VehicleProperty::ExteriorBrightness,"ExteriorBrightness", "q", AbstractProperty::Read);
- supportedChanged(re->supported());
+
}
};
*/
wantPropertyVariant(VehicleProperty::ExteriorTemperature, "Exterior", "i", AbstractProperty::Read);
- supportedChanged(re->supported());
+
}
};
* @attributeComment \brief Must return level of rain intensity 0: No Rain - 10: Heaviest Rain.
*/
wantPropertyVariant(VehicleProperty::RainSensor, "RainSensor", "q", AbstractProperty::Read);
- supportedChanged(re->supported());
+
}
};
* @attributeComment \brief Must return Level of windshield whiper speed (see WIPERSPEED_)
*/
wantPropertyVariant(VehicleProperty::RainSensor, "WindshieldWiper", "y", AbstractProperty::ReadWrite);
- supportedChanged(re->supported());
+
}
};
*/
wantPropertyVariant(VehicleProperty::SeatCooler, "SeatCooler", "b", AbstractProperty::ReadWrite);
- supportedChanged(re->supported());
+
}
};
**/
wantProperty<uint>(VehicleProperty::Odometer, "Odometer", "i", AbstractProperty::Read);
- supportedChanged(re->supported());
+
}
};
* @attributeComment \brief MUST return battery current in Amperes
**/
wantProperty<double>(VehicleProperty::BatteryCurrent, "Current", "d", AbstractProperty::Read);
- supportedChanged(re->supported());
+
}
};
* @attributeComment \brief MUST return right rear tire pressure in kPa.
**/
wantProperty<double>(VehicleProperty::TirePressureRightRear, "RightRear", "d", AbstractProperty::Read);
- supportedChanged(re->supported());
+
}
};
* @attributeComment \brief MUST return right rear tire temperature in Celcius.
**/
wantProperty<double>(VehicleProperty::TireTemperatureRightRear, "RightRear", "d", AbstractProperty::Read);
- supportedChanged(re->supported());
+
}
};
**/
wantProperty<Security::Status>(VehicleProperty::SecurityAlertStatus,"SecurityAlert", "i", AbstractProperty::Read);
- supportedChanged(re->supported());
+
}
};
**/
wantProperty<bool>(VehicleProperty::ParkingBrakeStatus,"ParkingBrake", "b", AbstractProperty::Read);
- supportedChanged(re->supported());
+
}
};
**/
wantProperty<bool>(VehicleProperty::ParkingLightStatus,"ParkingLight", "b", AbstractProperty::Read);
- supportedChanged(re->supported());
+
}
};
**/
wantProperty<bool>(VehicleProperty::HazardLightStatus,"HazardLight", "b", AbstractProperty::Read);
- supportedChanged(re->supported());
+
}
};
* @attributeComment \brief Must return Vehicle Speed in kilometers per hour.
**/
wantPropertyVariant(VehicleProperty::VehicleSpeed,"VehicleSpeed", "i", AbstractProperty::Read);
- supportedChanged(re->supported());
+
}
* @attributeComment \brief Must return Engine Speed in rotations per minute.
**/
wantPropertyVariant(VehicleProperty::EngineSpeed,"EngineSpeed", "i", AbstractProperty::Read);
- supportedChanged(re->supported());
+
}
* @attributeComment \brief Must return Vehicle Power mode (see VEHICLEPOWERMODE)
**/
wantPropertyVariant(VehicleProperty::VehiclePowerMode, "VehiclePowerMode","b",AbstractProperty::Read);
- supportedChanged(re->supported());
+
}
};
**/
wantPropertyVariant(VehicleProperty::TripMeters, "TripMeters", "aq", AbstractProperty::ReadWrite);
- supportedChanged(re->supported());
+
}
};
* @attributeComment \brief Must return acceleration on the "Z" axis as 1/1000 G (gravitational force).
**/
wantPropertyVariant(VehicleProperty::AccelerationZ, "Z", "q", AbstractProperty::Read);
- supportedChanged(re->supported());
+
}
};
wantPropertyVariant(VehicleProperty::TransmissionMode,
"Mode", "y", AbstractProperty::Read);
- supportedChanged(re->supported());
+
}
};
* @attributeComment \brief Must return target Cruise Control speed in kilometers per hour (kph).
**/
wantPropertyVariant(VehicleProperty::CruiseControlSpeed, "Speed", "q", AbstractProperty::Read);
- supportedChanged(re->supported());
+
}
};
* @attributeComment \brief Must return Wheel Brake status: Engaged = true, disengaged = false
**/
wantPropertyVariant(VehicleProperty::WheelBrake, "Engaged", "b", AbstractProperty::Read);
- supportedChanged(re->supported());
+
}
};
* @attributeComment \brief Must return high beam status: on = true, off = false.
**/
wantPropertyVariant(VehicleProperty::LightHighBeam, "HighBeam", "b", AbstractProperty::Read);
- supportedChanged(re->supported());
+
}
};
* @attributeComment \brief Must return center interior light status: on = true, off = false
**/
wantPropertyVariant(VehicleProperty::InteriorLightCenter, "Center", "b", AbstractProperty::Read);
- supportedChanged(re->supported());
+
}
};
* @attributeComment \brief Must return horn status: on = true, off = false
**/
wantPropertyVariant(VehicleProperty::Horn,"On","b",AbstractProperty::Read);
- supportedChanged(re->supported());
+
}
};
* @attributeComment \brief Must return average fuel 'economy' in kilometers per liter of fuel since last reset. Setting this to any value should reset the counter to '0'
**/
wantPropertyVariant(VehicleProperty::FuelAverageEconomy,"AverageEconomy", "q", AbstractProperty::ReadWrite);
- supportedChanged(re->supported());
+
}
};
* @attributeComment \brief Must return Engine Oil Pressure in kPa.
**/
wantPropertyVariant(VehicleProperty::EngineOilPressure, "Pressure", "q", AbstractProperty::Read);
- supportedChanged(re->supported());
+
}
};
* @attributeComment \brief Must return direction in Degrees (0-360)
**/
wantPropertyVariant(VehicleProperty::Direction, "Direction", "q", AbstractProperty::Read);
- supportedChanged(re->supported());
+
}
};
std::string signature = g_variant_get_type_string(temp->toVariant());
- propertyDBusMap[prop] = new VariantType(re, signature, prop, VariantType::ReadWrite, this);
+ propertyDBusMap[prop] = new VariantType(re, signature, prop, prop, VariantType::ReadWrite, this);
delete temp;
- supportedChanged(re->supported());
+
}
#include "abstractroutingengine.h"
#include "debugout.h"
-VariantType::VariantType(AbstractRoutingEngine* re, std::string signature, std::string propertyName, Access access, AbstractDBusInterface *interface)
+VariantType::VariantType(AbstractRoutingEngine* re, std::string signature, VehicleProperty::Property ambPropertyName, std::string propertyName, Access access, AbstractDBusInterface *interface)
:AbstractProperty(propertyName, signature, access, interface), mInitialized(false)
{
+ mAmbPropertyName = ambPropertyName;
routingEngine = re;
//set default value:
- setValue(VehicleProperty::getPropertyTypeForPropertyNameValue(propertyName));
+ setValue(VehicleProperty::getPropertyTypeForPropertyNameValue(mAmbPropertyName));
}
void VariantType::initialize()
if(mInitialized) return;
AsyncPropertyRequest request;
- request.property = mPropertyName;
+ request.property = mAmbPropertyName;
request.sourceUuidFilter = mSourceFilter;
request.zoneFilter = mZoneFilter;
{
if(!value())
{
- AbstractPropertyType* v = VehicleProperty::getPropertyTypeForPropertyNameValue(mPropertyName);
+ AbstractPropertyType* v = VehicleProperty::getPropertyTypeForPropertyNameValue(mAmbPropertyName);
setValue(v);
void VariantType::fromGVariant(GVariant *val)
{
- AbstractPropertyType* v = VehicleProperty::getPropertyTypeForPropertyNameValue(mPropertyName);
+ AbstractPropertyType* v = VehicleProperty::getPropertyTypeForPropertyNameValue(mAmbPropertyName);
v->fromVariant( val );
AsyncSetPropertyRequest request;
- request.property = mPropertyName;
+ request.property = mAmbPropertyName;
request.value = v;
request.completed = [](AsyncPropertyReply* reply)
{
{
public:
- VariantType(AbstractRoutingEngine* re, string signature, string propertyName, Access access, AbstractDBusInterface* interface);
+ VariantType(AbstractRoutingEngine* re, string signature, VehicleProperty::Property ambPropertyName, string propertyName, Access access, AbstractDBusInterface* interface);
void initialize();
**/
wantPropertyVariant(VehicleProperty::VIN, "VIN", "s", AbstractProperty::Read);
- supportedChanged(re->supported());
+
}
};
**/
wantPropertyVariant(VehicleProperty::VehicleLength, "Length", "u", AbstractProperty::Read);
- supportedChanged(re->supported());
+
}
};
**/
wantPropertyVariant(VehicleProperty::FuelPositionSide, "RefuelPosition", "y", AbstractProperty::Read);
- supportedChanged(re->supported());
+
}
};
**/
wantPropertyVariant(VehicleProperty::VehicleType, "Type", "y", AbstractProperty::Read);
- supportedChanged(re->supported());
+
}
};
**/
wantPropertyVariant(VehicleProperty::DoorsPerRow, "DoorsPerRow", "ay", AbstractProperty::Read);
- supportedChanged(re->supported());
+
}
};
**/
wantPropertyVariant(VehicleProperty::TransmissionGearType, "TransmissionGearType", "y", AbstractProperty::Read);
- supportedChanged(re->supported());
+
}
};
**/
wantPropertyVariant(VehicleProperty::AntilockBrakingSystem, "AntilockBrakingSystem", "b", AbstractProperty::Read);
- supportedChanged(re->supported());
+
}
};