Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cfel-sc-public
Kamzik3
Commits
3d567b89
Commit
3d567b89
authored
May 16, 2022
by
Jerome Carnis
🦊
Browse files
deviceMethodWidget.py: fix mypy complaints
parent
f0ae1824
Pipeline
#28256
passed with stages
in 9 minutes and 33 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
kamzik3/gui/deviceMethodWidget.py
View file @
3d567b89
...
...
@@ -40,7 +40,7 @@ class DeviceMethodWidget(Ui_Form, DeviceWidget, StackableWidget):
parent
=
None
,
):
self
.
method
=
method
self
.
value_controls
=
()
self
.
value_controls
:
Tuple
[
QWidget
,
...]
=
()
DeviceWidget
.
__init__
(
self
,
device
,
model_image
=
model_image
,
config
=
config
,
parent
=
parent
)
...
...
@@ -287,24 +287,26 @@ class MethodEnabledByAttributeWidget(DeviceMethodEnabledWidget):
# emit a signal each time the external trigger value is changed
# callback(attribute_object[key_filter]) is called
self
.
device
.
attach_attribute_callback
(
attribute
=
ATTR_EXTERNAL_TRIGGER
,
callback
=
self
.
sig_control_changed
.
emit
,
key_filter
=
VALUE
,
)
# define the status of the input field using the current value of the attribute
self
.
control_changed
(
self
.
device
.
get_value
(
ATTR_EXTERNAL_TRIGGER
))
# create the checkbox for the attribute
control_widget
=
AttributeDeviceDisplayWidget
(
device
=
self
.
external_device_attribute
[
0
],
attribute
=
self
.
external_device_attribute
[
1
],
)
self
.
widget_holder
.
layout
().
insertWidget
(
3
,
control_widget
)
if
self
.
device
is
not
None
:
self
.
device
.
attach_attribute_callback
(
attribute
=
ATTR_EXTERNAL_TRIGGER
,
callback
=
self
.
sig_control_changed
.
emit
,
key_filter
=
VALUE
,
)
# define the status of the input field
# using the current value of the attribute
self
.
control_changed
(
self
.
device
.
get_value
(
ATTR_EXTERNAL_TRIGGER
))
# create the checkbox for the attribute
control_widget
=
AttributeDeviceDisplayWidget
(
device
=
self
.
external_device_attribute
[
0
],
attribute
=
self
.
external_device_attribute
[
1
],
)
self
.
widget_holder
.
layout
().
insertWidget
(
3
,
control_widget
)
self
.
set_status_label
(
self
.
device
.
get_value
(
ATTR_STATUS
))
self
.
value_controls
=
(
self
.
input_value
,)
self
.
set_status_label
(
self
.
device
.
get_value
(
ATTR_STATUS
))
self
.
value_controls
=
(
self
.
input_value
,)
class
DeviceSimpleMethodsListWidget
(
DeviceMethodWidget
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment