Commit 87d760b8 authored by Andrea Orlat's avatar Andrea Orlat
Browse files

added NotoMinorServo component

parent 2a10319f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
"@(#) $Id$"
+41 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
	- $Id: NotoMinorServoBoss.xsd,v 1.1 2009-05-21 15:32:47 c.migoni Exp $
	- Author: Carlo Migoni
	-
	- History:
	- 04-03-2009  Created
-->

<xs:schema
	targetNamespace="urn:schemas-cosylab-com:NotoMinorServoBoss:1.0"
	xmlns="urn:schemas-cosylab-com:NotoMinorServoBoss:1.0"
	xmlns:xs="http://www.w3.org/2001/XMLSchema"
	xmlns:cdb="urn:schemas-cosylab-com:CDB:1.0"
	xmlns:baci="urn:schemas-cosylab-com:BACI:1.0"
	xmlns:mng="urn:schemas-cosylab-com:Managment:1.0"
	xmlns:as="urn:schemas-cosylab-com:MinorServo:1.0"
	elementFormDefault="qualified"
	attributeFormDefault="unqualified">
	<xs:import namespace="urn:schemas-cosylab-com:CDB:1.0" schemaLocation="CDB.xsd"/>
	<xs:import namespace="urn:schemas-cosylab-com:BACI:1.0" schemaLocation="BACI.xsd"/>
	<xs:import namespace="urn:schemas-cosylab-com:Managment:1.0" schemaLocation="Managment.xsd"/>

	<xs:complexType name="NotoMinorServoBossType">
		<xs:sequence>
			<xs:element name="status" type="mng:SystemStatusType" />	
			<xs:element name="enabled" type="mng:BooleanType" />
			<xs:element name="tracking" type="mng:BooleanType" />
		</xs:sequence>
		<xs:attribute name="IPAddress" type="xs:string" use="required" />
		<xs:attribute name="Port" type="xs:unsignedShort" use="required" />
		<!-- sleep time of the watching thread (microseconds), this is the thread that keeps data up to date -->
		<xs:attribute name="WatchingThreadTime" type="xs:unsignedLong" use="required" />
		<!-- sleep time of the working thread (microseconds), this is the thread that keeps data up to date -->
		<xs:attribute name="WorkingThreadTime" type="xs:unsignedLong" use="required" />
        	<xs:attribute name="profile" type="xs:unsignedByte" use="required" />
	</xs:complexType>

	<xs:element name="NotoMinorServoBoss" type="NotoMinorServoBossType"/>
	
</xs:schema>
+144 −0
Original line number Diff line number Diff line
#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 <IRA>
#include <maciContainerServices.h>
#include <ComponentErrors.h>

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 <a href=mailto:a.orlati@ira.cnr.it>Andrea Orlati</a>,
 * Istituto di Radioastronomia, Italia
 * <br> 
  */
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_*/
+63 −0
Original line number Diff line number Diff line
#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 <baciDevIO.h>
#include <IRA>

using namespace baci;

/**
 * This  class is derived from the template DevIO. 
 * @author <a href=mailto:migoni@ca.astro.it>Carlo Migoni</a>,
 * Osservatorio Astronomico di Cagliari, Italia<br>
 */ 
class NotoMinorServoBossImplDevIOEnable: public virtual DevIO<Management::TBoolean>
{
public:
	
	NotoMinorServoBossImplDevIOEnable(IRA::CSecureArea<CNotoMinorServoBossCore>* 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<CNotoMinorServoBossCore> 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<CNotoMinorServoBossCore> *m_core;
};

#endif /*DEVIOENABLE_H_*/
+57 −0
Original line number Diff line number Diff line
#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 <baciDevIO.h>
#include <IRA>

using namespace baci;

/**
 * This  class is derived from the template DevIO. It is used by the  status property. 
 * @author <a href=mailto:migoni@ca.astro.it>Carlo Migoni</a>,
 * Osservatorio Astronomico di Cagliari, Italia<br>
 */ 
class NotoMinorServoBossImplDevIOStatus: public virtual DevIO<Management::TSystemStatus>
{
	
public:
	
	NotoMinorServoBossImplDevIOStatus(IRA::CSecureArea<CNotoMinorServoBossCore>* 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<CNotoMinorServoBossCore> 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<CNotoMinorServoBossCore> *m_core;
	
};

#endif /*DEVIOSTATUS_H_*/
Loading