Skip to content

Commit

Permalink
generator will not restart on enableing auto start
Browse files Browse the repository at this point in the history
  • Loading branch information
kwindrem committed Jun 23, 2024
1 parent 6c335e5 commit 2b65516
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 24 deletions.
12 changes: 9 additions & 3 deletions FileSets/v2.73/startstop.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,9 +420,9 @@ def _evaluate_startstop_conditions(self):
if self._dbusservice['/ManualStartTimer'] < 0 and self._dbusservice['/ManualStart'] == 1:
self._dbusservice['/ManualStartTimer'] = 0
self._dbusservice['/ManualStart'] = 0
ignoresAutoStartCondition = True
ignoreAutoStartCondition = True
else:
ignoresAutoStartCondition = False
ignoreAutoStartCondition = False
if self._evaluate_manual_start():
startbycondition = 'manual'
start = True
Expand All @@ -437,7 +437,7 @@ def _evaluate_startstop_conditions(self):
# Evaluate value conditions
for condition in conditions:
#### GuiMods
start = self._evaluate_condition(self._condition_stack[condition], values[condition], ignoresAutoStartCondition) or start
start = self._evaluate_condition(self._condition_stack[condition], values[condition], ignoreAutoStartCondition) or start

startbycondition = condition if start and startbycondition is None else startbycondition
# Connection lost is set to true if the number of retries of one or more enabled conditions
Expand All @@ -462,6 +462,12 @@ def _evaluate_startstop_conditions(self):
start = True
startbycondition = 'lossofcommunication'

#### GuiMods
## auto start disabled and generator is stopped - clear the 'reached' flags
elif self._dbusservice['/State'] == States.STOPPED:
for condition, data in self._condition_stack.items():
self._reset_condition(data)

if not start and self._errorstate:
self._stop_generator()

Expand Down
14 changes: 10 additions & 4 deletions FileSets/v3.01/startstop.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ def _create_service(self):
self._dbusservice.add_path('/ExternalOverride', value=None)
self._dbusservice['/GeneratorRunningState'] = "?"
self._dbusservice['/ExternalOverride'] = False
self._ignoresAutoStartCondition = False
self._ignoreAutoStartCondition = False

@property
def capabilities(self):
Expand Down Expand Up @@ -608,9 +608,9 @@ def _evaluate_startstop_conditions(self):
if self._dbusservice['/ManualStartTimer'] < 0 and self._dbusservice['/ManualStart'] == 1:
self._dbusservice['/ManualStartTimer'] = 0
self._dbusservice['/ManualStart'] = 0
self._ignoresAutoStartCondition = True
self._ignoreAutoStartCondition = True
else:
self._ignoresAutoStartCondition = False
self._ignoreAutoStartCondition = False
if self._evaluate_manual_start():
startbycondition = 'manual'
start = True
Expand Down Expand Up @@ -651,6 +651,12 @@ def _evaluate_startstop_conditions(self):
start = True
startbycondition = 'lossofcommunication'

#### GuiMods
## auto start disabled and generator is stopped - clear the 'reached' flags
elif self._dbusservice['/State'] == States.STOPPED:
for condition, data in self._condition_stack.items():
self._reset_condition(data)

if not start and self._errorstate:
self._stop_generator()

Expand Down Expand Up @@ -800,7 +806,7 @@ def _evaluate_condition(self, condition):
stop = value <= stopvalue if start_is_greater else value >= stopvalue
# when starting manually and stopping based on auto stop values,
# start if stop condition is not satisfied
if self._ignoresAutoStartCondition:
if self._ignoreAutoStartCondition:
start = not stop
else:
# When the condition is already reached only the stop value can set it to False
Expand Down
14 changes: 10 additions & 4 deletions FileSets/v3.10/startstop.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ def _create_service(self):
self._dbusservice.add_path('/ExternalOverride', value=None)
self._dbusservice['/GeneratorRunningState'] = "?"
self._dbusservice['/ExternalOverride'] = False
self._ignoresAutoStartCondition = False
self._ignoreAutoStartCondition = False

@property
def capabilities(self):
Expand Down Expand Up @@ -647,9 +647,9 @@ def _evaluate_startstop_conditions(self):
if self._dbusservice['/ManualStartTimer'] < 0 and self._dbusservice['/ManualStart'] == 1:
self._dbusservice['/ManualStartTimer'] = 0
self._dbusservice['/ManualStart'] = 0
self._ignoresAutoStartCondition = True
self._ignoreAutoStartCondition = True
else:
self._ignoresAutoStartCondition = False
self._ignoreAutoStartCondition = False
if self._evaluate_manual_start():
startbycondition = 'manual'
start = True
Expand Down Expand Up @@ -703,6 +703,12 @@ def _evaluate_startstop_conditions(self):
start = True
startbycondition = 'lossofcommunication'

#### GuiMods
## auto start disabled and generator is stopped - clear the 'reached' flags
elif self._dbusservice['/State'] == States.STOPPED:
for condition, data in self._condition_stack.items():
self._reset_condition(data)

if not start and self._errorstate:
self._stop_generator()

Expand Down Expand Up @@ -866,7 +872,7 @@ def _evaluate_condition(self, condition):
stop = value <= stopvalue if start_is_greater else value >= stopvalue
# when starting manually and stopping based on auto stop values,
# start if stop condition is not satisfied
if self._ignoresAutoStartCondition:
if self._ignoreAutoStartCondition:
start = not stop
else:
# When the condition is already reached only the stop value can set it to False
Expand Down
14 changes: 10 additions & 4 deletions FileSets/v3.14/startstop.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ def _create_service(self):
self._dbusservice.add_path('/ExternalOverride', value=None)
self._dbusservice['/GeneratorRunningState'] = "?"
self._dbusservice['/ExternalOverride'] = False
self._ignoresAutoStartCondition = False
self._ignoreAutoStartCondition = False

@property
def capabilities(self):
Expand Down Expand Up @@ -648,9 +648,9 @@ def _evaluate_startstop_conditions(self):
if self._dbusservice['/ManualStartTimer'] < 0 and self._dbusservice['/ManualStart'] == 1:
self._dbusservice['/ManualStartTimer'] = 0
self._dbusservice['/ManualStart'] = 0
self._ignoresAutoStartCondition = True
self._ignoreAutoStartCondition = True
else:
self._ignoresAutoStartCondition = False
self._ignoreAutoStartCondition = False
if self._evaluate_manual_start():
startbycondition = 'manual'
start = True
Expand Down Expand Up @@ -704,6 +704,12 @@ def _evaluate_startstop_conditions(self):
start = True
startbycondition = 'lossofcommunication'

#### GuiMods
## auto start disabled and generator is stopped - clear the 'reached' flags
elif self._dbusservice['/State'] == States.STOPPED:
for condition, data in self._condition_stack.items():
self._reset_condition(data)

if not start and self._errorstate:
self._stop_generator()

Expand Down Expand Up @@ -869,7 +875,7 @@ def _evaluate_condition(self, condition):
stop = value <= stopvalue if start_is_greater else value >= stopvalue
# when starting manually and stopping based on auto stop values,
# start if stop condition is not satisfied
if self._ignoresAutoStartCondition:
if self._ignoreAutoStartCondition:
start = not stop
else:
# When the condition is already reached only the stop value can set it to False
Expand Down
14 changes: 10 additions & 4 deletions FileSets/v3.31/startstop.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ def _create_service(self):
self._dbusservice.add_path('/ExternalOverride', value=None)
self._dbusservice['/GeneratorRunningState'] = "?"
self._dbusservice['/ExternalOverride'] = False
self._ignoresAutoStartCondition = False
self._ignoreAutoStartCondition = False

@property
def capabilities(self):
Expand Down Expand Up @@ -658,9 +658,9 @@ def _evaluate_startstop_conditions(self):
if self._dbusservice['/ManualStartTimer'] < 0 and self._dbusservice['/ManualStart'] == 1:
self._dbusservice['/ManualStartTimer'] = 0
self._dbusservice['/ManualStart'] = 0
self._ignoresAutoStartCondition = True
self._ignoreAutoStartCondition = True
else:
self._ignoresAutoStartCondition = False
self._ignoreAutoStartCondition = False
if self._evaluate_manual_start():
startbycondition = 'manual'
start = True
Expand Down Expand Up @@ -714,6 +714,12 @@ def _evaluate_startstop_conditions(self):
start = True
startbycondition = 'lossofcommunication'

#### GuiMods
## auto start disabled and generator is stopped - clear the 'reached' flags
elif self._dbusservice['/State'] == States.STOPPED:
for condition, data in self._condition_stack.items():
self._reset_condition(data)

if not start and self._errorstate:
self._stop_generator()

Expand Down Expand Up @@ -879,7 +885,7 @@ def _evaluate_condition(self, condition):
stop = value <= stopvalue if start_is_greater else value >= stopvalue
# when starting manually and stopping based on auto stop values,
# start if stop condition is not satisfied
if self._ignoresAutoStartCondition:
if self._ignoreAutoStartCondition:
start = not stop
else:
# When the condition is already reached only the stop value can set it to False
Expand Down
17 changes: 13 additions & 4 deletions FileSets/v3.40~30/startstop.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,8 @@ def _create_service(self):
self._dbusservice.add_path('/ExternalOverride', value=None)
self._dbusservice['/GeneratorRunningState'] = "?"
self._dbusservice['/ExternalOverride'] = False
self._ignoresAutoStartCondition = False
self._ignoreAutoStartCondition = False


@property
def capabilities(self):
Expand Down Expand Up @@ -644,9 +645,10 @@ def _evaluate_startstop_conditions(self):
if self._dbusservice['/ManualStartTimer'] < 0 and self._dbusservice['/ManualStart'] == 1:
self._dbusservice['/ManualStartTimer'] = 0
self._dbusservice['/ManualStart'] = 0
self._ignoresAutoStartCondition = True
self._ignoreAutoStartCondition = True

else:
self._ignoresAutoStartCondition = False
self._ignoreAutoStartCondition = False
if self._evaluate_manual_start():
startbycondition = 'manual'
start = True
Expand Down Expand Up @@ -700,6 +702,12 @@ def _evaluate_startstop_conditions(self):
start = True
startbycondition = 'lossofcommunication'

#### GuiMods
## auto start disabled and generator is stopped - clear the 'reached' flags
elif self._dbusservice['/State'] == States.STOPPED:
for condition, data in self._condition_stack.items():
self._reset_condition(data)

if not start and self._errorstate:
self._stop_generator()

Expand Down Expand Up @@ -883,7 +891,8 @@ def _evaluate_condition(self, condition):
stop = value <= stopvalue if start_is_greater else value >= stopvalue
# when starting manually and stopping based on auto stop values,
# start if stop condition is not satisfied
if self._ignoresAutoStartCondition:

if self._ignoreAutoStartCondition:
start = not stop
else:
# When the condition is already reached only the stop value can set it to False
Expand Down
7 changes: 7 additions & 0 deletions changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
v10.48:
changed behavior: previously, if the generator auto starts then auto start is disabled
the generator will restart if auto start is reenabled
unless all stop conditions have been met
now, reenabling auto start will NOT restart the generator
if no start conditions are active

v10.47:
more fixes for missing Multi tile

Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v10.44
v10.48

0 comments on commit 2b65516

Please sign in to comment.