Skip to content
Snippets Groups Projects
Commit 48766f17 authored by Alessandro Abrami's avatar Alessandro Abrami
Browse files

2021/10/07: deleted src/Afifo.cpp src/Afifo.h src/RequestHistory.cpp src/ThisCmd.cpp

parent 9b04e9af
No related branches found
No related tags found
No related merge requests found
Subproject commit 87b72d5f50ce2a93ad93546c7988a2db2bfc920f Subproject commit 67699117c83233775cbf0d58258ed8e430e1fbf9
...@@ -466,11 +466,6 @@ public: ...@@ -466,11 +466,6 @@ public:
vector<string> getUserConfigData(const Tango::ConstDevString *w_val, int w_length); vector<string> getUserConfigData(const Tango::ConstDevString *w_val, int w_length);
bool Targets2Config(vector<Target>& trgs, vector<string>& targets); bool Targets2Config(vector<Target>& trgs, vector<string>& targets);
string ThisCmd();
void RequestHistory(Tango::DevString *extstatusattr, int *riga, string msg);
void read_RequestHistory(int *riga, int *howmany);
/*----- PROTECTED REGION END -----*/ // AxisG2Selector::Additional Method prototypes /*----- PROTECTED REGION END -----*/ // AxisG2Selector::Additional Method prototypes
}; };
......
#include "AxisG2Selector.h"
/*
Nota: solo in always_execute_hook() si puo' essere certi che bb[0] sia l'operazione corrente,
gia' a livello di esecuzione del codice del comando (ad es. get_image() ...)
questa assunzione non e' piu' certa.
Allora disogna andare nel recente passato di bb alla ricerca dell'entry con command_inout
In realta' vedo (su srv-ccd-padres-03) che nemmeno in always_execute_hook() e' garantita
la consequenzialita' e quindi l'esattezza di bb() !!!!
*/
namespace AxisG2Selector_ns {
string AxisG2Selector::ThisCmd(){
string CMD_TAG("command_inout");
string thiscmd("__XX_XX__XXX__");
std::size_t found(std::string::npos);
Tango::DevVarStringArray* bb = NULL;
struct timeval t0, t1;
float elaps;
stringstream ss;
ss.str("");
gettimeofday(&t0, NULL);
{
vector<string> vs;
try {
bb = black_box(8);
vs << (*bb);
#ifdef _DBG_BB
cout << "ThisCmd():: |" << endl;
for (vector<string>::iterator it = vs.begin(); it != vs.end(); ++it) cout << "\t__BB_IN__THISCMD__ [" << distance(vs.begin(), it) << "]: " << *it << endl;
#endif /* _DBG_BB */
for (vector<string>::iterator it = vs.begin(); (it != vs.end()) && (found==std::string::npos); ++it) {
found = (*it).find(CMD_TAG);
if ( found != std::string::npos ) {
thiscmd = *it;
} else {
ss.str("");
ss << "{" << bb->length() << "} ";
thiscmd += ss.str();
}
}
} catch (Tango::DevFailed e) {
if (e.errors.length() > 0){
thiscmd += e.errors[0].reason.in();
} else {
thiscmd += "Tango except";
}
} catch (...) {
cout << "ThisCmd()::BB:: Except!" << endl;
thiscmd += "General except";
}
if (bb != NULL ) delete bb;
}
//cout << "thiscmd=|" << thiscmd << "|" << endl;
string op(": Operation command_inout_");
found = thiscmd.find(op);
if (found!=std::string::npos) thiscmd.erase(found, op.size()+2);
op = ": Operation command_inout";
found = thiscmd.find(op);
if (found!=std::string::npos) thiscmd.erase(found, op.size()+1);
op = "from";
found = thiscmd.find(op);
if (found!=std::string::npos) thiscmd.erase(found, op.size()+1);
op = "requested from";
found = thiscmd.find(op);
if (found!=std::string::npos) thiscmd.erase(found, op.size()+1);
op = "client with";
found = thiscmd.find(op);
if (found!=std::string::npos) thiscmd.erase(found, op.size()+1);
gettimeofday(&t1, NULL);
elaps = ((float)(t1.tv_sec - t0.tv_sec))*1000 +((float)(t1.tv_usec - t0.tv_usec))/1000;
ss.str("");
ss << " [" << elaps << "ms]";
thiscmd += ss.str();
return thiscmd;
}
} //namespace
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