Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: begun proofread and rewrite for io.picolabs.wrangler

...

Contents

Table of Contents
maxLevel2

Pico Children

One of the important features of programming with picos is creating children. Solving programming problems with picos usually involves creating a system of picos that cooperate to solve the problem. This lesson introduces the concept of pico life-cycle management.

The pico that is created when your pico-engine started for the first time is called a "primary" or "ownerthe "root" pico and is the primary pico

  • Every pico except the primary root pico has a parent. 
  • You can create as many child picos as you like. 
  • Picos can be the children of other child picos and so on. 

Creating Children Using the UI

You can use the UI to manage child picos. 

Start by clicking on the "About" tab for your owner pico and then clicking the "New Childadd child pico" button, having provided a display name and, if you wish, a different color. In this lesson and the next, we'll be considering a system of picos which implement a registration system, so let's call the child "Registration Pico".

Here is a screenshot just before clicking the button:

And after. Notice the new child pico has a (randomly assigned) identifier and event channel identifier (ECI).

Visiting a Child Pico

Click on the ID link of the "Registration Pico" to see the "About" tab for this new child pico.

Notice that, while the owner root pico doesn't have a parent, this pico does.

For practice, create a child pico for this picofor the Registration Pico, naming it "Section Collection Pico" and giving it a different color.

Seeing the parent-child relationship

Click on the minus sign (actually, an en-dash) in the upper-right corner to see the layout of the pico collection so far. It should look something like this, after you move the picos around a bit:

Deleting child picos using the UI

You may have noticed in the "About" tab, beside the name of the picos you have created, that there is a link labelled "del". This allows you to manually delete the pico. 

For practice, create another child pico, starting at a pico of your choice and then delete it. Currently, the UI does not allow you to delete a pico which has children (until you first delete all of its children, etc. recursively).

Warning
Deleting a pico cannot be automatically un-done. Any channels and installed rulesets will be deleted with the child and can only be manually recovered.


...