initial working dbus plugin
authorKevron Rees <kevron_m_rees@linux.intel.com>
Tue, 21 Aug 2012 23:50:22 +0000 (16:50 -0700)
committerKevron Rees <kevron_m_rees@linux.intel.com>
Tue, 21 Aug 2012 23:50:22 +0000 (16:50 -0700)
plugins/dbus/abstractproperty.h
plugins/exampleplugin.cpp

index 8feae3e..921d0df 100644 (file)
@@ -71,6 +71,7 @@ public:
        void setValue(boost::any val)
        {
                mValue = val;
+               updateValue();
        }
 
        template<typename T>
index 64e7cc4..5dc9b96 100644 (file)
@@ -99,6 +99,7 @@ PropertyList ExampleSourcePlugin::supported()
        PropertyList props;
        props.push_back(VehicleProperty::EngineSpeed);
        props.push_back(VehicleProperty::VehicleSpeed);
+       props.push_back(VehicleProperty::AccelerationX);
        
        return props;
 }
@@ -112,10 +113,12 @@ void ExampleSourcePlugin::randomizeProperties()
 {
        velocity = 1 + (255.00 * (rand() / (RAND_MAX + 1.0)));
        engineSpeed = 1 + (15000.00 * (rand() / (RAND_MAX + 1.0)));
+       int accelerationX = 1 + (15000.00 * (rand() / (RAND_MAX + 1.0)));
        
        DebugOut()<<"setting velocity to: "<<velocity<<endl;
        DebugOut()<<"setting enginespeed to: "<<engineSpeed<<endl;
        
        routingEngine->updateProperty(VehicleProperty::VehicleSpeed, velocity);
        routingEngine->updateProperty(VehicleProperty::EngineSpeed, engineSpeed);
+       routingEngine->updateProperty(VehicleProperty::AccelerationX, accelerationX);
 }