Commit 09b0ab76 authored by Sergio Poppi's avatar Sergio Poppi
Browse files

Weather Station autostow functionality added

parent 95708b79
Loading
Loading
Loading
Loading
+17 −1
Original line number Diff line number Diff line
@@ -40,6 +40,10 @@

#include "ComponentProxies" 

#include <ComponentProxy.h>
#include "AntennaDefinitionsC.h"



/*
const CString ADDRESS="192.167.8.13"; //DEBUG
@@ -72,6 +76,15 @@ The class implements the Srt Meteo Station.
Not all the paramters from the station have been implemented.

*/
#include <SRTMountC.h>
#include "ComponentProxy.h"

namespace Antenna
{
    PROXY_COMPONENT(SRTMount);
};



using ACS::ThreadBase;
class SRTWeatherStationImpl;
@@ -204,7 +217,9 @@ private:
	
 	
        Management::Scheduler_proxy m_scheduler;
        Antenna::AntennaBoss_proxy m_antennaBoss;	void deleteAll();
        Antenna::AntennaBoss_proxy m_antennaBoss;
         Antenna::SRTMount_proxy m_mount;        	
        void deleteAll();
	CSecureArea<SRTWeatherSocket> *m_socket;
	CWindCheckerThread *m_controlThread_p;
	WeatherStationData m_wsdata;
@@ -218,6 +233,7 @@ private:
	SmartPropertyPointer<RWdouble> m_humidity;
	SmartPropertyPointer<RWdouble> m_pressure;
	SimpleParser::CParser<SRTWeatherSocket> * m_parser;
        unsigned int m_threshold;
        
        
        
+5 −1
Original line number Diff line number Diff line
@@ -75,11 +75,15 @@ SRTWeatherStationImpl_LIBS =ComponentErrors \
			ManagmentDefinitionsStubs\
			ParserErrors\
			AntennaBossStubs\
			MountStubs\
			SchedulerStubs \
			SRTMountStubs \
			AntennaDefinitionsStubs\
			AntennaErrors 
			
			


#
# special compilation flags for single c sources
#yyyyy_CFLAGS   = 
+22 −6
Original line number Diff line number Diff line
@@ -21,7 +21,8 @@ SRTWeatherStationImpl::SRTWeatherStationImpl(
        m_scheduler.setContainerServices(m_containerServices);
        m_antennaBoss.setComponentName("IDL:alma/Antenna/AntennaBoss:1.0");
        m_antennaBoss.setContainerServices(m_containerServices);
        
        m_mount.setComponentName("IDL:alma/Antenna/SRTMount:1.0");
        m_mount.setContainerServices(m_containerServices);

        
        AUTO_TRACE("SRTWeatherStationImpl::SRTWeatherStationImpl");
@@ -104,7 +105,6 @@ Weather::parameters SRTWeatherStationImpl::getData()throw (ACSErr::ACSbaseExImpl
{
	Weather::parameters mp;
        AUTO_TRACE("SRTWeatherStationImpl::getData");
     	ACS::Time timestamp;

	double temperature;
	double winddir;
@@ -275,7 +275,9 @@ void SRTWeatherStationImpl::initialize() throw (ACSErr::ACSbaseExImpl)

	SRTWeatherSocket *sock;
	try {
		  if 			(CIRATools::getDBValue(getContainerServices(),"IPAddress",ADDRESS) && CIRATools::getDBValue(getContainerServices(),"port",PORT))
		  if 			(CIRATools::getDBValue(getContainerServices(),"IPAddress",ADDRESS) && CIRATools::getDBValue(getContainerServices(),"port",PORT)) &&
                  CIRATools::getDBValue(getContainerServices(),"windthreshold",m_threshold)) &&
                  
		  	  {
			  	  ACS_LOG(LM_FULL_INFO,"SRTWeatherStationImpl::initialize()",(LM_INFO,"IP address %s, Port %d ",(const char *) ADDRESS,PORT));

@@ -341,7 +343,6 @@ void SRTWeatherStationImpl::initialize() throw (ACSErr::ACSbaseExImpl)
		throw x.getComponentErrorsEx();		
	}

	SRTWeatherStationImpl* self_p =this;
        AUTO_TRACE("SRTWeatherStationImpl::initialize");


@@ -441,8 +442,23 @@ SRTWeatherStationImpl::pressure ()
void SRTWeatherStationImpl::parkAntenna()
{

    ACSErr::Completion_var completion;
//     ACS::ROpattern_var property;
    
    Antenna::ROTCommonModes_ptr property;
    
    property=m_mount->elevationMode();

   double status;
   status=property->get_sync(completion);
   if (status !=Antenna::ACU_STOW) 
     {
                  m_scheduler->stopSchedule();
                  m_antennaBoss->park();
     
     }
     
     
   ACS_LOG(LM_FULL_INFO,"SRTWeatherStationImpl::parkAntenna()",(LM_WARNING,"AUTOSTOWING!!!!!!"));
   

+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ CWindCheckerThread::runLoop()
    wdata = m_srtweatherstation_p->getData();
    wind=wdata.wind; // converts wind speed from m/s to km/h
     AUTO_TRACE("WindCheckerThread::runLoop()");
     if (wind > 41){
     if (wind > 0){
     
         m_srtweatherstation_p->parkAntenna();