From ca0e0b5b88dd007aa6c8de4946e45fbcb8056e77 Mon Sep 17 00:00:00 2001 From: aklotz Date: Wed, 14 Apr 2021 13:14:29 +0200 Subject: [PATCH] tests yaml pour la config --- config/config.yml | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ config/minimal_config.txt | 143 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ config/test_yaml.py | 19 +++++++++++++++++++ 3 files changed, 229 insertions(+), 0 deletions(-) create mode 100644 config/config.yml create mode 100644 config/minimal_config.txt create mode 100644 config/test_yaml.py diff --git a/config/config.yml b/config/config.yml new file mode 100644 index 0000000..7b63469 --- /dev/null +++ b/config/config.yml @@ -0,0 +1,67 @@ +OBSERVATORY_1: + _name: TNC + + UNITS: + UNIT_1: + _name: TNC-Telescope + # _Site: (home, ligne d'horizon) + + MOUNT: + _name: TNC-Mount + _components: + - Mount_TM350-Astromecca_sn459.yml + + CHANNELS: + + CHANNEL_1: + _name: TNC-NW + _components: + - Camera_FLIKepler4040_sn123.yml + - Focuser_Optec_sn341.yml + - Optic_TakahashiED180_sn445.yml + + CHANNEL_2: + _name: TNC-NE + + CHANNEL_3: + _name: TNC-SW + + CHANNEL_4: + _name: TNC-SE + + COMPUTERS: + + COMPUTER_1: + _name: PyROS_bdd + _file: Computer_DELL_PowerEdge7000_sn599.yml + _hostname: TNC_PC_DB + database: + name: MySQL + port: 3306 + + COMPUTER_2: + _name: PyROS_principal + _file: Computer_DELL_E6430_sn000.yml + _hostname: TNC_PC1 + _role: Main + agents: + - Majordome: /home/pyros/private/majordome_perso + - Monitoring: ~ + + COMPUTER_3: + _name: PyROS_spare + _file: Computer_DELL_E6430_sn001.yml + _hostname: TNC_PC2 + _role: Spare + _main: TNC_PC1 + agents: + - Majordome: ~ + - Monitoring: ~ + + COMPUTER_4: + _name: PyROS_channel + _file: Computer_DELL_MiniPC_s772.yml + _hostname: TNC_MINIPC_SW + _role: Main + agents: + - Camera: ~ diff --git a/config/minimal_config.txt b/config/minimal_config.txt new file mode 100644 index 0000000..cd04adb --- /dev/null +++ b/config/minimal_config.txt @@ -0,0 +1,143 @@ +================================================ +Assemblage configuration +Commande à placer par exemple dans /etc/rc.local + +nohup python3 pyros -c assembly.xml & + +nohup python3 pyros -c pyros_plugins/assembly_TNC.xml & + +pyros_plugins est un dossier vide versionné +------------------------------------------------ + +assembly_TNC.xml + +OBSERVATORY_1: + _name: TNC + + UNITS: + UNIT_1: + _name: TNC-Telescope + # _Site: (home, ligne d'horizon) + + MOUNT: + _name: TNC-Mount + _components: + - Mount_TM350-Astromecca_sn459.yml + + CHANNELS: + + CHANNEL_1: + _name: TNC-NW + _components: + - Camera_FLIKepler4040_sn123.yml + - Focuser_Optec_sn341.yml + - Optic_TakahashiED180_sn445.yml + + CHANNEL_2: + _name: TNC-NE + + CHANNEL_3: + _name: TNC-SW + + CHANNEL_4: + _name: TNC-SE + + COMPUTERS: + + COMPUTER_1: + _name: PyROS_bdd + _file: Computer_DELL_PowerEdge7000_sn599.yml + _hostname: TNC_PC_DB + database: + name: MySQL + port: 3306 + + COMPUTER_2: + _name: PyROS_principal + _file: Computer_DELL_E6430_sn000.yml + _hostname: TNC_PC1 + _role: Main + agents: + - Majordome: /home/pyros/private/majordome_perso + - Monitoring: ~ + + COMPUTER_3: + _name: PyROS_spare + _file: Computer_DELL_E6430_sn001.yml + _hostname: TNC_PC2 + _role: Spare + _main: TNC_PC1 + agents: + - Majordome: ~ + - Monitoring: ~ + + COMPUTER_4: PyROS_channel + _file: Computer_DELL_MiniPC_s772.yml + _hostname: TNC_MINIPC_SW + _role: Main + agents: + - Camera: ~ + + Reste à décrire, UPS, router, VPN (dans monitoring ?) + +================================================ +LISTE DE HARDWARE Disponible dans l'observatoire +------------------------------------------------ + +Computer_DELL_MiniPC_s772.xml + _serialNumber + _tag_dell + _macaddress: 23:e5:67:ee:a2:11 + +Computer_DELL_PowerEdge7000_sn599.xml + _serialNumber + _tag_dell + _macaddress: 23:e5:67:ee:a2:34 + +Computer_DELL_E6430_sn000.xml + _serialNumber + _tag_dell + _macaddress: 23:e5:67:ee:a2:33 + +Computer_DELL_E6430_sn001.xml + _serialNumber + _tag_dell + _macaddress: 23:e5:67:ee:a2:35 + +Mount_TM350-Astromecca_sn459.xml + _serialNumber + _communication_transport: Serial + _communication_langage: MCS + MountPointing + Type: HADEC + +Camera_FLIKepler4040_sn123.xml + _serialNumber + _communication_transport: USB + _communication_langage: FLIPro library + _input: photons + _output: image + DetectorSensor + DetectorShutter + DetectorTimer + +Focuser_Optec_sn341.xml + _SerialNumber + DetectorFocus + +Optic_TakahashiED180_sn445.xml + _SerialNumber + Optic + +Filterwheel_FLI_sn57345.xml + _SerialNumber + FilterSelector + + + + + + + + + \ No newline at end of file diff --git a/config/test_yaml.py b/config/test_yaml.py new file mode 100644 index 0000000..68e9545 --- /dev/null +++ b/config/test_yaml.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +""" +Spyder Editor + +This is a temporary script file. +""" +import yaml + +with open("C:/srv/develop/pyros/config/config.yml", 'r') as stream: + try: + a = yaml.safe_load(stream) + print(a) + except yaml.YAMLError as exc: + print(exc) + +# Write YAML file +with open('C:/srv/develop/pyros/config/config2.yml', 'w', encoding='utf8') as outfile: + yaml.dump(a, outfile, default_flow_style=False, allow_unicode=True) + -- libgit2 0.21.2