AugeLab Studio Manual
English
English
  • 👋Welcome to AugeLab Studio User Manual
  • 📘Introduction
    • AugeLab Studio
    • Key Features
    • Use Cases
    • System Requirements
  • 🚀Getting Started
    • Signing up
    • Installation
    • First Look
    • Simple Tour
    • Your Very First Project
      • Basics
      • Detection
      • Wrapping Up
    • More Local Examples
    • Further Reading
  • 🖥️AugeLab Studio Interface
    • Detailed Look
    • Scenario Area
    • Menu and Toolbar
    • Managing Projects
    • Installing AI and much more
      • Leverage AI with Module Downloader
  • 🧱Function Blocks
    • Block Structures
    • Sockets
    • Blocks Column
    • Connections
    • All Function Blocks
      • AI Blocks
        • Face Detection
        • Mask Detection
        • Object Detection - Custom
        • Object Detection
        • Pose Estimation
        • Safety Equipment Detection
        • Social Distance Detector
        • Super Resolution
        • Text Detection
        • OCR
      • CNN Blocks
        • Average Pooling 2D
        • Batch Normalization
        • Choose Folder 2D
        • Compile Model
        • Conv. Sep. Layer 2D
        • Conv. Trans. Layer 2D
        • Convolutional Layer 2D
        • Dropout Layer
        • Flatten Layer 2D
        • Fully Connected
        • Global Average Pooling 2D
        • Global Max Pooling 2D
        • Input Layer 2D
        • Loss CCE
        • Max Pooling 2D
        • Metrics Accuracy
        • Model EfficientNet
        • Model MobileNet
        • Model ResNet
        • Model VGG
        • Optimizer Adadelta
        • Optimizer Adagrad
        • Optimizer Adam
        • Optimizer Adamax
        • Optimizer FTRL
        • Optimizer Nadam
        • Optimizer RMSProp
        • Optimizer SGD
        • ReLU Layer
        • Softmax Layer
        • Training Parameters
      • Data/Logic
        • Flow Control
          • Batch Concatenation
          • Batch Processing
          • Debatch
          • Get Batch Size
          • HMI Background
          • Subsystem Enabled
          • Subsystem In
          • Subsystem Loop
          • Subsystem Out
          • Subsystem
        • logic
          • All True
          • And
          • Demux
          • Equals
          • Greater
          • Logic Operations
          • Mux
          • Not
          • Or
          • Set - Reset
          • Smaller
        • Mathmetical Operations
          • Add
          • Counter
          • Divide
          • Math Operations
          • Maximum
          • Minimum
          • Multiply
          • Not Equals
          • Round
          • Square Root
          • Subtract
          • Trigonometry
        • Data Operations
          • Data Memory
          • Data to JSON
          • Data Type Converter
          • Datetime Compare
          • Dictionary Operations
          • Exclude Nones
          • Find Substring
          • Get Element
          • Is None
          • List Operations
          • Parse Data Dictionary
          • Replace None
          • String Merge
          • String Operations
        • Referencing
          • Data Read Global
          • Data Read Local
          • Data Write Global
          • Data Write Local
          • Debug Input
          • Tag From
          • Tag To
        • Signal Operators
          • Delay Step
          • Edge Falling
          • Edge Rising
          • Multi Port Switch
          • OFF Delay
          • ON Delay
      • Image/Transformations
        • Analysis
          • Color Density Percentage
          • Get Dimension
          • Histogram On Curve
          • Histogram On Line
          • Image Color Match
          • Image Memory
          • Image Resolution and Channel Value
          • Maximum Images
          • Mean Value of Image
          • Measure Position Distance
          • Minimum Images
          • Non-zero of Image
          • Std. of Image
          • Structural Similarity
        • Transformation Filters
          • Auto Alignment
          • Auto Contrast
          • Color Quantizer and Clustering
          • Color Space
          • Contrast-Brightness-Gamma
          • Contrast Optimization
          • Deconvolution
          • Denoising
          • Distance Transformation
          • FloodFill
          • Grab Cut Algorithm
        • Color Filters
          • 2D Filter
          • Apply Mask
          • Bilateral Filter
          • Blur
          • Edge Filter
          • HSV Filter
          • Image Adaptive Threshold
          • Image Threshold
          • Invert Image
          • Morphological Transformations
          • Normalize Image
          • RGB Mask
          • RGB Set
          • Sobel Filter
        • Operations
          • Add Images Weighted
          • Add Images
          • Collage Images
          • Divide Images
          • Flip Image
          • Image AutoRotator
          • Image Concatenate
          • Image Resize
          • Image Resizer
          • Merge Channels
          • Multiply Images
          • Polar Transform
          • Rotate Image Angle
          • Slice Image
          • Split Image
          • Subtract Images
      • Detections/Shapes
        • Detectors
          • Barcode Reader
          • Blob Detector
          • Blur Detector
          • Circle Detector
          • Corner Detector
          • Custom CNN Model
          • Data Matrix Reader
          • Detect Reference
          • Feature Detector
          • Find Object - Multiple Image
          • Find Object
          • Find Reference
          • Harris Corner Filter
          • Line Detector
          • Match Shapes
          • Measure Object Distance
          • Shape Detector
        • Draw
          • Draw Detections
          • Draw Line
          • Draw Point
          • Draw Rectangle
          • Draw Result On Image
          • Write Date On Image
          • Write Text On Image
        • Roi Processing
          • Check Area (Polygon)
          • Check Area
          • Get Pixel Mouse
          • Get Pixel
          • Get ROI
          • Image ROI Center
          • Image ROI Polygon
          • Image ROI Select Multi
          • Image ROI Select
          • Image ROI
          • Perspective Transform
          • Rectangles in Rectangle
        • Shape Analysis
          • Approximate Contour
          • Choose Line
          • Contour to Image
          • Fill Contour
          • Find Contour
          • Hull Convex
          • Minimum Circle
          • Minimum Ellipse
          • Minimum Rectangle
          • Minimum Rotated Rectangle
          • Most Similar Shape
          • Point Polygon Test
      • Input/Output
        • Communication
          • Modbus Connect
          • Modbus Read
          • Modbus Write
          • MQTT Publish
          • MQTT Subscribe
          • OPC UA Client
          • OPC UA Read
          • OPC UA Write
          • REST API - Get
          • REST API - Post
          • Send Mail
          • Siemens S7 Connect
          • Siemens S7 Read
          • Siemens S7 Write
        • Data Inputs
          • Date-Time List
          • Date-Time
          • Headless Check
          • Keyboard/Barcode Reader
          • Logic Input
          • Number Input
          • Number Range
          • PWM (Pulse Width Modulation)
          • Rising Edge
          • String Input
          • Text
        • Image Inputs
          • Camera IP (ONVIF)
          • Camera IP
          • Camera USB External
          • Camera USB Vidgear
          • Camera USB
          • Load Image From Path
          • Load Image
          • Make Image
          • Pixel
          • Video
        • Outputs/Exports
          • CSV Export
          • Cycle Timer
          • File/Folder Operations
          • GPU Statistics
          • Image Logger
          • Image Write
          • Led Output
          • Multi Image Write
          • Output
          • Scope
          • Show Image
          • Stop
  • 📡Devices and Communication
    • Camera Usage
    • Communication Protocols
    • Further Reading
  • 🧩Example Projects
    • Demo Projects
    • Circumference Measurement
    • Object Counting
    • Tile Width Measurement
    • Human Detection
    • Object Detection
  • 🔑Key Features
    • Deploy Custom HMI Applications
    • Annotate Data for Object Detection
    • Train Custom AI Models
      • Choosing the Right Database
      • When to Stop Training
    • Create Plugins
      • Components
      • Coding Reference
    • Share Your Solutions with Community
    • Instal Python Packages
  • 📑FAQ
    • Contact Us
    • FAQ
    • Setting up a full project
  • Additional Resources
    • Training Schedule
    • Training Materials
    • AugeLab Experts
  • Appendix
    • Dictionary
    • References
Powered by GitBook
On this page
  • Text Input
  • Drop Down List
  • Label
  • Slider
  • Slider Labeled
  • CheckBox
  • Button
  • Image
  • Table

Was this helpful?

  1. Key Features
  2. Create Plugins

Components

PreviousCreate PluginsNextCoding Reference

Last updated 8 months ago

Was this helpful?

Components are interactable widgets that allows users to configure parameters or see results from your custom widget.

Components are constructed by keyword arguments.

Generic Arguments

Generic arguments apply to all custom componenets. You can provide them as keyword arguments to constructors.

tooltip: str = ''

Text Input

Allows users to input text/number through a single line.

Constructor:

TextInput

Keyword Arguments:

text: str = '5' : Default value of Text Input

place_holder: str = '' : Text to be shown when the Text Input is empty.

Attributes-Methods

text -> str : Receive current text written on Text Input

Example:

class Example_Block(Block):
    ...
    def init(self):
        ...
        self.param['text1'] = TextInput(text= '5', 
                                        place_holder='Enter a number', 
                                        tooltip='Defines constant')
    
    def run(self):
        ...
        raw_constant: str = self.param['text1'].text
        constant: int = int(raw_constant)  # casting into integer
        ... 

Drop Down List

Drop down lists allows users to choose an option from a provided list of texts.

Constructor:

DropDown

Keyword Arguments:

items: list[str, ...] = ['item1', 'item2', 'item3']: List of texts that are shown on the drop down list.

Attributes-Methods:

selected_item -> str: Returns selected item text. Returns '' if no text available.

selected_index -> int: Returns selected item as integer. Returns 0 if no item is available.

Example:

class Example_Block(Block):
    ...
    def init(self):
        ...
        self.param['drop_down'] = DropDown(items=['Method 1, Method 2', 'Method 3'], 
                                        tooltip='Choose Method')
    
    def run(self):
        ...
        raw_constant: int = self.param['drop_down'].selected_index()
        if raw_constant == 0:
            ... 

Label

Labels are simple text based components to statically or dynamically show text on your custom block.

They are also used to provide information about interactable components:

Constructor:

Label

Keyword Arguments:

text: str = '': List of texts that are shown on the drop down list.

Attributes-Methods:

set_text(text: str): Set text of of label.

Example:

class Example_Block(Block):
    ...
    def init(self):
        ...
        self.param['label'] = Label(text='Result is: Not Set', 
                                        tooltip='Shows mean value')
    
    def run(self):
        ...
        self.param['label'].set_text(f'Result is: {n}')
        ... 

Slider

Restricts user input to range of numbers.

Constructor:

Slider

Keyword Arguments:

min: int = -5: Minimum value shown on slider..

max: int = 5: Maximum value.

val: int = 3: Initial value.

Attributes-Methods:

value -> int: Current value of slider.

Example:

class Example_Block(Block):
    ...
    def init(self):
        ...
        self.param['slider'] = Slider(min=-5, max=5, val=3)
    
    def run(self):
        ...
        threshold: int = self.param['slider'].value
        ... 

Slider Labeled

Constructor:

SliderLabeled

Keyword Arguments:

min: int = -5: Minimum value shown on slider..

max: int = 5: Maximum value.

val: int = 3: Initial value.

label: str ="Value": Label text to be shown.

multiplier: float | int = 1: Multiply shown value before addition. Using this with add will allow you show odd numbers if you please.

add: float | int = 0: Added value after multiplication.

Attributes-Methods:

value -> int: Current raw value of slider.

modifiedValue -> int | float: Current modified value of slider.

Example:

class Example_Block(Block):
    ...
    def init(self):
        ...
        self.param['threshold_odd'] = SliderLabeled(min= -5, max= 5, val= 3, label="Value", multiplier = 2, add = -1)
    
    def run(self):
        ...
        threshold_odd: int = self.param['threshold_odd'].modifiedValue
        ... 

CheckBox

Allows logic state input.

Constructor:

CheckBox

Keyword Arguments:

text: str = '': Text to be shown beside checkbox.

Attributes-Methods:

is_checked -> str Set text of of label.

Example:

class Example_Block(Block):
    ...
    def init(self):
        ...
        self.param['gray_mode'] = CheckBox(text=': Gray Mode')
    
    def run(self):
        ...
        flag_gray: bool = self.param['gray_mode'].is_checked
        ... 

Button

Triggers an event in your script on mouse click. This component is also very useful for resource management for custom blocks in your scenario.

Constructor:

Button

Keyword Arguments:

text: str = '': Text to be shown beside checkbox.

Attributes-Methods:

set_clicked_callback(callback: Callable): Set callback function to be triggered everytime the button is clicked.

Using set_clickbed_callback is always used in init part of your custom block script.

Example:

...
class Example_Block(Block):
    ...
    file_path: str = ''
    def init(self):
        ...
        self.param['Choose File'] = Button(text= 'Choose File')
        self.param['Choose File'].set_clicked_callback(load_image)
    
    def load_image(self):
        path = QAFileDialog.getOpenFileName(caption='Load Image', 
                                        directory='C:/Images', 
                                        filter='Image Files (*.png *.jpg *.bmp)')
        self.file_path = self.register_resource('image-path', path)
        
    def run(self):
        image_path = self.get_resource('image-path')
    

Image

Constructor:

Image

Keyword Arguments:

fixed_width: int = 80: Image height, best to be used with Block.width

fixed_height: int = 80: Image width, best to be used with Block.height

Attributes-Methods:

update(img: npt.NDArray[np.uint8]): Update image shown with three or one dimensions.

Example:

...
class Example_Block(Block):
	def init(self):
		...
		self.param['Result'] = Image(fixed_width=self.width-40,  
					     fixed_height=self.height-80)

	def run(self):
		...
		self.param['Result'].update(np.zeros((60, 60, 3)))
		...

Table

Allows multiple items/modes to be selected at the same time.

Constructor:

Table

Keyword Arguments:

items: list[str, ...] = ['item1', 'item2', 'item3']: List of texts that are shown on the table list.

Attributes-Methods:

items -> list[str, ...]: Get list of all items.

selected_items -> list[str, ...]: Get list of selected items.

set_items(items: list[str, ...]): Set item list.

Example:

...
class Example_Block(Block):
	def init(self):
		...
		self.param['Detection List'] = Table(items=['Human', 'Cat', 'Dog'])

	def run(self):
		...
		detection_list: list[str, ...] = self.param['Detection List'].selected_items()
		...

Same as but adds a label that automatically shows which value is shown in component.

Example above utilizes callbacks using and .

🔑
Slider
register_resource
get_resource