Added 'No ventilation' option to expert app fixes #112

This commit is contained in:
Luis Aleixo 2021-11-17 11:49:15 +01:00
parent 54ed2e0923
commit e73ca5a096

View file

@ -434,7 +434,7 @@ class ModelWidgets(View):
widget.layout.visible = False
ventilation_w = widgets.ToggleButtons(
options=ventilation_widgets.keys(),
options=['Natural', 'Mechanical', 'No ventilation']
)
def toggle_ventilation(value):
@ -532,6 +532,7 @@ class CARAStateBuilder(state.StateBuilder):
states={
'Natural': self.build_generic(models.WindowOpening),
'Mechanical': self.build_generic(models.HVACMechanical),
'No ventilation': self.build_generic(models.AirChange),
},
state_builder=self,
)
@ -539,6 +540,10 @@ class CARAStateBuilder(state.StateBuilder):
s._states['Mechanical'].dcs_update_from(
models.HVACMechanical(models.PeriodicInterval(period=24*60, duration=24*60), 500.)
)
# Initialise the No ventilation state
s._states['No ventilation'].dcs_update_from(
models.AirChange(active=models.PeriodicInterval(period=120, duration=120), air_exch=0.)
)
return s