Skip to content
Snippets Groups Projects
Commit 561be819 authored by Marco De Marco's avatar Marco De Marco
Browse files

Autostart added

parent 847506a9
No related branches found
No related tags found
No related merge requests found
...@@ -159,6 +159,13 @@ void MetadataExporter::init_device() ...@@ -159,6 +159,13 @@ void MetadataExporter::init_device()
m_server_sp = SSLServer::create(this, m_configuration_sp); m_server_sp = SSLServer::create(this, m_configuration_sp);
else else
m_server_sp = PlainServer::create(this, m_configuration_sp); m_server_sp = PlainServer::create(this, m_configuration_sp);
//Start device if auto start enabled
if(autoStart)
{
INFO_STREAM << "FitsImporter::init_device() auto start enabled " << endl;
on();
}
} }
catch(std::exception& ex) catch(std::exception& ex)
{ {
...@@ -212,6 +219,7 @@ void MetadataExporter::get_device_property() ...@@ -212,6 +219,7 @@ void MetadataExporter::get_device_property()
dev_prop.push_back(Tango::DbDatum("DatabaseConnectionNumber")); dev_prop.push_back(Tango::DbDatum("DatabaseConnectionNumber"));
dev_prop.push_back(Tango::DbDatum("ExportedTables")); dev_prop.push_back(Tango::DbDatum("ExportedTables"));
dev_prop.push_back(Tango::DbDatum("AuthorisedUsers")); dev_prop.push_back(Tango::DbDatum("AuthorisedUsers"));
dev_prop.push_back(Tango::DbDatum("AutoStart"));
// is there at least one property to be read ? // is there at least one property to be read ?
if (dev_prop.size()>0) if (dev_prop.size()>0)
...@@ -380,6 +388,17 @@ void MetadataExporter::get_device_property() ...@@ -380,6 +388,17 @@ void MetadataExporter::get_device_property()
// And try to extract AuthorisedUsers value from database // And try to extract AuthorisedUsers value from database
if (dev_prop[i].is_empty()==false) dev_prop[i] >> authorisedUsers; if (dev_prop[i].is_empty()==false) dev_prop[i] >> authorisedUsers;
// Try to initialize AutoStart from class property
cl_prop = ds_class->get_class_property(dev_prop[++i].name);
if (cl_prop.is_empty()==false) cl_prop >> autoStart;
else {
// Try to initialize AutoStart from default device value
def_prop = ds_class->get_default_device_property(dev_prop[i].name);
if (def_prop.is_empty()==false) def_prop >> autoStart;
}
// And try to extract AutoStart value from database
if (dev_prop[i].is_empty()==false) dev_prop[i] >> autoStart;
} }
/*----- PROTECTED REGION ID(MetadataExporter::get_device_property_after) ENABLED START -----*/ /*----- PROTECTED REGION ID(MetadataExporter::get_device_property_after) ENABLED START -----*/
......
...@@ -121,6 +121,8 @@ public: ...@@ -121,6 +121,8 @@ public:
// AuthorisedUsers: Authorised user list: one user per row // AuthorisedUsers: Authorised user list: one user per row
// [username password] // [username password]
vector<string> authorisedUsers; vector<string> authorisedUsers;
// AutoStart: Exec On command after init if state is not fault
Tango::DevBoolean autoStart;
// Constructors and destructors // Constructors and destructors
......
...@@ -84,6 +84,11 @@ ...@@ -84,6 +84,11 @@
<type xsi:type="pogoDsl:StringVectorType"/> <type xsi:type="pogoDsl:StringVectorType"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/> <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</deviceProperties> </deviceProperties>
<deviceProperties name="AutoStart" description="Exec On command after init if state is not fault">
<type xsi:type="pogoDsl:BooleanType"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<DefaultPropValue>false</DefaultPropValue>
</deviceProperties>
<commands name="State" description="This command gets the device state (stored in its device_state data member) and returns it to the caller." execMethod="dev_state" displayLevel="OPERATOR" polledPeriod="0"> <commands name="State" description="This command gets the device state (stored in its device_state data member) and returns it to the caller." execMethod="dev_state" displayLevel="OPERATOR" polledPeriod="0">
<argin description="none"> <argin description="none">
<type xsi:type="pogoDsl:VoidType"/> <type xsi:type="pogoDsl:VoidType"/>
......
...@@ -606,6 +606,20 @@ void MetadataExporterClass::set_default_property() ...@@ -606,6 +606,20 @@ void MetadataExporterClass::set_default_property()
} }
else else
add_wiz_dev_prop(prop_name, prop_desc); add_wiz_dev_prop(prop_name, prop_desc);
prop_name = "AutoStart";
prop_desc = "Exec On command after init if state is not fault";
prop_def = "false";
vect_data.clear();
vect_data.push_back("false");
if (prop_def.length()>0)
{
Tango::DbDatum data(prop_name);
data << vect_data ;
dev_def_prop.push_back(data);
add_wiz_dev_prop(prop_name, prop_desc, prop_def);
}
else
add_wiz_dev_prop(prop_name, prop_desc);
} }
//-------------------------------------------------------- //--------------------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment