withaspirit / Elevator-Simulation

Elevator System Simulation project
1 stars 1 forks source link

Elevator Faults and Travel Time #176

Closed withaspirit closed 2 years ago

withaspirit commented 2 years ago

Introducing TravelTime to Elevator

Changes

Future: Add a Test file to see what happens when the Elevator is interrupted.

julian-carleton commented 2 years ago

@cyberphoria , is this the watchdog to check if the arrival sensor had a fault? I think it looks good.

withaspirit commented 2 years ago

Yeah. For now, the idea is that it always waits X time to simulate movement. After that, it checks if it has received the ApproachEvent, and if not, it throws a TimerOutException.

In contrast, if emergency stopped is pressed by, say, the Elevator.interrupt() method being invoked, the wait time would be exited early and handling for the interrupted exception could occur.

julian-carleton commented 2 years ago

Ok, cool. I think I understand it better now. So this actually accounts for both faults. Because if the package from the approach event is lost, then it would also handle it. Neat!

julian-carleton commented 2 years ago

I think the testing should still be done in this branch before merging, so that we can see if the timing with the interrupt method actually works.

withaspirit commented 2 years ago

Earlier today, I was planning on making a separate branch for testing this branch, and then adjusting this branch as necessary for the test branch. IDK if I'll have time before next meeting, though.