Skip to content
This repository has been archived by the owner on Dec 8, 2024. It is now read-only.

Commit

Permalink
Display messages
Browse files Browse the repository at this point in the history
shorter display messages, that should actually be on new lines
  • Loading branch information
polypies73 committed Oct 10, 2024
1 parent 58ea5f1 commit 7c16db8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
18 changes: 18 additions & 0 deletions client/drivers/data_structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,24 @@ def set_last_plant_time(self, time: datetime) -> None:
"""
self._last_plant_time = time

def accept_new_posture_data(
self, posture_data: List[float]
) -> None: # TODO: Refine type signature
"""
Update the internal store of posture data for the OLED display.
Args:
posture_data : List[float]
New posture data to accept and merge with the current state of this object.
TODO: Implement me!
"""
# DEBUG:
print("<!> accept_new_posture_data()")
# :DEBUG
for datum in posture_data:
self._posture_data.put_nowait(datum)


## SECTION: Hardware packaged together

Expand Down
12 changes: 6 additions & 6 deletions client/drivers/login_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
Status.TOO_MANY_FACES.value: "Too many faces detected",
Status.NO_MATCH.value: "Could not match face",
}
QUIT_INSTRUCTIONS = "Right button to quit"
QUIT_INSTRUCTIONS = "Right: quit"

Action = Callable[[HardwareComponents], int]

Expand All @@ -44,9 +44,9 @@ def handle_authentication(hardware: HardwareComponents) -> int:
while True:
_log_and_send(
hardware,
["Left button to login",
"Right button to register",
"Double press right button to reset data"]
["Left: login",
"Right: register",
"Double press right: reset data"]
)
button = hardware.wait_for_button_press()

Expand Down Expand Up @@ -82,7 +82,7 @@ def _loop_action(hardware: HardwareComponents, action: Action) -> int:

def _attempt_login(hardware: HardwareComponents) -> int:
capturer = RaspCapturer()
messages = ["Press left button to take photo", f"{QUIT_INSTRUCTIONS}"]
messages = ["Left: take photo", f"{QUIT_INSTRUCTIONS}"]
_log_and_send(hardware, messages, message_time=0)

button_pressed = hardware.wait_for_button_press()
Expand All @@ -106,7 +106,7 @@ def _attempt_register(hardware: HardwareComponents) -> int:
faces: list[np.ndarray] = []
for i in range(NUM_FACES):
messages = [
f"Press left button to take photo {i + 1}/{NUM_FACES}",
f"Left: take photo {i + 1}/{NUM_FACES}",
f"{QUIT_INSTRUCTIONS}"
]
_log_and_send(hardware, messages, message_time=0)
Expand Down

0 comments on commit 7c16db8

Please sign in to comment.