Operator View is intended to allow you 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 by
...
Code modules.
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.
Accessible from the https://pekatvision.atlassian.net/wiki/x/yYKbKQ/spaces/KB31/pages/891847490/Camera+Functions?atl_f=PAGETREE tab by selecting Operator View > Edit.
...
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 https://pekatvision.atlassian.net/wiki/x/jYibKQ Context is True. You can then set this key in Code based on your own rules.
...
The camera element shows the current view from the camera - the same as you would see in the https://pekatvision.atlassian.net/wiki/spaces/KB31/pages/891847490/Camera+Functions?atl_f=PAGETREE tab. To see the evaluated view, Evaluation needs to be enabled in any module and the Process option enabled in the Camera tab.
...
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.
Items field can be used to specify the options available for the operator. You just need to write them into the field separated by semicolon ( ; ).
Target Key is the key in Context 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 Code where you access it.
This would be the code to acces the value if the target key is set to ‘input2’:
Code Block |
---|
context['operatorInput']['input2'] |
Note |
---|
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’. |
Slider
The 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).
...
Target Key is the key in Context which will contain the value which was selected entered in this field at the time the image was processed. You can then work with this value in Code where you access it with (.
This would be the code to acces the value if the target key is set to ‘input2’)‘input3’:
Code Block |
---|
context['operatorInput']['input2input3'] |
Note |
---|
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’. |
...
When you finish configuring your operator view in Editor, click on Save and go back to the Camera Functions tab and select Operator View > Open, 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.
...
Info |
---|
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 https://pekatvision.atlassian.net/wiki/x/2YibKQ Inspection 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. |
...