Skip to content
Snippets Groups Projects
Commit 90c64787 authored by Jean Coquet's avatar Jean Coquet
Browse files

fin premiere mise au point trajectoire.

Pas essaye le Start
reste a tester averc une trajectoire qui marche pour tester que le check retourne OK

reste a coder un message d'erreur le plus explicite possible pour aider l'utilisateur
parent 06cf6ca0
No related branches found
No related tags found
No related merge requests found
......@@ -1275,10 +1275,16 @@ INFO_STREAM << "HWProxy::handle_message::GROUP_DEFINE_POSITION cmd " << cmd << "
std::cout << "nb_lignes = " << nb_lignes << " taille ligne = " << taille_ligne << std::endl;
std::stringstream s;
std::string resp;
//- initializations
trajectory_stuff.traj.resize (nb_lignes);
// trajectory_stuff.traj.resize (nb_lignes);
trajectory_stuff.traj.clear ();
trajectory_stuff.origin_point.resize (conf.nb_axes);
//- parcours ligne par ligne
s << std::fixed
<< std::setprecision (5)
<< std::showpoint;
for (size_t lig = 0; lig < nb_lignes; lig++)
{
//- cas point origine
......@@ -1307,11 +1313,14 @@ std::cout << "nb_lignes = " << nb_lignes << " taille ligne = " << taille_ligne
<< tr->positions [(lig * taille_ligne) + col + 1];
}
s << ")" << std::endl;
trajectory_stuff.traj [lig] = s.str ();
trajectory_stuff.traj.push_back (s.str ());
std::cout << "Trajectory line = " << s.str () ;
}
}
//- DEBUG : ajout a la fin d'une ligne avec tout a 0
trajectory_stuff.state = TRAJ_INPUT_PROCESSED;
}
......@@ -1321,13 +1330,16 @@ std::cout << "nb_lignes = " << nb_lignes << " taille ligne = " << taille_ligne
//-----------------------------------------------
void HWProxy::trajectory_upload ()
{
DEBUG_STREAM << "HWProxy::trajectory_upload () <-" << std::endl;
INFO_STREAM << "HWProxy::trajectory_upload () <-" << std::endl;
trajectory_stuff.state = TRAJ_LOADING;
std::string resp;
if (trajectory_stuff.state != TRAJ_NOT_INITIALIZED && trajectory_stuff.state != TRAJ_INPUT_ERROR)
{
for (size_t i = 0; i < trajectory_stuff.traj.size (); i++)
{
this->write (trajectory_stuff.traj [i]);
this->write_read (trajectory_stuff.traj [i], resp);
std::cout << "HWProxy::trajectory_upload () cmd " << trajectory_stuff.traj [i] << " returned " << resp << std::endl;
}
}
trajectory_stuff.state = TRAJ_LOADED;
......@@ -1339,10 +1351,12 @@ std::cout << "nb_lignes = " << nb_lignes << " taille ligne = " << taille_ligne
//-----------------------------------------------
void HWProxy::trajectory_clear ()
{
DEBUG_STREAM << "HWProxy::trajectory_clear () <-" << std::endl;
INFO_STREAM << "HWProxy::trajectory_clear () <-" << std::endl;
std::stringstream s;
std::string resp;
s << "MultipleAxesPVTResetInMemory(" << conf.group_name << ")" << std::endl;
this->write (s.str ());
this->write_read (s.str (),resp);
std::cout << "HWProxy::trajectory_clear () cmd " << s.str () << " returned " << resp << std::endl;
}
//-----------------------------------------------
......@@ -1367,16 +1381,23 @@ std::cout << "nb_lignes = " << nb_lignes << " taille ligne = " << taille_ligne
//-MultipleAxesPVTVerification (GroupName, "FromMemory")
//- request for verification
std::stringstream cmd;
std::string resp;
cmd << "MultipleAxesPVTVerification("
<< conf.group_name
<< ",\"FromMemory\")";
this->write (cmd.str ());
<< ",FromMemory)";
this->write_read (cmd.str (),resp);
//- now check positioner by positioner
for (size_t i = 0; i < hw_data.size (); i++)
{
if (this->trajectory_check_hw_i (hw_data [i].posit_name) == false)
return false;
}
std::cout << "HWProxy::trajectory_check_hw commande <"
<< cmd.str ()
<< "> retourne ["
<< resp
<< "]"
<< std::endl;
return true;
}
......@@ -1394,16 +1415,22 @@ std::cout << "nb_lignes = " << nb_lignes << " taille ligne = " << taille_ligne
cmd << "MultipleAxesPVTVerificationResultGet("
<< conf.group_name
<< "."
<< positioner_name;
<< positioner_name
<< ",char*,double*,double*,double*,double*)";
this->write_read (cmd.str (), resp);
//- TODO : CA RENVOIE QUOI?
//- TODO : Traiter en cas d'erreur les 4 infos retornées minimum position maximum position minimum velocity maximum velocity
std::cout << "HWProxy::trajectory_check_hw_i commande <"
<< cmd.str ()
<< "> retourne ["
<< resp
<< "] CODE A TERMINER"
<< "]"
<< std::endl;
//- TODO : exception et information a l'utilisateur
if (resp[0] != '0')
return false;
return true;
}
//-----------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment