|
10 | 10 |
|
11 | 11 | import cartago.Artifact;
|
12 | 12 | import cartago.OPERATION;
|
13 |
| -import infrastructure.configuration.model.Configuration; |
| 13 | +import application.presenter.configuration.model.Configuration; |
14 | 14 | import org.yaml.snakeyaml.Yaml;
|
15 | 15 | import org.yaml.snakeyaml.constructor.Constructor;
|
16 | 16 | import org.yaml.snakeyaml.representer.Representer;
|
@@ -48,7 +48,46 @@ void load() {
|
48 | 48 | ) {
|
49 | 49 | final String fileContent = new String(configInputStream.readAllBytes(), StandardCharsets.UTF_8);
|
50 | 50 | final Configuration config = yaml.load(fileContent);
|
51 |
| - signal("config", config.getOperatingRoomStandbyMode().isEnabled().toString()); // tobe deleted |
| 51 | + // Signal the configuration to the observers |
| 52 | + // Operating room environment configuration |
| 53 | + signal("operatingRoom", |
| 54 | + config.getOperatingRoom().getTemperature(), |
| 55 | + config.getOperatingRoom().getHumidity(), |
| 56 | + config.getOperatingRoom().getAmbientIlluminance(), |
| 57 | + config.getOperatingRoom().getSurgicalIlluminance()); |
| 58 | + |
| 59 | + // Pre post operating room environment configuration |
| 60 | + signal("preOperatingRoom", |
| 61 | + config.getPrePostOperatingRoom().getTemperature(), |
| 62 | + config.getPrePostOperatingRoom().getHumidity(), |
| 63 | + config.getPrePostOperatingRoom().getAmbientIlluminance()); |
| 64 | + |
| 65 | + // Operating room standby mode |
| 66 | + if (config.getOperatingRoomStandbyMode().isEnabled()) { |
| 67 | + signal("operatingRoomStandby", |
| 68 | + config.getOperatingRoomStandbyMode().getMinutesToEnable(), |
| 69 | + config.getOperatingRoomStandbyMode().getEnvironment().getTemperature(), |
| 70 | + config.getOperatingRoomStandbyMode().getEnvironment().getHumidity(), |
| 71 | + config.getOperatingRoomStandbyMode().getEnvironment().getAmbientIlluminance(), |
| 72 | + config.getOperatingRoomStandbyMode().getEnvironment().getSurgicalIlluminance()); |
| 73 | + } |
| 74 | + |
| 75 | + // Pre post operating room standby mode |
| 76 | + if (config.getPrePostOperatingRoomStandbyMode().isEnabled()) { |
| 77 | + signal("prePostOperatingRoomStandby", |
| 78 | + config.getPrePostOperatingRoomStandbyMode().getMinutesToEnable(), |
| 79 | + config.getPrePostOperatingRoomStandbyMode().getEnvironment().getTemperature(), |
| 80 | + config.getPrePostOperatingRoomStandbyMode().getEnvironment().getHumidity(), |
| 81 | + config.getPrePostOperatingRoomStandbyMode().getEnvironment().getAmbientIlluminance()); |
| 82 | + } |
| 83 | + |
| 84 | + // Medical technologies scenarios |
| 85 | + config.getMedicalTechnologyScenarios().forEach(scenario -> { |
| 86 | + signal("medicalTechnologyScenario", |
| 87 | + scenario.getMedicalTechnologyType(), |
| 88 | + scenario.getAmbientIlluminance(), |
| 89 | + scenario.getSurgicalIlluminance()); |
| 90 | + }); |
52 | 91 | } catch (IOException e) {
|
53 | 92 | throw new IllegalStateException("Impossible to read configuration file", e);
|
54 | 93 | }
|
|
0 commit comments