Skip to content
Snippets Groups Projects
Commit 571f8b07 authored by Alain BUTEAU's avatar Alain BUTEAU
Browse files

TANGODEVIC-1155

la commande AUTOSEARCHGAIN réclame un INIT sur ds_FemtoCurrentAmplifier
parent 9233b763
No related branches found
No related tags found
No related merge requests found
......@@ -35,6 +35,11 @@ AutoSearchGainThread::AutoSearchGainThread (FemtoCurrentAmplifier* femto_device,
start_undetached();
}
AutoSearchGainThread::~AutoSearchGainThread ()
{
DEBUG_STREAM << "DTOR: AutoSearchGainThread::~AutoSearchGainThread: entering ....!" << endl;
}
//
// AutoSearchGainThread::run_undetached
//
......@@ -42,33 +47,27 @@ void *AutoSearchGainThread::run_undetached (void *arg)
{
DEBUG_STREAM << ">>>> AutoSearchGainThread starting up!" << endl;
//- Start the Loop on Gains
for(int i = femto_device_->MAX_GAIN_INDEX;i > -1; i--)
{
//- set the gain
//mutex.lock();
Tango::WAttribute &watt = femto_device_->dev_attr->get_w_attr_by_name("gain");
watt.set_write_value((short)i);
femto_device_->write_gain(watt);
//mutex.unlock();
omni_thread::sleep(1);
omni_thread::sleep(100);
//- read Overload
//mutex.lock();
Tango::Attribute &att1 = femto_device_->dev_attr->get_attr_by_name("overload");
femto_device_->read_overload(att1);
//- Check if overload happen: 1->overload , 0->not overload
if(*(femto_device_->attr_overload_read) == 0)
{
INFO_STREAM << "Gain Found: " << i << endl;
INFO_STREAM << "Gain Found: gain value= " << i << endl;
femto_device_->set_state(Tango::ON);
femto_device_->set_status("Femto is in NORMAL operation");
return NULL;
}
else
INFO_STREAM << "Gain not Found, try with next one" << endl;
//mutex.unlock();
}
......
......@@ -982,8 +982,8 @@ void FemtoCurrentAmplifier::read_gainSelectedNum(Tango::Attribute &attr)
*/
//+------------------------------------------------------------------
void FemtoCurrentAmplifier::auto_search_gain()
{
DEBUG_STREAM << "FemtoCurrentAmplifier::auto_search_gain(): entering... !" << endl;
{
// Add your own code to control device here
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment