DrSensor / DrSensor/scdlang

Generate timing diagram

Open
#27 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
103
Forks
2
PR merge metrics
No merged PRs in 30d

Description

### How it looks like? (maybe)
```scl
entry |> State1 |> exit

state State2 {
State21 >< activity

initial -> State21
State21 -> State22 @ Event
}

initial -> State1
State1 -> State2 @ Event[guard] |> action
State2 -> State1 @ Reset |> action
```
From 👆 to 👇
![Screenshot_20190706_065814](https://user-images.githubusercontent.com/4953069/60748745-58430a00-9fbb-11e9-89d5-f9be4327c25a.png)
```js
{signal: [
{name: 'execution', wave: '03524.02350', data: ['entry', 'exit', 'action', 'activity', 'action', 'entry', 'exit']},
{name: 'trigger', wave: '0..=0.==0..', data: ['Event [guard]', 'Event', 'Reset']},

{name: 'State1', wave: '01.x...1..0'},
['State2',
{name: 'State21', wave: '0x.1..x...0'},
{name: 'State22', wave: '0x....1x..0'},
],
],
config: { hscale: 3 }
}
```
Paste 👆 to https://wavedrom.com/editor.html
> I think I should move `action`, `entry`, and `exit` inside state timeline 🤔. Also separate `activity` to different lifeline, especially when in the compound state.

> However, for easier implementation, it should lay flat. Imagine having an action that executed many times, how long the `data` will be 😅

#### Something needs to watch out!
- waveform doesn't automatically fit the diagram with the texts
- probably there will be a need for sorting (I hope not because I use `wave: 0.x..0`) if I want to support Arrows Splines
- `activity` inside Compound State could be tricky to visualize. Maybe `activity` should be separated as a different lifeline

###### References
- [legends about Timing Diagrams](https://www.uml-diagrams.org/timing-diagrams.html) (recommended)
- [Hitchhiker's Guide to the WaveDrom](https://observablehq.com/@drom/wavedrom)

###### Related issues
- https://github.com/wavedrom/wavedrom/issues/195

###### Viewers
- https://github.com/Nic30/d3-wave

###### Other approachs
- transpile into [LLHD](http://www.llhd.io) then visualize using gtkwave or alike
- generate [VCD](https://en.m.wikipedia.org/wiki/Value_change_dump) file

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.