Pico Engine UI -- Engine Rulesets page

Overview

Out of Date

The content on this page has not been updated to be consistent with the 1.0 release of the pico engine. 

The ruleset is the unit of compilation for KRL. Each ruleset has an identifier (RID), and its source code is located somewhere on the Internet, and thus it has a URL. You as a KRL developer choose where to locate the source code. For applications involving only your laptop, you may choose to locate the source code in your file system. In this case a ruleset's URL will use the file:// scheme.

A ruleset can only be executed when it is installed in a pico. It can only be installed in a pico when it has been registered with the pico engine which hosts that pico. Installing a ruleset in a pico is not done here, but rather in the Rulesets tab of the My Picos page.

The engine rulesets page is one way for you to manage the source code and registration of your rulesets. However, it does not help you place them somewhere on the Internet, nor does it have the ability to save them to your local file system. You will need to do that separately, using other tools.

The engine rulesets page does not save to disk

If you use the Engine Rulesets page to make changes to a ruleset registered in the pico-engine, you will need to take steps to save your work in your local filesystem or on the Internet.

The pico-engine keeps an internal cache of the source code (and URL) of each registered ruleset. This page helps you work with that cache.

Sections of the Engine Rulesets page

The page is shown here. Note that it is divided vertically into three sections.

The left hand side contains information about the pico-engine, the rulesets registered in it, and a few tools for managing rulesets.

The center column is an embedded editor to allow you to verify syntactic correctness of the ruleset and register it with the engine.

The right column contains information and tools for managing a ruleset when one has been selected.

Left column

This column contains:

  • The Pico Labs logo and the version of the pico-engine
  • A list of rulesets you have registered
  • The list of system rulesets (these currently all start with io.picolabs. but should be those present in the krl folder of the pico-engine)
  • A form to assist you in creating a new ruleset
  • A form to register a ruleset given the URL of its source code on the Internet (http:// or https:// scheme) or on your filesystem (file:// scheme)
  • A button which will create a zip file of the source code for all of the rulesets listed above

Center column

This column contains:

  • A button you can click to register the source code in the pico-engine
  • A drop-down menu to choose a theme for the source code editor
  • A source code editor
  • The status of the source code, with respect to its syntactic correctness

You should click the "Register" button only when the source code is syntactically correct.

Right column

This column can differ, depending on whether or not a ruleset has been selected and whether or not that ruleset has been modified in the pico-engine from its definitive version on the Internet (at its URL).

Right column with a ruleset consistent in the pico-engine and at its URL

Shown here, the Engine Rulesets page after registering a ruleset from this URL https://raw.githubusercontent.com/Picolab/pico_lessons/master/hello_world.krl

This column contains:

  • The ruleset identifier (or RID)
  • Given that it has not yet been modified in this editor, a section showing its URL
    • the URL (truncated, but you can hover over it, right click, and copy it into your clipboard)
    • a button labelled "flush" which you can use if the source code has been changed externally to bring the editor (and pico-engine) up to date
  • A section showing the history of edits done using this editor, with the oldest at the top, and the current version at the bottom
  • A link "delete ruleset" to unregister this RID from the pico-engine. You will be asked to confirm. Unregistration fails if the ruleset has been installed in any pico hosted by the engine

Right column with a ruleset which has been edited locally in the pico-engine

Shown here after some edits have been made using the Engine Rulesets editor

The URL section is now gone. This History section shows all versions. The code for the newest (current) version is displayed.

The timestamp of each previous version has become a clickable link.

Right column links for examining version changes

If you click on a previous version link, a new page will pop up showing the changes between that version (on the left) and the current version (on the right).

Copyright Picolabs | Licensed under Creative Commons.