Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .continue/rules/project-specific-rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
{}
---

Always read and follow .clinerules and CLAUDE.md
Always read and follow .clinerules and CLAUDE.md

Don't create new files, rather edit the existing files
27 changes: 27 additions & 0 deletions .github/workflows/rust-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,30 @@ jobs:
with:
name: fsm_linux
path: target/release/fsm

docs:
runs-on: ubuntu-latest
needs: build
if: github.ref != 'refs/heads/gh-pages' # Skip if triggered from gh-pages

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable

- name: Generate documentation
run: cargo doc --workspace --no-deps

- name: whereis
run: |
ls -la ./target/doc

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./target/doc
45 changes: 45 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug executable 'fsm'",
"cargo": {
"args": [
"run",
"--bin=fsm",
"--package=fsm",
],
"filter": {
"name": "fsm",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in executable 'fsm'",
"cargo": {
"args": [
"test",
"--no-run",
"--bin=fsm",
"--package=fsm"
],
"filter": {
"name": "fsm",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}"
}
]
}
48 changes: 30 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,38 @@
**Features**
- Type Save FSM (type state pattern)
- FSM run in their own thread
- communication via message queues
- State Transition and message handling boiler plate managed by `fsm!` macro
- Communication via bidirectional message queues
- State transition and message handling boiler plate managed by `fsm!` macro

One such FSM is a simplistic lathe:
```mermaid
stateDiagram-v2
state "Off" as off
state "Spindle Spinning" as spinning
state "Feed" as feeding
state "Emergency Stop" as notaus

One such FSM is a simplistic lathe
[*] --> off
off --> spinning
spinning --> feeding
spinning --> off
feeding --> spinning
off --> notaus
spinning --> notaus
feeding --> notaus
notaus --> off : Acknowledge
```

```plantuml
@startuml
state "Off" as off
state "Spindle Spinning" as spinning
state "Feed" as feeding
state "Emergency Stop" as notaus
Another FSM is a Mill with different state transitions but based on the same mechanics
```mermaid
stateDiagram-v2
state "Off" as off
state "Spinning" as spinning
state "Moving" as moving

off --> spinning
spinning --> feeding
spinning --> off
feeding --> spinning
off --> notaus
spinning --> notaus
feeding --> notaus
notaus --> off: Acknowledge
@enduml
[*] --> off
off --> spinning : StartSpinning(revs)
spinning --> off : StopSpinning
spinning --> moving : Move(linear_move)
moving --> spinning : StopMoving
```
13 changes: 7 additions & 6 deletions assistants/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
@README.md

## Documentation

## Documentatio
- When creating documentation, don't list dependencies.
- Don't mention mod.rs in drawings and other documentation. But you may read mod.rs to gain information about the structure

### Doc-Strings
- Focus on the "why" something is needed, don't explain "how" something works
- Be brief
- Ask, if not sure what to write

## Do

## Do
- **Do**: Ask before removing rust warnings because I do this myself. Give me an option to skip this step.
- **Do**: Doc Strings:
- focus on the intent of the code, not on the implementation. If unclear, ask.
Expand All @@ -18,6 +21,4 @@
## Don't
- **Don't** Comment things in unit tests
- **Don't** run the tests and start fixing things on your own. Ask first


- **Do not**: Write down what you just did at the end of a task
- **Don't**: Write down what you just did at the end of a task
Loading