door-handler #21

Merged
Athamantis merged 26 commits from door-handler into main 2026-02-25 16:35:32 +00:00
Owner
No description provided.
add outline to door handler
Some checks failed
/ build_and_test (push) Failing after 16s
b61bf66f74
Merge branch 'main' into door-handler
All checks were successful
/ build_and_test (push) Successful in 33s
6de776e034
add psedo code and code
Some checks failed
/ build_and_test (push) Failing after 23s
0fc95ff0b2
fix notification(hpoefully)
Some checks failed
/ build_and_test (push) Failing after 22s
dd1c194c68
something|
Some checks failed
/ build_and_test (push) Failing after 20s
cfbf69a481
fix the match statement
Some checks failed
/ build_and_test (push) Failing after 22s
72bfa2e9ce
remove errors / aka does light handler handle elevator light also?
All checks were successful
/ build_and_test (push) Successful in 33s
d2b1b28043
add something
Some checks failed
/ build_and_test (push) Failing after 23s
ad312d4cfe
Add door handler sender to system state
All checks were successful
/ build_and_test (push) Successful in 37s
28a0388b50
add comments and fix some warnings
Some checks failed
/ build_and_test (push) Failing after 22s
117aa4b251
trying to add testing
Some checks failed
/ build_and_test (push) Failing after 22s
79035f70bc
add tests and println->debug
All checks were successful
/ build_and_test (push) Successful in 33s
9b913edffc
Author
Owner

Needs the obstruction branch because it needs to set the obstruction.
But else it will work.

Needs the obstruction branch because it needs to set the obstruction. But else it will work.
Merge branch 'main' into door-handler
Some checks failed
/ build_and_test (push) Failing after 25s
db315493c1
fix the obstruction_handler tests
All checks were successful
/ build_and_test (push) Successful in 33s
ff0e183dd5
testing
Some checks failed
/ build_and_test (push) Has been cancelled
e437f4d337
fix test for door-handler
All checks were successful
/ build_and_test (push) Successful in 35s
6b85a6bb8a
fix debug and trace logging
Some checks failed
/ build_and_test (push) Failing after 22s
1677f38336
Athamantis changed title from WIP: door-handler to door-handler 2026-02-24 11:54:54 +00:00
add crate log trace
All checks were successful
/ build_and_test (push) Successful in 36s
1023ab384b
Author
Owner

closes #5

closes #5
sebgab requested changes 2026-02-24 12:22:24 +00:00
Dismissed
sebgab left a comment
Owner

Some small things

Some small things
src/main.rs Outdated
@ -67,1 +68,4 @@
// Setup the channels
// TODO: make unbound
let (door_handler_tx, door_handler_rx) = mpsc::channel::<DoorState>(100);
Owner

Follow up on this todo, convert to unbounded.

Follow up on this todo, convert to unbounded.
Author
Owner

converted

converted
Athamantis marked this conversation as resolved
src/main.rs Outdated
@ -68,2 +72,3 @@
// Create the system state
let state = SystemState::new(ip);
let state = SystemState::new(ip, door_handler_tx);
Owner

If we wait until after #23 we can use the same mechanism for passing in this handle.

If we wait until after #23 we can use the same mechanism for passing in this handle.
Author
Owner

i have now merged #23 so everything should be updated

i have now merged #23 so everything should be updated
Athamantis marked this conversation as resolved
@ -0,0 +1,694 @@
use super::DoorState;
use crate::SystemState;
// use crossbeam_channel::{self as cbc, Receiver};
Owner

Delete commented out import

Delete commented out import
Author
Owner

done

done
Athamantis marked this conversation as resolved
@ -0,0 +24,4 @@
) {
trace!("INFO: Awating message.");
// Waiting on message from the sync_notification
let message: DoorState = sync_notification
Owner

This isn't a sync notification. This is a message with data.

This isn't a sync notification. This is a message with data.
Author
Owner

doorstate_reciever better?

doorstate_reciever better?
Athamantis marked this conversation as resolved
@ -0,0 +44,4 @@
current_door_state, message
);
match (current_door_state, message) {
Owner

This match statement is very long, could you please break it up into several smaller functions to make the logic clearer?

This match statement is very long, could you please break it up into several smaller functions to make the logic clearer?
Author
Owner

done

done
Athamantis marked this conversation as resolved
@ -0,0 +104,4 @@
};
}
pub async fn door_handler_task(
Owner

Missing doccomment.

Missing doccomment.
Author
Owner

added

added
Athamantis marked this conversation as resolved
@ -0,0 +114,4 @@
}
#[cfg(test)]
pub mod tests {
Owner

There are many long tests. I assume your logic for each test is good.

There are many long tests. I assume your logic for each test is good.
Author
Owner

thanks!
they work!

thanks! they work!
Athamantis marked this conversation as resolved
channel -> unbounded_channel
All checks were successful
/ build_and_test (push) Successful in 34s
c54c9981bf
fix some feedback
All checks were successful
/ build_and_test (push) Successful in 32s
b83378149c
Merge branch 'main' into door-handler
Some checks failed
/ build_and_test (push) Has been cancelled
d053c0c221
fix door_handler tests
All checks were successful
/ build_and_test (push) Successful in 36s
f3c5db7b62
break out in functions
All checks were successful
/ build_and_test (push) Successful in 35s
0e2783b45e
deleted test functions in main
All checks were successful
/ build_and_test (push) Successful in 34s
5ca7976fc6
update the channel usupdate the channel usee
All checks were successful
/ build_and_test (push) Successful in 33s
5614a6ad99
sebgab approved these changes 2026-02-25 16:34:39 +00:00
sebgab left a comment
Owner

LGTM

LGTM
Merge branch 'main' into door-handler
All checks were successful
/ build_and_test (push) Successful in 20s
/ Static Release Build (push) Has been skipped
ca23756d66
sebgab deleted branch door-handler 2026-02-25 16:35:41 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
TTK4145/elevator!21
No description provided.