Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
total_control_app
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
Martin Drechsler
total_control_app
Commits
00109e28
Commit
00109e28
authored
Jun 26, 2019
by
Martin Drechsler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rigol measurement
parent
6063820e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
0 deletions
+66
-0
rigol_measurement.py
rigol_measurement.py
+66
-0
No files found.
rigol_measurement.py
0 → 100644
View file @
00109e28
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
tip: pyuic5 -x ventana.ui -o ventana_ui.py
@author: martindrech
This is a fast solution, for controlling and performing measurements with the rigol function generator.
"""
from
PyQt5
import
QtCore
,
QtWidgets
,
QtGui
from
PyQt5.QtCore
import
QSettings
from
PyQt5.QtWidgets
import
QAction
,
QFileDialog
,
QInputDialog
,
QWidget
from
resources.rigol_measurement_ui
import
Ui_Frame
from
appsettings
import
WORKING_DIR
class
RigolMeasurementFrame
(
QtWidgets
.
QFrame
,
Ui_Frame
):
def
__init__
(
self
):
super
()
.
__init__
()
self
.
setupUi
(
self
)
self
.
treeModel
=
QtGui
.
QStandardItemModel
()
self
.
treeView
.
setAlternatingRowColors
(
True
)
self
.
treeView
.
setSortingEnabled
(
True
)
self
.
treeView
.
setHeaderHidden
(
False
)
self
.
treeView
.
setSelectionBehavior
(
QtGui
.
QAbstractItemView
.
SelectItems
)
self
.
treeView
.
setEditTriggers
(
QtGui
.
QAbstractItemView
.
NoEditTriggers
)
self
.
treeModel
.
setHorizontalHeaderLabels
([
'Parameter'
,
'Value'
])
self
.
treeView
.
setModel
(
self
.
treeModel
)
self
.
treeModel
.
insertRow
(
0
)
self
.
treeModel
.
setData
(
self
.
treeModel
.
index
(
0
,
0
),
r'df (kHz)'
)
self
.
treeModel
.
setData
(
self
.
treeModel
.
index
(
0
,
1
),
'?'
)
self
.
saveMeasureButton
.
setEnabled
(
False
)
self
.
configure_spinBoxes
()
def
select_folder
(
self
):
directory
=
QFileDialog
.
getExistingDirectory
(
self
,
'Choose directory'
)
def
configure_spinBoxes
(
self
):
self
.
startValue
.
setMinimum
(
0
)
self
.
startValue
.
setMaximum
(
10e6
)
self
.
startValue
.
setSingleStep
(
1000
)
self
.
startValue
.
setOpts
(
suffix
=
'Hz'
,
siPrefix
=
True
)
self
.
endValue
.
setMinimum
(
0
)
self
.
endValue
.
setMaximum
(
10e6
)
self
.
endValue
.
setSingleStep
(
1000
)
self
.
endValue
.
setOpts
(
suffix
=
'Hz'
,
siPrefix
=
True
)
self
.
stepsNum
.
setMaximum
(
1000000
)
def
update_tree
(
self
):
try
:
self
.
treeModel
.
setData
(
self
.
treeModel
.
index
(
0
,
1
),
(
self
.
endValue
.
value
()
-
self
.
startValue
.
value
())
/
(
self
.
stepsNum
.
value
()
-
1
)
/
1000
)
except
:
self
.
treeModel
.
setData
(
self
.
treeModel
.
index
(
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