Commit 815bb123 authored by Locatelli's avatar Locatelli

Pass property names to ploty2 instead of ids

parent 6c91b2f0
......@@ -19,58 +19,59 @@ message Message {
// PlotPropertyData Message
message PlotPropertyDataMessage {
required int32 title_id = 1;
required int32 xaxis_title_id = 2;
required int32 yaxis_title_id = 3;
required string windowTitle = 4;
required string plotTitle = 5;
required string xaxis_title = 6;
required string yaxis_title = 7;
required string plotkey = 8;
repeated string keys = 9;
repeated string legend_keys = 10;
repeated string colors = 11;
repeated int32 datax_ids = 12;
repeated int32 datay_ids = 13;
repeated int32 dataz_ids = 14;
repeated int32 plottype_id = 15;
repeated int32 x_id = 16;
repeated int32 y_id = 17;
repeated int32 channel_id = 18;
repeated int32 slice_id = 19;
repeated int32 max_x_id = 20;
repeated int32 max_y_id = 21;
repeated int32 max_channel_id = 22;
repeated int32 max_slice_id = 23;
repeated int32 xphysical_size_id = 24;
repeated int32 yphysical_size_id = 25;
repeated bool error_bars = 26;
repeated int32 optimization_result_found_id = 27;
repeated int32 optimization_result_x_id = 28;
repeated string optimization_result_color = 29;
repeated int32 optimization_fit_found_id = 30;
repeated int32 optimization_fit_y_id = 31;
repeated string optimization_fit_color = 32;
optional int32 use_grid_id = 33;
optional int32 use_log_id = 34;
optional int32 color_map_id = 35;
optional int32 min_color_limit_id = 36;
optional int32 max_color_limit_id = 37;
optional int32 nbRois_id = 38;
repeated int32 x0_parent_id = 39;
repeated int32 y0_parent_id = 40;
repeated int32 x1_parent_id = 41;
repeated int32 y1_parent_id = 42;
repeated int32 sum_parent_id = 43;
optional int32 selectedPlot_id = 44;
optional int32 selectedRoi_id = 45;
optional int32 selectedX0_id = 46;
optional int32 selectedY0_id = 47;
optional int32 selectedX1_id = 48;
optional int32 selectedY1_id = 49;
optional int32 commandRoiAdd_id = 50;
optional int32 commandRoiRaz_id = 51;
optional int32 countActivated_id = 52;
required string controller_name = 1;
required string title_prop_name = 2;
required string xaxis_title_prop_name = 3;
required string yaxis_title_prop_name = 4;
required string windowTitle = 5;
required string plotTitle = 6;
required string xaxis_title = 7;
required string yaxis_title = 8;
required string plotkey = 9;
repeated string keys = 10;
repeated string legend_keys = 11;
repeated string colors = 12;
repeated string datax_prop_name = 13;
repeated string datay_prop_name = 14;
repeated string dataz_prop_name = 15;
repeated string plottype_prop_name = 16;
repeated string x_prop_name = 17;
repeated string y_prop_name = 18;
repeated string channel_prop_name = 19;
repeated string slice_prop_name = 20;
repeated string max_x_prop_name = 21;
repeated string max_y_prop_name = 22;
repeated string max_channel_prop_name = 23;
repeated string max_slice_prop_name = 24;
repeated string xphysical_size_prop_name = 25;
repeated string yphysical_size_prop_name = 26;
repeated bool error_bars = 27;
repeated string optimization_result_found_prop_name = 28;
repeated string optimization_result_x_prop_name = 29;
repeated string optimization_result_color = 30;
repeated string optimization_fit_found_prop_name = 31;
repeated string optimization_fit_y_prop_name = 32;
repeated string optimization_fit_color = 33;
optional string use_grid_prop_name = 34;
optional string use_log_prop_name = 35;
optional string color_map_prop_name = 36;
optional string min_color_limit_prop_name = 37;
optional string max_color_limit_prop_name = 38;
optional string nbRois_prop_name = 39;
repeated string x0_parent_prop_name = 40;
repeated string y0_parent_prop_name = 41;
repeated string x1_parent_prop_name = 42;
repeated string y1_parent_prop_name = 43;
repeated string sum_parent_prop_name = 44;
optional string selectedPlot_prop_name = 45;
optional string selectedRoi_prop_name = 46;
optional string selectedX0_prop_name = 47;
optional string selectedY0_prop_name = 48;
optional string selectedX1_prop_name = 49;
optional string selectedY1_prop_name = 50;
optional string commandRoiAdd_prop_name = 51;
optional string commandRoiRaz_prop_name = 52;
optional string countActivated_prop_name = 53;
}
// Spy and multiplot message for ploty2
......
......@@ -73,6 +73,8 @@ message Message {
GetPropertyType = 30;
GetDynamicPropertyIds = 31;
GetServantId = 32;
}
required Type type = 1;
......@@ -183,3 +185,9 @@ message GetDynamicPropertyIdsRequest {
required uint32 databaseID = 1;
required uint32 propertyID = 2;
}
message GetServantIDRequest {
required uint32 databaseID = 1;
required string servantName = 2;
}
......@@ -105,6 +105,7 @@ void DatabaseResponder::initProcessFunctions() {
m_processFunctions[database::Message::GetWholeDynamicProperties] = ProcessFunction(&DatabaseResponder::processGetWholeDynamicProperties, true);
m_processFunctions[database::Message::GetPropertyType] = ProcessFunction(&DatabaseResponder::processGetProperyTypeRequest, true);
m_processFunctions[database::Message::GetDynamicPropertyIds] = ProcessFunction(&DatabaseResponder::processGetDynamicPropertyIdsRequest, true);
m_processFunctions[database::Message::GetServantId] = ProcessFunction(&DatabaseResponder::processGetServantIDRequest, true);
}
void DatabaseResponder::processGetInt32Value(cameo::application::Request * request, const std::string & message, std::string & response) {
......@@ -602,10 +603,10 @@ void DatabaseResponder::processGetPropertyIDRequest(cameo::application::Request
responseMessage.set_value(propertyID);
}
catch (PropertyAccessorDirectImpl::NoSuchServantException& e) {
catch (Database::NoSuchServantException& e) {
responseMessage.set_error(common::Error::NO_SUCH_SERVANT);
}
catch (PropertyAccessorDirectImpl::NoSuchPropertyException& e) {
catch (Database::NoSuchPropertyException& e) {
responseMessage.set_error(common::Error::NO_SUCH_PROPERTY);
}
......@@ -668,6 +669,26 @@ void DatabaseResponder::processGetDynamicPropertyIdsRequest(cameo::application::
}
void DatabaseResponder::processGetServantIDRequest(cameo::application::Request * request, const std::string & message, std::string & response) {
database::GetServantIDRequest messageRequest;
messageRequest.ParseFromString(message);
common::Int32Response responseMessage;
try {
unsigned long servantID = Database::getInstance(messageRequest.databaseid())->getServantID(messageRequest.servantname());
responseMessage.set_value(servantID);
}
catch (Database::NoSuchServantException& e) {
responseMessage.set_error(common::Error::NO_SUCH_SERVANT);
}
// Serialize the response.
responseMessage.SerializeToString(&response);
}
void DatabaseResponder::loop() {
// Initialize the map of functions.
......
......@@ -100,6 +100,8 @@ private:
void processGetDynamicPropertyIdsRequest(cameo::application::Request * request, const std::string & message, std::string & response);
void processGetServantIDRequest(cameo::application::Request * request, const std::string & message, std::string & response);
dataprovider::PropertyAccessorDirectImpl* m_propertyAccessor;
dataprovider::CommandAccessorDirectImpl* m_commandAccessor;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment