Skip to content
Snippets Groups Projects
Commit f127a378 authored by Guillaume PICHON's avatar Guillaume PICHON
Browse files

Management of the new command HexapodPositionCurrentGet instead of...

Management of the new command HexapodPositionCurrentGet instead of GroupPositionCurrentGet for hexapod with firmware version XPS-D.
parent 29e3f0e1
No related branches found
No related tags found
No related merge requests found
......@@ -10,3 +10,4 @@ test_package/*
.cproject
build
CMakeUserPresets.json
.vscode
......@@ -173,6 +173,23 @@ void HWProxy::process_message(yat::Message& _msg) throw(Tango::DevFailed)
m_name_current_cs = "Work";
m_group_state = -1;
//- Retreiving firmware version
std::string cmd_firmware_version = "FirmwareVersionGet(char *)";
std::string reply_firmware_version;
write_read(cmd_firmware_version, reply_firmware_version);
size_t pos_sep0 = reply_firmware_version.find(',');
if(pos_sep0!= std::string::npos)
{
//The answer should in the form "0,FIRMWARE_VERSION,EndofAPI"
size_t pos_sep1 = reply_firmware_version.find(',', pos_sep0+1);
if(pos_sep1!= std::string::npos)
{
m_firmware_version = reply_firmware_version.substr(pos_sep0+1, pos_sep1-pos_sep0-1);
INFO_STREAM << "Firmware version = " << m_firmware_version << std::endl;
}
}
read_positions();
read_hxp_state();
//- initilalze memorized values to something
......@@ -770,6 +787,10 @@ bool HWProxy::read_positions()
//- commande : pour le groupe HEXAPOD de 6 axes virtuels XYZUVW
//- GroupPositionCurrentGet (HEXAPOD, double *, double *, double *, double *, double *, double *)
std::string cmd = "GroupPositionCurrentGet(" + m_conf.group_name + ", double *, double *, double *, double *, double *, double *)";
if( m_firmware_version.find("XPS-D")!=std::string::npos)
{
cmd = "HexapodPositionCurrentGet(" + m_conf.group_name + ", double *, double *, double *, double *, double *, double *)";
}
if(write_read(cmd, response))
{
......
......@@ -291,6 +291,8 @@ private:
//- the current coordinate system used to write on the Hexapod
std::string m_name_current_cs;
//- the firmware version of the hexapod
std::string m_firmware_version;
} ;
}//- namespace
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment