#include "varianttype.h"
+#include "abstractroutingengine.h"
VariantType::VariantType(AbstractRoutingEngine* re, std::string signature, std::string propertyName, Access access, AbstractDBusInterface *interface)
:AbstractProperty(propertyName, signature, access, interface),routingEngine(re)
{
-//VehicleProperty::getPropertyTypeForPropertyNameValue(propertyName,"")->toVariant()->get_type_string()
+ AsyncPropertyRequest request;
+ request.property = mPropertyName;
+
+ VariantType* foo = this;
+
+ request.completed = [foo](AsyncPropertyReply* reply)
+ {
+ foo->setValue(reply->value);
+ };
+
+ re->getPropertyAsync(request);
+
}
GVariant *VariantType::toGVariant()
{
if(!value())
{
+
AbstractPropertyType* v = VehicleProperty::getPropertyTypeForPropertyNameValue(mPropertyName);
return v->toVariant()->gobj();
reply->value = &temp;
reply->completed(reply);
}
+ else if(reply->property == VehicleProperty::ExteriorBrightness)
+ {
+ VehicleProperty::ExteriorBrightnessType temp(1000);
+ reply->value = &temp;
+ reply->completed(reply);
+ }
}
void ExampleSourcePlugin::getRangePropertyAsync(AsyncRangePropertyReply *reply)
props.push_back(VehicleProperty::WMI);
props.push_back(VehicleProperty::BatteryVoltage);
props.push_back(VehicleProperty::MachineGunTurretStatus);
+ props.push_back(VehicleProperty::ExteriorBrightness);
return props;
}