Commit 7ef19b13 authored by Nicolò Parmiggiani's avatar Nicolò Parmiggiani
Browse files

added sag supervisor

parent e15af945
Loading
Loading
Loading
Loading
Loading
+47 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="ISO-8859-1"?>
<Components  xmlns="urn:schemas-cosylab-com:Components:1.0"
      xmlns:cdb="urn:schemas-cosylab-com:CDB:1.0"
      xmlns:baci="urn:schemas-cosylab-com:BACI:1.0"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

      <e Name="PY_SAGSUPERVISOR"
         Code="SAG_IMPL_MODULE.SAGSupervisorImpl"
         Type="IDL:cta/SAG_SUPERVISOR_MODULE/SAGSupervisor:1.0"
         Container="aragornContainer"
         ImplLang="py"
         Autostart="false" />      

      <!-- Contains an API to send messages in ACS channels -->
      <e Name="PY_SAGNOTIFICATION_MANAGER"
         Code="SAG_IMPL_MODULE.SAGNotificationManagerImpl"
         Type="IDL:cta/SAG_MODULE/SAGNotificationManager:1.0"
         Container="aragornContainer"
         ImplLang="py"
         Autostart="true" />      

      <!-- SAG monitoring component -->
      <e Name="PY_SAGSUBARRAYMONITOR"
         Code="SAG_IMPL_MODULE.SAGSubArrayMonitorImpl"
         Type="IDL:cta/SAG_MODULE/SAGSubArrayMonitor:1.0"
         Container="aragornContainer"
         ImplLang="py"
         Autostart="true" />  

      <!-- Simulating data retrival from a db -->
      <e Name="SIM_SAG_DATABASE" 
         Code="Acssim.Servants.Simulator"
         Type="IDL:cta/SAG_MODULE/SAGDatabase:1.0"
         Container="aragornContainer"
         ImplLang="py"
         Autostart="true" />

      <!-- Simulating communication with the MON subsystem -->
      <e Name="SIM_MONITORING" 
         Code="Acssim.Servants.Simulator"
         Type="IDL:cta/EXTERNAL_MODULE/Monitoring:1.0"
         Container="aragornContainer"
         ImplLang="py"
         Autostart="true" />   
 

</Components>
+36 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="ISO-8859-1"?>
<Manager   xmlns:cdb="urn:schemas-cosylab-com:CDB:1.0" 
           xmlns="urn:schemas-cosylab-com:Manager:1.0" 
           xmlns:log="urn:schemas-cosylab-com:LoggingConfig:1.0"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     Timeout="50.0"
     ClientPingInterval="10.0"
     ContainerPingInterval="10.0"
     AdministratorPingInterval="10.0">
	
	<Startup>
	</Startup>

	<ServiceComponents>
		<cdb:e string="AcsAlarmService" />
		<cdb:e string="ACSLogSvc" />
		<cdb:e string="Log" />
		<cdb:e string="LogFactory" />
		<cdb:e string="NotifyEventChannelFactory" />
		<cdb:e string="MC_NotifyEventChannelFactory" />
		<cdb:e string="LoggingNotifyEventChannelFactory" />
		<cdb:e string="MC_LoggingNotifyEventChannelFactory" />
		<cdb:e string="AlarmNotifyEventChannelFactory" />
		<cdb:e string="MC_AlarmNotifyEventChannelFactory" />
		<cdb:e string="ArchivingChannel@ARCHIVING.channels" />
		<cdb:e string="LoggingChannel@LOGGING.channels" />
		<cdb:e string="AlarmChannel" />
		<cdb:e string="InterfaceRepository" />
		<cdb:e string="CDB" />
	</ServiceComponents>

	<LoggingConfig>
		<log:e Name="jacorb@Manager" minLogLevel="5" minLogLevelLocal="4" />
	</LoggingConfig>

</Manager>
+44 −0
Original line number Diff line number Diff line
<SimulatedComponent xmlns="urn:schemas-cosylab-com:SimulatedComponent:1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <pythonImports>
from time import sleep
from Acspy.Nc.Supplier import Supplier
from Acspy.Nc.Consumer import Consumer
import SAG_CUSTOM_TYPES_MODULE
import SAG_CUSTOM_TYPES_MODULE__POA
    </pythonImports>
    <initialize>
logger=parameters[0].getLogger()
logger.logInfo("SIM_ARRAYDATAHANDLER component initialization")
setGlobalData("logger", logger)

sup = Supplier(SAG_CUSTOM_TYPES_MODULE.CHANNELNAME_ADH)
setGlobalData("sup", sup)

def adh_event_handler(event):
    logger = getGlobalData("logger")
    logger.logInfo("[SIM_ARRAYDATAHANDLER] New message received: " + str(event))
    
con = Consumer(SAG_CUSTOM_TYPES_MODULE.CHANNELNAME_ADH)
con.addSubscription(SAG_CUSTOM_TYPES_MODULE.SAGChannelEvent_TO_ADH, adh_event_handler)
con.consumerReady()
setGlobalData("con", con)
    </initialize>
    <cleanUp>
print('SIM_ARRAYDATAHANDLER component cleaning up')
getGlobalData("sup").disconnect()
    </cleanUp>
    <_corbaMethod Name="simulateDataSend" Timeout="0">
logger = getGlobalData("logger")
logger.logInfo("[SIM_ARRAYDATAHANDLER] simulateDataSend() called!")

sup = getGlobalData("sup")
for i in range(10):
    event = SAG_CUSTOM_TYPES_MODULE.ChannelEvent_FROM_ADH("param1_mon", 888)
    logger.logInfo('SIM_ARRAYDATAHANDLER publishing event..')
    sup.publishEvent(simple_data=event)
    sleep(1)
return True
    </_corbaMethod>


</SimulatedComponent>
 No newline at end of file
+10 −0
Original line number Diff line number Diff line
<SimulatedComponent xmlns="urn:schemas-cosylab-com:SimulatedComponent:1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <pythonImports>
    </pythonImports>
    <initialize>
print('SimCentralControl component initialization')
    </initialize>
    <cleanUp>
print('SimCentralControl component cleaning up')
    </cleanUp>
</SimulatedComponent>
 No newline at end of file
+10 −0
Original line number Diff line number Diff line
<SimulatedComponent xmlns="urn:schemas-cosylab-com:SimulatedComponent:1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <pythonImports>
    </pythonImports>
    <initialize>
print('SimHumanInterface component initialization')
    </initialize>
    <cleanUp>
print('SimHumanInterface component cleaning up')
    </cleanUp>
</SimulatedComponent>
 No newline at end of file
Loading