Skip to content
Snippets Groups Projects
Commit 5e4b34aa authored by David Hammer's avatar David Hammer
Browse files

Minor fixes

parent 45556239
No related branches found
No related tags found
1 merge request!53Train picker arbiter kernel
...@@ -51,6 +51,7 @@ class PickyBoi(PythonDevice): ...@@ -51,6 +51,7 @@ class PickyBoi(PythonDevice):
STRING_ELEMENT(expected) STRING_ELEMENT(expected)
.key("ppuFollowingState") .key("ppuFollowingState")
.setSpecialDisplayType("State")
.readOnly() .readOnly()
.initialValue("OFF") .initialValue("OFF")
.commit(), .commit(),
...@@ -81,7 +82,7 @@ class PickyBoi(PythonDevice): ...@@ -81,7 +82,7 @@ class PickyBoi(PythonDevice):
SLOT_ELEMENT(expected) SLOT_ELEMENT(expected)
.key("toggleFollowPpu") .key("toggleFollowPpu")
.allowedStates([State.MONITORING, State.PASSIVE, State.ERROR]) .allowedStates(State.MONITORING, State.PASSIVE, State.ERROR)
.commit(), .commit(),
SLOT_ELEMENT(expected) SLOT_ELEMENT(expected)
...@@ -90,7 +91,11 @@ class PickyBoi(PythonDevice): ...@@ -90,7 +91,11 @@ class PickyBoi(PythonDevice):
SLOT_ELEMENT(expected) SLOT_ELEMENT(expected)
.key("captureNextTrain") .key("captureNextTrain")
.allowedStates([State.MONITORING, State.PASSIVE, State.ERROR]) .allowedStates(State.MONITORING, State.PASSIVE, State.ERROR)
.commit(),
OUTPUT_CHANNEL(expected)
.key("output")
.commit(), .commit(),
) )
...@@ -172,7 +177,7 @@ class PickyBoi(PythonDevice): ...@@ -172,7 +177,7 @@ class PickyBoi(PythonDevice):
# TODO: check against timeserver to handle wild future trains # TODO: check against timeserver to handle wild future trains
if self._just_capture_next: if self._just_capture_next:
self.set("nextTrainToCatch", current_tid) self.set("nextTrainToCatch", current_tid)
self._traint_to_get = set( self._trains_to_get = set(
range(current_tid, current_tid + self.get("numberOfTrainsToCatch")) range(current_tid, current_tid + self.get("numberOfTrainsToCatch"))
) )
self._just_capture_next = False self._just_capture_next = False
...@@ -213,7 +218,7 @@ class PickyBoi(PythonDevice): ...@@ -213,7 +218,7 @@ class PickyBoi(PythonDevice):
self.updateState(State.PASSIVE) self.updateState(State.PASSIVE)
self._previous_tid = current_tid self._previous_tid = current_tid
def _update_target(self, new_target_tid): def _update_target(self):
# assumes nextTrainToCatch and numberOfTrainsToCatch have been set # assumes nextTrainToCatch and numberOfTrainsToCatch have been set
new_target_tid = self.get("nextTrainToCatch") new_target_tid = self.get("nextTrainToCatch")
self._trains_to_get = set( self._trains_to_get = set(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment