Python Statecharts#
Miros is a statechart library written in Python. A statechart is a hierarchical state machine (HSM), running within its own thread. If you program using statecharts, you will have the ability to quickly translate your design goals into robust, understandable, working code.
Contents#
- Installation
- Introduction
- Quick Start
- Tutorial: Zero to One
- Diagrams
- History and Context
- Install drawing software
- The Most Important Rule in UML
- Classes
- Inheritance and miros
- Events
- Event Processor Attachment Points
- States
- Deep History Icon
- If-Else Structures
- Extending Arrows
- Terminate Icon
- Final Icon
- Fall Through
- Publish and Subscribe Coloured Dots
- High Level Federation Diagrams
- Medium Level Construction and Pub/Sub Diagrams
- Detailed Statechart Diagrams
- Sequence Diagrams
- Payloads
- A Warning about Diagramming
- Examples
- Comprehensive
- Comprehensive with Instrumentation
- Thread Safe Attributes
- Hacking to Learn
- A Picture and a Question
- A Partial Answer
- A Better Answer
- Our First Working Hypothesis
- Code, Make a Picture
- Code, Required Imports
- Code, Frame in the States
- Code, Add Common Internal State Code
- Code, Add Hiearchy
- Code, Add the T and Init events
- Code, See if anything Runs
- Code, Add the guard and t function
- Code, Add the other functions
- Challenging Our Hypothesis
- Learning for my Mistake
- Interacting Statecharts (Same Machine)
- Using and Unwinding a Factory
- Orthogonal Regions
- Distributed Battery Charging
- High Level Introduction to how Batteries and Chargers Work
- Spec 1: Control Systems
- Spec 2: Battery Parameters
- Spec 3: Electrical Charging Profile
- Spec 4: Charger Behavioral Design
- Spec 5: High Level Verification Goals
- Spec 6: Battery Simulator
- Spec 7: Testing with Physics Simulation
- Spec 8: Current Derating in Constant Voltage Modes
- Cellular Automata
- Mongol Horse Archer
- Recipes
- Demonstration of Capabilities
- State Abstraction in Miros
- Minimal Viable States
- Attachment Points and a Working State Machine
- Feedback about Behavior through Instrumentation
- Entry Conditions and Handled Events
- Exit Conditions
- Inventing your own Signals: External events
- Hooks
- Comprehensive Instrumentation with the live_spy and scribble
- Attaching More than one ActiveObject to an HSM
- Making the Live Instrumentation use the Python Logger
- Making a Statechart from a class
- Communication between Statecharts
- Overload a State in a Subclass
- One-Shots, Multi-Shots and Heartbeats
- Creating thread-safe class Attributes
- States
- Events And Signals
- Creating an Event
- Creating a Signal
- Posting Events
- Posting an Event to the Fifo
- Posting an Event to the LIFO
- Create a Guard
- Creating a One-Shot Event
- Creating a Multishot Event
- Canceling a Specific Event Source
- Canceling Event Source By Signal Name
- Deferring and Recalling an Event
- Adding a Payload to an Event
- Determining if an Event Has a Payload
- Subscribing to an Event Posted by Another Active Object
- Publishing events to other Active Objects
- Catching Signals Based on Patterns and Tokens
- Avoiding Bugs Which Travel Through Time
- Avoiding double time heart beat bugs
- Avoiding Heart-Beat-Bleed Bugs
- ActiveObjects
- Factories
- Multiple Statecharts
- Seeing What is Going On
- Describing your Work
- Testing
- Demonstration of Capabilities
- Reflection
- Patterns
- Testing
- Glossary
- Architecture