Skip to content

A straightforward way to write Concurrent Task Trees in plain text, with a fast visualizer.

Notifications You must be signed in to change notification settings

EmileSonneveld/CTT-editor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

126b2d6 · Oct 17, 2019

History

55 Commits
Apr 9, 2019
Jan 22, 2019
Dec 13, 2018
Oct 17, 2019
Oct 17, 2019
Oct 17, 2019
Apr 8, 2019
Dec 10, 2018
Oct 17, 2019
Oct 17, 2019
Dec 10, 2018
Dec 10, 2018

Repository files navigation

CTT-editor

A straightforward way to write Concurrent Task Trees in plain text, with a fast visualizer.

To Compile: sbt fastOptJS

Binary release is available on GitHub.

How task icons are chosen:

val sp = name.split(' ')
if (icons.contains(sp.last)) return sp.last + ".gif"
if (children.size > 0) return "abstraction.gif"
val n = name.toLowerCase()
if (Operator() != null) return ""
if (n.startsWith("show")
|| n.startsWith("check")
|| n.startsWith("print")
|| n.startsWith("is")) return "application.gif"
return "interaction.gif"
How operator priority is defined:
new CttOperator("[]", 1, "Choice"),
new CttOperator("|=|", 2, "Order independant"),
new CttOperator("|||", 2, "Interleaving"),
new CttOperator("|[]|", 2, "Interleaving with information exchange"), // priority unsure
new CttOperator("||", 2, "Parallelism"), // priority unsure
new CttOperator("[>", 3, "Deactivation"),
new CttOperator(">>", 4, "Enabling"),
new CttOperator("[]>>", 4, "Enabling with information exchange"),
new CttOperator("|>", 4, "Suspend-resume"), // priority unsure

What it does:

  • Edit CTTs in an easy plain text format
  • Render CTTs in SVG
  • Make a simplified/normalized CTT, considering the priority of operations
  • Generate Enabled Task Sets for a CTT
  • All logic happens in the frontend. Backend code only serves and stores files.

TODO:

  • Be able to refer to tasks defined in another file.
  • Detect recursive tasks and give appropriate icon.
  • Verify if Enabled Task Sets work correctly for optional tasks
  • Check inputted CTT on problems:
    • Syntax in text file
    • exercise 1: A looping task without deactivation
    • exercise 2: Or operations [] between optional tasks
    • exercise 3: Ambiguity in order of operations
    • exercise 4: Select task, before something is shown
    • exercise 6: UI specific words, like 'click'
    • Slide 20: With option task, the first chooses should not be application tasks

Some things I learned:

  • Scala is a very smooth programming language. But has to many features.
  • Maven dependencies just seem to work.
  • Java-FX has no descend way to render SVG
    • When using a WebView, assets with a relative path are not loaded.
  • Using el.innerHTML is very fast. I use it to load the SVG in the html page, to be less dependent on platform specific code.
  • Sync requests don't seem that bad when the site is always loading on localhost. A request takes ~ 10ms.
  • The backend (CrudServer) is very simple backend that gives the user all file permissions in the folder where it operates. For applications running locally, this isn't a security problem. For online applications, this should only be used in small teams with people you trust.
  • Inkscape has some problems with displaying SVGs while browsers mostly handle everything.

Building

CrudServer and ctt-editor-fastopt.js need to be built separately. Copy them to the correct location and commit to save a new version.

About

A straightforward way to write Concurrent Task Trees in plain text, with a fast visualizer.

Resources

Stars

Watchers

Forks

Packages

No packages published