-
Notifications
You must be signed in to change notification settings - Fork 1
/
statemachine.shape
71 lines (59 loc) · 2.15 KB
/
statemachine.shape
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
##preamble \usepackage{mlsstyle}
##needs ..Shapes..Layout / centering-X
##needs ..Applications..Blockdraw
##needs state-machines.shext
##lookin ..Shapes..Graphics
##lookin ..Shapes..Text
##lookin ..Shapes..Geometry
##lookin ..Shapes..Layout
##lookin ..Shapes..Traits
##lookin ..Shapes..Data
##lookin ..Shapes..IO
##lookin ..Shapes..Numeric..Math
##lookin ..Applications..Blockdraw
stateBlock: \ name →
{
@width:stateBorderWidth & @stroke:stateColor | [stroke [stateRoundRect (~40mm,~5mm) (40mm,5mm)]]
&
((stateNameStyle | (newText << name)) >> center)
}
state1: [putblockOrigin •page [stateBlock `state1´]]
state2: [putblockBelow •page [stateBlock `state2´] state1 15mm]
{
pth: [toppoint state1]--((+0m),(+8mm)) >> reverse
•page << transitionStyle | [stroke pth tail:initialStateTail head:resetHead]
}
{
pth: [bottompoint state1 5 1]--[toppoint state2 5 1]
•page << transitionStyle | [stroke pth head:resetHead]
c: [putblockOrigin •page [immediateCondition pth]]
•page << [putlabelLeft [TeX `a´] [leftpoint c] 0]
}
{
pth: [bottompoint state1 5 2]--[toppoint state2 5 2]
•page << transitionStyle | [stroke pth head:resetHead]
c: [putblockOrigin •page [delayedCondition pth]]
•page << [putlabelLeft [TeX `2:\,b´] [leftpoint c] 0]
}
{
pth: [bottompoint state1 5 3]--[toppoint state2 5 3]
•page << transitionStyle | [stroke pth head:normalHead]
c: [putblockOrigin •page [immediateCondition pth]]
•page << [putlabelLeft [TeX `3:\,c´] [leftpoint c] 0]
}
{
pth: [bottompoint state1 5 4]--[toppoint state2 5 4]
•page << transitionStyle | [stroke pth head:normalHead]
c: [putblockOrigin •page [delayedCondition pth]]
•page << [putlabelLeft [TeX `4:\,d´] [leftpoint c] 0]
}
{
pth: [bottompoint state1 5 5]--[toppoint state2 5 5]
•page << transitionStyle | [stroke pth head:resetHead tail:synchronizeTail]
c: [putblockOrigin •page [immediateCondition pth]]
condHelper: [rightpoint c]--(+(10mm,5mm))
•page << conditionHelperStyle | [stroke condHelper]
•page << [putlabelRight [TeX `5:\,e´] condHelper.end.p 0]
}
contents: [bboxed_sym_x (•page)]
[bboxed contents [bbox contents] 'bleed]