diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..378ec5d1a62c274145c2f182d57408a472a7a605 --- /dev/null +++ b/Makefile @@ -0,0 +1,9 @@ +NAME_SRV = a2720-srv + +CXXFLAGS = -I../../modules/drivers/a2720 +LDFLAGS = + +include ../makefiles/Make-9.3.3.in + +test: bin/${NAME_SRV} + LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):$(SDKTARGETSYSROOT)/usr/lib $(LOADER) bin/${NAME_SRV} test -v4 diff --git a/README.md b/README.md deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/doc/A2720_Manualv3.1.1.pdf b/doc/A2720_Manualv3.1.1.pdf new file mode 100644 index 0000000000000000000000000000000000000000..48793fd4ff40085c396f4b331cde2d4fd519cc53 Binary files /dev/null and b/doc/A2720_Manualv3.1.1.pdf differ diff --git a/doc/Linee_guida_powersupply.txt b/doc/Linee_guida_powersupply.txt new file mode 100644 index 0000000000000000000000000000000000000000..224e5db4f37f26f825dc9f66615b5f23ad589e5c --- /dev/null +++ b/doc/Linee_guida_powersupply.txt @@ -0,0 +1,248 @@ +---------------------------------------------------------------------------- +Linee guida nella realizzazione di Device Server (DS) Tango per alimentatori +dei magneti +---------------------------------------------------------------------------- + + +---------------------------------------------------------------------------- +Changes: +---------------------------------------------------------------------------- +Ver 20140911 +Aggiunta specifica sulla getsione della parte setting delle attibuto Current a seconda dello State +del DS. Chirimenti sul comportamento nei vari State. + +Ver 20101214 +Aggiunta la proprieta' CycStepTime e alcune note sul suo utilizzo nella sezione +"Ciclaggio". + +Ver 20101119 +Corretti i nomi delle proprieta' ed aggiunto anche Warning nella sezione +"Configurazione del Device server". Creata una sezione "Ciclaggio" per separare +le informazioni inerenti tale procedura dalla sezione "Note" dove finiscono +tutte le informazioni di carattere generale. + +Ver 20101115 +L'attributo Voltage in scrittura e' opzionale (modificata la "Tabella della +verità Stato/Attributo"). Aggiunte alcune note su CycWaitTime e CycNumTimes. +Sia che il ciclaggio vada a buon fine o no il DS deve impostare la corrente +CycEndCurr. + +Ver 20101112 +Eliminati VoltageSet, CurrentLimit e VoltageLimit dalla lista degli attributi. +Reso piu' chiara la parte del documento riferita al ciclaggio. + +Ver 20101105 +Se le transazioni sono lunghe queste devono essere gestite con lo stato MOVING +pertanto la funzione Abort deve essere configurata solo su questo stato. Corretta +la tabella della verità Stato/Commando. + +Ver 20101018 +Aggiunto lo stato ALARM nelle sezioni "Stati", "Tabella della verità Stato/Commando" +ed in "Tabella della verità Stato/Attributo". +Aggiunta la sezione "Configurazione del Device server". + +Ver 20101008 +Prima versione rilasciata di questo documento. + + +---------------------------------------------------------------------------- +Attributi: +---------------------------------------------------------------------------- +RW DevDouble Current Legge la corrente effettivamente erogata nella + parte reading, il setpoint nella parte setting, + (vedi CurrentSet) + Scrive la corrente richiesta (setpoint) +R DevDouble Voltage Legge la tensione effettivamente erogata +R DevDouble CurrentSet Legge la corrente richiesta (setpoint impostato) +R DevBoolean[] PsStat Legge vari flag del dispositivo + + +---------------------------------------------------------------------------- +Comandi: +---------------------------------------------------------------------------- +void StartCycling Comando di ciclaggio +void Abort Abortisce il ciclaggio, le rampe (o la transazione di accensione/spegnimento : solo per alcuni modelli) +void On Accende +void Off Spenge +void Reset Recupero da uno stato di FAULT + + +---------------------------------------------------------------------------- +Stati: +---------------------------------------------------------------------------- +ON Condizione normale, il power supply eroga corrente. +OFF Condizione normale, il power supply NON eroga corrente. +FAULT Condizione anomale, dovuta a gusto del power supply, inntevento di interlock, + mancanza di comunicazione con il dispositivo, errore software nel server Tango. + La diagnostica del problema va tratta con l' attribute Status (stringhe) e/o con i bit + stato di PsStat. + L' erogazione di corrente e' INDEFINITA. +MOVING Ciclaggio o nella transazione di accensione/spegnimento. +ALARM Gestito automaticamnte da Tango nel caso vengano superati i limiti nel + range delle grandezze scalari. + +STANDBY (Opzionale) Condizione normale, equivalente a OFF. + + +---------------------------------------------------------------------------- +Tabella della verità Stato/Commando: +---------------------------------------------------------------------------- + Commando +Stato \ startCycling Abort On Off Reset +ON Y N Y Y N +OFF N N Y Y N +FAULT N N N N Y +MOVING N Y N N N +ALARM ** ** ** ** ** + +(**) Il DS deve comportarsi come se fosse nello stato che ricava dalla lettura +dello stato del dispositivo pertanto nel DS non e' richiesta nessuna gestione +particolare dello stato ALARM. + + +---------------------------------------------------------------------------- +Tabella della verità Stato/Attributo: +---------------------------------------------------------------------------- + Attributo +Stato \ Current Voltage CurrentSet PsStat +ON RW RW* R R +OFF R R R R +FAULT R R R R +MOVING R R R R +ALARM ** ** ** ** + +(*) Non tutti gli alimentatore supportano l'impostazione della tensione. +In tali caso Voltage deve risultare solamente solo in lettura cioe' R. + +(**) Il DS deve comportarsi come se fosse nello stato che ricava dalla lettura +dello stato del dispositivo pertanto nel DS non e' richiesta nessuna gestione +particolare dello stato ALARM. + + +---------------------------------------------------------------------------- +Note +---------------------------------------------------------------------------- +I commandi On() e Off() devono poter essere rieseguiti anche se il dispositivo +risulta gia' nel relativo stato (quindi eseguire On() quando lo stato +risulti gia' ON ed Off() quando lo stato risulti gia' in OFF). + +I commandi che impostano una tensione o/e una corrente non devono essere permessi +(quindi deve essere aggiunto un controllo nella State Machine del DS) quando +lo stato e' diverso da ON. Giacche' si vuole pero' essere in grado di leggere +tali valori in tutti gli stati tale modifica deve essere apportata +a mano (Pogo 6.x non permette di specificarlo). + +Il commando di Reset, eseguito con successo, puo' far rientrare solamente +lo stato di FAULT del DS. + +Il comando Abort, se eseguito durante il ciclaggio, riporta il dispositivo +nello stato di partenza (stato ON con corrente settata CycEndCurr). +Se esguito durante una rampa , lascia la corrente all' ultimo step eseguito dalla rampa. +Qualora invece venga eseguito durante la transazione di accensione/spegnimento +riporta sempre il dispositivo nello stato di OFF. + +Inoltre va aggiunto questo codice nell'inizializzazione del DS: +(esempio riferito ad un A2605, ma valido in generale) +Tango::WAttribute *attr_set_current; + +try { + Tango::MultiAttribute *attr_list = get_device_attr(); + attr_set_current = 0; + attr_set_current = &(attr_list->get_w_attr_by_name("Current")); +} +catch(...) { + INFO_STREAM << "A2605::init_device(): ERROR GETTING ATTRIBUTE" << endl; +} + +La parte setting dell' attributo Current va settato con il setpoint letto dal dispositivo negli stati in cui +si eroga corrente : ON,RUNNING; +La parte setting dell' attributo Current va settato a 0.0 negli stati in cui non si eroga corrente: OFF, STANDBY + + +Si fa nel metodo read_Current, (con l' ipotesi che lo state del device Tango sia memorizzata in _state): + +double set_curr; +if ( _state == ON || _state == RUNNING) + set_curr = set_current_from_field(); //legge il setpoint dal dispositivo +if ( _state == OFF || _state == STANDBY) + set_curr = 0.0; +if (attr_set_current) + attr_set_current->set_write_value(set_curr); + + +---------------------------------------------------------------------------- +Ciclaggio +---------------------------------------------------------------------------- +Il comando startCycling() cicla l'alimentatore tra il valore indicato da +CycMinCurr e quelle indicato da CycMaxCurr un certo numero di volte indicato +da CycNumTimes mantenendo il livello per CycWaitTime secondi. La corrente deve +variare con un rateo definito indicato da CycRampSlopeCurr. Qualora il rateo +sia forzato dal dispositivo stesso il DS puo' semplicemente ignorare +tale proprieta'. + +Prima di procedere la ciclaggio vero e proprio startCycling() deve impostare +alla partenza la corrente CycStartCurr. Parimenti una volta terminato il +ciclaggio deve impostare la corrente CycEndCurr. Se facendo cio' si genera un +cambio di stato questo non deve essere considerato per le finalita' +di CycNumTimes. + +Il DS dovra' anche memorizzare l'esito dell'ultimo ciclaggio. Se questo risulti +fallito il DS, senza comunque variare lo stato, deve riportarlo nel messaggio +testuale che ritorna all'utente da Status(). Un ciclaggio deve essere considerato +fallito sia se durante la sua esecuzione riscontri un problema sia nel caso venga +abortito con il relativo commando. Il messaggio di ciclaggio fallito deve essere +rimosso solo una volta che sia portato a termine con successo un successivo +ciclaggio. + +Ricapitolando il comportamento del comando startCycling() e' determinato dalle +seguenti proprieta' del dispositivo: + +CycMinCurr +CycMaxCurr +CycEndCurr +CycStartCurr +CycNumTimes +CycWaitTime +CycRampSlopeCurr +CycStepTime + +Nel caso di alimentatori che non supportano nativamente la rampa di salita e' +necessario simularla tramite una scalinata il cui singolo gradino deve durare +CycStepTime secondi e la cui ampiezza risulti CycRampSlopeCurr * CycStepTime. + +Si nota che l'esigenza di parametrizzare questi valori nasce dalla volonta' di +gestire sia gli alimentatori bipolari che monopolari (per esempio nei primi il +valore minimo assoluto di corrente e' 0 mentre cio' non e' vero per i secondi). + + +---------------------------------------------------------------------------- +Configurazione del Device server +---------------------------------------------------------------------------- +E' molto importante che i device siano configurati correttamente. + +Per tutti gli attributi che ricadono in grandezze analogiche devono +essere configurati le seguenti proprieta': + +Display format: Imposta implicitamente il numero di cifre significative + visualizzate, che sono una caratteristica dell' istanza del DS (Pogo). + +Value min/max: Sono una caratteristica del DS (Pogo). + +Warning min/max: Opzionalmente si possono configurare per segnalare + stati anomali che non impedisce l'operativita' (Pogo). + +Alarm min/max: Sono una caratteristica del DS. Se configurati possono + porre il device nello stato ALARM (Pogo). + +Delta time,Delta value: Usati solo per le grandezze RW. Se quanto letto + differisce da quanto impostato setting per un certo tempo il device viene + posto nello stato di ALARM (Pogo). + +Polling: Parametro molto importante per trovare il corretto bilanciamento tra + prontezza della risposta e carico prodotto dal server. Se il polling non + e' abilitato il device non puo' genenare eventi in modo automatico (Jive). + +Event: Vanno configurati per lo meno per avere un sistema di archiviazione + efficiente. Vanno stabilite le soglie che per il DS rappresentano un + variazione significativa di una grandezza scalare. Sono quindi legate + alla risoluzione e al rapporto segnale rumore (Jive). diff --git a/src/A2720.cpp b/src/A2720.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1e76d20076464e14090cdb255eea0c7e82e7266f --- /dev/null +++ b/src/A2720.cpp @@ -0,0 +1,2320 @@ +/*----- PROTECTED REGION ID(A2720.cpp) ENABLED START -----*/ +static const char *RcsId = "$Id: A2720.cpp,v 1.8 2019-05-06 08:21:47 alessio Exp $"; +//============================================================================= +// +// file : A2720.cpp +// +// description : C++ source for the A2720 class and its commands. +// The class is derived from Device. It represents the +// CORBA servant object which will be accessed from the +// network. All commands which can be executed on the +// A2720 are implemented in this file. +// +// project : +// +// This file is part of Tango device class. +// +// Tango is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Tango is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Tango. If not, see <http://www.gnu.org/licenses/>. +// +// $Author: alessio $ +// +// $Revision: 1.8 $ +// $Date: 2019-05-06 08:21:47 $ +// +// $HeadURL: $ +// +//============================================================================= +// This file is generated by POGO +// (Program Obviously used to Generate tango Object) +//============================================================================= + + +#include <A2720.h> +#include <A2720Class.h> + +#include <fcntl.h> +#include <sys/ioctl.h> +#include <cmath> + +#define MAXCONFIGLINELENGTH 256 + +/*----- PROTECTED REGION END -----*/ // A2720.cpp + +/** + * A2720 class description: + * + */ + +//================================================================ +// The following table gives the correspondence +// between command and method names. +// +// Command name | Method name +//================================================================ +// State | Inherited (no method) +// Status | Inherited (no method) +// StartCycling | start_cycling +// Abort | abort +// On | on +// Off | off +// Reset | reset +//================================================================ + +//================================================================ +// Attributes managed are: +//================================================================ +// Current | Tango::DevDouble Scalar +// Voltage | Tango::DevDouble Scalar +// CurrentSet | Tango::DevDouble Scalar +// AuxiliaryVoltage | Tango::DevDouble Scalar +// DCLinkVoltage | Tango::DevDouble Scalar +// ADCTemperature | Tango::DevFloat Scalar +// HeatsinkTemperature | Tango::DevFloat Scalar +// PRU0Firmware | Tango::DevFloat Scalar +// PRU1Firmware | Tango::DevFloat Scalar +// KPCoefficient | Tango::DevFloat Scalar +// KICoefficient | Tango::DevFloat Scalar +// KFFCoefficient | Tango::DevFloat Scalar +// SlewRate | Tango::DevFloat Scalar +// CurrentMin | Tango::DevFloat Scalar +// CurrentMax | Tango::DevFloat Scalar +// CurrentCoefficient0 | Tango::DevFloat Scalar +// CurrentCoefficient1 | Tango::DevFloat Scalar +// CurrentCoefficient2 | Tango::DevFloat Scalar +// AuxVoltageCoefficient0 | Tango::DevFloat Scalar +// AuxVoltageCoefficient1 | Tango::DevFloat Scalar +// VoltageCoefficient0 | Tango::DevFloat Scalar +// VoltageCoefficient1 | Tango::DevFloat Scalar +// DCCurrentCoefficient0 | Tango::DevFloat Scalar +// DCCurrentCoefficient1 | Tango::DevFloat Scalar +// ADCTempCoefficient0 | Tango::DevFloat Scalar +// ADCTempCoefficient1 | Tango::DevFloat Scalar +// HeatsinkTempCoefficient0 | Tango::DevFloat Scalar +// HeatsinkTempCoefficient1 | Tango::DevFloat Scalar +// SerialNumber | Tango::DevString Scalar +// Model | Tango::DevString Scalar +// CalibrationDate | Tango::DevString Scalar +// PulseDuration | Tango::DevFloat Scalar +// CurrentCoefficient3 | Tango::DevFloat Scalar +// DCurr | Tango::DevDouble Scalar +// CurrentCoefficient4 | Tango::DevFloat Scalar +// CurrentCoefficient5 | Tango::DevFloat Scalar +// PsStat | Tango::DevBoolean Spectrum ( max = 10) +//================================================================ + +namespace A2720_ns +{ +/*----- PROTECTED REGION ID(A2720::namespace_starting) ENABLED START -----*/ + +// static initializations + +/*----- PROTECTED REGION END -----*/ // A2720::namespace_starting + +//-------------------------------------------------------- +/** + * Method : A2720::A2720() + * Description : Constructors for a Tango device + * implementing the classA2720 + */ +//-------------------------------------------------------- +A2720::A2720(Tango::DeviceClass *cl, string &s) + : TANGO_BASE_CLASS(cl, s.c_str()) +{ + /*----- PROTECTED REGION ID(A2720::constructor_1) ENABLED START -----*/ + init_device(); + lastcycling = true; + transition = NONE; + /*----- PROTECTED REGION END -----*/ // A2720::constructor_1 +} +//-------------------------------------------------------- +A2720::A2720(Tango::DeviceClass *cl, const char *s) + : TANGO_BASE_CLASS(cl, s) +{ + /*----- PROTECTED REGION ID(A2720::constructor_2) ENABLED START -----*/ + init_device(); + lastcycling = true; + transition = NONE; + /*----- PROTECTED REGION END -----*/ // A2720::constructor_2 +} +//-------------------------------------------------------- +A2720::A2720(Tango::DeviceClass *cl, const char *s, const char *d) + : TANGO_BASE_CLASS(cl, s, d) +{ + /*----- PROTECTED REGION ID(A2720::constructor_3) ENABLED START -----*/ + init_device(); + lastcycling = true; + transition = NONE; + /*----- PROTECTED REGION END -----*/ // A2720::constructor_3 +} + +//-------------------------------------------------------- +/** + * Method : A2720::delete_device() + * Description : will be called at device destruction or at init command + */ +//-------------------------------------------------------- +void A2720::delete_device() +{ + DEBUG_STREAM << "A2720::delete_device() " << device_name << endl; + /*----- PROTECTED REGION ID(A2720::delete_device) ENABLED START -----*/ + + // Delete device allocated objects + + // Ask to the worker thread to stop + cont = false; + // Give some time to the worker thread to complete + usleep(200000); + + free(attr_Model_read[0]); + free(attr_CalibrationDate_read[0]); + free(attr_SerialNumber_read[0]); + + close(drv); + + /*----- PROTECTED REGION END -----*/ // A2720::delete_device + delete[] attr_Current_read; + delete[] attr_Voltage_read; + delete[] attr_CurrentSet_read; + delete[] attr_AuxiliaryVoltage_read; + delete[] attr_DCLinkVoltage_read; + delete[] attr_ADCTemperature_read; + delete[] attr_HeatsinkTemperature_read; + delete[] attr_PRU0Firmware_read; + delete[] attr_PRU1Firmware_read; + delete[] attr_KPCoefficient_read; + delete[] attr_KICoefficient_read; + delete[] attr_KFFCoefficient_read; + delete[] attr_SlewRate_read; + delete[] attr_CurrentMin_read; + delete[] attr_CurrentMax_read; + delete[] attr_CurrentCoefficient0_read; + delete[] attr_CurrentCoefficient1_read; + delete[] attr_CurrentCoefficient2_read; + delete[] attr_AuxVoltageCoefficient0_read; + delete[] attr_AuxVoltageCoefficient1_read; + delete[] attr_VoltageCoefficient0_read; + delete[] attr_VoltageCoefficient1_read; + delete[] attr_DCCurrentCoefficient0_read; + delete[] attr_DCCurrentCoefficient1_read; + delete[] attr_ADCTempCoefficient0_read; + delete[] attr_ADCTempCoefficient1_read; + delete[] attr_HeatsinkTempCoefficient0_read; + delete[] attr_HeatsinkTempCoefficient1_read; + delete[] attr_SerialNumber_read; + delete[] attr_Model_read; + delete[] attr_CalibrationDate_read; + delete[] attr_PulseDuration_read; + delete[] attr_CurrentCoefficient3_read; + delete[] attr_CurrentCoefficient4_read; + delete[] attr_CurrentCoefficient5_read; + delete[] attr_PsStat_read; +} + +//-------------------------------------------------------- +/** + * Method : A2720::init_device() + * Description : will be called at device initialization. + */ +//-------------------------------------------------------- +void A2720::init_device() +{ + DEBUG_STREAM << "A2720::init_device() create device " << device_name << endl; + /*----- PROTECTED REGION ID(A2720::init_device_before) ENABLED START -----*/ + + // Initialization before get_device_property() call + init_error.clear(); + attr_set_current = NULL; + real_state = Tango::UNKNOWN; + + /*----- PROTECTED REGION END -----*/ // A2720::init_device_before + + + // Get the device properties from database + get_device_property(); + + attr_Current_read = new Tango::DevDouble[1]; + attr_Voltage_read = new Tango::DevDouble[1]; + attr_CurrentSet_read = new Tango::DevDouble[1]; + attr_AuxiliaryVoltage_read = new Tango::DevDouble[1]; + attr_DCLinkVoltage_read = new Tango::DevDouble[1]; + attr_ADCTemperature_read = new Tango::DevFloat[1]; + attr_HeatsinkTemperature_read = new Tango::DevFloat[1]; + attr_PRU0Firmware_read = new Tango::DevFloat[1]; + attr_PRU1Firmware_read = new Tango::DevFloat[1]; + attr_KPCoefficient_read = new Tango::DevFloat[1]; + attr_KICoefficient_read = new Tango::DevFloat[1]; + attr_KFFCoefficient_read = new Tango::DevFloat[1]; + attr_SlewRate_read = new Tango::DevFloat[1]; + attr_CurrentMin_read = new Tango::DevFloat[1]; + attr_CurrentMax_read = new Tango::DevFloat[1]; + attr_CurrentCoefficient0_read = new Tango::DevFloat[1]; + attr_CurrentCoefficient1_read = new Tango::DevFloat[1]; + attr_CurrentCoefficient2_read = new Tango::DevFloat[1]; + attr_AuxVoltageCoefficient0_read = new Tango::DevFloat[1]; + attr_AuxVoltageCoefficient1_read = new Tango::DevFloat[1]; + attr_VoltageCoefficient0_read = new Tango::DevFloat[1]; + attr_VoltageCoefficient1_read = new Tango::DevFloat[1]; + attr_DCCurrentCoefficient0_read = new Tango::DevFloat[1]; + attr_DCCurrentCoefficient1_read = new Tango::DevFloat[1]; + attr_ADCTempCoefficient0_read = new Tango::DevFloat[1]; + attr_ADCTempCoefficient1_read = new Tango::DevFloat[1]; + attr_HeatsinkTempCoefficient0_read = new Tango::DevFloat[1]; + attr_HeatsinkTempCoefficient1_read = new Tango::DevFloat[1]; + attr_SerialNumber_read = new Tango::DevString[1]; + attr_Model_read = new Tango::DevString[1]; + attr_CalibrationDate_read = new Tango::DevString[1]; + attr_PulseDuration_read = new Tango::DevFloat[1]; + attr_CurrentCoefficient3_read = new Tango::DevFloat[1]; + attr_CurrentCoefficient4_read = new Tango::DevFloat[1]; + attr_CurrentCoefficient5_read = new Tango::DevFloat[1]; + attr_PsStat_read = new Tango::DevBoolean[10]; + // No longer if mandatory property not set. + if (mandatoryNotDefined) + return; + + /*----- PROTECTED REGION ID(A2720::init_device) ENABLED START -----*/ + attr_Model_read[0] = attr_CalibrationDate_read[0] + = attr_SerialNumber_read[0] = NULL; + + // Initialize device + try { + // Write PsStat's values property + Tango::DbData dbdata; + Tango::DbDatum dbdatum1("PsStat"); + dbdatum1 << (short)1; + dbdata.push_back(dbdatum1); + Tango::DbDatum dbdatum2("values"); + vector<string> str_values; + str_values.push_back("ON"); + str_values.push_back("Over current fault"); + str_values.push_back("Crow bar fault"); + str_values.push_back("DCCT fault"); + str_values.push_back("Over temperature fault"); + str_values.push_back("Cross conduction fault"); + str_values.push_back("VAUX - under voltage"); + str_values.push_back("Magnet fault"); + str_values.push_back("DC link fault actual"); + str_values.push_back("DC link warning history"); + str_values.push_back("Earth fault"); + dbdatum2 << str_values; + dbdata.push_back(dbdatum2); + db_dev->put_attribute_property(dbdata); + + // Retrieve set part of Current attribute + Tango::MultiAttribute *attr_list = get_device_attr(); + attr_set_current = &(attr_list->get_w_attr_by_name("Current")); + + // Read A2720 configuration file + FILE *file_ptr; + char buffer[MAXCONFIGLINELENGTH]; + + file_ptr = fopen("/etc/a2720.cfg", "r"); + if (!file_ptr) { + init_error = string(strerror(errno)); + Tango::Except::throw_exception("", + init_error.c_str(), + "A2720::init_device()"); + } + while (!feof(file_ptr)) + { + if (fgets(buffer,MAXCONFIGLINELENGTH, file_ptr) != NULL) + { + char *left = strtok(buffer,"="); + char *right = strtok(NULL,"\n"); + + char name[256], value[256]; + sscanf(left, "%s", name); + + size_t i; + for (i=0; i<strlen(right); ++i) { + if (! isspace(right[i])) + break; + } + strcpy(value, &right[i]); + + if (strcasecmp(name, "kp") == 0) { + } else if (strcasecmp(name, "ki") == 0) { + } else if (strcasecmp(name, "kff") == 0) { + } else if (strcasecmp(name, "slewrate") == 0) { + } else if (strcasecmp(name, "imin") == 0) { + } else if (strcasecmp(name, "imax") == 0) { + } else if (strcasecmp(name, "Iout-a0") == 0) { + } else if (strcasecmp(name, "Iout-a1") == 0) { + } else if (strcasecmp(name, "Iout-a2") == 0) { + } else if (strcasecmp(name, "Iout-a3") == 0) { + } else if (strcasecmp(name, "Iout-a4") == 0) { + } else if (strcasecmp(name, "Iout-a5") == 0) { + } else if (strcasecmp(name, "Vaux-a0") == 0) { + } else if (strcasecmp(name, "Vaux-a1") == 0) { + } else if (strcasecmp(name, "Vout-a0") == 0) { + } else if (strcasecmp(name, "Vout-a1") == 0) { + } else if (strcasecmp(name, "VDClink-a0") == 0) { + } else if (strcasecmp(name, "VDClink-a1") == 0) { + } else if (strcasecmp(name, "tempADC-a0") == 0) { + } else if (strcasecmp(name, "tempADC-a1") == 0) { + } else if (strcasecmp(name, "tempHeatsink-a0") == 0) { + } else if (strcasecmp(name, "tempHeatsink-a1") == 0) { + } else if (strcasecmp(name, "serial-number") == 0) { + attr_SerialNumber_read[0] = (char*)malloc(MAXCONFIGLINELENGTH); + strncpy(attr_SerialNumber_read[0], value, MAXCONFIGLINELENGTH); + } else if (strcasecmp(name, "calibration-date") == 0) { + attr_CalibrationDate_read[0] = (char*)malloc(MAXCONFIGLINELENGTH); + strncpy(attr_CalibrationDate_read[0], value, MAXCONFIGLINELENGTH); + } else if (strcasecmp(name, "identification-name") == 0) { + attr_Model_read[0] = (char*)malloc(MAXCONFIGLINELENGTH); + strncpy(attr_Model_read[0], value, MAXCONFIGLINELENGTH); + } else if (strcasecmp(name, "pulse-duration") == 0) { + } else { + fclose(file_ptr); + init_error = string("Invalid configuration option!"); + Tango::Except::throw_exception("", + init_error.c_str(), + "A2720::init_device()"); + } + } + } + fclose(file_ptr); + + // Open device node + if ((drv = open("/dev/a2720", O_RDWR)) == -1) { + init_error = string(strerror(errno)); + Tango::Except::throw_exception("", + init_error.c_str(), + "A2720::init_device()"); + } + // Set min and max + if (update() != 0) { + init_error = string(strerror(errno)); + Tango::Except::throw_exception("", + init_error.c_str(), + "A2720::init_device()"); + } + Tango::MultiAttrProp<Tango::DevDouble> props; + attr_list->get_attr_by_name("Current").get_properties(props); + props.min_value.set_val((double)config.output_current_min); + props.max_value.set_val((double)config.output_current_max); + attr_list->get_attr_by_name("Current").set_properties(props); + + // Read initial slewrate register value + working_ramp_step = config.output_ramp_step; + } catch (Tango::DevFailed &e) { + init_error = "Initialization failed: " + string(e.errors[0].desc); + } catch (...) { + init_error = "Initialization failed: Unknown error"; + } + + /*----- PROTECTED REGION END -----*/ // A2720::init_device +} + +//-------------------------------------------------------- +/** + * Method : A2720::get_device_property() + * Description : Read database to initialize property data members. + */ +//-------------------------------------------------------- +void A2720::get_device_property() +{ + /*----- PROTECTED REGION ID(A2720::get_device_property_before) ENABLED START -----*/ + + // Initialize property data members + + /*----- PROTECTED REGION END -----*/ // A2720::get_device_property_before + + mandatoryNotDefined = false; + + // Read device properties from database. + Tango::DbData dev_prop; + dev_prop.push_back(Tango::DbDatum("CycMinCurr")); + dev_prop.push_back(Tango::DbDatum("CycMaxCurr")); + dev_prop.push_back(Tango::DbDatum("CycEndCurr")); + dev_prop.push_back(Tango::DbDatum("CycNumTimes")); + dev_prop.push_back(Tango::DbDatum("CycWaitTime")); + dev_prop.push_back(Tango::DbDatum("CycRampSlopeCurr")); + + // 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 A2720Class to get class property + Tango::DbDatum def_prop, cl_prop; + A2720Class *ds_class = + (static_cast<A2720Class *>(get_device_class())); + int i = -1; + + // Try to initialize CycMinCurr from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> cycMinCurr; + else { + // Try to initialize CycMinCurr from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> cycMinCurr; + } + // And try to extract CycMinCurr value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> cycMinCurr; + // Property StartDsPath is mandatory, check if has been defined in database. + check_mandatory_property(cl_prop, dev_prop[i]); + + // Try to initialize CycMaxCurr from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> cycMaxCurr; + else { + // Try to initialize CycMaxCurr from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> cycMaxCurr; + } + // And try to extract CycMaxCurr value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> cycMaxCurr; + // Property StartDsPath is mandatory, check if has been defined in database. + check_mandatory_property(cl_prop, dev_prop[i]); + + // Try to initialize CycEndCurr from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> cycEndCurr; + else { + // Try to initialize CycEndCurr from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> cycEndCurr; + } + // And try to extract CycEndCurr value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> cycEndCurr; + // Property StartDsPath is mandatory, check if has been defined in database. + check_mandatory_property(cl_prop, dev_prop[i]); + + // Try to initialize CycNumTimes from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> cycNumTimes; + else { + // Try to initialize CycNumTimes from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> cycNumTimes; + } + // And try to extract CycNumTimes value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> cycNumTimes; + // Property StartDsPath is mandatory, check if has been defined in database. + check_mandatory_property(cl_prop, dev_prop[i]); + + // Try to initialize CycWaitTime from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> cycWaitTime; + else { + // Try to initialize CycWaitTime from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> cycWaitTime; + } + // And try to extract CycWaitTime value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> cycWaitTime; + // Property StartDsPath is mandatory, check if has been defined in database. + check_mandatory_property(cl_prop, dev_prop[i]); + + // Try to initialize CycRampSlopeCurr from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> cycRampSlopeCurr; + else { + // Try to initialize CycRampSlopeCurr from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> cycRampSlopeCurr; + } + // And try to extract CycRampSlopeCurr value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> cycRampSlopeCurr; + // Property StartDsPath is mandatory, check if has been defined in database. + check_mandatory_property(cl_prop, dev_prop[i]); + + } + + /*----- PROTECTED REGION ID(A2720::get_device_property_after) ENABLED START -----*/ + + // Check device property data members init + + /*----- PROTECTED REGION END -----*/ // A2720::get_device_property_after +} +//-------------------------------------------------------- +/** + * Method : A2720::check_mandatory_property() + * Description : For mandatory properties check if defined in database. + */ +//-------------------------------------------------------- +void A2720::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 << 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"; + string status(get_status()); + status += tms.str(); + set_status(status); + mandatoryNotDefined = true; + /*----- PROTECTED REGION ID(A2720::check_mandatory_property) ENABLED START -----*/ + cerr << tms.str() << " for " << device_name << endl; + + /*----- PROTECTED REGION END -----*/ // A2720::check_mandatory_property + } +} + + +//-------------------------------------------------------- +/** + * Method : A2720::always_executed_hook() + * Description : method always executed before any command is executed + */ +//-------------------------------------------------------- +void A2720::always_executed_hook() +{ + DEBUG_STREAM << "A2720::always_executed_hook() " << device_name << endl; + if (mandatoryNotDefined) + { + string status(get_status()); + Tango::Except::throw_exception( + (const char *)"PROPERTY_NOT_SET", + status.c_str(), + (const char *)"A2720::always_executed_hook()"); + } + /*----- PROTECTED REGION ID(A2720::always_executed_hook) ENABLED START -----*/ + + // code always executed before all requests + if (! init_error.empty()) { + set_state(Tango::FAULT); + real_state = Tango::FAULT; + set_status("Initialization failed: " + init_error); + return; + } + + if (update() != 0) { + set_state(Tango::FAULT); + real_state = Tango::FAULT; + set_status(string(strerror(errno))); + return; + } + + if (transition != CYCLING && working_ramp_step != config.output_ramp_step) { + ERROR_STREAM << "Restore right SlewRate" << endl; + assert(false); + config.output_ramp_step = working_ramp_step; + if (ioctl(drv, A2720_SET_CONFIG, &config) != 0) { + set_state(Tango::FAULT); + real_state = Tango::FAULT; + set_status("Trying to restore working slewrate: " + string(strerror(errno))); + return; + } + } + + if (~status.iostatus & 0x1) { + set_state(Tango::ON); + real_state = Tango::ON; + set_status("The device is in ON state"); + } else { + set_state(Tango::OFF); + real_state = Tango::OFF; + set_status("The device is in OFF state"); + } + + if (! lastcycling) + append_status(" (last cycling failed) "); + + if (~status.iostatus & 0x2000000) + append_status(" DC link warning "); + + switch(transition) { + case ONOFF: + set_state(Tango::MOVING); + real_state = Tango::MOVING; + set_status("On/Off transition..."); + if (! cont) + append_status(" aborted!"); + break; + case RAMPING: + set_state(Tango::MOVING); + real_state = Tango::MOVING; + set_status("Ramping in progress..."); + if (! cont) + append_status(" aborted!"); + break; + case CYCLING: + set_state(Tango::MOVING); + real_state = Tango::MOVING; + set_status("Cycling in progress..."); + if (! cont) + append_status(" aborted!"); + break; + case NONE: + default: + ; + } + + if (status.iostatus & 0xFDFFFFFE) { + set_state(Tango::FAULT); + real_state = Tango::FAULT; + set_status(""); + + if (status.iostatus & 0x4) + append_status("Over current "); + if (status.iostatus & 0x8) + append_status("Crow bar "); + if (status.iostatus & 0x40) + append_status("DCCT fault "); + if (status.iostatus & 0x80) + append_status("Over temperature "); + if (status.iostatus & 0x1000) + append_status("Cross conduction "); + if (status.iostatus & 0x2000) + append_status("VAUX - under voltage "); + if (status.iostatus & 0x8000) + append_status("Magnet fault "); + if (status.iostatus & 0x1000000) + append_status("DC link"); + if (status.iostatus & 0x4000000) + append_status("Earth fault "); + } + + /*----- PROTECTED REGION END -----*/ // A2720::always_executed_hook +} + +//-------------------------------------------------------- +/** + * Method : A2720::read_attr_hardware() + * Description : Hardware acquisition for attributes + */ +//-------------------------------------------------------- +void A2720::read_attr_hardware(TANGO_UNUSED(vector<long> &attr_list)) +{ + DEBUG_STREAM << "A2720::read_attr_hardware(vector<long> &attr_list) entering... " << endl; + /*----- PROTECTED REGION ID(A2720::read_attr_hardware) ENABLED START -----*/ + + // Add your own code + if (! init_error.empty()) + Tango::Except::throw_exception( "", + ("Initialization failed: " + init_error).c_str(), + "A2720::read_attr_hardware()"); + + /*----- PROTECTED REGION END -----*/ // A2720::read_attr_hardware +} +//-------------------------------------------------------- +/** + * Method : A2720::write_attr_hardware() + * Description : Hardware writing for attributes + */ +//-------------------------------------------------------- +void A2720::write_attr_hardware(TANGO_UNUSED(vector<long> &attr_list)) +{ + DEBUG_STREAM << "A2720::write_attr_hardware(vector<long> &attr_list) entering... " << endl; + /*----- PROTECTED REGION ID(A2720::write_attr_hardware) ENABLED START -----*/ + + // Add your own code + if (ioctl(drv, A2720_SET_CONFIG, &config) != 0) + Tango::Except::throw_exception( "", + strerror(errno), + "A2720::write_attr_hardware()"); + + /*----- PROTECTED REGION END -----*/ // A2720::write_attr_hardware +} + +//-------------------------------------------------------- +/** + * Read attribute Current related method + * Description: + * + * Data type: Tango::DevDouble + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::read_Current(Tango::Attribute &attr) +{ + DEBUG_STREAM << "A2720::read_Current(Tango::Attribute &attr) entering... " << endl; + /*----- PROTECTED REGION ID(A2720::read_Current) ENABLED START -----*/ + // Set the attribute value + + attr_Current_read[0] = TRUNCF(status.output_current); + attr.set_value(attr_Current_read); + + if (~status.iostatus & 0x1) + attr_set_current->set_write_value((double)config.output_current_setpoint); + else + attr_set_current->set_write_value(0.0); + + /*----- PROTECTED REGION END -----*/ // A2720::read_Current +} +//-------------------------------------------------------- +/** + * Write attribute Current related method + * Description: + * + * Data type: Tango::DevDouble + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::write_Current(Tango::WAttribute &attr) +{ + DEBUG_STREAM << "A2720::write_Current(Tango::WAttribute &attr) entering... " << endl; + // Retrieve write value + Tango::DevDouble w_val; + attr.get_write_value(w_val); + /*----- PROTECTED REGION ID(A2720::write_Current) ENABLED START -----*/ + + if (! init_error.empty()) + Tango::Except::throw_exception( "", + init_error.c_str(), + "A2720::write_Current()"); + + transition = RAMPING; + config.output_current_setpoint = (float)w_val; + worker = new A2720Worker(this); + worker->start(); + + /*----- PROTECTED REGION END -----*/ // A2720::write_Current +} +//-------------------------------------------------------- +/** + * Read attribute Voltage related method + * Description: + * + * Data type: Tango::DevDouble + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::read_Voltage(Tango::Attribute &attr) +{ + DEBUG_STREAM << "A2720::read_Voltage(Tango::Attribute &attr) entering... " << endl; + /*----- PROTECTED REGION ID(A2720::read_Voltage) ENABLED START -----*/ + // Set the attribute value + attr_Voltage_read[0] = TRUNCF(config.output_voltage_a0 + + (config.output_voltage_a1 * (float)status.output_voltage)); + attr.set_value(attr_Voltage_read); + + /*----- PROTECTED REGION END -----*/ // A2720::read_Voltage +} +//-------------------------------------------------------- +/** + * Read attribute CurrentSet related method + * Description: + * + * Data type: Tango::DevDouble + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::read_CurrentSet(Tango::Attribute &attr) +{ + DEBUG_STREAM << "A2720::read_CurrentSet(Tango::Attribute &attr) entering... " << endl; + /*----- PROTECTED REGION ID(A2720::read_CurrentSet) ENABLED START -----*/ + // Set the attribute value + attr_CurrentSet_read[0] = (double)config.output_current_setpoint; + attr.set_value(attr_CurrentSet_read); + + /*----- PROTECTED REGION END -----*/ // A2720::read_CurrentSet +} +//-------------------------------------------------------- +/** + * Read attribute AuxiliaryVoltage related method + * Description: + * + * Data type: Tango::DevDouble + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::read_AuxiliaryVoltage(Tango::Attribute &attr) +{ + DEBUG_STREAM << "A2720::read_AuxiliaryVoltage(Tango::Attribute &attr) entering... " << endl; + /*----- PROTECTED REGION ID(A2720::read_AuxiliaryVoltage) ENABLED START -----*/ + // Set the attribute value + attr_AuxiliaryVoltage_read[0] = TRUNCF(config.aux_a0 + + (config.aux_a1 * (float)status.auxiliary_voltage)); + attr.set_value(attr_AuxiliaryVoltage_read); + + /*----- PROTECTED REGION END -----*/ // A2720::read_AuxiliaryVoltage +} +//-------------------------------------------------------- +/** + * Read attribute DCLinkVoltage related method + * Description: + * + * Data type: Tango::DevDouble + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::read_DCLinkVoltage(Tango::Attribute &attr) +{ + DEBUG_STREAM << "A2720::read_DCLinkVoltage(Tango::Attribute &attr) entering... " << endl; + /*----- PROTECTED REGION ID(A2720::read_DCLinkVoltage) ENABLED START -----*/ + // Set the attribute value + attr_DCLinkVoltage_read[0] = TRUNCF(config.dc_a0 + + (config.dc_a1 * (float)status.dclink_voltage)); + attr.set_value(attr_DCLinkVoltage_read); + + /*----- PROTECTED REGION END -----*/ // A2720::read_DCLinkVoltage +} +//-------------------------------------------------------- +/** + * Read attribute ADCTemperature related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::read_ADCTemperature(Tango::Attribute &attr) +{ + DEBUG_STREAM << "A2720::read_ADCTemperature(Tango::Attribute &attr) entering... " << endl; + /*----- PROTECTED REGION ID(A2720::read_ADCTemperature) ENABLED START -----*/ + // Set the attribute value + attr_ADCTemperature_read[0] = TRUNCF(config.heater_a0 + + (config.heater_a1 * (float)status.heater_temperature)); + attr.set_value(attr_ADCTemperature_read); + + /*----- PROTECTED REGION END -----*/ // A2720::read_ADCTemperature +} +//-------------------------------------------------------- +/** + * Read attribute HeatsinkTemperature related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::read_HeatsinkTemperature(Tango::Attribute &attr) +{ + DEBUG_STREAM << "A2720::read_HeatsinkTemperature(Tango::Attribute &attr) entering... " << endl; + /*----- PROTECTED REGION ID(A2720::read_HeatsinkTemperature) ENABLED START -----*/ + // Set the attribute value + attr_HeatsinkTemperature_read[0] = TRUNCF(config.heatsink_a0 + + (config.heatsink_a1 * (float)status.heatsink_temperature)); + attr.set_value(attr_HeatsinkTemperature_read); + + /*----- PROTECTED REGION END -----*/ // A2720::read_HeatsinkTemperature +} +//-------------------------------------------------------- +/** + * Read attribute PRU0Firmware related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::read_PRU0Firmware(Tango::Attribute &attr) +{ + DEBUG_STREAM << "A2720::read_PRU0Firmware(Tango::Attribute &attr) entering... " << endl; + /*----- PROTECTED REGION ID(A2720::read_PRU0Firmware) ENABLED START -----*/ + // Set the attribute value + attr_PRU0Firmware_read[0] = status.pru0_fw_ver; + attr.set_value(attr_PRU0Firmware_read); + + /*----- PROTECTED REGION END -----*/ // A2720::read_PRU0Firmware +} +//-------------------------------------------------------- +/** + * Read attribute PRU1Firmware related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::read_PRU1Firmware(Tango::Attribute &attr) +{ + DEBUG_STREAM << "A2720::read_PRU1Firmware(Tango::Attribute &attr) entering... " << endl; + /*----- PROTECTED REGION ID(A2720::read_PRU1Firmware) ENABLED START -----*/ + // Set the attribute value + attr_PRU1Firmware_read[0] = status.pru1_fw_ver; + attr.set_value(attr_PRU1Firmware_read); + + /*----- PROTECTED REGION END -----*/ // A2720::read_PRU1Firmware +} +//-------------------------------------------------------- +/** + * Read attribute KPCoefficient related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::read_KPCoefficient(Tango::Attribute &attr) +{ + DEBUG_STREAM << "A2720::read_KPCoefficient(Tango::Attribute &attr) entering... " << endl; + /*----- PROTECTED REGION ID(A2720::read_KPCoefficient) ENABLED START -----*/ + // Set the attribute value + attr_KPCoefficient_read[0] = config.kp_coefficient; + attr.set_value(attr_KPCoefficient_read); + + /*----- PROTECTED REGION END -----*/ // A2720::read_KPCoefficient +} +//-------------------------------------------------------- +/** + * Write attribute KPCoefficient related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::write_KPCoefficient(Tango::WAttribute &attr) +{ + DEBUG_STREAM << "A2720::write_KPCoefficient(Tango::WAttribute &attr) entering... " << endl; + // Retrieve write value + Tango::DevFloat w_val; + attr.get_write_value(w_val); + /*----- PROTECTED REGION ID(A2720::write_KPCoefficient) ENABLED START -----*/ + + config.kp_coefficient = w_val; + + /*----- PROTECTED REGION END -----*/ // A2720::write_KPCoefficient +} +//-------------------------------------------------------- +/** + * Read attribute KICoefficient related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::read_KICoefficient(Tango::Attribute &attr) +{ + DEBUG_STREAM << "A2720::read_KICoefficient(Tango::Attribute &attr) entering... " << endl; + /*----- PROTECTED REGION ID(A2720::read_KICoefficient) ENABLED START -----*/ + // Set the attribute value + attr_KICoefficient_read[0] = config.ki_coefficient; + attr.set_value(attr_KICoefficient_read); + + /*----- PROTECTED REGION END -----*/ // A2720::read_KICoefficient +} +//-------------------------------------------------------- +/** + * Write attribute KICoefficient related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::write_KICoefficient(Tango::WAttribute &attr) +{ + DEBUG_STREAM << "A2720::write_KICoefficient(Tango::WAttribute &attr) entering... " << endl; + // Retrieve write value + Tango::DevFloat w_val; + attr.get_write_value(w_val); + /*----- PROTECTED REGION ID(A2720::write_KICoefficient) ENABLED START -----*/ + + config.ki_coefficient = w_val; + + /*----- PROTECTED REGION END -----*/ // A2720::write_KICoefficient +} +//-------------------------------------------------------- +/** + * Read attribute KFFCoefficient related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::read_KFFCoefficient(Tango::Attribute &attr) +{ + DEBUG_STREAM << "A2720::read_KFFCoefficient(Tango::Attribute &attr) entering... " << endl; + /*----- PROTECTED REGION ID(A2720::read_KFFCoefficient) ENABLED START -----*/ + // Set the attribute value + attr_KFFCoefficient_read[0] = config.kff_coefficient; + attr.set_value(attr_KFFCoefficient_read); + + /*----- PROTECTED REGION END -----*/ // A2720::read_KFFCoefficient +} +//-------------------------------------------------------- +/** + * Write attribute KFFCoefficient related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::write_KFFCoefficient(Tango::WAttribute &attr) +{ + DEBUG_STREAM << "A2720::write_KFFCoefficient(Tango::WAttribute &attr) entering... " << endl; + // Retrieve write value + Tango::DevFloat w_val; + attr.get_write_value(w_val); + /*----- PROTECTED REGION ID(A2720::write_KFFCoefficient) ENABLED START -----*/ + + config.kff_coefficient = w_val; + + /*----- PROTECTED REGION END -----*/ // A2720::write_KFFCoefficient +} +//-------------------------------------------------------- +/** + * Read attribute SlewRate related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::read_SlewRate(Tango::Attribute &attr) +{ + DEBUG_STREAM << "A2720::read_SlewRate(Tango::Attribute &attr) entering... " << endl; + /*----- PROTECTED REGION ID(A2720::read_SlewRate) ENABLED START -----*/ + // Set the attribute value + attr_SlewRate_read[0] = config.output_ramp_step * 50000; + attr.set_value(attr_SlewRate_read); + + /*----- PROTECTED REGION END -----*/ // A2720::read_SlewRate +} +//-------------------------------------------------------- +/** + * Write attribute SlewRate related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::write_SlewRate(Tango::WAttribute &attr) +{ + DEBUG_STREAM << "A2720::write_SlewRate(Tango::WAttribute &attr) entering... " << endl; + // Retrieve write value + Tango::DevFloat w_val; + attr.get_write_value(w_val); + /*----- PROTECTED REGION ID(A2720::write_SlewRate) ENABLED START -----*/ + + config.output_ramp_step = working_ramp_step = w_val / 50000; + + /*----- PROTECTED REGION END -----*/ // A2720::write_SlewRate +} +//-------------------------------------------------------- +/** + * Read attribute CurrentMin related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::read_CurrentMin(Tango::Attribute &attr) +{ + DEBUG_STREAM << "A2720::read_CurrentMin(Tango::Attribute &attr) entering... " << endl; + /*----- PROTECTED REGION ID(A2720::read_CurrentMin) ENABLED START -----*/ + // Set the attribute value + attr_CurrentMin_read[0] = config.output_current_min; + attr.set_value(attr_CurrentMin_read); + + /*----- PROTECTED REGION END -----*/ // A2720::read_CurrentMin +} +//-------------------------------------------------------- +/** + * Write attribute CurrentMin related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::write_CurrentMin(Tango::WAttribute &attr) +{ + DEBUG_STREAM << "A2720::write_CurrentMin(Tango::WAttribute &attr) entering... " << endl; + // Retrieve write value + Tango::DevFloat w_val; + attr.get_write_value(w_val); + /*----- PROTECTED REGION ID(A2720::write_CurrentMin) ENABLED START -----*/ + + config.output_current_min = w_val; + + /*----- PROTECTED REGION END -----*/ // A2720::write_CurrentMin +} +//-------------------------------------------------------- +/** + * Read attribute CurrentMax related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::read_CurrentMax(Tango::Attribute &attr) +{ + DEBUG_STREAM << "A2720::read_CurrentMax(Tango::Attribute &attr) entering... " << endl; + /*----- PROTECTED REGION ID(A2720::read_CurrentMax) ENABLED START -----*/ + // Set the attribute value + attr_CurrentMax_read[0] = config.output_current_max; + attr.set_value(attr_CurrentMax_read); + + /*----- PROTECTED REGION END -----*/ // A2720::read_CurrentMax +} +//-------------------------------------------------------- +/** + * Write attribute CurrentMax related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::write_CurrentMax(Tango::WAttribute &attr) +{ + DEBUG_STREAM << "A2720::write_CurrentMax(Tango::WAttribute &attr) entering... " << endl; + // Retrieve write value + Tango::DevFloat w_val; + attr.get_write_value(w_val); + /*----- PROTECTED REGION ID(A2720::write_CurrentMax) ENABLED START -----*/ + + config.output_current_max = w_val; + + /*----- PROTECTED REGION END -----*/ // A2720::write_CurrentMax +} +//-------------------------------------------------------- +/** + * Read attribute CurrentCoefficient0 related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::read_CurrentCoefficient0(Tango::Attribute &attr) +{ + DEBUG_STREAM << "A2720::read_CurrentCoefficient0(Tango::Attribute &attr) entering... " << endl; + /*----- PROTECTED REGION ID(A2720::read_CurrentCoefficient0) ENABLED START -----*/ + // Set the attribute value + attr_CurrentCoefficient0_read[0] = config.a0_coefficient_scaling; + attr.set_value(attr_CurrentCoefficient0_read); + + /*----- PROTECTED REGION END -----*/ // A2720::read_CurrentCoefficient0 +} +//-------------------------------------------------------- +/** + * Write attribute CurrentCoefficient0 related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::write_CurrentCoefficient0(Tango::WAttribute &attr) +{ + DEBUG_STREAM << "A2720::write_CurrentCoefficient0(Tango::WAttribute &attr) entering... " << endl; + // Retrieve write value + Tango::DevFloat w_val; + attr.get_write_value(w_val); + /*----- PROTECTED REGION ID(A2720::write_CurrentCoefficient0) ENABLED START -----*/ + + config.a0_coefficient_scaling = w_val; + + /*----- PROTECTED REGION END -----*/ // A2720::write_CurrentCoefficient0 +} +//-------------------------------------------------------- +/** + * Read attribute CurrentCoefficient1 related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::read_CurrentCoefficient1(Tango::Attribute &attr) +{ + DEBUG_STREAM << "A2720::read_CurrentCoefficient1(Tango::Attribute &attr) entering... " << endl; + /*----- PROTECTED REGION ID(A2720::read_CurrentCoefficient1) ENABLED START -----*/ + // Set the attribute value + attr_CurrentCoefficient1_read[0] = config.a1_coefficient_scaling; + attr.set_value(attr_CurrentCoefficient1_read); + + /*----- PROTECTED REGION END -----*/ // A2720::read_CurrentCoefficient1 +} +//-------------------------------------------------------- +/** + * Write attribute CurrentCoefficient1 related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::write_CurrentCoefficient1(Tango::WAttribute &attr) +{ + DEBUG_STREAM << "A2720::write_CurrentCoefficient1(Tango::WAttribute &attr) entering... " << endl; + // Retrieve write value + Tango::DevFloat w_val; + attr.get_write_value(w_val); + /*----- PROTECTED REGION ID(A2720::write_CurrentCoefficient1) ENABLED START -----*/ + + config.a1_coefficient_scaling = w_val; + + /*----- PROTECTED REGION END -----*/ // A2720::write_CurrentCoefficient1 +} +//-------------------------------------------------------- +/** + * Read attribute CurrentCoefficient2 related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::read_CurrentCoefficient2(Tango::Attribute &attr) +{ + DEBUG_STREAM << "A2720::read_CurrentCoefficient2(Tango::Attribute &attr) entering... " << endl; + /*----- PROTECTED REGION ID(A2720::read_CurrentCoefficient2) ENABLED START -----*/ + // Set the attribute value + attr_CurrentCoefficient2_read[0] = config.a2_coefficient_scaling; + attr.set_value(attr_CurrentCoefficient2_read); + + /*----- PROTECTED REGION END -----*/ // A2720::read_CurrentCoefficient2 +} +//-------------------------------------------------------- +/** + * Write attribute CurrentCoefficient2 related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::write_CurrentCoefficient2(Tango::WAttribute &attr) +{ + DEBUG_STREAM << "A2720::write_CurrentCoefficient2(Tango::WAttribute &attr) entering... " << endl; + // Retrieve write value + Tango::DevFloat w_val; + attr.get_write_value(w_val); + /*----- PROTECTED REGION ID(A2720::write_CurrentCoefficient2) ENABLED START -----*/ + + config.a2_coefficient_scaling = w_val; + + /*----- PROTECTED REGION END -----*/ // A2720::write_CurrentCoefficient2 +} +//-------------------------------------------------------- +/** + * Read attribute AuxVoltageCoefficient0 related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::read_AuxVoltageCoefficient0(Tango::Attribute &attr) +{ + DEBUG_STREAM << "A2720::read_AuxVoltageCoefficient0(Tango::Attribute &attr) entering... " << endl; + /*----- PROTECTED REGION ID(A2720::read_AuxVoltageCoefficient0) ENABLED START -----*/ + // Set the attribute value + attr_AuxVoltageCoefficient0_read[0] = config.aux_a0; + attr.set_value(attr_AuxVoltageCoefficient0_read); + + /*----- PROTECTED REGION END -----*/ // A2720::read_AuxVoltageCoefficient0 +} +//-------------------------------------------------------- +/** + * Write attribute AuxVoltageCoefficient0 related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::write_AuxVoltageCoefficient0(Tango::WAttribute &attr) +{ + DEBUG_STREAM << "A2720::write_AuxVoltageCoefficient0(Tango::WAttribute &attr) entering... " << endl; + // Retrieve write value + Tango::DevFloat w_val; + attr.get_write_value(w_val); + /*----- PROTECTED REGION ID(A2720::write_AuxVoltageCoefficient0) ENABLED START -----*/ + + config.aux_a0 = w_val; + + /*----- PROTECTED REGION END -----*/ // A2720::write_AuxVoltageCoefficient0 +} +//-------------------------------------------------------- +/** + * Read attribute AuxVoltageCoefficient1 related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::read_AuxVoltageCoefficient1(Tango::Attribute &attr) +{ + DEBUG_STREAM << "A2720::read_AuxVoltageCoefficient1(Tango::Attribute &attr) entering... " << endl; + /*----- PROTECTED REGION ID(A2720::read_AuxVoltageCoefficient1) ENABLED START -----*/ + // Set the attribute value + attr_AuxVoltageCoefficient1_read[0] = config.aux_a1; + attr.set_value(attr_AuxVoltageCoefficient1_read); + + /*----- PROTECTED REGION END -----*/ // A2720::read_AuxVoltageCoefficient1 +} +//-------------------------------------------------------- +/** + * Write attribute AuxVoltageCoefficient1 related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::write_AuxVoltageCoefficient1(Tango::WAttribute &attr) +{ + DEBUG_STREAM << "A2720::write_AuxVoltageCoefficient1(Tango::WAttribute &attr) entering... " << endl; + // Retrieve write value + Tango::DevFloat w_val; + attr.get_write_value(w_val); + /*----- PROTECTED REGION ID(A2720::write_AuxVoltageCoefficient1) ENABLED START -----*/ + + config.aux_a1 = w_val; + + /*----- PROTECTED REGION END -----*/ // A2720::write_AuxVoltageCoefficient1 +} +//-------------------------------------------------------- +/** + * Read attribute VoltageCoefficient0 related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::read_VoltageCoefficient0(Tango::Attribute &attr) +{ + DEBUG_STREAM << "A2720::read_VoltageCoefficient0(Tango::Attribute &attr) entering... " << endl; + /*----- PROTECTED REGION ID(A2720::read_VoltageCoefficient0) ENABLED START -----*/ + // Set the attribute value + attr_VoltageCoefficient0_read[0] = config.output_voltage_a0; + attr.set_value(attr_VoltageCoefficient0_read); + + /*----- PROTECTED REGION END -----*/ // A2720::read_VoltageCoefficient0 +} +//-------------------------------------------------------- +/** + * Write attribute VoltageCoefficient0 related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::write_VoltageCoefficient0(Tango::WAttribute &attr) +{ + DEBUG_STREAM << "A2720::write_VoltageCoefficient0(Tango::WAttribute &attr) entering... " << endl; + // Retrieve write value + Tango::DevFloat w_val; + attr.get_write_value(w_val); + /*----- PROTECTED REGION ID(A2720::write_VoltageCoefficient0) ENABLED START -----*/ + + config.output_voltage_a0 = w_val; + + /*----- PROTECTED REGION END -----*/ // A2720::write_VoltageCoefficient0 +} +//-------------------------------------------------------- +/** + * Read attribute VoltageCoefficient1 related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::read_VoltageCoefficient1(Tango::Attribute &attr) +{ + DEBUG_STREAM << "A2720::read_VoltageCoefficient1(Tango::Attribute &attr) entering... " << endl; + /*----- PROTECTED REGION ID(A2720::read_VoltageCoefficient1) ENABLED START -----*/ + // Set the attribute value + attr_VoltageCoefficient1_read[0] = config.output_voltage_a1; + attr.set_value(attr_VoltageCoefficient1_read); + + /*----- PROTECTED REGION END -----*/ // A2720::read_VoltageCoefficient1 +} +//-------------------------------------------------------- +/** + * Write attribute VoltageCoefficient1 related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::write_VoltageCoefficient1(Tango::WAttribute &attr) +{ + DEBUG_STREAM << "A2720::write_VoltageCoefficient1(Tango::WAttribute &attr) entering... " << endl; + // Retrieve write value + Tango::DevFloat w_val; + attr.get_write_value(w_val); + /*----- PROTECTED REGION ID(A2720::write_VoltageCoefficient1) ENABLED START -----*/ + + config.output_voltage_a1 = w_val; + + /*----- PROTECTED REGION END -----*/ // A2720::write_VoltageCoefficient1 +} +//-------------------------------------------------------- +/** + * Read attribute DCCurrentCoefficient0 related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::read_DCCurrentCoefficient0(Tango::Attribute &attr) +{ + DEBUG_STREAM << "A2720::read_DCCurrentCoefficient0(Tango::Attribute &attr) entering... " << endl; + /*----- PROTECTED REGION ID(A2720::read_DCCurrentCoefficient0) ENABLED START -----*/ + // Set the attribute value + attr_DCCurrentCoefficient0_read[0] = config.dc_a0; + attr.set_value(attr_DCCurrentCoefficient0_read); + + /*----- PROTECTED REGION END -----*/ // A2720::read_DCCurrentCoefficient0 +} +//-------------------------------------------------------- +/** + * Write attribute DCCurrentCoefficient0 related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::write_DCCurrentCoefficient0(Tango::WAttribute &attr) +{ + DEBUG_STREAM << "A2720::write_DCCurrentCoefficient0(Tango::WAttribute &attr) entering... " << endl; + // Retrieve write value + Tango::DevFloat w_val; + attr.get_write_value(w_val); + /*----- PROTECTED REGION ID(A2720::write_DCCurrentCoefficient0) ENABLED START -----*/ + + config.dc_a0 = w_val; + + /*----- PROTECTED REGION END -----*/ // A2720::write_DCCurrentCoefficient0 +} +//-------------------------------------------------------- +/** + * Read attribute DCCurrentCoefficient1 related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::read_DCCurrentCoefficient1(Tango::Attribute &attr) +{ + DEBUG_STREAM << "A2720::read_DCCurrentCoefficient1(Tango::Attribute &attr) entering... " << endl; + /*----- PROTECTED REGION ID(A2720::read_DCCurrentCoefficient1) ENABLED START -----*/ + // Set the attribute value + attr_DCCurrentCoefficient1_read[0] = config.dc_a1; + attr.set_value(attr_DCCurrentCoefficient1_read); + + /*----- PROTECTED REGION END -----*/ // A2720::read_DCCurrentCoefficient1 +} +//-------------------------------------------------------- +/** + * Write attribute DCCurrentCoefficient1 related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::write_DCCurrentCoefficient1(Tango::WAttribute &attr) +{ + DEBUG_STREAM << "A2720::write_DCCurrentCoefficient1(Tango::WAttribute &attr) entering... " << endl; + // Retrieve write value + Tango::DevFloat w_val; + attr.get_write_value(w_val); + /*----- PROTECTED REGION ID(A2720::write_DCCurrentCoefficient1) ENABLED START -----*/ + + config.dc_a1 = w_val; + + /*----- PROTECTED REGION END -----*/ // A2720::write_DCCurrentCoefficient1 +} +//-------------------------------------------------------- +/** + * Read attribute ADCTempCoefficient0 related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::read_ADCTempCoefficient0(Tango::Attribute &attr) +{ + DEBUG_STREAM << "A2720::read_ADCTempCoefficient0(Tango::Attribute &attr) entering... " << endl; + /*----- PROTECTED REGION ID(A2720::read_ADCTempCoefficient0) ENABLED START -----*/ + // Set the attribute value + attr_ADCTempCoefficient0_read[0] = config.heater_a0; + attr.set_value(attr_ADCTempCoefficient0_read); + + /*----- PROTECTED REGION END -----*/ // A2720::read_ADCTempCoefficient0 +} +//-------------------------------------------------------- +/** + * Write attribute ADCTempCoefficient0 related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::write_ADCTempCoefficient0(Tango::WAttribute &attr) +{ + DEBUG_STREAM << "A2720::write_ADCTempCoefficient0(Tango::WAttribute &attr) entering... " << endl; + // Retrieve write value + Tango::DevFloat w_val; + attr.get_write_value(w_val); + /*----- PROTECTED REGION ID(A2720::write_ADCTempCoefficient0) ENABLED START -----*/ + + config.heater_a0 = w_val; + + /*----- PROTECTED REGION END -----*/ // A2720::write_ADCTempCoefficient0 +} +//-------------------------------------------------------- +/** + * Read attribute ADCTempCoefficient1 related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::read_ADCTempCoefficient1(Tango::Attribute &attr) +{ + DEBUG_STREAM << "A2720::read_ADCTempCoefficient1(Tango::Attribute &attr) entering... " << endl; + /*----- PROTECTED REGION ID(A2720::read_ADCTempCoefficient1) ENABLED START -----*/ + // Set the attribute value + attr_ADCTempCoefficient1_read[0] = config.heater_a1; + attr.set_value(attr_ADCTempCoefficient1_read); + + /*----- PROTECTED REGION END -----*/ // A2720::read_ADCTempCoefficient1 +} +//-------------------------------------------------------- +/** + * Write attribute ADCTempCoefficient1 related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::write_ADCTempCoefficient1(Tango::WAttribute &attr) +{ + DEBUG_STREAM << "A2720::write_ADCTempCoefficient1(Tango::WAttribute &attr) entering... " << endl; + // Retrieve write value + Tango::DevFloat w_val; + attr.get_write_value(w_val); + /*----- PROTECTED REGION ID(A2720::write_ADCTempCoefficient1) ENABLED START -----*/ + + config.heater_a1 = w_val; + + /*----- PROTECTED REGION END -----*/ // A2720::write_ADCTempCoefficient1 +} +//-------------------------------------------------------- +/** + * Read attribute HeatsinkTempCoefficient0 related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::read_HeatsinkTempCoefficient0(Tango::Attribute &attr) +{ + DEBUG_STREAM << "A2720::read_HeatsinkTempCoefficient0(Tango::Attribute &attr) entering... " << endl; + /*----- PROTECTED REGION ID(A2720::read_HeatsinkTempCoefficient0) ENABLED START -----*/ + // Set the attribute value + attr_HeatsinkTempCoefficient0_read[0] = config.heatsink_a0; + attr.set_value(attr_HeatsinkTempCoefficient0_read); + + /*----- PROTECTED REGION END -----*/ // A2720::read_HeatsinkTempCoefficient0 +} +//-------------------------------------------------------- +/** + * Write attribute HeatsinkTempCoefficient0 related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::write_HeatsinkTempCoefficient0(Tango::WAttribute &attr) +{ + DEBUG_STREAM << "A2720::write_HeatsinkTempCoefficient0(Tango::WAttribute &attr) entering... " << endl; + // Retrieve write value + Tango::DevFloat w_val; + attr.get_write_value(w_val); + /*----- PROTECTED REGION ID(A2720::write_HeatsinkTempCoefficient0) ENABLED START -----*/ + + config.heatsink_a0 = w_val; + + /*----- PROTECTED REGION END -----*/ // A2720::write_HeatsinkTempCoefficient0 +} +//-------------------------------------------------------- +/** + * Read attribute HeatsinkTempCoefficient1 related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::read_HeatsinkTempCoefficient1(Tango::Attribute &attr) +{ + DEBUG_STREAM << "A2720::read_HeatsinkTempCoefficient1(Tango::Attribute &attr) entering... " << endl; + /*----- PROTECTED REGION ID(A2720::read_HeatsinkTempCoefficient1) ENABLED START -----*/ + // Set the attribute value + attr_HeatsinkTempCoefficient1_read[0] = config.heatsink_a1; + attr.set_value(attr_HeatsinkTempCoefficient1_read); + + /*----- PROTECTED REGION END -----*/ // A2720::read_HeatsinkTempCoefficient1 +} +//-------------------------------------------------------- +/** + * Write attribute HeatsinkTempCoefficient1 related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::write_HeatsinkTempCoefficient1(Tango::WAttribute &attr) +{ + DEBUG_STREAM << "A2720::write_HeatsinkTempCoefficient1(Tango::WAttribute &attr) entering... " << endl; + // Retrieve write value + Tango::DevFloat w_val; + attr.get_write_value(w_val); + /*----- PROTECTED REGION ID(A2720::write_HeatsinkTempCoefficient1) ENABLED START -----*/ + + config.heatsink_a1 = w_val; + + /*----- PROTECTED REGION END -----*/ // A2720::write_HeatsinkTempCoefficient1 +} +//-------------------------------------------------------- +/** + * Read attribute SerialNumber related method + * Description: + * + * Data type: Tango::DevString + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::read_SerialNumber(Tango::Attribute &attr) +{ + DEBUG_STREAM << "A2720::read_SerialNumber(Tango::Attribute &attr) entering... " << endl; + /*----- PROTECTED REGION ID(A2720::read_SerialNumber) ENABLED START -----*/ + // Set the attribute value + attr.set_value(attr_SerialNumber_read); + + /*----- PROTECTED REGION END -----*/ // A2720::read_SerialNumber +} +//-------------------------------------------------------- +/** + * Read attribute Model related method + * Description: + * + * Data type: Tango::DevString + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::read_Model(Tango::Attribute &attr) +{ + DEBUG_STREAM << "A2720::read_Model(Tango::Attribute &attr) entering... " << endl; + /*----- PROTECTED REGION ID(A2720::read_Model) ENABLED START -----*/ + // Set the attribute value + attr.set_value(attr_Model_read); + + /*----- PROTECTED REGION END -----*/ // A2720::read_Model +} +//-------------------------------------------------------- +/** + * Read attribute CalibrationDate related method + * Description: + * + * Data type: Tango::DevString + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::read_CalibrationDate(Tango::Attribute &attr) +{ + DEBUG_STREAM << "A2720::read_CalibrationDate(Tango::Attribute &attr) entering... " << endl; + /*----- PROTECTED REGION ID(A2720::read_CalibrationDate) ENABLED START -----*/ + // Set the attribute value + attr.set_value(attr_CalibrationDate_read); + + /*----- PROTECTED REGION END -----*/ // A2720::read_CalibrationDate +} +//-------------------------------------------------------- +/** + * Read attribute PulseDuration related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::read_PulseDuration(Tango::Attribute &attr) +{ + DEBUG_STREAM << "A2720::read_PulseDuration(Tango::Attribute &attr) entering... " << endl; + /*----- PROTECTED REGION ID(A2720::read_PulseDuration) ENABLED START -----*/ + // Set the attribute value + attr_PulseDuration_read[0] = config.pulse_duration * 0.02; + attr.set_value(attr_PulseDuration_read); + + /*----- PROTECTED REGION END -----*/ // A2720::read_PulseDuration +} +//-------------------------------------------------------- +/** + * Write attribute PulseDuration related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::write_PulseDuration(Tango::WAttribute &attr) +{ + DEBUG_STREAM << "A2720::write_PulseDuration(Tango::WAttribute &attr) entering... " << endl; + // Retrieve write value + Tango::DevFloat w_val; + attr.get_write_value(w_val); + /*----- PROTECTED REGION ID(A2720::write_PulseDuration) ENABLED START -----*/ + + config.pulse_duration = w_val / 0.02; + + /*----- PROTECTED REGION END -----*/ // A2720::write_PulseDuration +} +//-------------------------------------------------------- +/** + * Read attribute CurrentCoefficient3 related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::read_CurrentCoefficient3(Tango::Attribute &attr) +{ + DEBUG_STREAM << "A2720::read_CurrentCoefficient3(Tango::Attribute &attr) entering... " << endl; + /*----- PROTECTED REGION ID(A2720::read_CurrentCoefficient3) ENABLED START -----*/ + // Set the attribute value + attr_CurrentCoefficient3_read[0] = config.a3_coefficient_scaling; + attr.set_value(attr_CurrentCoefficient3_read); + + /*----- PROTECTED REGION END -----*/ // A2720::read_CurrentCoefficient3 +} +//-------------------------------------------------------- +/** + * Write attribute CurrentCoefficient3 related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::write_CurrentCoefficient3(Tango::WAttribute &attr) +{ + DEBUG_STREAM << "A2720::write_CurrentCoefficient3(Tango::WAttribute &attr) entering... " << endl; + // Retrieve write value + Tango::DevFloat w_val; + attr.get_write_value(w_val); + /*----- PROTECTED REGION ID(A2720::write_CurrentCoefficient3) ENABLED START -----*/ + + config.a3_coefficient_scaling = w_val; + + /*----- PROTECTED REGION END -----*/ // A2720::write_CurrentCoefficient3 +} +//-------------------------------------------------------- +/** + * Write attribute DCurr related method + * Description: + * + * Data type: Tango::DevDouble + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::write_DCurr(Tango::WAttribute &attr) +{ + DEBUG_STREAM << "A2720::write_DCurr(Tango::WAttribute &attr) entering... " << endl; + // Retrieve write value + Tango::DevDouble w_val; + attr.get_write_value(w_val); + /*----- PROTECTED REGION ID(A2720::write_DCurr) ENABLED START -----*/ + + if (! init_error.empty()) + Tango::Except::throw_exception( "", + init_error.c_str(), + "A2720::write_DCurr()"); + + config.output_current_setpoint = (float)w_val; + + /*----- PROTECTED REGION END -----*/ // A2720::write_DCurr +} +//-------------------------------------------------------- +/** + * Read attribute CurrentCoefficient4 related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::read_CurrentCoefficient4(Tango::Attribute &attr) +{ + DEBUG_STREAM << "A2720::read_CurrentCoefficient4(Tango::Attribute &attr) entering... " << endl; + /*----- PROTECTED REGION ID(A2720::read_CurrentCoefficient4) ENABLED START -----*/ + // Set the attribute value + attr_CurrentCoefficient4_read[0] = config.a4_coefficient_scaling; + attr.set_value(attr_CurrentCoefficient4_read); + + /*----- PROTECTED REGION END -----*/ // A2720::read_CurrentCoefficient4 +} +//-------------------------------------------------------- +/** + * Write attribute CurrentCoefficient4 related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::write_CurrentCoefficient4(Tango::WAttribute &attr) +{ + DEBUG_STREAM << "A2720::write_CurrentCoefficient4(Tango::WAttribute &attr) entering... " << endl; + // Retrieve write value + Tango::DevFloat w_val; + attr.get_write_value(w_val); + /*----- PROTECTED REGION ID(A2720::write_CurrentCoefficient4) ENABLED START -----*/ + + config.a4_coefficient_scaling = w_val; + + /*----- PROTECTED REGION END -----*/ // A2720::write_CurrentCoefficient4 +} +//-------------------------------------------------------- +/** + * Read attribute CurrentCoefficient5 related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::read_CurrentCoefficient5(Tango::Attribute &attr) +{ + DEBUG_STREAM << "A2720::read_CurrentCoefficient5(Tango::Attribute &attr) entering... " << endl; + /*----- PROTECTED REGION ID(A2720::read_CurrentCoefficient5) ENABLED START -----*/ + // Set the attribute value + attr_CurrentCoefficient5_read[0] = config.a5_coefficient_scaling; + attr.set_value(attr_CurrentCoefficient5_read); + + /*----- PROTECTED REGION END -----*/ // A2720::read_CurrentCoefficient5 +} +//-------------------------------------------------------- +/** + * Write attribute CurrentCoefficient5 related method + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ +//-------------------------------------------------------- +void A2720::write_CurrentCoefficient5(Tango::WAttribute &attr) +{ + DEBUG_STREAM << "A2720::write_CurrentCoefficient5(Tango::WAttribute &attr) entering... " << endl; + // Retrieve write value + Tango::DevFloat w_val; + attr.get_write_value(w_val); + /*----- PROTECTED REGION ID(A2720::write_CurrentCoefficient5) ENABLED START -----*/ + + config.a5_coefficient_scaling = w_val; + + /*----- PROTECTED REGION END -----*/ // A2720::write_CurrentCoefficient5 +} +//-------------------------------------------------------- +/** + * Read attribute PsStat related method + * Description: + * + * Data type: Tango::DevBoolean + * Attr type: Spectrum max = 10 + */ +//-------------------------------------------------------- +void A2720::read_PsStat(Tango::Attribute &attr) +{ + DEBUG_STREAM << "A2720::read_PsStat(Tango::Attribute &attr) entering... " << endl; + /*----- PROTECTED REGION ID(A2720::read_PsStat) ENABLED START -----*/ + // Set the attribute value + memset(attr_PsStat_read, 0, sizeof(Tango::DevBoolean) * 10); + + if (~status.iostatus & 0x1) + attr_PsStat_read[0] = true; + + if (status.iostatus & 0x4) + attr_PsStat_read[1] = true; + + if (status.iostatus & 0x8) + attr_PsStat_read[2] = true; + + if (status.iostatus & 0x40) + attr_PsStat_read[3] = true; + + if (status.iostatus & 0x80) + attr_PsStat_read[4] = true; + + if (status.iostatus & 0x1000) + attr_PsStat_read[5] = true; + + if (status.iostatus & 0x2000) + attr_PsStat_read[6] = true; + + if (status.iostatus & 0x8000) + attr_PsStat_read[7] = true; + + if (~status.iostatus & 0x1000000) + attr_PsStat_read[8] = true; + + if (~status.iostatus & 0x2000000) + attr_PsStat_read[9] = true; + + if (status.iostatus & 0x4000000) + attr_PsStat_read[10] = true; + + attr.set_value(attr_PsStat_read, 10); + + /*----- PROTECTED REGION END -----*/ // A2720::read_PsStat +} + +//-------------------------------------------------------- +/** + * Method : A2720::add_dynamic_attributes() + * Description : Create the dynamic attributes if any + * for specified device. + */ +//-------------------------------------------------------- +void A2720::add_dynamic_attributes() +{ + /*----- PROTECTED REGION ID(A2720::add_dynamic_attributes) ENABLED START -----*/ + + // Add your own code to create and add dynamic attributes if any + + /*----- PROTECTED REGION END -----*/ // A2720::add_dynamic_attributes +} + +//-------------------------------------------------------- +/** + * Command StartCycling related method + * Description: + * + */ +//-------------------------------------------------------- +void A2720::start_cycling() +{ + DEBUG_STREAM << "A2720::StartCycling() - " << device_name << endl; + /*----- PROTECTED REGION ID(A2720::start_cycling) ENABLED START -----*/ + + // Add your own code + if (! init_error.empty()) + Tango::Except::throw_exception( "", + init_error.c_str(), + "A2720::start_cycling()"); + + config.output_ramp_step = (float)cycRampSlopeCurr / 50000; + + if (ioctl(drv, A2720_SET_CONFIG, &config) != 0) + Tango::Except::throw_exception( "", + strerror(errno), + "A2720::start_cycling()"); + + transition = CYCLING; + worker = new A2720Worker(this); + worker->start(); + + /*----- PROTECTED REGION END -----*/ // A2720::start_cycling +} +//-------------------------------------------------------- +/** + * Command Abort related method + * Description: + * + */ +//-------------------------------------------------------- +void A2720::abort() +{ + DEBUG_STREAM << "A2720::Abort() - " << device_name << endl; + /*----- PROTECTED REGION ID(A2720::abort) ENABLED START -----*/ + + // Add your own code + if (! init_error.empty()) + Tango::Except::throw_exception( "", + init_error.c_str(), + "A2720::abort()"); + + cont = false; + + /*----- PROTECTED REGION END -----*/ // A2720::abort +} +//-------------------------------------------------------- +/** + * Command On related method + * Description: + * + */ +//-------------------------------------------------------- +void A2720::on() +{ + DEBUG_STREAM << "A2720::On() - " << device_name << endl; + /*----- PROTECTED REGION ID(A2720::on) ENABLED START -----*/ + + // Add your own code + if (! init_error.empty()) + Tango::Except::throw_exception( "", + init_error.c_str(), + "A2720::on()"); + + config.control = 0xffff; + + if (ioctl(drv, A2720_SET_CONFIG, &config) != 0) + Tango::Except::throw_exception( "", + strerror(errno), + "A2720::on()"); + + transition = ONOFF; + worker = new A2720Worker(this); + worker->start(); + + /*----- PROTECTED REGION END -----*/ // A2720::on +} +//-------------------------------------------------------- +/** + * Command Off related method + * Description: + * + */ +//-------------------------------------------------------- +void A2720::off() +{ + DEBUG_STREAM << "A2720::Off() - " << device_name << endl; + /*----- PROTECTED REGION ID(A2720::off) ENABLED START -----*/ + + // Add your own code + if (! init_error.empty()) + Tango::Except::throw_exception( "", + init_error.c_str(), + "A2720::off()"); + + config.control = 0x0; + + if (ioctl(drv, A2720_SET_CONFIG, &config) != 0) + Tango::Except::throw_exception( "", + strerror(errno), + "A2720::off()"); + + transition = ONOFF; + worker = new A2720Worker(this); + worker->start(); + + /*----- PROTECTED REGION END -----*/ // A2720::off +} +//-------------------------------------------------------- +/** + * Command Reset related method + * Description: + * + */ +//-------------------------------------------------------- +void A2720::reset() +{ + DEBUG_STREAM << "A2720::Reset() - " << device_name << endl; + /*----- PROTECTED REGION ID(A2720::reset) ENABLED START -----*/ + + // Add your own code + if (! init_error.empty()) + Tango::Except::throw_exception( "", + init_error.c_str(), + "A2720::reset()"); + + config.reset = 0xffff; + + if (ioctl(drv, A2720_SET_CONFIG, &config) != 0) + Tango::Except::throw_exception( "", + strerror(errno), + "A2720::reset()"); + + /*----- PROTECTED REGION END -----*/ // A2720::reset +} +//-------------------------------------------------------- +/** + * Method : A2720::add_dynamic_commands() + * Description : Create the dynamic commands if any + * for specified device. + */ +//-------------------------------------------------------- +void A2720::add_dynamic_commands() +{ + /*----- PROTECTED REGION ID(A2720::add_dynamic_commands) ENABLED START -----*/ + + // Add your own code to create and add dynamic commands if any + + /*----- PROTECTED REGION END -----*/ // A2720::add_dynamic_commands +} + +/*----- PROTECTED REGION ID(A2720::namespace_ending) ENABLED START -----*/ + +// Additional Methods +int A2720::update(void) +{ + int ret1, ret2; + + ret1 = ioctl(drv, A2720_GET_STATUS, &status); + if (ret1 != 0) + return ret1; + + ret2 = ioctl(drv, A2720_GET_CONFIG, &config); + if (ret2 != 0) + return ret2; + + return 0; +} + +bool A2720::is_writing_complete(void) +{ + if (status.output_current < config.output_current_setpoint + 0.002 && + status.output_current > config.output_current_setpoint - 0.002) + return true; + return false; +} + +int A2720::write_current(float newcurr) +{ + int ret; + + ret = ioctl(drv, A2720_GET_CONFIG, &config); + if (ret != 0) + return ret; + + config.output_current_setpoint = newcurr; + + ret = ioctl(drv, A2720_SET_CONFIG, &config); + return ret; +} + +void A2720::wait(unsigned int millisecs) +{ + while(cont && millisecs) { + if (millisecs >= 250) { + omni_thread::self()->sleep(0, 250000000); + millisecs -= 250; + } else { + omni_thread::self()->sleep(0, millisecs * 1000000); + millisecs = 0; + } + } +} + +void A2720Worker::run(void*) +{ + unsigned int ncycles = 0; + + DEBUG_STREAM << "A2720Worker::run() - enter" << endl; + + switch(device->transition) { + case ONOFF: + while(device->cont) { + if (device->update() == 0) { + if (device->config.control == 0x0 + && device->status.iostatus & 0x1) + break; + else if (device->config.control == 0xffff + && (device->status.iostatus & 0x1) == 0x0) + break; + else {} + } else + break; + device->wait(50); + } + break; + case RAMPING: + while(device->cont) { + if (device->update() == 0) { + if (device->is_writing_complete()) + break; + } else + break; + device->wait(50); + } + break; + case CYCLING: + while (device->cont) { + if (ncycles < device->cycNumTimes*2) { + if (device->write_current((float)((ncycles % 2) ? + device->cycMinCurr : device->cycMaxCurr)) != 0) + break; + + while (device->cont) { + if (device->update() == 0) { + if (device->is_writing_complete()) + break; + } else + break; + device->wait(50); + } + + device->wait(device->cycWaitTime*1000); + ncycles++; + } else + break; + } + break; + case NONE: + default: + ; + } + + switch (device->transition) { + case ONOFF: + if (! device->cont) { + ioctl(device->drv, A2720_GET_CONFIG, &device->config); + device->config.control = 0x0; + ioctl(device->drv, A2720_SET_CONFIG, &device->config); + } + break; + case CYCLING: + if (device->cycNumTimes*2==ncycles) + device->lastcycling = true; + else + device->lastcycling = false; + + if (device->write_current((float)device->cycEndCurr) == 0) { + while(1) { + if (device->update() == 0) { + if (device->is_writing_complete()) + break; + } else + break; + device->wait(50); + } + } + + ioctl(device->drv, A2720_GET_CONFIG, &device->config); + device->config.output_ramp_step = device->working_ramp_step; + ioctl(device->drv, A2720_SET_CONFIG, &device->config); + break; + case RAMPING: + case NONE: + default: + ; + } + device->transition = NONE; + + DEBUG_STREAM << "A2720Worker::run() - exit" << endl; +} + +/*----- PROTECTED REGION END -----*/ // A2720::namespace_ending +} // namespace diff --git a/src/A2720.h b/src/A2720.h new file mode 100644 index 0000000000000000000000000000000000000000..00d653060ab6f5a3ef9f5880179ce9ca20071d55 --- /dev/null +++ b/src/A2720.h @@ -0,0 +1,661 @@ +/*----- PROTECTED REGION ID(A2720.h) ENABLED START -----*/ +//============================================================================= +// +// file : A2720.h +// +// description : Include file for the A2720 class +// +// project : +// +// This file is part of Tango device class. +// +// Tango is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Tango is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Tango. If not, see <http://www.gnu.org/licenses/>. +// +// $Author: alessio $ +// +// $Revision: 1.4 $ +// $Date: 2018-02-19 16:52:13 $ +// +// $HeadURL: $ +// +//============================================================================= +// This file is generated by POGO +// (Program Obviously used to Generate tango Object) +//============================================================================= + + +#ifndef A2720_H +#define A2720_H + +#include <tango.h> +#include "a2720.h" + +/*----- PROTECTED REGION END -----*/ // A2720.h + +/** + * A2720 class description: + * + */ + +namespace A2720_ns +{ +/*----- PROTECTED REGION ID(A2720::Additional Class Declarations) ENABLED START -----*/ + +// Additional Class Declarations +enum transition_t { NONE, ONOFF, RAMPING, CYCLING}; + +class A2720Worker; + +/*----- PROTECTED REGION END -----*/ // A2720::Additional Class Declarations + +class A2720 : public TANGO_BASE_CLASS +{ + +/*----- PROTECTED REGION ID(A2720::Data Members) ENABLED START -----*/ + +// Add your own data members +public: + string init_error; + int drv; + a2720_config config; + a2720_status status; + Tango::WAttribute *attr_set_current; + + A2720Worker *worker; + bool cont; + bool lastcycling; + enum transition_t transition; + + float working_ramp_step; + + Tango::DevState real_state; + +/*----- PROTECTED REGION END -----*/ // A2720::Data Members + +// Device property data members +public: + // CycMinCurr: + Tango::DevDouble cycMinCurr; + // CycMaxCurr: + Tango::DevDouble cycMaxCurr; + // CycEndCurr: + Tango::DevDouble cycEndCurr; + // CycNumTimes: + Tango::DevULong cycNumTimes; + // CycWaitTime: + Tango::DevULong cycWaitTime; + // CycRampSlopeCurr: + Tango::DevDouble cycRampSlopeCurr; + + bool mandatoryNotDefined; + +// Attribute data members +public: + Tango::DevDouble *attr_Current_read; + Tango::DevDouble *attr_Voltage_read; + Tango::DevDouble *attr_CurrentSet_read; + Tango::DevDouble *attr_AuxiliaryVoltage_read; + Tango::DevDouble *attr_DCLinkVoltage_read; + Tango::DevFloat *attr_ADCTemperature_read; + Tango::DevFloat *attr_HeatsinkTemperature_read; + Tango::DevFloat *attr_PRU0Firmware_read; + Tango::DevFloat *attr_PRU1Firmware_read; + Tango::DevFloat *attr_KPCoefficient_read; + Tango::DevFloat *attr_KICoefficient_read; + Tango::DevFloat *attr_KFFCoefficient_read; + Tango::DevFloat *attr_SlewRate_read; + Tango::DevFloat *attr_CurrentMin_read; + Tango::DevFloat *attr_CurrentMax_read; + Tango::DevFloat *attr_CurrentCoefficient0_read; + Tango::DevFloat *attr_CurrentCoefficient1_read; + Tango::DevFloat *attr_CurrentCoefficient2_read; + Tango::DevFloat *attr_AuxVoltageCoefficient0_read; + Tango::DevFloat *attr_AuxVoltageCoefficient1_read; + Tango::DevFloat *attr_VoltageCoefficient0_read; + Tango::DevFloat *attr_VoltageCoefficient1_read; + Tango::DevFloat *attr_DCCurrentCoefficient0_read; + Tango::DevFloat *attr_DCCurrentCoefficient1_read; + Tango::DevFloat *attr_ADCTempCoefficient0_read; + Tango::DevFloat *attr_ADCTempCoefficient1_read; + Tango::DevFloat *attr_HeatsinkTempCoefficient0_read; + Tango::DevFloat *attr_HeatsinkTempCoefficient1_read; + Tango::DevString *attr_SerialNumber_read; + Tango::DevString *attr_Model_read; + Tango::DevString *attr_CalibrationDate_read; + Tango::DevFloat *attr_PulseDuration_read; + Tango::DevFloat *attr_CurrentCoefficient3_read; + Tango::DevFloat *attr_CurrentCoefficient4_read; + Tango::DevFloat *attr_CurrentCoefficient5_read; + Tango::DevBoolean *attr_PsStat_read; + +// Constructors and destructors +public: + /** + * Constructs a newly device object. + * + * @param cl Class. + * @param s Device Name + */ + A2720(Tango::DeviceClass *cl,string &s); + /** + * Constructs a newly device object. + * + * @param cl Class. + * @param s Device Name + */ + A2720(Tango::DeviceClass *cl,const char *s); + /** + * Constructs a newly device object. + * + * @param cl Class. + * @param s Device name + * @param d Device description. + */ + A2720(Tango::DeviceClass *cl,const char *s,const char *d); + /** + * The device object destructor. + */ + ~A2720() {delete_device();}; + + +// Miscellaneous methods +public: + /* + * will be called at device destruction or at init command. + */ + void delete_device(); + /* + * 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: + //-------------------------------------------------------- + /* + * Method : A2720::read_attr_hardware() + * Description : Hardware acquisition for attributes. + */ + //-------------------------------------------------------- + virtual void read_attr_hardware(vector<long> &attr_list); + //-------------------------------------------------------- + /* + * Method : A2720::write_attr_hardware() + * Description : Hardware writing for attributes. + */ + //-------------------------------------------------------- + virtual void write_attr_hardware(vector<long> &attr_list); + +/** + * Attribute Current related methods + * Description: + * + * Data type: Tango::DevDouble + * Attr type: Scalar + */ + virtual void read_Current(Tango::Attribute &attr); + virtual void write_Current(Tango::WAttribute &attr); + virtual bool is_Current_allowed(Tango::AttReqType type); +/** + * Attribute Voltage related methods + * Description: + * + * Data type: Tango::DevDouble + * Attr type: Scalar + */ + virtual void read_Voltage(Tango::Attribute &attr); + virtual bool is_Voltage_allowed(Tango::AttReqType type); +/** + * Attribute CurrentSet related methods + * Description: + * + * Data type: Tango::DevDouble + * Attr type: Scalar + */ + virtual void read_CurrentSet(Tango::Attribute &attr); + virtual bool is_CurrentSet_allowed(Tango::AttReqType type); +/** + * Attribute AuxiliaryVoltage related methods + * Description: + * + * Data type: Tango::DevDouble + * Attr type: Scalar + */ + virtual void read_AuxiliaryVoltage(Tango::Attribute &attr); + virtual bool is_AuxiliaryVoltage_allowed(Tango::AttReqType type); +/** + * Attribute DCLinkVoltage related methods + * Description: + * + * Data type: Tango::DevDouble + * Attr type: Scalar + */ + virtual void read_DCLinkVoltage(Tango::Attribute &attr); + virtual bool is_DCLinkVoltage_allowed(Tango::AttReqType type); +/** + * Attribute ADCTemperature related methods + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ + virtual void read_ADCTemperature(Tango::Attribute &attr); + virtual bool is_ADCTemperature_allowed(Tango::AttReqType type); +/** + * Attribute HeatsinkTemperature related methods + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ + virtual void read_HeatsinkTemperature(Tango::Attribute &attr); + virtual bool is_HeatsinkTemperature_allowed(Tango::AttReqType type); +/** + * Attribute PRU0Firmware related methods + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ + virtual void read_PRU0Firmware(Tango::Attribute &attr); + virtual bool is_PRU0Firmware_allowed(Tango::AttReqType type); +/** + * Attribute PRU1Firmware related methods + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ + virtual void read_PRU1Firmware(Tango::Attribute &attr); + virtual bool is_PRU1Firmware_allowed(Tango::AttReqType type); +/** + * Attribute KPCoefficient related methods + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ + virtual void read_KPCoefficient(Tango::Attribute &attr); + virtual void write_KPCoefficient(Tango::WAttribute &attr); + virtual bool is_KPCoefficient_allowed(Tango::AttReqType type); +/** + * Attribute KICoefficient related methods + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ + virtual void read_KICoefficient(Tango::Attribute &attr); + virtual void write_KICoefficient(Tango::WAttribute &attr); + virtual bool is_KICoefficient_allowed(Tango::AttReqType type); +/** + * Attribute KFFCoefficient related methods + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ + virtual void read_KFFCoefficient(Tango::Attribute &attr); + virtual void write_KFFCoefficient(Tango::WAttribute &attr); + virtual bool is_KFFCoefficient_allowed(Tango::AttReqType type); +/** + * Attribute SlewRate related methods + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ + virtual void read_SlewRate(Tango::Attribute &attr); + virtual void write_SlewRate(Tango::WAttribute &attr); + virtual bool is_SlewRate_allowed(Tango::AttReqType type); +/** + * Attribute CurrentMin related methods + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ + virtual void read_CurrentMin(Tango::Attribute &attr); + virtual void write_CurrentMin(Tango::WAttribute &attr); + virtual bool is_CurrentMin_allowed(Tango::AttReqType type); +/** + * Attribute CurrentMax related methods + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ + virtual void read_CurrentMax(Tango::Attribute &attr); + virtual void write_CurrentMax(Tango::WAttribute &attr); + virtual bool is_CurrentMax_allowed(Tango::AttReqType type); +/** + * Attribute CurrentCoefficient0 related methods + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ + virtual void read_CurrentCoefficient0(Tango::Attribute &attr); + virtual void write_CurrentCoefficient0(Tango::WAttribute &attr); + virtual bool is_CurrentCoefficient0_allowed(Tango::AttReqType type); +/** + * Attribute CurrentCoefficient1 related methods + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ + virtual void read_CurrentCoefficient1(Tango::Attribute &attr); + virtual void write_CurrentCoefficient1(Tango::WAttribute &attr); + virtual bool is_CurrentCoefficient1_allowed(Tango::AttReqType type); +/** + * Attribute CurrentCoefficient2 related methods + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ + virtual void read_CurrentCoefficient2(Tango::Attribute &attr); + virtual void write_CurrentCoefficient2(Tango::WAttribute &attr); + virtual bool is_CurrentCoefficient2_allowed(Tango::AttReqType type); +/** + * Attribute AuxVoltageCoefficient0 related methods + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ + virtual void read_AuxVoltageCoefficient0(Tango::Attribute &attr); + virtual void write_AuxVoltageCoefficient0(Tango::WAttribute &attr); + virtual bool is_AuxVoltageCoefficient0_allowed(Tango::AttReqType type); +/** + * Attribute AuxVoltageCoefficient1 related methods + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ + virtual void read_AuxVoltageCoefficient1(Tango::Attribute &attr); + virtual void write_AuxVoltageCoefficient1(Tango::WAttribute &attr); + virtual bool is_AuxVoltageCoefficient1_allowed(Tango::AttReqType type); +/** + * Attribute VoltageCoefficient0 related methods + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ + virtual void read_VoltageCoefficient0(Tango::Attribute &attr); + virtual void write_VoltageCoefficient0(Tango::WAttribute &attr); + virtual bool is_VoltageCoefficient0_allowed(Tango::AttReqType type); +/** + * Attribute VoltageCoefficient1 related methods + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ + virtual void read_VoltageCoefficient1(Tango::Attribute &attr); + virtual void write_VoltageCoefficient1(Tango::WAttribute &attr); + virtual bool is_VoltageCoefficient1_allowed(Tango::AttReqType type); +/** + * Attribute DCCurrentCoefficient0 related methods + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ + virtual void read_DCCurrentCoefficient0(Tango::Attribute &attr); + virtual void write_DCCurrentCoefficient0(Tango::WAttribute &attr); + virtual bool is_DCCurrentCoefficient0_allowed(Tango::AttReqType type); +/** + * Attribute DCCurrentCoefficient1 related methods + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ + virtual void read_DCCurrentCoefficient1(Tango::Attribute &attr); + virtual void write_DCCurrentCoefficient1(Tango::WAttribute &attr); + virtual bool is_DCCurrentCoefficient1_allowed(Tango::AttReqType type); +/** + * Attribute ADCTempCoefficient0 related methods + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ + virtual void read_ADCTempCoefficient0(Tango::Attribute &attr); + virtual void write_ADCTempCoefficient0(Tango::WAttribute &attr); + virtual bool is_ADCTempCoefficient0_allowed(Tango::AttReqType type); +/** + * Attribute ADCTempCoefficient1 related methods + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ + virtual void read_ADCTempCoefficient1(Tango::Attribute &attr); + virtual void write_ADCTempCoefficient1(Tango::WAttribute &attr); + virtual bool is_ADCTempCoefficient1_allowed(Tango::AttReqType type); +/** + * Attribute HeatsinkTempCoefficient0 related methods + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ + virtual void read_HeatsinkTempCoefficient0(Tango::Attribute &attr); + virtual void write_HeatsinkTempCoefficient0(Tango::WAttribute &attr); + virtual bool is_HeatsinkTempCoefficient0_allowed(Tango::AttReqType type); +/** + * Attribute HeatsinkTempCoefficient1 related methods + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ + virtual void read_HeatsinkTempCoefficient1(Tango::Attribute &attr); + virtual void write_HeatsinkTempCoefficient1(Tango::WAttribute &attr); + virtual bool is_HeatsinkTempCoefficient1_allowed(Tango::AttReqType type); +/** + * Attribute SerialNumber related methods + * Description: + * + * Data type: Tango::DevString + * Attr type: Scalar + */ + virtual void read_SerialNumber(Tango::Attribute &attr); + virtual bool is_SerialNumber_allowed(Tango::AttReqType type); +/** + * Attribute Model related methods + * Description: + * + * Data type: Tango::DevString + * Attr type: Scalar + */ + virtual void read_Model(Tango::Attribute &attr); + virtual bool is_Model_allowed(Tango::AttReqType type); +/** + * Attribute CalibrationDate related methods + * Description: + * + * Data type: Tango::DevString + * Attr type: Scalar + */ + virtual void read_CalibrationDate(Tango::Attribute &attr); + virtual bool is_CalibrationDate_allowed(Tango::AttReqType type); +/** + * Attribute PulseDuration related methods + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ + virtual void read_PulseDuration(Tango::Attribute &attr); + virtual void write_PulseDuration(Tango::WAttribute &attr); + virtual bool is_PulseDuration_allowed(Tango::AttReqType type); +/** + * Attribute CurrentCoefficient3 related methods + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ + virtual void read_CurrentCoefficient3(Tango::Attribute &attr); + virtual void write_CurrentCoefficient3(Tango::WAttribute &attr); + virtual bool is_CurrentCoefficient3_allowed(Tango::AttReqType type); +/** + * Attribute DCurr related methods + * Description: + * + * Data type: Tango::DevDouble + * Attr type: Scalar + */ + virtual void write_DCurr(Tango::WAttribute &attr); + virtual bool is_DCurr_allowed(Tango::AttReqType type); +/** + * Attribute CurrentCoefficient4 related methods + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ + virtual void read_CurrentCoefficient4(Tango::Attribute &attr); + virtual void write_CurrentCoefficient4(Tango::WAttribute &attr); + virtual bool is_CurrentCoefficient4_allowed(Tango::AttReqType type); +/** + * Attribute CurrentCoefficient5 related methods + * Description: + * + * Data type: Tango::DevFloat + * Attr type: Scalar + */ + virtual void read_CurrentCoefficient5(Tango::Attribute &attr); + virtual void write_CurrentCoefficient5(Tango::WAttribute &attr); + virtual bool is_CurrentCoefficient5_allowed(Tango::AttReqType type); +/** + * Attribute PsStat related methods + * Description: + * + * Data type: Tango::DevBoolean + * Attr type: Spectrum max = 10 + */ + virtual void read_PsStat(Tango::Attribute &attr); + virtual bool is_PsStat_allowed(Tango::AttReqType type); + + + //-------------------------------------------------------- + /** + * Method : A2720::add_dynamic_attributes() + * Description : Add dynamic attributes if any. + */ + //-------------------------------------------------------- + void add_dynamic_attributes(); + + + + +// Command related methods +public: + /** + * Command StartCycling related method + * Description: + * + */ + virtual void start_cycling(); + virtual bool is_StartCycling_allowed(const CORBA::Any &any); + /** + * Command Abort related method + * Description: + * + */ + virtual void abort(); + virtual bool is_Abort_allowed(const CORBA::Any &any); + /** + * Command On related method + * Description: + * + */ + virtual void on(); + virtual bool is_On_allowed(const CORBA::Any &any); + /** + * Command Off related method + * Description: + * + */ + virtual void off(); + virtual bool is_Off_allowed(const CORBA::Any &any); + /** + * Command Reset related method + * Description: + * + */ + virtual void reset(); + virtual bool is_Reset_allowed(const CORBA::Any &any); + + + //-------------------------------------------------------- + /** + * Method : A2720::add_dynamic_commands() + * Description : Add dynamic commands if any. + */ + //-------------------------------------------------------- + void add_dynamic_commands(); + +/*----- PROTECTED REGION ID(A2720::Additional Method prototypes) ENABLED START -----*/ + +// Additional Method prototypes + int update(void); + bool is_writing_complete(void); + int write_current(float newcurr); + void wait(unsigned int millisecs); + +/*----- PROTECTED REGION END -----*/ // A2720::Additional Method prototypes +}; + +/*----- PROTECTED REGION ID(A2720::Additional Classes Definitions) ENABLED START -----*/ + +// Additional Classes Definitions +class A2720Worker : public omni_thread, public Tango::LogAdapter +{ + A2720 *device; + void run(void*); + + public: + A2720Worker(A2720 *device_) : + LogAdapter((Tango::DeviceImpl*)device_), + device(device_) { + device->cont = true; + } +}; + +/*----- PROTECTED REGION END -----*/ // A2720::Additional Classes Definitions + +} // End of namespace + +#endif // A2720_H diff --git a/src/A2720.xmi b/src/A2720.xmi new file mode 100644 index 0000000000000000000000000000000000000000..05f6907570ae5c9d8556a94dd3fef204e3b20452 --- /dev/null +++ b/src/A2720.xmi @@ -0,0 +1,661 @@ +<?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="A2720" pogoRevision="9.4"> + <description description="" title="" sourcePath="/home/alessio/fermi/servers/a2720/src" language="Cpp" filestogenerate="XMI file,Code files,Protected Regions" license="GPL" 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="PowerSupply" siteSpecific="" platform="Unix Like" bus="Socket" manufacturer="Elettra-Sincrotrone Trieste S.C.p.A." reference="A2720"/> + </description> + <classProperties name="CycRampSlopeCurr" description=""> + <type xsi:type="pogoDsl:DoubleType"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + </classProperties> + <classProperties name="CycMinCurr" description=""> + <type xsi:type="pogoDsl:DoubleType"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + </classProperties> + <classProperties name="CycMaxCurr" description=""> + <type xsi:type="pogoDsl:DoubleType"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + </classProperties> + <classProperties name="CycEndCurr" description=""> + <type xsi:type="pogoDsl:DoubleType"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + </classProperties> + <classProperties name="CycStartCurr" description=""> + <type xsi:type="pogoDsl:DoubleType"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + </classProperties> + <classProperties name="CycNumTimes" description=""> + <type xsi:type="pogoDsl:UIntType"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + </classProperties> + <classProperties name="CycWaitTime" description=""> + <type xsi:type="pogoDsl:UIntType"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + </classProperties> + <deviceProperties name="CycMinCurr" mandatory="true" description=""> + <type xsi:type="pogoDsl:DoubleType"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + </deviceProperties> + <deviceProperties name="CycMaxCurr" mandatory="true" description=""> + <type xsi:type="pogoDsl:DoubleType"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + </deviceProperties> + <deviceProperties name="CycEndCurr" mandatory="true" description=""> + <type xsi:type="pogoDsl:DoubleType"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + </deviceProperties> + <deviceProperties name="CycNumTimes" mandatory="true" description=""> + <type xsi:type="pogoDsl:UIntType"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + </deviceProperties> + <deviceProperties name="CycWaitTime" mandatory="true" description=""> + <type xsi:type="pogoDsl:UIntType"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + </deviceProperties> + <deviceProperties name="CycRampSlopeCurr" mandatory="true" description=""> + <type xsi:type="pogoDsl:DoubleType"/> + <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"/> + </argin> + <argout description="Device state"> + <type xsi:type="pogoDsl:StateType"/> + </argout> + <status abstract="true" inherited="true" concrete="true"/> + </commands> + <commands name="Status" description="This command gets the device status (stored in its device_status data member) and returns it to the caller." execMethod="dev_status" displayLevel="OPERATOR" polledPeriod="0"> + <argin description="none"> + <type xsi:type="pogoDsl:VoidType"/> + </argin> + <argout description="Device status"> + <type xsi:type="pogoDsl:ConstStringType"/> + </argout> + <status abstract="true" inherited="true" concrete="true"/> + </commands> + <commands name="StartCycling" description="" execMethod="start_cycling" 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>OFF</excludedStates> + <excludedStates>FAULT</excludedStates> + <excludedStates>UNKNOWN</excludedStates> + <excludedStates>MOVING</excludedStates> + <excludedStates>ALARM</excludedStates> + </commands> + <commands name="Abort" description="" execMethod="abort" 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>ON</excludedStates> + <excludedStates>OFF</excludedStates> + <excludedStates>FAULT</excludedStates> + <excludedStates>UNKNOWN</excludedStates> + <excludedStates>ALARM</excludedStates> + </commands> + <commands name="On" description="" execMethod="on" 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>FAULT</excludedStates> + <excludedStates>UNKNOWN</excludedStates> + <excludedStates>MOVING</excludedStates> + <excludedStates>ALARM</excludedStates> + </commands> + <commands name="Off" description="" execMethod="off" 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>FAULT</excludedStates> + <excludedStates>UNKNOWN</excludedStates> + <excludedStates>MOVING</excludedStates> + <excludedStates>ALARM</excludedStates> + </commands> + <commands name="Reset" description="" execMethod="reset" 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>ON</excludedStates> + <excludedStates>OFF</excludedStates> + <excludedStates>UNKNOWN</excludedStates> + <excludedStates>MOVING</excludedStates> + <excludedStates>ALARM</excludedStates> + </commands> + <attributes name="Current" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:DoubleType"/> + <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="Current" unit="A" standardUnit="1.0" displayUnit="A" format="%.6f" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <readExcludedStates>UNKNOWN</readExcludedStates> + <readExcludedStates>ALARM</readExcludedStates> + <writeExcludedStates>OFF</writeExcludedStates> + <writeExcludedStates>FAULT</writeExcludedStates> + <writeExcludedStates>UNKNOWN</writeExcludedStates> + <writeExcludedStates>MOVING</writeExcludedStates> + <writeExcludedStates>ALARM</writeExcludedStates> + </attributes> + <attributes name="Voltage" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:DoubleType"/> + <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="Voltage" unit="V" standardUnit="1.0" displayUnit="V" format="%.6f" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <readExcludedStates>UNKNOWN</readExcludedStates> + <readExcludedStates>ALARM</readExcludedStates> + </attributes> + <attributes name="CurrentSet" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:DoubleType"/> + <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="Current set" unit="A" standardUnit="1.0" displayUnit="A" format="%.6f" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <readExcludedStates>UNKNOWN</readExcludedStates> + <readExcludedStates>ALARM</readExcludedStates> + </attributes> + <attributes name="AuxiliaryVoltage" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:DoubleType"/> + <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="Auxiliary voltage" unit="V" standardUnit="1.0" displayUnit="V" format="%.6f" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <readExcludedStates>UNKNOWN</readExcludedStates> + <readExcludedStates>ALARM</readExcludedStates> + </attributes> + <attributes name="DCLinkVoltage" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:DoubleType"/> + <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="DC link voltage" unit="V" standardUnit="1.0" displayUnit="V" format="%.6f" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <readExcludedStates>UNKNOWN</readExcludedStates> + <readExcludedStates>ALARM</readExcludedStates> + </attributes> + <attributes name="ADCTemperature" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:FloatType"/> + <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="ADC temperature" unit="C" standardUnit="1.0" displayUnit="C" format="%.6f" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <readExcludedStates>UNKNOWN</readExcludedStates> + <readExcludedStates>ALARM</readExcludedStates> + </attributes> + <attributes name="HeatsinkTemperature" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:FloatType"/> + <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="Heatsink temperature" unit="C" standardUnit="1.0" displayUnit="C" format="%.6f" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <readExcludedStates>UNKNOWN</readExcludedStates> + <readExcludedStates>ALARM</readExcludedStates> + </attributes> + <attributes name="PRU0Firmware" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:FloatType"/> + <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="PRU0 firmware" unit="" standardUnit="" displayUnit="" format="%.2f" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <readExcludedStates>UNKNOWN</readExcludedStates> + <readExcludedStates>ALARM</readExcludedStates> + </attributes> + <attributes name="PRU1Firmware" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:FloatType"/> + <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="PRU1 firmware" unit="" standardUnit="" displayUnit="" format="%.2f" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <readExcludedStates>UNKNOWN</readExcludedStates> + <readExcludedStates>ALARM</readExcludedStates> + </attributes> + <attributes name="KPCoefficient" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:FloatType"/> + <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="KP coefficient" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <readExcludedStates>UNKNOWN</readExcludedStates> + <readExcludedStates>ALARM</readExcludedStates> + <writeExcludedStates>OFF</writeExcludedStates> + <writeExcludedStates>FAULT</writeExcludedStates> + <writeExcludedStates>UNKNOWN</writeExcludedStates> + <writeExcludedStates>MOVING</writeExcludedStates> + <writeExcludedStates>ALARM</writeExcludedStates> + </attributes> + <attributes name="KICoefficient" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:FloatType"/> + <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="KI coefficient" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <readExcludedStates>UNKNOWN</readExcludedStates> + <readExcludedStates>ALARM</readExcludedStates> + <writeExcludedStates>OFF</writeExcludedStates> + <writeExcludedStates>FAULT</writeExcludedStates> + <writeExcludedStates>UNKNOWN</writeExcludedStates> + <writeExcludedStates>MOVING</writeExcludedStates> + <writeExcludedStates>ALARM</writeExcludedStates> + </attributes> + <attributes name="KFFCoefficient" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:FloatType"/> + <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="KFF coefficient" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <readExcludedStates>UNKNOWN</readExcludedStates> + <readExcludedStates>ALARM</readExcludedStates> + <writeExcludedStates>OFF</writeExcludedStates> + <writeExcludedStates>FAULT</writeExcludedStates> + <writeExcludedStates>UNKNOWN</writeExcludedStates> + <writeExcludedStates>MOVING</writeExcludedStates> + <writeExcludedStates>ALARM</writeExcludedStates> + </attributes> + <attributes name="SlewRate" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:FloatType"/> + <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="Slewrate" unit="A/s" standardUnit="1.0" displayUnit="A/s" format="%.6f" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <readExcludedStates>UNKNOWN</readExcludedStates> + <readExcludedStates>ALARM</readExcludedStates> + <writeExcludedStates>OFF</writeExcludedStates> + <writeExcludedStates>FAULT</writeExcludedStates> + <writeExcludedStates>UNKNOWN</writeExcludedStates> + <writeExcludedStates>MOVING</writeExcludedStates> + <writeExcludedStates>ALARM</writeExcludedStates> + </attributes> + <attributes name="CurrentMin" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:FloatType"/> + <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="CurrentMin" unit="A" standardUnit="1.0" displayUnit="A" format="%.6f" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <readExcludedStates>UNKNOWN</readExcludedStates> + <readExcludedStates>ALARM</readExcludedStates> + <writeExcludedStates>OFF</writeExcludedStates> + <writeExcludedStates>FAULT</writeExcludedStates> + <writeExcludedStates>UNKNOWN</writeExcludedStates> + <writeExcludedStates>MOVING</writeExcludedStates> + <writeExcludedStates>ALARM</writeExcludedStates> + </attributes> + <attributes name="CurrentMax" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:FloatType"/> + <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="CurrentMax" unit="A" standardUnit="1.0" displayUnit="A" format="%.6f" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <readExcludedStates>UNKNOWN</readExcludedStates> + <readExcludedStates>ALARM</readExcludedStates> + <writeExcludedStates>OFF</writeExcludedStates> + <writeExcludedStates>FAULT</writeExcludedStates> + <writeExcludedStates>UNKNOWN</writeExcludedStates> + <writeExcludedStates>MOVING</writeExcludedStates> + <writeExcludedStates>ALARM</writeExcludedStates> + </attributes> + <attributes name="CurrentCoefficient0" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:FloatType"/> + <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="Current coefficient 0" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <readExcludedStates>UNKNOWN</readExcludedStates> + <readExcludedStates>ALARM</readExcludedStates> + <writeExcludedStates>OFF</writeExcludedStates> + <writeExcludedStates>FAULT</writeExcludedStates> + <writeExcludedStates>UNKNOWN</writeExcludedStates> + <writeExcludedStates>MOVING</writeExcludedStates> + <writeExcludedStates>ALARM</writeExcludedStates> + </attributes> + <attributes name="CurrentCoefficient1" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:FloatType"/> + <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="Current coefficient 1" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <readExcludedStates>UNKNOWN</readExcludedStates> + <readExcludedStates>ALARM</readExcludedStates> + <writeExcludedStates>OFF</writeExcludedStates> + <writeExcludedStates>FAULT</writeExcludedStates> + <writeExcludedStates>UNKNOWN</writeExcludedStates> + <writeExcludedStates>MOVING</writeExcludedStates> + <writeExcludedStates>ALARM</writeExcludedStates> + </attributes> + <attributes name="CurrentCoefficient2" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:FloatType"/> + <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="Current coefficient 2" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <readExcludedStates>UNKNOWN</readExcludedStates> + <readExcludedStates>ALARM</readExcludedStates> + <writeExcludedStates>OFF</writeExcludedStates> + <writeExcludedStates>FAULT</writeExcludedStates> + <writeExcludedStates>UNKNOWN</writeExcludedStates> + <writeExcludedStates>MOVING</writeExcludedStates> + <writeExcludedStates>ALARM</writeExcludedStates> + </attributes> + <attributes name="AuxVoltageCoefficient0" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:FloatType"/> + <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="Auxiliary voltage coefficient 0" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <readExcludedStates>UNKNOWN</readExcludedStates> + <readExcludedStates>ALARM</readExcludedStates> + <writeExcludedStates>OFF</writeExcludedStates> + <writeExcludedStates>FAULT</writeExcludedStates> + <writeExcludedStates>UNKNOWN</writeExcludedStates> + <writeExcludedStates>MOVING</writeExcludedStates> + <writeExcludedStates>ALARM</writeExcludedStates> + </attributes> + <attributes name="AuxVoltageCoefficient1" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:FloatType"/> + <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="Auxiliary voltage coefficient 1" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <readExcludedStates>UNKNOWN</readExcludedStates> + <readExcludedStates>ALARM</readExcludedStates> + <writeExcludedStates>OFF</writeExcludedStates> + <writeExcludedStates>FAULT</writeExcludedStates> + <writeExcludedStates>UNKNOWN</writeExcludedStates> + <writeExcludedStates>MOVING</writeExcludedStates> + <writeExcludedStates>ALARM</writeExcludedStates> + </attributes> + <attributes name="VoltageCoefficient0" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:FloatType"/> + <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="Voltage coefficient 0" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <readExcludedStates>UNKNOWN</readExcludedStates> + <readExcludedStates>ALARM</readExcludedStates> + <writeExcludedStates>OFF</writeExcludedStates> + <writeExcludedStates>FAULT</writeExcludedStates> + <writeExcludedStates>UNKNOWN</writeExcludedStates> + <writeExcludedStates>MOVING</writeExcludedStates> + <writeExcludedStates>ALARM</writeExcludedStates> + </attributes> + <attributes name="VoltageCoefficient1" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:FloatType"/> + <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="Voltage coefficient 1" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <readExcludedStates>UNKNOWN</readExcludedStates> + <readExcludedStates>ALARM</readExcludedStates> + <writeExcludedStates>OFF</writeExcludedStates> + <writeExcludedStates>FAULT</writeExcludedStates> + <writeExcludedStates>UNKNOWN</writeExcludedStates> + <writeExcludedStates>MOVING</writeExcludedStates> + <writeExcludedStates>ALARM</writeExcludedStates> + </attributes> + <attributes name="DCCurrentCoefficient0" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:FloatType"/> + <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="DC current coefficient 0" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <readExcludedStates>UNKNOWN</readExcludedStates> + <readExcludedStates>ALARM</readExcludedStates> + <writeExcludedStates>OFF</writeExcludedStates> + <writeExcludedStates>FAULT</writeExcludedStates> + <writeExcludedStates>UNKNOWN</writeExcludedStates> + <writeExcludedStates>MOVING</writeExcludedStates> + <writeExcludedStates>ALARM</writeExcludedStates> + </attributes> + <attributes name="DCCurrentCoefficient1" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:FloatType"/> + <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="DC current coefficient 1" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <readExcludedStates>UNKNOWN</readExcludedStates> + <readExcludedStates>ALARM</readExcludedStates> + <writeExcludedStates>OFF</writeExcludedStates> + <writeExcludedStates>FAULT</writeExcludedStates> + <writeExcludedStates>UNKNOWN</writeExcludedStates> + <writeExcludedStates>MOVING</writeExcludedStates> + <writeExcludedStates>ALARM</writeExcludedStates> + </attributes> + <attributes name="ADCTempCoefficient0" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:FloatType"/> + <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="ADC temperature coefficient 0" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <readExcludedStates>UNKNOWN</readExcludedStates> + <readExcludedStates>ALARM</readExcludedStates> + <writeExcludedStates>OFF</writeExcludedStates> + <writeExcludedStates>FAULT</writeExcludedStates> + <writeExcludedStates>UNKNOWN</writeExcludedStates> + <writeExcludedStates>MOVING</writeExcludedStates> + <writeExcludedStates>ALARM</writeExcludedStates> + </attributes> + <attributes name="ADCTempCoefficient1" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:FloatType"/> + <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="ADC temperature coefficient 1" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <readExcludedStates>UNKNOWN</readExcludedStates> + <readExcludedStates>ALARM</readExcludedStates> + <writeExcludedStates>OFF</writeExcludedStates> + <writeExcludedStates>FAULT</writeExcludedStates> + <writeExcludedStates>UNKNOWN</writeExcludedStates> + <writeExcludedStates>MOVING</writeExcludedStates> + <writeExcludedStates>ALARM</writeExcludedStates> + </attributes> + <attributes name="HeatsinkTempCoefficient0" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:FloatType"/> + <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="Heatsink temperature coefficient 0" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <readExcludedStates>UNKNOWN</readExcludedStates> + <readExcludedStates>ALARM</readExcludedStates> + <writeExcludedStates>OFF</writeExcludedStates> + <writeExcludedStates>FAULT</writeExcludedStates> + <writeExcludedStates>UNKNOWN</writeExcludedStates> + <writeExcludedStates>MOVING</writeExcludedStates> + <writeExcludedStates>ALARM</writeExcludedStates> + </attributes> + <attributes name="HeatsinkTempCoefficient1" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:FloatType"/> + <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="Heatsink temperature coefficient 1" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <readExcludedStates>UNKNOWN</readExcludedStates> + <readExcludedStates>ALARM</readExcludedStates> + <writeExcludedStates>OFF</writeExcludedStates> + <writeExcludedStates>FAULT</writeExcludedStates> + <writeExcludedStates>UNKNOWN</writeExcludedStates> + <writeExcludedStates>MOVING</writeExcludedStates> + <writeExcludedStates>ALARM</writeExcludedStates> + </attributes> + <attributes name="SerialNumber" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:StringType"/> + <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="Serial number" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <readExcludedStates>UNKNOWN</readExcludedStates> + <readExcludedStates>ALARM</readExcludedStates> + </attributes> + <attributes name="Model" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:StringType"/> + <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="Model" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <readExcludedStates>UNKNOWN</readExcludedStates> + <readExcludedStates>ALARM</readExcludedStates> + </attributes> + <attributes name="CalibrationDate" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:StringType"/> + <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="Calibration date" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <readExcludedStates>UNKNOWN</readExcludedStates> + <readExcludedStates>ALARM</readExcludedStates> + </attributes> + <attributes name="PulseDuration" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:FloatType"/> + <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="Pulse duration" unit="ms" standardUnit="1.0" displayUnit="ms" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <readExcludedStates>UNKNOWN</readExcludedStates> + <readExcludedStates>ALARM</readExcludedStates> + <writeExcludedStates>OFF</writeExcludedStates> + <writeExcludedStates>FAULT</writeExcludedStates> + <writeExcludedStates>UNKNOWN</writeExcludedStates> + <writeExcludedStates>MOVING</writeExcludedStates> + <writeExcludedStates>ALARM</writeExcludedStates> + </attributes> + <attributes name="CurrentCoefficient3" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:FloatType"/> + <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="Current coefficient 3" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <readExcludedStates>UNKNOWN</readExcludedStates> + <readExcludedStates>ALARM</readExcludedStates> + <writeExcludedStates>OFF</writeExcludedStates> + <writeExcludedStates>FAULT</writeExcludedStates> + <writeExcludedStates>UNKNOWN</writeExcludedStates> + <writeExcludedStates>MOVING</writeExcludedStates> + <writeExcludedStates>ALARM</writeExcludedStates> + </attributes> + <attributes name="DCurr" attType="Scalar" rwType="WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="false" isDynamic="false"> + <dataType xsi:type="pogoDsl:DoubleType"/> + <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="A" standardUnit="1.0" displayUnit="A" format="%.6f" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <readExcludedStates>UNKNOWN</readExcludedStates> + <readExcludedStates>ALARM</readExcludedStates> + <writeExcludedStates>OFF</writeExcludedStates> + <writeExcludedStates>FAULT</writeExcludedStates> + <writeExcludedStates>UNKNOWN</writeExcludedStates> + <writeExcludedStates>MOVING</writeExcludedStates> + <writeExcludedStates>ALARM</writeExcludedStates> + </attributes> + <attributes name="CurrentCoefficient4" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:FloatType"/> + <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="Current coefficient 4" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <readExcludedStates>UNKNOWN</readExcludedStates> + <readExcludedStates>ALARM</readExcludedStates> + <writeExcludedStates>OFF</writeExcludedStates> + <writeExcludedStates>FAULT</writeExcludedStates> + <writeExcludedStates>UNKNOWN</writeExcludedStates> + <writeExcludedStates>MOVING</writeExcludedStates> + <writeExcludedStates>ALARM</writeExcludedStates> + </attributes> + <attributes name="CurrentCoefficient5" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:FloatType"/> + <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="Current coefficient 5" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <readExcludedStates>UNKNOWN</readExcludedStates> + <readExcludedStates>ALARM</readExcludedStates> + <writeExcludedStates>OFF</writeExcludedStates> + <writeExcludedStates>FAULT</writeExcludedStates> + <writeExcludedStates>UNKNOWN</writeExcludedStates> + <writeExcludedStates>MOVING</writeExcludedStates> + <writeExcludedStates>ALARM</writeExcludedStates> + </attributes> + <attributes name="PsStat" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="10" 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> + <readExcludedStates>ALARM</readExcludedStates> + </attributes> + <states name="ON" description=""> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + </states> + <states name="OFF" description=""> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + </states> + <states name="FAULT" description=""> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + </states> + <states name="UNKNOWN" description=""> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + </states> + <states name="MOVING" description=""> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + </states> + <states name="ALARM" description=""> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + </states> + <preferences docHome="./doc_html" makefileHome="$(TANGO_HOME)"/> + </classes> +</pogoDsl:PogoSystem> diff --git a/src/A2720Class.cpp b/src/A2720Class.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5a7e75d3de5d28f7cefe2cdacbb7430e00982831 --- /dev/null +++ b/src/A2720Class.cpp @@ -0,0 +1,1887 @@ +/*----- PROTECTED REGION ID(A2720Class.cpp) ENABLED START -----*/ +static const char *RcsId = "$Id: A2720Class.cpp,v 1.4 2018-02-19 16:52:13 alessio Exp $"; +static const char *TagName = "A2720 $Name: $"; +static const char *CvsPath = "$Source: /home/cvsadm/cvsroot/fermi/servers/a2720/src/A2720Class.cpp,v $"; +static const char *SvnPath = "$HeadURL: $"; +static const char *HttpServer = "http://www.esrf.eu/computing/cs/tango/tango_doc/ds_doc/"; +//============================================================================= +// +// file : A2720Class.cpp +// +// description : C++ source for the A2720Class. +// A singleton class derived from DeviceClass. +// It implements the command and attribute list +// and all properties and methods required +// by the A2720 once per process. +// +// project : +// +// This file is part of Tango device class. +// +// Tango is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Tango is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Tango. If not, see <http://www.gnu.org/licenses/>. +// +// $Author: alessio $ +// +// $Revision: 1.4 $ +// $Date: 2018-02-19 16:52:13 $ +// +// $HeadURL: $ +// +//============================================================================= +// This file is generated by POGO +// (Program Obviously used to Generate tango Object) +//============================================================================= + + +#include <A2720Class.h> + +/*----- PROTECTED REGION END -----*/ // A2720Class.cpp + +//------------------------------------------------------------------- +/** + * Create A2720Class singleton and + * return it in a C function for Python usage + */ +//------------------------------------------------------------------- +extern "C" { +#ifdef _TG_WINDOWS_ + +__declspec(dllexport) + +#endif + + Tango::DeviceClass *_create_A2720_class(const char *name) { + return A2720_ns::A2720Class::init(name); + } +} + +namespace A2720_ns +{ +//=================================================================== +// Initialize pointer for singleton pattern +//=================================================================== +A2720Class *A2720Class::_instance = NULL; + +//-------------------------------------------------------- +/** + * method : A2720Class::A2720Class(string &s) + * description : constructor for the A2720Class + * + * @param s The class name + */ +//-------------------------------------------------------- +A2720Class::A2720Class(string &s):Tango::DeviceClass(s) +{ + cout2 << "Entering A2720Class constructor" << endl; + set_default_property(); + get_class_property(); + write_class_property(); + + /*----- PROTECTED REGION ID(A2720Class::constructor) ENABLED START -----*/ + + /*----- PROTECTED REGION END -----*/ // A2720Class::constructor + + cout2 << "Leaving A2720Class constructor" << endl; +} + +//-------------------------------------------------------- +/** + * method : A2720Class::~A2720Class() + * description : destructor for the A2720Class + */ +//-------------------------------------------------------- +A2720Class::~A2720Class() +{ + /*----- PROTECTED REGION ID(A2720Class::destructor) ENABLED START -----*/ + + /*----- PROTECTED REGION END -----*/ // A2720Class::destructor + + _instance = NULL; +} + + +//-------------------------------------------------------- +/** + * method : A2720Class::init + * description : Create the object if not already done. + * Otherwise, just return a pointer to the object + * + * @param name The class name + */ +//-------------------------------------------------------- +A2720Class *A2720Class::init(const char *name) +{ + if (_instance == NULL) + { + try + { + string s(name); + _instance = new A2720Class(s); + } + catch (bad_alloc &) + { + throw; + } + } + return _instance; +} + +//-------------------------------------------------------- +/** + * method : A2720Class::instance + * description : Check if object already created, + * and return a pointer to the object + */ +//-------------------------------------------------------- +A2720Class *A2720Class::instance() +{ + if (_instance == NULL) + { + cerr << "Class is not initialised !!" << endl; + exit(-1); + } + return _instance; +} + + + +//=================================================================== +// Command execution method calls +//=================================================================== +//-------------------------------------------------------- +/** + * method : StartCyclingClass::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 *StartCyclingClass::execute(Tango::DeviceImpl *device, TANGO_UNUSED(const CORBA::Any &in_any)) +{ + cout2 << "StartCyclingClass::execute(): arrived" << endl; + ((static_cast<A2720 *>(device))->start_cycling()); + return new CORBA::Any(); +} + +//-------------------------------------------------------- +/** + * method : AbortClass::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 *AbortClass::execute(Tango::DeviceImpl *device, TANGO_UNUSED(const CORBA::Any &in_any)) +{ + cout2 << "AbortClass::execute(): arrived" << endl; + ((static_cast<A2720 *>(device))->abort()); + return new CORBA::Any(); +} + +//-------------------------------------------------------- +/** + * method : OnClass::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 *OnClass::execute(Tango::DeviceImpl *device, TANGO_UNUSED(const CORBA::Any &in_any)) +{ + cout2 << "OnClass::execute(): arrived" << endl; + ((static_cast<A2720 *>(device))->on()); + return new CORBA::Any(); +} + +//-------------------------------------------------------- +/** + * method : OffClass::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 *OffClass::execute(Tango::DeviceImpl *device, TANGO_UNUSED(const CORBA::Any &in_any)) +{ + cout2 << "OffClass::execute(): arrived" << endl; + ((static_cast<A2720 *>(device))->off()); + return new CORBA::Any(); +} + +//-------------------------------------------------------- +/** + * method : ResetClass::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 *ResetClass::execute(Tango::DeviceImpl *device, TANGO_UNUSED(const CORBA::Any &in_any)) +{ + cout2 << "ResetClass::execute(): arrived" << endl; + ((static_cast<A2720 *>(device))->reset()); + return new CORBA::Any(); +} + + +//=================================================================== +// Properties management +//=================================================================== +//-------------------------------------------------------- +/** + * Method : A2720Class::get_class_property() + * Description : Get the class property for specified name. + */ +//-------------------------------------------------------- +Tango::DbDatum A2720Class::get_class_property(string &prop_name) +{ + for (unsigned int i=0 ; i<cl_prop.size() ; i++) + if (cl_prop[i].name == prop_name) + return cl_prop[i]; + // if not found, returns an empty DbDatum + return Tango::DbDatum(prop_name); +} + +//-------------------------------------------------------- +/** + * Method : A2720Class::get_default_device_property() + * Description : Return the default value for device property. + */ +//-------------------------------------------------------- +Tango::DbDatum A2720Class::get_default_device_property(string &prop_name) +{ + for (unsigned int i=0 ; i<dev_def_prop.size() ; i++) + if (dev_def_prop[i].name == prop_name) + return dev_def_prop[i]; + // if not found, return an empty DbDatum + return Tango::DbDatum(prop_name); +} + +//-------------------------------------------------------- +/** + * Method : A2720Class::get_default_class_property() + * Description : Return the default value for class property. + */ +//-------------------------------------------------------- +Tango::DbDatum A2720Class::get_default_class_property(string &prop_name) +{ + for (unsigned int i=0 ; i<cl_def_prop.size() ; i++) + if (cl_def_prop[i].name == prop_name) + return cl_def_prop[i]; + // if not found, return an empty DbDatum + return Tango::DbDatum(prop_name); +} + +//-------------------------------------------------------- +/** + * Method : A2720Class::get_class_property() + * Description : Read database to initialize class property data members. + */ +//-------------------------------------------------------- +void A2720Class::get_class_property() +{ + /*----- PROTECTED REGION ID(A2720Class::get_class_property_before) ENABLED START -----*/ + + // Initialize class property data members + + /*----- PROTECTED REGION END -----*/ // A2720Class::get_class_property_before + // Read class properties from database. + cl_prop.push_back(Tango::DbDatum("CycRampSlopeCurr")); + cl_prop.push_back(Tango::DbDatum("CycMinCurr")); + cl_prop.push_back(Tango::DbDatum("CycMaxCurr")); + cl_prop.push_back(Tango::DbDatum("CycEndCurr")); + cl_prop.push_back(Tango::DbDatum("CycStartCurr")); + cl_prop.push_back(Tango::DbDatum("CycNumTimes")); + cl_prop.push_back(Tango::DbDatum("CycWaitTime")); + + // Call database and extract values + if (Tango::Util::instance()->_UseDb==true) + get_db_class()->get_property(cl_prop); + Tango::DbDatum def_prop; + int i = -1; + + // Try to extract CycRampSlopeCurr value + if (cl_prop[++i].is_empty()==false) cl_prop[i] >> cycRampSlopeCurr; + else + { + // Check default value for CycRampSlopeCurr + def_prop = get_default_class_property(cl_prop[i].name); + if (def_prop.is_empty()==false) + { + def_prop >> cycRampSlopeCurr; + cl_prop[i] << cycRampSlopeCurr; + } + } + // Try to extract CycMinCurr value + if (cl_prop[++i].is_empty()==false) cl_prop[i] >> cycMinCurr; + else + { + // Check default value for CycMinCurr + def_prop = get_default_class_property(cl_prop[i].name); + if (def_prop.is_empty()==false) + { + def_prop >> cycMinCurr; + cl_prop[i] << cycMinCurr; + } + } + // Try to extract CycMaxCurr value + if (cl_prop[++i].is_empty()==false) cl_prop[i] >> cycMaxCurr; + else + { + // Check default value for CycMaxCurr + def_prop = get_default_class_property(cl_prop[i].name); + if (def_prop.is_empty()==false) + { + def_prop >> cycMaxCurr; + cl_prop[i] << cycMaxCurr; + } + } + // Try to extract CycEndCurr value + if (cl_prop[++i].is_empty()==false) cl_prop[i] >> cycEndCurr; + else + { + // Check default value for CycEndCurr + def_prop = get_default_class_property(cl_prop[i].name); + if (def_prop.is_empty()==false) + { + def_prop >> cycEndCurr; + cl_prop[i] << cycEndCurr; + } + } + // Try to extract CycStartCurr value + if (cl_prop[++i].is_empty()==false) cl_prop[i] >> cycStartCurr; + else + { + // Check default value for CycStartCurr + def_prop = get_default_class_property(cl_prop[i].name); + if (def_prop.is_empty()==false) + { + def_prop >> cycStartCurr; + cl_prop[i] << cycStartCurr; + } + } + // Try to extract CycNumTimes value + if (cl_prop[++i].is_empty()==false) cl_prop[i] >> cycNumTimes; + else + { + // Check default value for CycNumTimes + def_prop = get_default_class_property(cl_prop[i].name); + if (def_prop.is_empty()==false) + { + def_prop >> cycNumTimes; + cl_prop[i] << cycNumTimes; + } + } + // Try to extract CycWaitTime value + if (cl_prop[++i].is_empty()==false) cl_prop[i] >> cycWaitTime; + else + { + // Check default value for CycWaitTime + def_prop = get_default_class_property(cl_prop[i].name); + if (def_prop.is_empty()==false) + { + def_prop >> cycWaitTime; + cl_prop[i] << cycWaitTime; + } + } + /*----- PROTECTED REGION ID(A2720Class::get_class_property_after) ENABLED START -----*/ + + // Check class property data members init + + /*----- PROTECTED REGION END -----*/ // A2720Class::get_class_property_after + +} + +//-------------------------------------------------------- +/** + * Method : A2720Class::set_default_property() + * Description : Set default property (class and device) for wizard. + * For each property, add to wizard property name and description. + * If default value has been set, add it to wizard property and + * store it in a DbDatum. + */ +//-------------------------------------------------------- +void A2720Class::set_default_property() +{ + string prop_name; + string prop_desc; + string prop_def; + vector<string> vect_data; + + // Set Default Class Properties + prop_name = "CycRampSlopeCurr"; + prop_desc = ""; + prop_def = ""; + vect_data.clear(); + if (prop_def.length()>0) + { + Tango::DbDatum data(prop_name); + data << vect_data ; + cl_def_prop.push_back(data); + add_wiz_class_prop(prop_name, prop_desc, prop_def); + } + else + add_wiz_class_prop(prop_name, prop_desc); + prop_name = "CycMinCurr"; + prop_desc = ""; + prop_def = ""; + vect_data.clear(); + if (prop_def.length()>0) + { + Tango::DbDatum data(prop_name); + data << vect_data ; + cl_def_prop.push_back(data); + add_wiz_class_prop(prop_name, prop_desc, prop_def); + } + else + add_wiz_class_prop(prop_name, prop_desc); + prop_name = "CycMaxCurr"; + prop_desc = ""; + prop_def = ""; + vect_data.clear(); + if (prop_def.length()>0) + { + Tango::DbDatum data(prop_name); + data << vect_data ; + cl_def_prop.push_back(data); + add_wiz_class_prop(prop_name, prop_desc, prop_def); + } + else + add_wiz_class_prop(prop_name, prop_desc); + prop_name = "CycEndCurr"; + prop_desc = ""; + prop_def = ""; + vect_data.clear(); + if (prop_def.length()>0) + { + Tango::DbDatum data(prop_name); + data << vect_data ; + cl_def_prop.push_back(data); + add_wiz_class_prop(prop_name, prop_desc, prop_def); + } + else + add_wiz_class_prop(prop_name, prop_desc); + prop_name = "CycStartCurr"; + prop_desc = ""; + prop_def = ""; + vect_data.clear(); + if (prop_def.length()>0) + { + Tango::DbDatum data(prop_name); + data << vect_data ; + cl_def_prop.push_back(data); + add_wiz_class_prop(prop_name, prop_desc, prop_def); + } + else + add_wiz_class_prop(prop_name, prop_desc); + prop_name = "CycNumTimes"; + prop_desc = ""; + prop_def = ""; + vect_data.clear(); + if (prop_def.length()>0) + { + Tango::DbDatum data(prop_name); + data << vect_data ; + cl_def_prop.push_back(data); + add_wiz_class_prop(prop_name, prop_desc, prop_def); + } + else + add_wiz_class_prop(prop_name, prop_desc); + prop_name = "CycWaitTime"; + prop_desc = ""; + prop_def = ""; + vect_data.clear(); + if (prop_def.length()>0) + { + Tango::DbDatum data(prop_name); + data << vect_data ; + cl_def_prop.push_back(data); + add_wiz_class_prop(prop_name, prop_desc, prop_def); + } + else + add_wiz_class_prop(prop_name, prop_desc); + + // Set Default device Properties + prop_name = "CycMinCurr"; + 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 = "CycMaxCurr"; + 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 = "CycEndCurr"; + 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 = "CycNumTimes"; + 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 = "CycWaitTime"; + 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 = "CycRampSlopeCurr"; + 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); +} + +//-------------------------------------------------------- +/** + * Method : A2720Class::write_class_property() + * Description : Set class description fields as property in database + */ +//-------------------------------------------------------- +void A2720Class::write_class_property() +{ + // First time, check if database used + if (Tango::Util::_UseDb == false) + return; + + Tango::DbData data; + string classname = get_name(); + string header; + string::size_type start, end; + + // Put title + Tango::DbDatum title("ProjectTitle"); + string str_title(""); + title << str_title; + data.push_back(title); + + // Put Description + Tango::DbDatum description("Description"); + vector<string> str_desc; + str_desc.push_back(""); + description << str_desc; + data.push_back(description); + + // put cvs or svn location + string filename("A2720"); + filename += "Class.cpp"; + + // check for cvs information + string src_path(CvsPath); + start = src_path.find("/"); + if (start!=string::npos) + { + end = src_path.find(filename); + if (end>start) + { + string strloc = src_path.substr(start, end-start); + // Check if specific repository + start = strloc.find("/cvsroot/"); + if (start!=string::npos && start>0) + { + string repository = strloc.substr(0, start); + if (repository.find("/segfs/")!=string::npos) + strloc = "ESRF:" + strloc.substr(start, strloc.length()-start); + } + Tango::DbDatum cvs_loc("cvs_location"); + cvs_loc << strloc; + data.push_back(cvs_loc); + } + } + + // check for svn information + else + { + string src_path(SvnPath); + start = src_path.find("://"); + if (start!=string::npos) + { + end = src_path.find(filename); + if (end>start) + { + header = "$HeadURL: "; + start = header.length(); + string strloc = src_path.substr(start, (end-start)); + + Tango::DbDatum svn_loc("svn_location"); + svn_loc << strloc; + data.push_back(svn_loc); + } + } + } + + // Get CVS or SVN revision tag + + // CVS tag + string tagname(TagName); + header = "$Name: "; + start = header.length(); + string endstr(" $"); + + end = tagname.find(endstr); + if (end!=string::npos && end>start) + { + string strtag = tagname.substr(start, end-start); + Tango::DbDatum cvs_tag("cvs_tag"); + cvs_tag << strtag; + data.push_back(cvs_tag); + } + + // SVN tag + string svnpath(SvnPath); + header = "$HeadURL: "; + start = header.length(); + + end = svnpath.find(endstr); + if (end!=string::npos && end>start) + { + string strloc = svnpath.substr(start, end-start); + + string tagstr ("/tags/"); + start = strloc.find(tagstr); + if ( start!=string::npos ) + { + start = start + tagstr.length(); + end = strloc.find(filename); + string strtag = strloc.substr(start, end-start-1); + + Tango::DbDatum svn_tag("svn_tag"); + svn_tag << strtag; + data.push_back(svn_tag); + } + } + + // Get URL location + string httpServ(HttpServer); + if (httpServ.length()>0) + { + Tango::DbDatum db_doc_url("doc_url"); + db_doc_url << httpServ; + data.push_back(db_doc_url); + } + + // Put inheritance + Tango::DbDatum inher_datum("InheritedFrom"); + vector<string> inheritance; + inheritance.push_back("TANGO_BASE_CLASS"); + inher_datum << inheritance; + data.push_back(inher_datum); + + // Call database and and values + get_db_class()->put_property(data); +} + +//=================================================================== +// Factory methods +//=================================================================== + +//-------------------------------------------------------- +/** + * Method : A2720Class::device_factory() + * Description : Create the device object(s) + * and store them in the device list + */ +//-------------------------------------------------------- +void A2720Class::device_factory(const Tango::DevVarStringArray *devlist_ptr) +{ + /*----- PROTECTED REGION ID(A2720Class::device_factory_before) ENABLED START -----*/ + + // Add your own code + + /*----- PROTECTED REGION END -----*/ // A2720Class::device_factory_before + + // Create devices and add it into the device list + for (unsigned long i=0 ; i<devlist_ptr->length() ; i++) + { + cout4 << "Device name : " << (*devlist_ptr)[i].in() << endl; + device_list.push_back(new A2720(this, (*devlist_ptr)[i])); + } + + // Manage dynamic attributes if any + erase_dynamic_attributes(devlist_ptr, get_class_attr()->get_attr_list()); + + // Export devices to the outside world + for (unsigned long i=1 ; i<=devlist_ptr->length() ; i++) + { + // Add dynamic attributes if any + A2720 *dev = static_cast<A2720 *>(device_list[device_list.size()-i]); + dev->add_dynamic_attributes(); + + // Check before if database used. + if ((Tango::Util::_UseDb == true) && (Tango::Util::_FileDb == false)) + export_device(dev); + else + export_device(dev, dev->get_name().c_str()); + } + + /*----- PROTECTED REGION ID(A2720Class::device_factory_after) ENABLED START -----*/ + + // Add your own code + + /*----- PROTECTED REGION END -----*/ // A2720Class::device_factory_after +} +//-------------------------------------------------------- +/** + * Method : A2720Class::attribute_factory() + * Description : Create the attribute object(s) + * and store them in the attribute list + */ +//-------------------------------------------------------- +void A2720Class::attribute_factory(vector<Tango::Attr *> &att_list) +{ + /*----- PROTECTED REGION ID(A2720Class::attribute_factory_before) ENABLED START -----*/ + + // Add your own code + + /*----- PROTECTED REGION END -----*/ // A2720Class::attribute_factory_before + // Attribute : Current + CurrentAttrib *current = new CurrentAttrib(); + Tango::UserDefaultAttrProp current_prop; + // description not set for Current + current_prop.set_label("Current"); + current_prop.set_unit("A"); + current_prop.set_standard_unit("1.0"); + current_prop.set_display_unit("A"); + current_prop.set_format("%.6f"); + // max_value not set for Current + // min_value not set for Current + // max_alarm not set for Current + // min_alarm not set for Current + // max_warning not set for Current + // min_warning not set for Current + // delta_t not set for Current + // delta_val not set for Current + + current->set_default_properties(current_prop); + // Not Polled + current->set_disp_level(Tango::OPERATOR); + // Not Memorized + att_list.push_back(current); + + // Attribute : Voltage + VoltageAttrib *voltage = new VoltageAttrib(); + Tango::UserDefaultAttrProp voltage_prop; + // description not set for Voltage + voltage_prop.set_label("Voltage"); + voltage_prop.set_unit("V"); + voltage_prop.set_standard_unit("1.0"); + voltage_prop.set_display_unit("V"); + voltage_prop.set_format("%.6f"); + // max_value not set for Voltage + // min_value not set for Voltage + // max_alarm not set for Voltage + // min_alarm not set for Voltage + // max_warning not set for Voltage + // min_warning not set for Voltage + // delta_t not set for Voltage + // delta_val not set for Voltage + + voltage->set_default_properties(voltage_prop); + // Not Polled + voltage->set_disp_level(Tango::OPERATOR); + // Not Memorized + att_list.push_back(voltage); + + // Attribute : CurrentSet + CurrentSetAttrib *currentset = new CurrentSetAttrib(); + Tango::UserDefaultAttrProp currentset_prop; + // description not set for CurrentSet + currentset_prop.set_label("Current set"); + currentset_prop.set_unit("A"); + currentset_prop.set_standard_unit("1.0"); + currentset_prop.set_display_unit("A"); + currentset_prop.set_format("%.6f"); + // max_value not set for CurrentSet + // min_value not set for CurrentSet + // max_alarm not set for CurrentSet + // min_alarm not set for CurrentSet + // max_warning not set for CurrentSet + // min_warning not set for CurrentSet + // delta_t not set for CurrentSet + // delta_val not set for CurrentSet + + currentset->set_default_properties(currentset_prop); + // Not Polled + currentset->set_disp_level(Tango::OPERATOR); + // Not Memorized + att_list.push_back(currentset); + + // Attribute : AuxiliaryVoltage + AuxiliaryVoltageAttrib *auxiliaryvoltage = new AuxiliaryVoltageAttrib(); + Tango::UserDefaultAttrProp auxiliaryvoltage_prop; + // description not set for AuxiliaryVoltage + auxiliaryvoltage_prop.set_label("Auxiliary voltage"); + auxiliaryvoltage_prop.set_unit("V"); + auxiliaryvoltage_prop.set_standard_unit("1.0"); + auxiliaryvoltage_prop.set_display_unit("V"); + auxiliaryvoltage_prop.set_format("%.6f"); + // max_value not set for AuxiliaryVoltage + // min_value not set for AuxiliaryVoltage + // max_alarm not set for AuxiliaryVoltage + // min_alarm not set for AuxiliaryVoltage + // max_warning not set for AuxiliaryVoltage + // min_warning not set for AuxiliaryVoltage + // delta_t not set for AuxiliaryVoltage + // delta_val not set for AuxiliaryVoltage + + auxiliaryvoltage->set_default_properties(auxiliaryvoltage_prop); + // Not Polled + auxiliaryvoltage->set_disp_level(Tango::OPERATOR); + // Not Memorized + att_list.push_back(auxiliaryvoltage); + + // Attribute : DCLinkVoltage + DCLinkVoltageAttrib *dclinkvoltage = new DCLinkVoltageAttrib(); + Tango::UserDefaultAttrProp dclinkvoltage_prop; + // description not set for DCLinkVoltage + dclinkvoltage_prop.set_label("DC link voltage"); + dclinkvoltage_prop.set_unit("V"); + dclinkvoltage_prop.set_standard_unit("1.0"); + dclinkvoltage_prop.set_display_unit("V"); + dclinkvoltage_prop.set_format("%.6f"); + // max_value not set for DCLinkVoltage + // min_value not set for DCLinkVoltage + // max_alarm not set for DCLinkVoltage + // min_alarm not set for DCLinkVoltage + // max_warning not set for DCLinkVoltage + // min_warning not set for DCLinkVoltage + // delta_t not set for DCLinkVoltage + // delta_val not set for DCLinkVoltage + + dclinkvoltage->set_default_properties(dclinkvoltage_prop); + // Not Polled + dclinkvoltage->set_disp_level(Tango::OPERATOR); + // Not Memorized + att_list.push_back(dclinkvoltage); + + // Attribute : ADCTemperature + ADCTemperatureAttrib *adctemperature = new ADCTemperatureAttrib(); + Tango::UserDefaultAttrProp adctemperature_prop; + // description not set for ADCTemperature + adctemperature_prop.set_label("ADC temperature"); + adctemperature_prop.set_unit("C"); + adctemperature_prop.set_standard_unit("1.0"); + adctemperature_prop.set_display_unit("C"); + adctemperature_prop.set_format("%.6f"); + // max_value not set for ADCTemperature + // min_value not set for ADCTemperature + // max_alarm not set for ADCTemperature + // min_alarm not set for ADCTemperature + // max_warning not set for ADCTemperature + // min_warning not set for ADCTemperature + // delta_t not set for ADCTemperature + // delta_val not set for ADCTemperature + + adctemperature->set_default_properties(adctemperature_prop); + // Not Polled + adctemperature->set_disp_level(Tango::OPERATOR); + // Not Memorized + att_list.push_back(adctemperature); + + // Attribute : HeatsinkTemperature + HeatsinkTemperatureAttrib *heatsinktemperature = new HeatsinkTemperatureAttrib(); + Tango::UserDefaultAttrProp heatsinktemperature_prop; + // description not set for HeatsinkTemperature + heatsinktemperature_prop.set_label("Heatsink temperature"); + heatsinktemperature_prop.set_unit("C"); + heatsinktemperature_prop.set_standard_unit("1.0"); + heatsinktemperature_prop.set_display_unit("C"); + heatsinktemperature_prop.set_format("%.6f"); + // max_value not set for HeatsinkTemperature + // min_value not set for HeatsinkTemperature + // max_alarm not set for HeatsinkTemperature + // min_alarm not set for HeatsinkTemperature + // max_warning not set for HeatsinkTemperature + // min_warning not set for HeatsinkTemperature + // delta_t not set for HeatsinkTemperature + // delta_val not set for HeatsinkTemperature + + heatsinktemperature->set_default_properties(heatsinktemperature_prop); + // Not Polled + heatsinktemperature->set_disp_level(Tango::OPERATOR); + // Not Memorized + att_list.push_back(heatsinktemperature); + + // Attribute : PRU0Firmware + PRU0FirmwareAttrib *pru0firmware = new PRU0FirmwareAttrib(); + Tango::UserDefaultAttrProp pru0firmware_prop; + // description not set for PRU0Firmware + pru0firmware_prop.set_label("PRU0 firmware"); + // unit not set for PRU0Firmware + // standard_unit not set for PRU0Firmware + // display_unit not set for PRU0Firmware + pru0firmware_prop.set_format("%.2f"); + // max_value not set for PRU0Firmware + // min_value not set for PRU0Firmware + // max_alarm not set for PRU0Firmware + // min_alarm not set for PRU0Firmware + // max_warning not set for PRU0Firmware + // min_warning not set for PRU0Firmware + // delta_t not set for PRU0Firmware + // delta_val not set for PRU0Firmware + + pru0firmware->set_default_properties(pru0firmware_prop); + // Not Polled + pru0firmware->set_disp_level(Tango::OPERATOR); + // Not Memorized + att_list.push_back(pru0firmware); + + // Attribute : PRU1Firmware + PRU1FirmwareAttrib *pru1firmware = new PRU1FirmwareAttrib(); + Tango::UserDefaultAttrProp pru1firmware_prop; + // description not set for PRU1Firmware + pru1firmware_prop.set_label("PRU1 firmware"); + // unit not set for PRU1Firmware + // standard_unit not set for PRU1Firmware + // display_unit not set for PRU1Firmware + pru1firmware_prop.set_format("%.2f"); + // max_value not set for PRU1Firmware + // min_value not set for PRU1Firmware + // max_alarm not set for PRU1Firmware + // min_alarm not set for PRU1Firmware + // max_warning not set for PRU1Firmware + // min_warning not set for PRU1Firmware + // delta_t not set for PRU1Firmware + // delta_val not set for PRU1Firmware + + pru1firmware->set_default_properties(pru1firmware_prop); + // Not Polled + pru1firmware->set_disp_level(Tango::OPERATOR); + // Not Memorized + att_list.push_back(pru1firmware); + + // Attribute : KPCoefficient + KPCoefficientAttrib *kpcoefficient = new KPCoefficientAttrib(); + Tango::UserDefaultAttrProp kpcoefficient_prop; + // description not set for KPCoefficient + kpcoefficient_prop.set_label("KP coefficient"); + // unit not set for KPCoefficient + // standard_unit not set for KPCoefficient + // display_unit not set for KPCoefficient + // format not set for KPCoefficient + // max_value not set for KPCoefficient + // min_value not set for KPCoefficient + // max_alarm not set for KPCoefficient + // min_alarm not set for KPCoefficient + // max_warning not set for KPCoefficient + // min_warning not set for KPCoefficient + // delta_t not set for KPCoefficient + // delta_val not set for KPCoefficient + + kpcoefficient->set_default_properties(kpcoefficient_prop); + // Not Polled + kpcoefficient->set_disp_level(Tango::OPERATOR); + // Not Memorized + att_list.push_back(kpcoefficient); + + // Attribute : KICoefficient + KICoefficientAttrib *kicoefficient = new KICoefficientAttrib(); + Tango::UserDefaultAttrProp kicoefficient_prop; + // description not set for KICoefficient + kicoefficient_prop.set_label("KI coefficient"); + // unit not set for KICoefficient + // standard_unit not set for KICoefficient + // display_unit not set for KICoefficient + // format not set for KICoefficient + // max_value not set for KICoefficient + // min_value not set for KICoefficient + // max_alarm not set for KICoefficient + // min_alarm not set for KICoefficient + // max_warning not set for KICoefficient + // min_warning not set for KICoefficient + // delta_t not set for KICoefficient + // delta_val not set for KICoefficient + + kicoefficient->set_default_properties(kicoefficient_prop); + // Not Polled + kicoefficient->set_disp_level(Tango::OPERATOR); + // Not Memorized + att_list.push_back(kicoefficient); + + // Attribute : KFFCoefficient + KFFCoefficientAttrib *kffcoefficient = new KFFCoefficientAttrib(); + Tango::UserDefaultAttrProp kffcoefficient_prop; + // description not set for KFFCoefficient + kffcoefficient_prop.set_label("KFF coefficient"); + // unit not set for KFFCoefficient + // standard_unit not set for KFFCoefficient + // display_unit not set for KFFCoefficient + // format not set for KFFCoefficient + // max_value not set for KFFCoefficient + // min_value not set for KFFCoefficient + // max_alarm not set for KFFCoefficient + // min_alarm not set for KFFCoefficient + // max_warning not set for KFFCoefficient + // min_warning not set for KFFCoefficient + // delta_t not set for KFFCoefficient + // delta_val not set for KFFCoefficient + + kffcoefficient->set_default_properties(kffcoefficient_prop); + // Not Polled + kffcoefficient->set_disp_level(Tango::OPERATOR); + // Not Memorized + att_list.push_back(kffcoefficient); + + // Attribute : SlewRate + SlewRateAttrib *slewrate = new SlewRateAttrib(); + Tango::UserDefaultAttrProp slewrate_prop; + // description not set for SlewRate + slewrate_prop.set_label("Slewrate"); + slewrate_prop.set_unit("A/s"); + slewrate_prop.set_standard_unit("1.0"); + slewrate_prop.set_display_unit("A/s"); + slewrate_prop.set_format("%.6f"); + // max_value not set for SlewRate + // min_value not set for SlewRate + // max_alarm not set for SlewRate + // min_alarm not set for SlewRate + // max_warning not set for SlewRate + // min_warning not set for SlewRate + // delta_t not set for SlewRate + // delta_val not set for SlewRate + + slewrate->set_default_properties(slewrate_prop); + // Not Polled + slewrate->set_disp_level(Tango::OPERATOR); + // Not Memorized + att_list.push_back(slewrate); + + // Attribute : CurrentMin + CurrentMinAttrib *currentmin = new CurrentMinAttrib(); + Tango::UserDefaultAttrProp currentmin_prop; + // description not set for CurrentMin + currentmin_prop.set_label("CurrentMin"); + currentmin_prop.set_unit("A"); + currentmin_prop.set_standard_unit("1.0"); + currentmin_prop.set_display_unit("A"); + currentmin_prop.set_format("%.6f"); + // max_value not set for CurrentMin + // min_value not set for CurrentMin + // max_alarm not set for CurrentMin + // min_alarm not set for CurrentMin + // max_warning not set for CurrentMin + // min_warning not set for CurrentMin + // delta_t not set for CurrentMin + // delta_val not set for CurrentMin + + currentmin->set_default_properties(currentmin_prop); + // Not Polled + currentmin->set_disp_level(Tango::OPERATOR); + // Not Memorized + att_list.push_back(currentmin); + + // Attribute : CurrentMax + CurrentMaxAttrib *currentmax = new CurrentMaxAttrib(); + Tango::UserDefaultAttrProp currentmax_prop; + // description not set for CurrentMax + currentmax_prop.set_label("CurrentMax"); + currentmax_prop.set_unit("A"); + currentmax_prop.set_standard_unit("1.0"); + currentmax_prop.set_display_unit("A"); + currentmax_prop.set_format("%.6f"); + // max_value not set for CurrentMax + // min_value not set for CurrentMax + // max_alarm not set for CurrentMax + // min_alarm not set for CurrentMax + // max_warning not set for CurrentMax + // min_warning not set for CurrentMax + // delta_t not set for CurrentMax + // delta_val not set for CurrentMax + + currentmax->set_default_properties(currentmax_prop); + // Not Polled + currentmax->set_disp_level(Tango::OPERATOR); + // Not Memorized + att_list.push_back(currentmax); + + // Attribute : CurrentCoefficient0 + CurrentCoefficient0Attrib *currentcoefficient0 = new CurrentCoefficient0Attrib(); + Tango::UserDefaultAttrProp currentcoefficient0_prop; + // description not set for CurrentCoefficient0 + currentcoefficient0_prop.set_label("Current coefficient 0"); + // unit not set for CurrentCoefficient0 + // standard_unit not set for CurrentCoefficient0 + // display_unit not set for CurrentCoefficient0 + // format not set for CurrentCoefficient0 + // max_value not set for CurrentCoefficient0 + // min_value not set for CurrentCoefficient0 + // max_alarm not set for CurrentCoefficient0 + // min_alarm not set for CurrentCoefficient0 + // max_warning not set for CurrentCoefficient0 + // min_warning not set for CurrentCoefficient0 + // delta_t not set for CurrentCoefficient0 + // delta_val not set for CurrentCoefficient0 + + currentcoefficient0->set_default_properties(currentcoefficient0_prop); + // Not Polled + currentcoefficient0->set_disp_level(Tango::OPERATOR); + // Not Memorized + att_list.push_back(currentcoefficient0); + + // Attribute : CurrentCoefficient1 + CurrentCoefficient1Attrib *currentcoefficient1 = new CurrentCoefficient1Attrib(); + Tango::UserDefaultAttrProp currentcoefficient1_prop; + // description not set for CurrentCoefficient1 + currentcoefficient1_prop.set_label("Current coefficient 1"); + // unit not set for CurrentCoefficient1 + // standard_unit not set for CurrentCoefficient1 + // display_unit not set for CurrentCoefficient1 + // format not set for CurrentCoefficient1 + // max_value not set for CurrentCoefficient1 + // min_value not set for CurrentCoefficient1 + // max_alarm not set for CurrentCoefficient1 + // min_alarm not set for CurrentCoefficient1 + // max_warning not set for CurrentCoefficient1 + // min_warning not set for CurrentCoefficient1 + // delta_t not set for CurrentCoefficient1 + // delta_val not set for CurrentCoefficient1 + + currentcoefficient1->set_default_properties(currentcoefficient1_prop); + // Not Polled + currentcoefficient1->set_disp_level(Tango::OPERATOR); + // Not Memorized + att_list.push_back(currentcoefficient1); + + // Attribute : CurrentCoefficient2 + CurrentCoefficient2Attrib *currentcoefficient2 = new CurrentCoefficient2Attrib(); + Tango::UserDefaultAttrProp currentcoefficient2_prop; + // description not set for CurrentCoefficient2 + currentcoefficient2_prop.set_label("Current coefficient 2"); + // unit not set for CurrentCoefficient2 + // standard_unit not set for CurrentCoefficient2 + // display_unit not set for CurrentCoefficient2 + // format not set for CurrentCoefficient2 + // max_value not set for CurrentCoefficient2 + // min_value not set for CurrentCoefficient2 + // max_alarm not set for CurrentCoefficient2 + // min_alarm not set for CurrentCoefficient2 + // max_warning not set for CurrentCoefficient2 + // min_warning not set for CurrentCoefficient2 + // delta_t not set for CurrentCoefficient2 + // delta_val not set for CurrentCoefficient2 + + currentcoefficient2->set_default_properties(currentcoefficient2_prop); + // Not Polled + currentcoefficient2->set_disp_level(Tango::OPERATOR); + // Not Memorized + att_list.push_back(currentcoefficient2); + + // Attribute : AuxVoltageCoefficient0 + AuxVoltageCoefficient0Attrib *auxvoltagecoefficient0 = new AuxVoltageCoefficient0Attrib(); + Tango::UserDefaultAttrProp auxvoltagecoefficient0_prop; + // description not set for AuxVoltageCoefficient0 + auxvoltagecoefficient0_prop.set_label("Auxiliary voltage coefficient 0"); + // unit not set for AuxVoltageCoefficient0 + // standard_unit not set for AuxVoltageCoefficient0 + // display_unit not set for AuxVoltageCoefficient0 + // format not set for AuxVoltageCoefficient0 + // max_value not set for AuxVoltageCoefficient0 + // min_value not set for AuxVoltageCoefficient0 + // max_alarm not set for AuxVoltageCoefficient0 + // min_alarm not set for AuxVoltageCoefficient0 + // max_warning not set for AuxVoltageCoefficient0 + // min_warning not set for AuxVoltageCoefficient0 + // delta_t not set for AuxVoltageCoefficient0 + // delta_val not set for AuxVoltageCoefficient0 + + auxvoltagecoefficient0->set_default_properties(auxvoltagecoefficient0_prop); + // Not Polled + auxvoltagecoefficient0->set_disp_level(Tango::OPERATOR); + // Not Memorized + att_list.push_back(auxvoltagecoefficient0); + + // Attribute : AuxVoltageCoefficient1 + AuxVoltageCoefficient1Attrib *auxvoltagecoefficient1 = new AuxVoltageCoefficient1Attrib(); + Tango::UserDefaultAttrProp auxvoltagecoefficient1_prop; + // description not set for AuxVoltageCoefficient1 + auxvoltagecoefficient1_prop.set_label("Auxiliary voltage coefficient 1"); + // unit not set for AuxVoltageCoefficient1 + // standard_unit not set for AuxVoltageCoefficient1 + // display_unit not set for AuxVoltageCoefficient1 + // format not set for AuxVoltageCoefficient1 + // max_value not set for AuxVoltageCoefficient1 + // min_value not set for AuxVoltageCoefficient1 + // max_alarm not set for AuxVoltageCoefficient1 + // min_alarm not set for AuxVoltageCoefficient1 + // max_warning not set for AuxVoltageCoefficient1 + // min_warning not set for AuxVoltageCoefficient1 + // delta_t not set for AuxVoltageCoefficient1 + // delta_val not set for AuxVoltageCoefficient1 + + auxvoltagecoefficient1->set_default_properties(auxvoltagecoefficient1_prop); + // Not Polled + auxvoltagecoefficient1->set_disp_level(Tango::OPERATOR); + // Not Memorized + att_list.push_back(auxvoltagecoefficient1); + + // Attribute : VoltageCoefficient0 + VoltageCoefficient0Attrib *voltagecoefficient0 = new VoltageCoefficient0Attrib(); + Tango::UserDefaultAttrProp voltagecoefficient0_prop; + // description not set for VoltageCoefficient0 + voltagecoefficient0_prop.set_label("Voltage coefficient 0"); + // unit not set for VoltageCoefficient0 + // standard_unit not set for VoltageCoefficient0 + // display_unit not set for VoltageCoefficient0 + // format not set for VoltageCoefficient0 + // max_value not set for VoltageCoefficient0 + // min_value not set for VoltageCoefficient0 + // max_alarm not set for VoltageCoefficient0 + // min_alarm not set for VoltageCoefficient0 + // max_warning not set for VoltageCoefficient0 + // min_warning not set for VoltageCoefficient0 + // delta_t not set for VoltageCoefficient0 + // delta_val not set for VoltageCoefficient0 + + voltagecoefficient0->set_default_properties(voltagecoefficient0_prop); + // Not Polled + voltagecoefficient0->set_disp_level(Tango::OPERATOR); + // Not Memorized + att_list.push_back(voltagecoefficient0); + + // Attribute : VoltageCoefficient1 + VoltageCoefficient1Attrib *voltagecoefficient1 = new VoltageCoefficient1Attrib(); + Tango::UserDefaultAttrProp voltagecoefficient1_prop; + // description not set for VoltageCoefficient1 + voltagecoefficient1_prop.set_label("Voltage coefficient 1"); + // unit not set for VoltageCoefficient1 + // standard_unit not set for VoltageCoefficient1 + // display_unit not set for VoltageCoefficient1 + // format not set for VoltageCoefficient1 + // max_value not set for VoltageCoefficient1 + // min_value not set for VoltageCoefficient1 + // max_alarm not set for VoltageCoefficient1 + // min_alarm not set for VoltageCoefficient1 + // max_warning not set for VoltageCoefficient1 + // min_warning not set for VoltageCoefficient1 + // delta_t not set for VoltageCoefficient1 + // delta_val not set for VoltageCoefficient1 + + voltagecoefficient1->set_default_properties(voltagecoefficient1_prop); + // Not Polled + voltagecoefficient1->set_disp_level(Tango::OPERATOR); + // Not Memorized + att_list.push_back(voltagecoefficient1); + + // Attribute : DCCurrentCoefficient0 + DCCurrentCoefficient0Attrib *dccurrentcoefficient0 = new DCCurrentCoefficient0Attrib(); + Tango::UserDefaultAttrProp dccurrentcoefficient0_prop; + // description not set for DCCurrentCoefficient0 + dccurrentcoefficient0_prop.set_label("DC current coefficient 0"); + // unit not set for DCCurrentCoefficient0 + // standard_unit not set for DCCurrentCoefficient0 + // display_unit not set for DCCurrentCoefficient0 + // format not set for DCCurrentCoefficient0 + // max_value not set for DCCurrentCoefficient0 + // min_value not set for DCCurrentCoefficient0 + // max_alarm not set for DCCurrentCoefficient0 + // min_alarm not set for DCCurrentCoefficient0 + // max_warning not set for DCCurrentCoefficient0 + // min_warning not set for DCCurrentCoefficient0 + // delta_t not set for DCCurrentCoefficient0 + // delta_val not set for DCCurrentCoefficient0 + + dccurrentcoefficient0->set_default_properties(dccurrentcoefficient0_prop); + // Not Polled + dccurrentcoefficient0->set_disp_level(Tango::OPERATOR); + // Not Memorized + att_list.push_back(dccurrentcoefficient0); + + // Attribute : DCCurrentCoefficient1 + DCCurrentCoefficient1Attrib *dccurrentcoefficient1 = new DCCurrentCoefficient1Attrib(); + Tango::UserDefaultAttrProp dccurrentcoefficient1_prop; + // description not set for DCCurrentCoefficient1 + dccurrentcoefficient1_prop.set_label("DC current coefficient 1"); + // unit not set for DCCurrentCoefficient1 + // standard_unit not set for DCCurrentCoefficient1 + // display_unit not set for DCCurrentCoefficient1 + // format not set for DCCurrentCoefficient1 + // max_value not set for DCCurrentCoefficient1 + // min_value not set for DCCurrentCoefficient1 + // max_alarm not set for DCCurrentCoefficient1 + // min_alarm not set for DCCurrentCoefficient1 + // max_warning not set for DCCurrentCoefficient1 + // min_warning not set for DCCurrentCoefficient1 + // delta_t not set for DCCurrentCoefficient1 + // delta_val not set for DCCurrentCoefficient1 + + dccurrentcoefficient1->set_default_properties(dccurrentcoefficient1_prop); + // Not Polled + dccurrentcoefficient1->set_disp_level(Tango::OPERATOR); + // Not Memorized + att_list.push_back(dccurrentcoefficient1); + + // Attribute : ADCTempCoefficient0 + ADCTempCoefficient0Attrib *adctempcoefficient0 = new ADCTempCoefficient0Attrib(); + Tango::UserDefaultAttrProp adctempcoefficient0_prop; + // description not set for ADCTempCoefficient0 + adctempcoefficient0_prop.set_label("ADC temperature coefficient 0"); + // unit not set for ADCTempCoefficient0 + // standard_unit not set for ADCTempCoefficient0 + // display_unit not set for ADCTempCoefficient0 + // format not set for ADCTempCoefficient0 + // max_value not set for ADCTempCoefficient0 + // min_value not set for ADCTempCoefficient0 + // max_alarm not set for ADCTempCoefficient0 + // min_alarm not set for ADCTempCoefficient0 + // max_warning not set for ADCTempCoefficient0 + // min_warning not set for ADCTempCoefficient0 + // delta_t not set for ADCTempCoefficient0 + // delta_val not set for ADCTempCoefficient0 + + adctempcoefficient0->set_default_properties(adctempcoefficient0_prop); + // Not Polled + adctempcoefficient0->set_disp_level(Tango::OPERATOR); + // Not Memorized + att_list.push_back(adctempcoefficient0); + + // Attribute : ADCTempCoefficient1 + ADCTempCoefficient1Attrib *adctempcoefficient1 = new ADCTempCoefficient1Attrib(); + Tango::UserDefaultAttrProp adctempcoefficient1_prop; + // description not set for ADCTempCoefficient1 + adctempcoefficient1_prop.set_label("ADC temperature coefficient 1"); + // unit not set for ADCTempCoefficient1 + // standard_unit not set for ADCTempCoefficient1 + // display_unit not set for ADCTempCoefficient1 + // format not set for ADCTempCoefficient1 + // max_value not set for ADCTempCoefficient1 + // min_value not set for ADCTempCoefficient1 + // max_alarm not set for ADCTempCoefficient1 + // min_alarm not set for ADCTempCoefficient1 + // max_warning not set for ADCTempCoefficient1 + // min_warning not set for ADCTempCoefficient1 + // delta_t not set for ADCTempCoefficient1 + // delta_val not set for ADCTempCoefficient1 + + adctempcoefficient1->set_default_properties(adctempcoefficient1_prop); + // Not Polled + adctempcoefficient1->set_disp_level(Tango::OPERATOR); + // Not Memorized + att_list.push_back(adctempcoefficient1); + + // Attribute : HeatsinkTempCoefficient0 + HeatsinkTempCoefficient0Attrib *heatsinktempcoefficient0 = new HeatsinkTempCoefficient0Attrib(); + Tango::UserDefaultAttrProp heatsinktempcoefficient0_prop; + // description not set for HeatsinkTempCoefficient0 + heatsinktempcoefficient0_prop.set_label("Heatsink temperature coefficient 0"); + // unit not set for HeatsinkTempCoefficient0 + // standard_unit not set for HeatsinkTempCoefficient0 + // display_unit not set for HeatsinkTempCoefficient0 + // format not set for HeatsinkTempCoefficient0 + // max_value not set for HeatsinkTempCoefficient0 + // min_value not set for HeatsinkTempCoefficient0 + // max_alarm not set for HeatsinkTempCoefficient0 + // min_alarm not set for HeatsinkTempCoefficient0 + // max_warning not set for HeatsinkTempCoefficient0 + // min_warning not set for HeatsinkTempCoefficient0 + // delta_t not set for HeatsinkTempCoefficient0 + // delta_val not set for HeatsinkTempCoefficient0 + + heatsinktempcoefficient0->set_default_properties(heatsinktempcoefficient0_prop); + // Not Polled + heatsinktempcoefficient0->set_disp_level(Tango::OPERATOR); + // Not Memorized + att_list.push_back(heatsinktempcoefficient0); + + // Attribute : HeatsinkTempCoefficient1 + HeatsinkTempCoefficient1Attrib *heatsinktempcoefficient1 = new HeatsinkTempCoefficient1Attrib(); + Tango::UserDefaultAttrProp heatsinktempcoefficient1_prop; + // description not set for HeatsinkTempCoefficient1 + heatsinktempcoefficient1_prop.set_label("Heatsink temperature coefficient 1"); + // unit not set for HeatsinkTempCoefficient1 + // standard_unit not set for HeatsinkTempCoefficient1 + // display_unit not set for HeatsinkTempCoefficient1 + // format not set for HeatsinkTempCoefficient1 + // max_value not set for HeatsinkTempCoefficient1 + // min_value not set for HeatsinkTempCoefficient1 + // max_alarm not set for HeatsinkTempCoefficient1 + // min_alarm not set for HeatsinkTempCoefficient1 + // max_warning not set for HeatsinkTempCoefficient1 + // min_warning not set for HeatsinkTempCoefficient1 + // delta_t not set for HeatsinkTempCoefficient1 + // delta_val not set for HeatsinkTempCoefficient1 + + heatsinktempcoefficient1->set_default_properties(heatsinktempcoefficient1_prop); + // Not Polled + heatsinktempcoefficient1->set_disp_level(Tango::OPERATOR); + // Not Memorized + att_list.push_back(heatsinktempcoefficient1); + + // Attribute : SerialNumber + SerialNumberAttrib *serialnumber = new SerialNumberAttrib(); + Tango::UserDefaultAttrProp serialnumber_prop; + // description not set for SerialNumber + serialnumber_prop.set_label("Serial number"); + // unit not set for SerialNumber + // standard_unit not set for SerialNumber + // display_unit not set for SerialNumber + // format not set for SerialNumber + // max_value not set for SerialNumber + // min_value not set for SerialNumber + // max_alarm not set for SerialNumber + // min_alarm not set for SerialNumber + // max_warning not set for SerialNumber + // min_warning not set for SerialNumber + // delta_t not set for SerialNumber + // delta_val not set for SerialNumber + + serialnumber->set_default_properties(serialnumber_prop); + // Not Polled + serialnumber->set_disp_level(Tango::OPERATOR); + // Not Memorized + att_list.push_back(serialnumber); + + // Attribute : Model + ModelAttrib *model = new ModelAttrib(); + Tango::UserDefaultAttrProp model_prop; + // description not set for Model + model_prop.set_label("Model"); + // unit not set for Model + // standard_unit not set for Model + // display_unit not set for Model + // format not set for Model + // max_value not set for Model + // min_value not set for Model + // max_alarm not set for Model + // min_alarm not set for Model + // max_warning not set for Model + // min_warning not set for Model + // delta_t not set for Model + // delta_val not set for Model + + model->set_default_properties(model_prop); + // Not Polled + model->set_disp_level(Tango::OPERATOR); + // Not Memorized + att_list.push_back(model); + + // Attribute : CalibrationDate + CalibrationDateAttrib *calibrationdate = new CalibrationDateAttrib(); + Tango::UserDefaultAttrProp calibrationdate_prop; + // description not set for CalibrationDate + calibrationdate_prop.set_label("Calibration date"); + // unit not set for CalibrationDate + // standard_unit not set for CalibrationDate + // display_unit not set for CalibrationDate + // format not set for CalibrationDate + // max_value not set for CalibrationDate + // min_value not set for CalibrationDate + // max_alarm not set for CalibrationDate + // min_alarm not set for CalibrationDate + // max_warning not set for CalibrationDate + // min_warning not set for CalibrationDate + // delta_t not set for CalibrationDate + // delta_val not set for CalibrationDate + + calibrationdate->set_default_properties(calibrationdate_prop); + // Not Polled + calibrationdate->set_disp_level(Tango::OPERATOR); + // Not Memorized + att_list.push_back(calibrationdate); + + // Attribute : PulseDuration + PulseDurationAttrib *pulseduration = new PulseDurationAttrib(); + Tango::UserDefaultAttrProp pulseduration_prop; + // description not set for PulseDuration + pulseduration_prop.set_label("Pulse duration"); + pulseduration_prop.set_unit("ms"); + pulseduration_prop.set_standard_unit("1.0"); + pulseduration_prop.set_display_unit("ms"); + // format not set for PulseDuration + // max_value not set for PulseDuration + // min_value not set for PulseDuration + // max_alarm not set for PulseDuration + // min_alarm not set for PulseDuration + // max_warning not set for PulseDuration + // min_warning not set for PulseDuration + // delta_t not set for PulseDuration + // delta_val not set for PulseDuration + + pulseduration->set_default_properties(pulseduration_prop); + // Not Polled + pulseduration->set_disp_level(Tango::OPERATOR); + // Not Memorized + att_list.push_back(pulseduration); + + // Attribute : CurrentCoefficient3 + CurrentCoefficient3Attrib *currentcoefficient3 = new CurrentCoefficient3Attrib(); + Tango::UserDefaultAttrProp currentcoefficient3_prop; + // description not set for CurrentCoefficient3 + currentcoefficient3_prop.set_label("Current coefficient 3"); + // unit not set for CurrentCoefficient3 + // standard_unit not set for CurrentCoefficient3 + // display_unit not set for CurrentCoefficient3 + // format not set for CurrentCoefficient3 + // max_value not set for CurrentCoefficient3 + // min_value not set for CurrentCoefficient3 + // max_alarm not set for CurrentCoefficient3 + // min_alarm not set for CurrentCoefficient3 + // max_warning not set for CurrentCoefficient3 + // min_warning not set for CurrentCoefficient3 + // delta_t not set for CurrentCoefficient3 + // delta_val not set for CurrentCoefficient3 + + currentcoefficient3->set_default_properties(currentcoefficient3_prop); + // Not Polled + currentcoefficient3->set_disp_level(Tango::OPERATOR); + // Not Memorized + att_list.push_back(currentcoefficient3); + + // Attribute : DCurr + DCurrAttrib *dcurr = new DCurrAttrib(); + Tango::UserDefaultAttrProp dcurr_prop; + // description not set for DCurr + // label not set for DCurr + dcurr_prop.set_unit("A"); + dcurr_prop.set_standard_unit("1.0"); + dcurr_prop.set_display_unit("A"); + dcurr_prop.set_format("%.6f"); + // max_value not set for DCurr + // min_value not set for DCurr + // max_alarm not set for DCurr + // min_alarm not set for DCurr + // max_warning not set for DCurr + // min_warning not set for DCurr + // delta_t not set for DCurr + // delta_val not set for DCurr + + dcurr->set_default_properties(dcurr_prop); + // Not Polled + dcurr->set_disp_level(Tango::OPERATOR); + // Not Memorized + att_list.push_back(dcurr); + + // Attribute : CurrentCoefficient4 + CurrentCoefficient4Attrib *currentcoefficient4 = new CurrentCoefficient4Attrib(); + Tango::UserDefaultAttrProp currentcoefficient4_prop; + // description not set for CurrentCoefficient4 + currentcoefficient4_prop.set_label("Current coefficient 4"); + // unit not set for CurrentCoefficient4 + // standard_unit not set for CurrentCoefficient4 + // display_unit not set for CurrentCoefficient4 + // format not set for CurrentCoefficient4 + // max_value not set for CurrentCoefficient4 + // min_value not set for CurrentCoefficient4 + // max_alarm not set for CurrentCoefficient4 + // min_alarm not set for CurrentCoefficient4 + // max_warning not set for CurrentCoefficient4 + // min_warning not set for CurrentCoefficient4 + // delta_t not set for CurrentCoefficient4 + // delta_val not set for CurrentCoefficient4 + + currentcoefficient4->set_default_properties(currentcoefficient4_prop); + // Not Polled + currentcoefficient4->set_disp_level(Tango::OPERATOR); + // Not Memorized + att_list.push_back(currentcoefficient4); + + // Attribute : CurrentCoefficient5 + CurrentCoefficient5Attrib *currentcoefficient5 = new CurrentCoefficient5Attrib(); + Tango::UserDefaultAttrProp currentcoefficient5_prop; + // description not set for CurrentCoefficient5 + currentcoefficient5_prop.set_label("Current coefficient 5"); + // unit not set for CurrentCoefficient5 + // standard_unit not set for CurrentCoefficient5 + // display_unit not set for CurrentCoefficient5 + // format not set for CurrentCoefficient5 + // max_value not set for CurrentCoefficient5 + // min_value not set for CurrentCoefficient5 + // max_alarm not set for CurrentCoefficient5 + // min_alarm not set for CurrentCoefficient5 + // max_warning not set for CurrentCoefficient5 + // min_warning not set for CurrentCoefficient5 + // delta_t not set for CurrentCoefficient5 + // delta_val not set for CurrentCoefficient5 + + currentcoefficient5->set_default_properties(currentcoefficient5_prop); + // Not Polled + currentcoefficient5->set_disp_level(Tango::OPERATOR); + // Not Memorized + att_list.push_back(currentcoefficient5); + + // Attribute : PsStat + PsStatAttrib *psstat = new PsStatAttrib(); + Tango::UserDefaultAttrProp psstat_prop; + // description not set for PsStat + // label not set for PsStat + // unit not set for PsStat + // standard_unit not set for PsStat + // display_unit not set for PsStat + // format not set for PsStat + // max_value not set for PsStat + // min_value not set for PsStat + // max_alarm not set for PsStat + // min_alarm not set for PsStat + // max_warning not set for PsStat + // min_warning not set for PsStat + // delta_t not set for PsStat + // delta_val not set for PsStat + + psstat->set_default_properties(psstat_prop); + // Not Polled + psstat->set_disp_level(Tango::OPERATOR); + // Not Memorized + att_list.push_back(psstat); + + + // Create a list of static attributes + create_static_attribute_list(get_class_attr()->get_attr_list()); + /*----- PROTECTED REGION ID(A2720Class::attribute_factory_after) ENABLED START -----*/ + + // Add your own code + + /*----- PROTECTED REGION END -----*/ // A2720Class::attribute_factory_after +} +//-------------------------------------------------------- +/** + * Method : A2720Class::pipe_factory() + * Description : Create the pipe object(s) + * and store them in the pipe list + */ +//-------------------------------------------------------- +void A2720Class::pipe_factory() +{ + /*----- PROTECTED REGION ID(A2720Class::pipe_factory_before) ENABLED START -----*/ + + // Add your own code + + /*----- PROTECTED REGION END -----*/ // A2720Class::pipe_factory_before + /*----- PROTECTED REGION ID(A2720Class::pipe_factory_after) ENABLED START -----*/ + + // Add your own code + + /*----- PROTECTED REGION END -----*/ // A2720Class::pipe_factory_after +} +//-------------------------------------------------------- +/** + * Method : A2720Class::command_factory() + * Description : Create the command object(s) + * and store them in the command list + */ +//-------------------------------------------------------- +void A2720Class::command_factory() +{ + /*----- PROTECTED REGION ID(A2720Class::command_factory_before) ENABLED START -----*/ + + // Add your own code + + /*----- PROTECTED REGION END -----*/ // A2720Class::command_factory_before + + + // Command StartCycling + StartCyclingClass *pStartCyclingCmd = + new StartCyclingClass("StartCycling", + Tango::DEV_VOID, Tango::DEV_VOID, + "", + "", + Tango::OPERATOR); + command_list.push_back(pStartCyclingCmd); + + // Command Abort + AbortClass *pAbortCmd = + new AbortClass("Abort", + Tango::DEV_VOID, Tango::DEV_VOID, + "", + "", + Tango::OPERATOR); + command_list.push_back(pAbortCmd); + + // Command On + OnClass *pOnCmd = + new OnClass("On", + Tango::DEV_VOID, Tango::DEV_VOID, + "", + "", + Tango::OPERATOR); + command_list.push_back(pOnCmd); + + // Command Off + OffClass *pOffCmd = + new OffClass("Off", + Tango::DEV_VOID, Tango::DEV_VOID, + "", + "", + Tango::OPERATOR); + command_list.push_back(pOffCmd); + + // Command Reset + ResetClass *pResetCmd = + new ResetClass("Reset", + Tango::DEV_VOID, Tango::DEV_VOID, + "", + "", + Tango::OPERATOR); + command_list.push_back(pResetCmd); + + /*----- PROTECTED REGION ID(A2720Class::command_factory_after) ENABLED START -----*/ + + // Add your own code + + /*----- PROTECTED REGION END -----*/ // A2720Class::command_factory_after +} + +//=================================================================== +// Dynamic attributes related methods +//=================================================================== + +//-------------------------------------------------------- +/** + * method : A2720Class::create_static_attribute_list + * description : Create the a list of static attributes + * + * @param att_list the ceated attribute list + */ +//-------------------------------------------------------- +void A2720Class::create_static_attribute_list(vector<Tango::Attr *> &att_list) +{ + for (unsigned long i=0 ; i<att_list.size() ; i++) + { + string att_name(att_list[i]->get_name()); + transform(att_name.begin(), att_name.end(), att_name.begin(), ::tolower); + defaultAttList.push_back(att_name); + } + + cout2 << defaultAttList.size() << " attributes in default list" << endl; + + /*----- PROTECTED REGION ID(A2720Class::create_static_att_list) ENABLED START -----*/ + + /*----- PROTECTED REGION END -----*/ // A2720Class::create_static_att_list +} + + +//-------------------------------------------------------- +/** + * method : A2720Class::erase_dynamic_attributes + * description : delete the dynamic attributes if any. + * + * @param devlist_ptr the device list pointer + * @param list of all attributes + */ +//-------------------------------------------------------- +void A2720Class::erase_dynamic_attributes(const Tango::DevVarStringArray *devlist_ptr, vector<Tango::Attr *> &att_list) +{ + Tango::Util *tg = Tango::Util::instance(); + + for (unsigned long i=0 ; i<devlist_ptr->length() ; i++) + { + Tango::DeviceImpl *dev_impl = tg->get_device_by_name(((string)(*devlist_ptr)[i]).c_str()); + A2720 *dev = static_cast<A2720 *> (dev_impl); + + vector<Tango::Attribute *> &dev_att_list = dev->get_device_attr()->get_attribute_list(); + vector<Tango::Attribute *>::iterator ite_att; + for (ite_att=dev_att_list.begin() ; ite_att != dev_att_list.end() ; ++ite_att) + { + string att_name((*ite_att)->get_name_lower()); + if ((att_name == "state") || (att_name == "status")) + continue; + vector<string>::iterator ite_str = find(defaultAttList.begin(), defaultAttList.end(), att_name); + if (ite_str == defaultAttList.end()) + { + cout2 << att_name << " is a UNWANTED dynamic attribute for device " << (*devlist_ptr)[i] << endl; + Tango::Attribute &att = dev->get_device_attr()->get_attr_by_name(att_name.c_str()); + dev->remove_attribute(att_list[att.get_attr_idx()], true, false); + --ite_att; + } + } + } + /*----- PROTECTED REGION ID(A2720Class::erase_dynamic_attributes) ENABLED START -----*/ + + /*----- PROTECTED REGION END -----*/ // A2720Class::erase_dynamic_attributes +} + +//-------------------------------------------------------- +/** + * Method : A2720Class::get_attr_by_name() + * Description : returns Tango::Attr * object found by name + */ +//-------------------------------------------------------- +Tango::Attr *A2720Class::get_attr_object_by_name(vector<Tango::Attr *> &att_list, string attname) +{ + vector<Tango::Attr *>::iterator it; + for (it=att_list.begin() ; it<att_list.end() ; ++it) + if ((*it)->get_name()==attname) + return (*it); + // Attr does not exist + return NULL; +} + + +/*----- PROTECTED REGION ID(A2720Class::Additional Methods) ENABLED START -----*/ + +/*----- PROTECTED REGION END -----*/ // A2720Class::Additional Methods +} // namespace diff --git a/src/A2720Class.h b/src/A2720Class.h new file mode 100644 index 0000000000000000000000000000000000000000..3dee25018dc14f9140a86e2791b27dcbc6c5652f --- /dev/null +++ b/src/A2720Class.h @@ -0,0 +1,778 @@ +/*----- PROTECTED REGION ID(A2720Class.h) ENABLED START -----*/ +//============================================================================= +// +// file : A2720Class.h +// +// description : Include for the A2720 root class. +// This class is the singleton class for +// the A2720 device class. +// It contains all properties and methods which the +// A2720 requires only once e.g. the commands. +// +// project : +// +// This file is part of Tango device class. +// +// Tango is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Tango is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Tango. If not, see <http://www.gnu.org/licenses/>. +// +// $Author: alessio $ +// +// $Revision: 1.4 $ +// $Date: 2018-02-19 16:52:13 $ +// +// $HeadURL: $ +// +//============================================================================= +// This file is generated by POGO +// (Program Obviously used to Generate tango Object) +//============================================================================= + + +#ifndef A2720Class_H +#define A2720Class_H + +#include <tango.h> +#include <A2720.h> + + +/*----- PROTECTED REGION END -----*/ // A2720Class.h + + +namespace A2720_ns +{ +/*----- PROTECTED REGION ID(A2720Class::classes for dynamic creation) ENABLED START -----*/ + + +/*----- PROTECTED REGION END -----*/ // A2720Class::classes for dynamic creation + +//========================================= +// Define classes for attributes +//========================================= +// Attribute Current class definition +class CurrentAttrib: public Tango::Attr +{ +public: + CurrentAttrib():Attr("Current", + Tango::DEV_DOUBLE, Tango::READ_WRITE) {}; + ~CurrentAttrib() {}; + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<A2720 *>(dev))->read_Current(att);} + virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att) + {(static_cast<A2720 *>(dev))->write_Current(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<A2720 *>(dev))->is_Current_allowed(ty);} +}; + +// Attribute Voltage class definition +class VoltageAttrib: public Tango::Attr +{ +public: + VoltageAttrib():Attr("Voltage", + Tango::DEV_DOUBLE, Tango::READ) {}; + ~VoltageAttrib() {}; + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<A2720 *>(dev))->read_Voltage(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<A2720 *>(dev))->is_Voltage_allowed(ty);} +}; + +// Attribute CurrentSet class definition +class CurrentSetAttrib: public Tango::Attr +{ +public: + CurrentSetAttrib():Attr("CurrentSet", + Tango::DEV_DOUBLE, Tango::READ) {}; + ~CurrentSetAttrib() {}; + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<A2720 *>(dev))->read_CurrentSet(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<A2720 *>(dev))->is_CurrentSet_allowed(ty);} +}; + +// Attribute AuxiliaryVoltage class definition +class AuxiliaryVoltageAttrib: public Tango::Attr +{ +public: + AuxiliaryVoltageAttrib():Attr("AuxiliaryVoltage", + Tango::DEV_DOUBLE, Tango::READ) {}; + ~AuxiliaryVoltageAttrib() {}; + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<A2720 *>(dev))->read_AuxiliaryVoltage(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<A2720 *>(dev))->is_AuxiliaryVoltage_allowed(ty);} +}; + +// Attribute DCLinkVoltage class definition +class DCLinkVoltageAttrib: public Tango::Attr +{ +public: + DCLinkVoltageAttrib():Attr("DCLinkVoltage", + Tango::DEV_DOUBLE, Tango::READ) {}; + ~DCLinkVoltageAttrib() {}; + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<A2720 *>(dev))->read_DCLinkVoltage(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<A2720 *>(dev))->is_DCLinkVoltage_allowed(ty);} +}; + +// Attribute ADCTemperature class definition +class ADCTemperatureAttrib: public Tango::Attr +{ +public: + ADCTemperatureAttrib():Attr("ADCTemperature", + Tango::DEV_FLOAT, Tango::READ) {}; + ~ADCTemperatureAttrib() {}; + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<A2720 *>(dev))->read_ADCTemperature(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<A2720 *>(dev))->is_ADCTemperature_allowed(ty);} +}; + +// Attribute HeatsinkTemperature class definition +class HeatsinkTemperatureAttrib: public Tango::Attr +{ +public: + HeatsinkTemperatureAttrib():Attr("HeatsinkTemperature", + Tango::DEV_FLOAT, Tango::READ) {}; + ~HeatsinkTemperatureAttrib() {}; + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<A2720 *>(dev))->read_HeatsinkTemperature(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<A2720 *>(dev))->is_HeatsinkTemperature_allowed(ty);} +}; + +// Attribute PRU0Firmware class definition +class PRU0FirmwareAttrib: public Tango::Attr +{ +public: + PRU0FirmwareAttrib():Attr("PRU0Firmware", + Tango::DEV_FLOAT, Tango::READ) {}; + ~PRU0FirmwareAttrib() {}; + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<A2720 *>(dev))->read_PRU0Firmware(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<A2720 *>(dev))->is_PRU0Firmware_allowed(ty);} +}; + +// Attribute PRU1Firmware class definition +class PRU1FirmwareAttrib: public Tango::Attr +{ +public: + PRU1FirmwareAttrib():Attr("PRU1Firmware", + Tango::DEV_FLOAT, Tango::READ) {}; + ~PRU1FirmwareAttrib() {}; + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<A2720 *>(dev))->read_PRU1Firmware(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<A2720 *>(dev))->is_PRU1Firmware_allowed(ty);} +}; + +// Attribute KPCoefficient class definition +class KPCoefficientAttrib: public Tango::Attr +{ +public: + KPCoefficientAttrib():Attr("KPCoefficient", + Tango::DEV_FLOAT, Tango::READ_WRITE) {}; + ~KPCoefficientAttrib() {}; + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<A2720 *>(dev))->read_KPCoefficient(att);} + virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att) + {(static_cast<A2720 *>(dev))->write_KPCoefficient(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<A2720 *>(dev))->is_KPCoefficient_allowed(ty);} +}; + +// Attribute KICoefficient class definition +class KICoefficientAttrib: public Tango::Attr +{ +public: + KICoefficientAttrib():Attr("KICoefficient", + Tango::DEV_FLOAT, Tango::READ_WRITE) {}; + ~KICoefficientAttrib() {}; + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<A2720 *>(dev))->read_KICoefficient(att);} + virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att) + {(static_cast<A2720 *>(dev))->write_KICoefficient(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<A2720 *>(dev))->is_KICoefficient_allowed(ty);} +}; + +// Attribute KFFCoefficient class definition +class KFFCoefficientAttrib: public Tango::Attr +{ +public: + KFFCoefficientAttrib():Attr("KFFCoefficient", + Tango::DEV_FLOAT, Tango::READ_WRITE) {}; + ~KFFCoefficientAttrib() {}; + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<A2720 *>(dev))->read_KFFCoefficient(att);} + virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att) + {(static_cast<A2720 *>(dev))->write_KFFCoefficient(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<A2720 *>(dev))->is_KFFCoefficient_allowed(ty);} +}; + +// Attribute SlewRate class definition +class SlewRateAttrib: public Tango::Attr +{ +public: + SlewRateAttrib():Attr("SlewRate", + Tango::DEV_FLOAT, Tango::READ_WRITE) {}; + ~SlewRateAttrib() {}; + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<A2720 *>(dev))->read_SlewRate(att);} + virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att) + {(static_cast<A2720 *>(dev))->write_SlewRate(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<A2720 *>(dev))->is_SlewRate_allowed(ty);} +}; + +// Attribute CurrentMin class definition +class CurrentMinAttrib: public Tango::Attr +{ +public: + CurrentMinAttrib():Attr("CurrentMin", + Tango::DEV_FLOAT, Tango::READ_WRITE) {}; + ~CurrentMinAttrib() {}; + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<A2720 *>(dev))->read_CurrentMin(att);} + virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att) + {(static_cast<A2720 *>(dev))->write_CurrentMin(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<A2720 *>(dev))->is_CurrentMin_allowed(ty);} +}; + +// Attribute CurrentMax class definition +class CurrentMaxAttrib: public Tango::Attr +{ +public: + CurrentMaxAttrib():Attr("CurrentMax", + Tango::DEV_FLOAT, Tango::READ_WRITE) {}; + ~CurrentMaxAttrib() {}; + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<A2720 *>(dev))->read_CurrentMax(att);} + virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att) + {(static_cast<A2720 *>(dev))->write_CurrentMax(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<A2720 *>(dev))->is_CurrentMax_allowed(ty);} +}; + +// Attribute CurrentCoefficient0 class definition +class CurrentCoefficient0Attrib: public Tango::Attr +{ +public: + CurrentCoefficient0Attrib():Attr("CurrentCoefficient0", + Tango::DEV_FLOAT, Tango::READ_WRITE) {}; + ~CurrentCoefficient0Attrib() {}; + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<A2720 *>(dev))->read_CurrentCoefficient0(att);} + virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att) + {(static_cast<A2720 *>(dev))->write_CurrentCoefficient0(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<A2720 *>(dev))->is_CurrentCoefficient0_allowed(ty);} +}; + +// Attribute CurrentCoefficient1 class definition +class CurrentCoefficient1Attrib: public Tango::Attr +{ +public: + CurrentCoefficient1Attrib():Attr("CurrentCoefficient1", + Tango::DEV_FLOAT, Tango::READ_WRITE) {}; + ~CurrentCoefficient1Attrib() {}; + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<A2720 *>(dev))->read_CurrentCoefficient1(att);} + virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att) + {(static_cast<A2720 *>(dev))->write_CurrentCoefficient1(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<A2720 *>(dev))->is_CurrentCoefficient1_allowed(ty);} +}; + +// Attribute CurrentCoefficient2 class definition +class CurrentCoefficient2Attrib: public Tango::Attr +{ +public: + CurrentCoefficient2Attrib():Attr("CurrentCoefficient2", + Tango::DEV_FLOAT, Tango::READ_WRITE) {}; + ~CurrentCoefficient2Attrib() {}; + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<A2720 *>(dev))->read_CurrentCoefficient2(att);} + virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att) + {(static_cast<A2720 *>(dev))->write_CurrentCoefficient2(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<A2720 *>(dev))->is_CurrentCoefficient2_allowed(ty);} +}; + +// Attribute AuxVoltageCoefficient0 class definition +class AuxVoltageCoefficient0Attrib: public Tango::Attr +{ +public: + AuxVoltageCoefficient0Attrib():Attr("AuxVoltageCoefficient0", + Tango::DEV_FLOAT, Tango::READ_WRITE) {}; + ~AuxVoltageCoefficient0Attrib() {}; + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<A2720 *>(dev))->read_AuxVoltageCoefficient0(att);} + virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att) + {(static_cast<A2720 *>(dev))->write_AuxVoltageCoefficient0(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<A2720 *>(dev))->is_AuxVoltageCoefficient0_allowed(ty);} +}; + +// Attribute AuxVoltageCoefficient1 class definition +class AuxVoltageCoefficient1Attrib: public Tango::Attr +{ +public: + AuxVoltageCoefficient1Attrib():Attr("AuxVoltageCoefficient1", + Tango::DEV_FLOAT, Tango::READ_WRITE) {}; + ~AuxVoltageCoefficient1Attrib() {}; + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<A2720 *>(dev))->read_AuxVoltageCoefficient1(att);} + virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att) + {(static_cast<A2720 *>(dev))->write_AuxVoltageCoefficient1(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<A2720 *>(dev))->is_AuxVoltageCoefficient1_allowed(ty);} +}; + +// Attribute VoltageCoefficient0 class definition +class VoltageCoefficient0Attrib: public Tango::Attr +{ +public: + VoltageCoefficient0Attrib():Attr("VoltageCoefficient0", + Tango::DEV_FLOAT, Tango::READ_WRITE) {}; + ~VoltageCoefficient0Attrib() {}; + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<A2720 *>(dev))->read_VoltageCoefficient0(att);} + virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att) + {(static_cast<A2720 *>(dev))->write_VoltageCoefficient0(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<A2720 *>(dev))->is_VoltageCoefficient0_allowed(ty);} +}; + +// Attribute VoltageCoefficient1 class definition +class VoltageCoefficient1Attrib: public Tango::Attr +{ +public: + VoltageCoefficient1Attrib():Attr("VoltageCoefficient1", + Tango::DEV_FLOAT, Tango::READ_WRITE) {}; + ~VoltageCoefficient1Attrib() {}; + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<A2720 *>(dev))->read_VoltageCoefficient1(att);} + virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att) + {(static_cast<A2720 *>(dev))->write_VoltageCoefficient1(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<A2720 *>(dev))->is_VoltageCoefficient1_allowed(ty);} +}; + +// Attribute DCCurrentCoefficient0 class definition +class DCCurrentCoefficient0Attrib: public Tango::Attr +{ +public: + DCCurrentCoefficient0Attrib():Attr("DCCurrentCoefficient0", + Tango::DEV_FLOAT, Tango::READ_WRITE) {}; + ~DCCurrentCoefficient0Attrib() {}; + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<A2720 *>(dev))->read_DCCurrentCoefficient0(att);} + virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att) + {(static_cast<A2720 *>(dev))->write_DCCurrentCoefficient0(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<A2720 *>(dev))->is_DCCurrentCoefficient0_allowed(ty);} +}; + +// Attribute DCCurrentCoefficient1 class definition +class DCCurrentCoefficient1Attrib: public Tango::Attr +{ +public: + DCCurrentCoefficient1Attrib():Attr("DCCurrentCoefficient1", + Tango::DEV_FLOAT, Tango::READ_WRITE) {}; + ~DCCurrentCoefficient1Attrib() {}; + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<A2720 *>(dev))->read_DCCurrentCoefficient1(att);} + virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att) + {(static_cast<A2720 *>(dev))->write_DCCurrentCoefficient1(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<A2720 *>(dev))->is_DCCurrentCoefficient1_allowed(ty);} +}; + +// Attribute ADCTempCoefficient0 class definition +class ADCTempCoefficient0Attrib: public Tango::Attr +{ +public: + ADCTempCoefficient0Attrib():Attr("ADCTempCoefficient0", + Tango::DEV_FLOAT, Tango::READ_WRITE) {}; + ~ADCTempCoefficient0Attrib() {}; + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<A2720 *>(dev))->read_ADCTempCoefficient0(att);} + virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att) + {(static_cast<A2720 *>(dev))->write_ADCTempCoefficient0(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<A2720 *>(dev))->is_ADCTempCoefficient0_allowed(ty);} +}; + +// Attribute ADCTempCoefficient1 class definition +class ADCTempCoefficient1Attrib: public Tango::Attr +{ +public: + ADCTempCoefficient1Attrib():Attr("ADCTempCoefficient1", + Tango::DEV_FLOAT, Tango::READ_WRITE) {}; + ~ADCTempCoefficient1Attrib() {}; + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<A2720 *>(dev))->read_ADCTempCoefficient1(att);} + virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att) + {(static_cast<A2720 *>(dev))->write_ADCTempCoefficient1(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<A2720 *>(dev))->is_ADCTempCoefficient1_allowed(ty);} +}; + +// Attribute HeatsinkTempCoefficient0 class definition +class HeatsinkTempCoefficient0Attrib: public Tango::Attr +{ +public: + HeatsinkTempCoefficient0Attrib():Attr("HeatsinkTempCoefficient0", + Tango::DEV_FLOAT, Tango::READ_WRITE) {}; + ~HeatsinkTempCoefficient0Attrib() {}; + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<A2720 *>(dev))->read_HeatsinkTempCoefficient0(att);} + virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att) + {(static_cast<A2720 *>(dev))->write_HeatsinkTempCoefficient0(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<A2720 *>(dev))->is_HeatsinkTempCoefficient0_allowed(ty);} +}; + +// Attribute HeatsinkTempCoefficient1 class definition +class HeatsinkTempCoefficient1Attrib: public Tango::Attr +{ +public: + HeatsinkTempCoefficient1Attrib():Attr("HeatsinkTempCoefficient1", + Tango::DEV_FLOAT, Tango::READ_WRITE) {}; + ~HeatsinkTempCoefficient1Attrib() {}; + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<A2720 *>(dev))->read_HeatsinkTempCoefficient1(att);} + virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att) + {(static_cast<A2720 *>(dev))->write_HeatsinkTempCoefficient1(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<A2720 *>(dev))->is_HeatsinkTempCoefficient1_allowed(ty);} +}; + +// Attribute SerialNumber class definition +class SerialNumberAttrib: public Tango::Attr +{ +public: + SerialNumberAttrib():Attr("SerialNumber", + Tango::DEV_STRING, Tango::READ) {}; + ~SerialNumberAttrib() {}; + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<A2720 *>(dev))->read_SerialNumber(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<A2720 *>(dev))->is_SerialNumber_allowed(ty);} +}; + +// Attribute Model class definition +class ModelAttrib: public Tango::Attr +{ +public: + ModelAttrib():Attr("Model", + Tango::DEV_STRING, Tango::READ) {}; + ~ModelAttrib() {}; + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<A2720 *>(dev))->read_Model(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<A2720 *>(dev))->is_Model_allowed(ty);} +}; + +// Attribute CalibrationDate class definition +class CalibrationDateAttrib: public Tango::Attr +{ +public: + CalibrationDateAttrib():Attr("CalibrationDate", + Tango::DEV_STRING, Tango::READ) {}; + ~CalibrationDateAttrib() {}; + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<A2720 *>(dev))->read_CalibrationDate(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<A2720 *>(dev))->is_CalibrationDate_allowed(ty);} +}; + +// Attribute PulseDuration class definition +class PulseDurationAttrib: public Tango::Attr +{ +public: + PulseDurationAttrib():Attr("PulseDuration", + Tango::DEV_FLOAT, Tango::READ_WRITE) {}; + ~PulseDurationAttrib() {}; + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<A2720 *>(dev))->read_PulseDuration(att);} + virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att) + {(static_cast<A2720 *>(dev))->write_PulseDuration(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<A2720 *>(dev))->is_PulseDuration_allowed(ty);} +}; + +// Attribute CurrentCoefficient3 class definition +class CurrentCoefficient3Attrib: public Tango::Attr +{ +public: + CurrentCoefficient3Attrib():Attr("CurrentCoefficient3", + Tango::DEV_FLOAT, Tango::READ_WRITE) {}; + ~CurrentCoefficient3Attrib() {}; + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<A2720 *>(dev))->read_CurrentCoefficient3(att);} + virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att) + {(static_cast<A2720 *>(dev))->write_CurrentCoefficient3(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<A2720 *>(dev))->is_CurrentCoefficient3_allowed(ty);} +}; + +// Attribute DCurr class definition +class DCurrAttrib: public Tango::Attr +{ +public: + DCurrAttrib():Attr("DCurr", + Tango::DEV_DOUBLE, Tango::WRITE) {}; + ~DCurrAttrib() {}; + virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att) + {(static_cast<A2720 *>(dev))->write_DCurr(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<A2720 *>(dev))->is_DCurr_allowed(ty);} +}; + +// Attribute CurrentCoefficient4 class definition +class CurrentCoefficient4Attrib: public Tango::Attr +{ +public: + CurrentCoefficient4Attrib():Attr("CurrentCoefficient4", + Tango::DEV_FLOAT, Tango::READ_WRITE) {}; + ~CurrentCoefficient4Attrib() {}; + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<A2720 *>(dev))->read_CurrentCoefficient4(att);} + virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att) + {(static_cast<A2720 *>(dev))->write_CurrentCoefficient4(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<A2720 *>(dev))->is_CurrentCoefficient4_allowed(ty);} +}; + +// Attribute CurrentCoefficient5 class definition +class CurrentCoefficient5Attrib: public Tango::Attr +{ +public: + CurrentCoefficient5Attrib():Attr("CurrentCoefficient5", + Tango::DEV_FLOAT, Tango::READ_WRITE) {}; + ~CurrentCoefficient5Attrib() {}; + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<A2720 *>(dev))->read_CurrentCoefficient5(att);} + virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att) + {(static_cast<A2720 *>(dev))->write_CurrentCoefficient5(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<A2720 *>(dev))->is_CurrentCoefficient5_allowed(ty);} +}; + +// Attribute PsStat class definition +class PsStatAttrib: public Tango::SpectrumAttr +{ +public: + PsStatAttrib():SpectrumAttr("PsStat", + Tango::DEV_BOOLEAN, Tango::READ, 10) {}; + ~PsStatAttrib() {}; + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<A2720 *>(dev))->read_PsStat(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<A2720 *>(dev))->is_PsStat_allowed(ty);} +}; + + +//========================================= +// Define classes for commands +//========================================= +// Command StartCycling class definition +class StartCyclingClass : public Tango::Command +{ +public: + StartCyclingClass(const char *name, + Tango::CmdArgType in, + Tango::CmdArgType out, + const char *in_desc, + const char *out_desc, + Tango::DispLevel level) + :Command(name,in,out,in_desc,out_desc, level) {}; + + StartCyclingClass(const char *name, + Tango::CmdArgType in, + Tango::CmdArgType out) + :Command(name,in,out) {}; + ~StartCyclingClass() {}; + + 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<A2720 *>(dev))->is_StartCycling_allowed(any);} +}; + +// Command Abort class definition +class AbortClass : public Tango::Command +{ +public: + AbortClass(const char *name, + Tango::CmdArgType in, + Tango::CmdArgType out, + const char *in_desc, + const char *out_desc, + Tango::DispLevel level) + :Command(name,in,out,in_desc,out_desc, level) {}; + + AbortClass(const char *name, + Tango::CmdArgType in, + Tango::CmdArgType out) + :Command(name,in,out) {}; + ~AbortClass() {}; + + 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<A2720 *>(dev))->is_Abort_allowed(any);} +}; + +// Command On class definition +class OnClass : public Tango::Command +{ +public: + OnClass(const char *name, + Tango::CmdArgType in, + Tango::CmdArgType out, + const char *in_desc, + const char *out_desc, + Tango::DispLevel level) + :Command(name,in,out,in_desc,out_desc, level) {}; + + OnClass(const char *name, + Tango::CmdArgType in, + Tango::CmdArgType out) + :Command(name,in,out) {}; + ~OnClass() {}; + + 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<A2720 *>(dev))->is_On_allowed(any);} +}; + +// Command Off class definition +class OffClass : public Tango::Command +{ +public: + OffClass(const char *name, + Tango::CmdArgType in, + Tango::CmdArgType out, + const char *in_desc, + const char *out_desc, + Tango::DispLevel level) + :Command(name,in,out,in_desc,out_desc, level) {}; + + OffClass(const char *name, + Tango::CmdArgType in, + Tango::CmdArgType out) + :Command(name,in,out) {}; + ~OffClass() {}; + + 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<A2720 *>(dev))->is_Off_allowed(any);} +}; + +// Command Reset class definition +class ResetClass : public Tango::Command +{ +public: + ResetClass(const char *name, + Tango::CmdArgType in, + Tango::CmdArgType out, + const char *in_desc, + const char *out_desc, + Tango::DispLevel level) + :Command(name,in,out,in_desc,out_desc, level) {}; + + ResetClass(const char *name, + Tango::CmdArgType in, + Tango::CmdArgType out) + :Command(name,in,out) {}; + ~ResetClass() {}; + + 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<A2720 *>(dev))->is_Reset_allowed(any);} +}; + + +/** + * The A2720Class singleton definition + */ + +#ifdef _TG_WINDOWS_ +class __declspec(dllexport) A2720Class : public Tango::DeviceClass +#else +class A2720Class : public Tango::DeviceClass +#endif +{ + /*----- PROTECTED REGION ID(A2720Class::Additionnal DServer data members) ENABLED START -----*/ + + + /*----- PROTECTED REGION END -----*/ // A2720Class::Additionnal DServer data members + + // Class properties data members + public: + // CycRampSlopeCurr: + Tango::DevDouble cycRampSlopeCurr; + // CycMinCurr: + Tango::DevDouble cycMinCurr; + // CycMaxCurr: + Tango::DevDouble cycMaxCurr; + // CycEndCurr: + Tango::DevDouble cycEndCurr; + // CycStartCurr: + Tango::DevDouble cycStartCurr; + // CycNumTimes: + Tango::DevULong cycNumTimes; + // CycWaitTime: + Tango::DevULong cycWaitTime; + public: + // write class properties data members + Tango::DbData cl_prop; + Tango::DbData cl_def_prop; + Tango::DbData dev_def_prop; + + // Method prototypes + static A2720Class *init(const char *); + static A2720Class *instance(); + ~A2720Class(); + Tango::DbDatum get_class_property(string &); + Tango::DbDatum get_default_device_property(string &); + Tango::DbDatum get_default_class_property(string &); + + protected: + A2720Class(string &); + static A2720Class *_instance; + void command_factory(); + void attribute_factory(vector<Tango::Attr *> &); + void pipe_factory(); + void write_class_property(); + void set_default_property(); + void get_class_property(); + string get_cvstag(); + string get_cvsroot(); + + private: + void device_factory(const Tango::DevVarStringArray *); + void create_static_attribute_list(vector<Tango::Attr *> &); + void erase_dynamic_attributes(const Tango::DevVarStringArray *,vector<Tango::Attr *> &); + vector<string> defaultAttList; + Tango::Attr *get_attr_object_by_name(vector<Tango::Attr *> &att_list, string attname); +}; + +} // End of namespace + +#endif // A2720_H diff --git a/src/A2720StateMachine.cpp b/src/A2720StateMachine.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e88debf04a66bf66bb4821eb8a73d2ff0025a93f --- /dev/null +++ b/src/A2720StateMachine.cpp @@ -0,0 +1,1904 @@ +/*----- PROTECTED REGION ID(A2720StateMachine.cpp) ENABLED START -----*/ +static const char *RcsId = "$Id: A2720StateMachine.cpp,v 1.4 2018-02-19 16:52:13 alessio Exp $"; +//============================================================================= +// +// file : A2720StateMachine.cpp +// +// description : State machine file for the A2720 class +// +// project : +// +// This file is part of Tango device class. +// +// Tango is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Tango is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Tango. If not, see <http://www.gnu.org/licenses/>. +// +// $Author: alessio $ +// +// $Revision: 1.4 $ +// $Date: 2018-02-19 16:52:13 $ +// +// $HeadURL: $ +// +//============================================================================= +// This file is generated by POGO +// (Program Obviously used to Generate tango Object) +//============================================================================= + +#include <A2720.h> + +/*----- PROTECTED REGION END -----*/ // A2720::A2720StateMachine.cpp + +//================================================================ +// States | Description +//================================================================ +// ON | +// OFF | +// FAULT | +// UNKNOWN | +// MOVING | +// ALARM | + + +namespace A2720_ns +{ +//================================================= +// Attributes Allowed Methods +//================================================= + +//-------------------------------------------------------- +/** + * Method : A2720::is_Current_allowed() + * Description : Execution allowed for Current attribute + */ +//-------------------------------------------------------- +bool A2720::is_Current_allowed(TANGO_UNUSED(Tango::AttReqType type)) +{ + // Check access type. + if ( type!=Tango::READ_REQ ) + { + // Compare device state with not allowed states for WRITE + if (get_state()==Tango::OFF || + get_state()==Tango::FAULT || + get_state()==Tango::UNKNOWN || + get_state()==Tango::MOVING || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::CurrentStateAllowed_WRITE) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::OFF || + real_state==Tango::FAULT || + real_state==Tango::UNKNOWN || + real_state==Tango::MOVING) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::CurrentStateAllowed_WRITE + return false; + } + return true; + } + else + + // Check access type. + if ( type==Tango::READ_REQ ) + { + // Compare device state with not allowed states for READ + if (get_state()==Tango::UNKNOWN || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::CurrentStateAllowed_READ) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::UNKNOWN) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::CurrentStateAllowed_READ + return false; + } + return true; + } + return true; +} + +//-------------------------------------------------------- +/** + * Method : A2720::is_Voltage_allowed() + * Description : Execution allowed for Voltage attribute + */ +//-------------------------------------------------------- +bool A2720::is_Voltage_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 || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::VoltageStateAllowed_READ) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::UNKNOWN) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::VoltageStateAllowed_READ + return false; + } + return true; + } + return true; +} + +//-------------------------------------------------------- +/** + * Method : A2720::is_CurrentSet_allowed() + * Description : Execution allowed for CurrentSet attribute + */ +//-------------------------------------------------------- +bool A2720::is_CurrentSet_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 || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::CurrentSetStateAllowed_READ) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::UNKNOWN) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::CurrentSetStateAllowed_READ + return false; + } + return true; + } + return true; +} + +//-------------------------------------------------------- +/** + * Method : A2720::is_AuxiliaryVoltage_allowed() + * Description : Execution allowed for AuxiliaryVoltage attribute + */ +//-------------------------------------------------------- +bool A2720::is_AuxiliaryVoltage_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 || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::AuxiliaryVoltageStateAllowed_READ) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::UNKNOWN) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::AuxiliaryVoltageStateAllowed_READ + return false; + } + return true; + } + return true; +} + +//-------------------------------------------------------- +/** + * Method : A2720::is_DCLinkVoltage_allowed() + * Description : Execution allowed for DCLinkVoltage attribute + */ +//-------------------------------------------------------- +bool A2720::is_DCLinkVoltage_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 || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::DCLinkVoltageStateAllowed_READ) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::UNKNOWN) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::DCLinkVoltageStateAllowed_READ + return false; + } + return true; + } + return true; +} + +//-------------------------------------------------------- +/** + * Method : A2720::is_ADCTemperature_allowed() + * Description : Execution allowed for ADCTemperature attribute + */ +//-------------------------------------------------------- +bool A2720::is_ADCTemperature_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 || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::ADCTemperatureStateAllowed_READ) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::UNKNOWN) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::ADCTemperatureStateAllowed_READ + return false; + } + return true; + } + return true; +} + +//-------------------------------------------------------- +/** + * Method : A2720::is_HeatsinkTemperature_allowed() + * Description : Execution allowed for HeatsinkTemperature attribute + */ +//-------------------------------------------------------- +bool A2720::is_HeatsinkTemperature_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 || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::HeatsinkTemperatureStateAllowed_READ) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::UNKNOWN) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::HeatsinkTemperatureStateAllowed_READ + return false; + } + return true; + } + return true; +} + +//-------------------------------------------------------- +/** + * Method : A2720::is_PRU0Firmware_allowed() + * Description : Execution allowed for PRU0Firmware attribute + */ +//-------------------------------------------------------- +bool A2720::is_PRU0Firmware_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 || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::PRU0FirmwareStateAllowed_READ) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::UNKNOWN) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::PRU0FirmwareStateAllowed_READ + return false; + } + return true; + } + return true; +} + +//-------------------------------------------------------- +/** + * Method : A2720::is_PRU1Firmware_allowed() + * Description : Execution allowed for PRU1Firmware attribute + */ +//-------------------------------------------------------- +bool A2720::is_PRU1Firmware_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 || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::PRU1FirmwareStateAllowed_READ) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::UNKNOWN) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::PRU1FirmwareStateAllowed_READ + return false; + } + return true; + } + return true; +} + +//-------------------------------------------------------- +/** + * Method : A2720::is_KPCoefficient_allowed() + * Description : Execution allowed for KPCoefficient attribute + */ +//-------------------------------------------------------- +bool A2720::is_KPCoefficient_allowed(TANGO_UNUSED(Tango::AttReqType type)) +{ + // Check access type. + if ( type!=Tango::READ_REQ ) + { + // Compare device state with not allowed states for WRITE + if (get_state()==Tango::OFF || + get_state()==Tango::FAULT || + get_state()==Tango::UNKNOWN || + get_state()==Tango::MOVING || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::KPCoefficientStateAllowed_WRITE) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::OFF || + real_state==Tango::FAULT || + real_state==Tango::UNKNOWN || + real_state==Tango::MOVING) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::KPCoefficientStateAllowed_WRITE + return false; + } + return true; + } + else + + // Check access type. + if ( type==Tango::READ_REQ ) + { + // Compare device state with not allowed states for READ + if (get_state()==Tango::UNKNOWN || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::KPCoefficientStateAllowed_READ) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::UNKNOWN) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::KPCoefficientStateAllowed_READ + return false; + } + return true; + } + return true; +} + +//-------------------------------------------------------- +/** + * Method : A2720::is_KICoefficient_allowed() + * Description : Execution allowed for KICoefficient attribute + */ +//-------------------------------------------------------- +bool A2720::is_KICoefficient_allowed(TANGO_UNUSED(Tango::AttReqType type)) +{ + // Check access type. + if ( type!=Tango::READ_REQ ) + { + // Compare device state with not allowed states for WRITE + if (get_state()==Tango::OFF || + get_state()==Tango::FAULT || + get_state()==Tango::UNKNOWN || + get_state()==Tango::MOVING || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::KICoefficientStateAllowed_WRITE) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::OFF || + real_state==Tango::FAULT || + real_state==Tango::UNKNOWN || + real_state==Tango::MOVING) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::KICoefficientStateAllowed_WRITE + return false; + } + return true; + } + else + + // Check access type. + if ( type==Tango::READ_REQ ) + { + // Compare device state with not allowed states for READ + if (get_state()==Tango::UNKNOWN || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::KICoefficientStateAllowed_READ) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::UNKNOWN) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::KICoefficientStateAllowed_READ + return false; + } + return true; + } + return true; +} + +//-------------------------------------------------------- +/** + * Method : A2720::is_KFFCoefficient_allowed() + * Description : Execution allowed for KFFCoefficient attribute + */ +//-------------------------------------------------------- +bool A2720::is_KFFCoefficient_allowed(TANGO_UNUSED(Tango::AttReqType type)) +{ + // Check access type. + if ( type!=Tango::READ_REQ ) + { + // Compare device state with not allowed states for WRITE + if (get_state()==Tango::OFF || + get_state()==Tango::FAULT || + get_state()==Tango::UNKNOWN || + get_state()==Tango::MOVING || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::KFFCoefficientStateAllowed_WRITE) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::OFF || + real_state==Tango::FAULT || + real_state==Tango::UNKNOWN || + real_state==Tango::MOVING) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::KFFCoefficientStateAllowed_WRITE + return false; + } + return true; + } + else + + // Check access type. + if ( type==Tango::READ_REQ ) + { + // Compare device state with not allowed states for READ + if (get_state()==Tango::UNKNOWN || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::KFFCoefficientStateAllowed_READ) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::UNKNOWN) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::KFFCoefficientStateAllowed_READ + return false; + } + return true; + } + return true; +} + +//-------------------------------------------------------- +/** + * Method : A2720::is_SlewRate_allowed() + * Description : Execution allowed for SlewRate attribute + */ +//-------------------------------------------------------- +bool A2720::is_SlewRate_allowed(TANGO_UNUSED(Tango::AttReqType type)) +{ + // Check access type. + if ( type!=Tango::READ_REQ ) + { + // Compare device state with not allowed states for WRITE + if (get_state()==Tango::OFF || + get_state()==Tango::FAULT || + get_state()==Tango::UNKNOWN || + get_state()==Tango::MOVING || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::SlewRateStateAllowed_WRITE) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::OFF || + real_state==Tango::FAULT || + real_state==Tango::UNKNOWN || + real_state==Tango::MOVING) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::SlewRateStateAllowed_WRITE + return false; + } + return true; + } + else + + // Check access type. + if ( type==Tango::READ_REQ ) + { + // Compare device state with not allowed states for READ + if (get_state()==Tango::UNKNOWN || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::SlewRateStateAllowed_READ) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::UNKNOWN) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::SlewRateStateAllowed_READ + return false; + } + return true; + } + return true; +} + +//-------------------------------------------------------- +/** + * Method : A2720::is_CurrentMin_allowed() + * Description : Execution allowed for CurrentMin attribute + */ +//-------------------------------------------------------- +bool A2720::is_CurrentMin_allowed(TANGO_UNUSED(Tango::AttReqType type)) +{ + // Check access type. + if ( type!=Tango::READ_REQ ) + { + // Compare device state with not allowed states for WRITE + if (get_state()==Tango::OFF || + get_state()==Tango::FAULT || + get_state()==Tango::UNKNOWN || + get_state()==Tango::MOVING || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::CurrentMinStateAllowed_WRITE) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::OFF || + real_state==Tango::FAULT || + real_state==Tango::UNKNOWN || + real_state==Tango::MOVING) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::CurrentMinStateAllowed_WRITE + return false; + } + return true; + } + else + + // Check access type. + if ( type==Tango::READ_REQ ) + { + // Compare device state with not allowed states for READ + if (get_state()==Tango::UNKNOWN || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::CurrentMinStateAllowed_READ) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::UNKNOWN) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::CurrentMinStateAllowed_READ + return false; + } + return true; + } + return true; +} + +//-------------------------------------------------------- +/** + * Method : A2720::is_CurrentMax_allowed() + * Description : Execution allowed for CurrentMax attribute + */ +//-------------------------------------------------------- +bool A2720::is_CurrentMax_allowed(TANGO_UNUSED(Tango::AttReqType type)) +{ + // Check access type. + if ( type!=Tango::READ_REQ ) + { + // Compare device state with not allowed states for WRITE + if (get_state()==Tango::OFF || + get_state()==Tango::FAULT || + get_state()==Tango::UNKNOWN || + get_state()==Tango::MOVING || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::CurrentMaxStateAllowed_WRITE) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::OFF || + real_state==Tango::FAULT || + real_state==Tango::UNKNOWN || + real_state==Tango::MOVING) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::CurrentMaxStateAllowed_WRITE + return false; + } + return true; + } + else + + // Check access type. + if ( type==Tango::READ_REQ ) + { + // Compare device state with not allowed states for READ + if (get_state()==Tango::UNKNOWN || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::CurrentMaxStateAllowed_READ) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::UNKNOWN) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::CurrentMaxStateAllowed_READ + return false; + } + return true; + } + return true; +} + +//-------------------------------------------------------- +/** + * Method : A2720::is_CurrentCoefficient0_allowed() + * Description : Execution allowed for CurrentCoefficient0 attribute + */ +//-------------------------------------------------------- +bool A2720::is_CurrentCoefficient0_allowed(TANGO_UNUSED(Tango::AttReqType type)) +{ + // Check access type. + if ( type!=Tango::READ_REQ ) + { + // Compare device state with not allowed states for WRITE + if (get_state()==Tango::OFF || + get_state()==Tango::FAULT || + get_state()==Tango::UNKNOWN || + get_state()==Tango::MOVING || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::CurrentCoefficient0StateAllowed_WRITE) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::OFF || + real_state==Tango::FAULT || + real_state==Tango::UNKNOWN || + real_state==Tango::MOVING) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::CurrentCoefficient0StateAllowed_WRITE + return false; + } + return true; + } + else + + // Check access type. + if ( type==Tango::READ_REQ ) + { + // Compare device state with not allowed states for READ + if (get_state()==Tango::UNKNOWN || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::CurrentCoefficient0StateAllowed_READ) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::UNKNOWN) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::CurrentCoefficient0StateAllowed_READ + return false; + } + return true; + } + return true; +} + +//-------------------------------------------------------- +/** + * Method : A2720::is_CurrentCoefficient1_allowed() + * Description : Execution allowed for CurrentCoefficient1 attribute + */ +//-------------------------------------------------------- +bool A2720::is_CurrentCoefficient1_allowed(TANGO_UNUSED(Tango::AttReqType type)) +{ + // Check access type. + if ( type!=Tango::READ_REQ ) + { + // Compare device state with not allowed states for WRITE + if (get_state()==Tango::OFF || + get_state()==Tango::FAULT || + get_state()==Tango::UNKNOWN || + get_state()==Tango::MOVING || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::CurrentCoefficient1StateAllowed_WRITE) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::OFF || + real_state==Tango::FAULT || + real_state==Tango::UNKNOWN || + real_state==Tango::MOVING) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::CurrentCoefficient1StateAllowed_WRITE + return false; + } + return true; + } + else + + // Check access type. + if ( type==Tango::READ_REQ ) + { + // Compare device state with not allowed states for READ + if (get_state()==Tango::UNKNOWN || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::CurrentCoefficient1StateAllowed_READ) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::UNKNOWN) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::CurrentCoefficient1StateAllowed_READ + return false; + } + return true; + } + return true; +} + +//-------------------------------------------------------- +/** + * Method : A2720::is_CurrentCoefficient2_allowed() + * Description : Execution allowed for CurrentCoefficient2 attribute + */ +//-------------------------------------------------------- +bool A2720::is_CurrentCoefficient2_allowed(TANGO_UNUSED(Tango::AttReqType type)) +{ + // Check access type. + if ( type!=Tango::READ_REQ ) + { + // Compare device state with not allowed states for WRITE + if (get_state()==Tango::OFF || + get_state()==Tango::FAULT || + get_state()==Tango::UNKNOWN || + get_state()==Tango::MOVING || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::CurrentCoefficient2StateAllowed_WRITE) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::OFF || + real_state==Tango::FAULT || + real_state==Tango::UNKNOWN || + real_state==Tango::MOVING) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::CurrentCoefficient2StateAllowed_WRITE + return false; + } + return true; + } + else + + // Check access type. + if ( type==Tango::READ_REQ ) + { + // Compare device state with not allowed states for READ + if (get_state()==Tango::UNKNOWN || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::CurrentCoefficient2StateAllowed_READ) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::UNKNOWN) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::CurrentCoefficient2StateAllowed_READ + return false; + } + return true; + } + return true; +} + +//-------------------------------------------------------- +/** + * Method : A2720::is_AuxVoltageCoefficient0_allowed() + * Description : Execution allowed for AuxVoltageCoefficient0 attribute + */ +//-------------------------------------------------------- +bool A2720::is_AuxVoltageCoefficient0_allowed(TANGO_UNUSED(Tango::AttReqType type)) +{ + // Check access type. + if ( type!=Tango::READ_REQ ) + { + // Compare device state with not allowed states for WRITE + if (get_state()==Tango::OFF || + get_state()==Tango::FAULT || + get_state()==Tango::UNKNOWN || + get_state()==Tango::MOVING || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::AuxVoltageCoefficient0StateAllowed_WRITE) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::OFF || + real_state==Tango::FAULT || + real_state==Tango::UNKNOWN || + real_state==Tango::MOVING) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::AuxVoltageCoefficient0StateAllowed_WRITE + return false; + } + return true; + } + else + + // Check access type. + if ( type==Tango::READ_REQ ) + { + // Compare device state with not allowed states for READ + if (get_state()==Tango::UNKNOWN || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::AuxVoltageCoefficient0StateAllowed_READ) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::UNKNOWN) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::AuxVoltageCoefficient0StateAllowed_READ + return false; + } + return true; + } + return true; +} + +//-------------------------------------------------------- +/** + * Method : A2720::is_AuxVoltageCoefficient1_allowed() + * Description : Execution allowed for AuxVoltageCoefficient1 attribute + */ +//-------------------------------------------------------- +bool A2720::is_AuxVoltageCoefficient1_allowed(TANGO_UNUSED(Tango::AttReqType type)) +{ + // Check access type. + if ( type!=Tango::READ_REQ ) + { + // Compare device state with not allowed states for WRITE + if (get_state()==Tango::OFF || + get_state()==Tango::FAULT || + get_state()==Tango::UNKNOWN || + get_state()==Tango::MOVING || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::AuxVoltageCoefficient1StateAllowed_WRITE) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::OFF || + real_state==Tango::FAULT || + real_state==Tango::UNKNOWN || + real_state==Tango::MOVING) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::AuxVoltageCoefficient1StateAllowed_WRITE + return false; + } + return true; + } + else + + // Check access type. + if ( type==Tango::READ_REQ ) + { + // Compare device state with not allowed states for READ + if (get_state()==Tango::UNKNOWN || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::AuxVoltageCoefficient1StateAllowed_READ) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::UNKNOWN) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::AuxVoltageCoefficient1StateAllowed_READ + return false; + } + return true; + } + return true; +} + +//-------------------------------------------------------- +/** + * Method : A2720::is_VoltageCoefficient0_allowed() + * Description : Execution allowed for VoltageCoefficient0 attribute + */ +//-------------------------------------------------------- +bool A2720::is_VoltageCoefficient0_allowed(TANGO_UNUSED(Tango::AttReqType type)) +{ + // Check access type. + if ( type!=Tango::READ_REQ ) + { + // Compare device state with not allowed states for WRITE + if (get_state()==Tango::OFF || + get_state()==Tango::FAULT || + get_state()==Tango::UNKNOWN || + get_state()==Tango::MOVING || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::VoltageCoefficient0StateAllowed_WRITE) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::OFF || + real_state==Tango::FAULT || + real_state==Tango::UNKNOWN || + real_state==Tango::MOVING) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::VoltageCoefficient0StateAllowed_WRITE + return false; + } + return true; + } + else + + // Check access type. + if ( type==Tango::READ_REQ ) + { + // Compare device state with not allowed states for READ + if (get_state()==Tango::UNKNOWN || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::VoltageCoefficient0StateAllowed_READ) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::UNKNOWN) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::VoltageCoefficient0StateAllowed_READ + return false; + } + return true; + } + return true; +} + +//-------------------------------------------------------- +/** + * Method : A2720::is_VoltageCoefficient1_allowed() + * Description : Execution allowed for VoltageCoefficient1 attribute + */ +//-------------------------------------------------------- +bool A2720::is_VoltageCoefficient1_allowed(TANGO_UNUSED(Tango::AttReqType type)) +{ + // Check access type. + if ( type!=Tango::READ_REQ ) + { + // Compare device state with not allowed states for WRITE + if (get_state()==Tango::OFF || + get_state()==Tango::FAULT || + get_state()==Tango::UNKNOWN || + get_state()==Tango::MOVING || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::VoltageCoefficient1StateAllowed_WRITE) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::OFF || + real_state==Tango::FAULT || + real_state==Tango::UNKNOWN || + real_state==Tango::MOVING) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::VoltageCoefficient1StateAllowed_WRITE + return false; + } + return true; + } + else + + // Check access type. + if ( type==Tango::READ_REQ ) + { + // Compare device state with not allowed states for READ + if (get_state()==Tango::UNKNOWN || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::VoltageCoefficient1StateAllowed_READ) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::UNKNOWN) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::VoltageCoefficient1StateAllowed_READ + return false; + } + return true; + } + return true; +} + +//-------------------------------------------------------- +/** + * Method : A2720::is_DCCurrentCoefficient0_allowed() + * Description : Execution allowed for DCCurrentCoefficient0 attribute + */ +//-------------------------------------------------------- +bool A2720::is_DCCurrentCoefficient0_allowed(TANGO_UNUSED(Tango::AttReqType type)) +{ + // Check access type. + if ( type!=Tango::READ_REQ ) + { + // Compare device state with not allowed states for WRITE + if (get_state()==Tango::OFF || + get_state()==Tango::FAULT || + get_state()==Tango::UNKNOWN || + get_state()==Tango::MOVING || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::DCCurrentCoefficient0StateAllowed_WRITE) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::OFF || + real_state==Tango::FAULT || + real_state==Tango::UNKNOWN || + real_state==Tango::MOVING) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::DCCurrentCoefficient0StateAllowed_WRITE + return false; + } + return true; + } + else + + // Check access type. + if ( type==Tango::READ_REQ ) + { + // Compare device state with not allowed states for READ + if (get_state()==Tango::UNKNOWN || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::DCCurrentCoefficient0StateAllowed_READ) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::UNKNOWN) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::DCCurrentCoefficient0StateAllowed_READ + return false; + } + return true; + } + return true; +} + +//-------------------------------------------------------- +/** + * Method : A2720::is_DCCurrentCoefficient1_allowed() + * Description : Execution allowed for DCCurrentCoefficient1 attribute + */ +//-------------------------------------------------------- +bool A2720::is_DCCurrentCoefficient1_allowed(TANGO_UNUSED(Tango::AttReqType type)) +{ + // Check access type. + if ( type!=Tango::READ_REQ ) + { + // Compare device state with not allowed states for WRITE + if (get_state()==Tango::OFF || + get_state()==Tango::FAULT || + get_state()==Tango::UNKNOWN || + get_state()==Tango::MOVING || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::DCCurrentCoefficient1StateAllowed_WRITE) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::OFF || + real_state==Tango::FAULT || + real_state==Tango::UNKNOWN || + real_state==Tango::MOVING) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::DCCurrentCoefficient1StateAllowed_WRITE + return false; + } + return true; + } + else + + // Check access type. + if ( type==Tango::READ_REQ ) + { + // Compare device state with not allowed states for READ + if (get_state()==Tango::UNKNOWN || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::DCCurrentCoefficient1StateAllowed_READ) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::UNKNOWN) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::DCCurrentCoefficient1StateAllowed_READ + return false; + } + return true; + } + return true; +} + +//-------------------------------------------------------- +/** + * Method : A2720::is_ADCTempCoefficient0_allowed() + * Description : Execution allowed for ADCTempCoefficient0 attribute + */ +//-------------------------------------------------------- +bool A2720::is_ADCTempCoefficient0_allowed(TANGO_UNUSED(Tango::AttReqType type)) +{ + // Check access type. + if ( type!=Tango::READ_REQ ) + { + // Compare device state with not allowed states for WRITE + if (get_state()==Tango::OFF || + get_state()==Tango::FAULT || + get_state()==Tango::UNKNOWN || + get_state()==Tango::MOVING || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::ADCTempCoefficient0StateAllowed_WRITE) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::OFF || + real_state==Tango::FAULT || + real_state==Tango::UNKNOWN || + real_state==Tango::MOVING) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::ADCTempCoefficient0StateAllowed_WRITE + return false; + } + return true; + } + else + + // Check access type. + if ( type==Tango::READ_REQ ) + { + // Compare device state with not allowed states for READ + if (get_state()==Tango::UNKNOWN || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::ADCTempCoefficient0StateAllowed_READ) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::UNKNOWN) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::ADCTempCoefficient0StateAllowed_READ + return false; + } + return true; + } + return true; +} + +//-------------------------------------------------------- +/** + * Method : A2720::is_ADCTempCoefficient1_allowed() + * Description : Execution allowed for ADCTempCoefficient1 attribute + */ +//-------------------------------------------------------- +bool A2720::is_ADCTempCoefficient1_allowed(TANGO_UNUSED(Tango::AttReqType type)) +{ + // Check access type. + if ( type!=Tango::READ_REQ ) + { + // Compare device state with not allowed states for WRITE + if (get_state()==Tango::OFF || + get_state()==Tango::FAULT || + get_state()==Tango::UNKNOWN || + get_state()==Tango::MOVING || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::ADCTempCoefficient1StateAllowed_WRITE) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::OFF || + real_state==Tango::FAULT || + real_state==Tango::UNKNOWN || + real_state==Tango::MOVING) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::ADCTempCoefficient1StateAllowed_WRITE + return false; + } + return true; + } + else + + // Check access type. + if ( type==Tango::READ_REQ ) + { + // Compare device state with not allowed states for READ + if (get_state()==Tango::UNKNOWN || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::ADCTempCoefficient1StateAllowed_READ) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::UNKNOWN) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::ADCTempCoefficient1StateAllowed_READ + return false; + } + return true; + } + return true; +} + +//-------------------------------------------------------- +/** + * Method : A2720::is_HeatsinkTempCoefficient0_allowed() + * Description : Execution allowed for HeatsinkTempCoefficient0 attribute + */ +//-------------------------------------------------------- +bool A2720::is_HeatsinkTempCoefficient0_allowed(TANGO_UNUSED(Tango::AttReqType type)) +{ + // Check access type. + if ( type!=Tango::READ_REQ ) + { + // Compare device state with not allowed states for WRITE + if (get_state()==Tango::OFF || + get_state()==Tango::FAULT || + get_state()==Tango::UNKNOWN || + get_state()==Tango::MOVING || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::HeatsinkTempCoefficient0StateAllowed_WRITE) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::OFF || + real_state==Tango::FAULT || + real_state==Tango::UNKNOWN || + real_state==Tango::MOVING) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::HeatsinkTempCoefficient0StateAllowed_WRITE + return false; + } + return true; + } + else + + // Check access type. + if ( type==Tango::READ_REQ ) + { + // Compare device state with not allowed states for READ + if (get_state()==Tango::UNKNOWN || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::HeatsinkTempCoefficient0StateAllowed_READ) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::UNKNOWN) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::HeatsinkTempCoefficient0StateAllowed_READ + return false; + } + return true; + } + return true; +} + +//-------------------------------------------------------- +/** + * Method : A2720::is_HeatsinkTempCoefficient1_allowed() + * Description : Execution allowed for HeatsinkTempCoefficient1 attribute + */ +//-------------------------------------------------------- +bool A2720::is_HeatsinkTempCoefficient1_allowed(TANGO_UNUSED(Tango::AttReqType type)) +{ + // Check access type. + if ( type!=Tango::READ_REQ ) + { + // Compare device state with not allowed states for WRITE + if (get_state()==Tango::OFF || + get_state()==Tango::FAULT || + get_state()==Tango::UNKNOWN || + get_state()==Tango::MOVING || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::HeatsinkTempCoefficient1StateAllowed_WRITE) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::OFF || + real_state==Tango::FAULT || + real_state==Tango::UNKNOWN || + real_state==Tango::MOVING) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::HeatsinkTempCoefficient1StateAllowed_WRITE + return false; + } + return true; + } + else + + // Check access type. + if ( type==Tango::READ_REQ ) + { + // Compare device state with not allowed states for READ + if (get_state()==Tango::UNKNOWN || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::HeatsinkTempCoefficient1StateAllowed_READ) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::UNKNOWN) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::HeatsinkTempCoefficient1StateAllowed_READ + return false; + } + return true; + } + return true; +} + +//-------------------------------------------------------- +/** + * Method : A2720::is_SerialNumber_allowed() + * Description : Execution allowed for SerialNumber attribute + */ +//-------------------------------------------------------- +bool A2720::is_SerialNumber_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 || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::SerialNumberStateAllowed_READ) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::UNKNOWN) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::SerialNumberStateAllowed_READ + return false; + } + return true; + } + return true; +} + +//-------------------------------------------------------- +/** + * Method : A2720::is_Model_allowed() + * Description : Execution allowed for Model attribute + */ +//-------------------------------------------------------- +bool A2720::is_Model_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 || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::ModelStateAllowed_READ) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::UNKNOWN) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::ModelStateAllowed_READ + return false; + } + return true; + } + return true; +} + +//-------------------------------------------------------- +/** + * Method : A2720::is_CalibrationDate_allowed() + * Description : Execution allowed for CalibrationDate attribute + */ +//-------------------------------------------------------- +bool A2720::is_CalibrationDate_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 || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::CalibrationDateStateAllowed_READ) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::UNKNOWN) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::CalibrationDateStateAllowed_READ + return false; + } + return true; + } + return true; +} + +//-------------------------------------------------------- +/** + * Method : A2720::is_PulseDuration_allowed() + * Description : Execution allowed for PulseDuration attribute + */ +//-------------------------------------------------------- +bool A2720::is_PulseDuration_allowed(TANGO_UNUSED(Tango::AttReqType type)) +{ + // Check access type. + if ( type!=Tango::READ_REQ ) + { + // Compare device state with not allowed states for WRITE + if (get_state()==Tango::OFF || + get_state()==Tango::FAULT || + get_state()==Tango::UNKNOWN || + get_state()==Tango::MOVING || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::PulseDurationStateAllowed_WRITE) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::OFF || + real_state==Tango::FAULT || + real_state==Tango::UNKNOWN || + real_state==Tango::MOVING) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::PulseDurationStateAllowed_WRITE + return false; + } + return true; + } + else + + // Check access type. + if ( type==Tango::READ_REQ ) + { + // Compare device state with not allowed states for READ + if (get_state()==Tango::UNKNOWN || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::PulseDurationStateAllowed_READ) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::UNKNOWN) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::PulseDurationStateAllowed_READ + return false; + } + return true; + } + return true; +} + +//-------------------------------------------------------- +/** + * Method : A2720::is_CurrentCoefficient3_allowed() + * Description : Execution allowed for CurrentCoefficient3 attribute + */ +//-------------------------------------------------------- +bool A2720::is_CurrentCoefficient3_allowed(TANGO_UNUSED(Tango::AttReqType type)) +{ + // Check access type. + if ( type!=Tango::READ_REQ ) + { + // Compare device state with not allowed states for WRITE + if (get_state()==Tango::OFF || + get_state()==Tango::FAULT || + get_state()==Tango::UNKNOWN || + get_state()==Tango::MOVING || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::CurrentCoefficient3StateAllowed_WRITE) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::OFF || + real_state==Tango::FAULT || + real_state==Tango::UNKNOWN || + real_state==Tango::MOVING) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::CurrentCoefficient3StateAllowed_WRITE + return false; + } + return true; + } + else + + // Check access type. + if ( type==Tango::READ_REQ ) + { + // Compare device state with not allowed states for READ + if (get_state()==Tango::UNKNOWN || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::CurrentCoefficient3StateAllowed_READ) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::UNKNOWN) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::CurrentCoefficient3StateAllowed_READ + return false; + } + return true; + } + return true; +} + +//-------------------------------------------------------- +/** + * Method : A2720::is_DCurr_allowed() + * Description : Execution allowed for DCurr attribute + */ +//-------------------------------------------------------- +bool A2720::is_DCurr_allowed(TANGO_UNUSED(Tango::AttReqType type)) +{ + // Check access type. + if ( type!=Tango::READ_REQ ) + { + // Compare device state with not allowed states for WRITE + if (get_state()==Tango::OFF || + get_state()==Tango::FAULT || + get_state()==Tango::UNKNOWN || + get_state()==Tango::MOVING || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::DCurrStateAllowed_WRITE) ENABLED START -----*/ + + /*----- PROTECTED REGION END -----*/ // A2720::DCurrStateAllowed_WRITE + return false; + } + return true; + } + + return true; +} + +//-------------------------------------------------------- +/** + * Method : A2720::is_CurrentCoefficient4_allowed() + * Description : Execution allowed for CurrentCoefficient4 attribute + */ +//-------------------------------------------------------- +bool A2720::is_CurrentCoefficient4_allowed(TANGO_UNUSED(Tango::AttReqType type)) +{ + // Check access type. + if ( type!=Tango::READ_REQ ) + { + // Compare device state with not allowed states for WRITE + if (get_state()==Tango::OFF || + get_state()==Tango::FAULT || + get_state()==Tango::UNKNOWN || + get_state()==Tango::MOVING || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::CurrentCoefficient4StateAllowed_WRITE) ENABLED START -----*/ + + /*----- PROTECTED REGION END -----*/ // A2720::CurrentCoefficient4StateAllowed_WRITE + return false; + } + return true; + } + else + + // Check access type. + if ( type==Tango::READ_REQ ) + { + // Compare device state with not allowed states for READ + if (get_state()==Tango::UNKNOWN || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::CurrentCoefficient4StateAllowed_READ) ENABLED START -----*/ + + /*----- PROTECTED REGION END -----*/ // A2720::CurrentCoefficient4StateAllowed_READ + return false; + } + return true; + } + return true; +} + +//-------------------------------------------------------- +/** + * Method : A2720::is_CurrentCoefficient5_allowed() + * Description : Execution allowed for CurrentCoefficient5 attribute + */ +//-------------------------------------------------------- +bool A2720::is_CurrentCoefficient5_allowed(TANGO_UNUSED(Tango::AttReqType type)) +{ + // Check access type. + if ( type!=Tango::READ_REQ ) + { + // Compare device state with not allowed states for WRITE + if (get_state()==Tango::OFF || + get_state()==Tango::FAULT || + get_state()==Tango::UNKNOWN || + get_state()==Tango::MOVING || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::CurrentCoefficient5StateAllowed_WRITE) ENABLED START -----*/ + + /*----- PROTECTED REGION END -----*/ // A2720::CurrentCoefficient5StateAllowed_WRITE + return false; + } + return true; + } + else + + // Check access type. + if ( type==Tango::READ_REQ ) + { + // Compare device state with not allowed states for READ + if (get_state()==Tango::UNKNOWN || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::CurrentCoefficient5StateAllowed_READ) ENABLED START -----*/ + + /*----- PROTECTED REGION END -----*/ // A2720::CurrentCoefficient5StateAllowed_READ + return false; + } + return true; + } + return true; +} + +//-------------------------------------------------------- +/** + * Method : A2720::is_PsStat_allowed() + * Description : Execution allowed for PsStat attribute + */ +//-------------------------------------------------------- +bool A2720::is_PsStat_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 || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::PsStatStateAllowed_READ) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::UNKNOWN) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::PsStatStateAllowed_READ + return false; + } + return true; + } + return true; +} + + +//================================================= +// Commands Allowed Methods +//================================================= + +//-------------------------------------------------------- +/** + * Method : A2720::is_StartCycling_allowed() + * Description : Execution allowed for StartCycling attribute + */ +//-------------------------------------------------------- +bool A2720::is_StartCycling_allowed(TANGO_UNUSED(const CORBA::Any &any)) +{ + // Compare device state with not allowed states. + if (get_state()==Tango::OFF || + get_state()==Tango::FAULT || + get_state()==Tango::UNKNOWN || + get_state()==Tango::MOVING || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::StartCyclingStateAllowed) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::OFF || + real_state==Tango::FAULT || + real_state==Tango::UNKNOWN || + real_state==Tango::MOVING) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::StartCyclingStateAllowed + return false; + } + return true; +} + +//-------------------------------------------------------- +/** + * Method : A2720::is_Abort_allowed() + * Description : Execution allowed for Abort attribute + */ +//-------------------------------------------------------- +bool A2720::is_Abort_allowed(TANGO_UNUSED(const CORBA::Any &any)) +{ + // Compare device state with not allowed states. + if (get_state()==Tango::ON || + get_state()==Tango::OFF || + get_state()==Tango::FAULT || + get_state()==Tango::UNKNOWN || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::AbortStateAllowed) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::ON || + real_state==Tango::OFF || + real_state==Tango::FAULT || + real_state==Tango::UNKNOWN) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::AbortStateAllowed + return false; + } + return true; +} + +//-------------------------------------------------------- +/** + * Method : A2720::is_On_allowed() + * Description : Execution allowed for On attribute + */ +//-------------------------------------------------------- +bool A2720::is_On_allowed(TANGO_UNUSED(const CORBA::Any &any)) +{ + // Compare device state with not allowed states. + if (get_state()==Tango::FAULT || + get_state()==Tango::UNKNOWN || + get_state()==Tango::MOVING || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::OnStateAllowed) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::FAULT || + real_state==Tango::UNKNOWN || + real_state==Tango::MOVING) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::OnStateAllowed + return false; + } + return true; +} + +//-------------------------------------------------------- +/** + * Method : A2720::is_Off_allowed() + * Description : Execution allowed for Off attribute + */ +//-------------------------------------------------------- +bool A2720::is_Off_allowed(TANGO_UNUSED(const CORBA::Any &any)) +{ + // Compare device state with not allowed states. + if (get_state()==Tango::FAULT || + get_state()==Tango::UNKNOWN || + get_state()==Tango::MOVING || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::OffStateAllowed) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::FAULT || + real_state==Tango::UNKNOWN || + real_state==Tango::MOVING) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::OffStateAllowed + return false; + } + return true; +} + +//-------------------------------------------------------- +/** + * Method : A2720::is_Reset_allowed() + * Description : Execution allowed for Reset attribute + */ +//-------------------------------------------------------- +bool A2720::is_Reset_allowed(TANGO_UNUSED(const CORBA::Any &any)) +{ + // Compare device state with not allowed states. + if (get_state()==Tango::ON || + get_state()==Tango::OFF || + get_state()==Tango::UNKNOWN || + get_state()==Tango::MOVING || + get_state()==Tango::ALARM) + { + /*----- PROTECTED REGION ID(A2720::ResetStateAllowed) ENABLED START -----*/ + if (get_state()==Tango::ALARM) { + if (real_state==Tango::ON || + real_state==Tango::OFF || + real_state==Tango::UNKNOWN || + real_state==Tango::MOVING) + return false; + } + + /*----- PROTECTED REGION END -----*/ // A2720::ResetStateAllowed + return false; + } + return true; +} + + +/*----- PROTECTED REGION ID(A2720::A2720StateAllowed.AdditionalMethods) ENABLED START -----*/ + +// Additional Methods + +/*----- PROTECTED REGION END -----*/ // A2720::A2720StateAllowed.AdditionalMethods + +} // End of namespace diff --git a/src/ClassFactory.cpp b/src/ClassFactory.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c4ce4797b862119c3a5d02d32f71b9e64ac1e2aa --- /dev/null +++ b/src/ClassFactory.cpp @@ -0,0 +1,56 @@ +/*----- PROTECTED REGION ID(A2720::ClassFactory.cpp) ENABLED START -----*/ +static const char *RcsId = "$Id: ClassFactory.cpp,v 1.1.1.2 2016-06-21 08:33:03 alessio Exp $"; +//============================================================================= +// +// file : ClassFactory.cpp +// +// description : C++ source for the class_factory method of the DServer +// device class. This method is responsible for the creation of +// all class singleton for a device server. It is called +// at device server startup. +// +// project : +// +// This file is part of Tango device class. +// +// Tango is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Tango is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Tango. If not, see <http://www.gnu.org/licenses/>. +// +// $Author: alessio $ +// +// $Revision: 1.1.1.2 $ +// $Date: 2016-06-21 08:33:03 $ +// +// $HeadURL: $ +// +//============================================================================= +// This file is generated by POGO +// (Program Obviously used to Generate tango Object) +//============================================================================= + +#include <tango.h> +#include <A2720Class.h> + +// Add class header files if needed + + +/** + * Create A2720 Class singleton and store it in DServer object. + */ + +void Tango::DServer::class_factory() +{ + // Add method class init if needed + add_class(A2720_ns::A2720Class::init("A2720")); +} +/*----- PROTECTED REGION END -----*/ // A2720::ClassFactory.cpp diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..df4b1ebafd6e09bb315c9932cecdbf777b4003e2 --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,87 @@ +/*----- PROTECTED REGION ID(A2720::main.cpp) ENABLED START -----*/ +static const char *RcsId = "$Id: main.cpp,v 1.1.1.2 2016-06-21 08:33:03 alessio Exp $"; +//============================================================================= +// +// file : main.cpp +// +// description : C++ source for the A2720 device server main. +// The main rule is to initialise (and create) the Tango +// system and to create the DServerClass singleton. +// The main should be the same for every Tango device server. +// +// project : +// +// This file is part of Tango device class. +// +// Tango is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Tango is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Tango. If not, see <http://www.gnu.org/licenses/>. +// +// $Author: alessio $ +// +// $Revision: 1.1.1.2 $ +// $Date: 2016-06-21 08:33:03 $ +// +// $HeadURL: $ +// +//============================================================================= +// This file is generated by POGO +// (Program Obviously used to Generate tango Object) +//============================================================================= +#include <tango.h> + +// Check if crash reporting is used. +#if defined(ENABLE_CRASH_REPORT) +# include <crashreporting/crash_report.h> +#else +# define DECLARE_CRASH_HANDLER +# define INSTALL_CRASH_HANDLER +#endif + +DECLARE_CRASH_HANDLER + +int main(int argc,char *argv[]) +{ + INSTALL_CRASH_HANDLER + try + { + // Initialise the device server + //---------------------------------------- + Tango::Util *tg = Tango::Util::init(argc,argv); + + // Create the device server singleton + // which will create everything + //---------------------------------------- + tg->server_init(false); + + // Run the endless loop + //---------------------------------------- + cout << "Ready to accept request" << endl; + tg->server_run(); + } + catch (bad_alloc &) + { + cout << "Can't allocate memory to store device object !!!" << endl; + cout << "Exiting" << endl; + } + catch (CORBA::Exception &e) + { + Tango::Except::print_exception(e); + + cout << "Received a CORBA_Exception" << endl; + cout << "Exiting" << endl; + } + Tango::Util::instance()->server_cleanup(); + return(0); +} + +/*----- PROTECTED REGION END -----*/ // A2720::main.cpp