door-handler #21
No reviewers
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
priority
high
priority
low
priority
medium
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
TTK4145/elevator!21
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "door-handler"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Needs the obstruction branch because it needs to set the obstruction.
But else it will work.
WIP: door-handlerto door-handlercloses #5
Some small things
@ -67,1 +68,4 @@// Setup the channels// TODO: make unboundlet (door_handler_tx, door_handler_rx) = mpsc::channel::<DoorState>(100);Follow up on this todo, convert to unbounded.
converted
@ -68,2 +72,3 @@// Create the system statelet state = SystemState::new(ip);let state = SystemState::new(ip, door_handler_tx);If we wait until after #23 we can use the same mechanism for passing in this handle.
i have now merged #23 so everything should be updated
@ -0,0 +1,694 @@use super::DoorState;use crate::SystemState;// use crossbeam_channel::{self as cbc, Receiver};Delete commented out import
done
@ -0,0 +24,4 @@) {trace!("INFO: Awating message.");// Waiting on message from the sync_notificationlet message: DoorState = sync_notificationThis isn't a sync notification. This is a message with data.
doorstate_reciever better?
@ -0,0 +44,4 @@current_door_state, message);match (current_door_state, message) {This match statement is very long, could you please break it up into several smaller functions to make the logic clearer?
done
@ -0,0 +104,4 @@};}pub async fn door_handler_task(Missing doccomment.
added
@ -0,0 +114,4 @@}#[cfg(test)]pub mod tests {There are many long tests. I assume your logic for each test is good.
thanks!
they work!
LGTM