Transmission::TransmissionPositions transmissionShiftPostion = Transmission::Neutral;
uint16_t steeringWheelAngle=0;
uint16_t throttlePos = 0;
-uint16_t engineCoolant = 40;
+int engineCoolant = 40;
bool machineGun = false;
+const char* id = "6dd4268a-c605-4a06-9034-59c1e8344c8e";
+
static gboolean timeoutCallback(gpointer data)
{
ExampleSourcePlugin* src = (ExampleSourcePlugin*)data;
-
+
src->randomizeProperties();
-
+
return true;
}
-extern "C" AbstractSource * create(AbstractRoutingEngine* routingengine, map<string, string> config)
+extern "C" void create(AbstractRoutingEngine* routingengine, map<string, string> config)
{
- return new ExampleSourcePlugin(routingengine, config);
-
+ new ExampleSourcePlugin(routingengine, config);
}
const string ExampleSourcePlugin::uuid()
{
- return "6dd4268a-c605-4a06-9034-59c1e8344c8e";
+ return id;
}
{
VehicleProperty::DoorsPerRowType temp;
- BasicPropertyType<uint16_t> row1(2);
- BasicPropertyType<uint16_t> row2(2);
- BasicPropertyType<uint16_t> row3(1);
-
- temp.append(&row1);
- temp.append(&row2);
- temp.append(&row3);
+ temp.append(2);
+ temp.append(2);
+ temp.append(1);
reply->value = &temp;
reply->success = true;
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;
-
- VehicleProperty::VehicleSpeedType vel(velocity);
- VehicleProperty::EngineSpeedType es(engineSpeed);
- VehicleProperty::AccelerationXType ac(accelerationX);
- VehicleProperty::SteeringWheelAngleType swa(steeringWheelAngle);
- VehicleProperty::TransmissionShiftPositionType tsp(transmissionShiftPostion);
- VehicleProperty::TransmissionGearPositionType tgp(transmissionShiftPostion);
- VehicleProperty::ThrottlePositionType tp(throttlePos);
- VehicleProperty::EngineCoolantTemperatureType ec(engineCoolant);
- VehicleProperty::MachineGunTurretStatusType mgt(machineGun);
+
+ vel.setValue(velocity);
+ vel.sequence++;
+ vel.priority = AbstractPropertyType::High;
+ es.setValue(engineSpeed);
+ es.sequence++;
+ es.priority = AbstractPropertyType::Low;
+ ac.setValue(accelerationX);
+ swa.setValue(steeringWheelAngle);
+ tsp.setValue(transmissionShiftPostion);
+ tgp.setValue(transmissionShiftPostion);
+ tsp.priority = AbstractPropertyType::Low;
+ tp.setValue(throttlePos);
+ ec.setValue(engineCoolant);
+ mgt.setValue(machineGun);
machineGun = !machineGun;
{
mSupported.push_back(property);
- std::list<Zone::Type> zones;
+ Zone::ZoneList zones;
zones.push_back(zone);