Skip to content
This repository was archived by the owner on Jul 8, 2022. It is now read-only.

Commit 92f93b4

Browse files
committed
Remove duplicated push_att_conf_events calls
1 parent 464f5b1 commit 92f93b4

File tree

1 file changed

+1
-78
lines changed

1 file changed

+1
-78
lines changed

cppapi/server/device.cpp

Lines changed: 1 addition & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -2408,15 +2408,6 @@ void DeviceImpl::set_attribute_config(const Tango::AttributeConfigList &new_conf
24082408
(const char *) "DeviceImpl::set_attribute_config");
24092409
}
24102410

2411-
//
2412-
// Get some event related data
2413-
//
2414-
2415-
Tango::Util *tg = Tango::Util::instance();
2416-
2417-
EventSupplier *event_supplier_nd = NULL;
2418-
EventSupplier *event_supplier_zmq = NULL;
2419-
24202411
//
24212412
// Update attribute config first in database, then locally
24222413
// Finally send attr conf. event
@@ -2462,75 +2453,7 @@ void DeviceImpl::set_attribute_config(const Tango::AttributeConfigList &new_conf
24622453
// Send the event
24632454
//
24642455

2465-
if (attr.use_notifd_event() == true)
2466-
{
2467-
event_supplier_nd = tg->get_notifd_event_supplier();
2468-
}
2469-
else
2470-
{
2471-
event_supplier_nd = NULL;
2472-
}
2473-
2474-
if (attr.use_zmq_event() == true)
2475-
{
2476-
event_supplier_zmq = tg->get_zmq_event_supplier();
2477-
}
2478-
else
2479-
{
2480-
event_supplier_zmq = NULL;
2481-
}
2482-
2483-
if ((event_supplier_nd != NULL) || (event_supplier_zmq != NULL))
2484-
{
2485-
std::string tmp_name(new_conf[i].name);
2486-
2487-
EventSupplier::SuppliedEventData ad;
2488-
::memset(&ad, 0, sizeof(ad));
2489-
2490-
long vers = get_dev_idl_version();
2491-
if (vers <= 2)
2492-
{
2493-
Tango::AttributeConfig_2 attr_conf_2;
2494-
attr.get_properties(attr_conf_2);
2495-
ad.attr_conf_2 = &attr_conf_2;
2496-
if (event_supplier_nd != NULL)
2497-
{
2498-
event_supplier_nd->push_att_conf_events(this, ad, (Tango::DevFailed *) NULL, tmp_name);
2499-
}
2500-
if (event_supplier_zmq != NULL)
2501-
{
2502-
event_supplier_zmq->push_att_conf_events(this, ad, (Tango::DevFailed *) NULL, tmp_name);
2503-
}
2504-
}
2505-
else if (vers <= 4)
2506-
{
2507-
Tango::AttributeConfig_3 attr_conf_3;
2508-
attr.get_properties(attr_conf_3);
2509-
ad.attr_conf_3 = &attr_conf_3;
2510-
if (event_supplier_nd != NULL)
2511-
{
2512-
event_supplier_nd->push_att_conf_events(this, ad, (Tango::DevFailed *) NULL, tmp_name);
2513-
}
2514-
if (event_supplier_zmq != NULL)
2515-
{
2516-
event_supplier_zmq->push_att_conf_events(this, ad, (Tango::DevFailed *) NULL, tmp_name);
2517-
}
2518-
}
2519-
else
2520-
{
2521-
Tango::AttributeConfig_5 attr_conf_5;
2522-
attr.get_properties(attr_conf_5);
2523-
ad.attr_conf_5 = &attr_conf_5;
2524-
if (event_supplier_nd != NULL)
2525-
{
2526-
event_supplier_nd->push_att_conf_events(this, ad, (Tango::DevFailed *) NULL, tmp_name);
2527-
}
2528-
if (event_supplier_zmq != NULL)
2529-
{
2530-
event_supplier_zmq->push_att_conf_events(this, ad, (Tango::DevFailed *) NULL, tmp_name);
2531-
}
2532-
}
2533-
}
2456+
push_att_conf_event(&attr);
25342457
}
25352458

25362459
}

0 commit comments

Comments
 (0)