- class TMSiFrontend.components.channel_component.ChannelComponent(index, layout, widget, connect_chb=None, checked_state=True, connect_offset=None, offset_value=0, connect_scale=None, scale_value=100, connect_combo=None, name='Channel component')#
Bases:
object
Component to collect information for the channel
- __init__(index, layout, widget, connect_chb=None, checked_state=True, connect_offset=None, offset_value=0, connect_scale=None, scale_value=100, connect_combo=None, name='Channel component')#
Initialization of ChannelComponent
- Parameters:
index (int) – channel index
layout (Q*Layout) – parent layout where it lays
widget (QWidget) – Widget where it lays
connect_chb (function, optional) – action to be triggered when clicking on enabled/disabled checkbox, defaults to None
checked_state (bool, optional) – initial state of the checkbox (enabled or disabled), defaults to True
connect_offset (function, optional) – action to be triggered when changing offset, defaults to None
offset_value (float, optional) – initial offset value, defaults to 0
connect_scale (function, optional) – action to be triggered when changing scale, defaults to None
scale_value (float, optional) – initial scale value, defaults to 100
connect_combo (function, optional) – action to be triggered when changing color, defaults to None
name (str, optional) – name, defaults to “Channel component”
Methods
__init__
(index, layout, widget[, ...])Initialization of ChannelComponent
colors
()Available colors
delete
()Delete component
Get color rgb
Get component index
get_name
()Get channel name
Get the offset of the component
Get the scale of the component
set_checked
(checked)Set channel checked
set_color
(color_index)Set channel's color
set_offset
(value)Set offset of the component
set_scale
(value)Set scale of the component
set_text
(text)Set text of the component
- colors()#
Available colors
- Returns:
colors dictionary
- Return type:
dict
- delete()#
Delete component
- get_color()#
Get color rgb
- Returns:
rgb values for the selected color
- Return type:
tuple
- get_index()#
Get component index
- Returns:
index of the component
- Return type:
int
- get_name()#
Get channel name
- Returns:
the name of the channel
- Return type:
str
- get_offset()#
Get the offset of the component
- Returns:
offset
- Return type:
float
- get_scale()#
Get the scale of the component
- Returns:
scale
- Return type:
float
- set_checked(checked)#
Set channel checked
- set_color(color_index)#
Set channel’s color
- Parameters:
color_index (int) – index of the color to choose
- set_offset(value)#
Set offset of the component
- Parameters:
value (float) – offset
- set_scale(value)#
Set scale of the component
- Parameters:
value (float) – scale
- set_text(text)#
Set text of the component
- Parameters:
value (float) – text