File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import
2+ "https://raw.githubusercontent.com/CollaborativeStateMachines/Cirrina/refs/heads/develop/src/main/resources/pkl/csm/csml.pkl"
3+
4+ import "events.pkl" as Events
5+ import "serviceTypes.pkl" as ServiceTypes
6+
7+ beltFsm = new csml .StateMachine {
8+ states {
9+ ["loadingState" ] = new csml .Initial {
10+ on {
11+ [Events.eObjectValid] {
12+ to = "transportingState"
13+ }
14+ [Events.eJobDone] {
15+ to = "jobDoneState"
16+ }
17+ }
18+ }
19+ ["transportingState" ] {
20+ entry {
21+ new csml .Invoke {
22+ type = ServiceTypes.stMoveBelt
23+ }
24+ }
25+
26+ exit {
27+ new csml .Invoke {
28+ type = ServiceTypes.stStopBelt
29+ }
30+ }
31+
32+ on {
33+ [Events.eStartUnload] {
34+ to = "unloadingState"
35+ }
36+ [Events.eJobDone] {
37+ to = "jobDoneState"
38+ }
39+ }
40+ }
41+
42+ ["jobDoneState" ] = new csml .Terminal {}
43+
44+ ["unloadingState" ] {
45+ entry {
46+ new csml .Emit { event { topic = Events.eArmPickup }; target = "'arm'" }
47+ }
48+
49+ after {
50+ ["armPickupTimeout" ] {
51+ delay = "1000"
52+ triggers = new csml .Emit { event { topic = Events.eArmPickup }; target = "'arm'" }
53+ }
54+ }
55+
56+ on {
57+ [Events.eJobDone] {
58+ to = "jobDoneState"
59+ }
60+
61+ [Events.ePickedUp] {
62+ to = "loadingState"
63+ }
64+ }
65+ }
66+ }
67+ }
You can’t perform that action at this time.
0 commit comments