Commit 291340b0 authored by Graziano Scalamera's avatar Graziano Scalamera
Browse files

Fix Current write value after reconnection

parent 8dbb16d3
......@@ -474,7 +474,11 @@ if (ramping) {
Tango::DevState stmov = Tango::MOVING;
if (get_state() != stmov) {
set_state(stmov);
push_change_event("state", &stmov);
try {
push_change_event("state", &stmov);
} catch(Tango::DevFailed &e) {
INFO_STREAM << __FUNCTION__<< ": push_change_event failed, err="<<e.errors[0].desc;
}
}
return;
}
......@@ -498,7 +502,11 @@ if (abs((now.tv_sec - last_cache_update.tv_sec)*1000000+
{
Tango::DevState st = Tango::FAULT;
set_state(st);
push_change_event("state", &st);
try {
push_change_event("state", &st);
} catch(Tango::DevFailed &e) {
INFO_STREAM << __FUNCTION__<< ": push_change_event failed, err="<<e.errors[0].desc;
}
}
if((iface == ETH) || ((iface == SERIAL) && (i != (SER_STATUS_IND_DCF - 7)) && (i != (SER_STATUS_IND_LIM - 7)))) //if serial do not set fault if dc fail or limit
{
......@@ -516,7 +524,11 @@ if (abs((now.tv_sec - last_cache_update.tv_sec)*1000000+
{
Tango::DevState st = Tango::ON;
set_state(st);
push_change_event("state", &st);
try {
push_change_event("state", &st);
} catch(Tango::DevFailed &e) {
INFO_STREAM << __FUNCTION__<< ": push_change_event failed, err="<<e.errors[0].desc;
}
}
if(!cycling)
set_status(STATUS_DELTA_PW_ON);
......@@ -527,7 +539,11 @@ if (abs((now.tv_sec - last_cache_update.tv_sec)*1000000+
{
Tango::DevState st = Tango::FAULT;
set_state(st);
push_change_event("state", &st);
try {
push_change_event("state", &st);
} catch(Tango::DevFailed &e) {
INFO_STREAM << __FUNCTION__<< ": push_change_event failed, err="<<e.errors[0].desc;
}
}
set_status(STATUS_DELTA_UNDEF);
}
......@@ -537,8 +553,21 @@ if (abs((now.tv_sec - last_cache_update.tv_sec)*1000000+
if(get_state() != Tango::OFF)
{
Tango::DevState st = Tango::OFF;
set_state(st);
push_change_event("state", &st);
set_state(st);
try {
push_change_event("state", &st);
} catch(Tango::DevFailed &e) {
INFO_STREAM << __FUNCTION__<< ": push_change_event failed, err="<<e.errors[0].desc;
}
currentsetpoint = 0.0;
try {
Tango::MultiAttribute *attr_list = get_device_attr();
Tango::WAttribute *attr_set_current;
attr_set_current = &(attr_list->get_w_attr_by_name("Current"));
attr_set_current->set_write_value(currentsetpoint);
} catch(Tango::DevFailed &e) {
INFO_STREAM << __FUNCTION__<< ": set_write_value failed, err="<<e.errors[0].desc;
}
}
set_status(STATUS_DELTA_PW_OFF);
}
......@@ -547,8 +576,21 @@ if (abs((now.tv_sec - last_cache_update.tv_sec)*1000000+
if(get_state() != Tango::STANDBY)
{
Tango::DevState st = Tango::STANDBY;
set_state(st);
push_change_event("state", &st);
set_state(st);
try {
push_change_event("state", &st);
} catch(Tango::DevFailed &e) {
INFO_STREAM << __FUNCTION__<< ": push_change_event failed, err="<<e.errors[0].desc;
}
currentsetpoint = 0.0;
try {
Tango::MultiAttribute *attr_list = get_device_attr();
Tango::WAttribute *attr_set_current;
attr_set_current = &(attr_list->get_w_attr_by_name("Current"));
attr_set_current->set_write_value(currentsetpoint);
} catch(Tango::DevFailed &e) {
INFO_STREAM << __FUNCTION__<< ": set_write_value failed, err="<<e.errors[0].desc;
}
}
set_status(STATUS_DELTA_STANDBY);
}
......
Markdown is supported
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