Skip to content
Snippets Groups Projects
Commit e2f0cb8d authored by Xavier ELATTAOUI's avatar Xavier ELATTAOUI
Browse files

Release preparation (Jira TANGODEVIC-1414 : add spectrum attribute which lists...

Release preparation (Jira TANGODEVIC-1414 : add spectrum attribute which lists fixed positions name).
parent c304cf92
Branches
No related tags found
No related merge requests found
......@@ -54,6 +54,20 @@ Revision: - Author:
<Br>
<Table Border=2 Cellpadding=3 CELLSPACING=0 WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<Td COLSPAN=4> <Font Size=+2><Center><b>Scalar Attributes</b></td></Font></Center>
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<Td><Center><b>Attribute name</b></td></Center>
<Td><Center><b>Data Type</b></td></Center>
<Td><Center><b>R/W Type</b></td></Center>
<Td><Center><b>Expert</b></td></Center>
<Tr><Td><b>labelList</b>: <Font Size=-1>List of fixed positions names.</Font></Td>
<Td><Center><Font Size=-1>DEV_STRING</Font></Center></Td><Td><Center><Font Size=-1>READ</Font></Center></Td><Td><Center><Font Size=-1>No</Font></Center></Td></Tr>
</Table>
</Center>
<Br><Br><Br><Br><Br>
<!--- html Footer --->
......
......@@ -102,9 +102,9 @@ The language device desctructor automatically calls the <i> delete_device() </i>
<Br>&nbsp
</ul><Br>
<Br>
<A NAME="InitializeReferencePositionn"><!-- --></A>
<A NAME="InitializeReferencePositionn"><!-- --></A>
<h2>4 - InitializeReferencePositionn</h2>
<A NAME="InitializeReferencePosition"><!-- --></A>
<A NAME="InitializeReferencePosition"><!-- --></A>
<h2>4 - InitializeReferencePosition</h2>
<ul>
<Li><Strong>Description: </Strong> Homes the hexapod (send it to Home position and stays there))<Br>&nbsp
<Li><Strong>Argin:<Br>DEV_VOID</Strong>
......
......@@ -11,7 +11,7 @@
<A Href="DevCommands.html#Init" TARGET="DevCommands"> Init</a><Br>
<A Href="DevCommands.html#State" TARGET="DevCommands"> State</a><Br>
<A Href="DevCommands.html#Status" TARGET="DevCommands"> Status</a><Br>
<A Href="DevCommands.html#InitializeReferencePositionn" TARGET="DevCommands"> InitializeReferencePositionn</a><Br>
<A Href="DevCommands.html#InitializeReferencePosition" TARGET="DevCommands"> InitializeReferencePosition</a><Br>
<A Href="DevCommands.html#Stop" TARGET="DevCommands"> Stop</a><Br>
......
......@@ -73,7 +73,7 @@ Revision: - Author:
<Tr><Td><b>Status</b></Td>
<Td><Font Size=-1>DEV_VOID</Font></Td>
<Td><Font Size=-1>CONST_DEV_STRING</Font></Td>
<Tr><Td><b>InitializeReferencePositionn</b></Td>
<Tr><Td><b>InitializeReferencePosition</b></Td>
<Td><Font Size=-1>DEV_VOID</Font></Td>
<Td><Font Size=-1>DEV_VOID</Font></Td>
<Tr><Td><b>Stop</b></Td>
......
......@@ -9,7 +9,7 @@
<groupId>fr.soleil.device</groupId>
<artifactId>HexapodFMBO-${aol}-${mode}</artifactId>
<version>1.2.10-SNAPSHOT</version>
<version>1.2.10</version>
<packaging>nar</packaging>
......
......@@ -74,6 +74,8 @@ static const double __NAN__ = ::sqrt(-1.);
#define isnan _isnan
#endif
static const long kSpecLen = 256;
namespace FixedPositions_ns
{
......@@ -114,6 +116,15 @@ FixedPositions::FixedPositions(Tango::DeviceClass *cl,const char *s,const char *
void FixedPositions::delete_device()
{
// Delete device allocated objects
size_t s = 0;
if (attr_labelList_read)
{
for (s = 0; s < kSpecLen; s++)
CORBA::string_free(attr_labelList_read[s]);
delete[] attr_labelList_read;
attr_labelList_read = 0;
}
//- remove dynamic attributes
if (m_dam)
......@@ -154,6 +165,14 @@ void FixedPositions::init_device()
this->hex = 0;
this->status_str = "beginning initialization of the device\n";
attr_labelList_read = new Tango::DevString[kSpecLen];
size_t s = 0;
for (s = 0; s < kSpecLen; s++)
{
attr_labelList_read[s] = CORBA::string_alloc(kSpecLen);
::memset(attr_labelList_read[s], 0, kSpecLen * sizeof(char));
}
get_device_property();
if (properties_missing)
......@@ -419,6 +438,33 @@ void FixedPositions::always_executed_hook()
}
}
//+----------------------------------------------------------------------------
//
// method : FixedPositions::read_attr_hardware
//
// description : Hardware acquisition for attributes.
//
//-----------------------------------------------------------------------------
void FixedPositions::read_attr_hardware(vector<long> &attr_list)
{
DEBUG_STREAM << "FixedPositions::read_attr_hardware(vector<long> &attr_list) entering... "<< endl;
// Add your own code here
}
//+----------------------------------------------------------------------------
//
// method : FixedPositions::read_labelList
//
// description : Extract real attribute values for labelList acquisition result.
//
//-----------------------------------------------------------------------------
void FixedPositions::read_labelList(Tango::Attribute &attr)
{
DEBUG_STREAM << "FixedPositions::read_labelList(Tango::Attribute &attr) entering... "<< endl;
attr.set_value(attr_labelList_read, kSpecLen);
}
//+------------------------------------------------------------------
/**
......@@ -490,7 +536,7 @@ bool FixedPositions::parse()
//- parse the property andd fill the PositionsData vect
for (size_t i = 0; i < fixedPositionsProp.size (); i += 6)
for (size_t i = 0, k=0; i < fixedPositionsProp.size (); i += 6, k++)
{
PositionsData * pos_dat_tmp = new PositionsData;
......@@ -517,6 +563,10 @@ bool FixedPositions::parse()
std::string::size_type idx = fixedPositionsProp [i].find (">");
pos_dat_tmp->dyn_attr_name = fixedPositionsProp [i].substr (idx +1);
//- populate attr labelList :
CORBA::string_free(attr_labelList_read[k]);
attr_labelList_read[k] = CORBA::string_dup(pos_dat_tmp->dyn_attr_name.c_str());
//- parse the lines <TCP>, <LCS>, <BWLS>, <FWLS>, <UC>
if (parse_coord_line ("<TCP>", fixedPositionsProp [i + 1], (i+1), pos_dat_tmp->tcp) == false)
return false;
......@@ -911,4 +961,5 @@ bool FixedPositions::compare_line (std::vector <double> & current, std::vector <
} // namespace
......@@ -77,6 +77,7 @@ public :
* Attribute member data.
*/
//@{
Tango::DevString *attr_labelList_read;
//@}
/**
......@@ -205,6 +206,18 @@ public :
*/
//@{
/**
* Hardware acquisition for attributes.
*/
virtual void read_attr_hardware(vector<long> &attr_list);
/**
* Extract real attribute values for labelList acquisition result.
*/
virtual void read_labelList(Tango::Attribute &attr);
/**
* Read/Write allowed for labelList attribute.
*/
virtual bool is_labelList_allowed(Tango::AttReqType type);
/**
* Execution allowed for InitializeReferencePosition command.
*/
......
......@@ -291,6 +291,26 @@ void FixedPositionsClass::device_factory(const Tango::DevVarStringArray *devlist
//-------------------------------------------------------------
}
//+----------------------------------------------------------------------------
// Method: FixedPositionsClass::attribute_factory(vector<Tango::Attr *> &att_list)
//-----------------------------------------------------------------------------
void FixedPositionsClass::attribute_factory(vector<Tango::Attr *> &att_list)
{
// Attribute : labelList
labelListAttrib *label_list = new labelListAttrib();
Tango::UserDefaultAttrProp label_list_prop;
label_list_prop.set_label("labelList");
label_list_prop.set_unit(" ");
label_list_prop.set_standard_unit(" ");
label_list_prop.set_display_unit(" ");
label_list_prop.set_format("%s");
label_list_prop.set_description("List of fixed positions names.");
label_list->set_default_properties(label_list_prop);
att_list.push_back(label_list);
// End of Automatic code generation
//-------------------------------------------------------------
}
......
......@@ -45,6 +45,18 @@ namespace FixedPositions_ns
{//=====================================
// Define classes for attributes
//=====================================
class labelListAttrib: public Tango::Attr
{
public:
labelListAttrib():Attr("labelList", Tango::DEV_STRING, Tango::READ) {};
~labelListAttrib() {};
virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att)
{(static_cast<FixedPositions *>(dev))->read_labelList(att);}
virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty)
{return (static_cast<FixedPositions *>(dev))->is_labelList_allowed(ty);}
};
//=========================================
// Define classes for commands
//=========================================
......@@ -130,6 +142,7 @@ protected:
static FixedPositionsClass *_instance;
void command_factory();
void get_class_property();
void attribute_factory(vector<Tango::Attr *> &);
void write_class_property();
void set_default_property();
string get_cvstag();
......
......@@ -49,6 +49,20 @@ static const char *RcsId = "$Id $";
namespace FixedPositions_ns
{
//+----------------------------------------------------------------------------
//
// method : FixedPositions::is_labelList_allowed
//
// description : Read/Write allowed for labelList attribute.
//
//-----------------------------------------------------------------------------
bool FixedPositions::is_labelList_allowed(Tango::AttReqType type)
{
// End of Generated Code
// Re-Start of Generated Code
return true;
}
//=================================================
// Commands Allowed Methods
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment