engine->subscribeToProperty(*itr,this);
}
- mSupported.push_back(DatabaseFileProperty);
- mSupported.push_back(DatabaseLoggingProperty);
- mSupported.push_back(DatabasePlaybackProperty);
+ mSupported.push_back(DatabaseFile);
+ mSupported.push_back(DatabaseLogging);
+ mSupported.push_back(DatabasePlayback);
routingEngine->setSupported(supported(), this);
return mSupported;
}
+PropertyInfo DatabaseSink::getPropertyInfo(VehicleProperty::Property property)
+{
+ /// TODO: Compute update frequency for properties in the database
+ return PropertyInfo();
+}
+
void DatabaseSink::parseConfig()
{
json_object *rootobject;
void DatabaseSink::setPlayback(bool v)
{
AsyncSetPropertyRequest request;
- request.property = DatabasePlaybackProperty;
+ request.property = DatabasePlayback;
request.value = new DatabasePlaybackType(v);
setProperty(request);
void DatabaseSink::setLogging(bool b)
{
AsyncSetPropertyRequest request;
- request.property = DatabaseLoggingProperty;
+ request.property = DatabaseLogging;
request.value = new DatabaseLoggingType(b);
setProperty(request);
{
reply->success = false;
- if(reply->property == DatabaseFileProperty)
+ if(reply->property == DatabaseFile)
{
- DatabaseFilePropertyType temp(databaseName);
+ DatabaseFileType temp(databaseName);
reply->value = &temp;
reply->success = true;
return;
}
- else if(reply->property == DatabaseLoggingProperty)
+ else if(reply->property == DatabaseLogging)
{
- BasicPropertyType<bool> temp = shared;
+ DatabaseLoggingType temp = shared;
reply->value = &temp;
reply->success = true;
return;
}
- else if(reply->property == DatabasePlaybackProperty)
+ else if(reply->property == DatabasePlayback)
{
- BasicPropertyType<bool> temp = playback;
+ DatabasePlaybackType temp = playback;
reply->value = &temp;
reply->success = true;
reply->completed(reply);
AsyncPropertyReply* reply = new AsyncPropertyReply(request);
reply->success = false;
- if(request.property == DatabaseLoggingProperty)
+ if(request.property == DatabaseLogging)
{
if(request.value->value<bool>())
{
setPlayback(false);
startDb();
reply->success = true;
- BasicPropertyType<bool> temp(true);
- routingEngine->updateProperty(DatabaseLoggingProperty,&temp,uuid());
+ DatabaseLoggingType temp(true);
+ routingEngine->updateProperty(DatabaseLogging,&temp,uuid());
}
else
{
stopDb();
reply->success = true;
- BasicPropertyType<bool> temp(false);
- routingEngine->updateProperty(DatabaseLoggingProperty,&temp,uuid());
+ DatabaseLoggingType temp(false);
+ routingEngine->updateProperty(DatabaseLogging,&temp,uuid());
}
}
- else if(request.property == DatabaseFileProperty)
+ else if(request.property == DatabaseFile)
{
std::string fname = request.value->toString();
databaseName = fname;
- StringPropertyType temp(databaseName);
+ DatabaseFileType temp(databaseName);
- routingEngine->updateProperty(DatabaseFileProperty,&temp,uuid());
+ routingEngine->updateProperty(DatabaseFile,&temp,uuid());
reply->success = true;
}
- else if( request.property == DatabasePlaybackProperty)
+ else if( request.property == DatabasePlayback)
{
if(request.value->value<bool>())
{
setLogging(false);
startPlayback();
- BasicPropertyType<bool> temp(playback);
+ DatabasePlaybackType temp(playback);
- routingEngine->updateProperty(DatabasePlaybackProperty,&temp,uuid());
+ routingEngine->updateProperty(DatabasePlayback,&temp,uuid());
}
else
{
playback = false;
- BasicPropertyType<bool> temp(playback);
+ DatabasePlaybackType temp(playback);
- routingEngine->updateProperty(DatabasePlaybackProperty, &temp, uuid());
+ routingEngine->updateProperty(DatabasePlayback, &temp, uuid());
}
reply->success = true;