Skip to content

Instantly share code, notes, and snippets.

@ricehornet
Forked from jjmilburn/SketchSystems.spec
Last active December 4, 2020 00:58
Show Gist options
  • Save ricehornet/6d844a26f2b98a178d3c37f0d275d758 to your computer and use it in GitHub Desktop.
Save ricehornet/6d844a26f2b98a178d3c37f0d275d758 to your computer and use it in GitHub Desktop.
Generating dlight unit keycode
Generating dlight unit keycode
#dlight server index is unknown
Angaza index is X*
get_dlight_server_latest_token_data -> unit number exists on dlight server?
unit number exists on dlight server?
yes? -> dlight latest token index is X minus 1 or None?
no? -> Raise error require ticket to add unit on dlight side
dlight latest token index is X minus 1 or None?
yes? -> dlight_create_token_with_id_x
no? -> is dlight server index and token value equal to Angaza index and requested value?
dlight_create_token_with_id_x
success -> store token and update Angaza index to token index
failure -> Angaza index is X
is dlight server index and token value equal to Angaza index and requested value?
yes? -> store token and update Angaza index to token index
no? -> is dlight server index and token value greater than Angaza index and requested value?
is dlight server index and token value greater than Angaza index and requested value?
yes? -> dlight_create_token_with latest token value from dlight
no? -> Fail as this indicates angaza is ahead of dlight somehow and we can adjust our index
dlight_create_token_with latest token value from dlight
always -> store token and update Angaza index to token index
Raise error require ticket to add unit on dlight side
store token and update Angaza index to token index
Fail as this indicates angaza is ahead of dlight somehow and we can adjust our index
function render(model){
let current_state_name = model.active_states[0].name;
return $("h1",
{style: {color: "darkBlue"}},
`The current state is: ${current_state_name}`);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment