summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevron Rees <tripzero.kev@gmail.com>2012-08-27 17:16:47 -0700
committerKevron Rees <tripzero.kev@gmail.com>2012-08-27 17:16:47 -0700
commit83375c9ee341e2576e963ff3a94cf2589f9733b2 (patch)
treebcd37e6a295c83c2f818e46d85d48789e0862409
parent0699e4720bbd8de3c7772dfc126bfe40ca05953e (diff)
downloadautomotive-message-broker-83375c9ee341e2576e963ff3a94cf2589f9733b2.tar.gz
example supports engine coolant
-rw-r--r--plugins/exampleplugin.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/exampleplugin.cpp b/plugins/exampleplugin.cpp
index a91a4bba..6563214b 100644
--- a/plugins/exampleplugin.cpp
+++ b/plugins/exampleplugin.cpp
@@ -30,6 +30,7 @@ uint16_t accelerationX = 0;
uint16_t transmissionShiftPostion = 0;
uint16_t steeringWheelAngle=0;
uint16_t throttlePos = 0;
+uint16_t engineCoolant = 40;
static gboolean timeoutCallback(gpointer data)
{
@@ -123,6 +124,7 @@ PropertyList ExampleSourcePlugin::supported()
props.push_back(VehicleProperty::TransmissionShiftPosition);
props.push_back(VehicleProperty::SteeringWheelAngle);
props.push_back(VehicleProperty::ThrottlePosition);
+ props.push_back(VehicleProperty::EngineCoolantTemperature);
return props;
}
@@ -140,6 +142,7 @@ void ExampleSourcePlugin::randomizeProperties()
transmissionShiftPostion = 1 + (6.00 * (rand() / (RAND_MAX + 1.0)));
steeringWheelAngle = 1 + (359.00 * (rand() / (RAND_MAX + 1.0)));
throttlePos = 1 + (100.00 * (rand() / (RAND_MAX + 1.0)));
+ engineCoolant = 1 + (40.00 * (rand() / (RAND_MAX + 140.0)));
DebugOut()<<"setting velocity to: "<<velocity<<endl;
DebugOut()<<"setting enginespeed to: "<<engineSpeed<<endl;
@@ -150,4 +153,5 @@ void ExampleSourcePlugin::randomizeProperties()
routingEngine->updateProperty(VehicleProperty::SteeringWheelAngle, steeringWheelAngle);
routingEngine->updateProperty(VehicleProperty::TransmissionShiftPosition, transmissionShiftPostion);
routingEngine->updateProperty(VehicleProperty::ThrottlePosition, throttlePos);
+ routingEngine->updateProperty(VehicleProperty::EngineCoolantTemperature, engineCoolant);
}