diff --git a/GenDevice/createEmptyCDB.py b/GenDevice/createEmptyCDB.py index b528224c1dfb41f5cdb996fdcc0a17590d95abf9..e2122738d83f7baa6011899d308f98ed4c611aa0 100755 --- a/GenDevice/createEmptyCDB.py +++ b/GenDevice/createEmptyCDB.py @@ -103,13 +103,18 @@ def createCBDBaseDir(dirname): def createCDBDirs(): basedir=os.environ["ACS_CDB"] - templatedir=os.environ["PYGEN"]+"/templates/Alarms" + templatedir=os.environ["PYGEN"]+ "/templates/CDB" #/templates/Alarms" print (basedir) if basedir=="": print ("ACS_CDB variable is not defined") return False else: - almadir = basedir+"/CDB/alma" + alarmdir=basedir+"/CDB" #"/CDB/Alarms" + if os.path.exists(alarmdir): + print ("dir:",alarmdir," already exists") + else: + shutil.copytree(templatedir,alarmdir) + """almadir = basedir+"/CDB/alma" if createDir(almadir): srt="directory:"+almadir+" created" print (srt) @@ -130,12 +135,8 @@ def createCDBDirs(): if createDir(managerdir): print ("directory:"+managerdir+" created") else: - print ("error creting directory:"+managerdir) - alarmdir=basedir+"/CDB/Alarms" - if os.path.exists(alarmdir): - print ("dir:",alarmdir," already exists") - else: - shutil.copytree(templatedir,alarmdir) + print ("error creting directory:"+managerdir)""" + def createManagerXml(): basedir=os.environ["ACS_CDB"] managerdir = basedir+"/CDB/MACI/Managers/Manager" diff --git a/templates/CDB/Alarms/Administrative/AlarmSystemConfiguration/AlarmSystemConfiguration.xml b/templates/CDB/Alarms/Administrative/AlarmSystemConfiguration/AlarmSystemConfiguration.xml new file mode 100755 index 0000000000000000000000000000000000000000..92b045a0b8c5e262dc4d201aa583326089492cc8 --- /dev/null +++ b/templates/CDB/Alarms/Administrative/AlarmSystemConfiguration/AlarmSystemConfiguration.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> + +<alarm-system-configuration + xmlns="urn:schemas-cosylab-com:acsalarm-alarmservice:1.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + + + <configuration-property name="Implementation">CERN</configuration-property> +</alarm-system-configuration> + diff --git a/templates/CDB/Alarms/Administrative/Categories/Categories.xml b/templates/CDB/Alarms/Administrative/Categories/Categories.xml new file mode 100755 index 0000000000000000000000000000000000000000..a6669001c21ccb4c7f9d072c896dca8435c55c2b --- /dev/null +++ b/templates/CDB/Alarms/Administrative/Categories/Categories.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<categories + xmlns="urn:schemas-cosylab-com:acsalarm-categories:1.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <category is-default="true" path="CATEGORY1"> + <description>Test category 1</description> + <alarms> + <FaultFamily>BaciPropTest#testDoubleVar</FaultFamily> + <FaultFamily>BaciPropTest#testPatternVar</FaultFamily> + <FaultFamily>TestFF</FaultFamily> + <FaultFamily>AnotherFF</FaultFamily> + </alarms> + </category> +</categories> diff --git a/templates/CDB/Alarms/Administrative/ReductionDefinitions/ReductionDefinitions.xml b/templates/CDB/Alarms/Administrative/ReductionDefinitions/ReductionDefinitions.xml new file mode 100755 index 0000000000000000000000000000000000000000..5b74d69d50f3898efeeb99d084d9c775049d5ea4 --- /dev/null +++ b/templates/CDB/Alarms/Administrative/ReductionDefinitions/ReductionDefinitions.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!-- + - Sample configuration of alarm reduction links. + --> +<reduction-definitions + xmlns="urn:schemas-cosylab-com:AcsAlarmSystem:1.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + +<!-- + <links-to-create/> + + <thresholds/> +--> + +</reduction-definitions> + diff --git a/templates/CDB/Alarms/AlarmDefinitions/.DS_Store b/templates/CDB/Alarms/AlarmDefinitions/.DS_Store new file mode 100755 index 0000000000000000000000000000000000000000..2403ba9c27a33ce820d120fe327b552f6125d28f Binary files /dev/null and b/templates/CDB/Alarms/AlarmDefinitions/.DS_Store differ diff --git a/templates/CDB/Alarms/AlarmDefinitions/BACIProperty/BACIProperty.xml b/templates/CDB/Alarms/AlarmDefinitions/BACIProperty/BACIProperty.xml new file mode 100755 index 0000000000000000000000000000000000000000..3dd557102d426bb0a5020094b568563123cfe92d --- /dev/null +++ b/templates/CDB/Alarms/AlarmDefinitions/BACIProperty/BACIProperty.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<fault-family name="BACIProperty" + xmlns="urn:schemas-cosylab-com:acsalarm-fault-family:1.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > + <alarm-source>ALARM_SYSTEM_SOURCES</alarm-source> + <help-url>http://tempuri.org</help-url> + <contact name="Test"/> + <fault-code value="1"> + <priority>1</priority> + <problem-description>BACI property</problem-description> + </fault-code> + <fault-code value="2"> + <priority>1</priority> + <problem-description>BACI property (LOW)</problem-description> + </fault-code> + <fault-code value="3"> + <priority>1</priority> + <problem-description>BACI property (HIGH)</problem-description> + </fault-code> + <fault-member-default> + </fault-member-default> +</fault-family> diff --git a/templates/CDB/Alarms/AlarmDefinitions/BaciPropTest#testDoubleVar/BaciPropTest#testDoubleVar.xml b/templates/CDB/Alarms/AlarmDefinitions/BaciPropTest#testDoubleVar/BaciPropTest#testDoubleVar.xml new file mode 100755 index 0000000000000000000000000000000000000000..6c3c4684dc4a5287ea3add853099bfff50192edd --- /dev/null +++ b/templates/CDB/Alarms/AlarmDefinitions/BaciPropTest#testDoubleVar/BaciPropTest#testDoubleVar.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<fault-family name="BaciPropTest#testDoubleVar" + xmlns="urn:schemas-cosylab-com:acsalarm-fault-family:1.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > + <alarm-source>ALARM_SYSTEM_SOURCES</alarm-source> + <help-url>http://tempuri.org</help-url> + <contact name="Test"/> + <fault-code value="1"> + <priority>1</priority> + <problem-description>BACI property</problem-description> + </fault-code> + <fault-code value="2"> + <priority>1</priority> + <problem-description>BACI property (LOW)</problem-description> + </fault-code> + <fault-code value="3"> + <priority>1</priority> + <problem-description>BACI property (HIGH)</problem-description> + </fault-code> + <fault-member-default> + </fault-member-default> +</fault-family> diff --git a/templates/CDB/Alarms/AlarmDefinitions/BaciPropTest#testEnumVar/BaciPropTest#testEnumVar.xml b/templates/CDB/Alarms/AlarmDefinitions/BaciPropTest#testEnumVar/BaciPropTest#testEnumVar.xml new file mode 100755 index 0000000000000000000000000000000000000000..2515b9e8a112637878827569239ea49e72579c01 --- /dev/null +++ b/templates/CDB/Alarms/AlarmDefinitions/BaciPropTest#testEnumVar/BaciPropTest#testEnumVar.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<fault-family name="BaciPropTest#testEnumVar" + xmlns="urn:schemas-cosylab-com:acsalarm-fault-family:1.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > + <alarm-source>ALARM_SYSTEM_SOURCES</alarm-source> + <help-url>http://tempuri.org</help-url> + <contact name="Test"/> + <fault-code value="1"> + <priority>1</priority> + <problem-description>BACI property</problem-description> + </fault-code> + <fault-code value="2"> + <priority>1</priority> + <problem-description>BACI property (LOW)</problem-description> + </fault-code> + <fault-code value="3"> + <priority>1</priority> + <problem-description>BACI property (HIGH)</problem-description> + </fault-code> + <fault-member-default> + </fault-member-default> +</fault-family> diff --git a/templates/CDB/Alarms/AlarmDefinitions/BaciPropTest#testPatternVar/BaciPropTest#testPatternVar.xml b/templates/CDB/Alarms/AlarmDefinitions/BaciPropTest#testPatternVar/BaciPropTest#testPatternVar.xml new file mode 100755 index 0000000000000000000000000000000000000000..600a981863ae2e686304f7b079abf824210d6cd8 --- /dev/null +++ b/templates/CDB/Alarms/AlarmDefinitions/BaciPropTest#testPatternVar/BaciPropTest#testPatternVar.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<fault-family name="BaciPropTest#testPatternVar" + xmlns="urn:schemas-cosylab-com:acsalarm-fault-family:1.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > + <alarm-source>ALARM_SYSTEM_SOURCES</alarm-source> + <help-url>http://tempuri.org</help-url> + <contact name="Test"/> + <fault-code value="1"> + <priority>1</priority> + <problem-description>BACI property</problem-description> + </fault-code> + <fault-code value="2"> + <priority>1</priority> + <problem-description>BACI property (LOW)</problem-description> + </fault-code> + <fault-code value="3"> + <priority>1</priority> + <problem-description>BACI property (HIGH)</problem-description> + </fault-code> + <fault-member-default> + </fault-member-default> +</fault-family> diff --git a/templates/CDB/Alarms/AlarmDefinitions/DPSInterface/DPSInterface b/templates/CDB/Alarms/AlarmDefinitions/DPSInterface/DPSInterface new file mode 100755 index 0000000000000000000000000000000000000000..232a83fd6b6e823e67676737d699a6f027ee68fa --- /dev/null +++ b/templates/CDB/Alarms/AlarmDefinitions/DPSInterface/DPSInterface @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<fault-family name="DPSInterface" + xmlns="urn:schemas-cosylab-com:acsalarm-fault-family:1.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > + <alarm-source>ALARM_SYSTEM_SOURCES</alarm-source> + <help-url>http://tempuri.org</help-url> + <contact name="Vito" /> + <fault-code value="1"> + <priority>1</priority> + <problem-description>BACI property with aanother FF, FM</problem-description> + </fault-code> + <fault-code value="2"> + <priority>1</priority> + <problem-description>BACI property with a another FF, FM (LOW)</problem-description> + </fault-code> + <fault-code value="3"> + <priority>1</priority> + <problem-description>BACI property with a another FF, FM (HIGH)</problem-description> + </fault-code> + <fault-member-default> + </fault-member-default> +</fault-family> diff --git a/templates/CDB/Alarms/AlarmDefinitions/Manager/Manager.xml b/templates/CDB/Alarms/AlarmDefinitions/Manager/Manager.xml new file mode 100755 index 0000000000000000000000000000000000000000..0a392323f90ff53286e8b83ee724d3b350df3e41 --- /dev/null +++ b/templates/CDB/Alarms/AlarmDefinitions/Manager/Manager.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<fault-family name="Manager" xmlns="urn:schemas-cosylab-com:acsalarm-fault-family:1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <alarm-source>ALARM_SYSTEM_SOURCES</alarm-source> + <help-url>http://tempuri.org</help-url> + <contact name="Alessandro Caproni"/> + + <fault-code value="1"> + <priority>3</priority> + <problem-description>Container crashed</problem-description> + </fault-code> + + <fault-code value="2"> + <priority>2</priority> + <problem-description>Filesystem error affecting manager state recovery after restart.</problem-description> + </fault-code> + + <!-- Having a default fault member is necessary for alarms on container/client crashes (FC=1), + because for these the manager uses FM=<clientName> which cannot be configured statically. + --> + <fault-member-default/> + + <fault-member name="Prevayler"/> + +</fault-family> diff --git a/templates/CDB/Alarms/AlarmDefinitions/TestFF/TestFF.xml b/templates/CDB/Alarms/AlarmDefinitions/TestFF/TestFF.xml new file mode 100755 index 0000000000000000000000000000000000000000..9856e2fb0d82f7734dbe13dc7f1b9ce31eaad45a --- /dev/null +++ b/templates/CDB/Alarms/AlarmDefinitions/TestFF/TestFF.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<fault-family name="TestFF" + xmlns="urn:schemas-cosylab-com:acsalarm-fault-family:1.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > + <alarm-source>ALARM_SYSTEM_SOURCES</alarm-source> + <help-url>http://tempuri.org</help-url> + <contact name="ACS developer"/> + <fault-code value="1"> + <priority>1</priority> + <problem-description>BACI property with a new FF, FM</problem-description> + </fault-code> + <fault-code value="2"> + <priority>1</priority> + <problem-description>BACI property with a new FF, FM (LOW)</problem-description> + </fault-code> + <fault-code value="3"> + <priority>1</priority> + <problem-description>BACI property with a new FF, FM (HIGH)</problem-description> + </fault-code> + <fault-member-default> + </fault-member-default> +</fault-family> diff --git a/templates/CDB/MACI/Components/ARCHIVE/TMCDB/MONITOR_BLOBBER/MONITOR_BLOBBER.xml b/templates/CDB/MACI/Components/ARCHIVE/TMCDB/MONITOR_BLOBBER/MONITOR_BLOBBER.xml new file mode 100755 index 0000000000000000000000000000000000000000..6aff1044031a44a3b18eb5b5404a0a8eba7f6c8f --- /dev/null +++ b/templates/CDB/MACI/Components/ARCHIVE/TMCDB/MONITOR_BLOBBER/MONITOR_BLOBBER.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?> +<Component xmlns="urn:schemas-cosylab-com:Component: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" + Name="ARCHIVE/TMCDB/MONITOR_BLOBBER" + Code="alma.acs.monitoring.blobber.BlobberHelper" + Type="IDL:alma/MonitorArchiver/Blobber:1.0" + Container="monColTestCont" + Default="true" + ImplLang="java" /> + + diff --git a/templates/CDB/MACI/Components/ARCHIVE/TMCDB/MONITOR_CONTROL/MONITOR_CONTROL.xml b/templates/CDB/MACI/Components/ARCHIVE/TMCDB/MONITOR_CONTROL/MONITOR_CONTROL.xml new file mode 100755 index 0000000000000000000000000000000000000000..07dd4c180c93447fcac9e437509f9b7b3f1c4ca8 --- /dev/null +++ b/templates/CDB/MACI/Components/ARCHIVE/TMCDB/MONITOR_CONTROL/MONITOR_CONTROL.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8"?> +<Component xmlns="urn:schemas-cosylab-com:Component: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" + Name="ARCHIVE/TMCDB/MONITOR_CONTROL" + Code="alma.acs.monitoring.controller.ControllerHelper" + Type="IDL:alma/MonitorArchiver/Controller:1.0" + Container="monColTestCont" + Default="true" + Autostart="true" + ImplLang="java" /> + + diff --git a/templates/CDB/MACI/Components/Components.xml b/templates/CDB/MACI/Components/Components.xml new file mode 100755 index 0000000000000000000000000000000000000000..be4a2d8fb4a9211ded099f2759bf1494d7ced840 --- /dev/null +++ b/templates/CDB/MACI/Components/Components.xml @@ -0,0 +1,13 @@ +<?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="MONITOR_COLLECTOR_TEST" + Code="MonitorCollector" + Type="IDL:alma/TMCDB/MonitorCollector:1.0" + ImplLang="cpp" + Container="bilboContainer" /> +</Components> + + diff --git a/templates/CDB/MACI/Containers/bilboContainer/bilboContainer.xml b/templates/CDB/MACI/Containers/bilboContainer/bilboContainer.xml new file mode 100755 index 0000000000000000000000000000000000000000..8135cea662378ab25449713d06cf6c10afc0fe16 --- /dev/null +++ b/templates/CDB/MACI/Containers/bilboContainer/bilboContainer.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<Container xmlns="urn:schemas-cosylab-com:Container: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" + xmlns:log="urn:schemas-cosylab-com:LoggingConfig:1.0" + Timeout="20.0" + UseIFR="1" + ManagerRetry="10" + ImplLang="cpp"> + <Autoload> + <cdb:e string="baci" /> + </Autoload> + <LoggingConfig + centralizedLogger="Log" + minLogLevel="2" + dispatchPacketSize="0" + immediateDispatchLevel="99"> + </LoggingConfig> +</Container> + + + + diff --git a/templates/CDB/MACI/Containers/frodoContainer/frodoContainer.xml b/templates/CDB/MACI/Containers/frodoContainer/frodoContainer.xml new file mode 100644 index 0000000000000000000000000000000000000000..4f775714e2e7ffac47a5ab6133c8784208fd9a4a --- /dev/null +++ b/templates/CDB/MACI/Containers/frodoContainer/frodoContainer.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<Container + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns="urn:schemas-cosylab-com:Container:1.0" + xmlns:log="urn:schemas-cosylab-com:LoggingConfig:1.0" + ImplLang="java" + ServerThreads="99" + > + + <Autoload> + </Autoload> + + <LoggingConfig + centralizedLogger="Log" + minLogLevel="4" + dispatchPacketSize="10" + immediateDispatchLevel="99"> + <log:e Name="jacorb@frodoContainer" + minLogLevel="8" minLogLevelLocal="8" /> + <log:e Name="UnknownSlf4j@frodoContainer" + minLogLevel="8" minLogLevelLocal="8" /> + </LoggingConfig> + +</Container> + \ No newline at end of file diff --git a/templates/CDB/MACI/Containers/monColTestCont/monColTestCont.xml b/templates/CDB/MACI/Containers/monColTestCont/monColTestCont.xml new file mode 100755 index 0000000000000000000000000000000000000000..cab7aadc457a9fc7b2b119153792469cbb7311f0 --- /dev/null +++ b/templates/CDB/MACI/Containers/monColTestCont/monColTestCont.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> + +<Container + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns="urn:schemas-cosylab-com:Container:1.0" + xmlns:log="urn:schemas-cosylab-com:LoggingConfig:1.0" + ImplLang="java" + > + + <Autoload> + </Autoload> + + <LoggingConfig minLogLevel="2" minLogLevelLocal="2"> + <log:e Name="jacorb@frodoContainer" minLogLevel="5" minLogLevelLocal="5" /> + </LoggingConfig> + +</Container> + diff --git a/templates/CDB/MACI/Managers/Manager/Manager.xml b/templates/CDB/MACI/Managers/Manager/Manager.xml new file mode 100644 index 0000000000000000000000000000000000000000..d06f6e2998d7ccc3e2f84df0f94d686e942c7f9a --- /dev/null +++ b/templates/CDB/MACI/Managers/Manager/Manager.xml @@ -0,0 +1,37 @@ +<?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> + \ No newline at end of file diff --git a/templates/minserver.tmpl b/templates/minserver.tmpl index 72d2c7ce0e9a8658ca1b91038febd235d90fb702..4e9cb70139eaa4519a70526c34595c753d08eed2 100644 --- a/templates/minserver.tmpl +++ b/templates/minserver.tmpl @@ -75,6 +75,10 @@ class VarUpdater(Thread): v.set_value(v.get_value()+random.uniform(-5,5)) else: v.set_value(random.uniform(-5,5)) + if ty==ua.VariantType.Int16: + v.set_value(random.randint(0,8),ua.VariantType.Int16) + if ty==ua.VariantType.Int32: + v.set_value(random.randint(0,8),ua.VariantType.Int32) time.sleep(2)