Commit 40d27b85b965a1945c20a203514ba6a54c055120
1 parent
ad3b297c
Exists in
dev
Add 'inventory' section to observatory configuration
Showing
9 changed files
with
311 additions
and
290 deletions
Show diff stats
CHANGELOG
1 | +07-02-2022 (AKo) : v0.3.5.0 | |
2 | + - Adding INVENTORY section to observatory configuration | |
3 | + - Logout now redirect to home page | |
4 | + | |
1 | 5 | 04-02-2022 (AKo) : v0.3.4.0 |
2 | 6 | - Adding VERSION file reading to get version number |
3 | 7 | - Adding configpyros class and renaming previous ConfigPyros class to obsconfig to avoid confusion | ... | ... |
VERSION
config/schemas/schema_observatory-2.0.yml
1 | +schema;schema_INVENTORY: | |
2 | + required: True | |
3 | + type: map | |
4 | + mapping: | |
5 | + COMPUTERS: | |
6 | + include: schema_COMPUTERS | |
7 | + DEVICES: | |
8 | + include: schema_DEVICES | |
9 | + | |
1 | 10 | schema;schema_DATABASE: |
2 | 11 | required: True |
3 | 12 | type: map |
... | ... | @@ -268,10 +277,8 @@ schema;schema_OBSERVATORY: |
268 | 277 | name: |
269 | 278 | type: str |
270 | 279 | required: True |
271 | - DEVICES: | |
272 | - include: schema_DEVICES | |
273 | - COMPUTERS: | |
274 | - include: schema_COMPUTERS | |
280 | + INVENTORY: | |
281 | + include: schema_INVENTORY | |
275 | 282 | UNITS: |
276 | 283 | include: schema_UNITS |
277 | 284 | ... | ... |
privatedev/config/guitalens/observatory_guitalens.yml
... | ... | @@ -5,70 +5,72 @@ schema: schema_observatory-2.0.yml |
5 | 5 | OBSERVATORY: |
6 | 6 | |
7 | 7 | name: Guitalens |
8 | + | |
9 | + INVENTORY: | |
8 | 10 | |
9 | - # === Inventory of available devices | |
10 | - # A device is a hardware with a maximum of one connection to drive it with a computer. | |
11 | - # As a device can be shared with various units, it is defined at the observatory level. | |
12 | - DEVICES: | |
13 | - | |
14 | - # Each device is defined by a specific configuration file that enumerate the components. | |
11 | + # === Inventory of available devices | |
12 | + # A device is a hardware with a maximum of one connection to drive it with a computer. | |
13 | + # As a device can be shared with various units, it is defined at the observatory level. | |
14 | + DEVICES: | |
15 | 15 | |
16 | - - DEVICE: | |
17 | - name: AstroMecCA_TM350 | |
18 | - file: device_Astromecca_TM350_sn001.yml | |
19 | - | |
20 | - - DEVICE: | |
21 | - name: PLC_meteo | |
22 | - file: device_Raspberry_MiFe_sn004.yml | |
23 | - # Describe here the configuration of the device in operation | |
24 | - network_interface_index: 0 | |
25 | - network_ip: 192.168.0.2 | |
26 | - | |
27 | - - DEVICE: | |
28 | - name: SkyWatcher_ED80 | |
29 | - file: device_SkyWatcher_ED80_snxx1.yml | |
30 | - | |
31 | - - DEVICE: | |
32 | - name: Celestron_C11 | |
33 | - file: device_Celestron_C11_sn974234.yml | |
34 | - | |
35 | - - DEVICE: | |
36 | - name: ZWO_ASI1600MMPro | |
37 | - file: device_ZWO_ASI1600MMPro_sn91C0f0405080900.yml | |
38 | - | |
39 | - - DEVICE: | |
40 | - name: FLI_Kepler4040 | |
41 | - file: device_FLI_Kepler4040_sn2821221.yml | |
42 | - | |
43 | - - DEVICE: | |
44 | - name: FLI_KeplerGPS | |
45 | - file: device_FLI_KITS_sn0x1.yml | |
16 | + # Each device is defined by a specific configuration file that enumerate the components. | |
46 | 17 | |
18 | + - DEVICE: | |
19 | + name: AstroMecCA_TM350 | |
20 | + file: device_Astromecca_TM350_sn001.yml | |
21 | + | |
22 | + - DEVICE: | |
23 | + name: PLC_meteo | |
24 | + file: device_Raspberry_MiFe_sn004.yml | |
25 | + # Describe here the configuration of the device in operation | |
26 | + network_interface_index: 0 | |
27 | + network_ip: 192.168.0.2 | |
28 | + | |
29 | + - DEVICE: | |
30 | + name: SkyWatcher_ED80 | |
31 | + file: device_SkyWatcher_ED80_snxx1.yml | |
32 | + | |
33 | + - DEVICE: | |
34 | + name: Celestron_C11 | |
35 | + file: device_Celestron_C11_sn974234.yml | |
36 | + | |
37 | + - DEVICE: | |
38 | + name: ZWO_ASI1600MMPro | |
39 | + file: device_ZWO_ASI1600MMPro_sn91C0f0405080900.yml | |
40 | + | |
41 | + - DEVICE: | |
42 | + name: FLI_Kepler4040 | |
43 | + file: device_FLI_Kepler4040_sn2821221.yml | |
44 | + | |
45 | + - DEVICE: | |
46 | + name: FLI_KeplerGPS | |
47 | + file: device_FLI_KITS_sn0x1.yml | |
48 | + | |
47 | 49 | |
48 | - # === Inventory of available computers | |
49 | - # A computer is a hardware of a virtual machine. | |
50 | - # As a computer can be shared with various units, it is defined at the observatory level. | |
51 | - COMPUTERS: | |
52 | - | |
53 | - - COMPUTER: | |
54 | - name: MainComputer | |
55 | - file: computer_XCY_X26A_snAA478.yml | |
56 | - # Describe here the configuration of the computer in operation | |
57 | - role: Main | |
58 | - # Choice of the interface to connect the computer to the network (cf.network_interfaces infile) | |
59 | - network_interface_index: 0 | |
60 | - # IP attributed by the Router | |
61 | - network_ip: 192.168.0.11 | |
50 | + # === Inventory of available computers | |
51 | + # A computer is a hardware of a virtual machine. | |
52 | + # As a computer can be shared with various units, it is defined at the observatory level. | |
53 | + COMPUTERS: | |
54 | + | |
55 | + - COMPUTER: | |
56 | + name: MainComputer | |
57 | + file: computer_XCY_X26A_snAA478.yml | |
58 | + # Describe here the configuration of the computer in operation | |
59 | + role: Main | |
60 | + # Choice of the interface to connect the computer to the network (cf.network_interfaces infile) | |
61 | + network_interface_index: 0 | |
62 | + # IP attributed by the Router | |
63 | + network_ip: 192.168.0.11 | |
62 | 64 | |
63 | - - COMPUTER: | |
64 | - name: EtienneComputer | |
65 | - file: computer_XYZ_EP.yml | |
66 | - # Describe here the configuration of the computer in operation | |
67 | - role: Main | |
68 | - # Choice of the interface to connect the computer to the network (cf.network_interfaces infile) | |
69 | - network_interface_index: 0 | |
70 | - # IP attributed by the Router | |
71 | - network_ip: 192.168.0.11 | |
65 | + - COMPUTER: | |
66 | + name: EtienneComputer | |
67 | + file: computer_XYZ_EP.yml | |
68 | + # Describe here the configuration of the computer in operation | |
69 | + role: Main | |
70 | + # Choice of the interface to connect the computer to the network (cf.network_interfaces infile) | |
71 | + network_interface_index: 0 | |
72 | + # IP attributed by the Router | |
73 | + network_ip: 192.168.0.11 | |
72 | 74 | |
73 | 75 | |
74 | 76 | # === Assembly of devices into units | ... | ... |
privatedev/config/tnc/observatory_tnc.yml
... | ... | @@ -5,112 +5,114 @@ schema: schema_observatory-2.0.yml |
5 | 5 | OBSERVATORY: |
6 | 6 | |
7 | 7 | name: TNC |
8 | + | |
9 | + INVENTORY: | |
8 | 10 | |
9 | - # === Inventory of available devices | |
10 | - # A device is a hardware with a maximum of one connection to drive it with a computer. | |
11 | - # As a device can be shared with various units, it is defined at the observatory level. | |
12 | - DEVICES: | |
13 | - | |
14 | - # Each device is defined by a specific configuration file that enumarate the components. | |
11 | + # === Inventory of available devices | |
12 | + # A device is a hardware with a maximum of one connection to drive it with a computer. | |
13 | + # As a device can be shared with various units, it is defined at the observatory level. | |
14 | + DEVICES: | |
15 | 15 | |
16 | - - DEVICE: | |
17 | - name: AstroMecCA_TM350 | |
18 | - file: device_Astromecca_TM350_sn011.yml | |
16 | + # Each device is defined by a specific configuration file that enumarate the components. | |
19 | 17 | |
20 | - - DEVICE: | |
21 | - name: TAROT_meteo | |
22 | - file: device_Raspberry_TAROT_sn002.yml | |
23 | - # Describe here the configuration of the device in operation | |
24 | - network_interface_index: 0 | |
25 | - network_ip: 192.168.0.20 | |
18 | + - DEVICE: | |
19 | + name: AstroMecCA_TM350 | |
20 | + file: device_Astromecca_TM350_sn011.yml | |
21 | + | |
22 | + - DEVICE: | |
23 | + name: TAROT_meteo | |
24 | + file: device_Raspberry_TAROT_sn002.yml | |
25 | + # Describe here the configuration of the device in operation | |
26 | + network_interface_index: 0 | |
27 | + network_ip: 192.168.0.20 | |
26 | 28 | |
27 | - - DEVICE: | |
28 | - name: AstroMecaCA_CS100 # roof of the observatory | |
29 | - file: device_Astromecca_CS100_sn001.yml | |
30 | - # Describe here the configuration of the device in operation | |
31 | - network_interface_index: 0 | |
32 | - network_ip: 192.168.0.21 | |
33 | - | |
34 | - - DEVICE: | |
35 | - name: Takahashi_Epsilon_180ED_001 | |
36 | - file: device_Takahashi_180ED_sn001.yml | |
29 | + - DEVICE: | |
30 | + name: AstroMecaCA_CS100 # roof of the observatory | |
31 | + file: device_Astromecca_CS100_sn001.yml | |
32 | + # Describe here the configuration of the device in operation | |
33 | + network_interface_index: 0 | |
34 | + network_ip: 192.168.0.21 | |
35 | + | |
36 | + - DEVICE: | |
37 | + name: Takahashi_Epsilon_180ED_001 | |
38 | + file: device_Takahashi_180ED_sn001.yml | |
37 | 39 | |
38 | - - DEVICE: | |
39 | - name: Takahashi_Epsilon_180ED_002 | |
40 | - file: device_Takahashi_180ED_sn002.yml | |
40 | + - DEVICE: | |
41 | + name: Takahashi_Epsilon_180ED_002 | |
42 | + file: device_Takahashi_180ED_sn002.yml | |
41 | 43 | |
42 | - - DEVICE: | |
43 | - name: Takahashi_Epsilon_180ED_003 | |
44 | - file: device_Takahashi_180ED_sn003.yml | |
45 | - | |
46 | - - DEVICE: | |
47 | - name: Takahashi_Epsilon_180ED_004 | |
48 | - file: device_Takahashi_180ED_sn004.yml | |
49 | - | |
50 | - - DEVICE: | |
51 | - name: FLI_Kepler4040_001 | |
52 | - file: device_FLI_Kepler4040_sn28212x1.yml | |
53 | - | |
54 | - - DEVICE: | |
55 | - name: FLI_Kepler4040_002 | |
56 | - file: device_FLI_Kepler4040_sn28212x2.yml | |
57 | - | |
58 | - - DEVICE: | |
59 | - name: FLI_Kepler4040_003 | |
60 | - file: device_FLI_Kepler4040_sn28212x3.yml | |
61 | - | |
62 | - - DEVICE: | |
63 | - name: FLI_Kepler4040_004 | |
64 | - file: device_FLI_Kepler4040_sn28212x4.yml | |
65 | - | |
66 | - - DEVICE: | |
67 | - name: FLI_KeplerGPS_001 | |
68 | - file: device_FLI_KITS_sn2x1.yml | |
44 | + - DEVICE: | |
45 | + name: Takahashi_Epsilon_180ED_003 | |
46 | + file: device_Takahashi_180ED_sn003.yml | |
47 | + | |
48 | + - DEVICE: | |
49 | + name: Takahashi_Epsilon_180ED_004 | |
50 | + file: device_Takahashi_180ED_sn004.yml | |
51 | + | |
52 | + - DEVICE: | |
53 | + name: FLI_Kepler4040_001 | |
54 | + file: device_FLI_Kepler4040_sn28212x1.yml | |
55 | + | |
56 | + - DEVICE: | |
57 | + name: FLI_Kepler4040_002 | |
58 | + file: device_FLI_Kepler4040_sn28212x2.yml | |
59 | + | |
60 | + - DEVICE: | |
61 | + name: FLI_Kepler4040_003 | |
62 | + file: device_FLI_Kepler4040_sn28212x3.yml | |
63 | + | |
64 | + - DEVICE: | |
65 | + name: FLI_Kepler4040_004 | |
66 | + file: device_FLI_Kepler4040_sn28212x4.yml | |
67 | + | |
68 | + - DEVICE: | |
69 | + name: FLI_KeplerGPS_001 | |
70 | + file: device_FLI_KITS_sn2x1.yml | |
69 | 71 | |
70 | - - DEVICE: | |
71 | - name: FLI_KeplerGPS_002 | |
72 | - file: device_FLI_KITS_sn2x2.yml | |
72 | + - DEVICE: | |
73 | + name: FLI_KeplerGPS_002 | |
74 | + file: device_FLI_KITS_sn2x2.yml | |
73 | 75 | |
74 | - - DEVICE: | |
75 | - name: FLI_KeplerGPS_003 | |
76 | - file: device_FLI_KITS_sn2x3.yml | |
76 | + - DEVICE: | |
77 | + name: FLI_KeplerGPS_003 | |
78 | + file: device_FLI_KITS_sn2x3.yml | |
77 | 79 | |
78 | - - DEVICE: | |
79 | - name: FLI_KeplerGPS_004 | |
80 | - file: device_FLI_KITS_sn2x4.yml | |
81 | - | |
82 | - - DEVICE: | |
83 | - name: Optec_TFC19740_001 | |
84 | - file: device_Optec_TFC19740_sn001.yml | |
80 | + - DEVICE: | |
81 | + name: FLI_KeplerGPS_004 | |
82 | + file: device_FLI_KITS_sn2x4.yml | |
83 | + | |
84 | + - DEVICE: | |
85 | + name: Optec_TFC19740_001 | |
86 | + file: device_Optec_TFC19740_sn001.yml | |
85 | 87 | |
86 | - - DEVICE: | |
87 | - name: Optec_TFC19740_002 | |
88 | - file: device_Optec_TFC19740_sn002.yml | |
88 | + - DEVICE: | |
89 | + name: Optec_TFC19740_002 | |
90 | + file: device_Optec_TFC19740_sn002.yml | |
89 | 91 | |
90 | - - DEVICE: | |
91 | - name: Optec_TFC19740_003 | |
92 | - file: device_Optec_TFC19740_sn003.yml | |
92 | + - DEVICE: | |
93 | + name: Optec_TFC19740_003 | |
94 | + file: device_Optec_TFC19740_sn003.yml | |
93 | 95 | |
94 | - - DEVICE: | |
95 | - name: Optec_TFC19740_004 | |
96 | - file: device_Optec_TFC19740_sn004.yml | |
97 | - | |
98 | - | |
99 | - # === Inventory of available computers | |
100 | - # A computer is a hardware of a virtual machine. | |
101 | - # As a computer can be shared with various units, it is defined at the observatory level. | |
102 | - COMPUTERS: | |
103 | - | |
104 | - - COMPUTER: | |
105 | - name: MainComputer | |
106 | - file: computer_XCY_X26A_snAA478.yml | |
107 | - # Describe here the configuration of the computer in operation | |
108 | - role: Main | |
109 | - # Choice of the interface to connect the computer to the network (cf. _network_interfaces in _file) | |
110 | - network_interface_index: 0 | |
111 | - # IP attributed by the Router | |
112 | - network_ip: 192.168.0.11 | |
113 | - | |
96 | + - DEVICE: | |
97 | + name: Optec_TFC19740_004 | |
98 | + file: device_Optec_TFC19740_sn004.yml | |
99 | + | |
100 | + | |
101 | + # === Inventory of available computers | |
102 | + # A computer is a hardware of a virtual machine. | |
103 | + # As a computer can be shared with various units, it is defined at the observatory level. | |
104 | + COMPUTERS: | |
105 | + | |
106 | + - COMPUTER: | |
107 | + name: MainComputer | |
108 | + file: computer_XCY_X26A_snAA478.yml | |
109 | + # Describe here the configuration of the computer in operation | |
110 | + role: Main | |
111 | + # Choice of the interface to connect the computer to the network (cf. _network_interfaces in _file) | |
112 | + network_interface_index: 0 | |
113 | + # IP attributed by the Router | |
114 | + network_ip: 192.168.0.11 | |
115 | + | |
114 | 116 | # === Assembly of devices into units |
115 | 117 | # A unit is a robotic telescope |
116 | 118 | UNITS: | ... | ... |
src/core/pyros_django/obsconfig/fixtures/observatory_configuration_ko.yml
... | ... | @@ -6,49 +6,51 @@ OBSERVATORY: |
6 | 6 | |
7 | 7 | name: observatory_test |
8 | 8 | |
9 | - # === Inventory of available devices | |
10 | - # A device is a hardware with a maximum of one connection to drive it with a computer. | |
11 | - # As a device can be shared with various units, it is defined at the observatory level. | |
12 | - DEVICES: | |
13 | - | |
14 | - # Each device is defined by a specific configuration file that enumarate the components. | |
9 | + INVENTORY: | |
10 | + | |
11 | + # === Inventory of available devices | |
12 | + # A device is a hardware with a maximum of one connection to drive it with a computer. | |
13 | + # As a device can be shared with various units, it is defined at the observatory level. | |
14 | + DEVICES: | |
15 | 15 | |
16 | - - DEVICE: | |
17 | - name: AstroMecCA | |
18 | - file: device_Astromecca_TM350_test.yml | |
19 | - | |
20 | - - DEVICE: | |
21 | - name: PLC-meteo | |
22 | - file: device_Raspberry_MiFe_test.yml | |
23 | - # Describe here the configuration of the device in operation | |
24 | - network_interface_index: 0 | |
25 | - network_ip: 192.168.0.2 | |
26 | - | |
27 | - - DEVICE: | |
28 | - name: SkyWatcher-ED80 | |
29 | - file: device_SkyWatcher_ED80_test.yml | |
16 | + # Each device is defined by a specific configuration file that enumarate the components. | |
30 | 17 | |
31 | - | |
32 | - - DEVICE: | |
33 | - name: ZWO-ASI1600MMPro | |
34 | - file: device_ZWO_ASI1600MMPro_test.yml | |
35 | - | |
36 | - | |
37 | - # === Inventory of available computers | |
38 | - # A computer is a hardware of a virtual machine. | |
39 | - # As a computer can be shared with various units, it is defined at the observatory level. | |
40 | - COMPUTERS: | |
41 | - | |
42 | - - COMPUTER: | |
18 | + - DEVICE: | |
19 | + name: AstroMecCA | |
20 | + file: device_Astromecca_TM350_test.yml | |
21 | + | |
22 | + - DEVICE: | |
23 | + name: PLC-meteo | |
24 | + file: device_Raspberry_MiFe_test.yml | |
25 | + # Describe here the configuration of the device in operation | |
26 | + network_interface_index: 0 | |
27 | + network_ip: 192.168.0.2 | |
28 | + | |
29 | + - DEVICE: | |
30 | + name: SkyWatcher-ED80 | |
31 | + file: device_SkyWatcher_ED80_test.yml | |
32 | + | |
33 | + | |
34 | + - DEVICE: | |
35 | + name: ZWO-ASI1600MMPro | |
36 | + file: device_ZWO_ASI1600MMPro_test.yml | |
37 | + | |
38 | + | |
39 | + # === Inventory of available computers | |
40 | + # A computer is a hardware of a virtual machine. | |
41 | + # As a computer can be shared with various units, it is defined at the observatory level. | |
42 | + COMPUTERS: | |
43 | 43 | |
44 | - name: MainComputer | |
45 | - file: computer_test.yml | |
46 | - # Describe here the configuration of the computer in operation | |
47 | - role: Main | |
48 | - # Choice of the interface to connect the computer to the network (cf.network_interfaces infile) | |
49 | - network_interface_index: 0 | |
50 | - # IP attributed by the Router | |
51 | - network_ip: 192.168.0.11 | |
44 | + - COMPUTER: | |
45 | + | |
46 | + name: MainComputer | |
47 | + file: computer_test.yml | |
48 | + # Describe here the configuration of the computer in operation | |
49 | + role: Main | |
50 | + # Choice of the interface to connect the computer to the network (cf.network_interfaces infile) | |
51 | + network_interface_index: 0 | |
52 | + # IP attributed by the Router | |
53 | + network_ip: 192.168.0.11 | |
52 | 54 | |
53 | 55 | # === Assembly of devices into units |
54 | 56 | # A unit is a robotic telescope | ... | ... |
src/core/pyros_django/obsconfig/fixtures/observatory_configuration_ok_complex.yml
... | ... | @@ -5,54 +5,56 @@ schema: schema_observatory-2.0.yml |
5 | 5 | OBSERVATORY: |
6 | 6 | |
7 | 7 | name: observatory_test |
8 | + | |
9 | + INVENTORY: | |
8 | 10 | |
9 | - # === Inventory of available devices | |
10 | - # A device is a hardware with a maximum of one connection to drive it with a computer. | |
11 | - # As a device can be shared with various units, it is defined at the observatory level. | |
12 | - DEVICES: | |
13 | - | |
14 | - # Each device is defined by a specific configuration file that enumarate the components. | |
11 | + # === Inventory of available devices | |
12 | + # A device is a hardware with a maximum of one connection to drive it with a computer. | |
13 | + # As a device can be shared with various units, it is defined at the observatory level. | |
14 | + DEVICES: | |
15 | 15 | |
16 | - - DEVICE: | |
17 | - name: AstroMecCA | |
18 | - file: device_Astromecca_TM350_test.yml | |
19 | - | |
20 | - - DEVICE: | |
21 | - name: PLC-meteo | |
22 | - file: device_Raspberry_MiFe_test.yml | |
23 | - # Describe here the configuration of the device in operation | |
24 | - network_interface_index: 0 | |
25 | - network_ip: 192.168.0.2 | |
26 | - | |
27 | - - DEVICE: | |
28 | - name: SkyWatcher | |
29 | - file: device_SkyWatcher_ED80_test.yml | |
16 | + # Each device is defined by a specific configuration file that enumarate the components. | |
30 | 17 | |
18 | + - DEVICE: | |
19 | + name: AstroMecCA | |
20 | + file: device_Astromecca_TM350_test.yml | |
21 | + | |
22 | + - DEVICE: | |
23 | + name: PLC-meteo | |
24 | + file: device_Raspberry_MiFe_test.yml | |
25 | + # Describe here the configuration of the device in operation | |
26 | + network_interface_index: 0 | |
27 | + network_ip: 192.168.0.2 | |
28 | + | |
29 | + - DEVICE: | |
30 | + name: SkyWatcher | |
31 | + file: device_SkyWatcher_ED80_test.yml | |
32 | + | |
33 | + | |
34 | + - DEVICE: | |
35 | + name: ZWO | |
36 | + file: device_ZWO_ASI1600MMPro_test_complex.yml | |
31 | 37 | |
32 | - - DEVICE: | |
33 | - name: ZWO | |
34 | - file: device_ZWO_ASI1600MMPro_test_complex.yml | |
35 | - | |
36 | - - DEVICE: | |
37 | - name: FLI | |
38 | - file: device_FLI_KITS_sn0x1.yml | |
39 | - | |
40 | - # === Inventory of available computers | |
41 | - # A computer is a hardware of a virtual machine. | |
42 | - # As a computer can be shared with various units, it is defined at the observatory level. | |
43 | - COMPUTERS: | |
44 | - | |
45 | - - COMPUTER: | |
38 | + - DEVICE: | |
39 | + name: FLI | |
40 | + file: device_FLI_KITS_sn0x1.yml | |
41 | + | |
42 | + # === Inventory of available computers | |
43 | + # A computer is a hardware of a virtual machine. | |
44 | + # As a computer can be shared with various units, it is defined at the observatory level. | |
45 | + COMPUTERS: | |
46 | 46 | |
47 | - name: MainComputer | |
48 | - file: computer_test.yml | |
49 | - # Describe here the configuration of the computer in operation | |
50 | - role: Main | |
51 | - # Choice of the interface to connect the computer to the network (cf.network_interfaces infile) | |
52 | - network_interface_index: 0 | |
53 | - # IP attributed by the Router | |
54 | - network_ip: 192.168.0.11 | |
55 | - | |
47 | + - COMPUTER: | |
48 | + | |
49 | + name: MainComputer | |
50 | + file: computer_test.yml | |
51 | + # Describe here the configuration of the computer in operation | |
52 | + role: Main | |
53 | + # Choice of the interface to connect the computer to the network (cf.network_interfaces infile) | |
54 | + network_interface_index: 0 | |
55 | + # IP attributed by the Router | |
56 | + network_ip: 192.168.0.11 | |
57 | + | |
56 | 58 | # === Assembly of devices into units |
57 | 59 | # A unit is a robotic telescope |
58 | 60 | UNITS: | ... | ... |
src/core/pyros_django/obsconfig/fixtures/observatory_configuration_ok_simple.yml
... | ... | @@ -5,51 +5,53 @@ schema: schema_observatory-2.0.yml |
5 | 5 | OBSERVATORY: |
6 | 6 | |
7 | 7 | name: observatory_test |
8 | - | |
9 | - # === Inventory of available devices | |
10 | - # A device is a hardware with a maximum of one connection to drive it with a computer. | |
11 | - # As a device can be shared with various units, it is defined at the observatory level. | |
12 | - DEVICES: | |
13 | - | |
14 | - # Each device is defined by a specific configuration file that enumarate the components. | |
8 | + | |
9 | + INVENTORY: | |
15 | 10 | |
16 | - - DEVICE: | |
17 | - name: AstroMecCA | |
18 | - file: device_Astromecca_TM350_test.yml | |
19 | - | |
20 | - - DEVICE: | |
21 | - name: PLC-meteo | |
22 | - file: device_Raspberry_MiFe_test.yml | |
23 | - # Describe here the configuration of the device in operation | |
24 | - network_interface_index: 0 | |
25 | - network_ip: 192.168.0.2 | |
26 | - | |
27 | - - DEVICE: | |
28 | - name: SkyWatcher | |
29 | - file: device_SkyWatcher_ED80_test.yml | |
30 | - | |
31 | - | |
32 | - - DEVICE: | |
33 | - name: ZWO | |
34 | - file: device_ZWO_ASI1600MMPro_test.yml | |
35 | - | |
11 | + # === Inventory of available devices | |
12 | + # A device is a hardware with a maximum of one connection to drive it with a computer. | |
13 | + # As a device can be shared with various units, it is defined at the observatory level. | |
14 | + DEVICES: | |
15 | + | |
16 | + # Each device is defined by a specific configuration file that enumarate the components. | |
36 | 17 | |
37 | - # === Inventory of available computers | |
38 | - # A computer is a hardware of a virtual machine. | |
39 | - # As a computer can be shared with various units, it is defined at the observatory level. | |
40 | - COMPUTERS: | |
41 | - | |
42 | - - COMPUTER: | |
18 | + - DEVICE: | |
19 | + name: AstroMecCA | |
20 | + file: device_Astromecca_TM350_test.yml | |
21 | + | |
22 | + - DEVICE: | |
23 | + name: PLC-meteo | |
24 | + file: device_Raspberry_MiFe_test.yml | |
25 | + # Describe here the configuration of the device in operation | |
26 | + network_interface_index: 0 | |
27 | + network_ip: 192.168.0.2 | |
28 | + | |
29 | + - DEVICE: | |
30 | + name: SkyWatcher | |
31 | + file: device_SkyWatcher_ED80_test.yml | |
32 | + | |
33 | + | |
34 | + - DEVICE: | |
35 | + name: ZWO | |
36 | + file: device_ZWO_ASI1600MMPro_test.yml | |
37 | + | |
38 | + | |
39 | + # === Inventory of available computers | |
40 | + # A computer is a hardware of a virtual machine. | |
41 | + # As a computer can be shared with various units, it is defined at the observatory level. | |
42 | + COMPUTERS: | |
43 | 43 | |
44 | - name: MainComputer | |
45 | - file: computer_test.yml | |
46 | - # Describe here the configuration of the computer in operation | |
47 | - role: Main | |
48 | - # Choice of the interface to connect the computer to the network (cf.network_interfaces infile) | |
49 | - network_interface_index: 0 | |
50 | - # IP attributed by the Router | |
51 | - network_ip: 192.168.0.11 | |
44 | + - COMPUTER: | |
52 | 45 | |
46 | + name: MainComputer | |
47 | + file: computer_test.yml | |
48 | + # Describe here the configuration of the computer in operation | |
49 | + role: Main | |
50 | + # Choice of the interface to connect the computer to the network (cf.network_interfaces infile) | |
51 | + network_interface_index: 0 | |
52 | + # IP attributed by the Router | |
53 | + network_ip: 192.168.0.11 | |
54 | + | |
53 | 55 | # === Assembly of devices into units |
54 | 56 | # A unit is a robotic telescope |
55 | 57 | UNITS: | ... | ... |
src/core/pyros_django/obsconfig/obsconfig_class.py
... | ... | @@ -56,13 +56,13 @@ class OBSConfig: |
56 | 56 | return -1 |
57 | 57 | self.obs_config = obs_config |
58 | 58 | # check last date of modification for devices files |
59 | - for device in self.obs_config["OBSERVATORY"]["DEVICES"]: | |
59 | + for device in self.obs_config["OBSERVATORY"]["INVENTORY"]["DEVICES"]: | |
60 | 60 | device_file = self.CONFIG_PATH+device["DEVICE"]["file"] |
61 | 61 | device_file_mtime = os.path.getmtime(device_file) |
62 | 62 | if device_file_mtime > pickle_file_mtime: |
63 | 63 | return True |
64 | 64 | |
65 | - for computer in self.obs_config["OBSERVATORY"]["COMPUTERS"]: | |
65 | + for computer in self.obs_config["OBSERVATORY"]["INVENTORY"]["COMPUTERS"]: | |
66 | 66 | computer_file = self.CONFIG_PATH+computer["COMPUTER"]["file"] |
67 | 67 | computer_file_mtime = os.path.getmtime(computer_file) |
68 | 68 | if computer_file_mtime > pickle_file_mtime: |
... | ... | @@ -294,7 +294,7 @@ class OBSConfig: |
294 | 294 | dict: key is device name, value is file name |
295 | 295 | """ |
296 | 296 | devices_names_and_files = {} |
297 | - for device in self.obs_config["OBSERVATORY"]["DEVICES"]: | |
297 | + for device in self.obs_config["OBSERVATORY"]["INVENTORY"]["DEVICES"]: | |
298 | 298 | device = device["DEVICE"] |
299 | 299 | |
300 | 300 | devices_names_and_files[device["name"]] = device["file"] |
... | ... | @@ -512,8 +512,8 @@ class OBSConfig: |
512 | 512 | return self.computers |
513 | 513 | else: |
514 | 514 | computers = {} |
515 | - for computer_id in range(len(self.obs_config["OBSERVATORY"]["COMPUTERS"])): | |
516 | - computer = self.obs_config["OBSERVATORY"]["COMPUTERS"][computer_id]["COMPUTER"] | |
515 | + for computer_id in range(len(self.obs_config["OBSERVATORY"]["INVENTORY"]["COMPUTERS"])): | |
516 | + computer = self.obs_config["OBSERVATORY"]["INVENTORY"]["COMPUTERS"][computer_id]["COMPUTER"] | |
517 | 517 | if( "file" in computer.keys() ): |
518 | 518 | computer["computer_config"]= self.read_and_check_config_file(self.CONFIG_PATH+computer["file"])["COMPUTER"] |
519 | 519 | computers[computer["name"]] = computer |
... | ... | @@ -531,8 +531,8 @@ class OBSConfig: |
531 | 531 | |
532 | 532 | else: |
533 | 533 | devices = {} |
534 | - for device_id in range(len(self.obs_config["OBSERVATORY"]["DEVICES"])): | |
535 | - device = self.obs_config["OBSERVATORY"]["DEVICES"][device_id]["DEVICE"] | |
534 | + for device_id in range(len(self.obs_config["OBSERVATORY"]["INVENTORY"]["DEVICES"])): | |
535 | + device = self.obs_config["OBSERVATORY"]["INVENTORY"]["DEVICES"][device_id]["DEVICE"] | |
536 | 536 | if( "file" in device.keys() ): |
537 | 537 | device["device_config"] = self.read_device_config_file(self.CONFIG_PATH+device["file"])["DEVICE"] |
538 | 538 | devices[device["name"]] = device |
... | ... | @@ -545,7 +545,7 @@ class OBSConfig: |
545 | 545 | list: list of names of devices |
546 | 546 | """ |
547 | 547 | devices_names = [] |
548 | - for device in self.obs_config["OBSERVATORY"]["DEVICES"]: | |
548 | + for device in self.obs_config["OBSERVATORY"]["INVENTORY"]["DEVICES"]: | |
549 | 549 | devices_names.append(device["DEVICE"]["name"]) |
550 | 550 | return devices_names |
551 | 551 | ... | ... |