update cache of dbus properties even if not currently registered
authorKevron Rees <kevron.m.rees@intel.com>
Tue, 14 Oct 2014 21:36:42 +0000 (14:36 -0700)
committerKevron Rees <kevron.m.rees@intel.com>
Tue, 14 Oct 2014 21:42:09 +0000 (14:42 -0700)
plugins/dbus/dbusplugin.cpp
plugins/dbus/varianttype.cpp
plugins/wheel/wheelplugin.cpp

index 1dd00e5..28b5e9b 100644 (file)
@@ -69,9 +69,6 @@ void DBusSink::supportedChanged(const PropertyList &supportedProperties)
 
 void DBusSink::propertyChanged(AbstractPropertyType *value)
 {
-       if(!isRegistered())
-               return;
-
        VehicleProperty::Property property = value->name;
 
        if( value->zone != zoneFilter)
index 730ed59..933ecca 100644 (file)
@@ -36,7 +36,7 @@ void VariantType::initialize()
        /// do not request if not supported:
        PropertyList proplist = routingEngine->supported();
 
-       if(contains(proplist,mAmbPropertyName))
+       if(contains(proplist, mAmbPropertyName))
                routingEngine->getPropertyAsync(request);
 }
 
@@ -55,7 +55,7 @@ GVariant *VariantType::toGVariant()
 void VariantType::fromGVariant(GVariant *val)
 {
        AbstractPropertyType *v = VehicleProperty::getPropertyTypeForPropertyNameValue(mAmbPropertyName);
-       v->fromVariant( val );
+       v->fromVariant(val);
 
        AsyncSetPropertyRequest request;
        request.property = mAmbPropertyName;
index f6ebdbb..0ddfd79 100644 (file)
@@ -99,6 +99,7 @@ private:
        VehicleProperty::EngineOilPressureType *oilPSI;
        VehicleProperty::EngineCoolantTemperatureType *coolantTemp;
        VehicleProperty::SteeringWheelAngleType *steeringAngle;
+       VehicleProperty::SteeringWheelAngleW3CType *steeringAngleW3C;
        VehicleProperty::ThrottlePositionType *throttle;
        VehicleProperty::ClutchStatusType *clutch;
        VehicleProperty::WheelBrakeType *brake;
@@ -162,6 +163,7 @@ PropertyList WheelSourcePlugin::supported()
        props.push_back(VehicleProperty::ThrottlePosition);
        props.push_back(VehicleProperty::WheelBrake);
        props.push_back(VehicleProperty::SteeringWheelAngle);
+       props.push_back(VehicleProperty::SteeringWheelAngleW3C);
        props.push_back(VehicleProperty::TurnSignal);
        props.push_back(VehicleProperty::ClutchStatus);
        props.push_back(VehicleProperty::EngineOilPressure);
@@ -208,6 +210,7 @@ WheelPrivate::WheelPrivate(WheelSourcePlugin *parent, AbstractRoutingEngine *rou
          engineSpeed(new VehicleProperty::EngineSpeedType(0)),
          vehicleSpeed(new VehicleProperty::VehicleSpeedType(0)),
          steeringAngle(new VehicleProperty::SteeringWheelAngleType(0)),
+         steeringAngleW3C(new VehicleProperty::SteeringWheelAngleW3CType(0)),
          clutch(new VehicleProperty::ClutchStatusType(false)),
          brake(new VehicleProperty::WheelBrakeType(false)),
          tempButton(new VehicleProperty::ButtonEventType(ButtonEvents::NoButton)),
@@ -308,6 +311,8 @@ AbstractPropertyType *WheelPrivate::getProperty(VehicleProperty::Property propTy
                return this->brake;
        else if (propType == VehicleProperty::SteeringWheelAngle)
                return this->steeringAngle;
+       else if (propType == VehicleProperty::SteeringWheelAngleW3C)
+               return this->steeringAngleW3C;
        else if (propType == VehicleProperty::TurnSignal)
                return this->turnSignal;
        else if (propType == VehicleProperty::ClutchStatus)
@@ -536,7 +541,9 @@ void WheelPrivate::changeCoolantTemp(bool increase)
 void WheelPrivate::changeSteeringAngle(int val)
 {
        *steeringAngle = (((double)val/(double)32767.0) + (double)1.0) * (double)180.0;
+       *steeringAngleW3C = (((double)val/(double)32767.0) + (double)1.0) * (double)180.0;
        this->re->updateProperty(steeringAngle, mParent->uuid());
+       this->re->updateProperty(steeringAngleW3C, mParent->uuid());
 }
 
 void WheelPrivate::changeClutch(int val)