Skip to content

Instantly share code, notes, and snippets.

@edgerunner
Last active April 10, 2019 08:04
Show Gist options
  • Save edgerunner/7e045c59b85bd2cd8dba6e9e82692810 to your computer and use it in GitHub Desktop.
Save edgerunner/7e045c59b85bd2cd8dba6e9e82692810 to your computer and use it in GitHub Desktop.
Ironer&
Ironer&
Motor
reset -> Stopped
Stopped*
start -> Started
Started
stop -> Stopped
Forward*
curtain triggered -> Reverse
Reverse
curtain released -> Forward
Burner
Off*
power on -> On
On
power off -> Off
low gas pressure -> Failed
stop -> Off
Checking*
check ok -> Sweeping
Sweeping
sweep timer done -> Ignition
Ignition
flame detected -> Operation
ignition timeout -> Failed
Operation
flameout -> Failed
Failed
reset -> Checking
function render(model){
const stateName = (s) => {
if (s.name === "root") { return ":"; }
if (s.parent) { return `${stateName(s.parent)}:${s.name}`; }
else { return s.name; }
}
let current_state_names = model.active_states.map(stateName).join(" ");
return $("h1",
{style: {color: "darkBlue"}},
`The current state is: ${current_state_names}`);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment