led_icon
frog.gui.led_icon
¤
Class for LED Icons.
Classes¤
LEDIcon(on_img, off_img, is_on=False)
¤
Bases: QLabel
QLabel object to represent an LED with on/off status.
Creates the LED icon, sets its status and stores corresponding image data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
on_img
|
QImage
|
QImage for LED on state. |
required |
off_img
|
QImage
|
QImage for LED off state. |
required |
is_on
|
bool
|
On/off status of LED. |
False
|
Source code in frog/gui/led_icon.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
|
Functions¤
create_green_icon()
classmethod
¤
Creates a green LED icon.
Source code in frog/gui/led_icon.py
44 45 46 47 |
|
create_red_icon()
classmethod
¤
Creates a red LED icon.
Source code in frog/gui/led_icon.py
49 50 51 52 |
|
flash(duration=250)
¤
Turns the LED on for a specified duration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
duration
|
int
|
Number of milliseconds to keep LED lit for |
250
|
Source code in frog/gui/led_icon.py
64 65 66 67 68 69 70 71 |
|
turn_off()
¤
Turns the LED off.
Source code in frog/gui/led_icon.py
59 60 61 62 |
|
turn_on()
¤
Turns the LED on.
Source code in frog/gui/led_icon.py
54 55 56 57 |
|