Skip to content
Snippets Groups Projects
Commit 72263996 authored by Florent LANGLOIS's avatar Florent LANGLOIS
Browse files

- fixed a state bug :mantis 25877

parent 0734ca2f
No related branches found
No related tags found
No related merge requests found
......@@ -164,7 +164,7 @@ namespace FemtoCurrentAmplifier_ns
attr_gain_write = 0;
dio_proxy_not_yet_created = true;
is_dio_proxy_created = false;
creates_dio_proxy();
if(femtoType == 1)// femto 100
......@@ -179,19 +179,24 @@ namespace FemtoCurrentAmplifier_ns
{
MAX_GAIN_INDEX = MAX_GAIN_INDEX_FEMTO_300-1;
}
else
{
set_state(Tango::FAULT);
set_status("Error during init device, possible values for FemtoType property are: 1,2 or 3");
}
mutex = new omni_mutex();
//- Force gain mode to LN
if(femtoType != 3 )
{
Tango::WAttribute &attr1 = dev_attr->get_w_attr_by_name("gainMode");
attr1.set_write_value(true);
write_gainMode(attr1);
Tango::WAttribute &gainMode = dev_attr->get_w_attr_by_name("gainMode");
gainMode.set_write_value(true);
write_gainMode(gainMode);
}
Tango::WAttribute &attr2 = dev_attr->get_w_attr_by_name("gain");
string mem_value = attr2.get_mem_value();
Tango::WAttribute &gain = dev_attr->get_w_attr_by_name("gain");
string mem_value = gain.get_mem_value();
attr_gain_write = XString<Tango::DevShort>::convertFromString(mem_value);
}
......@@ -366,6 +371,10 @@ namespace FemtoCurrentAmplifier_ns
//-----------------------------------------------------------------------------
void FemtoCurrentAmplifier::always_executed_hook()
{
if(!is_dio_proxy_created)
{
creates_dio_proxy();
}
}
//+----------------------------------------------------------------------------
......@@ -379,11 +388,6 @@ void FemtoCurrentAmplifier::read_attr_hardware(vector<long> &attr_list)
{
DEBUG_STREAM << "FemtoCurrentAmplifier::read_attr_hardware(vector<long> &attr_list) entering... "<< endl;
if(dio_proxy_not_yet_created)
{
creates_dio_proxy();
}
}
//+----------------------------------------------------------------------------
//
......@@ -502,10 +506,15 @@ void FemtoCurrentAmplifier::write_gain(Tango::WAttribute &attr)
if (attr_gain_write <0)
attr_gain_write = 0;
Tango::WAttribute &watt = dev_attr->get_w_attr_by_name("gain");
watt.set_write_value(attr_gain_write);
//- FL: ??? set the value on the write part ??
Tango::WAttribute &gain = dev_attr->get_w_attr_by_name("gain");
gain.set_write_value(attr_gain_write);
this->set_gain_on_dio_board(attr_gain_write);
//- force a read to overload to refresh the state
Tango::Attribute &overload = dev_attr->get_attr_by_name("overload");
read_overload(overload);
}
//+----------------------------------------------------------------------------
......@@ -929,7 +938,7 @@ void FemtoCurrentAmplifier::creates_dio_proxy()
"FemtoCurrentAmplifier::init_device"
);
dio_proxy_not_yet_created = false;
is_dio_proxy_created = true;
}
......
......@@ -342,7 +342,7 @@ protected :
short MAX_GAIN_INDEX;
bool dio_proxy_not_yet_created;
bool is_dio_proxy_created;
//- thread
omni_mutex* mutex;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment