Commit ec751594 authored by Sergio Poppi's avatar Sergio Poppi
Browse files

PyWeatherStation Skeleton

parent b43496e5
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
"@(#) $Id$"
+23 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="ISO-8859-1"?>
<xs:schema xmlns="urn:schemas-cosylab-com:WeatherStation: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" targetNamespace="urn:schemas-cosylab-com:WeatherStation: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:complexType name="WeatherStationType">
        <xs:sequence>
      			<xs:element name="temperature" type="baci:RWdouble"/>
		  			<xs:element name="winddir" type="baci:RWdouble"/>
		  			<xs:element name="windspeed" type="baci:RWdouble"/>
					<xs:element name="windspeedpeak" type="baci:RWdouble"/>
		  			<xs:element name="humidity" type="baci:RWdouble"/>
		  			<xs:element name="pressure" type="baci:RWdouble"/>
		  			
		    </xs:sequence>
        <xs:attribute name="IPAddress" type="xs:string" use="required"/>
	       <xs:attribute name="port" type="xs:unsignedInt" use="required"/>
        <xs:attribute name="windthreshold" type="xs:unsignedInt" use="optional"/>
  
  	</xs:complexType>
  
  	<xs:element name="WeatherStation" type="WeatherStationType"/>
</xs:schema>
+25 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="ISO-8859-1"?>
<xs:schema xmlns="urn:schemas-cosylab-com:WeatherStationData: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" targetNamespace="urn:schemas-cosylab-com:WeatherStation: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:complexType name="WeatherStationDataType">
        <xs:sequence>
      			<xs:element name="temperature" type="baci:RWdouble"/>
		  			<xs:element name="winddir" type="baci:RWdouble"/>
		  			<xs:element name="windspeed" type="baci:RWdouble"/>
					<xs:element name="windspeedpeak" type="baci:RWdouble"/>
		  			<xs:element name="humidity" type="baci:RWdouble"/>
		  			<xs:element name="pressure" type="baci:RWdouble"/>
		  			<xs:element name="sensor" type="xs:string" minOccurs="1"                   maxOccurs="unbounded" />
                                        	    
 		  	 	  	
        </xs:sequence>
        <xs:attribute name="IPAddress" type="xs:string" use="required"/>
	       <xs:attribute name="port" type="xs:unsignedInt" use="required"/>
        <xs:attribute name="windthreshold" type="xs:unsignedInt" use="optional"/>
  
  	</xs:complexType>
  
  	<xs:element name="WeatherStationData" type="WeatherStationDataType"/>
</xs:schema>
+207 −0
Original line number Diff line number Diff line
#*******************************************************************************
# PPPPPPPP
#
# "@(#) $Id$"
#
# Makefile of ........
#
# who       when      what
# --------  --------  ----------------------------------------------
# spoppi  09/03/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   = 

#
# <brief description of xxxxx program>
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     =

#
# <brief description of lllll library>
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	   =

#
# <brief description of tttttt tcl-script>
tttttt_OBJECTS  =
tttttt_TCLSH    = 
tttttt_LIBS     = 

#
# TCL libraries (public and local)
# ------------------------------
TCL_LIBRARIES   =
TCL_LIBRARIES_L =

#
# <brief description of tttlll library>
tttlll_OBJECTS  = 

#
# Configuration Database Files
# ----------------------------
CDB_SCHEMAS = 

# 
# IDL Files and flags
# 
IDL_FILES =
TAO_IDLFLAGS =
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___
+64 −0
Original line number Diff line number Diff line
#! /usr/bin/env python


import time
from math import radians
import Receivers__POA
from Acspy.Servants.CharacteristicComponent import CharacteristicComponent
from Acspy.Servants.ContainerServices import ContainerServices 
from Acspy.Servants.ComponentLifecycle import ComponentLifecycle 
from Acspy.Util.BaciHelper import addProperty
from Acspy.Clients.SimpleClient import PySimpleClient
from Acspy.Nc.Supplier import Supplier
from Acspy.Common.TimeHelper import getTimeStamp
from maciErrType import CannotGetComponentEx
from ACSErrTypeCommonImpl import CORBAProblemExImpl
from LocalOscillatorImpl.devios import amplitudeDevIO,frequencyDevIO,isLockedDevIO
import Acspy.Util.ACSCorba

import Receivers
import ComponentErrorsImpl
import ComponentErrors
 
from LocalOscillatorImpl import CommandLine
from IRAPy import logger


class WeatherStation (Weather__POA.LocalOscillator, CharacteristicComponent, ContainerServices, ComponentLifecycle):

       def __init__(self):
          pass
       def cleanUp(self):
          pass


       def initialize(self): 
           addProperty(self, 'temperature')
           
           addProperty(self, 'winddir')
           addProperty(self, 'pressure')
           addProperty(self, 'pressure')


       def getData(self):
            pass
       def getWindSpeedAverage(self):

            pass
       def getWindspeedPeak(self):

            pass
       def getWindDir(self):
            
            pass

       def getHumidity(self):
            pass
       

       def getPressure(self):

            pass
 

       
Loading