diff --git a/Noto/Interfaces/NotoMinorServoInterface/ChangeLog b/Noto/Interfaces/NotoMinorServoInterface/ChangeLog deleted file mode 100644 index a6bf091b522213900a055a4eb1a126d8732a01fb..0000000000000000000000000000000000000000 --- a/Noto/Interfaces/NotoMinorServoInterface/ChangeLog +++ /dev/null @@ -1 +0,0 @@ -"@(#) $Id$" diff --git a/Noto/Interfaces/NotoMinorServoInterface/idl/NotoMinorServoBoss.idl b/Noto/Interfaces/NotoMinorServoInterface/idl/NotoMinorServoBoss.idl deleted file mode 100644 index 4344a3805f7bb7186293f9d6f9c3b682f418b11a..0000000000000000000000000000000000000000 --- a/Noto/Interfaces/NotoMinorServoInterface/idl/NotoMinorServoBoss.idl +++ /dev/null @@ -1,44 +0,0 @@ -/* *******************************************************************/ -/* OAC Osservatorio Astronomico di Cagliari */ -/* */ -/* This code is under GNU General Public Licence (GPL). */ -/* */ -/* Who when what */ -/* Carlo Migoni (migoni@oa-cagliari.inaf.it) 10/07/2013 Creation */ -/*********************************************************************/ - -#ifndef _MinorServoBOSS_IDL_ - -#define _MinorServoBOSS_IDL_ - -#include -#include - -#pragma prefix "alma" - -module MinorServo { - - /** - * This component is the supervisor of the Minor Servo subsystem. - * It will be used to control the entire minor servo during an observation. - * @author Carlo Migoni, - * Osservatorio Astronomico di Cagliari, Italia - *
- */ - interface NotoMinorServoBoss: ACS::CharacteristicComponent, Management::CommandInterpreter, Management::Subsystem { - - /** - * This method can be called in order to disable the MinorServo refresh. - * @throw CORBA::SystemException - */ - void msOff(); - - /** - * This method can be called in order to enable the active surface refresh. - * @throw CORBA::SystemException - */ - void msOn(); - }; -}; - -#endif diff --git a/Noto/Interfaces/NotoMinorServoInterface/src/Makefile b/Noto/Interfaces/NotoMinorServoInterface/src/Makefile deleted file mode 100644 index e7b950fbd14cad9d3b25e6ee83c7b8eec6492ccd..0000000000000000000000000000000000000000 --- a/Noto/Interfaces/NotoMinorServoInterface/src/Makefile +++ /dev/null @@ -1,210 +0,0 @@ -#******************************************************************************* -# PPPPPPPP -# -# "@(#) $Id$" -# -# Makefile of ........ -# -# who when what -# -------- -------- ---------------------------------------------- -# andrea 01/12/16 created -# - -#******************************************************************************* -# This Makefile follows VLT Standards (see Makefile(5) for more). -#******************************************************************************* -# REMARKS -# None -#------------------------------------------------------------------------ - -# -# user definable C-compilation flags -#USER_CFLAGS = - -# -# additional include and library search paths -#USER_INC = -#USER_LIB = - -# -# MODULE CODE DESCRIPTION: -# ------------------------ -# As a general rule: public file are "cleaned" and "installed" -# local (_L) are not "installed". - -# -# C programs (public and local) -# ----------------------------- -EXECUTABLES = -EXECUTABLES_L = - -# -# -xxxxx_OBJECTS = -xxxxx_LDFLAGS = -xxxxx_LIBS = - -# -# special compilation flags for single c sources -#yyyyy_CFLAGS = - -# -# Includes (.h) files (public only) -# --------------------------------- -INCLUDES = - -# -# Libraries (public and local) -# ---------------------------- -LIBRARIES = -LIBRARIES_L = - -# -# -lllll_OBJECTS = - -# -# Scripts (public and local) -# ---------------------------- -SCRIPTS = -SCRIPTS_L = - -# -# TCL scripts (public and local) -# ------------------------------ -TCL_SCRIPTS = -TCL_SCRIPTS_L = - -# -# Python stuff (public and local) -# ---------------------------- -PY_SCRIPTS = -PY_SCRIPTS_L = - -PY_MODULES = -PY_MODULES_L = - -PY_PACKAGES = -PY_PACKAGES_L = -pppppp_MODULES = - -# -# -tttttt_OBJECTS = -tttttt_TCLSH = -tttttt_LIBS = - -# -# TCL libraries (public and local) -# ------------------------------ -TCL_LIBRARIES = -TCL_LIBRARIES_L = - -# -# -tttlll_OBJECTS = - -# -# Configuration Database Files -# ---------------------------- -CDB_SCHEMAS = - -# -# IDL Files and flags -# -IDL_FILES = NotoMinorServoBoss -TAO_IDLFLAGS = -USER_IDL = - -NotoMinorServoBossStubs_LIBS = baciStubs ManagmentDefinitionsStubs - -# -# Jarfiles and their directories -# -JARFILES= -jjj_DIRS= -jjj_EXTRAS= -# -# java sources in Jarfile on/off -DEBUG= -# -# ACS XmlIdl generation on/off -# -XML_IDL= -# -# Java Component Helper Classes generation on/off -# -COMPONENT_HELPERS= -# -# Java Entity Classes generation on/off -# -XSDBIND= -# -# Schema Config files for the above -# -XSDBIND_INCLUDE= -# man pages to be done -# -------------------- -MANSECTIONS = -MAN1 = -MAN3 = -MAN5 = -MAN7 = -MAN8 = - -# -# local man pages -# --------------- -MANl = - -# -# ASCII file to be converted into Framemaker-MIF -# -------------------- -ASCII_TO_MIF = - -# -# other files to be installed -#---------------------------- -INSTALL_FILES = - -# -# list of all possible C-sources (used to create automatic dependencies) -# ------------------------------ -CSOURCENAMES = \ - $(foreach exe, $(EXECUTABLES) $(EXECUTABLES_L), $($(exe)_OBJECTS)) \ - $(foreach rtos, $(RTAI_MODULES) , $($(rtos)_OBJECTS)) \ - $(foreach lib, $(LIBRARIES) $(LIBRARIES_L), $($(lib)_OBJECTS)) - -# -#>>>>> END OF standard rules - -# -# INCLUDE STANDARDS -# ----------------- - -MAKEDIRTMP := $(shell searchFile include/acsMakefile) -ifneq ($(MAKEDIRTMP),\#error\#) - MAKEDIR := $(MAKEDIRTMP)/include - include $(MAKEDIR)/acsMakefile -endif - -# -# TARGETS -# ------- -all: do_all - @echo " . . . 'all' done" - -clean : clean_all - @echo " . . . clean done" - -clean_dist : clean_all clean_dist_all - @echo " . . . clean_dist done" - -man : do_man - @echo " . . . man page(s) done" - -install : install_all - @echo " . . . installation done" - - -#___oOo___ diff --git a/Noto/Servers/NotoMinorServo/config/CDB/schemas/NotoMinorServoBoss.xsd b/Noto/Servers/NotoMinorServo/config/CDB/schemas/NotoMinorServoBoss.xsd deleted file mode 100644 index 1cfafb26b07e908b8c759be0f565fffb77fbf775..0000000000000000000000000000000000000000 --- a/Noto/Servers/NotoMinorServo/config/CDB/schemas/NotoMinorServoBoss.xsd +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Noto/Servers/NotoMinorServo/include/Configuration.h b/Noto/Servers/NotoMinorServo/include/Configuration.h deleted file mode 100644 index c6f080305bbfad0cb9c5e5b9d7b836d25953fd5c..0000000000000000000000000000000000000000 --- a/Noto/Servers/NotoMinorServo/include/Configuration.h +++ /dev/null @@ -1,144 +0,0 @@ -#ifndef _CONFIGURATION_H_ -#define _CONFIGURATION_H_ - -/* ************************************************************************************* */ -/* IRA Istituto di Radioastronomia */ -/* $Id: Configuration.h,v 1.2 2011-05-12 14:14:31 a.orlati Exp $ */ -/* */ -/* This code is under GNU General Public Licence (GPL). */ -/* */ -/* Who When What */ -/* Andrea Orlati(aorlati@ira.inaf.it) 02/10/2008 Creation */ - -#include -#include -#include - -using namespace IRA; - -/** - * This class implements the component configurator. The data inside this class are initialized at the startup from the - * configuration database and then are used (read) inside the component. - * @author Andrea Orlati, - * Istituto di Radioastronomia, Italia - *
- */ -class CConfiguration { -public: - /** - * Constructor - */ - CConfiguration(); - - /** - * Destructor - */ - ~CConfiguration(); - /** - * This member function is used to configure component by reading the configuration parameter from the CDB. - * This must be the first call before using any other function of this class. - * @throw CDBAccess - * @throw MemoryAllocation - * @throw IRALibraryResource - * @param Services pointer to the container services object - */ - void init(maci::ContainerServices *Services) throw (ComponentErrors::CDBAccessExImpl,ComponentErrors::MemoryAllocationExImpl,ComponentErrors::IRALibraryResourceExImpl); - - /** - * @return the port number - */ - inline const WORD& getPort() const { return m_wPort; } - - /** - * @return the TCP/IP address of the listening server - */ - inline const IRA::CString getAddress() const {return m_sAddress; } - - /** - * @return the timeout when receiving from the command socket(in microseconds) - */ - inline const DWORD getCommandLineTimeout() const { return m_dwCommandLineTimeout; } - - /** - * @return the timeout in microseconds when trying to reconnect to the backend - */ - inline const DWORD getConnectTimeout() const { return m_dwConnectTimeout; } - - /** - * @return the time in microseconds that is taken between two property refreshes - */ - inline const DWORD getPropertyRefreshTime() const { return m_dwPropertyRefreshTime; } - - /** - * @return the name of the configuration that the backend have to implement - */ - inline const IRA::CString getConfiguration() const { return m_sConfig; } - - /** - * @return the number of microseconds that the log filter will cache a log message - */ - inline DWORD getRepetitionCacheTime() const { return m_dwRepetitionCacheTime; } - - /** - * @return the number of microseconds that the log filter will take as expiration time for a log message - */ - inline DWORD getRepetitionExpireTime() const { return m_dwRepetitionExpireTime; } - - /** - * @return the number of microseconds that the backend will take after a command issue to sent the first data - */ - inline DWORD getDataLatency() const { return m_dwDataLatency; } - - /** - * @return the port number for the data line - */ - inline const WORD& getDataPort() const { return m_wDataPort; } - - /** - * @return the sleep time of the sender thread in microseconds - */ - inline const DWORD& getSenderSleepTime() const { return m_dwSenderSleepTime; } - - /** - * @return the response time of the sender thread in microseconds - */ - inline const DWORD& getSenderResponseTime() const { return m_dwSenderResponseTime; } - - /** - * @return the sleep time of the control thread in microseconds - */ - inline const DWORD& getControlSleepTime() const { return m_dwControlSleepTime; } - - /** - * @return the response time of the control thread in microseconds - */ - inline const DWORD& getControlResponseTime() const { return m_dwControlResponseTime; } - - /** - * @return the time tollerance in microsenconds. - */ - inline const DWORD& getTimeTollerance() const { return m_dwTimeTollerance; } - - -private: - WORD m_wPort; - IRA::CString m_sAddress; - DWORD m_dwCommandLineTimeout; - DWORD m_dwConnectTimeout; - DWORD m_dwPropertyRefreshTime; - IRA::CString m_sConfig; - DWORD m_dwRepetitionCacheTime; - DWORD m_dwRepetitionExpireTime; - WORD m_wDataPort; - IRA::CString m_sDataAddress; - DWORD m_dwDataLatency; - DWORD m_dwSenderSleepTime; - DWORD m_dwSenderResponseTime; - DWORD m_dwTimeTollerance; - DWORD m_dwControlSleepTime; - DWORD m_dwControlResponseTime; - DWORD m_dwBoardsNumber; - DWORD m_dwDataBufferSize; -}; - -#endif /*CONFIGURATION_H_*/ diff --git a/Noto/Servers/NotoMinorServo/include/DevIOEnable.h b/Noto/Servers/NotoMinorServo/include/DevIOEnable.h deleted file mode 100644 index e5ede7234669e25d8b417cc2ad8d0209b93af9ae..0000000000000000000000000000000000000000 --- a/Noto/Servers/NotoMinorServo/include/DevIOEnable.h +++ /dev/null @@ -1,63 +0,0 @@ -#ifndef _NOTOMinorServoBOSSIMPLDEVIOENABLE_H_ -#define _NOTOMinorServoBOSSIMPLDEVIOENABLE_H_ - -/* ************************************************************************************* */ -/* OAC Osservatorio Astronomico di Cagliari */ -/* $Id: DevIOEnable.h,v 1.2 2009-05-25 07:45:32 c.migoni Exp $ */ -/* */ -/* This code is under GNU General Public Licence (GPL). */ -/* */ -/* Who when What */ -/* Carlo Migoni (migoni@ca.astro.it) 16/03/2009 Creation */ - -#include -#include - -using namespace baci; - -/** - * This class is derived from the template DevIO. - * @author Carlo Migoni, - * Osservatorio Astronomico di Cagliari, Italia
- */ -class NotoMinorServoBossImplDevIOEnable: public virtual DevIO -{ -public: - - NotoMinorServoBossImplDevIOEnable(IRA::CSecureArea* core): m_core(core) { - AUTO_TRACE("NotoMinorServoBossImplDevIOEnable::NotoMinorServoBossImplDevIOEnable()"); - } - - ~NotoMinorServoBossImplDevIOEnable() { - AUTO_TRACE("NotoMinorServoBossImplDevIOEnable::~NotoMinorServoBossImplDevIOEnable()"); - } - - bool initializeValue() - { - return false; - } - - Management::TBoolean read(ACS::Time& timestamp) throw (ACSErr::ACSbaseExImpl) - { - bool val; - CSecAreaResourceWrapper resource=m_core->Get(); - AUTO_TRACE("NotoMinorServoBossImplDevIOEnable::read()"); - timestamp=getTimeStamp(); - val=resource->getEnable(); - if (val) { - return Management::MNG_TRUE; - } - else { - return Management::MNG_FALSE; - } - } - - void write(const CORBA::Long& value, ACS::Time& timestamp) throw (ACSErr::ACSbaseExImpl) { - AUTO_TRACE("NotoMinorServoBossImplDevIOEnable::write()"); - } - -private: - IRA::CSecureArea *m_core; -}; - -#endif /*DEVIOENABLE_H_*/ diff --git a/Noto/Servers/NotoMinorServo/include/DevIOStatus.h b/Noto/Servers/NotoMinorServo/include/DevIOStatus.h deleted file mode 100644 index ea33a638eb7fea0c167cb0dc186f68e86b5bb749..0000000000000000000000000000000000000000 --- a/Noto/Servers/NotoMinorServo/include/DevIOStatus.h +++ /dev/null @@ -1,57 +0,0 @@ -#ifndef _NOTOMinorServoBOSSIMPLDEVIOSTATUS_H_ -#define _NOTOMinorServoBOSSIMPLDEVIOSTATUS_H_ - -/* ************************************************************************************* */ -/* OAC Osservatorio Astronomico di Cagliari */ -/* $Id: DevIOStatus.h,v 1.1 2009-05-21 15:33:19 c.migoni Exp $ */ -/* */ -/* This code is under GNU General Public Licence (GPL). */ -/* */ -/* Who When What */ -/* Carlo Migoni (migoni@ca.astro.it) 11/05/2008 Creation */ - -#include -#include - -using namespace baci; - -/** - * This class is derived from the template DevIO. It is used by the status property. - * @author Carlo Migoni, - * Osservatorio Astronomico di Cagliari, Italia
- */ -class NotoMinorServoBossImplDevIOStatus: public virtual DevIO -{ - -public: - - NotoMinorServoBossImplDevIOStatus(IRA::CSecureArea* core): m_core(core) { - AUTO_TRACE("NotoMinorServoBossImplDevIOStatus::NotoMinorServoBossImplDevIOStatus()"); - } - - ~NotoMinorServoBossImplDevIOStatus() { - AUTO_TRACE("NotoMinorServoBossImplDevIOStatus::~NotoMinorServoBossImplDevIOStatus()"); - } - - bool initializeValue(){ - return false; - } - - Management::TSystemStatus read(ACS::Time& timestamp) throw (ACSErr::ACSbaseExImpl) { - CSecAreaResourceWrapper resource=m_core->Get(); - AUTO_TRACE("NotoMinorServoBossImplDevIOStatus::read()"); - timestamp=getTimeStamp(); - return resource->getStatus(); - - } - - void write(const CORBA::Long& value, ACS::Time& timestamp) throw (ACSErr::ACSbaseExImpl) { - AUTO_TRACE("NotoMinorServoBossImplDevIOStatus::write()"); - } - -private: - IRA::CSecureArea *m_core; - -}; - -#endif /*DEVIOSTATUS_H_*/ diff --git a/Noto/Servers/NotoMinorServo/include/DevIOTracking.h b/Noto/Servers/NotoMinorServo/include/DevIOTracking.h deleted file mode 100644 index 45649a75e9dfc88f48dd3926f9b281617f29061d..0000000000000000000000000000000000000000 --- a/Noto/Servers/NotoMinorServo/include/DevIOTracking.h +++ /dev/null @@ -1,63 +0,0 @@ -#ifndef _NOTOMinorServoBOSSIMPLDEVIOTRACKING_H_ -#define _NOTOMinorServoBOSSIMPLDEVIOTRACKING_H_ - -/* ************************************************************************************* */ -/* OAC Osservatorio Astronomico di Cagliari */ -/* $Id: DevIOTracking.h,v 1.2 2009-05-25 07:45:32 c.migoni Exp $ */ -/* */ -/* This code is under GNU General Public Licence (GPL). */ -/* */ -/* Who when What */ -/* Carlo Migoni (migoni@ca.astro.it) 16/03/2009 Creation */ - -#include -#include - -using namespace baci; - -/** - * This class is derived from the template DevIO. - * @author Carlo Migoni, - * Osservatorio Astronomico di Cagliari, Italia
- */ -class NotoMinorServoBossImplDevIOTracking: public virtual DevIO -{ -public: - - NotoMinorServoBossImplDevIOTracking(IRA::CSecureArea* core): m_core(core) { - AUTO_TRACE("NotoMinorServoBossImplDevIOTracking::NotoMinorServoBossImplDevIOTracking()"); - } - - ~NotoMinorServoBossImplDevIOTracking() { - AUTO_TRACE("NotoMinorServoBossImplDevIOTracking::~NotoMinorServoBossImplDevIOTracking()"); - } - - bool initializeValue() - { - return false; - } - - Management::TBoolean read(ACS::Time& timestamp) throw (ACSErr::ACSbaseExImpl) - { - bool val; - CSecAreaResourceWrapper resource=m_core->Get(); - AUTO_TRACE("NotoMinorServoBossImplDevIOTracking::read()"); - timestamp=getTimeStamp(); - val=resource->getTracking(); - if (val) { - return Management::MNG_TRUE; - } - else { - return Management::MNG_FALSE; - } - } - - void write(const CORBA::Long& value, ACS::Time& timestamp) throw (ACSErr::ACSbaseExImpl) { - AUTO_TRACE("NotoMinorServoBossImplDevIOTracking::write()"); - } - -private: - IRA::CSecureArea *m_core; -}; - -#endif /*DEVIOTRACKING_H_*/ diff --git a/Noto/Servers/NotoMinorServo/include/NotoMinorServoBossCore.h b/Noto/Servers/NotoMinorServo/include/NotoMinorServoBossCore.h deleted file mode 100644 index 1144a4dad0b766047373b625daf98bf7cfc17163..0000000000000000000000000000000000000000 --- a/Noto/Servers/NotoMinorServo/include/NotoMinorServoBossCore.h +++ /dev/null @@ -1,332 +0,0 @@ -#ifndef _NOTOMINORSERVOBOSSCORE_H_ -#define _NOTOMINORSERVOBOSSCORE_H_ - -/* ************************************************************************ */ -/* OAC Osservatorio Astronomico di Cagliari */ -/* $Id: NotoMinorServoBossCore.h,v 1.6 2011-03-11 12:30:53 c.migoni Exp $ */ -/* */ -/* This code is under GNU General Public Licence (GPL). */ -/* */ -/* Who when What */ -/* Carlo Migoni (migoni@ca.astro.it) 26/01/2009 Creation */ - -#include -#include -#include -#include -#include -//#include -//#include -#include -#include -//#include -#include -#include -#include -#include -#include -#include -#include "Configuration.h" -#include - -#define POLY_COEFF 5 -#define CIRCLES 17 -#define ACTUATORS 96 -#define firstUSD 1 -#define lastUSD 1116 -#define LOOPTIME 100000 // 0,10 sec -#define USDTABLE "/home/gavino/Nuraghe/ACS/trunk/Noto/Configuration/CDB/alma/AS/tab_convUSD.txt\0" -#define USDTABLECORRECTIONS "/home/gavino/Nuraghe/ACS/trunk/Noto/Configuration/CDB/alma/AS/act_rev02.txt\0" -#define MM2HSTEP 350 //(10500 HSTEP / 30 MM) -#define MM2STEP 1400 //(42000 STEP / 30 MM) -#define WARNINGUSDPERCENT 0.95 -#define ERRORUSDPERCENT 0.90 -#define THRESHOLDPOS 16 // 12 micron in step -#define NPOSITIONS 7 -#define DELTAEL 15.0 - -// mask pattern for status -#define MRUN 0x000080 -#define CAMM 0x000100 -#define ENBL 0x002000 -#define PAUT 0x000800 -#define CAL 0x008000 - -#define SENDBUFFERSIZE 100 -#define RECBUFFERSIZE 512 -#define PROT_TERMINATOR_CH '\n' - -/* -#define _SET_CDB_CORE(PROP,LVAL,ROUTINE) { \ - if (!CIRATools::setDBValue(m_services,#PROP,(const long&) LVAL)) \ - { ASErrors::CDBAccessErrorExImpl exImpl(__FILE__,__LINE__,ROUTINE); \ - exImpl.setFieldName(#PROP); throw exImpl; \ - } \ -} -*/ - -using namespace IRA; -using namespace baci; -using namespace maci; -using namespace ComponentErrors; -using namespace std; - -class NotoMinorServoBossImpl; -class CNotoMinorServoBossWatchingThread; -class CNotoMinorServoBossWorkingThread; - -/** - * This class models the NotoMinorServoBoss datasets and functionalities. - * @author Migoni Carlo - * Osservatorio Astronomico di Cagliari, Italia - *
- */ -class CNotoMinorServoBossCore : public CSocket { - friend class NotoMinorServoBossImpl; - friend class CNotoMinorServoBossWatchingThread; - friend class CNotoMinorServoBossWorkingThread; -public: - enum TLineStatus { - NOTCNTD, /*!< Socket is not connected, no operation available */ - CNTDING, /*!< Connection is in progress, no operation available */ - CNTD /*!< Socket is connected and ready, line is ready */ - }; - - /** - * Constructor. Default Constructor. - * @param service pointer to the continaer services. - * @param me pointer to the component itself - */ - CNotoMinorServoBossCore(ContainerServices *service); - - /** It contains error information */ - CError m_Error; - - /** - * Destructor. - */ - virtual ~CNotoMinorServoBossCore(); - - /** - * This function initializes the boss core, all preliminary operation are performed here. - */ - virtual void initialize(); - - /** - * This function starts the boss core so that it will available to accept operations and requests. - * @throw ComponentErrors::CouldntGetComponentExImpl - * @throw ComponentErrors::CORBAProblemExImpl - */ - virtual void execute(CConfiguration *config) throw (ComponentErrors::CouldntGetComponentExImpl,ComponentErrors::SocketErrorExImpl, - ComponentErrors::ValidationErrorExImpl,ComponentErrors::TimeoutExImpl,ComponentErrors::CDBAccessExImpl); - - /** - * This function performs all the clean up operation required to free al the resources allocated by the class - */ - virtual void cleanUp(); - -/* void reset(int circle, int actuator, int radius) throw (ComponentErrors::UnexpectedExImpl, ComponentErrors::CouldntCallOperationExImpl, ComponentErrors::CORBAProblemExImpl, ComponentErrors::ComponentNotActiveExImpl); - - void calibrate(int circle, int actuator, int radius) throw (ComponentErrors::UnexpectedExImpl, ComponentErrors::CouldntCallOperationExImpl, ComponentErrors::CORBAProblemExImpl); - - void calVer(int circle, int actuator, int radius) throw (ComponentErrors::UnexpectedExImpl, ComponentErrors::CouldntCallOperationExImpl, ComponentErrors::CORBAProblemExImpl); - - void onewayAction(MinorServo::TASOneWayAction onewayAction, int circle, int actuator, int radius, double elevation, double correction, long incr, MinorServo::TASProfile profile) throw (ComponentErrors::UnexpectedExImpl, ComponentErrors::CouldntCallOperationExImpl, ComponentErrors::CORBAProblemExImpl, ComponentErrors::ComponentNotActiveExImpl); -*/ - void workingMinorServo() throw (ComponentErrors::CORBAProblemExImpl, ComponentErrors::ComponentErrorsEx); -/* - void sector1MinorServo() throw (ComponentErrors::CORBAProblemExImpl, ComponentErrors::ComponentErrorsEx); - void sector2MinorServo() throw (ComponentErrors::CORBAProblemExImpl, ComponentErrors::ComponentErrorsEx); - void sector3MinorServo() throw (ComponentErrors::CORBAProblemExImpl, ComponentErrors::ComponentErrorsEx); - void sector4MinorServo() throw (ComponentErrors::CORBAProblemExImpl, ComponentErrors::ComponentErrorsEx); - void sector5MinorServo() throw (ComponentErrors::CORBAProblemExImpl, ComponentErrors::ComponentErrorsEx); - void sector6MinorServo() throw (ComponentErrors::CORBAProblemExImpl, ComponentErrors::ComponentErrorsEx); - void sector7MinorServo() throw (ComponentErrors::CORBAProblemExImpl, ComponentErrors::ComponentErrorsEx); - void sector8MinorServo() throw (ComponentErrors::CORBAProblemExImpl, ComponentErrors::ComponentErrorsEx); -*/ - void watchingMinorServoStatus() throw (ComponentErrors::CORBAProblemExImpl, ComponentErrors::CouldntGetAttributeExImpl, ComponentErrors::ComponentNotActiveExImpl); -/* - void usdStatus4GUIClient(int circle, int actuator, CORBA::Long_out status) throw (ComponentErrors::CORBAProblemExImpl, ComponentErrors::CouldntGetAttributeExImpl, ComponentErrors::ComponentNotActiveExImpl); - - void setActuator(int circle, int actuator, long int& actPos, long int& cmdPos, long int& Fmin, long int& Fmax, long int& acc, long int& delay) throw (ComponentErrors::PropertyErrorExImpl, ComponentErrors::ComponentNotActiveExImpl); - - void recoverUSD(int circle, int actuator) throw (ComponentErrors::CouldntGetComponentExImpl); -*/ - /** - * This function returns the status of the Active Surface subsystem; this indicates if the system is working correctly or there are some - * possible problems or a failure has been encoutered. This flag takes also into consideration the status of the Boss. - */ - inline const Management::TSystemStatus& getStatus() const { return m_status; }; - - /** - * This function returns the enable flags, this flag is true if the boss is enable to send command to the antenna. Viceversa if false the component - * works in a sort of simulation mode. - * @return a boolean value that is true if the antenna is enabled - */ - inline bool getEnable() const { return m_enable; } - -// inline const MinorServo::TASProfile& getProfile() const { return m_profile; }; - - inline bool getTracking() const { return m_tracking; } - - /** - * Sets the AutoUpdate flag to false, i.e. the component will not update automatically the surface. - */ - void disableAutoUpdate(); - - /** - * Sets the AutoUpdate flag to true, i.e. the component will update automatically the surface. - */ - void enableAutoUpdate(); - -// void checkASerrors(char* str, int circle, int actuator, ASErrors::ASErrorsEx Ex); - -// void checkAScompletionerrors (char *str, int circle, int actuator, CompletionImpl comp); - - void msSetup(const char *conf) throw (ComponentErrors::TimeoutExImpl,ComponentErrors::SocketErrorExImpl,ComponentErrors::CDBAccessExImpl); - - void msOn(); - - void msOff() throw (ComponentErrors::ComponentErrorsEx); - - void msPark() throw (ComponentErrors::ComponentErrorsEx); - -// void setProfile (const MinorServo::TASProfile& profile) throw (ComponentErrors::ComponentErrorsExImpl); - -private: - ContainerServices* m_services; - /** Component configuration data */ - CConfiguration *m_configuration; - - /**This flag indicates if the socket has timedout */ - bool m_bTimedout; - bool m_reiniting; - - /** - * List the fields of the backend status - */ - enum TstatusFields { - TIME_SYNC=0, /*!< backend time not sync */ - BUSY=1, /*!< backend is busy(transfer job initiated) and cannot accept other commands */ - SUSPEND=2, /*!< backend data flow is suspended */ - SAMPLING=3, /*!< backend is recording */ - CMDLINERROR=4, /*!< error in the command line */ - DATALINERROR=5 /*!< error in the data line */ - }; - - /** Connection status */ - TLineStatus m_Linestatus; - -// MinorServo::USD_var usd[CIRCLES+1][ACTUATORS+1]; - -// MinorServo::USD_var lanradius[CIRCLES+1][ACTUATORS+1]; - -// MinorServo::lan_var lan[9][13]; - -// IRA::CString lanCobName; - - int usdCounter, usdCounterS1, usdCounterS2, usdCounterS3, usdCounterS4, usdCounterS5, usdCounterS6, usdCounterS7, usdCounterS8; - int lanIndex, circleIndex, usdCircleIndex; - int lanIndexS1, circleIndexS1, usdCircleIndexS1; - int lanIndexS2, circleIndexS2, usdCircleIndexS2; - int lanIndexS3, circleIndexS3, usdCircleIndexS3; - int lanIndexS4, circleIndexS4, usdCircleIndexS4; - int lanIndexS5, circleIndexS5, usdCircleIndexS5; - int lanIndexS6, circleIndexS6, usdCircleIndexS6; - int lanIndexS7, circleIndexS7, usdCircleIndexS7; - int lanIndexS8, circleIndexS8, usdCircleIndexS8; - int actuatorcounter, circlecounter, totacts; - ACS::doubleSeq actuatorsCorrections; - - /** - * This represents the status of the whole Active Surface subsystem, it also includes and sammerizes the status of the boss component - */ - Management::TSystemStatus m_status; - - /** - * if this flag is false the active surface isn't active during - * observations - */ - bool m_enable; - - bool AutoUpdate; - -// void setradius(int radius, int &actuatorsradius, int &jumpradius); - -// void setserial (int circle, int actuator, int &lanIndex, char *serial_usd); - - Antenna::AntennaBoss_var m_antennaBoss; - -// MinorServo::TASProfile m_profile; - - bool m_tracking; - - char *s_usdTable; - - char *s_usdCorrections; - - bool m_sector1, m_sector2, m_sector3, m_sector4, m_sector5, m_sector6, m_sector7, m_sector8; - - bool m_profileSetted; - - bool m_ASup; - - double m_elevation; - - /** - * Check if the connection is still up and ready. If a previuos call timed out it will check the status of the connection. - * Insted if the connection is off it will try a reconnect. In both case the return value is false. - * @return true if the connection is ok - */ - bool checkConnection(); - - /** - * This member function is called to send a command to the backend - * @param Msg ponter to the byte buffer that contains the message - * @param Len length of the buffer - * @return SUCCESS if the buffer was sent correctly, WOULDBLOCK if the send would block, FAIL and the m_Error member is set accordingly. - */ - OperationResult sendBuffer(char *Msg,WORD Len); - - /** - * This member function is called to receive a buffer. if it realizes that the remote side disconnected it sets the member m_Status - * to NOTCNTD. - * @param Msg ponter to the byte buffer that will contain the answer - * @param Len length of the buffer, that means the exact number of bytes that can be read - * @return the number of bytes read, 0 if the connection fell down, FAIL in case of error and the m_Error member is set accordingly, - * WOULDBLOCK if the timeout expires - */ - int receiveBuffer(char *Msg,WORD Len); - - /** - * Sets the antenna status. - * @param sta the new antenna status. - */ - void setStatus(TLineStatus sta); - - /** - * @return the current line status - */ - inline const TLineStatus& getLineStatus() const { return m_Linestatus; } - - /** - * This function will set the status bit corresponding to the given field - */ - inline void setStatusField(TstatusFields field) { /*m_backendStatus |= 1 << field;*/ } - /** - * This function will unset (cleared) the status bit corresponding to the given field - */ - inline void clearStatusField(TstatusFields field) { /*m_backendStatus &= ~(1 << field);*/ } - - void PolyEvaluation (int Axis, float *Coeff, int Dim); - - void setDefaultAxesValues(const IRA::CString & config); - - float scupos[91][5]; - - int m_config; - - int mode; -}; - -#endif /*NOTOMINORSERVOBOSSCORE_H_*/ diff --git a/Noto/Servers/NotoMinorServo/include/NotoMinorServoBossImpl.h b/Noto/Servers/NotoMinorServo/include/NotoMinorServoBossImpl.h deleted file mode 100644 index 63ac89859b6428dfb8ad2b96552840db883cc4d8..0000000000000000000000000000000000000000 --- a/Noto/Servers/NotoMinorServo/include/NotoMinorServoBossImpl.h +++ /dev/null @@ -1,227 +0,0 @@ -#ifndef NotoMINORSERVOBOSSIMPL_H -#define NotoMINORSERVOBOSSIMPL_H - -/* ***************************************************************************/ -/* OAC Osservatorio Astronomico di Cagliari */ -/* $Id: NotoMinorServoBossImpl.h,v 1.4 2016-11-16 12:30:53 c.migoni Exp $ */ -/* */ -/* This code is under GNU General Public Licence (GPL). */ -/* */ -/* Who when What */ -/* Carlo Migoni (migoni@oa-cagliari.inaf.it) 16/11/2016 Creation */ -/* ***************************************************************************/ - -#ifndef __cplusplus -#error This is a C++ include file and cannot be used from plain C -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -//#include -#include -#include "NotoMinorServoBossCore.h" -#include "NotoMinorServoBossWatchingThread.h" -#include "NotoMinorServoBossWorkingThread.h" -#include "Configuration.h" -#include - -#define LOOPSTATUSTIME 10000000 // 1.0 second -#define LOOPWORKINGTIME 100000000 // 1.0 seconds - -#define _SET_CDB(PROP,LVAL,ROUTINE) { \ - maci::ContainerServices* cs=getContainerServices();\ - if (!CIRATools::setDBValue(cs,#PROP,(const long&) LVAL)) \ - { ASErrors::CDBAccessErrorExImpl exImpl(__FILE__,__LINE__,ROUTINE); \ - exImpl.setFieldName(#PROP); throw exImpl; \ - } \ -} - -using namespace baci; -using namespace maci; -//using namespace ASErrors; -using namespace ComponentErrors; - -/** - * This class implements the MinorServo::NotoMinorServoBoss CORBA interface and the ACS Component. - * @author Carlo Migoni - * Osservatorio Astronomico di Cagliari, Italia - *
- */ -class NotoMinorServoBossImpl: public virtual CharacteristicComponentImpl, public virtual POA_MinorServo::NotoMinorServoBoss -{ - public: - - /** - * Constructor. - * @param CompName component's name. This is also the name that will be used to find the configuration data for the component in the Configuration Database. - * @param containerServices pointer to the class that exposes all services offered by container - */ - NotoMinorServoBossImpl(const ACE_CString &CompName, maci::ContainerServices *containerServices); - - /** - * Destructor. - */ - virtual ~NotoMinorServoBossImpl(); - - /** - * Called to give the component time to initialize itself. The component reads in configuration files/parameters, builds up connection. - * Called before execute. It is implemented as a synchronous (blocking) call. - * @throw ACSErr::ACSbaseExImpl - * @arg \c ComponentErrors::MemoryAllocation - */ - virtual void initialize() throw (ACSErr::ACSbaseExImpl); - - /** - * Called after initialize() to tell the component that it has to be ready to accept incoming functional calls any time. - * Must be implemented as a synchronous (blocking) call. In this class the default implementation only logs the COMPSTATE_OPERATIONAL - * @throw ACSErr::ACSbaseExImpl - * @arg \c ComponentErrors::CDBAccess - */ - virtual void execute() throw (ACSErr::ACSbaseExImpl); - - /** - * Called by the container before destroying the server in a normal situation. This function takes charge of releasing all resources. - */ - virtual void cleanUp(); - /** - * Called by the container in case of error or emergency situation. This function tries to free all resources even though there is no - * warranty that the function is completely executed before the component is destroyed. - */ - virtual void aboutToAbort(); - - /** - * Returns a reference to the status property Implementation of IDL interface. - * @return pointer to read-only ROTSystemStatus property status - */ - virtual Management::ROTSystemStatus_ptr status() throw (CORBA::SystemException); - - /** - * Returns a reference to the enable property implementation of IDL interface. - * @return pointer to read-only ROTBoolean property enabled - */ - virtual Management::ROTBoolean_ptr enabled() throw (CORBA::SystemException); - - /** - * Returns a reference to the enable property implementation of IDL interface. - * @return pointer to read-only ROTBoolean property enabled - */ - //virtual MinorServo::ROTASProfile_ptr pprofile() throw (CORBA::SystemException); - - /** - * Returns a reference to the tracking property implementation of IDL interface. - * @return pointer to read-only ROTBoolean property enabled - */ - virtual Management::ROTBoolean_ptr tracking() throw (CORBA::SystemException); - - /** - * This method can be called in order to disable the automatic update of the surface. - * @throw CORBA::SystemException - */ - void msOff() throw (CORBA::SystemException); - - /** - * This method can be called in order to enable the automatic update of the surface. - * @throw CORBA::SystemException - */ - void msOn() throw (CORBA::SystemException); - - /** - * This is the command line interpreter for the sub-system. All the attributes and all the methods exposed by the boss can be - * called. That means a full set of operation for standard observation, but not full control of the system. - * @param the string that contains the command line to be parsed - * @return the string that contains the answer to the command issued by the input parameter. The caller is resposible to - * free the returned string (@sa CORBA::string_free). - * @todo provide e full description of the syntax and protocol (to be decided yet) - */ - virtual CORBA::Boolean command(const char *cmd,CORBA::String_out answer) throw (CORBA::SystemException); - //virtual char * command(const char *cmd) throw (CORBA::SystemException, ManagementErrors::CommandLineErrorEx); - - /** - * This method is used to park (i.e. reference position) the active surface). - * @throw CORBA::SystemExcpetion - * @throw ManagementErrors::ParkingErrorEx - */ - void park() throw (CORBA::SystemException, ManagementErrors::ParkingErrorEx); - - /** - * This method will be used to configure the MinorServoBoss before starting an observation - * @param config mnemonic code of the required configuration - * @throw CORBA::SystemException - * @throw ManagementErrors::ConfigurationErrorEx - */ - void setup(const char *config) throw (CORBA::SystemException, ComponentErrors::ComponentErrorsEx); -/* - void stop ( CORBA::Long circle, CORBA::Long actuator, CORBA::Long radius) throw (CORBA::SystemException, ComponentErrors::ComponentErrorsEx); - - //void setup ( CORBA::Long circle, CORBA::Long actuator, CORBA::Long radius) throw (CORBA::SystemException, ComponentErrors::ComponentErrorsEx); - - void stow ( CORBA::Long circle, CORBA::Long actuator, CORBA::Long radius) throw (CORBA::SystemException, ComponentErrors::ComponentErrorsEx); - - void refPos ( CORBA::Long circle, CORBA::Long actuator, CORBA::Long radius) throw (CORBA::SystemException, ComponentErrors::ComponentErrorsEx); - - void update ( CORBA::Double elevation) throw (CORBA::SystemException, ComponentErrors::ComponentErrorsEx); - - void move ( CORBA::Long circle, CORBA::Long actuator, CORBA::Long radius, CORBA::Long incr) throw (CORBA::SystemException, ComponentErrors::ComponentErrorsEx); - - void correction ( CORBA::Long circle, CORBA::Long actuator, CORBA::Long radius, CORBA::Double correction) throw (CORBA::SystemException, ComponentErrors::ComponentErrorsEx); - - void setProfile ( MinorServo::TASProfile profile) throw (CORBA::SystemException, ComponentErrors::ComponentErrorsEx); - - void usdStatus4GUIClient( CORBA::Long circle, CORBA::Long actuator, CORBA::Long_out status) throw (CORBA::SystemException, ComponentErrors::ComponentErrorsEx); - - void setActuator (CORBA::Long circle, CORBA::Long actuator, CORBA::Long_out actPos, CORBA::Long_out cmdPos, CORBA::Long_out Fmin, CORBA::Long_out Fmax, CORBA::Long_out acc, CORBA::Long_out delay) throw (CORBA::SystemException, ComponentErrors::ComponentErrorsEx); - - void up ( CORBA::Long circle, CORBA::Long actuator, CORBA::Long radius) throw (CORBA::SystemException, ComponentErrors::ComponentErrorsEx); - - void down ( CORBA::Long circle, CORBA::Long actuator, CORBA::Long radius) throw (CORBA::SystemException, ComponentErrors::ComponentErrorsEx); - - void bottom ( CORBA::Long circle, CORBA::Long actuator, CORBA::Long radius) throw (CORBA::SystemException, ComponentErrors::ComponentErrorsEx); - - void top ( CORBA::Long circle, CORBA::Long actuator, CORBA::Long radius) throw (CORBA::SystemException, ComponentErrors::ComponentErrorsEx); - - void reset ( CORBA::Long circle, CORBA::Long actuator, CORBA::Long radius) throw (CORBA::SystemException, ComponentErrors::ComponentErrorsEx); - - void calibrate ( CORBA::Long circle, CORBA::Long actuator, CORBA::Long radius) throw (CORBA::SystemException, ComponentErrors::ComponentErrorsEx); - - void calVer ( CORBA::Long circle, CORBA::Long actuator, CORBA::Long radius) throw (CORBA::SystemException, ComponentErrors::ComponentErrorsEx); - - void recoverUSD( CORBA::Long circle, CORBA::Long actuator) throw (CORBA::SystemException, ComponentErrors::ComponentErrorsEx ); -*/ - private: - /** - * pointer to Container Services - */ - ContainerServices* cs; - CConfiguration m_configuration; - - CNotoMinorServoBossWatchingThread *m_watchingThread; - - CNotoMinorServoBossWorkingThread *m_workingThread; - - SimpleParser::CParser *m_parser; - - SmartPropertyPointer < ROEnumImpl > m_pstatus; - - SmartPropertyPointer< ROEnumImpl > m_penabled; - // SmartPropertyPointer< ROEnumImpl > m_pprofile; - SmartPropertyPointer< ROEnumImpl > m_ptracking; - IRA::CSecureArea *m_core; - - /* * - * Active Surface profile - */ - //MinorServo::TASProfile m_profile; - - CNotoMinorServoBossCore *boss; -}; - -#endif /*NOTOMinorServoBOSSIMPL_H*/ diff --git a/Noto/Servers/NotoMinorServo/include/NotoMinorServoBossWatchingThread.h b/Noto/Servers/NotoMinorServo/include/NotoMinorServoBossWatchingThread.h deleted file mode 100644 index bdc6e4141cd7dcdbd180b09a9bbc6372e656bece..0000000000000000000000000000000000000000 --- a/Noto/Servers/NotoMinorServo/include/NotoMinorServoBossWatchingThread.h +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef _NOTOMINORSERVOBOSSWATCHINGTHREAD_H_ -#define _NOTOMINORSERVOBOSSWATCHINGTHREAD_H_ - -/* ********************************************************************************** */ -/* OAC Osservatorio Astronomico di Cagliari */ -/* $Id: NotoMinorServoBossWatchingThread.h,v 1.1 2009-05-21 15:33:19 c.migoni Exp $ */ -/* */ -/* This code is under GNU General Public Licence (GPL). */ -/* */ -/* Who when What */ -/* Carlo Migoni (migoni@ca.astro.it) 25/02/2009 Creation */ - -#include -#include -#include "NotoMinorServoBossCore.h" - -/** - * This class implements a watching thread. This thread is in charge of checking the status of the active surface -*/ -class CNotoMinorServoBossWatchingThread : public ACS::Thread -{ -public: - /** - * Constructor(). - * @param name thread name - * @param responseTime thread's heartbeat response time in 100ns unit. Default value is 1s. - * @param sleepTime thread's sleep time in 100ns unit. Default value is 100ms. - */ - CNotoMinorServoBossWatchingThread(const ACE_CString& name,IRA::CSecureArea *param, - const ACS::TimeInterval& responseTime=ThreadBase::defaultResponseTime,const ACS::TimeInterval& sleepTime=ThreadBase::defaultSleepTime); - - /** - * Destructor. - */ - ~CNotoMinorServoBossWatchingThread(); - - /** - * This method is executed once when the thread starts. - */ - virtual void onStart(); - - /** - * This method is executed once when the thread stops. - */ - virtual void onStop(); - - /** - * This method overrides the thread implementation class. - * The thread can be exited by calling ACS::ThreadBase::stop or ACS::ThreadBase::exit command. - */ - virtual void runLoop(); - -private: - - IRA::CSecureArea *m_core; -}; - -#endif /*NOTOMinorServoWATCHINGTHREAD_H_*/ diff --git a/Noto/Servers/NotoMinorServo/include/NotoMinorServoBossWorkingThread.h b/Noto/Servers/NotoMinorServo/include/NotoMinorServoBossWorkingThread.h deleted file mode 100644 index ee95597a7fcb0f9ba35276acc23acc64f5ccac45..0000000000000000000000000000000000000000 --- a/Noto/Servers/NotoMinorServo/include/NotoMinorServoBossWorkingThread.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef _NOTOMINORSERVOBOSSWORKINGTHREAD_H_ -#define _NOTOMINORSERVOBOSSWORKINGTHREAD_H_ - -/* ********************************************************************************* */ -/* OAC Osservatorio Astronomico di Cagliari */ -/* $Id: NotoMinorServoBossWorkingThread.h,v 1.1 2010-07-26 12:36:49 c.migoni Exp $ */ -/* */ -/* This code is under GNU General Public Licence (GPL). */ -/* */ -/* Who when What */ -/* Carlo Migoni (migoni@ca.astro.it) 09/07/2010 Creation */ - -#include -#include -#include "NotoMinorServoBossCore.h" -#include - -/** - * This class implements a working thread. This thread is in charge of updating the active surface -*/ -class CNotoMinorServoBossWorkingThread : public ACS::Thread -{ -public: - /** - * Constructor(). - * @param name thread name - * @param responseTime thread's heartbeat response time in 100ns unit. Default value is 1s. - * @param sleepTime thread's sleep time in 100ns unit. Default value is 100ms. - */ - CNotoMinorServoBossWorkingThread(const ACE_CString& name,IRA::CSecureArea *param, - const ACS::TimeInterval& responseTime=ThreadBase::defaultResponseTime,const ACS::TimeInterval& sleepTime=ThreadBase::defaultSleepTime); - - /** - * Destructor. - */ - ~CNotoMinorServoBossWorkingThread(); - - /** - * This method is executed once when the thread starts. - */ - virtual void onStart(); - - /** - * This method is executed once when the thread stops. - */ - virtual void onStop(); - - /** - * This method overrides the thread implementation class. - * The thread can be exited by calling ACS::ThreadBase::stop or ACS::ThreadBase::exit command. - */ - virtual void runLoop(); - -private: - - IRA::CSecureArea *m_core; -}; - -#endif /*_NOTOMinorServoBOSSWORKINGTHREAD_H_*/ diff --git a/Noto/Servers/NotoMinorServo/src/Configuration.cpp b/Noto/Servers/NotoMinorServo/src/Configuration.cpp deleted file mode 100644 index ef2450695e174fce7e532a38d0b1732bd2c0bb9e..0000000000000000000000000000000000000000 --- a/Noto/Servers/NotoMinorServo/src/Configuration.cpp +++ /dev/null @@ -1,60 +0,0 @@ -// $Id: Configuration.cpp,v 1.2 2011-05-12 14:14:31 a.orlati Exp $ - -#include "Configuration.h" - -#define _GET_DWORD_ATTRIBUTE(ATTRIB,DESCR,FIELD) { \ - DWORD tmpw; \ - if (!CIRATools::getDBValue(Services,ATTRIB,tmpw)) { \ - _EXCPT(ComponentErrors::CDBAccessExImpl,dummy,"CConfiguration::Init()"); \ - dummy.setFieldName(ATTRIB); \ - throw dummy; \ - } \ - else { \ - FIELD=tmpw; \ - ACS_DEBUG_PARAM("CConfiguration::Init()",DESCR" %lu",tmpw); \ - } \ -} - -#define _GET_STRING_ATTRIBUTE(ATTRIB,DESCR,FIELD) { \ - CString tmps; \ - if (!CIRATools::getDBValue(Services,ATTRIB,tmps)) { \ - _EXCPT(ComponentErrors::CDBAccessExImpl,dummy,"::CConfiguration::Init()"); \ - dummy.setFieldName(ATTRIB); \ - throw dummy; \ - } \ - else { \ - FIELD=tmps; \ - ACS_DEBUG_PARAM("CConfiguration::Init()",DESCR" %s",(const char*)tmps); \ - } \ -} - -CConfiguration::CConfiguration() -{ -} - -CConfiguration::~CConfiguration() -{ -} - -void CConfiguration::init(maci::ContainerServices *Services) throw (ComponentErrors::CDBAccessExImpl,ComponentErrors::MemoryAllocationExImpl,ComponentErrors::IRALibraryResourceExImpl) -{ - _GET_STRING_ATTRIBUTE("IPAddress","TCP/IP address is: ",m_sAddress); - _GET_DWORD_ATTRIBUTE("Port","Port is: ",m_wPort); - /*_GET_DWORD_ATTRIBUTE("CommandLineTimeout","Time out of the command line is (uSec): ",m_dwCommandLineTimeout); - _GET_DWORD_ATTRIBUTE("ConnectTimeout","Time out of the command line connection is (uSec): ",m_dwConnectTimeout); - _GET_DWORD_ATTRIBUTE("PropertyRefreshTime","The property refresh time is (microseconds): ",m_dwPropertyRefreshTime); - _GET_STRING_ATTRIBUTE("Configuration","Backend configuration is: ",m_sConfig); - _GET_DWORD_ATTRIBUTE("TimeTollerance","The time tollerance is (microseconds): ",m_dwTimeTollerance); - _GET_DWORD_ATTRIBUTE("RepetitionCacheTime","Log repetition filter cache time (uSec)",m_dwRepetitionCacheTime); - _GET_DWORD_ATTRIBUTE("RepetitionExpireTime","Log repetition filter expire time (uSec)",m_dwRepetitionExpireTime); - _GET_DWORD_ATTRIBUTE("DataPort","Port of data line is: ",m_wDataPort); - _GET_STRING_ATTRIBUTE("DataIPAddress","Data line TCP/IP address is: ", m_sDataAddress); - _GET_DWORD_ATTRIBUTE("DataLatency","The latency of the backend data line is (uSec)",m_dwDataLatency); - _GET_DWORD_ATTRIBUTE("SenderSleepTime","The sender thread sleep time is (uSec)",m_dwSenderSleepTime); - _GET_DWORD_ATTRIBUTE("SenderResponseTime","The sender thread response time is (uSec)",m_dwSenderResponseTime); - _GET_DWORD_ATTRIBUTE("ControlSleepTime","The control thread sleep time is (uSec)",m_dwControlSleepTime); - _GET_DWORD_ATTRIBUTE("ControlResponseTime","The control thread response time is (uSec)",m_dwControlResponseTime); - _GET_DWORD_ATTRIBUTE("BoardsNumber","The number of installed boards is ",m_dwBoardsNumber); - _GET_DWORD_ATTRIBUTE("DataBufferSize","Size of data packet is (bytes)",m_dwDataBufferSize);*/ -} - diff --git a/Noto/Servers/NotoMinorServo/src/Makefile b/Noto/Servers/NotoMinorServo/src/Makefile deleted file mode 100644 index 1b37951bbc945eb04dd75f846670e888f6a799ef..0000000000000000000000000000000000000000 --- a/Noto/Servers/NotoMinorServo/src/Makefile +++ /dev/null @@ -1,233 +0,0 @@ -#******************************************************************************* -# PPPPPPPP -# -# "@(#) $Id: Makefile,v 1.3 2010-07-26 12:37:07 c.migoni Exp $" -# -# Makefile of ........ -# -# who when what -# -------- -------- ---------------------------------------------- -# Carlo Migoni 10/05/07 created -# - -#******************************************************************************* -# This Makefile follows VLT Standards (see Makefile(5) for more). -#******************************************************************************* -# REMARKS -# None -#------------------------------------------------------------------------ - -# -# user definable C-compilation flags -#USER_CFLAGS = - -# -# additional include and library search paths -#USER_INC = -I/usr/local/include/gsl -USER_INC = -USER_LIB = -lACE \ - -lTAO \ - -lTAO_DsLogAdmin \ - -lTAO_CosNaming \ - -lTAO_IORTable \ - -lTAO_PortableServer \ - -lTAO_Svc_Utils \ - -lTAO_CosTrading \ - -lTAO_CosNotification \ - -lTAO_DynamicAny \ - -lTAO_IFR_Client \ - -lTAO_CosProperty \ - -lacsutil \ - -lcdb \ - -llogging \ - -lacscomponent \ - -lbaci \ - -lmaci \ - -lmaciClient \ - -lacserr \ - -lm \ - -lloki \ - -lncurses -# -lgsl \ -# -lgslcblas - -# -# MODULE CODE DESCRIPTION: -# ------------------------ -# As a general rule: public file are "cleaned" and "installed" -# local (_L) are not "installed". - -# -# C programs (public and local) -# ----------------------------- -EXECUTABLES = -#EXECUTABLES_L = TestClient - -# -# -#TestClient_OBJECTS = TestClient -#TestClient_LIBS = NotoMinorServoBossImpl IRALibrary lanStubs usdStubs ASErrors ComponentErrors ClientErrors ManagementErrors - -# -# special compilation flags for single c sources -#yyyyy_CFLAGS = - -# -# Includes (.h) files (public only) -# --------------------------------- -INCLUDES = - -# -# Libraries (public and local) -# ---------------------------- -LIBRARIES = NotoMinorServoBossImpl -LIBRARIES_L = -# -# -#NotoMinorServoBossImpl_OBJECTS = NotoMinorServoBossImpl NotoMinorServoBossCore NotoMinorServoBossWatchingThread NotoMinorServoBossWorkingThread NotoMinorServoBossSector1Thread NotoMinorServoBossSector2Thread NotoMinorServoBossSector3Thread NotoMinorServoBossSector4Thread NotoMinorServoBossSector5Thread NotoMinorServoBossSector6Thread NotoMinorServoBossSector7Thread NotoMinorServoBossSector8Thread -#NotoMinorServoBossImpl_LIBS = lanStubs usdStubs MinorServoBossStubs NotoMinorServoBossStubs AntennaDefinitionsStubs ManagmentDefinitionsStubs AntennaBossStubs ComponentErrors ASErrors ManagementErrors AntennaErrors IRALibrary ParserErrors - -NotoMinorServoBossImpl_OBJECTS = NotoMinorServoBossImpl Configuration NotoMinorServoBossCore NotoMinorServoBossWatchingThread NotoMinorServoBossWorkingThread -NotoMinorServoBossImpl_LIBS = NotoMinorServoBossStubs AntennaDefinitionsStubs ManagmentDefinitionsStubs AntennaBossStubs ComponentErrors ManagementErrors AntennaErrors IRALibrary ParserErrors DiscosVersion -# -# Scripts (public and local) -# ---------------------------- -SCRIPTS = -SCRIPTS_L = - -# -# TCL scripts (public and local) -# ------------------------------ -TCL_SCRIPTS = -TCL_SCRIPTS_L = - -# -# Python stuff (public and local) -# ---------------------------- -PY_SCRIPTS = -PY_SCRIPTS_L = - -PY_MODULES = -PY_MODULES_L = - -PY_PACKAGES = -PY_PACKAGES_L = -pppppp_MODULES = - -# -# -tttttt_OBJECTS = -tttttt_TCLSH = -tttttt_LIBS = - -# -# TCL libraries (public and local) -# ------------------------------ -TCL_LIBRARIES = -TCL_LIBRARIES_L = - -# -# -tttlll_OBJECTS = - -# -# Configuration Database Files -# ---------------------------- -CDB_SCHEMAS = NotoMinorServoBoss - -# -# IDL Files and flags -# -IDL_FILES = -IDL_TAO_FLAGS = -USER_IDL = -# -# Jarfiles and their directories -# -JARFILES= -jjj_DIRS= -jjj_EXTRAS= -# -# java sources in Jarfile on/off -DEBUG= -# -# ACS XmlIdl generation on/off -# -XML_IDL= -# -# Java Component Helper Classes generation on/off -# -COMPONENT_HELPERS= -# -# Java Entity Classes generation on/off -# -XSDBIND= -# -# Schema Config files for the above -# -XSDBIND_INCLUDE= -# man pages to be done -# -------------------- -MANSECTIONS = -MAN1 = -MAN3 = -MAN5 = -MAN7 = -MAN8 = - -# -# local man pages -# --------------- -MANl = - -# -# ASCII file to be converted into Framemaker-MIF -# -------------------- -ASCII_TO_MIF = - -# -# other files to be installed -#---------------------------- -INSTALL_FILES = - -# -# list of all possible C-sources (used to create automatic dependencies) -# ------------------------------ -CSOURCENAMES = \ - $(foreach exe, $(EXECUTABLES) $(EXECUTABLES_L), $($(exe)_OBJECTS)) \ - $(foreach rtos, $(RTAI_MODULES) , $($(rtos)_OBJECTS)) \ - $(foreach lib, $(LIBRARIES) $(LIBRARIES_L), $($(lib)_OBJECTS)) - -# -#>>>>> END OF standard rules - -# -# INCLUDE STANDARDS -# ----------------- - -MAKEDIRTMP := $(shell searchFile include/acsMakefile) -ifneq ($(MAKEDIRTMP),\#error\#) - MAKEDIR := $(MAKEDIRTMP)/include - include $(MAKEDIR)/acsMakefile -endif - -# -# TARGETS -# ------- -all: do_all - @echo " . . . 'all' done" - -clean : clean_all - @echo " . . . clean done" - -clean_dist : clean_all clean_dist_all - @echo " . . . clean_dist done" - -man : do_man - @echo " . . . man page(s) done" - -install : install_all - @echo " . . . installation done" - - -#___oOo___ diff --git a/Noto/Servers/NotoMinorServo/src/NotoMinorServoBossCore.cpp b/Noto/Servers/NotoMinorServo/src/NotoMinorServoBossCore.cpp deleted file mode 100644 index 95a81811e85d5f5ac817a9f329ddbc6bb8e36743..0000000000000000000000000000000000000000 --- a/Noto/Servers/NotoMinorServo/src/NotoMinorServoBossCore.cpp +++ /dev/null @@ -1,2159 +0,0 @@ -#include "NotoMinorServoBossCore.h" -#include -#include -#include - -int actuatorsInCircle[] = {0,24,24,48,48,48,48,96,96,96,96,96,96,96,96,96,8,4}; - -CNotoMinorServoBossCore::CNotoMinorServoBossCore(ContainerServices *service) : CSocket(), -m_services(service) -{ -} - -CNotoMinorServoBossCore::~CNotoMinorServoBossCore() -{ -} - -void CNotoMinorServoBossCore::initialize() -{ - ACS_LOG(LM_FULL_INFO,"CNotoMinorServoBossCore::initialize()",(LM_INFO,"CNotoMinorServoBossCore::initialize")); - - m_enable = false; - m_tracking = false; - m_status = Management::MNG_WARNING; -// m_profile = MinorServo::AS_SHAPED_FIXED; - AutoUpdate = false; - actuatorcounter = circlecounter = totacts = 1; - m_sector1 = false; - m_sector2 = false; - m_sector3 = false; - m_sector4 = false; - m_sector5 = false; - m_sector6 = false; - m_sector7 = false; - m_sector8 = false; - m_profileSetted = false; - m_ASup = false; - m_elevation = 0.0; -} - -void CNotoMinorServoBossCore::execute(CConfiguration *config) throw (ComponentErrors::CouldntGetComponentExImpl,ComponentErrors::SocketErrorExImpl, - ComponentErrors::ValidationErrorExImpl,ComponentErrors::TimeoutExImpl,ComponentErrors::CDBAccessExImpl) -{ - AUTO_TRACE("CNotoMinorServoBossCore::execute()"); - m_configuration=config; - // this will create the socket in blocking mode..... - if (Create(m_Error,STREAM)==FAIL) { - _EXCPT_FROM_ERROR(ComponentErrors::IRALibraryResourceExImpl,dummy,m_Error); - dummy.setCode(m_Error.getErrorCode()); - dummy.setDescription((const char*)m_Error.getDescription()); - m_Error.Reset(); - _THROW_EXCPT_FROM_EXCPT(ComponentErrors::SocketErrorExImpl,dummy,"CNotoMinorServoBossCore::execute()"); - } - // the first time, perform a blocking connection.... - if (Connect(m_Error,m_configuration->getAddress(),m_configuration->getPort())==FAIL) { - _EXCPT_FROM_ERROR(ComponentErrors::IRALibraryResourceExImpl,dummy,m_Error); - dummy.setCode(m_Error.getErrorCode()); - dummy.setDescription((const char*)m_Error.getDescription()); - m_Error.Reset(); - _THROW_EXCPT_FROM_EXCPT(ComponentErrors::SocketErrorExImpl,dummy,"CNotoMinorServoBossCore::execute()"); - } - else { - setStatus(CNTD); - } - // set socket send buffer!!!! - int Val=SENDBUFFERSIZE; - if (setSockOption(m_Error,SO_SNDBUF,&Val,sizeof(int))==FAIL) { - _EXCPT_FROM_ERROR(ComponentErrors::IRALibraryResourceExImpl,dummy,m_Error); - dummy.setCode(m_Error.getErrorCode()); - dummy.setDescription((const char*)m_Error.getDescription()); - m_Error.Reset(); - _THROW_EXCPT_FROM_EXCPT(ComponentErrors::SocketErrorExImpl,dummy,"CNotoMinorServoBossCore::execute()"); - } - - m_antennaBoss = Antenna::AntennaBoss::_nil(); - try { - m_antennaBoss = m_services->getComponent("ANTENNA/Boss"); - } - catch (maciErrType::CannotGetComponentExImpl& ex) { - _ADD_BACKTRACE(ComponentErrors::CouldntGetComponentExImpl,Impl,ex,"CNotoMinorServoBossCore::execute()"); - Impl.setComponentName("ANTENNA/Boss"); - m_status=Management::MNG_WARNING; - throw Impl; - } - m_enable = true; - ACS_LOG(LM_FULL_INFO, "CNotoMinorServoBossCore::execute()", (LM_INFO,"CNotoMinorServoBossCore::NotoMinorServoBoss_LOCATED")); -} - -void CNotoMinorServoBossCore::cleanUp() -{ - ACS_LOG(LM_FULL_INFO, "CNotoMinorServoBossCore::cleanUp()", (LM_INFO,"CNotoMinorServoBossCore::cleanUp")); - - try { - m_services->releaseComponent((const char*)m_antennaBoss->name()); - } - catch (maciErrType::CannotReleaseComponentExImpl& ex) { - _ADD_BACKTRACE(ComponentErrors::CouldntReleaseComponentExImpl,Impl,ex,"CNotoMinorServoBossCore::cleanUp()"); - Impl.setComponentName((const char *)m_antennaBoss->name()); - Impl.log(LM_DEBUG); - } - Close (m_Error); -} -/* -void CNotoMinorServoBossCore::reset (int circle, int actuator, int radius) throw (ComponentErrors::UnexpectedExImpl, ComponentErrors::CouldntCallOperationExImpl, ComponentErrors::CORBAProblemExImpl, ComponentErrors::ComponentNotActiveExImpl) -{ - if (circle == 0 && actuator == 0 &&radius == 0) // ALL - { - int i, l; - for (i = 1; i <= CIRCLES; i++) - { - for (l = 1; l <= actuatorsInCircle[i]; l++) - { - if (!CORBA::is_nil(usd[i][l])) - { - try { - usd[i][l]->reset(); - CIRATools::Wait(LOOPTIME); - } - catch (ASErrors::ASErrorsEx& E) { - _ADD_BACKTRACE(ComponentErrors::CouldntCallOperationExImpl,impl,E,"CNotoMinorServoBossCore::reset()"); - impl.setComponentName((const char*)usd[i][l]->name()); - impl.setOperationName("reset()"); - impl.log(); - } - catch(CORBA::SystemException &E) { - _EXCPT(ComponentErrors::CORBAProblemExImpl,impl,"CNotoMinorServoBossCore::reset()"); - impl.setName(E._name()); - impl.setMinor(E.minor()); - impl.log(); - } - catch(...) { - _EXCPT(ComponentErrors::UnexpectedExImpl,impl,"CNotoMinorServoBossCore::reset()"); - impl.log(); - } - } - else { - _EXCPT(ComponentErrors::ComponentNotActiveExImpl,impl,"CNotoMinorServoBossCore::reset()"); - impl.log(); - } - } - } - } - else if (circle != 0 && actuator == 0 && radius == 0) { // CIRCLE - int l; - for (l = 1; l <= actuatorsInCircle[circle]; l++) { - if (!CORBA::is_nil(usd[circle][l])) { - try { - usd[circle][l]->reset(); - CIRATools::Wait(LOOPTIME); - } - catch (ComponentErrors::ComponentErrorsEx& E) { - _ADD_BACKTRACE(ComponentErrors::CouldntCallOperationExImpl,impl,E,"CNotoMinorServoBossCore::reset()"); - impl.setComponentName((const char*)usd[circle][l]->name()); - impl.setOperationName("reset()"); - impl.log(); - } - catch(CORBA::SystemException &E) { - _EXCPT(ComponentErrors::CORBAProblemExImpl,impl,"CNotoMinorServoBossCore::reset()"); - impl.setName(E._name()); - impl.setMinor(E.minor()); - impl.log(); - } - catch(...) { - _EXCPT(ComponentErrors::UnexpectedExImpl,impl,"CNotoMinorServoBossCore::reset()"); - impl.log(); - } - } - else { - _EXCPT(ComponentErrors::ComponentNotActiveExImpl,impl,"CNotoMinorServoBossCore::reset()"); - impl.log(); - } - } - } - else if (circle == 0 && actuator == 0 && radius != 0) { // RADIUS - int actuatorsradius; - int jumpradius; - setradius(radius, actuatorsradius, jumpradius); - int l; - for (l = 1; l <= actuatorsradius; l++) { - if ((radius == 13 || radius == 37 || radius == 61 || radius == 85) && l == 14) - jumpradius++; // 17 circle - if (!CORBA::is_nil(lanradius[l+jumpradius][radius])) { - try { - lanradius[l+jumpradius][radius]->reset(); - CIRATools::Wait(LOOPTIME); - } - catch (ComponentErrors::ComponentErrorsEx& E) { - _ADD_BACKTRACE(ComponentErrors::CouldntCallOperationExImpl,impl,E,"CNotoMinorServoBossCore::reset()"); - impl.setComponentName((const char*)usd[l+jumpradius][radius]->name()); - impl.setOperationName("reset()"); - impl.log(); - } - catch(CORBA::SystemException &E) { - _EXCPT(ComponentErrors::CORBAProblemExImpl,impl,"CNotoMinorServoBossCore::reset()"); - impl.setName(E._name()); - impl.setMinor(E.minor()); - impl.log(); - } - catch(...) { - _EXCPT(ComponentErrors::UnexpectedExImpl,impl,"CNotoMinorServoBossCore::reset()"); - impl.log(); - } - } - else { - _EXCPT(ComponentErrors::ComponentNotActiveExImpl,impl,"CNotoMinorServoBossCore::reset()"); - impl.log(); - } - } - } - else { - if (!CORBA::is_nil(usd[circle][actuator])) { // SINGLE ACTUATOR - try { - usd[circle][actuator]->reset(); - } - catch (ComponentErrors::ComponentErrorsEx& E) { - _ADD_BACKTRACE(ComponentErrors::CouldntCallOperationExImpl,impl,E,"CNotoMinorServoBossCore::reset()"); - impl.setComponentName((const char*)usd[circle][actuator]->name()); - impl.setOperationName("reset()"); - throw impl; - } - catch(CORBA::SystemException &E) { - _EXCPT(ComponentErrors::CORBAProblemExImpl,impl,"CNotoMinorServoBossCore::reset()"); - impl.setName(E._name()); - impl.setMinor(E.minor()); - throw impl; - } - catch(...) { - _THROW_EXCPT(ComponentErrors::UnexpectedExImpl,"CNotoMinorServoBossCore::reset()"); - } - } - else { - _THROW_EXCPT(ComponentErrors::ComponentNotActiveExImpl,"CNotoMinorServoBossCore::reset()"); - } - } -} - - -void CNotoMinorServoBossCore::calibrate (int circle, int actuator, int radius) throw (ComponentErrors::UnexpectedExImpl, ComponentErrors::CouldntCallOperationExImpl, ComponentErrors::CORBAProblemExImpl) -{ - double cammaPos, cammaLen; - bool calibrated; - int i, l; - - if (circle == 0 && actuator == 0 && radius == 0) { // ALL - printf("top.....\n"); - for (i = 1; i <= CIRCLES; i++) { - for (l = 1; l <= actuatorsInCircle[i]; l++) { - if (!CORBA::is_nil(usd[i][l])) { - try { - usd[i][l]->top(); - printf ("actuator n.%d_%d top\n", i, l); - } - catch (ASErrors::ASErrorsEx & Ex) { - checkASerrors ("actuator", i, l, Ex); - } - } - } - } - ACE_OS::sleep (90); - - printf("move to upper mechanical position.....\n"); - for (i = 1; i <= CIRCLES; i++) { - for (l = 1; l <= actuatorsInCircle[i]; l++) { - if (!CORBA::is_nil(usd[i][l])) { - try { - usd[i][l]->move(1400); - printf ("actuator n.%d_%d move\n", i, l); - } - catch (ASErrors::ASErrorsEx & Ex) { - checkASerrors ("actuator", i, l, Ex); - } - } - } - } - ACE_OS::sleep (5); - - printf("calibration.....\n"); - for (i = 1; i <= CIRCLES; i++) { - for (l = 1; l <= actuatorsInCircle[i]; l++) { - if (!CORBA::is_nil(usd[i][l])) { - try { - usd[i][l]->calibrate (); - printf ("actuator n.%d_%d calibrate\n", i, l); - } - catch (ASErrors::ASErrorsEx & Ex) { - checkASerrors ("actuator", i, l, Ex); - } - } - } - } - ACE_OS::sleep (15); - - printf ("calibration verification.....\n"); - for (i = 1; i <= CIRCLES; i++) { - for (l = 1; l <= actuatorsInCircle[i]; l++) { - if (!CORBA::is_nil(usd[i][l])) { - try { - usd[i][l]->calVer (); - printf ("actuator n.%d_%d calVer\n", i, l); - } - catch (ASErrors::ASErrorsEx & Ex) { - checkASerrors ("actuator", i, l, Ex); - } - } - } - } - ACE_OS::sleep (150); - - printf ("write calibration results.....\n"); - for (i = 1; i <= CIRCLES; i++) { - for (l = 1; l <= actuatorsInCircle[i]; l++) { - if (!CORBA::is_nil(usd[i][l])) { - try { - CIRATools::Wait(LOOPTIME); - usd[i][l]->writeCalibration(cammaLen,cammaPos,calibrated); - printf ("actuator %02d_%02d %04.1f %05.1f %d\n", i, l, cammaLen, cammaPos, calibrated); - } - catch (ASErrors::ASErrorsEx & Ex) { - checkASerrors ("actuator", i, l, Ex); - } - } - } - } - ACE_OS::sleep (1); - } - else if (circle != 0 && actuator == 0 && radius == 0) { // CIRCLE - printf("top.....\n"); - for (l = 1; l <= actuatorsInCircle[circle]; l++) { - if (!CORBA::is_nil(usd[circle][l])) { - try { - usd[circle][l]->top(); - printf ("actuator n.%d_%d top\n", circle, l); - } - catch (ASErrors::ASErrorsEx & Ex) { - checkASerrors ("actuator", circle, l, Ex); - } - } - } - ACE_OS::sleep (90); - - printf("move to upper mechanical position.....\n"); - for (l = 1; l <= actuatorsInCircle[circle]; l++) { - if (!CORBA::is_nil(usd[circle][l])) { - try { - usd[circle][l]->move(1400); - printf ("actuator n.%d_%d move\n", circle, l); - } - catch (ASErrors::ASErrorsEx & Ex) { - checkASerrors ("actuator", circle, l, Ex); - } - } - } - ACE_OS::sleep (5); - - printf("calibration.....\n"); - for (l = 1; l <= actuatorsInCircle[circle]; l++) { - if (!CORBA::is_nil(usd[circle][l])) { - try { - usd[circle][l]->calibrate (); - printf ("actuator n.%d_%d calibrate\n", circle, l); - } - catch (ASErrors::ASErrorsEx & Ex) { - checkASerrors ("actuator", circle, l, Ex); - } - } - } - ACE_OS::sleep (15); - - printf ("calibration verification.....\n"); - for (l = 1; l <= actuatorsInCircle[circle]; l++) { - if (!CORBA::is_nil(usd[circle][l])) { - try { - usd[circle][l]->calVer (); - printf ("actuator n.%d_%d calVer\n", circle, l); - } - catch (ASErrors::ASErrorsEx & Ex) { - checkASerrors ("actuator", circle, l, Ex); - } - } - } - ACE_OS::sleep (150); - - printf ("write calibration results.....\n"); - for (l = 1; l <= actuatorsInCircle[circle]; l++) { - if (!CORBA::is_nil(usd[circle][l])) { - try { - CIRATools::Wait(LOOPTIME); - usd[circle][l]->writeCalibration(cammaLen,cammaPos,calibrated); - printf ("actuator %02d_%02d %04.1f %05.1f %d\n", circle, l, cammaLen, cammaPos, calibrated); - } - catch (ASErrors::ASErrorsEx & Ex) { - checkASerrors ("actuator", circle, l, Ex); - } - } - } - ACE_OS::sleep (1); - } - else if (circle == 0 && actuator == 0 && radius != 0) { // RADIUS - int actuatorsradius; - int jumpradius; - setradius(radius, actuatorsradius, jumpradius); - int l; - - printf("top.....\n"); - for (l = 1; l <= actuatorsradius; l++) { - if ((radius == 13 || radius == 37 || radius == 61 || radius == 85) && l == 14) - jumpradius++; // 17 circle - if (!CORBA::is_nil(lanradius[l+jumpradius][radius])) { - try { - lanradius[l+jumpradius][radius]->top(); - printf ("actuator n.%d_%d top\n", l+jumpradius, radius); - } - catch (ASErrors::ASErrorsEx &Ex) { - checkASerrors("actuator", l+jumpradius, radius, Ex); - } - } - } - ACE_OS::sleep (90); - - printf("move to upper mechanical position.....\n"); - for (l = 1; l <= actuatorsradius; l++) { - if ((radius == 13 || radius == 37 || radius == 61 || radius == 85) && l == 14) - jumpradius++; // 17 circle - if (!CORBA::is_nil(lanradius[l+jumpradius][radius])) { - try { - lanradius[l+jumpradius][radius]->move(1400); - printf ("actuator n.%d_%d move\n", l+jumpradius, radius); - } - catch (ASErrors::ASErrorsEx &Ex) { - checkASerrors("actuator", l+jumpradius, radius, Ex); - } - } - } - ACE_OS::sleep (5); - - printf("calibration.....\n"); - for (l = 1; l <= actuatorsradius; l++) { - if ((radius == 13 || radius == 37 || radius == 61 || radius == 85) && l == 14) - jumpradius++; // 17 circle - if (!CORBA::is_nil(lanradius[l+jumpradius][radius])) { - try { - lanradius[l+jumpradius][radius]->calibrate(); - printf ("actuator n.%d_%d calibrate\n", l+jumpradius, radius); - } - catch (ASErrors::ASErrorsEx &Ex) { - checkASerrors("actuator", l+jumpradius, radius, Ex); - } - } - } - ACE_OS::sleep (15); - - printf ("calibration verification.....\n"); - for (l = 1; l <= actuatorsradius; l++) { - if ((radius == 13 || radius == 37 || radius == 61 || radius == 85) && l == 14) - jumpradius++; // 17 circle - if (!CORBA::is_nil(lanradius[l+jumpradius][radius])) { - try { - lanradius[l+jumpradius][radius]->calVer(); - printf ("actuator n.%d_%d calVer\n", l+jumpradius, radius); - } - catch (ASErrors::ASErrorsEx &Ex) { - checkASerrors("actuator", l+jumpradius, radius, Ex); - } - } - } - ACE_OS::sleep (150); - - printf ("write calibration results.....\n"); - for (l = 1; l <= actuatorsradius; l++) { - if ((radius == 13 || radius == 37 || radius == 61 || radius == 85) && l == 14) - jumpradius++; // 17 circle - if (!CORBA::is_nil(lanradius[l+jumpradius][radius])) { - try { - CIRATools::Wait(LOOPTIME); - lanradius[l+jumpradius][radius]->writeCalibration(cammaLen,cammaPos,calibrated); - printf ("actuator %02d_%02d %04.1f %05.1f %d\n", l+jumpradius, radius, cammaLen, cammaPos, calibrated); - } - catch (ASErrors::ASErrorsEx &Ex) { - checkASerrors("actuator", l+jumpradius, radius, Ex); - } - } - } - ACE_OS::sleep (1); - } - else { - if (!CORBA::is_nil(usd[circle][actuator])) { // SINGLE ACTUATOR - printf("top.....\n"); - try { - usd[circle][actuator]->top(); - printf ("actuator n.%d_%d top\n", circle, actuator); - } - catch (ASErrors::ASErrorsEx &Ex) { - checkASerrors("actuator", circle, actuator, Ex); - } - ACE_OS::sleep (90); - printf("move to upper mechanical position.....\n"); - try { - usd[circle][actuator]->move(1400); - printf ("actuator n.%d_%d move\n", circle, actuator); - } - catch (ASErrors::ASErrorsEx &Ex) { - checkASerrors("actuator", circle, actuator, Ex); - } - ACE_OS::sleep (5); - printf("calibration.....\n"); - try { - usd[circle][actuator]->calibrate(); - printf ("actuator n.%d_%d calibrate\n", circle, actuator); - } - catch (ASErrors::ASErrorsEx &Ex) { - checkASerrors("actuator", circle, actuator, Ex); - } - ACE_OS::sleep (15); - printf ("calibration verification.....\n"); - try { - usd[circle][actuator]->calVer(); - printf ("actuator n.%d_%d calVer\n", circle, actuator); - } - catch (ASErrors::ASErrorsEx &Ex) { - checkASerrors("actuator", circle, actuator, Ex); - } - ACE_OS::sleep (150); - printf ("write calibration results.....\n"); - try { - usd[circle][actuator]->writeCalibration(cammaLen,cammaPos,calibrated); - printf ("actuator %02d_%02d %04.1f %05.1f %d\n", circle, actuator, cammaLen, cammaPos, calibrated); - } - catch (ASErrors::ASErrorsEx &Ex) { - checkASerrors("actuator", circle, actuator, Ex); - } - ACE_OS::sleep (1); - } - } -} - -void CNotoMinorServoBossCore::calVer (int circle, int actuator, int radius) throw (ComponentErrors::UnexpectedExImpl, ComponentErrors::CouldntCallOperationExImpl, ComponentErrors::CORBAProblemExImpl) -{ - - if (circle == 0 && actuator == 0 && radius == 0) { // ALL - int i, l; - for (i = 1; i <= CIRCLES; i++) - { - for (l = 1; l <= actuatorsInCircle[i]; l++) - { - if (usdinitialized[i][l] == 0) { - try { - printf("actuator n.%d_%d verification of calibration\n", i, l); - CompletionImpl comp = usd[i][l]->calVer(); - if (comp.isErrorFree() == false) - checkAScompletionerrors("usd", i, l, comp); - } - catch (ASErrors::ASErrorsEx &Ex) { - checkASerrors("actuator", i, l, Ex); - } - } - else - printf ("actuator n.%d_%d not initialized!\n", i, l); - } - } - } - else if (circle != 0 && actuator == 0 && radius == 0) { // CIRCLE - int l; - for (l = 1; l <= actuatorsInCircle[circle]; l++) - { - if (usdinitialized[circle][l] == 0) { - try { - printf("actuator n.%d_%d verification of calibration\n", circle, l); - CompletionImpl comp = usd[circle][l]->calVer(); - if (comp.isErrorFree() == false) - checkAScompletionerrors("usd", circle, l, comp); - } - catch (ASErrors::ASErrorsEx &Ex) { - checkASerrors("actuator", circle, l, Ex); - } - } - else - printf ("actuator n.%d_%d not initialized!\n", circle, l); - } - } - else if (circle == 0 && actuator == 0 && radius != 0) { // RADIUS - int actuatorsradius; - int jumpradius; - setradius(radius, actuatorsradius, jumpradius); - int l; - for (l = 1; l <= actuatorsradius; l++) { - if ((radius == 13 || radius == 37 || radius == 61 || radius == 85) && l == 14) - jumpradius++; // 17 circle - if (lanradiusinitialized[l+jumpradius][radius] == 0) { - try { - printf("actuator n.%d_%d verification of calibration\n", l+jumpradius, radius); - CompletionImpl comp = lanradius[l+jumpradius][radius]->calVer(); - if (comp.isErrorFree() == false) - checkAScompletionerrors("lanradius", l+jumpradius, radius, comp); - } - catch (ASErrors::ASErrorsEx &Ex) { - checkASerrors("actuator", l+jumpradius, radius, Ex); - } - } - else - printf ("actuator n.%d_%d not initialized!\n", l+jumpradius, radius); - } - } - else { - if (!CORBA::is_nil(usd[circle][actuator])) { // SINGLE ACTUATOR - try { - printf("actuator n.%d_%d verification of calibration\n", circle, actuator); - CompletionImpl comp = usd[circle][actuator]->calVer(); - if (comp.isErrorFree() == false) - checkAScompletionerrors("usd", circle, actuator, comp); - else - printf("usd %d %d calibration verification OK\n", circle, actuator); - } - catch (ASErrors::ASErrorsEx &Ex) { - checkASerrors("actuator", circle, actuator, Ex); - } - } - else - printf ("actuator n.%d_%d not initialized!\n", circle, actuator); - } -} - -void CNotoMinorServoBossCore::onewayAction(MinorServo::TASOneWayAction onewayAction, int circle, int actuator, int radius, double elevation, double correction, long incr, MinorServo::TASProfile profile) throw (ComponentErrors::UnexpectedExImpl, ComponentErrors::CouldntCallOperationExImpl, ComponentErrors::CORBAProblemExImpl, ComponentErrors::ComponentNotActiveExImpl) -{ - if (circle == 0 && actuator == 0 &&radius == 0) // ALL - { - int i, l; - int counter = 0; - ACSErr::Completion_var completion; - ACS::ROlong_var actPos_var; - ACS::RWlong_var cmdPos_var; - time_t start; - time_t stop; - - time(&start); - for (i = 1; i <= CIRCLES; i++) - { - for (l = 1; l <= actuatorsInCircle[i]; l++) - { - if (!CORBA::is_nil(usd[i][l])) - { - try { - switch (onewayAction) { - case MinorServo::AS_STOP: - usd[i][l]->stop(); - break; - case MinorServo::AS_SETUP: - usd[i][l]->setup(); - break; - case MinorServo::AS_STOW: - usd[i][l]->stow(); - break; - case MinorServo::AS_REFPOS: - usd[i][l]->refPos(); - break; - case MinorServo::AS_UP: - usd[i][l]->up(); - break; - case MinorServo::AS_DOWN: - usd[i][l]->down(); - break; - case MinorServo::AS_BOTTOM: - usd[i][l]->bottom(); - break; - case MinorServo::AS_TOP: - usd[i][l]->top(); - break; - case MinorServo::AS_UPDATE: - usd[i][l]->update(elevation); - break; - case MinorServo::AS_CORRECTION: - usd[i][l]->correction(correction*MM2STEP); - break; - case MinorServo::AS_MOVE: - usd[i][l]->move(incr*MM2STEP); - break; - case MinorServo::AS_PROFILE: - usd[i][l]->setProfile(profile); - break; - } - //CIRATools::Wait(500); - } - catch (ASErrors::ASErrorsEx& E) { - _ADD_BACKTRACE(ComponentErrors::CouldntCallOperationExImpl,impl,E,"CNotoMinorServoBossCore::onewayAction()"); - impl.setComponentName((const char*)usd[i][l]->name()); - impl.setOperationName("onewayAction()"); - impl.log(); - } - catch(CORBA::SystemException &E) { - _EXCPT(ComponentErrors::CORBAProblemExImpl,impl,"CNotoMinorServoBossCore::onewayAction()"); - impl.setName(E._name()); - impl.setMinor(E.minor()); - impl.log(); - } - catch(...) { - _EXCPT(ComponentErrors::UnexpectedExImpl,impl,"CNotoMinorServoBossCore::onewayAction()"); - impl.log(); - } - } - else { - _EXCPT(ComponentErrors::ComponentNotActiveExImpl,impl,"CNotoMinorServoBossCore::onewayAction()"); - impl.log(); - } - counter++; - if (counter == 1116) - counter = 0; - } - } - time(&stop); - printf("execution time = %f\n", difftime(stop,start)); - } - else if (circle != 0 && actuator == 0 && radius == 0) { // CIRCLE - printf ("onewayaction CIRCLE\n"); - int l; - for (l = 1; l <= actuatorsInCircle[circle]; l++) { - if (!CORBA::is_nil(usd[circle][l])) { - try { - switch (onewayAction) { - case MinorServo::AS_STOP: - usd[circle][l]->stop(); - break; - case MinorServo::AS_SETUP: - usd[circle][l]->setup(); - break; - case MinorServo::AS_STOW: - usd[circle][l]->stow(); - break; - case MinorServo::AS_REFPOS: - usd[circle][l]->refPos(); - break; - case MinorServo::AS_UP: - usd[circle][l]->up(); - break; - case MinorServo::AS_DOWN: - usd[circle][l]->down(); - break; - case MinorServo::AS_BOTTOM: - usd[circle][l]->bottom(); - break; - case MinorServo::AS_TOP: - usd[circle][l]->top(); - break; - case MinorServo::AS_UPDATE: - break; - case MinorServo::AS_CORRECTION: - usd[circle][l]->correction(correction*MM2STEP); - break; - case MinorServo::AS_MOVE: - usd[circle][l]->move(incr*MM2STEP); - break; - case MinorServo::AS_PROFILE: - break; - } - //CIRATools::Wait(LOOPTIME); - } - catch (ComponentErrors::ComponentErrorsEx& E) { - _ADD_BACKTRACE(ComponentErrors::CouldntCallOperationExImpl,impl,E,"CNotoMinorServoBossCore::oneWayAction()"); - impl.setComponentName((const char*)usd[circle][l]->name()); - impl.setOperationName("oneWayAction()"); - impl.log(); - } - catch(CORBA::SystemException &E) { - _EXCPT(ComponentErrors::CORBAProblemExImpl,impl,"CNotoMinorServoBossCore::oneWayAction()"); - impl.setName(E._name()); - impl.setMinor(E.minor()); - impl.log(); - } - catch(...) { - _EXCPT(ComponentErrors::UnexpectedExImpl,impl,"CNotoMinorServoBossCore::oneWayAction()"); - impl.log(); - } - } - else { - _EXCPT(ComponentErrors::ComponentNotActiveExImpl,impl,"CNotoMinorServoBossCore::oneWayAction()"); - impl.log(); - } - } - } - else if (circle == 0 && actuator == 0 && radius != 0) { // RADIUS - printf ("onewayaction RADIUS\n"); - int actuatorsradius; - int jumpradius; - setradius(radius, actuatorsradius, jumpradius); - int l; - for (l = 1; l <= actuatorsradius; l++) { - if ((radius == 13 || radius == 37 || radius == 61 || radius == 85) && l == 14) - jumpradius++; // 17 circle - if (!CORBA::is_nil(lanradius[l+jumpradius][radius])) { - try { - switch (onewayAction) { - case MinorServo::AS_STOP: - lanradius[l+jumpradius][radius]->stop(); - break; - case MinorServo::AS_SETUP: - lanradius[l+jumpradius][radius]->setup(); - break; - case MinorServo::AS_STOW: - lanradius[l+jumpradius][radius]->stow(); - break; - case MinorServo::AS_REFPOS: - lanradius[l+jumpradius][radius]->refPos(); - break; - case MinorServo::AS_UP: - lanradius[l+jumpradius][radius]->up(); - break; - case MinorServo::AS_DOWN: - lanradius[l+jumpradius][radius]->down(); - break; - case MinorServo::AS_BOTTOM: - lanradius[l+jumpradius][radius]->bottom(); - break; - case MinorServo::AS_TOP: - lanradius[l+jumpradius][radius]->top(); - break; - case MinorServo::AS_UPDATE: - break; - case MinorServo::AS_CORRECTION: - lanradius[l+jumpradius][radius]->correction(correction*MM2STEP); - break; - case MinorServo::AS_MOVE: - lanradius[l+jumpradius][radius]->move(incr*MM2STEP); - break; - case MinorServo::AS_PROFILE: - break; - } - //CIRATools::Wait(LOOPTIME); - } - catch (ComponentErrors::ComponentErrorsEx& E) { - _ADD_BACKTRACE(ComponentErrors::CouldntCallOperationExImpl,impl,E,"CNotoMinorServoBossCore::oneWayAction()"); - impl.setComponentName((const char*)lanradius[l+jumpradius][radius]->name()); - impl.setOperationName("oneWayAction()"); - impl.log(); - } - catch(CORBA::SystemException &E) { - _EXCPT(ComponentErrors::CORBAProblemExImpl,impl,"CNotoMinorServoBossCore::oneWayAction()"); - impl.setName(E._name()); - impl.setMinor(E.minor()); - impl.log(); - } - catch(...) { - _EXCPT(ComponentErrors::UnexpectedExImpl,impl,"CNotoMinorServoBossCore::oneWayAction()"); - impl.log(); - } - } - else { - _EXCPT(ComponentErrors::ComponentNotActiveExImpl,impl,"CNotoMinorServoBossCore::oneWayAction()"); - impl.log(); - } - } - } - else { - printf ("onewayaction SINGLE\n"); - if (!CORBA::is_nil(usd[circle][actuator])) { // SINGLE ACTUATOR - try { - switch (onewayAction) { - case MinorServo::AS_STOP: - usd[circle][actuator]->stop(); - break; - case MinorServo::AS_SETUP: - usd[circle][actuator]->setup(); - break; - case MinorServo::AS_STOW: - usd[circle][actuator]->stow(); - break; - case MinorServo::AS_REFPOS: - usd[circle][actuator]->refPos(); - break; - case MinorServo::AS_UP: - usd[circle][actuator]->up(); - break; - case MinorServo::AS_DOWN: - usd[circle][actuator]->down(); - break; - case MinorServo::AS_BOTTOM: - usd[circle][actuator]->bottom(); - break; - case MinorServo::AS_TOP: - usd[circle][actuator]->top(); - break; - case MinorServo::AS_UPDATE: - break; - case MinorServo::AS_CORRECTION: - usd[circle][actuator]->correction(correction*MM2STEP); - break; - case MinorServo::AS_MOVE: - usd[circle][actuator]->move(incr*MM2STEP); - break; - case MinorServo::AS_PROFILE: - break; - } - } - catch (ComponentErrors::ComponentErrorsEx& E) { - _ADD_BACKTRACE(ComponentErrors::CouldntCallOperationExImpl,impl,E,"CNotoMinorServoBossCore::oneWayAction()"); - impl.setComponentName((const char*)usd[circle][actuator]->name()); - impl.setOperationName("oneWayAction()"); - throw impl; - } - catch(CORBA::SystemException &E) { - _EXCPT(ComponentErrors::CORBAProblemExImpl,impl,"CNotoMinorServoBossCore::oneWayAction()"); - impl.setName(E._name()); - impl.setMinor(E.minor()); - throw impl; - } - catch(...) { - _THROW_EXCPT(ComponentErrors::UnexpectedExImpl,"CNotoMinorServoBossCore::oneWayAction()"); - } - } - else { - _THROW_EXCPT(ComponentErrors::ComponentNotActiveExImpl,"CNotoMinorServoBossCore::oneWayAction()"); - } - } -} -*/ - -void CNotoMinorServoBossCore::watchingMinorServoStatus() throw (ComponentErrors::CORBAProblemExImpl, ComponentErrors::CouldntGetAttributeExImpl, ComponentErrors::ComponentNotActiveExImpl) -{ -/* ACS::ROpattern_var status_var; - ACSErr::Completion_var completion; - - int i = circlecounter; - int l = actuatorcounter; - int totalactuators = totacts; - - if (totalactuators >= 1 && totalactuators <= 24) // 1 circle - i= 1; - if (totalactuators >= 25 && totalactuators <= 48) // 2 circle - i= 2; - if (totalactuators >= 49 && totalactuators <= 96) // 3 circle - i= 3; - if (totalactuators >= 97 && totalactuators <= 144) // 4 circle - i= 4; - if (totalactuators >= 145 && totalactuators <= 192) // 5 circle - i= 5; - if (totalactuators >= 193 && totalactuators <= 240) // 6 circle - i= 6; - if (totalactuators >= 241 && totalactuators <= 336) // 7 circle - i= 7; - if (totalactuators >= 337 && totalactuators <= 432) // 8 circle - i= 8; - if (totalactuators >= 433 && totalactuators <= 528) // 9 circle - i= 9; - if (totalactuators >= 529 && totalactuators <= 624) // 10 circle - i= 10; - if (totalactuators >= 625 && totalactuators <= 720) // 11 circle - i= 11; - if (totalactuators >= 721 && totalactuators <= 816) // 12 circle - i= 12; - if (totalactuators >= 817 && totalactuators <= 912) // 13 circle - i= 13; - if (totalactuators >= 913 && totalactuators <= 1008) // 14 circle - i= 14; - if (totalactuators >= 1009 && totalactuators <= 1104) // 15 circle - i= 15; - if (totalactuators >= 1105 && totalactuators <= 1112) // 16 circle - i= 16; - if (totalactuators >= 1113 && totalactuators <= 1116) // 17 circle - i= 17; - if (totalactuators == 1 || totalactuators == 25 || totalactuators == 49 || - totalactuators == 97 || totalactuators == 145 || totalactuators == 193 || - totalactuators == 241 || totalactuators == 337 || totalactuators == 433 || - totalactuators == 529 || totalactuators == 625 || totalactuators == 721 || - totalactuators == 817 || totalactuators == 913 || totalactuators == 1009 || - totalactuators == 1105 || totalactuators == 1113 || totalactuators == 1117) - l = 1; - - bool propertyEx = false; - bool notActivEx = false; - bool corbaEx = false; - - if (!CORBA::is_nil(usd[i][l])) { - try { - status_var = usd[i][l]->status (); - } - catch (CORBA::SystemException& ex) { - corbaEx = true; - usdCounter--; - if (usdCounter < (int)lastUSD*WARNINGUSDPERCENT) - m_status=Management::MNG_WARNING; - if (usdCounter < (int)lastUSD*ERRORUSDPERCENT) - m_status=Management::MNG_FAILURE; - } - } - else - notActivEx = true; - - //printf("component %d_%d: ",i,l); - - totalactuators++; - l++; - if (totalactuators == 1117) { - i = l = totalactuators = 1; - } - circlecounter = i; - actuatorcounter = l; - totacts = totalactuators; - - if (corbaEx == true) { - //printf("corba error\n"); - _THROW_EXCPT(ComponentErrors::CORBAProblemExImpl,"CNotoMinorServoBossCore::watchingMinorServoStatus()"); - } - if (propertyEx == true) { - //printf("property error\n"); - _THROW_EXCPT(ComponentErrors::CouldntGetAttributeExImpl,"CNotoMinorServoBossCore::watchingMinorServoStatus()"); - } - if (notActivEx == true ) { - //printf("not active\n"); - _THROW_EXCPT(ComponentErrors::ComponentNotActiveExImpl,"CNotoMinorServoBossCore::watchingMinorServoStatus()"); - } - //printf("NO error\n");*/ -} - -/* -void CNotoMinorServoBossCore::sector1MinorServo() throw (ComponentErrors::CORBAProblemExImpl, ComponentErrors::ComponentErrorsEx) -{ - printf("sector1 start\n"); - char serial_usd[23]; - char graf[5], mecc[4]; - char * value; - int i; - - value = "/home/gavino/Nuraghe/ACS/trunk/Noto/Configuration/CDB/alma/AS/tab_convUSD_S1.txt\0"; - ifstream usdTableS1(value); - if (!usdTableS1) { - ACS_SHORT_LOG ((LM_INFO, "File %s not found", value)); - exit(-1); - } - // Get reference to usd components - for (i = 1; i <= 139; i++) { - usdTableS1 >> lanIndexS1 >> circleIndexS1 >> usdCircleIndexS1 >> serial_usd >> graf >> mecc; - usd[circleIndexS1][usdCircleIndexS1] = MinorServo::USD::_nil(); - try { - printf("S1: circleIndexS1 = %d, usdCircleIndexS1 = %d\n", circleIndexS1, usdCircleIndexS1); - usd[circleIndexS1][usdCircleIndexS1] = m_services->getComponent(serial_usd); - lanradius[circleIndexS1][lanIndexS1] = usd[circleIndexS1][usdCircleIndexS1]; - usdCounterS1++; - } - catch (maciErrType::CannotGetComponentExImpl& ex) { - _ADD_BACKTRACE(ComponentErrors::CouldntGetComponentExImpl,Impl,ex,"CNotoMinorServoBossCore::sector1MinorServo()"); - Impl.setComponentName(serial_usd); - Impl.log(LM_DEBUG); - } - } - printf("sector1 done\n"); - m_sector1 = true; -} - -void CNotoMinorServoBossCore::sector2MinorServo() throw (ComponentErrors::CORBAProblemExImpl, ComponentErrors::ComponentErrorsEx) -{ - printf("sector2 start\n"); - char serial_usd[23]; - char graf[5], mecc[4]; - char * value; - int i; - - value = "/home/gavino/Nuraghe/ACS/trunk/Noto/Configuration/CDB/alma/AS/tab_convUSD_S2.txt\0"; - ifstream usdTableS2(value); - if (!usdTableS2) { - ACS_SHORT_LOG ((LM_INFO, "File %s not found", value)); - exit(-1); - } - // Get reference to usd components - for (i = 1; i <= 140; i++) { - usdTableS2 >> lanIndexS2 >> circleIndexS2 >> usdCircleIndexS2 >> serial_usd >> graf >> mecc; - usd[circleIndexS2][usdCircleIndexS2] = MinorServo::USD::_nil(); - try { - printf("S2: circleIndexS2 = %d, usdCircleIndexS2 = %d\n", circleIndexS2, usdCircleIndexS2); - usd[circleIndexS2][usdCircleIndexS2] = m_services->getComponent(serial_usd); - lanradius[circleIndexS2][lanIndexS2] = usd[circleIndexS2][usdCircleIndexS2]; - usdCounterS2++; - } - catch (maciErrType::CannotGetComponentExImpl& ex) { - _ADD_BACKTRACE(ComponentErrors::CouldntGetComponentExImpl,Impl,ex,"CNotoMinorServoBossCore::sector2MinorServo()"); - Impl.setComponentName(serial_usd); - Impl.log(LM_DEBUG); - } - } - - printf("sector2 done\n"); - m_sector2 = true; -} - -void CNotoMinorServoBossCore::sector3MinorServo() throw (ComponentErrors::CORBAProblemExImpl, ComponentErrors::ComponentErrorsEx) -{ - printf("sector3 start\n"); - char serial_usd[23]; - char graf[5], mecc[4]; - char * value; - int i; - - value = "/home/gavino/Nuraghe/ACS/trunk/Noto/Configuration/CDB/alma/AS/tab_convUSD_S3.txt\0"; - ifstream usdTableS3(value); - if (!usdTableS3) { - ACS_SHORT_LOG ((LM_INFO, "File %s not found", value)); - exit(-1); - } - // Get reference to usd components - for (i = 1; i <= 139; i++) { - usdTableS3 >> lanIndexS3 >> circleIndexS3 >> usdCircleIndexS3 >> serial_usd >> graf >> mecc; - usd[circleIndexS3][usdCircleIndexS3] = MinorServo::USD::_nil(); - try { - printf("S3: circleIndexS3 = %d, usdCircleIndexS3 = %d\n", circleIndexS3, usdCircleIndexS3); - usd[circleIndexS3][usdCircleIndexS3] = m_services->getComponent(serial_usd); - lanradius[circleIndexS3][lanIndexS3] = usd[circleIndexS3][usdCircleIndexS3]; - usdCounterS3++; - } - catch (maciErrType::CannotGetComponentExImpl& ex) { - _ADD_BACKTRACE(ComponentErrors::CouldntGetComponentExImpl,Impl,ex,"CNotoMinorServoBossCore::sector3MinorServo()"); - Impl.setComponentName(serial_usd); - Impl.log(LM_DEBUG); - } - } - - printf("sector3 done\n"); - m_sector3 = true; -} - -void CNotoMinorServoBossCore::sector4MinorServo() throw (ComponentErrors::CORBAProblemExImpl, ComponentErrors::ComponentErrorsEx) -{ - printf("sector4 start\n"); - char serial_usd[23]; - char graf[5], mecc[4]; - char * value; - int i; - - value = "/home/gavino/Nuraghe/ACS/trunk/Noto/Configuration/CDB/alma/AS/tab_convUSD_S4.txt\0"; - ifstream usdTableS4(value); - if (!usdTableS4) { - ACS_SHORT_LOG ((LM_INFO, "File %s not found", value)); - exit(-1); - } - // Get reference to usd components - for (i = 1; i <= 140; i++) { - usdTableS4 >> lanIndexS4 >> circleIndexS4 >> usdCircleIndexS4 >> serial_usd >> graf >> mecc; - usd[circleIndexS4][usdCircleIndexS4] = MinorServo::USD::_nil(); - try { - printf("S4: circleIndexS4 = %d, usdCircleIndexS4 = %d\n", circleIndexS4, usdCircleIndexS4); - usd[circleIndexS4][usdCircleIndexS4] = m_services->getComponent(serial_usd); - lanradius[circleIndexS4][lanIndexS4] = usd[circleIndexS4][usdCircleIndexS4]; - usdCounterS4++; - } - catch (maciErrType::CannotGetComponentExImpl& ex) { - _ADD_BACKTRACE(ComponentErrors::CouldntGetComponentExImpl,Impl,ex,"CNotoMinorServoBossCore::sector2MinorServo()"); - Impl.setComponentName(serial_usd); - Impl.log(LM_DEBUG); - } - } - - printf("sector4 done\n"); - m_sector4 = true; -} - -void CNotoMinorServoBossCore::sector5MinorServo() throw (ComponentErrors::CORBAProblemExImpl, ComponentErrors::ComponentErrorsEx) -{ - printf("sector5 start\n"); - char serial_usd[23]; - char graf[5], mecc[4]; - char * value; - int i; - - value = "/home/gavino/Nuraghe/ACS/trunk/Noto/Configuration/CDB/alma/AS/tab_convUSD_S5.txt\0"; - ifstream usdTableS5(value); - if (!usdTableS5) { - ACS_SHORT_LOG ((LM_INFO, "File %s not found", value)); - exit(-1); - } - // Get reference to usd components - for (i = 1; i <= 139; i++) { - usdTableS5 >> lanIndexS5 >> circleIndexS5 >> usdCircleIndexS5 >> serial_usd >> graf >> mecc; - usd[circleIndexS5][usdCircleIndexS5] = MinorServo::USD::_nil(); - try { - printf("S5: circleIndexS5 = %d, usdCircleIndexS5 = %d\n", circleIndexS5, usdCircleIndexS5); - usd[circleIndexS5][usdCircleIndexS5] = m_services->getComponent(serial_usd); - lanradius[circleIndexS5][lanIndexS5] = usd[circleIndexS5][usdCircleIndexS5]; - usdCounterS5++; - } - catch (maciErrType::CannotGetComponentExImpl& ex) { - _ADD_BACKTRACE(ComponentErrors::CouldntGetComponentExImpl,Impl,ex,"CNotoMinorServoBossCore::sector5MinorServo()"); - Impl.setComponentName(serial_usd); - Impl.log(LM_DEBUG); - } - } - - printf("sector5 done\n"); - m_sector5 = true; -} - -void CNotoMinorServoBossCore::sector6MinorServo() throw (ComponentErrors::CORBAProblemExImpl, ComponentErrors::ComponentErrorsEx) -{ - printf("sector6 start\n"); - char serial_usd[23]; - char graf[5], mecc[4]; - char * value; - int i; - - value = "/home/gavino/Nuraghe/ACS/trunk/Noto/Configuration/CDB/alma/AS/tab_convUSD_S6.txt\0"; - ifstream usdTableS6(value); - if (!usdTableS6) { - ACS_SHORT_LOG ((LM_INFO, "File %s not found", value)); - exit(-1); - } - // Get reference to usd components - for (i = 1; i <= 140; i++) { - usdTableS6 >> lanIndexS6 >> circleIndexS6 >> usdCircleIndexS6 >> serial_usd >> graf >> mecc; - usd[circleIndexS6][usdCircleIndexS6] = MinorServo::USD::_nil(); - try { - printf("S6: circleIndexS6 = %d, usdCircleIndexS6 = %d\n", circleIndexS6, usdCircleIndexS6); - usd[circleIndexS6][usdCircleIndexS6] = m_services->getComponent(serial_usd); - lanradius[circleIndexS6][lanIndexS6] = usd[circleIndexS6][usdCircleIndexS6]; - usdCounterS6++; - } - catch (maciErrType::CannotGetComponentExImpl& ex) { - _ADD_BACKTRACE(ComponentErrors::CouldntGetComponentExImpl,Impl,ex,"CNotoMinorServoBossCore::sector2MinorServo()"); - Impl.setComponentName(serial_usd); - Impl.log(LM_DEBUG); - } - } - - printf("sector6 done\n"); - m_sector6 = true; -} - -void CNotoMinorServoBossCore::sector7MinorServo() throw (ComponentErrors::CORBAProblemExImpl, ComponentErrors::ComponentErrorsEx) -{ - printf("sector7 start\n"); - char serial_usd[23]; - char graf[5], mecc[4]; - char * value; - int i; - - value = "/home/gavino/Nuraghe/ACS/trunk/Noto/Configuration/CDB/alma/AS/tab_convUSD_S7.txt\0"; - ifstream usdTableS7(value); - if (!usdTableS7) { - ACS_SHORT_LOG ((LM_INFO, "File %s not found", value)); - exit(-1); - } - // Get reference to usd components - for (i = 1; i <= 139; i++) { - usdTableS7 >> lanIndexS7 >> circleIndexS7 >> usdCircleIndexS7 >> serial_usd >> graf >> mecc; - usd[circleIndexS7][usdCircleIndexS7] = MinorServo::USD::_nil(); - try { - printf("S7: circleIndexS7 = %d, usdCircleIndexS7 = %d\n", circleIndexS7, usdCircleIndexS7); - usd[circleIndexS7][usdCircleIndexS7] = m_services->getComponent(serial_usd); - lanradius[circleIndexS7][lanIndexS7] = usd[circleIndexS7][usdCircleIndexS7]; - usdCounterS7++; - } - catch (maciErrType::CannotGetComponentExImpl& ex) { - _ADD_BACKTRACE(ComponentErrors::CouldntGetComponentExImpl,Impl,ex,"CNotoMinorServoBossCore::sector3MinorServo()"); - Impl.setComponentName(serial_usd); - Impl.log(LM_DEBUG); - } - } - - printf("sector7 done\n"); - m_sector7 = true; -} - -void CNotoMinorServoBossCore::sector8MinorServo() throw (ComponentErrors::CORBAProblemExImpl, ComponentErrors::ComponentErrorsEx) -{ - printf("sector8 start\n"); - char serial_usd[23]; - char graf[5], mecc[4]; - char * value; - int i; - - value = "/home/gavino/Nuraghe/ACS/trunk/Noto/Configuration/CDB/alma/AS/tab_convUSD_S8.txt\0"; - ifstream usdTableS8(value); - if (!usdTableS8) { - ACS_SHORT_LOG ((LM_INFO, "File %s not found", value)); - exit(-1); - } - // Get reference to usd components - for (i = 1; i <= 140; i++) { - usdTableS8 >> lanIndexS8 >> circleIndexS8 >> usdCircleIndexS8 >> serial_usd >> graf >> mecc; - usd[circleIndexS8][usdCircleIndexS8] = MinorServo::USD::_nil(); - try { - printf("S8: circleIndexS8 = %d, usdCircleIndexS8 = %d\n", circleIndexS8, usdCircleIndexS8); - usd[circleIndexS8][usdCircleIndexS8] = m_services->getComponent(serial_usd); - lanradius[circleIndexS8][lanIndexS8] = usd[circleIndexS8][usdCircleIndexS8]; - usdCounterS8++; - } - catch (maciErrType::CannotGetComponentExImpl& ex) { - _ADD_BACKTRACE(ComponentErrors::CouldntGetComponentExImpl,Impl,ex,"CNotoMinorServoBossCore::sector2MinorServo()"); - Impl.setComponentName(serial_usd); - Impl.log(LM_DEBUG); - } - } - - printf("sector8 done\n"); - m_sector8 = true; -} -*/ - -void CNotoMinorServoBossCore::workingMinorServo() throw (ComponentErrors::CORBAProblemExImpl, ComponentErrors::ComponentErrorsEx) -{ - char buff[SENDBUFFERSIZE]; - int res; - int n; - char str[80]; - - if (AutoUpdate) { - TIMEVALUE now; - double azimuth=0.0; - double elevation=0.0; - double diff=0.0; - int elev; - - IRA::CIRATools::getTime(now); - - if (!CORBA::is_nil(m_antennaBoss)) { - try { - m_antennaBoss->getRawCoordinates(now.value().value, azimuth, elevation); - } - catch (CORBA::SystemException& ex) { - _EXCPT(ComponentErrors::CORBAProblemExImpl,impl,"CNotoMinorServoBossCore::workingMinorServo()"); - impl.setName(ex._name()); - impl.setMinor(ex.minor()); - m_status=Management::MNG_WARNING; - //asPark(); TBC!!! - throw impl; - } - azimuth = 0.0; - diff = fabs(m_elevation - elevation*DR2D); - m_elevation=elevation*DR2D; - try { - //onewayAction(MinorServo::AS_UPDATE, 0, 0, 0, elevation*DR2D, 0, 0, m_profile); - if ((elevation*DR2D > 5.0) && (elevation*DR2D < 90.0) && (diff > 0.5)) { - //sprintf(buff,"@-%02.0lf\n", elevation*DR2D); - elev = (int)(floor(elevation*DR2D+0.5)); - sprintf (buff, "0,%d,%d", mode, m_config); - for (n = 0; n < ((mode) ? 5 : 2); n++) { - sprintf (str, ",%6.2f", scupos[elev][n]); /* comanded position + user offset */ - strcat (buff, str); - } - res = sendBuffer(buff,strlen(buff)); - //printf("diff = %f, buff = %s", diff, buff); - } - else - printf("bad elevation = %lf\n", elevation*DR2D); - } - catch (ComponentErrors::ComponentErrorsExImpl& ex) { - ex.log(LM_DEBUG); - throw ex.getComponentErrorsEx(); - } - } - } -} -/* -void CNotoMinorServoBossCore::setProfile(const MinorServo::TASProfile& newProfile) throw (ComponentErrors::ComponentErrorsExImpl) -{ - int s, i, l; - char * value; - - if ((m_sector1 == true)&&(m_sector2 == true)&&(m_sector3 == true)&&(m_sector4 == true)&&(m_sector5 == true)&&(m_sector6 == true)&&(m_sector7 == true)&&(m_sector8 == true)) { - //printf("setProfile corrections\n"); - value = USDTABLECORRECTIONS; - ifstream usdCorrections (value); - if (!usdCorrections) { - ACS_SHORT_LOG ((LM_INFO, "File %s not found", value)); - exit(-1); - } - actuatorsCorrections.length(NPOSITIONS); - for (i = 1; i <= CIRCLES; i++) { - for (l = 1; l <= actuatorsInCircle[i]; l++) { - // printf ("Corrections = "); - for (s = 0; s < NPOSITIONS; s++) { - usdCorrections >> actuatorsCorrections[s]; - //printf ("%f ", actuatorsCorrections[s]); - } - // printf("\n"); - if (!CORBA::is_nil(usd[i][l])) { - // printf("i = %d, l = %d\n", i, l); - usd[i][l]->posTable(actuatorsCorrections, NPOSITIONS, DELTAEL, THRESHOLDPOS); - } - } - } - m_sector1 = false; - m_sector2 = false; - m_sector3 = false; - m_sector4 = false; - m_sector5 = false; - m_sector6 = false; - m_sector7 = false; - m_sector8 = false; - usdCounter = usdCounterS1 + usdCounterS2 + usdCounterS3 + usdCounterS4 + usdCounterS5 + usdCounterS6 + usdCounterS7 + usdCounterS8; - - m_ASup=true; - m_status=Management::MNG_OK; - - if (usdCounter < (int)lastUSD*WARNINGUSDPERCENT) { - m_status=Management::MNG_WARNING; - } - if (usdCounter < (int)lastUSD*ERRORUSDPERCENT) { - m_status=Management::MNG_FAILURE; - m_ASup=false; - } - //printf("usdCounter = %d\n", usdCounter); - } - - if (m_ASup == true) { - CIRATools::Wait(1000000); - _SET_CDB_CORE(profile, newProfile,"NotoMinorServoBossCore::setProfile") - m_profile = newProfile; - try { - onewayAction(MinorServo::AS_PROFILE, 0, 0, 0, 0, 0, 0, newProfile); - } - catch (ComponentErrors::ComponentErrorsExImpl& ex) { - ex.log(LM_DEBUG); - throw ex.getComponentErrorsEx(); - } - - m_profileSetted = true; - - CIRATools::Wait(1000000); - asOn(); - } -} -*/ - -void CNotoMinorServoBossCore::msSetup(const char *conf) throw (ComponentErrors::TimeoutExImpl,ComponentErrors::SocketErrorExImpl,ComponentErrors::CDBAccessExImpl) -{ - setDefaultAxesValues(conf); -} - -void CNotoMinorServoBossCore::setDefaultAxesValues(const IRA::CString & conf) -{ - char buff[SENDBUFFERSIZE]; - char str[80]; - int n, res; - int axis; - float xValues[POLY_COEFF]; - float yValues[POLY_COEFF]; - float z1Values[POLY_COEFF]; - float z2Values[POLY_COEFF]; - float z3Values[POLY_COEFF]; - - if (conf.Compare("KAP")==0) { - m_config = 1; mode = 0; axis = 2; - } - if (conf.Compare("SXP")==0) { - m_config = 2; mode = 0; axis = 2; - } - if (conf.Compare("KUP")==0) { - m_config = 3; mode = 0; axis = 2; - } - if (conf.Compare("UHP")==0) { - m_config = 4; mode = 0; axis = 2; - } - if (conf.Compare("PPP")==0) { - m_config = 5; mode = 0; axis = 2; - } - if (conf.Compare("WWP")==0) { - m_config = 6; mode = 0; axis = 2; - } - if (conf.Compare("KKC")==0) { - m_config = 1; mode = 1; axis = 5; - } - if (conf.Compare("CCC")==0) { - m_config = 2; mode = 1; axis = 5; - xValues[4]=0; xValues[3]=0; xValues[2]=0; xValues[1]=0; xValues[0]=-0.5; - PolyEvaluation (0, xValues, POLY_COEFF); - yValues[4]=0; yValues[3]=0; yValues[2]=8.3689e-4; yValues[1]=.152495; yValues[0]=-11.7; - PolyEvaluation (1, yValues, POLY_COEFF); - z1Values[4]=0; z1Values[3]=0; z1Values[2]=0.00168640; z1Values[1]=-0.271430; z1Values[0]=17.3; - PolyEvaluation (2, z1Values, POLY_COEFF); - z2Values[4]=0; z2Values[3]=0; z2Values[2]=0.00168640; z2Values[1]=-0.271430; z2Values[0]=9.8; - PolyEvaluation (3, z2Values, POLY_COEFF); - z3Values[4]=0; z3Values[3]=0; z3Values[2]=0.00168640; z3Values[1]=-0.271430; z3Values[0]=12.6; - PolyEvaluation (4, z3Values, POLY_COEFF); - } - if (conf.Compare("MMC")==0) { - m_config = 3; mode = 1; axis = 5; - } - if (conf.Compare("LLC")==0) { - m_config = 4; mode = 1; axis = 5; - } - if (conf.Compare("LHC")==0) { - m_config = 5; mode = 1; axis = 5; - } - if (conf.Compare("QQC")==0) { - m_config = 6; mode = 1; axis = 5; - } - sprintf (buff, "0,%d,%d", mode, m_config); - for (n = 0; n < ((mode) ? 5 : 2); n++) { - sprintf (str, ",%6.2f", scupos[45][n]); // initial setup at 45° - strcat (buff, str); - } - res = sendBuffer(buff,strlen(buff)); -} - -void CNotoMinorServoBossCore::PolyEvaluation (int Axis, float *Coeff, int Dim) -/* computes scu axis position table */ -{ - int i, j; - float Xi; - for (i = 0; i <= 90; i++) { /* make 1 point every deg from 0 to 90 */ - scupos[i][Axis] = 0; - for (j = 0; j < Dim; j++) { - Xi = pow ((float)i, j); - scupos[i][Axis] += Coeff[j] * Xi; - //printf("j= %d, pos = %f\n", j, scupos[i][Axis]); - } - } -} -/* -void -PolyEvaluation (Axis, Coeff, Dim) - int Axis; - float *Coeff; - int Dim; -// computes scu axis position table -{ - int i, j; - float Xi; - for (i = 0; i <= 90; i++) { // make 1 point every deg from 0 to 90 - st->scupos[i][Axis] = 0; - for (j = 0; j < Dim; j++) { - Xi = pow (i, j); - st->scupos[i][Axis] += Coeff[j] * Xi; - } - } -} -*/ - -void CNotoMinorServoBossCore::msOn() -{ - //if (m_profileSetted == true ) { - // if ((m_profile != MinorServo::AS_PARABOLIC_FIXED) && (m_profile != MinorServo::AS_SHAPED_FIXED)) { - enableAutoUpdate(); // as=enable nel FS di Noto - m_tracking = true; - // } - // else { - // m_tracking = false; - // try { - // onewayAction(MinorServo::AS_UPDATE, 0, 0, 0, 45.0, 0, 0, m_profile); - // } - // catch (ComponentErrors::ComponentErrorsExImpl& ex) { - // ex.log(LM_DEBUG); - // throw ex.getComponentErrorsEx(); - // } - // } - //} - //else { - // printf("you must set the profile first\n"); - //} -} - -void CNotoMinorServoBossCore::msPark() throw (ComponentErrors::ComponentErrorsEx) -{ - char buff[SENDBUFFERSIZE]; - int res; - - //if (m_profileSetted == true ) { - try { - // onewayAction(MinorServo::AS_STOP, 0, 0, 0, 0, 0, 0, m_profile); - //send @-45 string to the server - sprintf(buff,"@-1\n"); // as=stow nel FS di Noto - res = sendBuffer(buff,4); - } - catch (ComponentErrors::ComponentErrorsExImpl& ex) { - ex.log(LM_DEBUG); - throw ex.getComponentErrorsEx(); - } - disableAutoUpdate(); - //} - //else { - // printf("you must set the profile first\n"); - //} -} - -void CNotoMinorServoBossCore::msOff() throw (ComponentErrors::ComponentErrorsEx) -{ - char buff[SENDBUFFERSIZE]; - int res; - - //if (m_profileSetted == true ) { - try { - // onewayAction(MinorServo::AS_STOP, 0, 0, 0, 0, 0, 0, m_profile); - //send @-45 string to the server - sprintf(buff,"@-45\n"); // as=disable nel FS di Noto - res = sendBuffer(buff,5); - } - catch (ComponentErrors::ComponentErrorsExImpl& ex) { - ex.log(LM_DEBUG); - throw ex.getComponentErrorsEx(); - } - disableAutoUpdate(); - //} - //else { - // printf("you must set the profile first\n"); - //} -} -/* -void CNotoMinorServoBossCore::setActuator(int circle, int actuator, long int& actPos, long int& cmdPos, long int& Fmin, long int& Fmax, long int& acc,long int& delay) throw (ComponentErrors::PropertyErrorExImpl, ComponentErrors::ComponentNotActiveExImpl) -{ - if (!CORBA::is_nil(usd[circle][actuator])) { - ACSErr::Completion_var completion; - ACS::ROlong_var actPos_var; - ACS::RWlong_var cmdPos_var; - ACS::RWlong_var Fmin_var; - ACS::RWlong_var Fmax_var; - ACS::RWlong_var acc_var; - ACS::RWlong_var delay_var; - - actPos_var = usd[circle][actuator]->actPos (); - if (actPos_var.ptr() != ACS::ROlong::_nil()) { - actPos = actPos_var->get_sync (completion.out ()); - } - else { - _EXCPT(ComponentErrors::PropertyErrorExImpl,impl,"CNotoMinorServoBossCore::setActuator()"); - impl.setPropertyName("usd actual position"); - throw impl; - } - cmdPos_var = usd[circle][actuator]->cmdPos (); - if (cmdPos_var.ptr() != ACS::RWlong::_nil()) { - cmdPos = cmdPos_var->get_sync (completion.out ()); - } - else { - _EXCPT(ComponentErrors::PropertyErrorExImpl,impl,"CNotoMinorServoBossCore::setActuator()"); - impl.setPropertyName("usd commanded position"); - throw impl; - } - Fmin_var = usd[circle][actuator]->Fmin (); - if (Fmin_var.ptr() != ACS::RWlong::_nil()) { - Fmin = Fmin_var->get_sync (completion.out ()); - } - else { - _EXCPT(ComponentErrors::PropertyErrorExImpl,impl,"CNotoMinorServoBossCore::setActuator()"); - impl.setPropertyName("usd Fmin"); - throw impl; - } - Fmax_var = usd[circle][actuator]->Fmax (); - if (Fmax_var.ptr() != ACS::RWlong::_nil()) { - Fmax = Fmax_var->get_sync (completion.out ()); - } - else { - _EXCPT(ComponentErrors::PropertyErrorExImpl,impl,"CNotoMinorServoBossCore::setActuator()"); - impl.setPropertyName("usd Fmax"); - throw impl; - } - acc_var = usd[circle][actuator]->acc (); - if (acc_var.ptr() != ACS::RWlong::_nil()) { - acc = acc_var->get_sync (completion.out ()); - } - else { - _EXCPT(ComponentErrors::PropertyErrorExImpl,impl,"CNotoMinorServoBossCore::setActuator()"); - impl.setPropertyName("usd acceleration"); - throw impl; - } - delay_var = usd[circle][actuator]->delay (); - if (delay_var.ptr() != ACS::RWlong::_nil()) { - delay = delay_var->get_sync (completion.out ()); - } - else { - _EXCPT(ComponentErrors::PropertyErrorExImpl,impl,"CNotoMinorServoBossCore::setActuator()"); - impl.setPropertyName("usd delay"); - throw impl; - } - } - else { - _THROW_EXCPT(ComponentErrors::ComponentNotActiveExImpl,"CNotoMinorServoBossCore::setActuator()"); - } -} - -void CNotoMinorServoBossCore::usdStatus4GUIClient(int circle, int actuator, CORBA::Long_out status) throw (ComponentErrors::CORBAProblemExImpl, ComponentErrors::CouldntGetAttributeExImpl, ComponentErrors::ComponentNotActiveExImpl) -{ - ACS::ROpattern_var status_var; - ACSErr::Completion_var completion; - - if (!CORBA::is_nil(usd[circle][actuator])) { - try { - status_var = usd[circle][actuator]->status (); - status = status_var->get_sync (completion.out ()); - } - catch (CORBA::SystemException& ex) { - _EXCPT(ComponentErrors::CORBAProblemExImpl,impl,"CNotoMinorServoBossCore::usdStatus4GUIClient()"); - impl.setName(ex._name()); - impl.setMinor(ex.minor()); - throw impl; - } - } - else { - _THROW_EXCPT(ComponentErrors::ComponentNotActiveExImpl,"CNotoMinorServoBossCore::usdStatus4GUIClient()"); - } -} - -void CNotoMinorServoBossCore::recoverUSD(int circleIndex, int usdCircleIndex) throw (ComponentErrors::CouldntGetComponentExImpl) -{ - char serial_usd[23]; - - setserial (circleIndex, usdCircleIndex, lanIndex, serial_usd); - - usd[circleIndex][usdCircleIndex] = MinorServo::USD::_nil(); - try { - usd[circleIndex][usdCircleIndex] = m_services->getComponent(serial_usd); - lanradius[circleIndex][lanIndex] = usd[circleIndex][usdCircleIndex]; - } - catch (maciErrType::CannotGetComponentExImpl& ex) { - _ADD_BACKTRACE(ComponentErrors::CouldntGetComponentExImpl,Impl,ex,"CNotoMinorServoBossCore::recoverUSD()"); - Impl.setComponentName(serial_usd); - Impl.log(LM_DEBUG); - } -} - -void CNotoMinorServoBossCore::setradius(int radius, int &actuatorsradius, int &jumpradius) -{ - if (radius == 1 || radius == 5 || radius == 9 || radius == 13 || - radius == 17 || radius == 21 || radius == 25 || radius == 29 || - radius == 33 || radius == 37 || radius == 41 || radius == 45 || - radius == 49 || radius == 53 || radius == 57 || radius == 61 || - radius == 65 || radius == 69 || radius == 73 || radius == 77 || - radius == 81 || radius == 85 || radius == 89 || radius == 93) - { - actuatorsradius = 13; - if (radius == 13 || radius == 37 || radius == 61 || radius == 85) - actuatorsradius++; - jumpradius = 2; - } - else if (radius == 3 || radius == 7 || radius == 11 || radius == 15 || - radius == 19 || radius == 23 || radius == 27 || radius == 31 || - radius == 35 || radius == 39 || radius == 43 || radius == 47 || - radius == 51 || radius == 55 || radius == 59 || radius == 63 || - radius == 67 || radius == 71 || radius == 75 || radius == 79 || - radius == 83 || radius == 87 || radius == 91 || radius == 95) - { - actuatorsradius = 15; - if (radius == 11 || radius == 15 || radius == 35 || radius == 39 || - radius == 59 || radius == 63 || radius == 83 || radius == 87) - actuatorsradius++; - jumpradius = 0; - } - else - { - actuatorsradius = 9; - jumpradius = 6; - } -} - -void CNotoMinorServoBossCore::setserial (int circle, int actuator, int &lan, char* serial_usd) -{ - int sector = 0; - - if (circle >= 1 && circle <= 2) { - if (actuator >= 1 && actuator <= 3) - sector = 1; - if (actuator >= 4 && actuator <= 6) - sector = 2; - if (actuator >= 7 && actuator <= 9) - sector = 3; - if (actuator >= 10 && actuator <= 12) - sector = 4; - if (actuator >= 13 && actuator <= 15) - sector = 5; - if (actuator >= 16 && actuator <= 18) - sector = 6; - if (actuator >= 19 && actuator <= 21) - sector = 7; - if (actuator >= 22 && actuator <= 24) - sector = 8; - - lan = actuator*4 - 1; - } - if (circle >= 3 && circle <= 6) { - if (actuator >= 1 && actuator <= 6) - sector = 1; - if (actuator >= 7 && actuator <= 12) - sector = 2; - if (actuator >= 13 && actuator <= 18) - sector = 3; - if (actuator >= 19 && actuator <= 24) - sector = 4; - if (actuator >= 25 && actuator <= 30) - sector = 5; - if (actuator >= 31 && actuator <= 36) - sector = 6; - if (actuator >= 37 && actuator <= 42) - sector = 7; - if (actuator >= 43 && actuator <= 48) - sector = 8; - - lan = actuator*2 -1; - } - if (circle >= 7 && circle <= 15) { - if (actuator >= 1 && actuator <= 12) - sector = 1; - if (actuator >= 13 && actuator <= 24) - sector = 2; - if (actuator >= 25 && actuator <= 36) - sector = 3; - if (actuator >= 37 && actuator <= 48) - sector = 4; - if (actuator >= 49 && actuator <= 60) - sector = 5; - if (actuator >= 61 && actuator <= 72) - sector = 6; - if (actuator >= 73 && actuator <= 84) - sector = 7; - if (actuator >= 85 && actuator <= 96) - sector = 8; - - lan = actuator; - } - if (circle == 16) { - sector = actuator; - if (actuator == 1) - lan = 11; - if (actuator == 2) - lan = 15; - if (actuator == 3) - lan = 35; - if (actuator == 4) - lan = 39; - if (actuator == 5) - lan = 59; - if (actuator == 6) - lan = 63; - if (actuator == 7) - lan = 83; - if (actuator == 8) - lan = 87; - } - if (circle == 17) { - sector = actuator*2; - if (actuator == 1) - lan = 13; - if (actuator == 2) - lan = 37; - if (actuator == 3) - lan = 61; - if (actuator == 4) - lan = 85; - } - lan -= 12*(sector-1); - sprintf (serial_usd,"AS/SECTOR%02d/LAN%02d/USD%02d",sector, lan, circle); -} -*/ -void CNotoMinorServoBossCore::enableAutoUpdate() -{ - if (!AutoUpdate) { - AutoUpdate=true; - ACS_LOG(LM_FULL_INFO,"CNotoMinorServoBossCore::enableAutoUpdate()",(LM_NOTICE,"NotoMinorServoBoss::AUTOMATIC_UPDATE_ENABLED")); - } -} - -void CNotoMinorServoBossCore::disableAutoUpdate() -{ - if (AutoUpdate) { - AutoUpdate=false; - ACS_LOG(LM_FULL_INFO,"CNotoMinorServoBossCore::disableAutoUpdate()",(LM_NOTICE,"NotoMinorServoBoss::AUTOMATIC_UPDATE_DISABLED")); - } -} -/* -void CNotoMinorServoBossCore::checkASerrors(char* str, int circle, int actuator, ASErrors::ASErrorsEx Ex) -{ - ASErrors::ASErrorsExImpl exImpl(Ex); - - printf("checkASerrors: "); - printf("%s %d_%d: ", str, circle, actuator); - - switch(exImpl.getErrorCode()) { - case ASErrors::NoError: - printf ("NoError\n"); - break; - case ASErrors::LibrarySocketError: - printf ("LibrarySocketError\n"); - break; - case ASErrors::SocketReconn: - printf ("SocketReconn\n"); - break; - case ASErrors::SocketFail: - printf ("SocketFail\n"); - break; - case ASErrors::SocketTOut: - printf ("SocketTOut\n"); - break; - case ASErrors::SocketNotRdy: - printf ("SocketNotRdy\n"); - break; - case ASErrors::MemoryAllocation: - printf ("MemoryAllocation\n"); - break; - case ASErrors::Incomplete: - printf ("Incomplete\n"); - break; - case ASErrors::InvalidResponse: - printf ("InvalideResponse\n"); - break; - case ASErrors::Nak: - printf ("Nak\n"); - break; - case ASErrors::CDBAccessError: - printf ("CDBAccessError\n"); - break; - case ASErrors::USDConnectionError: - printf ("USDConnectionError\n"); - break; - case ASErrors::USDTimeout: - printf ("USDTimeout\n"); - break; - case ASErrors::LANConnectionError: - printf ("LANConnectionError\n"); - break; - case ASErrors::LAN_Unavailable: - printf ("LANUnavailable\n"); - break; - case ASErrors::sendCmdErr: - printf ("sendCmdErr\n"); - break; - case ASErrors::USDUnavailable: - printf ("USDUnavailable\n"); - break; - case ASErrors::USDError: - printf ("USDError\n"); - break; - case ASErrors::DevIOError: - printf ("DevIOError\n"); - break; - case ASErrors::corbaError: - printf ("corbaError\n"); - break; - case ASErrors::USDStillRunning: - printf ("USDStillRunning\n"); - break; - case ASErrors::USDunCalibrated: - printf ("USDunCalibrated\n"); - break; - case ASErrors::CannotGetUSD: - printf ("CannotGetUSD\n"); - break; - } -} - -void CNotoMinorServoBossCore::checkAScompletionerrors (char *str, int circle, int actuator, CompletionImpl comp) -{ - printf ("%s %d_%d ", str, circle, actuator); - - switch (comp.getCode ()) - {case 0: - printf ("NoError\n"); - break; - case 1: - printf ("USD calibrated\n"); - break; - case 2: - printf ("LibrarySocketError\n"); - break; - case 3: - printf ("SocketReconn\n"); - break; - case 4: - printf ("SocketFail\n"); - break; - case 5: - printf ("SocketTOut\n"); - break; - case 6: - printf ("SocketNotRdy\n"); - break; - case 7: - printf ("MemoryAllocation\n"); - break; - case 8: - printf ("LANConnectionError\n"); - break; - case 9: - printf ("LANUnavailable\n"); - break; - case 10: - printf ("sendCmdErr\n"); - break; - case 11: - printf ("Incomplete\n"); - break; - case 12: - printf ("InvalidResponse\n"); - break; - case 13: - printf ("Nak\n"); - break; - case 14: - printf ("CDBAccessError\n"); - break; - case 15: - printf ("USDConnectionError\n"); - break; - case 16: - printf ("USDTimeout\n"); - break; - case 17: - printf ("USDUnavailable\n"); - break; - case 18: - printf ("USDError\n"); - break; - case 19: - printf ("DevIOError\n"); - break; - case 20: - printf ("corbaError\n"); - break; - case 21: - printf ("USDStillRunning\n"); - break; - case 22: - printf ("USDunCalibrated\n"); - break; - case 23: - printf ("CannotGetUSD\n"); - break; - } -} -*/ -void CNotoMinorServoBossCore::setStatus(TLineStatus sta) -{ - m_Linestatus=sta; - if (m_Linestatus!=CNTD) { - setStatusField(CMDLINERROR); - } - else { - clearStatusField(CMDLINERROR); - } -} - -bool CNotoMinorServoBossCore::checkConnection() -{ - CError Tmp; - char sBuffer[RECBUFFERSIZE]; - int rBytes; - if (m_bTimedout) { // if a previous time out happend....try if the buffer has still to be received - rBytes=receiveBuffer(sBuffer,RECBUFFERSIZE); - if (rBytes==WOULDBLOCK) { // if the operation would have block again.....declare the disconnection - setStatus(NOTCNTD); // another timeout! something has happend - //_IRA_LOGFILTER_LOG(LM_CRITICAL,"CCommandLine::checkConnection()","SOCKET_DISCONNECTED - timeout expired"); - } - else if (rBytes==FAIL) { - // Nothing to do, this error will be handled below.... - } - else if (rBytes==0) { - // Nothing to do, this error will be handled below.... - } - else { - m_bTimedout=false; // timeout recovered - } - } - if (getLineStatus()==CNTD) { - return true; - } - else if (getLineStatus()==CNTDING) { - return false; - } - else { // socket is not connected.... - // try to close the socket, if it is already closed : never known.... - Close(Tmp); - Tmp.Reset(); - m_bTimedout=false; - // this will create the socket in blocking mode..... - if (Create(Tmp,STREAM)==SUCCESS) { - // Put the socket in non-blocking mode, registers the onconnect event....and allow some seconds to complete! - if (EventSelect(Tmp,E_CONNECT,true,m_configuration->getConnectTimeout())==SUCCESS) { - OperationResult Res; - ACS_DEBUG("CCommandLine::checkConnection()","Trying to reconnect"); - Res=Connect(Tmp,m_configuration->getAddress(),m_configuration->getPort()); - if (Res==WOULDBLOCK) { - setStatus(CNTDING); - } - else if (Res==SUCCESS) { - setStatus(CNTD); - /*try { - stopDataAcquisitionForced(); // ask the backend to exit the data transfering mode...... - } - catch (ACSErr::ACSbaseExImpl& ex) { - - }*/ - clearStatusField(BUSY); - m_reiniting=true; - ACS_LOG(LM_FULL_INFO,"CCommandLine::checkConnection()",(LM_NOTICE,"SOCKET_RECONNECTED")); //we do not want to filter this info so no logfilter..... - return true; - } - } - } - return false; - } -} - -IRA::CSocket::OperationResult CNotoMinorServoBossCore::sendBuffer(char *Msg,WORD Len) -{ - int NWrite; - int BytesSent; - BytesSent=0; - while (BytesSentm_configuration->getCommandLineTimeout()) { - m_bTimedout=true; - return WOULDBLOCK; - } - else { - CIRATools::Wait(0,20000); - continue; - } - } - else if (res==FAIL) { - setStatus(NOTCNTD); - CString app; - app.Format("SOCKET_DISCONNECTED - %s",(const char *)m_Error.getFullDescription()); - //_IRA_LOGFILTER_LOG(LM_CRITICAL,"CCommandLine::receiveBuffer()",(const char*)app); - return res; - } - else if (res==0) { - setStatus(NOTCNTD); - //_IRA_LOGFILTER_LOG(LM_CRITICAL,"CCommandLine::receiveBuffer()","SOCKET_DISCONNECTED - remote side shutdown"); - return res; - } - else { - if (inCh!=PROT_TERMINATOR_CH) { - Msg[nRead]=inCh; - nRead++; - } - else { - Msg[nRead]=0; - return nRead; - } - } - } -} diff --git a/Noto/Servers/NotoMinorServo/src/NotoMinorServoBossImpl.cpp b/Noto/Servers/NotoMinorServo/src/NotoMinorServoBossImpl.cpp deleted file mode 100644 index ae089844ca155d6fbe6813500fc4f9b6ead6a764..0000000000000000000000000000000000000000 --- a/Noto/Servers/NotoMinorServo/src/NotoMinorServoBossImpl.cpp +++ /dev/null @@ -1,542 +0,0 @@ -// $Id: NotoMinorServoBossImpl.cpp,v 1.2 2016-11-15 12:37:07 c.migoni Exp $ - -#include -#include "NotoMinorServoBossImpl.h" -#include "DevIOStatus.h" -#include "DevIOEnable.h" -//#include "DevIOProfile.h" -#include "DevIOTracking.h" - -static char *rcsId="@(#) $Id: NotoMinorServoBossImpl.cpp,v 1.2 2016-11-15 12:37:07 c.migoni Exp $"; -static void *use_rcsId = ((void)&use_rcsId,(void *) &rcsId); - -using namespace SimpleParser; - -/*class NotoMinorServoProfile2String { -public: - static char *valToStr(const MinorServo::TASProfile& val) { - char *c=new char[16]; - if (val==MinorServo::AS_SHAPED) { - strcpy(c,"S"); - } - if (val==MinorServo::AS_SHAPED_FIXED) { - strcpy(c,"SF"); - } - if (val==MinorServo::AS_PARABOLIC) { - strcpy(c,"P"); - } - if (val==MinorServo::AS_PARABOLIC_FIXED) { - strcpy(c,"PF"); - } - return c; - } - static MinorServo::TASProfile strToVal(const char* str) throw (ParserErrors::BadTypeFormatExImpl) { - IRA::CString strVal(str); - strVal.MakeUpper(); - if (strVal=="S") { - return MinorServo::AS_SHAPED; - } - else if (strVal=="SF") { - return MinorServo::AS_SHAPED_FIXED; - } - else if (strVal=="P") { - return MinorServo::AS_PARABOLIC; - } - else if (strVal=="PF") { - return MinorServo::AS_PARABOLIC_FIXED; - } - else { - _EXCPT(ParserErrors::BadTypeFormatExImpl,ex,"NotoMinorServoProfile2String::strToVal()"); - throw ex; - } - } -};*/ - -NotoMinorServoBossImpl::NotoMinorServoBossImpl(const ACE_CString &CompName, maci::ContainerServices *containerServices) : - CharacteristicComponentImpl(CompName,containerServices), - m_pstatus(this), - m_penabled(this), -// m_pprofile(this), - m_ptracking(this), - m_core(NULL) -{ - AUTO_TRACE("NotoMinorServoBossImpl::NotoMinorServoBossImpl()"); -} - -NotoMinorServoBossImpl::~NotoMinorServoBossImpl() -{ - AUTO_TRACE("NotoMinorServoBossImpl::~NotoMinorServoBossImpl()"); -} - -void NotoMinorServoBossImpl::initialize() throw (ACSErr::ACSbaseExImpl) -{ - AUTO_TRACE("NotoMinorServoBossImpl::initialize()"); - cs = getContainerServices(); - ACS_LOG(LM_FULL_INFO,"NotoMinorServoBossImpl::initialize()",(LM_INFO,"COMPSTATE_INITIALIZING")); - try { - boss=(CNotoMinorServoBossCore *)new CNotoMinorServoBossCore(getContainerServices()); - m_core=new IRA::CSecureArea(boss); - m_pstatus=new ROEnumImpl - (getContainerServices()->getName()+":status",getComponent(),new NotoMinorServoBossImplDevIOStatus(m_core),true); - m_penabled=new ROEnumImpl - (getContainerServices()->getName()+":enabled",getComponent(),new NotoMinorServoBossImplDevIOEnable(m_core),true); -// m_pprofile=new ROEnumImpl -// (getContainerServices()->getName()+":pprofile",getComponent(),new NotoMinorServoBossImplDevIOProfile(m_core),true); - m_ptracking=new ROEnumImpl - (getContainerServices()->getName()+":tracking",getComponent(),new NotoMinorServoBossImplDevIOTracking(m_core),true); - - // create the parser for command line execution - m_parser = new SimpleParser::CParser(boss,10); - } - catch (std::bad_alloc& ex) { - _EXCPT(ComponentErrors::MemoryAllocationExImpl,dummy,"NotoMinorServoBossImpl::initialize()"); - throw dummy; - } - boss->initialize(); - try { - m_watchingThread=getContainerServices()->getThreadManager()->create *> - ("NotoMinorServoBOSSWATCHER",m_core); - } - catch (acsthreadErrType::acsthreadErrTypeExImpl& ex) { - _ADD_BACKTRACE(ComponentErrors::ThreadErrorExImpl,_dummy,ex,"NotoMinorServoBossImpl::initialize()"); - throw _dummy; - } - catch (...) { - _THROW_EXCPT(ComponentErrors::UnexpectedExImpl,"NotoMinorServoBossImpl::initialize()"); - } - - try { - m_workingThread=getContainerServices()->getThreadManager()->create *> - ("NotoMinorServoBOSSWORKER",m_core); - } - catch (acsthreadErrType::acsthreadErrTypeExImpl& ex) { - _ADD_BACKTRACE(ComponentErrors::ThreadErrorExImpl,_dummy,ex,"NotoMinorServoBossImpl::initialize()"); - throw _dummy; - } - catch (...) { - _THROW_EXCPT(ComponentErrors::UnexpectedExImpl,"NotoMinorServoBossImpl::initialize()"); - } -/* - if (CIRATools::getDBValue(cs,"profile",(long&)m_profile)) - { - ACS_SHORT_LOG((LM_INFO,"NotoMinorServoBoss: CDB %d profile parameter read", m_profile)); - boss->m_profile = m_profile; - } - else - { - ACS_LOG(LM_SOURCE_INFO,"NotoMinorServoBossImpl:initialize()",(LM_ERROR,"Error reading CDB!")); - ASErrors::CDBAccessErrorExImpl exImpl(__FILE__,__LINE__,"USDImpl::initialize() - Error reading CDB parameters"); - throw acsErrTypeLifeCycle::LifeCycleExImpl(exImpl,__FILE__,__LINE__,"USDImpl::initialize()"); - } -*/ - m_configuration.init(cs); - - // configure the parser..... - m_parser->add("servoSetup",new function1 >(boss,&CNotoMinorServoBossCore::msSetup),1 ); - m_parser->add("servoOn",new function0(boss,&CNotoMinorServoBossCore::msOn),0); - m_parser->add("servoOff",new function0(boss,&CNotoMinorServoBossCore::msOff),0); - m_parser->add("servoPark",new function0(boss,&CNotoMinorServoBossCore::msPark),0); - - ACS_LOG(LM_FULL_INFO, "NotoMinorServoBossImpl::initialize()", (LM_INFO,"COMPSTATE_INITIALIZED")); -} - -void NotoMinorServoBossImpl::execute() throw (ACSErr::ACSbaseExImpl) -{ - AUTO_TRACE("NotoMinorServoBossImpl::execute()"); - - try { - boss->execute(&m_configuration); - } - catch (ACSErr::ACSbaseExImpl& E) { - _ADD_BACKTRACE(ComponentErrors::InitializationProblemExImpl,_dummy,E,"NotoMinorServoBossImpl::execute()"); - throw _dummy; - } - //starts the loop status thread.... - //m_watchingThread->resume(); - //m_watchingThread->setSleepTime(LOOPSTATUSTIME); - - //starts the loop working thread.... - m_workingThread->resume(); - m_workingThread->setSleepTime(LOOPWORKINGTIME); - - ACS_LOG(LM_FULL_INFO,"NotoMinorServoBossImpl::execute()",(LM_INFO,"NotoMinorServoBossImpl::COMPSTATE_OPERATIONAL")); -} - -void NotoMinorServoBossImpl::cleanUp() -{ - AUTO_TRACE("NotoMinorServoBossImpl::cleanUp()"); - CSecAreaResourceWrapper core=m_core->Get(); - if (m_workingThread!=NULL) m_workingThread->suspend(); - if (m_watchingThread!=NULL) m_watchingThread->suspend(); - getContainerServices()->getThreadManager()->destroy(m_workingThread); - getContainerServices()->getThreadManager()->destroy(m_watchingThread); - ACS_LOG(LM_FULL_INFO,"NotoMinorServoBossImpl::cleanUp()",(LM_INFO,"NotoMinorServoBossImpl::THREADS_TERMINATED")); - core->cleanUp(); - ACS_LOG(LM_FULL_INFO,"NotoMinorServoBossImpl::cleanUp()",(LM_INFO,"NotoMinorServoBossImpl::BOSS_CORE_FREED")); - if (m_parser!=NULL) delete m_parser; - ACS_LOG(LM_FULL_INFO,"NotoMinorServoBossImpl::cleanUp()",(LM_INFO,"NotoMinorServoBossImpl::PARSER_FREED")); - CharacteristicComponentImpl::cleanUp(); -} - -void NotoMinorServoBossImpl::aboutToAbort() -{ - AUTO_TRACE("NotoMinorServoBossImpl::aboutToAbort()"); - if (m_workingThread!=NULL) m_workingThread->suspend(); - if (m_watchingThread!=NULL) m_watchingThread->suspend(); - getContainerServices()->getThreadManager()->destroy(m_workingThread); - getContainerServices()->getThreadManager()->destroy(m_watchingThread); - CSecAreaResourceWrapper core=m_core->Get(); - core->cleanUp(); - if (m_parser!=NULL) delete m_parser; -} -/* -void NotoMinorServoBossImpl::stop (CORBA::Long circle, CORBA::Long actuator, CORBA::Long radius) throw (CORBA::SystemException, ComponentErrors::ComponentErrorsEx) -{ - AUTO_TRACE("NotoMinorServoBossImpl::stop()"); - - CSecAreaResourceWrapper resource=m_core->Get(); - try { - //resource->onewayAction(MinorServo::AS_STOP, circle, actuator, radius, 0, 0, 0, m_profile); - } - catch (ComponentErrors::ComponentErrorsExImpl& ex) { - ex.log(LM_DEBUG); - throw ex.getComponentErrorsEx(); - } -} -*/ -void NotoMinorServoBossImpl::setup (const char *config) throw (CORBA::SystemException, ComponentErrors::ComponentErrorsEx) -{ - AUTO_TRACE("NotoMinorServoBossImpl::setup()"); - //IRA::CString strVal(config); - //strVal.MakeUpper(); - - CSecAreaResourceWrapper resource=m_core->Get(); - try { - resource->msSetup(config); - } - catch (ComponentErrors::ComponentErrorsExImpl& ex) { - ex.log(LM_DEBUG); - throw ex.getComponentErrorsEx(); - } - catch (...) { - _EXCPT(ComponentErrors::UnexpectedExImpl,dummy,"NotoMinorServoBossImpl::setup()"); - dummy.log(LM_DEBUG); - throw dummy.getComponentErrorsEx(); - } -} - -void NotoMinorServoBossImpl::park () throw (CORBA::SystemException, ManagementErrors::ParkingErrorEx) -{ - AUTO_TRACE("NotoMinorServoBossImpl::park()"); - msOff(); - //setProfile (MinorServo::AS_SHAPED_FIXED); - CSecAreaResourceWrapper resource=m_core->Get(); - try { - //resource->onewayAction(MinorServo::AS_UPDATE, 0, 0, 0, 45.0, 0, 0, m_profile); - resource->msPark(); - } - catch (ComponentErrors::ComponentErrorsExImpl& ex) { - _EXCPT(ManagementErrors::ParkingErrorExImpl,ex,"NotoMinorServoBossImpl::park()"); - throw ex.getParkingErrorEx(); - } - resource->m_tracking = false; -} -/* -void NotoMinorServoBossImpl::stow (CORBA::Long circle, CORBA::Long actuator, CORBA::Long radius) throw (CORBA::SystemException, ComponentErrors::ComponentErrorsEx) -{ - AUTO_TRACE("NotoMinorServoBossImpl::stow()"); - - CSecAreaResourceWrapper resource=m_core->Get(); - try { - //resource->onewayAction(MinorServo::AS_STOW, circle, actuator, radius, 0, 0, 0, m_profile); - resource->asPark(); - } - catch (ComponentErrors::ComponentErrorsExImpl& ex) { - ex.log(LM_DEBUG); - throw ex.getComponentErrorsEx(); - } -} - -void NotoMinorServoBossImpl::refPos (CORBA::Long circle, CORBA::Long actuator, CORBA::Long radius) throw (CORBA::SystemException, ComponentErrors::ComponentErrorsEx) -{ - AUTO_TRACE("NotoMinorServoBossImpl::refPos()"); - - CSecAreaResourceWrapper resource=m_core->Get(); - try { - //resource->onewayAction(MinorServo::AS_REFPOS, circle, actuator, radius, 0, 0, 0, m_profile); - } - catch (ComponentErrors::ComponentErrorsExImpl& ex) { - ex.log(LM_DEBUG); - throw ex.getComponentErrorsEx(); - } -} - -void NotoMinorServoBossImpl::update (CORBA::Double elevation) throw (CORBA::SystemException, ComponentErrors::ComponentErrorsEx) -{ - AUTO_TRACE("NotoMinorServoBossImpl::update()"); - - CSecAreaResourceWrapper resource=m_core->Get(); - - try { - //resource->onewayAction(MinorServo::AS_UPDATE, 0, 0, 0, elevation, 0, 0, m_profile); - } - catch (ComponentErrors::ComponentErrorsExImpl& ex) { - ex.log(LM_DEBUG); - throw ex.getComponentErrorsEx(); - } -} - -void NotoMinorServoBossImpl::up (CORBA::Long circle, CORBA::Long actuator, CORBA::Long radius) throw (CORBA::SystemException, ComponentErrors::ComponentErrorsEx) -{ - AUTO_TRACE("NotoMinorServoBossImpl::up()"); - - CSecAreaResourceWrapper resource=m_core->Get(); - try { - //resource->onewayAction(MinorServo::AS_UP, circle, actuator, radius, 0, 0, 0, m_profile); - } - catch (ComponentErrors::ComponentErrorsExImpl& ex) { - ex.log(LM_DEBUG); - throw ex.getComponentErrorsEx(); - } -} - -void NotoMinorServoBossImpl::down (CORBA::Long circle, CORBA::Long actuator, CORBA::Long radius) throw (CORBA::SystemException, ComponentErrors::ComponentErrorsEx) -{ - AUTO_TRACE("NotoMinorServoBossImpl::down()"); - - CSecAreaResourceWrapper resource=m_core->Get(); - try { - //resource->onewayAction(MinorServo::AS_DOWN, circle, actuator, radius, 0, 0, 0, m_profile); - } - catch (ComponentErrors::ComponentErrorsExImpl& ex) { - ex.log(LM_DEBUG); - throw ex.getComponentErrorsEx(); - } -} - -void NotoMinorServoBossImpl::bottom (CORBA::Long circle, CORBA::Long actuator, CORBA::Long radius) throw (CORBA::SystemException, ComponentErrors::ComponentErrorsEx) -{ - AUTO_TRACE("NotoMinorServoBossImpl::bottom()"); - - CSecAreaResourceWrapper resource=m_core->Get(); - try { - //resource->onewayAction(MinorServo::AS_BOTTOM, circle, actuator, radius, 0, 0, 0, m_profile); - } - catch (ComponentErrors::ComponentErrorsExImpl& ex) { - ex.log(LM_DEBUG); - throw ex.getComponentErrorsEx(); - } -} - -void NotoMinorServoBossImpl::top (CORBA::Long circle, CORBA::Long actuator, CORBA::Long radius) throw (CORBA::SystemException, ComponentErrors::ComponentErrorsEx) -{ - AUTO_TRACE("NotoMinorServoBossImpl::top()"); - - CSecAreaResourceWrapper resource=m_core->Get(); - try { - //resource->onewayAction(MinorServo::AS_TOP, circle, actuator, radius, 0, 0, 0, m_profile); - } - catch (ComponentErrors::ComponentErrorsExImpl& ex) { - ex.log(LM_DEBUG); - throw ex.getComponentErrorsEx(); - } -} - -void NotoMinorServoBossImpl::move (CORBA::Long circle, CORBA::Long actuator, CORBA::Long radius, CORBA::Long incr) throw (CORBA::SystemException, ComponentErrors::ComponentErrorsEx) -{ - AUTO_TRACE("NotoMinorServoBossImpl::move()"); - - CSecAreaResourceWrapper resource=m_core->Get(); - try { - //resource->onewayAction(MinorServo::AS_MOVE, circle, actuator, radius, 0, 0, incr, m_profile); - } - catch (ComponentErrors::ComponentErrorsExImpl& ex) { - ex.log(LM_DEBUG); - throw ex.getComponentErrorsEx(); - } -} - -void NotoMinorServoBossImpl::correction (CORBA::Long circle, CORBA::Long actuator, CORBA::Long radius, CORBA::Double correction) throw (CORBA::SystemException, ComponentErrors::ComponentErrorsEx) -{ - AUTO_TRACE("NotoMinorServoBossImpl::correction()"); - - CSecAreaResourceWrapper resource=m_core->Get(); - try { - //resource->onewayAction(MinorServo::AS_CORRECTION, circle, actuator, radius, 0, correction, 0, m_profile); - } - catch (ComponentErrors::ComponentErrorsExImpl& ex) { - ex.log(LM_DEBUG); - throw ex.getComponentErrorsEx(); - } -} - -void NotoMinorServoBossImpl::reset (CORBA::Long circle, CORBA::Long actuator, CORBA::Long radius) throw (CORBA::SystemException, ComponentErrors::ComponentErrorsEx) -{ - AUTO_TRACE("NotoMinorServoBossImpl::reset()"); - - CSecAreaResourceWrapper resource=m_core->Get(); - try { - //resource->reset(circle, actuator, radius); - } - catch (ComponentErrors::ComponentErrorsExImpl& ex) { - ex.log(LM_DEBUG); - throw ex.getComponentErrorsEx(); - } -} - -void NotoMinorServoBossImpl::setProfile (MinorServo::TASProfile newProfile) throw (CORBA::SystemException, ComponentErrors::ComponentErrorsEx) -{ - AUTO_TRACE("NotoMinorServoBossImpl::setProfile()"); - - m_profile = newProfile; - - CSecAreaResourceWrapper resource=m_core->Get(); - try { - //resource->setProfile(m_profile); - } - catch (ComponentErrors::ComponentErrorsExImpl& ex) { - ex.log(LM_DEBUG); - throw ex.getComponentErrorsEx(); - } -} - -void NotoMinorServoBossImpl::usdStatus4GUIClient (CORBA::Long circle, CORBA::Long actuator, CORBA::Long_out status) throw (CORBA::SystemException, ComponentErrors::ComponentErrorsEx) -{ - AUTO_TRACE("NotoMinorServoBossImpl::usdStatus4GUIClient()"); - - CSecAreaResourceWrapper resource=m_core->Get(); - try { - //resource->usdStatus4GUIClient(circle, actuator, status); - } - catch (ComponentErrors::ComponentErrorsExImpl& ex) { - ex.log(LM_DEBUG); - throw ex.getComponentErrorsEx(); - } -} - -void NotoMinorServoBossImpl::setActuator (CORBA::Long circle, CORBA::Long actuator, CORBA::Long_out actPos, CORBA::Long_out cmdPos, CORBA::Long_out Fmin, CORBA::Long_out Fmax, CORBA::Long_out acc, CORBA::Long_out delay) throw (CORBA::SystemException, ComponentErrors::ComponentErrorsEx) -{ - AUTO_TRACE("NotoMinorServoBossImpl::setActuator"); - - //long int act, cmd, fmin, fmax, ac, del; - - CSecAreaResourceWrapper resource=m_core->Get(); - try { - //resource->setActuator(circle, actuator, act, cmd, fmin, fmax, ac, del); - } - catch (ComponentErrors::ComponentErrorsExImpl& ex) { - ex.log(LM_DEBUG); - throw ex.getComponentErrorsEx(); - } - actPos = (CORBA::Long)act; - cmdPos = (CORBA::Long)cmd; - Fmin = (CORBA::Long)fmin; - Fmax = (CORBA::Long)fmax; - acc = (CORBA::Long)ac; - delay = (CORBA::Long)del; -} - - -void NotoMinorServoBossImpl::calibrate (CORBA::Long circle, CORBA::Long actuator, CORBA::Long radius) throw (CORBA::SystemException, ComponentErrors::ComponentErrorsEx) -{ - AUTO_TRACE("NotoMinorServoBossImpl::calibrate()"); - - CSecAreaResourceWrapper resource=m_core->Get(); - try { - //resource->calibrate(circle, actuator, radius); - } - catch (ComponentErrors::ComponentErrorsExImpl& ex) { - ex.log(LM_DEBUG); - throw ex.getComponentErrorsEx(); - } -} - -void NotoMinorServoBossImpl::calVer (CORBA::Long circle, CORBA::Long actuator, CORBA::Long radius) throw (CORBA::SystemException, ComponentErrors::ComponentErrorsEx) -{ - AUTO_TRACE("NotoMinorServoBossImpl::calibration verification()"); - - CSecAreaResourceWrapper resource=m_core->Get(); - try { - //resource->calVer(circle, actuator, radius); - } - catch (ComponentErrors::ComponentErrorsExImpl& ex) { - ex.log(LM_DEBUG); - throw ex.getComponentErrorsEx(); - } -} - - -void NotoMinorServoBossImpl::recoverUSD (CORBA::Long circle, CORBA::Long actuator) throw (CORBA::SystemException, ComponentErrors::ComponentErrorsEx) -{ - AUTO_TRACE("NotoMinorServoBossImpl::recoverUSD()"); - - CSecAreaResourceWrapper resource=m_core->Get(); - try { - //resource->recoverUSD(circle, actuator); TBC!! - } - catch (ComponentErrors::ComponentErrorsExImpl& ex) { - ex.log(LM_DEBUG); - throw ex.getComponentErrorsEx(); - } -} -*/ -void NotoMinorServoBossImpl::msOn() throw (CORBA::SystemException) -{ - AUTO_TRACE("NotoMinorServoBossImpl::asOn()"); - CSecAreaResourceWrapper resource=m_core->Get(); - try { - resource->msOn(); - } - catch (ComponentErrors::ComponentErrorsExImpl& ex) { - ex.log(LM_DEBUG); - throw ex.getComponentErrorsEx(); - } -} - -void NotoMinorServoBossImpl::msOff() throw (CORBA::SystemException) -{ - AUTO_TRACE("NotoMinorServoBossImpl::asOff()"); - CSecAreaResourceWrapper resource=m_core->Get(); - try { - resource->msOff(); - } - catch (ComponentErrors::ComponentErrorsExImpl& ex) { - ex.log(LM_DEBUG); - throw ex.getComponentErrorsEx(); - } -} - -CORBA::Boolean NotoMinorServoBossImpl::command(const char *cmd,CORBA::String_out answer) throw (CORBA::SystemException) -{ - AUTO_TRACE("AntennaBossImpl::command()"); - IRA::CString out; - bool res; - - CSecAreaResourceWrapper resource=m_core->Get(); - try { - m_parser->run(cmd,out); - res = true; - } - catch (ParserErrors::ParserErrorsExImpl &ex) { - res = false; - } - catch (ACSErr::ACSbaseExImpl& ex) { - ex.log(LM_ERROR); // the errors resulting from the execution are logged here as stated - // in the documentation of CommandInterpreter interface, - // while the parser errors are never logged. - res=false; - } - answer=CORBA::string_dup((const char *)out); - return res; -} - -_PROPERTY_REFERENCE_CPP(NotoMinorServoBossImpl,Management::ROTSystemStatus,m_pstatus,status); -_PROPERTY_REFERENCE_CPP(NotoMinorServoBossImpl,Management::ROTBoolean,m_penabled,enabled); -//_PROPERTY_REFERENCE_CPP(NotoMinorServoBossImpl,MinorServo::ROTASProfile,m_pprofile,pprofile); -_PROPERTY_REFERENCE_CPP(NotoMinorServoBossImpl,Management::ROTBoolean,m_ptracking,tracking); - -/* --------------- [ MACI DLL support functions ] -----------------*/ -#include -MACI_DLL_SUPPORT_FUNCTIONS(NotoMinorServoBossImpl) - -/*___oOo___*/ diff --git a/Noto/Servers/NotoMinorServo/src/NotoMinorServoBossWatchingThread.cpp b/Noto/Servers/NotoMinorServo/src/NotoMinorServoBossWatchingThread.cpp deleted file mode 100644 index 1adc51f25193534b253d499520291d8549bf7874..0000000000000000000000000000000000000000 --- a/Noto/Servers/NotoMinorServo/src/NotoMinorServoBossWatchingThread.cpp +++ /dev/null @@ -1,34 +0,0 @@ -#include "NotoMinorServoBossWatchingThread.h" - -CNotoMinorServoBossWatchingThread::CNotoMinorServoBossWatchingThread(const ACE_CString& name,IRA::CSecureArea *param, - const ACS::TimeInterval& responseTime,const ACS::TimeInterval& sleepTime) : ACS::Thread(name,responseTime,sleepTime), m_core(param) -{ - AUTO_TRACE("CNotoMinorServoBossWatchingThread::CNotoMinorServoBossWatchingThread()"); -} - -CNotoMinorServoBossWatchingThread::~CNotoMinorServoBossWatchingThread() -{ - AUTO_TRACE("CNotoMinorServoBossWatchingThread::~CNotoMinorServoBossWatchingThread()"); -} - -void CNotoMinorServoBossWatchingThread::onStart() -{ - AUTO_TRACE("CNotoMinorServoBossWatchingThread::onStart()"); -} - -void CNotoMinorServoBossWatchingThread::onStop() -{ - AUTO_TRACE("CNotoMinorServoBossWatchingThread::onStop()"); -} - -void CNotoMinorServoBossWatchingThread::runLoop() -{ - IRA::CSecAreaResourceWrapper resource=m_core->Get(); - - try { - resource->watchingMinorServoStatus(); - } - catch (ComponentErrors::ComponentErrorsExImpl& ex) { - ex.log(LM_DEBUG); - } -} diff --git a/Noto/Servers/NotoMinorServo/src/NotoMinorServoBossWorkingThread.cpp b/Noto/Servers/NotoMinorServo/src/NotoMinorServoBossWorkingThread.cpp deleted file mode 100644 index 6f3ef929bc96f359f34347239a92e944f46b21d4..0000000000000000000000000000000000000000 --- a/Noto/Servers/NotoMinorServo/src/NotoMinorServoBossWorkingThread.cpp +++ /dev/null @@ -1,34 +0,0 @@ -#include "NotoMinorServoBossWorkingThread.h" - -CNotoMinorServoBossWorkingThread::CNotoMinorServoBossWorkingThread(const ACE_CString& name,IRA::CSecureArea *param, - const ACS::TimeInterval& responseTime,const ACS::TimeInterval& sleepTime) : ACS::Thread(name,responseTime,sleepTime), m_core(param) -{ - AUTO_TRACE("CNotoMinorServoBossWorkingThread::CNotoMinorServoBossWorkingThread()"); -} - -CNotoMinorServoBossWorkingThread::~CNotoMinorServoBossWorkingThread() -{ - AUTO_TRACE("CNotoMinorServoBossWorkingThread::~CNotoMinorServoBossWorkingThread()"); -} - -void CNotoMinorServoBossWorkingThread::onStart() -{ - AUTO_TRACE("CNotoMinorServoBossWorkingThread::onStart()"); -} - -void CNotoMinorServoBossWorkingThread::onStop() -{ - AUTO_TRACE("CNotoMinorServoBossWorkingThread::onStop()"); -} - -void CNotoMinorServoBossWorkingThread::runLoop() -{ - IRA::CSecAreaResourceWrapper resource=m_core->Get(); - - try { - resource->workingMinorServo(); - } - catch (ComponentErrors::ComponentErrorsExImpl& ex) { - ex.log(LM_DEBUG); - } -} diff --git a/SystemMake/Makefile b/SystemMake/Makefile index 6d89bfd2aa5fc30acd03145ecf1a5f8694e3d373..66241f86fffd486b63c2c2653d0c44670f2ae9ba 100644 --- a/SystemMake/Makefile +++ b/SystemMake/Makefile @@ -67,7 +67,6 @@ MED_MISC:=MedScripts NT_DOC:=NTDox NT_ERRORS:=NotoActiveSurfaceErrors NT_INTERFACES:=NotoAntennaInterface NotoReceiversInterface NotoWeatherStationInterface NotoActiveSurfaceInterface \ - NotoMinorServoInterface NT_LIBRARIES:= NT_SERVERS:= NotoReceivers NotoMount NotoWeatherStation NotoActiveSurface NotoMinorServo NotoPyLocalOscillator NT_CLIENTS:=NotoMountTextClient @@ -151,8 +150,8 @@ ifeq ($(STATION),Noto) NotoAntennaInterface \ SlaLibrary IRALibrary TextWindowLibrary ParserLibrary PyTestingLibrary \ AntennaBoss Observatory OTF PointingModel Refraction SkySource Moon FitsWriter Scheduler ReceiversBoss ExternalClients CalibrationTool \ - TotalPower NotoMount CustomLogger \ - AntennaBossTextClient ObservatoryTextClient GenericBackendTextClient ReceiversBossTextClient SystemTerminal SchedulerTextClient \ + TotalPower NotoMount CustomLogger MedicinaMinorServo\ + AntennaBossTextClient ObservatoryTextClient GenericBackendTextClient ReceiversBossTextClient SystemTerminal SchedulerTextClient MinorServoBossTextClient\ NotoMountTextClient CustomLoggingClient Scripts IDL_DOC:=Managment Antenna Backends Metrology