Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
distributed oscilloscope
Project
Project
Details
Activity
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
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Projects
distributed oscilloscope
Commits
bde5bdd7
Commit
bde5bdd7
authored
Aug 14, 2019
by
Milosz Malczak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gui: added comments in the GUI
parent
06d8215d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
1 deletion
+40
-1
GUI.py
...ware/DistributedOscilloscope/applications/pyqt_app/GUI.py
+40
-1
No files found.
software/DistributedOscilloscope/applications/pyqt_app/GUI.py
View file @
bde5bdd7
...
...
@@ -66,27 +66,51 @@ class GUI_Class:
self
.
ui
.
run_control_layout
.
addWidget
(
self
.
run_stop_acquisition
)
def
register_ADC
(
self
,
unique_ADC_name
,
number_of_channels
):
"""
Registers a new ADC.
:param unique_ADC_name: name of the Device Application (ADC)
:param number_of_channels: number of channels in the ADC
"""
self
.
available_ADCs
.
append
(
unique_ADC_name
)
for
count
in
range
(
0
,
self
.
number_of_GUI_channels
):
self
.
channels
[
count
]
.
register_ADC
(
unique_ADC_name
,
number_of_channels
)
for
count
in
range
(
0
,
self
.
number_of_GUI_triggers
):
self
.
triggers
[
count
]
.
register_ADC
(
unique_ADC_name
)
self
.
triggers
[
count
]
.
register_ADC
(
unique_ADC_name
)
return
True
def
set_ADC_unavailable
(
self
,
unique_ADC_name
):
"""
Makes the ADC unavailable when other Application uses this ADC.
:param unique_ADC_name: name of the Device Application (ADC)
"""
for
count
in
range
(
0
,
self
.
number_of_GUI_channels
):
self
.
channels
[
count
]
.
set_ADC_unavailable
(
unique_ADC_name
)
for
count
in
range
(
0
,
self
.
number_of_GUI_triggers
):
self
.
triggers
[
count
]
.
set_ADC_unavailable
(
unique_ADC_name
)
def
set_ADC_available
(
self
,
unique_ADC_name
):
"""
Makes the ADC available when other Application stops using this ADC.
:param unique_ADC_name: name of the Device Application (ADC)
"""
for
count
in
range
(
0
,
self
.
number_of_GUI_channels
):
self
.
channels
[
count
]
.
set_ADC_available
(
unique_ADC_name
)
for
count
in
range
(
0
,
self
.
number_of_GUI_triggers
):
self
.
triggers
[
count
]
.
set_ADC_available
(
unique_ADC_name
)
def
unregister_ADC
(
self
,
unique_ADC_name
):
"""
Unregisters an ADC.
:param unique_ADC_name: name of the Device Application (ADC)
"""
self
.
available_ADCs
.
remove
(
unique_ADC_name
)
for
count
in
range
(
0
,
self
.
number_of_GUI_channels
):
self
.
channels
[
count
]
.
unregister_ADC
(
unique_ADC_name
,
True
)
...
...
@@ -97,6 +121,21 @@ class GUI_Class:
return
True
def
update_data
(
self
,
data
,
pre_post_samples
,
offsets
):
"""
Called by the Device Application.
Adds the acquisition data to the acquisition data queue in the ADC.
Every time the new data arrives, the ADC notifies the User Application
class, which checks if all rrequired data has arrived and is properly
aligned. If yes, it sends the data to the actuall User Application.
:param data: dictionary with GUI channels indexes as keys, containing
acquisition data
:param pre_post_samples: number of acquired presamples and postsamples
:param offsets: difference betwenn
"""
curr_time
=
timer
()
time_diff
=
curr_time
-
self
.
last_data_time
if
(
time_diff
<
0.1
):
...
...
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