Skip to content

Commit 251477b

Browse files
committed
state machine docs re-add
1 parent 3ea19ee commit 251477b

File tree

4 files changed

+35
-35
lines changed

4 files changed

+35
-35
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,3 +162,4 @@ cython_debug/
162162
#.idea/
163163

164164
skaffold.env
165+
TODO.md
Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,55 @@
1-
Using Finite State Machine
2-
--------------------------
3-
41
[API Reference](../../api-reference/thing/state-machine.md)
52

6-
Often, certain operations are not allowed during certain conditions, for example,
7-
one cannot turn ON a motor twice in a row, or one does not wish to change the
3+
Often, certain operations are not allowed during certain conditions, for example,
4+
one cannot turn ON a motor twice in a row, or one does not wish to change the
85
exposure of a camera during video capture (say).
96

10-
To implement these contraints, a state machine may be used to prevent property writes or
11-
action invokations in certain states (events are not supported). A `StateMachine` is a class-level
12-
attribute which accepts a finite list of states and the allowed properties and actions
7+
To implement these contraints, a state machine may be used to prevent property writes or
8+
action invokations in certain states (events are not supported). A `StateMachine` is a class-level
9+
attribute which accepts a finite list of states and the allowed properties and actions
1310
in these states:
1411

1512
```py title="Definition" linenums="1"
16-
--8<-- "docs/howto/code/fsm/def.py:1:1"
17-
--8<-- "docs/howto/code/fsm/def.py:12:15"
18-
--8<-- "docs/howto/code/fsm/def.py:34:36"
19-
--8<-- "docs/howto/code/fsm/def.py:40:41"
20-
```
21-
22-
Specify the machine conditions as keyword arguments to the `state_machine` with properties and actions
13+
--8<-- "docs/beginners-guide/code/fsm/def.py:1:1"
14+
--8<-- "docs/beginners-guide/code/fsm/def.py:12:15"
15+
--8<-- "docs/beginners-guide/code/fsm/def.py:34:36"
16+
--8<-- "docs/beginners-guide/code/fsm/def.py:40:41"
17+
```
18+
19+
Specify the machine conditions as keyword arguments to the `state_machine` with properties and actions
2320
in a list:
2421

2522
```py title="Specify Properties and Actions" linenums="1"
26-
--8<-- "docs/howto/code/fsm/def.py:1:2"
27-
--8<-- "docs/howto/code/fsm/def.py:12:41"
23+
--8<-- "docs/beginners-guide/code/fsm/def.py:1:2"
24+
--8<-- "docs/beginners-guide/code/fsm/def.py:12:41"
2825
```
2926

3027
As expected, one needs to set the `StateMachine` state to indicate state changes:
3128

3229
```py title="set_state()" linenums="1"
33-
--8<-- "docs/howto/code/fsm/def.py:13:15"
34-
--8<-- "docs/howto/code/fsm/def.py:54:63"
30+
--8<-- "docs/beginners-guide/code/fsm/def.py:13:15"
31+
--8<-- "docs/beginners-guide/code/fsm/def.py:54:63"
3532
```
3633

3734
One can also sepcify the allowed state of a property or action directly
3835
on the corresponding objects:
3936

4037
```py title="Specify State Alternate" linenums="1"
41-
--8<-- "docs/howto/code/fsm/def.py:13:15"
42-
--8<-- "docs/howto/code/fsm/def.py:64:"
38+
--8<-- "docs/beginners-guide/code/fsm/def.py:13:15"
39+
--8<-- "docs/beginners-guide/code/fsm/def.py:64:"
4340
```
4441

4542
State machines also push state change event when the state changes:
4643

4744
```py title="Definition" linenums="1"
45+
4846
```
4947

50-
One can suppress state change events by setting ``push_state_change_event=False``.
48+
One can suppress state change events by setting `push_state_change_event=False`.
5149

52-
Lastly, one can also supply callbacks which are executed when entering and exiting certain states,
50+
Lastly, one can also supply callbacks which are executed when entering and exiting certain states,
5351
irrespective of where or when the state change occured:
5452

5553
```py title="Definition" linenums="1"
56-
```
54+
55+
```

docs/introduction/contributing.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
We welcome contributions to `hololinked`! All types of contributions are encouraged and valued.
44

5-
> And if you like the project, but just don't have time to contribute, that's fine. There are other easy ways to support the project and show your appreciation, which we would also be very happy about:
5+
> If you like the project, but just don't have time to contribute, that's fine. There are other easy ways to support the project and show your appreciation, which we would also be very happy about:
66
>
77
> - Star the project
88
> - Tweet about it or share in social media
@@ -12,11 +12,11 @@ We welcome contributions to `hololinked`! All types of contributions are encoura
1212
1313
You can contribute in the following ways:
1414

15-
- Reporting bugs and issues
16-
- Suggesting new features
17-
- Improving documentation
18-
- Code
19-
- Submitting Examples or Implementations
15+
- reporting bugs and issues
16+
- submitting code
17+
- improving documentation
18+
- suggesting new features
19+
- submitting examples or implementations
2020

2121
For good first issues, visit repository wise:
2222

mkdocs.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ nav:
2222
- Using Actions: beginners-guide/articles/actions.md
2323
- Using Events: beginners-guide/articles/events.md
2424
- Using State Machine: beginners-guide/articles/state-machine.md
25-
- Configuring Thing Class:
26-
- Thing: beginners-guide/articles/thing/index.md
27-
- Using Different Protocols:
28-
- Object Proxy: beginners-guide/articles/object-proxy.md
29-
- Serialization: beginners-guide/articles/serialization.md
25+
# - Configuring Thing Class:
26+
# - Thing: beginners-guide/articles/thing/index.md
27+
# - Using Different Protocols:
28+
# - Object Proxy: beginners-guide/articles/object-proxy.md
29+
# - Serialization: beginners-guide/articles/serialization.md
3030
# API Reference
3131
- API Reference:
3232
- Thing:

0 commit comments

Comments
 (0)