Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

Operator View is intended to give you an opportunity to design a simple UI for your line operators, where they can view the camera with an evaluation of the current image and optionally see other information or be able to enter/choose inputs, which can then be processed in /wiki/spaces/KB3141/pages/533529462.

Editor

Editor is the place where you can design, how the Operator View should look - determine what elements it should contain and customize its position, style, and function.

You can get to it from the Camera tab by selecting Operator View > Open Editor.

Elements

The Root and Camera elements are always present in Operator View, but you have the option to add and customize other elements like Label, Input, Select, Slider, or Image.

Position of element can be changed not only by entering specific X and Y number in its settings, but also by clicking on the element and dragging it around the view.

Visibility by key

This is a parameter for optional elements, which allows you to determine that a certain element will be visible only if the specified key in /wiki/spaces/KB3141/pages/533529551 is True. You can then set this key in Code based on your own rules.

E.g. this simple code sets visibility to True if an image is evaluated as NG and to False if an image is OK:

def main(context):
    context['visibility_key'] = not(context['result'])

Root

Root is the main element in which all the other elements are contained. You are able to choose the background color of the root element.

Camera

Camera element shows the current view from the camera - the same as you would see in the Camera tab. To see the evaluated view, evaluation needs to be enabled in some module and the Process option enabled in the Camera tab.

You can customize the position and size of the area where the camera should be shown and also turn Rectangles on and off.

Label

Label is an element that allows you to show text to the operator.

The basic settings you can choose are position, background color, text color, offset from the edge of the label rectangle, and also font size and visibility by key.

The source type parameter determines whether your text will be static (not changing) or dynamic (changing based on some variable in context).

If you choose static source type, you can enter your desired text in the Text field. This option where text is not changing can be useful to show some instructions, descriptions, etc.

If you choose dynamic source type you get the option to choose the /wiki/spaces/KB3141/pages/533529551 key which will contain the text to be displayed.

Then, you can change the specified context key in the /wiki/spaces/KB3141/pages/533529462 module for each processed image and the value the key currently has will be shown in the Label in Operator View.

E.g. if you enter this simple code in the /wiki/spaces/KB3141/pages/533529462 module, it will show the text ‘True’ in the label if an image is evaluated as OK and ‘False’ if an image is evaluated as NOK:

def main(context):
    context['label_key'] = str(context['result'])

Input

Input element allows the operator to write any input text into a field, which can then be processed in /wiki/spaces/KB3141/pages/533529462.

The basic settings you can choose are position, background color, text color, width, font size, and visibility by key.

You can also set the Label text for this input, which can describe what the operator should input in this field, e.g. product type, etc.

Enable Max Length option lets you limit the number of characters the operator is allowed to input into this field.

Target Key is the key in /wiki/spaces/KB3141/pages/533529551 which will contain the value which was entered in this field at the time the image was processed. You can then work with this value in /wiki/spaces/KB3141/pages/533529462 where you access it with (if the target key is set to ‘input1’):

context['operatorInput']['input1']

If you want to have multiple inputs (or selects/sliders - explained below) in the operator view, you have to set different target key for each of them, so e.g. set one to ‘input1’ and the other to ‘input2’.

Select

Select element allows the operator to select one of the defined options and the chosen option can then be processed in /wiki/spaces/KB3141/pages/533529462.

The basic settings you can choose are position, background color, text color, width, font size, and visibility by key.

You can also set the Label text for this select, which can describe what the operator should select in this field, e.g. product type, etc.

Slider

Slider element allows the operator to select a number from a given range set with min and max. Either by using the slider itself or the text field next to it (if enabled by Show text field).

The Label can be used to describe what kind of value is set by the slider. Apart from the position, you can also adjust the slider width and set visibility by key.

Disabling the text field can be used e.g. when trying to make an “on/off switch” between 0 and 1, otherwise, the text field is needed for showing the set value.

Target Key is the key in /wiki/spaces/KB3141/pages/533529551 which will contain the value which was selected in this field at the time the image was processed. You can then work with this value in /wiki/spaces/KB3141/pages/533529462 where you access it with (if the target key is set to ‘input2’):

context['operatorInput']['input2']

If you want to have multiple inputs/selects/sliders in the operator view, you have to set different target key for each of them, so e.g. set one to ‘input1’ and the other to ‘input2’.

Open Operator View

When you finish configuring your operator view in Editor, click on Save and go back to the Camera tab and select Operator View > Open operator View, then a window like this will open (with elements as you defined them in Editor) and the operator can start interacting with it:

If you press Statistics, you can inspect how many images were processed and what was the success rate during the time between selected dates.

For images you saved (when you had ‘Save images’ enabled or you ‘Captured' the image while the Operator View was running) you can see the operator inputs at that time in the /wiki/spaces/KB3141/pages/534446081 tab under 'operatorInput’ key, which is a dictionary containing key-value pairs for all your inputs/selects/sliders.

If you set some dynamic label, you can see the value of its context key (if you set its value in code) at that time under the context key name you selected, so e.g. 'label_key' in this example.

If you set visibility by key for some element and you set its value in code, you will see it here too under the name you selected for the key so e.g. ‘visibility_key’ in this example.

  • No labels