void GeniviLogReplayerPlugin::addPropertySupport(VehicleProperty::Property property, Zone::Type zone)
{
    mSupported.push_back(property);

    Zone::ZoneList zones;

    zones.push_back(zone);

    PropertyInfo info(0, zones);

    propertyInfoMap[property] = info;
}
void ExampleSourcePlugin::addPropertySupport(VehicleProperty::Property property, Zone::Type zone)
{
	mSupported.push_back(property);

	Zone::ZoneList zones;

	zones.push_back(zone);

	PropertyInfo info(0, zones);

	propertyInfoMap[property] = info;
}
PropertyInfo WebSocketSource::getPropertyInfo(const VehicleProperty::Property &property)
{
	Zone::ZoneList zones;
	for(auto i : properties.properties())
	{
		if(i->name == property)
		{
			zones.push_back(i->zone);
		}
	}

	return PropertyInfo(0, zones);
}
ExampleSourcePlugin::ExampleSourcePlugin(AbstractRoutingEngine* re, map<string, string> config)
:AbstractSource(re, config), velocity(0), engineSpeed(0)
{
	debugOut("setting timeout");

	int delay = 1000;

	if(config.find("delay") != config.end())
	{
		delay = boost::lexical_cast<int>(config["delay"]);
	}

	g_timeout_add(delay, timeoutCallback, this );

	addPropertySupport(VehicleProperty::EngineSpeed, Zone::None);
	addPropertySupport(VehicleProperty::VehicleSpeed, Zone::None);
	addPropertySupport(VehicleProperty::AccelerationX, Zone::None);
	addPropertySupport(VehicleProperty::TransmissionShiftPosition, Zone::None);
	addPropertySupport(VehicleProperty::TransmissionGearPosition, Zone::None);
	addPropertySupport(VehicleProperty::SteeringWheelAngle, Zone::None);
	addPropertySupport(VehicleProperty::ThrottlePosition, Zone::None);
	addPropertySupport(VehicleProperty::EngineCoolantTemperature, Zone::None);
	addPropertySupport(VehicleProperty::VIN, Zone::None);
	addPropertySupport(VehicleProperty::WMI, Zone::None);
	addPropertySupport(VehicleProperty::BatteryVoltage, Zone::None);
	addPropertySupport(VehicleProperty::MachineGunTurretStatus, Zone::None);
	addPropertySupport(VehicleProperty::ExteriorBrightness, Zone::None);
	addPropertySupport(VehicleProperty::DoorsPerRow, Zone::None);
	addPropertySupport(VehicleProperty::AirbagStatus, Zone::None);

	Zone::ZoneList airbagZones;
	airbagZones.push_back(Zone::FrontLeft | Zone::FrontSide);
	airbagZones.push_back(Zone::FrontRight | Zone::FrontSide);
	airbagZones.push_back(Zone::RearLeft | Zone::LeftSide);
	airbagZones.push_back(Zone::RearRight | Zone::RightSide);

	airbagStatus[Zone::FrontLeft | Zone::FrontSide] = Airbag::Active;
	airbagStatus[Zone::FrontRight | Zone::FrontSide] = Airbag::Inactive;
	airbagStatus[Zone::RearLeft | Zone::LeftSide] = Airbag::Deployed;
	airbagStatus[Zone::RearRight | Zone::RightSide] = Airbag::Deployed;

	PropertyInfo airbagInfo(0,airbagZones);

	propertyInfoMap[VehicleProperty::AirbagStatus] = airbagInfo;

	addPropertySupport(VehicleProperty::AirConditioning, Zone::None);

	Zone::ZoneList acZones;
	acZones.push_back(Zone::FrontLeft);
	acZones.push_back(Zone::Front | Zone::Right);

	acStatus[Zone::Front | Zone::Left] = true;
	acStatus[Zone::Front | Zone::Right] = false;

	PropertyInfo acInfo(0,acZones);
	propertyInfoMap[VehicleProperty::AirConditioning] = acInfo;
}