Table of Contents

Table of Contents

FloWorks products

FloWorks products

User-defined product types

By default FloWorks uses numeric product IDs, but it is possible to define a custom set of products and their colors, instead of the default numeric product IDs.

This page describes how to use the Product editor, please see the Products page for more information about the concept of products in FloWorks and how they are used.

Switching to user-defined products

When you want to switch from numeric product IDs to using the Product Table for your model, there are two options.

  1. Click the Product Table button () to the right of the Product Type field in the properties panel of any FloWorks object.

    Create or Edit Product Table

    Once you have created the product table you can open it again by double clicking it in the Toolbox.

  2. By clicking the green "plus" button in the Toolbox and selecting FloWorks, then "Product Table".

    Create or Edit Product Table

  3. Both of these options bring up the Products Table Editor.

Edit product properties

To bring up the product table once your model has been configured to use one, there are two options.

  1. Click the Product Table button () to the right of the Product Type field in the properties panel of any FloWorks object.

    Create or Edit Product Table

  2. Double click the appropriate item in the Toolbox.

    Create or Edit Product Table

Both options will open the product table editor:

Product Table editor

Select the product you want to change on the left-hand side. The fields on the right will change to allow you to edit the properties of this product.

The buttons at the top allow you to:

  • Add Add a new product to the list of products
  • Remove Remove the selected product from the list. All products below it will shift up.
  • Remove table Remove the product table and go back to using numeric product IDs. See the section on switching back to numeric products.
  • Up / Down Move the product up and down in the list.

All other products

The All other products color picker indicates which color will be used for all FloWorks objects which do not have a product from the list. FloWorks objects may get a product which is not in the list because the product they were using was removed, because they had a numeric product ID (see previous section) higher than the number of products you define in the table, or because you have explicitly set the product ID (see previous section) higher than the number of products defined in the table.

Defining mixer recipes

Usually in FloWorks, flow mixers have locally defined recipes. This means that each flow mixer has a recipe table which defines the steps and ingredients required for each step. Since these recipe tables are not shared between two mixers, the ingredients table will reference specific input ports to decide from which input object an ingredient can be collected.

It is however possible to define the recipe for a specific product not locally on a single mixer, but globally in the model, so that multiple mixers in the model can mix the same product. These recipes are defined in the product table, and can then be loaded in the recipe table of a mixer using the "Load recipe" trigger option or the FlowMixer.loadrecipe method (see the class reference).

Entering a global mixer recipe is similar to the local mixer interface with one major difference: because different mixers in the model may acquire the same ingredient from different input ports, ingredients for global recipes are defined by product types. When a global recipe is loaded in a mixer's current recipe, the mixer uses its own Product Source trigger to decide from which specific input port each ingredient should be acquired.

To define a global recipe for a product, first make sure all ingredients have been defined. Then for the product you want to mix, check the "Define recipe for Flow Mixer" checkbox and use the Add Add button to add one or more steps for the recipe. The screenshot below shows an example of a global recipe.

The following screenshot shows how a "Load Recipe" event is added to the Reset trigger of a specific mixer and how its Product Sources table is filled.

Finally we can confirm that, after resetting the model, the global recipe for Strawberry Ice Cream has indeed been loaded on the mixer and that the general references to the ice cream ingredients have indeed been replaced with specific input port numbers according to the Product Sources table.

Switching back to numeric products

To switch back to numeric products, there are two options.

  1. If you already have the product table open (or open it using one of the two options described in the section editing user-defined products), the quickest way of removing it is using the Remove table button with the double cross.
  2. Delete the product table from the Toolbox. Right-click it and select Delete, or simply select it with the mouse and press the Delete button on the keyboard.
    Create or Edit Product Table

After clicking one of these two options, FloWorks will ask if you are certain that you want to remove the product table. Once you confirm this, the table will be deleted. All FloWorks objects will be assigned a numeric product ID, where objects with the same product will use the same numeric ID. The model should therefore still run, with the exception that calling the .product property from code will now return a number instead of the product name, and when you set this property you will need to assign a number instead of the name.