-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding ability to stop statechart from within the statechart
- Loading branch information
Showing
10 changed files
with
115 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import time | ||
from miros import spy_on | ||
from miros import ActiveObject | ||
from miros import signals, Event, return_status | ||
|
||
@spy_on | ||
def some_state(chart, e): | ||
status = return_status.UNHANDLED | ||
if(e.signal == signals.Destroy_This_Chart): | ||
chart.stop() | ||
status = return_status.HANDLED | ||
else: | ||
chart.temp.fun = chart.top | ||
status = return_status.SUPER | ||
return status | ||
|
||
if __name__ == "__main__": | ||
ao = ActiveObject('some_state') | ||
ao.live_trace = True | ||
ao.start_at(some_state) | ||
time.sleep(2) | ||
ao.post_fifo(Event(signal=signals.Destroy_This_Chart)) | ||
time.sleep(200) | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Allowing stop to be called within ActiveObject or Factory | ||
|
||
* the stop method can now be called within an ActiveObject or a Factory. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters