From 615ddec167f241c028d26da373e4d978684c0eb3 Mon Sep 17 00:00:00 2001 From: Alessio Igor Bogani <alessio.bogani@elettra.eu> Date: Sun, 11 Feb 2024 17:48:23 +0100 Subject: [PATCH] Add some attributes cavityFlow, coolingRack, dummyLoadFlow, circulatorPs, circulatorArc, circulatorNotReady, circulatorLowTemp, circulatorHighTemp and vacuumFeedthroughFlow Add and a command: resetArcDetector --- src/Rfilk.cpp | 539 +++++++++++++++++++++++++++++++++++++- src/Rfilk.h | 142 ++++++++++ src/Rfilk.xmi | 132 +++++++++- src/RfilkClass.cpp | 366 +++++++++++++++++++++++++- src/RfilkClass.h | 148 +++++++++++ src/RfilkStateMachine.cpp | 245 +++++++++++++++++ 6 files changed, 1565 insertions(+), 7 deletions(-) diff --git a/src/Rfilk.cpp b/src/Rfilk.cpp index f99dac4..e9399f0 100644 --- a/src/Rfilk.cpp +++ b/src/Rfilk.cpp @@ -49,15 +49,25 @@ // The following table gives the correspondence // between command and method names. // -// Command name | Method name +// Command name | Method name //================================================================ -// State | Inherited (no method) -// Status | Inherited (no method) +// State | Inherited (no method) +// Status | Inherited (no method) +// ResetArcDetector | reset_arc_detector //================================================================ //================================================================ -// Attributes managed is: +// Attributes managed are: //================================================================ +// cavityFlow | Tango::DevBoolean Scalar +// coolingRack | Tango::DevBoolean Scalar +// dummyLoadFlow | Tango::DevBoolean Scalar +// circulatorPs | Tango::DevBoolean Scalar +// circulatorArc | Tango::DevBoolean Scalar +// circulatorNotReady | Tango::DevBoolean Scalar +// circulatorLowTemp | Tango::DevBoolean Scalar +// circulatorHighTemp | Tango::DevBoolean Scalar +// vacuumFeedthroughFlow | Tango::DevBoolean Scalar //================================================================ namespace Rfilk_ns @@ -122,8 +132,37 @@ void Rfilk::delete_device() /*----- PROTECTED REGION ID(Rfilk::delete_device) ENABLED START -----*/ /* clang-format on */ // Delete device allocated objects + if (cavityFlowDIO) + delete cavityFlowDIO; + if (coolingRackDIO) + delete coolingRackDIO; + if (dummyLoadFlowDIO) + delete dummyLoadFlowDIO; + if (circulatorPsDIO) + delete circulatorPsDIO; + if (circulatorArcDIO) + delete circulatorArcDIO; + if (circulatorNotReadyDIO) + delete circulatorNotReadyDIO; + if (circulatorLowTempDIO) + delete circulatorLowTempDIO; + if (circulatorHighTempDIO) + delete circulatorHighTempDIO; + if (vacuumFeedthroughFlowDIO) + delete vacuumFeedthroughFlowDIO; + if (resetArcDetectorDIO) + delete resetArcDetectorDIO; /* clang-format off */ /*----- PROTECTED REGION END -----*/ // Rfilk::delete_device + delete[] attr_cavityFlow_read; + delete[] attr_coolingRack_read; + delete[] attr_dummyLoadFlow_read; + delete[] attr_circulatorPs_read; + delete[] attr_circulatorArc_read; + delete[] attr_circulatorNotReady_read; + delete[] attr_circulatorLowTemp_read; + delete[] attr_circulatorHighTemp_read; + delete[] attr_vacuumFeedthroughFlow_read; } //-------------------------------------------------------- @@ -138,18 +177,273 @@ void Rfilk::init_device() /*----- PROTECTED REGION ID(Rfilk::init_device_before) ENABLED START -----*/ /* clang-format on */ // Initialization before get_device_property() call + initError.clear(); + cavityFlowDIO = coolingRackDIO = dummyLoadFlowDIO = circulatorPsDIO = + circulatorArcDIO = circulatorNotReadyDIO = circulatorLowTempDIO = + circulatorHighTempDIO = vacuumFeedthroughFlowDIO = + resetArcDetectorDIO = NULL; /* clang-format off */ /*----- PROTECTED REGION END -----*/ // Rfilk::init_device_before - // No device property to be read from database + + // Get the device properties from database + get_device_property(); + + attr_cavityFlow_read = new Tango::DevBoolean[1]; + attr_coolingRack_read = new Tango::DevBoolean[1]; + attr_dummyLoadFlow_read = new Tango::DevBoolean[1]; + attr_circulatorPs_read = new Tango::DevBoolean[1]; + attr_circulatorArc_read = new Tango::DevBoolean[1]; + attr_circulatorNotReady_read = new Tango::DevBoolean[1]; + attr_circulatorLowTemp_read = new Tango::DevBoolean[1]; + attr_circulatorHighTemp_read = new Tango::DevBoolean[1]; + attr_vacuumFeedthroughFlow_read = new Tango::DevBoolean[1]; + // No longer if mandatory property not set. + if (mandatoryNotDefined) + return; /*----- PROTECTED REGION ID(Rfilk::init_device) ENABLED START -----*/ /* clang-format on */ // Initialize device + try { + cavityFlowDIO = new DIO(cavityFlowDevice); + coolingRackDIO = new DIO(coolingRackDevice); + dummyLoadFlowDIO = new DIO(dummyLoadFlowDevice); + circulatorPsDIO = new DIO(circulatorPsDevice); + circulatorArcDIO = new DIO(circulatorArcDevice); + circulatorNotReadyDIO = new DIO(circulatorNotReadyDevice); + circulatorLowTempDIO = new DIO(circulatorLowTempDevice); + circulatorHighTempDIO = new DIO(circulatorHighTempDevice); + vacuumFeedthroughFlowDIO = new DIO(vacuumFeedthroughFlowDevice); + resetArcDetectorDIO = new DIO(resetArcDetectorDevice); + + check_state(); + } catch (Tango::DevFailed &e) { + initError = "initialization failed: " + string(e.errors[0].desc); + } catch (...) { + initError = "initialization failed: unknown error"; + } + + if (! initError.empty()) { + ERROR_STREAM << initError << endl; + set_state(Tango::UNKNOWN); + set_status(initError); + assert(false); + } else { + set_state(Tango::ON); + } + /* clang-format off */ /*----- PROTECTED REGION END -----*/ // Rfilk::init_device } +//-------------------------------------------------------- +/** + * Method : Rfilk::get_device_property() + * Description: Read database to initialize property data members. + */ +//-------------------------------------------------------- +void Rfilk::get_device_property() +{ + /*----- PROTECTED REGION ID(Rfilk::get_device_property_before) ENABLED START -----*/ + /* clang-format on */ + // Initialize property data members + /* clang-format off */ + /*----- PROTECTED REGION END -----*/ // Rfilk::get_device_property_before + + mandatoryNotDefined = false; + + // Read device properties from database. + Tango::DbData dev_prop; + dev_prop.push_back(Tango::DbDatum("CavityFlowDevice")); + dev_prop.push_back(Tango::DbDatum("CoolingRackDevice")); + dev_prop.push_back(Tango::DbDatum("DummyLoadFlowDevice")); + dev_prop.push_back(Tango::DbDatum("CirculatorPsDevice")); + dev_prop.push_back(Tango::DbDatum("CirculatorArcDevice")); + dev_prop.push_back(Tango::DbDatum("CirculatorNotReadyDevice")); + dev_prop.push_back(Tango::DbDatum("CirculatorLowTempDevice")); + dev_prop.push_back(Tango::DbDatum("CirculatorHighTempDevice")); + dev_prop.push_back(Tango::DbDatum("VacuumFeedthroughFlowDevice")); + dev_prop.push_back(Tango::DbDatum("ResetArcDetectorDevice")); + + // is there at least one property to be read ? + if (dev_prop.size()>0) + { + // Call database and extract values + if (Tango::Util::instance()->_UseDb==true) + get_db_device()->get_property(dev_prop); + + // get instance on RfilkClass to get class property + Tango::DbDatum def_prop, cl_prop; + RfilkClass *ds_class = + (static_cast<RfilkClass *>(get_device_class())); + int i = -1; + + // Try to initialize CavityFlowDevice from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> cavityFlowDevice; + else { + // Try to initialize CavityFlowDevice from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> cavityFlowDevice; + } + // And try to extract CavityFlowDevice value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> cavityFlowDevice; + // Property StartDsPath is mandatory, check if has been defined in database. + check_mandatory_property(cl_prop, dev_prop[i]); + + // Try to initialize CoolingRackDevice from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> coolingRackDevice; + else { + // Try to initialize CoolingRackDevice from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> coolingRackDevice; + } + // And try to extract CoolingRackDevice value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> coolingRackDevice; + // Property StartDsPath is mandatory, check if has been defined in database. + check_mandatory_property(cl_prop, dev_prop[i]); + + // Try to initialize DummyLoadFlowDevice from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> dummyLoadFlowDevice; + else { + // Try to initialize DummyLoadFlowDevice from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> dummyLoadFlowDevice; + } + // And try to extract DummyLoadFlowDevice value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> dummyLoadFlowDevice; + // Property StartDsPath is mandatory, check if has been defined in database. + check_mandatory_property(cl_prop, dev_prop[i]); + + // Try to initialize CirculatorPsDevice from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> circulatorPsDevice; + else { + // Try to initialize CirculatorPsDevice from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> circulatorPsDevice; + } + // And try to extract CirculatorPsDevice value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> circulatorPsDevice; + // Property StartDsPath is mandatory, check if has been defined in database. + check_mandatory_property(cl_prop, dev_prop[i]); + + // Try to initialize CirculatorArcDevice from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> circulatorArcDevice; + else { + // Try to initialize CirculatorArcDevice from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> circulatorArcDevice; + } + // And try to extract CirculatorArcDevice value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> circulatorArcDevice; + // Property StartDsPath is mandatory, check if has been defined in database. + check_mandatory_property(cl_prop, dev_prop[i]); + + // Try to initialize CirculatorNotReadyDevice from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> circulatorNotReadyDevice; + else { + // Try to initialize CirculatorNotReadyDevice from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> circulatorNotReadyDevice; + } + // And try to extract CirculatorNotReadyDevice value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> circulatorNotReadyDevice; + // Property StartDsPath is mandatory, check if has been defined in database. + check_mandatory_property(cl_prop, dev_prop[i]); + + // Try to initialize CirculatorLowTempDevice from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> circulatorLowTempDevice; + else { + // Try to initialize CirculatorLowTempDevice from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> circulatorLowTempDevice; + } + // And try to extract CirculatorLowTempDevice value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> circulatorLowTempDevice; + // Property StartDsPath is mandatory, check if has been defined in database. + check_mandatory_property(cl_prop, dev_prop[i]); + + // Try to initialize CirculatorHighTempDevice from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> circulatorHighTempDevice; + else { + // Try to initialize CirculatorHighTempDevice from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> circulatorHighTempDevice; + } + // And try to extract CirculatorHighTempDevice value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> circulatorHighTempDevice; + // Property StartDsPath is mandatory, check if has been defined in database. + check_mandatory_property(cl_prop, dev_prop[i]); + + // Try to initialize VacuumFeedthroughFlowDevice from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> vacuumFeedthroughFlowDevice; + else { + // Try to initialize VacuumFeedthroughFlowDevice from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> vacuumFeedthroughFlowDevice; + } + // And try to extract VacuumFeedthroughFlowDevice value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> vacuumFeedthroughFlowDevice; + // Property StartDsPath is mandatory, check if has been defined in database. + check_mandatory_property(cl_prop, dev_prop[i]); + + // Try to initialize ResetArcDetectorDevice from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> resetArcDetectorDevice; + else { + // Try to initialize ResetArcDetectorDevice from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> resetArcDetectorDevice; + } + // And try to extract ResetArcDetectorDevice value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> resetArcDetectorDevice; + // Property StartDsPath is mandatory, check if has been defined in database. + check_mandatory_property(cl_prop, dev_prop[i]); + + } + + /*----- PROTECTED REGION ID(Rfilk::get_device_property_after) ENABLED START -----*/ + /* clang-format on */ + // Check device property data members init + /* clang-format off */ + /*----- PROTECTED REGION END -----*/ // Rfilk::get_device_property_after +} +//-------------------------------------------------------- +/** + * Method : Rfilk::check_mandatory_property() + * Description: For mandatory properties check if defined in database. + */ +//-------------------------------------------------------- +void Rfilk::check_mandatory_property(Tango::DbDatum &class_prop, Tango::DbDatum &dev_prop) +{ + // Check if all properties are empty + if (class_prop.is_empty() && dev_prop.is_empty()) + { + TangoSys_OMemStream tms; + tms << std::endl <<"Property \'" << dev_prop.name; + if (Tango::Util::instance()->_UseDb==true) + tms << "\' is mandatory but not defined in database"; + else + tms << "\' is mandatory but cannot be defined without database"; + append_status(tms.str()); + mandatoryNotDefined = true; + /*----- PROTECTED REGION ID(Rfilk::check_mandatory_property) ENABLED START -----*/ + /* clang-format on */ + std::cerr << tms.str() << " for " << device_name << std::endl; + /* clang-format off */ + /*----- PROTECTED REGION END -----*/ // Rfilk::check_mandatory_property + } +} + //-------------------------------------------------------- /** @@ -160,9 +454,33 @@ void Rfilk::init_device() void Rfilk::always_executed_hook() { DEBUG_STREAM << "Rfilk::always_executed_hook() " << device_name << std::endl; + if (mandatoryNotDefined) + { + Tango::Except::throw_exception( + (const char *)"PROPERTY_NOT_SET", + get_status().c_str(), + (const char *)"Rfilk::always_executed_hook()"); + } /*----- PROTECTED REGION ID(Rfilk::always_executed_hook) ENABLED START -----*/ /* clang-format on */ // code always executed before all requests + if (! initError.empty()) { + ERROR_STREAM << initError << endl; + set_status(initError); + set_state(Tango::UNKNOWN); + assert(false); + return; + } + + try { + check_state(); + } catch(Tango::DevFailed &e) { + ERROR_STREAM << string(e.errors[0].desc) << endl; + set_state(Tango::UNKNOWN); + set_status(string(e.errors[0].desc)); + assert(false); + } + /* clang-format off */ /*----- PROTECTED REGION END -----*/ // Rfilk::always_executed_hook } @@ -179,10 +497,191 @@ void Rfilk::read_attr_hardware(TANGO_UNUSED(std::vector<long> &attr_list)) /*----- PROTECTED REGION ID(Rfilk::read_attr_hardware) ENABLED START -----*/ /* clang-format on */ // Add your own code + check_init(); /* clang-format off */ /*----- PROTECTED REGION END -----*/ // Rfilk::read_attr_hardware } +//-------------------------------------------------------- +/** + * Read attribute cavityFlow related method + * + * + * Data type: Tango::DevBoolean + * Attr type: Scalar + */ +//-------------------------------------------------------- +void Rfilk::read_cavityFlow(Tango::Attribute &attr) +{ + DEBUG_STREAM << "Rfilk::read_cavityFlow(Tango::Attribute &attr) entering... " << std::endl; + /*----- PROTECTED REGION ID(Rfilk::read_cavityFlow) ENABLED START -----*/ + /* clang-format on */ + // Set the attribute value + attr_cavityFlow_read[0] = cavityFlowDIO->read(); + attr.set_value(attr_cavityFlow_read); + /* clang-format off */ + /*----- PROTECTED REGION END -----*/ // Rfilk::read_cavityFlow +} +//-------------------------------------------------------- +/** + * Read attribute coolingRack related method + * + * + * Data type: Tango::DevBoolean + * Attr type: Scalar + */ +//-------------------------------------------------------- +void Rfilk::read_coolingRack(Tango::Attribute &attr) +{ + DEBUG_STREAM << "Rfilk::read_coolingRack(Tango::Attribute &attr) entering... " << std::endl; + /*----- PROTECTED REGION ID(Rfilk::read_coolingRack) ENABLED START -----*/ + /* clang-format on */ + // Set the attribute value + attr_coolingRack_read[0] = coolingRackDIO->read(); + attr.set_value(attr_coolingRack_read); + /* clang-format off */ + /*----- PROTECTED REGION END -----*/ // Rfilk::read_coolingRack +} +//-------------------------------------------------------- +/** + * Read attribute dummyLoadFlow related method + * + * + * Data type: Tango::DevBoolean + * Attr type: Scalar + */ +//-------------------------------------------------------- +void Rfilk::read_dummyLoadFlow(Tango::Attribute &attr) +{ + DEBUG_STREAM << "Rfilk::read_dummyLoadFlow(Tango::Attribute &attr) entering... " << std::endl; + /*----- PROTECTED REGION ID(Rfilk::read_dummyLoadFlow) ENABLED START -----*/ + /* clang-format on */ + // Set the attribute value + attr_dummyLoadFlow_read[0] = dummyLoadFlowDIO->read(); + attr.set_value(attr_dummyLoadFlow_read); + /* clang-format off */ + /*----- PROTECTED REGION END -----*/ // Rfilk::read_dummyLoadFlow +} +//-------------------------------------------------------- +/** + * Read attribute circulatorPs related method + * + * + * Data type: Tango::DevBoolean + * Attr type: Scalar + */ +//-------------------------------------------------------- +void Rfilk::read_circulatorPs(Tango::Attribute &attr) +{ + DEBUG_STREAM << "Rfilk::read_circulatorPs(Tango::Attribute &attr) entering... " << std::endl; + /*----- PROTECTED REGION ID(Rfilk::read_circulatorPs) ENABLED START -----*/ + /* clang-format on */ + // Set the attribute value + attr_circulatorPs_read[0] = circulatorPsDIO->read(); + attr.set_value(attr_circulatorPs_read); + /* clang-format off */ + /*----- PROTECTED REGION END -----*/ // Rfilk::read_circulatorPs +} +//-------------------------------------------------------- +/** + * Read attribute circulatorArc related method + * + * + * Data type: Tango::DevBoolean + * Attr type: Scalar + */ +//-------------------------------------------------------- +void Rfilk::read_circulatorArc(Tango::Attribute &attr) +{ + DEBUG_STREAM << "Rfilk::read_circulatorArc(Tango::Attribute &attr) entering... " << std::endl; + /*----- PROTECTED REGION ID(Rfilk::read_circulatorArc) ENABLED START -----*/ + /* clang-format on */ + // Set the attribute value + attr_circulatorArc_read[0] = circulatorArcDIO->read(); + attr.set_value(attr_circulatorArc_read); + /* clang-format off */ + /*----- PROTECTED REGION END -----*/ // Rfilk::read_circulatorArc +} +//-------------------------------------------------------- +/** + * Read attribute circulatorNotReady related method + * + * + * Data type: Tango::DevBoolean + * Attr type: Scalar + */ +//-------------------------------------------------------- +void Rfilk::read_circulatorNotReady(Tango::Attribute &attr) +{ + DEBUG_STREAM << "Rfilk::read_circulatorNotReady(Tango::Attribute &attr) entering... " << std::endl; + /*----- PROTECTED REGION ID(Rfilk::read_circulatorNotReady) ENABLED START -----*/ + /* clang-format on */ + // Set the attribute value + attr_circulatorNotReady_read[0] = circulatorNotReadyDIO->read(); + attr.set_value(attr_circulatorNotReady_read); + /* clang-format off */ + /*----- PROTECTED REGION END -----*/ // Rfilk::read_circulatorNotReady +} +//-------------------------------------------------------- +/** + * Read attribute circulatorLowTemp related method + * + * + * Data type: Tango::DevBoolean + * Attr type: Scalar + */ +//-------------------------------------------------------- +void Rfilk::read_circulatorLowTemp(Tango::Attribute &attr) +{ + DEBUG_STREAM << "Rfilk::read_circulatorLowTemp(Tango::Attribute &attr) entering... " << std::endl; + /*----- PROTECTED REGION ID(Rfilk::read_circulatorLowTemp) ENABLED START -----*/ + /* clang-format on */ + // Set the attribute value + attr_circulatorLowTemp_read[0] = circulatorLowTempDIO->read(); + attr.set_value(attr_circulatorLowTemp_read); + /* clang-format off */ + /*----- PROTECTED REGION END -----*/ // Rfilk::read_circulatorLowTemp +} +//-------------------------------------------------------- +/** + * Read attribute circulatorHighTemp related method + * + * + * Data type: Tango::DevBoolean + * Attr type: Scalar + */ +//-------------------------------------------------------- +void Rfilk::read_circulatorHighTemp(Tango::Attribute &attr) +{ + DEBUG_STREAM << "Rfilk::read_circulatorHighTemp(Tango::Attribute &attr) entering... " << std::endl; + /*----- PROTECTED REGION ID(Rfilk::read_circulatorHighTemp) ENABLED START -----*/ + /* clang-format on */ + // Set the attribute value + attr_circulatorHighTemp_read[0] = circulatorHighTempDIO->read(); + attr.set_value(attr_circulatorHighTemp_read); + /* clang-format off */ + /*----- PROTECTED REGION END -----*/ // Rfilk::read_circulatorHighTemp +} +//-------------------------------------------------------- +/** + * Read attribute vacuumFeedthroughFlow related method + * + * + * Data type: Tango::DevBoolean + * Attr type: Scalar + */ +//-------------------------------------------------------- +void Rfilk::read_vacuumFeedthroughFlow(Tango::Attribute &attr) +{ + DEBUG_STREAM << "Rfilk::read_vacuumFeedthroughFlow(Tango::Attribute &attr) entering... " << std::endl; + /*----- PROTECTED REGION ID(Rfilk::read_vacuumFeedthroughFlow) ENABLED START -----*/ + /* clang-format on */ + // Set the attribute value + attr_vacuumFeedthroughFlow_read[0] = vacuumFeedthroughFlowDIO->read(); + attr.set_value(attr_vacuumFeedthroughFlow_read); + /* clang-format off */ + /*----- PROTECTED REGION END -----*/ // Rfilk::read_vacuumFeedthroughFlow +} //-------------------------------------------------------- /** @@ -200,6 +699,25 @@ void Rfilk::add_dynamic_attributes() /*----- PROTECTED REGION END -----*/ // Rfilk::add_dynamic_attributes } +//-------------------------------------------------------- +/** + * Command ResetArcDetector related method + * Description: Reset Arc Detector + * + */ +//-------------------------------------------------------- +void Rfilk::reset_arc_detector() +{ + DEBUG_STREAM << "Rfilk::ResetArcDetector() - " << device_name << std::endl; + /*----- PROTECTED REGION ID(Rfilk::reset_arc_detector) ENABLED START -----*/ + /* clang-format on */ + + // Add your own code + check_init(); + resetArcDetectorDIO->pulse(100); + /* clang-format off */ + /*----- PROTECTED REGION END -----*/ // Rfilk::reset_arc_detector +} //-------------------------------------------------------- /** * Method : Rfilk::add_dynamic_commands() @@ -219,6 +737,17 @@ void Rfilk::add_dynamic_commands() /*----- PROTECTED REGION ID(Rfilk::namespace_ending) ENABLED START -----*/ /* clang-format on */ // Additional Methods +void Rfilk::check_init() +{ + if (! initError.empty()) + Tango::Except::throw_exception( "", + initError.c_str(), + "Rfilk::check_init()"); +} + +void Rfilk::check_state() +{ +} /* clang-format off */ /*----- PROTECTED REGION END -----*/ // Rfilk::namespace_ending } // namespace diff --git a/src/Rfilk.h b/src/Rfilk.h index 6920d1c..1422f17 100644 --- a/src/Rfilk.h +++ b/src/Rfilk.h @@ -36,6 +36,10 @@ #include <tango.h> +#include "dio.h" +#include "adc.h" +#include "dac.h" + /* clang-format off */ /*----- PROTECTED REGION END -----*/ // Rfilk.h @@ -69,10 +73,49 @@ class Rfilk : public TANGO_BASE_CLASS /*----- PROTECTED REGION ID(Rfilk::Data Members) ENABLED START -----*/ /* clang-format on */ // Add your own data members + string initError; + DIO *cavityFlowDIO, *coolingRackDIO, *dummyLoadFlowDIO, *circulatorPsDIO, + *circulatorArcDIO, *circulatorNotReadyDIO, *circulatorLowTempDIO, + *circulatorHighTempDIO, *vacuumFeedthroughFlowDIO, *resetArcDetectorDIO; /* clang-format off */ /*----- PROTECTED REGION END -----*/ // Rfilk::Data Members +// Device property data members +public: + // CavityFlowDevice: + std::string cavityFlowDevice; + // CoolingRackDevice: + std::string coolingRackDevice; + // DummyLoadFlowDevice: + std::string dummyLoadFlowDevice; + // CirculatorPsDevice: + std::string circulatorPsDevice; + // CirculatorArcDevice: + std::string circulatorArcDevice; + // CirculatorNotReadyDevice: + std::string circulatorNotReadyDevice; + // CirculatorLowTempDevice: + std::string circulatorLowTempDevice; + // CirculatorHighTempDevice: + std::string circulatorHighTempDevice; + // VacuumFeedthroughFlowDevice: + std::string vacuumFeedthroughFlowDevice; + // ResetArcDetectorDevice: + std::string resetArcDetectorDevice; + + bool mandatoryNotDefined; +// Attribute data members +public: + Tango::DevBoolean *attr_cavityFlow_read; + Tango::DevBoolean *attr_coolingRack_read; + Tango::DevBoolean *attr_dummyLoadFlow_read; + Tango::DevBoolean *attr_circulatorPs_read; + Tango::DevBoolean *attr_circulatorArc_read; + Tango::DevBoolean *attr_circulatorNotReady_read; + Tango::DevBoolean *attr_circulatorLowTemp_read; + Tango::DevBoolean *attr_circulatorHighTemp_read; + Tango::DevBoolean *attr_vacuumFeedthroughFlow_read; // Constructors and destructors public: @@ -114,11 +157,19 @@ public: * Initialize the device */ virtual void init_device(); + /* + * Read the device properties from database + */ + void get_device_property(); /* * Always executed method before execution command method. */ virtual void always_executed_hook(); + /* + * Check if mandatory property has been set + */ + void check_mandatory_property(Tango::DbDatum &class_prop, Tango::DbDatum &dev_prop); // Attribute methods public: @@ -130,6 +181,88 @@ public: //-------------------------------------------------------- virtual void read_attr_hardware(std::vector<long> &attr_list); +/** + * Attribute cavityFlow related methods + * + * + * Data type: Tango::DevBoolean + * Attr type: Scalar + */ + virtual void read_cavityFlow(Tango::Attribute &attr); + virtual bool is_cavityFlow_allowed(Tango::AttReqType type); +/** + * Attribute coolingRack related methods + * + * + * Data type: Tango::DevBoolean + * Attr type: Scalar + */ + virtual void read_coolingRack(Tango::Attribute &attr); + virtual bool is_coolingRack_allowed(Tango::AttReqType type); +/** + * Attribute dummyLoadFlow related methods + * + * + * Data type: Tango::DevBoolean + * Attr type: Scalar + */ + virtual void read_dummyLoadFlow(Tango::Attribute &attr); + virtual bool is_dummyLoadFlow_allowed(Tango::AttReqType type); +/** + * Attribute circulatorPs related methods + * + * + * Data type: Tango::DevBoolean + * Attr type: Scalar + */ + virtual void read_circulatorPs(Tango::Attribute &attr); + virtual bool is_circulatorPs_allowed(Tango::AttReqType type); +/** + * Attribute circulatorArc related methods + * + * + * Data type: Tango::DevBoolean + * Attr type: Scalar + */ + virtual void read_circulatorArc(Tango::Attribute &attr); + virtual bool is_circulatorArc_allowed(Tango::AttReqType type); +/** + * Attribute circulatorNotReady related methods + * + * + * Data type: Tango::DevBoolean + * Attr type: Scalar + */ + virtual void read_circulatorNotReady(Tango::Attribute &attr); + virtual bool is_circulatorNotReady_allowed(Tango::AttReqType type); +/** + * Attribute circulatorLowTemp related methods + * + * + * Data type: Tango::DevBoolean + * Attr type: Scalar + */ + virtual void read_circulatorLowTemp(Tango::Attribute &attr); + virtual bool is_circulatorLowTemp_allowed(Tango::AttReqType type); +/** + * Attribute circulatorHighTemp related methods + * + * + * Data type: Tango::DevBoolean + * Attr type: Scalar + */ + virtual void read_circulatorHighTemp(Tango::Attribute &attr); + virtual bool is_circulatorHighTemp_allowed(Tango::AttReqType type); +/** + * Attribute vacuumFeedthroughFlow related methods + * + * + * Data type: Tango::DevBoolean + * Attr type: Scalar + */ + virtual void read_vacuumFeedthroughFlow(Tango::Attribute &attr); + virtual bool is_vacuumFeedthroughFlow_allowed(Tango::AttReqType type); + //-------------------------------------------------------- /** @@ -144,6 +277,13 @@ public: // Command related methods public: + /** + * Command ResetArcDetector related method + * Description: Reset Arc Detector + * + */ + virtual void reset_arc_detector(); + virtual bool is_ResetArcDetector_allowed(const CORBA::Any &any); //-------------------------------------------------------- @@ -157,6 +297,8 @@ public: /*----- PROTECTED REGION ID(Rfilk::Additional Method prototypes) ENABLED START -----*/ /* clang-format on */ // Additional Method prototypes + void check_init(); + void check_state(); /* clang-format off */ /*----- PROTECTED REGION END -----*/ // Rfilk::Additional Method prototypes }; diff --git a/src/Rfilk.xmi b/src/Rfilk.xmi index aae0f37..f068f4c 100644 --- a/src/Rfilk.xmi +++ b/src/Rfilk.xmi @@ -1,10 +1,50 @@ <?xml version="1.0" encoding="ASCII"?> <pogoDsl:PogoSystem xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:pogoDsl="http://www.esrf.fr/tango/pogo/PogoDsl"> <classes name="Rfilk" pogoRevision="9.7"> - <description description="" title="" sourcePath="/home/alessio/Sources/git-trees/rfilk/src" language="Cpp" filestogenerate="XMI file,Code files,Protected Regions" license="GPL" copyright="" hasMandatoryProperty="false" hasConcreteProperty="false" hasAbstractCommand="false" hasAbstractAttribute="false"> + <description description="" title="" sourcePath="/home/alessio/Sources/git-trees/rfilk/src" language="Cpp" filestogenerate="XMI file,Code files,Protected Regions" license="GPL" copyright="" hasMandatoryProperty="true" hasConcreteProperty="true" hasAbstractCommand="false" hasAbstractAttribute="false"> <inheritances classname="Device_Impl" sourcePath=""/> <identification contact="at elettra.eu> - Alessio Igor Bogani <alessio.bogani" author="Alessio Igor Bogani <alessio.bogani" emailDomain="elettra.eu>" classFamily="OtherInstruments" siteSpecific="" platform="Unix Like" bus="VME" manufacturer="none" reference=""/> </description> + <deviceProperties name="CavityFlowDevice" mandatory="true" description=""> + <type xsi:type="pogoDsl:StringType"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + </deviceProperties> + <deviceProperties name="CoolingRackDevice" mandatory="true" description=""> + <type xsi:type="pogoDsl:StringType"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + </deviceProperties> + <deviceProperties name="DummyLoadFlowDevice" mandatory="true" description=""> + <type xsi:type="pogoDsl:StringType"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + </deviceProperties> + <deviceProperties name="CirculatorPsDevice" mandatory="true" description=""> + <type xsi:type="pogoDsl:StringType"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + </deviceProperties> + <deviceProperties name="CirculatorArcDevice" mandatory="true" description=""> + <type xsi:type="pogoDsl:StringType"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + </deviceProperties> + <deviceProperties name="CirculatorNotReadyDevice" mandatory="true" description=""> + <type xsi:type="pogoDsl:StringType"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + </deviceProperties> + <deviceProperties name="CirculatorLowTempDevice" mandatory="true" description=""> + <type xsi:type="pogoDsl:StringType"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + </deviceProperties> + <deviceProperties name="CirculatorHighTempDevice" mandatory="true" description=""> + <type xsi:type="pogoDsl:StringType"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + </deviceProperties> + <deviceProperties name="VacuumFeedthroughFlowDevice" mandatory="true" description=""> + <type xsi:type="pogoDsl:StringType"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + </deviceProperties> + <deviceProperties name="ResetArcDetectorDevice" mandatory="true" description=""> + <type xsi:type="pogoDsl:StringType"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + </deviceProperties> <commands name="State" description="This command gets the device state (stored in its device_state data member) and returns it to the caller." execMethod="dev_state" displayLevel="OPERATOR" polledPeriod="0"> <argin description="none"> <type xsi:type="pogoDsl:VoidType"/> @@ -23,6 +63,96 @@ </argout> <status abstract="true" inherited="true" concrete="true"/> </commands> + <commands name="ResetArcDetector" description="Reset Arc Detector" execMethod="reset_arc_detector" displayLevel="OPERATOR" polledPeriod="0" isDynamic="false"> + <argin description=""> + <type xsi:type="pogoDsl:VoidType"/> + </argin> + <argout description=""> + <type xsi:type="pogoDsl:VoidType"/> + </argout> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + <excludedStates>UNKNOWN</excludedStates> + </commands> + <attributes name="cavityFlow" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:BooleanType"/> + <changeEvent fire="false" libCheckCriteria="false"/> + <archiveEvent fire="false" libCheckCriteria="false"/> + <dataReadyEvent fire="false" libCheckCriteria="true"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + <properties description="" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + </attributes> + <attributes name="coolingRack" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:BooleanType"/> + <changeEvent fire="false" libCheckCriteria="false"/> + <archiveEvent fire="false" libCheckCriteria="false"/> + <dataReadyEvent fire="false" libCheckCriteria="true"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + <properties description="" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <readExcludedStates>UNKNOWN</readExcludedStates> + </attributes> + <attributes name="dummyLoadFlow" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:BooleanType"/> + <changeEvent fire="false" libCheckCriteria="false"/> + <archiveEvent fire="false" libCheckCriteria="false"/> + <dataReadyEvent fire="false" libCheckCriteria="true"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + <properties description="" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <readExcludedStates>UNKNOWN</readExcludedStates> + </attributes> + <attributes name="circulatorPs" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:BooleanType"/> + <changeEvent fire="false" libCheckCriteria="false"/> + <archiveEvent fire="false" libCheckCriteria="false"/> + <dataReadyEvent fire="false" libCheckCriteria="true"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + <properties description="" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <readExcludedStates>UNKNOWN</readExcludedStates> + </attributes> + <attributes name="circulatorArc" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:BooleanType"/> + <changeEvent fire="false" libCheckCriteria="false"/> + <archiveEvent fire="false" libCheckCriteria="false"/> + <dataReadyEvent fire="false" libCheckCriteria="true"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + <properties description="" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <readExcludedStates>UNKNOWN</readExcludedStates> + </attributes> + <attributes name="circulatorNotReady" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:BooleanType"/> + <changeEvent fire="false" libCheckCriteria="false"/> + <archiveEvent fire="false" libCheckCriteria="false"/> + <dataReadyEvent fire="false" libCheckCriteria="true"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + <properties description="" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <readExcludedStates>UNKNOWN</readExcludedStates> + </attributes> + <attributes name="circulatorLowTemp" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:BooleanType"/> + <changeEvent fire="false" libCheckCriteria="false"/> + <archiveEvent fire="false" libCheckCriteria="false"/> + <dataReadyEvent fire="false" libCheckCriteria="true"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + <properties description="" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <readExcludedStates>UNKNOWN</readExcludedStates> + </attributes> + <attributes name="circulatorHighTemp" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:BooleanType"/> + <changeEvent fire="false" libCheckCriteria="false"/> + <archiveEvent fire="false" libCheckCriteria="false"/> + <dataReadyEvent fire="false" libCheckCriteria="true"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + <properties description="" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <readExcludedStates>UNKNOWN</readExcludedStates> + </attributes> + <attributes name="vacuumFeedthroughFlow" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:BooleanType"/> + <changeEvent fire="false" libCheckCriteria="false"/> + <archiveEvent fire="false" libCheckCriteria="false"/> + <dataReadyEvent fire="false" libCheckCriteria="true"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + <properties description="" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <readExcludedStates>UNKNOWN</readExcludedStates> + </attributes> <states name="ON" description=""> <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> </states> diff --git a/src/RfilkClass.cpp b/src/RfilkClass.cpp index cb12807..83afa94 100644 --- a/src/RfilkClass.cpp +++ b/src/RfilkClass.cpp @@ -154,6 +154,24 @@ RfilkClass *RfilkClass::instance() //=================================================================== // Command execution method calls //=================================================================== +//-------------------------------------------------------- +/** + * method : ResetArcDetectorClass::execute() + * description : method to trigger the execution of the command. + * + * @param device The device on which the command must be executed + * @param in_any The command input data + * + * returns The command output data (packed in the Any object) + */ +//-------------------------------------------------------- +CORBA::Any *ResetArcDetectorClass::execute(Tango::DeviceImpl *device, TANGO_UNUSED(const CORBA::Any &in_any)) +{ + TANGO_LOG_INFO << "ResetArcDetectorClass::execute(): arrived" << std::endl; + ((static_cast<Rfilk *>(device))->reset_arc_detector()); + return new CORBA::Any(); +} + //=================================================================== // Properties management @@ -223,6 +241,136 @@ void RfilkClass::set_default_property() // Set Default Class Properties // Set Default device Properties + prop_name = "CavityFlowDevice"; + prop_desc = ""; + prop_def = ""; + vect_data.clear(); + if (prop_def.length()>0) + { + Tango::DbDatum data(prop_name); + data << vect_data ; + dev_def_prop.push_back(data); + add_wiz_dev_prop(prop_name, prop_desc, prop_def); + } + else + add_wiz_dev_prop(prop_name, prop_desc); + prop_name = "CoolingRackDevice"; + prop_desc = ""; + prop_def = ""; + vect_data.clear(); + if (prop_def.length()>0) + { + Tango::DbDatum data(prop_name); + data << vect_data ; + dev_def_prop.push_back(data); + add_wiz_dev_prop(prop_name, prop_desc, prop_def); + } + else + add_wiz_dev_prop(prop_name, prop_desc); + prop_name = "DummyLoadFlowDevice"; + prop_desc = ""; + prop_def = ""; + vect_data.clear(); + if (prop_def.length()>0) + { + Tango::DbDatum data(prop_name); + data << vect_data ; + dev_def_prop.push_back(data); + add_wiz_dev_prop(prop_name, prop_desc, prop_def); + } + else + add_wiz_dev_prop(prop_name, prop_desc); + prop_name = "CirculatorPsDevice"; + prop_desc = ""; + prop_def = ""; + vect_data.clear(); + if (prop_def.length()>0) + { + Tango::DbDatum data(prop_name); + data << vect_data ; + dev_def_prop.push_back(data); + add_wiz_dev_prop(prop_name, prop_desc, prop_def); + } + else + add_wiz_dev_prop(prop_name, prop_desc); + prop_name = "CirculatorArcDevice"; + prop_desc = ""; + prop_def = ""; + vect_data.clear(); + if (prop_def.length()>0) + { + Tango::DbDatum data(prop_name); + data << vect_data ; + dev_def_prop.push_back(data); + add_wiz_dev_prop(prop_name, prop_desc, prop_def); + } + else + add_wiz_dev_prop(prop_name, prop_desc); + prop_name = "CirculatorNotReadyDevice"; + prop_desc = ""; + prop_def = ""; + vect_data.clear(); + if (prop_def.length()>0) + { + Tango::DbDatum data(prop_name); + data << vect_data ; + dev_def_prop.push_back(data); + add_wiz_dev_prop(prop_name, prop_desc, prop_def); + } + else + add_wiz_dev_prop(prop_name, prop_desc); + prop_name = "CirculatorLowTempDevice"; + prop_desc = ""; + prop_def = ""; + vect_data.clear(); + if (prop_def.length()>0) + { + Tango::DbDatum data(prop_name); + data << vect_data ; + dev_def_prop.push_back(data); + add_wiz_dev_prop(prop_name, prop_desc, prop_def); + } + else + add_wiz_dev_prop(prop_name, prop_desc); + prop_name = "CirculatorHighTempDevice"; + prop_desc = ""; + prop_def = ""; + vect_data.clear(); + if (prop_def.length()>0) + { + Tango::DbDatum data(prop_name); + data << vect_data ; + dev_def_prop.push_back(data); + add_wiz_dev_prop(prop_name, prop_desc, prop_def); + } + else + add_wiz_dev_prop(prop_name, prop_desc); + prop_name = "VacuumFeedthroughFlowDevice"; + prop_desc = ""; + prop_def = ""; + vect_data.clear(); + if (prop_def.length()>0) + { + Tango::DbDatum data(prop_name); + data << vect_data ; + dev_def_prop.push_back(data); + add_wiz_dev_prop(prop_name, prop_desc, prop_def); + } + else + add_wiz_dev_prop(prop_name, prop_desc); + prop_name = "ResetArcDetectorDevice"; + prop_desc = ""; + prop_def = ""; + vect_data.clear(); + if (prop_def.length()>0) + { + Tango::DbDatum data(prop_name); + data << vect_data ; + dev_def_prop.push_back(data); + add_wiz_dev_prop(prop_name, prop_desc, prop_def); + } + else + add_wiz_dev_prop(prop_name, prop_desc); } //-------------------------------------------------------- @@ -321,13 +469,220 @@ void RfilkClass::device_factory(const Tango::DevVarStringArray *devlist_ptr) * and store them in the attribute list */ //-------------------------------------------------------- -void RfilkClass::attribute_factory(std::vector<Tango::Attr *> &) +void RfilkClass::attribute_factory(std::vector<Tango::Attr *> &att_list) { /*----- PROTECTED REGION ID(RfilkClass::attribute_factory_before) ENABLED START -----*/ /* clang-format on */ // Add your own code /* clang-format off */ /*----- PROTECTED REGION END -----*/ // RfilkClass::attribute_factory_before + // Attribute : cavityFlow + cavityFlowAttrib *cavityflow = new cavityFlowAttrib(); + Tango::UserDefaultAttrProp cavityflow_prop; + // description not set for cavityFlow + // label not set for cavityFlow + // unit not set for cavityFlow + // standard_unit not set for cavityFlow + // display_unit not set for cavityFlow + // format not set for cavityFlow + // max_value not set for cavityFlow + // min_value not set for cavityFlow + // max_alarm not set for cavityFlow + // min_alarm not set for cavityFlow + // max_warning not set for cavityFlow + // min_warning not set for cavityFlow + // delta_t not set for cavityFlow + // delta_val not set for cavityFlow + cavityflow->set_default_properties(cavityflow_prop); + // Not Polled + cavityflow->set_disp_level(Tango::OPERATOR); + // Not Memorized + att_list.push_back(cavityflow); + + // Attribute : coolingRack + coolingRackAttrib *coolingrack = new coolingRackAttrib(); + Tango::UserDefaultAttrProp coolingrack_prop; + // description not set for coolingRack + // label not set for coolingRack + // unit not set for coolingRack + // standard_unit not set for coolingRack + // display_unit not set for coolingRack + // format not set for coolingRack + // max_value not set for coolingRack + // min_value not set for coolingRack + // max_alarm not set for coolingRack + // min_alarm not set for coolingRack + // max_warning not set for coolingRack + // min_warning not set for coolingRack + // delta_t not set for coolingRack + // delta_val not set for coolingRack + coolingrack->set_default_properties(coolingrack_prop); + // Not Polled + coolingrack->set_disp_level(Tango::OPERATOR); + // Not Memorized + att_list.push_back(coolingrack); + + // Attribute : dummyLoadFlow + dummyLoadFlowAttrib *dummyloadflow = new dummyLoadFlowAttrib(); + Tango::UserDefaultAttrProp dummyloadflow_prop; + // description not set for dummyLoadFlow + // label not set for dummyLoadFlow + // unit not set for dummyLoadFlow + // standard_unit not set for dummyLoadFlow + // display_unit not set for dummyLoadFlow + // format not set for dummyLoadFlow + // max_value not set for dummyLoadFlow + // min_value not set for dummyLoadFlow + // max_alarm not set for dummyLoadFlow + // min_alarm not set for dummyLoadFlow + // max_warning not set for dummyLoadFlow + // min_warning not set for dummyLoadFlow + // delta_t not set for dummyLoadFlow + // delta_val not set for dummyLoadFlow + dummyloadflow->set_default_properties(dummyloadflow_prop); + // Not Polled + dummyloadflow->set_disp_level(Tango::OPERATOR); + // Not Memorized + att_list.push_back(dummyloadflow); + + // Attribute : circulatorPs + circulatorPsAttrib *circulatorps = new circulatorPsAttrib(); + Tango::UserDefaultAttrProp circulatorps_prop; + // description not set for circulatorPs + // label not set for circulatorPs + // unit not set for circulatorPs + // standard_unit not set for circulatorPs + // display_unit not set for circulatorPs + // format not set for circulatorPs + // max_value not set for circulatorPs + // min_value not set for circulatorPs + // max_alarm not set for circulatorPs + // min_alarm not set for circulatorPs + // max_warning not set for circulatorPs + // min_warning not set for circulatorPs + // delta_t not set for circulatorPs + // delta_val not set for circulatorPs + circulatorps->set_default_properties(circulatorps_prop); + // Not Polled + circulatorps->set_disp_level(Tango::OPERATOR); + // Not Memorized + att_list.push_back(circulatorps); + + // Attribute : circulatorArc + circulatorArcAttrib *circulatorarc = new circulatorArcAttrib(); + Tango::UserDefaultAttrProp circulatorarc_prop; + // description not set for circulatorArc + // label not set for circulatorArc + // unit not set for circulatorArc + // standard_unit not set for circulatorArc + // display_unit not set for circulatorArc + // format not set for circulatorArc + // max_value not set for circulatorArc + // min_value not set for circulatorArc + // max_alarm not set for circulatorArc + // min_alarm not set for circulatorArc + // max_warning not set for circulatorArc + // min_warning not set for circulatorArc + // delta_t not set for circulatorArc + // delta_val not set for circulatorArc + circulatorarc->set_default_properties(circulatorarc_prop); + // Not Polled + circulatorarc->set_disp_level(Tango::OPERATOR); + // Not Memorized + att_list.push_back(circulatorarc); + + // Attribute : circulatorNotReady + circulatorNotReadyAttrib *circulatornotready = new circulatorNotReadyAttrib(); + Tango::UserDefaultAttrProp circulatornotready_prop; + // description not set for circulatorNotReady + // label not set for circulatorNotReady + // unit not set for circulatorNotReady + // standard_unit not set for circulatorNotReady + // display_unit not set for circulatorNotReady + // format not set for circulatorNotReady + // max_value not set for circulatorNotReady + // min_value not set for circulatorNotReady + // max_alarm not set for circulatorNotReady + // min_alarm not set for circulatorNotReady + // max_warning not set for circulatorNotReady + // min_warning not set for circulatorNotReady + // delta_t not set for circulatorNotReady + // delta_val not set for circulatorNotReady + circulatornotready->set_default_properties(circulatornotready_prop); + // Not Polled + circulatornotready->set_disp_level(Tango::OPERATOR); + // Not Memorized + att_list.push_back(circulatornotready); + + // Attribute : circulatorLowTemp + circulatorLowTempAttrib *circulatorlowtemp = new circulatorLowTempAttrib(); + Tango::UserDefaultAttrProp circulatorlowtemp_prop; + // description not set for circulatorLowTemp + // label not set for circulatorLowTemp + // unit not set for circulatorLowTemp + // standard_unit not set for circulatorLowTemp + // display_unit not set for circulatorLowTemp + // format not set for circulatorLowTemp + // max_value not set for circulatorLowTemp + // min_value not set for circulatorLowTemp + // max_alarm not set for circulatorLowTemp + // min_alarm not set for circulatorLowTemp + // max_warning not set for circulatorLowTemp + // min_warning not set for circulatorLowTemp + // delta_t not set for circulatorLowTemp + // delta_val not set for circulatorLowTemp + circulatorlowtemp->set_default_properties(circulatorlowtemp_prop); + // Not Polled + circulatorlowtemp->set_disp_level(Tango::OPERATOR); + // Not Memorized + att_list.push_back(circulatorlowtemp); + + // Attribute : circulatorHighTemp + circulatorHighTempAttrib *circulatorhightemp = new circulatorHighTempAttrib(); + Tango::UserDefaultAttrProp circulatorhightemp_prop; + // description not set for circulatorHighTemp + // label not set for circulatorHighTemp + // unit not set for circulatorHighTemp + // standard_unit not set for circulatorHighTemp + // display_unit not set for circulatorHighTemp + // format not set for circulatorHighTemp + // max_value not set for circulatorHighTemp + // min_value not set for circulatorHighTemp + // max_alarm not set for circulatorHighTemp + // min_alarm not set for circulatorHighTemp + // max_warning not set for circulatorHighTemp + // min_warning not set for circulatorHighTemp + // delta_t not set for circulatorHighTemp + // delta_val not set for circulatorHighTemp + circulatorhightemp->set_default_properties(circulatorhightemp_prop); + // Not Polled + circulatorhightemp->set_disp_level(Tango::OPERATOR); + // Not Memorized + att_list.push_back(circulatorhightemp); + + // Attribute : vacuumFeedthroughFlow + vacuumFeedthroughFlowAttrib *vacuumfeedthroughflow = new vacuumFeedthroughFlowAttrib(); + Tango::UserDefaultAttrProp vacuumfeedthroughflow_prop; + // description not set for vacuumFeedthroughFlow + // label not set for vacuumFeedthroughFlow + // unit not set for vacuumFeedthroughFlow + // standard_unit not set for vacuumFeedthroughFlow + // display_unit not set for vacuumFeedthroughFlow + // format not set for vacuumFeedthroughFlow + // max_value not set for vacuumFeedthroughFlow + // min_value not set for vacuumFeedthroughFlow + // max_alarm not set for vacuumFeedthroughFlow + // min_alarm not set for vacuumFeedthroughFlow + // max_warning not set for vacuumFeedthroughFlow + // min_warning not set for vacuumFeedthroughFlow + // delta_t not set for vacuumFeedthroughFlow + // delta_val not set for vacuumFeedthroughFlow + vacuumfeedthroughflow->set_default_properties(vacuumfeedthroughflow_prop); + // Not Polled + vacuumfeedthroughflow->set_disp_level(Tango::OPERATOR); + // Not Memorized + att_list.push_back(vacuumfeedthroughflow); + // Create a list of static attributes create_static_attribute_list(get_class_attr()->get_attr_list()); @@ -373,6 +728,15 @@ void RfilkClass::command_factory() /*----- PROTECTED REGION END -----*/ // RfilkClass::command_factory_before + // Command ResetArcDetector + ResetArcDetectorClass *pResetArcDetectorCmd = + new ResetArcDetectorClass("ResetArcDetector", + Tango::DEV_VOID, Tango::DEV_VOID, + "", + "", + Tango::OPERATOR); + command_list.push_back(pResetArcDetectorCmd); + /*----- PROTECTED REGION ID(RfilkClass::command_factory_after) ENABLED START -----*/ /* clang-format on */ // Add your own code diff --git a/src/RfilkClass.h b/src/RfilkClass.h index dc08e5a..e570749 100644 --- a/src/RfilkClass.h +++ b/src/RfilkClass.h @@ -53,6 +53,154 @@ namespace Rfilk_ns /* clang-format off */ /*----- PROTECTED REGION END -----*/ // RfilkClass::classes for dynamic creation +//========================================= +// Define classes for attributes +//========================================= +// Attribute cavityFlow class definition +class cavityFlowAttrib: public Tango::Attr +{ +public: + cavityFlowAttrib():Attr("cavityFlow", + Tango::DEV_BOOLEAN, Tango::READ) {} + ~cavityFlowAttrib() {} + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<Rfilk *>(dev))->read_cavityFlow(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<Rfilk *>(dev))->is_cavityFlow_allowed(ty);} +}; + +// Attribute coolingRack class definition +class coolingRackAttrib: public Tango::Attr +{ +public: + coolingRackAttrib():Attr("coolingRack", + Tango::DEV_BOOLEAN, Tango::READ) {} + ~coolingRackAttrib() {} + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<Rfilk *>(dev))->read_coolingRack(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<Rfilk *>(dev))->is_coolingRack_allowed(ty);} +}; + +// Attribute dummyLoadFlow class definition +class dummyLoadFlowAttrib: public Tango::Attr +{ +public: + dummyLoadFlowAttrib():Attr("dummyLoadFlow", + Tango::DEV_BOOLEAN, Tango::READ) {} + ~dummyLoadFlowAttrib() {} + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<Rfilk *>(dev))->read_dummyLoadFlow(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<Rfilk *>(dev))->is_dummyLoadFlow_allowed(ty);} +}; + +// Attribute circulatorPs class definition +class circulatorPsAttrib: public Tango::Attr +{ +public: + circulatorPsAttrib():Attr("circulatorPs", + Tango::DEV_BOOLEAN, Tango::READ) {} + ~circulatorPsAttrib() {} + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<Rfilk *>(dev))->read_circulatorPs(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<Rfilk *>(dev))->is_circulatorPs_allowed(ty);} +}; + +// Attribute circulatorArc class definition +class circulatorArcAttrib: public Tango::Attr +{ +public: + circulatorArcAttrib():Attr("circulatorArc", + Tango::DEV_BOOLEAN, Tango::READ) {} + ~circulatorArcAttrib() {} + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<Rfilk *>(dev))->read_circulatorArc(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<Rfilk *>(dev))->is_circulatorArc_allowed(ty);} +}; + +// Attribute circulatorNotReady class definition +class circulatorNotReadyAttrib: public Tango::Attr +{ +public: + circulatorNotReadyAttrib():Attr("circulatorNotReady", + Tango::DEV_BOOLEAN, Tango::READ) {} + ~circulatorNotReadyAttrib() {} + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<Rfilk *>(dev))->read_circulatorNotReady(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<Rfilk *>(dev))->is_circulatorNotReady_allowed(ty);} +}; + +// Attribute circulatorLowTemp class definition +class circulatorLowTempAttrib: public Tango::Attr +{ +public: + circulatorLowTempAttrib():Attr("circulatorLowTemp", + Tango::DEV_BOOLEAN, Tango::READ) {} + ~circulatorLowTempAttrib() {} + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<Rfilk *>(dev))->read_circulatorLowTemp(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<Rfilk *>(dev))->is_circulatorLowTemp_allowed(ty);} +}; + +// Attribute circulatorHighTemp class definition +class circulatorHighTempAttrib: public Tango::Attr +{ +public: + circulatorHighTempAttrib():Attr("circulatorHighTemp", + Tango::DEV_BOOLEAN, Tango::READ) {} + ~circulatorHighTempAttrib() {} + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<Rfilk *>(dev))->read_circulatorHighTemp(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<Rfilk *>(dev))->is_circulatorHighTemp_allowed(ty);} +}; + +// Attribute vacuumFeedthroughFlow class definition +class vacuumFeedthroughFlowAttrib: public Tango::Attr +{ +public: + vacuumFeedthroughFlowAttrib():Attr("vacuumFeedthroughFlow", + Tango::DEV_BOOLEAN, Tango::READ) {} + ~vacuumFeedthroughFlowAttrib() {} + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<Rfilk *>(dev))->read_vacuumFeedthroughFlow(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<Rfilk *>(dev))->is_vacuumFeedthroughFlow_allowed(ty);} +}; + + +//========================================= +// Define classes for commands +//========================================= +// Command ResetArcDetector class definition +class ResetArcDetectorClass : public Tango::Command +{ +public: + ResetArcDetectorClass(const char *cmd_name, + Tango::CmdArgType in, + Tango::CmdArgType out, + const char *in_desc, + const char *out_desc, + Tango::DispLevel level) + :Command(cmd_name,in,out,in_desc,out_desc, level) {} + + ResetArcDetectorClass(const char *cmd_name, + Tango::CmdArgType in, + Tango::CmdArgType out) + :Command(cmd_name,in,out) {} + ~ResetArcDetectorClass() {} + + virtual CORBA::Any *execute (Tango::DeviceImpl *dev, const CORBA::Any &any); + virtual bool is_allowed (Tango::DeviceImpl *dev, const CORBA::Any &any) + {return (static_cast<Rfilk *>(dev))->is_ResetArcDetector_allowed(any);} +}; + + /** * The RfilkClass singleton definition */ diff --git a/src/RfilkStateMachine.cpp b/src/RfilkStateMachine.cpp index a2829ca..15578f9 100644 --- a/src/RfilkStateMachine.cpp +++ b/src/RfilkStateMachine.cpp @@ -51,11 +51,256 @@ namespace Rfilk_ns // Attributes Allowed Methods //================================================= +//-------------------------------------------------------- +/** + * Method : Rfilk::is_cavityFlow_allowed() + * Description: Execution allowed for cavityFlow attribute + */ +//-------------------------------------------------------- +bool Rfilk::is_cavityFlow_allowed(TANGO_UNUSED(Tango::AttReqType type)) +{ + + // Not any excluded states for cavityFlow attribute in read access. + /*----- PROTECTED REGION ID(Rfilk::cavityFlowStateAllowed_READ) ENABLED START -----*/ + /* clang-format on */ + /* clang-format off */ + /*----- PROTECTED REGION END -----*/ // Rfilk::cavityFlowStateAllowed_READ + return true; +} + +//-------------------------------------------------------- +/** + * Method : Rfilk::is_coolingRack_allowed() + * Description: Execution allowed for coolingRack attribute + */ +//-------------------------------------------------------- +bool Rfilk::is_coolingRack_allowed(TANGO_UNUSED(Tango::AttReqType type)) +{ + + // Check access type. + if ( type==Tango::READ_REQ ) + { + // Compare device state with not allowed states for READ + if (get_state()==Tango::UNKNOWN) + { + /*----- PROTECTED REGION ID(Rfilk::coolingRackStateAllowed_READ) ENABLED START -----*/ + /* clang-format on */ + /* clang-format off */ + /*----- PROTECTED REGION END -----*/ // Rfilk::coolingRackStateAllowed_READ + return false; + } + return true; + } + return true; +} + +//-------------------------------------------------------- +/** + * Method : Rfilk::is_dummyLoadFlow_allowed() + * Description: Execution allowed for dummyLoadFlow attribute + */ +//-------------------------------------------------------- +bool Rfilk::is_dummyLoadFlow_allowed(TANGO_UNUSED(Tango::AttReqType type)) +{ + + // Check access type. + if ( type==Tango::READ_REQ ) + { + // Compare device state with not allowed states for READ + if (get_state()==Tango::UNKNOWN) + { + /*----- PROTECTED REGION ID(Rfilk::dummyLoadFlowStateAllowed_READ) ENABLED START -----*/ + /* clang-format on */ + /* clang-format off */ + /*----- PROTECTED REGION END -----*/ // Rfilk::dummyLoadFlowStateAllowed_READ + return false; + } + return true; + } + return true; +} + +//-------------------------------------------------------- +/** + * Method : Rfilk::is_circulatorPs_allowed() + * Description: Execution allowed for circulatorPs attribute + */ +//-------------------------------------------------------- +bool Rfilk::is_circulatorPs_allowed(TANGO_UNUSED(Tango::AttReqType type)) +{ + + // Check access type. + if ( type==Tango::READ_REQ ) + { + // Compare device state with not allowed states for READ + if (get_state()==Tango::UNKNOWN) + { + /*----- PROTECTED REGION ID(Rfilk::circulatorPsStateAllowed_READ) ENABLED START -----*/ + /* clang-format on */ + /* clang-format off */ + /*----- PROTECTED REGION END -----*/ // Rfilk::circulatorPsStateAllowed_READ + return false; + } + return true; + } + return true; +} + +//-------------------------------------------------------- +/** + * Method : Rfilk::is_circulatorArc_allowed() + * Description: Execution allowed for circulatorArc attribute + */ +//-------------------------------------------------------- +bool Rfilk::is_circulatorArc_allowed(TANGO_UNUSED(Tango::AttReqType type)) +{ + + // Check access type. + if ( type==Tango::READ_REQ ) + { + // Compare device state with not allowed states for READ + if (get_state()==Tango::UNKNOWN) + { + /*----- PROTECTED REGION ID(Rfilk::circulatorArcStateAllowed_READ) ENABLED START -----*/ + /* clang-format on */ + /* clang-format off */ + /*----- PROTECTED REGION END -----*/ // Rfilk::circulatorArcStateAllowed_READ + return false; + } + return true; + } + return true; +} + +//-------------------------------------------------------- +/** + * Method : Rfilk::is_circulatorNotReady_allowed() + * Description: Execution allowed for circulatorNotReady attribute + */ +//-------------------------------------------------------- +bool Rfilk::is_circulatorNotReady_allowed(TANGO_UNUSED(Tango::AttReqType type)) +{ + + // Check access type. + if ( type==Tango::READ_REQ ) + { + // Compare device state with not allowed states for READ + if (get_state()==Tango::UNKNOWN) + { + /*----- PROTECTED REGION ID(Rfilk::circulatorNotReadyStateAllowed_READ) ENABLED START -----*/ + /* clang-format on */ + /* clang-format off */ + /*----- PROTECTED REGION END -----*/ // Rfilk::circulatorNotReadyStateAllowed_READ + return false; + } + return true; + } + return true; +} + +//-------------------------------------------------------- +/** + * Method : Rfilk::is_circulatorLowTemp_allowed() + * Description: Execution allowed for circulatorLowTemp attribute + */ +//-------------------------------------------------------- +bool Rfilk::is_circulatorLowTemp_allowed(TANGO_UNUSED(Tango::AttReqType type)) +{ + + // Check access type. + if ( type==Tango::READ_REQ ) + { + // Compare device state with not allowed states for READ + if (get_state()==Tango::UNKNOWN) + { + /*----- PROTECTED REGION ID(Rfilk::circulatorLowTempStateAllowed_READ) ENABLED START -----*/ + /* clang-format on */ + /* clang-format off */ + /*----- PROTECTED REGION END -----*/ // Rfilk::circulatorLowTempStateAllowed_READ + return false; + } + return true; + } + return true; +} + +//-------------------------------------------------------- +/** + * Method : Rfilk::is_circulatorHighTemp_allowed() + * Description: Execution allowed for circulatorHighTemp attribute + */ +//-------------------------------------------------------- +bool Rfilk::is_circulatorHighTemp_allowed(TANGO_UNUSED(Tango::AttReqType type)) +{ + + // Check access type. + if ( type==Tango::READ_REQ ) + { + // Compare device state with not allowed states for READ + if (get_state()==Tango::UNKNOWN) + { + /*----- PROTECTED REGION ID(Rfilk::circulatorHighTempStateAllowed_READ) ENABLED START -----*/ + /* clang-format on */ + /* clang-format off */ + /*----- PROTECTED REGION END -----*/ // Rfilk::circulatorHighTempStateAllowed_READ + return false; + } + return true; + } + return true; +} + +//-------------------------------------------------------- +/** + * Method : Rfilk::is_vacuumFeedthroughFlow_allowed() + * Description: Execution allowed for vacuumFeedthroughFlow attribute + */ +//-------------------------------------------------------- +bool Rfilk::is_vacuumFeedthroughFlow_allowed(TANGO_UNUSED(Tango::AttReqType type)) +{ + + // Check access type. + if ( type==Tango::READ_REQ ) + { + // Compare device state with not allowed states for READ + if (get_state()==Tango::UNKNOWN) + { + /*----- PROTECTED REGION ID(Rfilk::vacuumFeedthroughFlowStateAllowed_READ) ENABLED START -----*/ + /* clang-format on */ + /* clang-format off */ + /*----- PROTECTED REGION END -----*/ // Rfilk::vacuumFeedthroughFlowStateAllowed_READ + return false; + } + return true; + } + return true; +} + //================================================= // Commands Allowed Methods //================================================= +//-------------------------------------------------------- +/** + * Method : Rfilk::is_ResetArcDetector_allowed() + * Description: Execution allowed for ResetArcDetector attribute + */ +//-------------------------------------------------------- +bool Rfilk::is_ResetArcDetector_allowed(TANGO_UNUSED(const CORBA::Any &any)) +{ + // Compare device state with not allowed states. + if (get_state()==Tango::UNKNOWN) + { + /*----- PROTECTED REGION ID(Rfilk::ResetArcDetectorStateAllowed) ENABLED START -----*/ + /* clang-format on */ + /* clang-format off */ + /*----- PROTECTED REGION END -----*/ // Rfilk::ResetArcDetectorStateAllowed + return false; + } + return true; +} + /*----- PROTECTED REGION ID(Rfilk::RfilkStateAllowed.AdditionalMethods) ENABLED START -----*/ /* clang-format on */ -- GitLab