Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pyLIAF
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nicolas Nunez Barreto
pyLIAF
Commits
17f814bb
Commit
17f814bb
authored
Jun 15, 2021
by
Lucas Giardino
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
agrego opcion de cambiar colores en el big_number, para la facha
parent
77ac3153
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
0 deletions
+40
-0
big_number.py
pyLIAF/artiq/applets/big_number.py
+40
-0
No files found.
pyLIAF/artiq/applets/big_number.py
0 → 100644
View file @
17f814bb
#!/usr/bin/env python3
from
PyQt5
import
QtWidgets
from
artiq.applets.simple
import
SimpleApplet
class
NumberWidget
(
QtWidgets
.
QLCDNumber
):
def
__init__
(
self
,
args
):
QtWidgets
.
QLCDNumber
.
__init__
(
self
)
self
.
setDigitCount
(
args
.
digit_count
)
self
.
dataset_name
=
args
.
dataset
self
.
color
=
args
.
color
self
.
bg_color
=
args
.
bg_color
self
.
setStyleSheet
(
f
"QLCDNumber {{
\
color:{self.color};
\
background-color: {self.bg_color};
\
}}"
)
def
data_changed
(
self
,
data
,
mods
):
try
:
n
=
float
(
data
[
self
.
dataset_name
][
1
])
except
(
KeyError
,
ValueError
,
TypeError
):
n
=
"---"
self
.
display
(
n
)
def
main
():
applet
=
SimpleApplet
(
NumberWidget
)
applet
.
add_dataset
(
"dataset"
,
"dataset to show"
)
applet
.
argparser
.
add_argument
(
"--bg_color"
,
type
=
str
,
default
=
""
,
help
=
"color of the number to display"
)
applet
.
argparser
.
add_argument
(
"--color"
,
type
=
str
,
default
=
"black"
,
help
=
"color of the number to display"
)
applet
.
argparser
.
add_argument
(
"--digit-count"
,
type
=
int
,
default
=
10
,
help
=
"total number of digits to show"
)
applet
.
run
()
if
__name__
==
"__main__"
:
main
()
Write
Preview
Markdown
is supported
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