Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Raptor Engineering Public Development
dsview
Commits
856e1803
Commit
856e1803
authored
6 years ago
by
DreamSourceLab
Browse files
Options
Download
Email Patches
Plain Diff
Improve the hardware abstraction layer
parent
c7cba6a7
Changes
105
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
179 additions
and
63 deletions
+179
-63
DSView/DSView.qrc
DSView/DSView.qrc
+1
-0
DSView/icons/showDoc.png
DSView/icons/showDoc.png
+0
-0
DSView/main.cpp
DSView/main.cpp
+3
-0
DSView/pv/data/analogsnapshot.cpp
DSView/pv/data/analogsnapshot.cpp
+2
-2
DSView/pv/data/mathstack.cpp
DSView/pv/data/mathstack.cpp
+1
-1
DSView/pv/device/device.cpp
DSView/pv/device/device.cpp
+6
-6
DSView/pv/device/devinst.cpp
DSView/pv/device/devinst.cpp
+1
-1
DSView/pv/device/devinst.h
DSView/pv/device/devinst.h
+1
-1
DSView/pv/dialogs/about.cpp
DSView/pv/dialogs/about.cpp
+2
-2
DSView/pv/dialogs/deviceoptions.cpp
DSView/pv/dialogs/deviceoptions.cpp
+26
-14
DSView/pv/dialogs/deviceoptions.h
DSView/pv/dialogs/deviceoptions.h
+1
-0
DSView/pv/dialogs/fftoptions.cpp
DSView/pv/dialogs/fftoptions.cpp
+4
-4
DSView/pv/dialogs/search.cpp
DSView/pv/dialogs/search.cpp
+2
-2
DSView/pv/dock/dsotriggerdock.cpp
DSView/pv/dock/dsotriggerdock.cpp
+1
-1
DSView/pv/dock/measuredock.cpp
DSView/pv/dock/measuredock.cpp
+1
-0
DSView/pv/mainframe.cpp
DSView/pv/mainframe.cpp
+52
-2
DSView/pv/mainframe.h
DSView/pv/mainframe.h
+11
-2
DSView/pv/mainwindow.cpp
DSView/pv/mainwindow.cpp
+61
-21
DSView/pv/prop/binding/deviceoptions.cpp
DSView/pv/prop/binding/deviceoptions.cpp
+1
-2
DSView/pv/prop/binding/probeoptions.cpp
DSView/pv/prop/binding/probeoptions.cpp
+2
-2
No files found.
DSView/DSView.qrc
View file @
856e1803
...
...
@@ -66,5 +66,6 @@
<file>icons/manual.png</file>
<file>icons/bug.png</file>
<file>icons/support.png</file>
<file>icons/showDoc.png</file>
</qresource>
</RCC>
This diff is collapsed.
Click to expand it.
DSView/icons/showDoc.png
0 → 100755
View file @
856e1803
37.3 KB
This diff is collapsed.
Click to expand it.
DSView/main.cpp
View file @
856e1803
...
...
@@ -33,6 +33,8 @@
#include <QFile>
#include <QDir>
#include <QTranslator>
#include <QSettings>
#include <QDesktopServices>
#include "dsapplication.h"
#include "pv/devicemanager.h"
...
...
@@ -158,6 +160,7 @@ int main(int argc, char *argv[])
qss
.
close
();
w
.
show
();
w
.
readSettings
();
w
.
show_doc
();
// Run the application
ret
=
a
.
exec
();
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/data/analogsnapshot.cpp
View file @
856e1803
...
...
@@ -273,9 +273,9 @@ void AnalogSnapshot::append_payload_to_envelope_levels()
// Break off if there are no new samples to compute
if
(
e0
.
ring_length
==
prev_length
)
return
;
continue
;
if
(
e0
.
length
==
0
)
return
;
continue
;
reallocate_envelope
(
e0
);
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/data/mathstack.cpp
View file @
856e1803
...
...
@@ -174,7 +174,7 @@ void MathStack::calc_fft()
boost
::
shared_ptr
<
pv
::
data
::
Dso
>
data
;
boost
::
shared_ptr
<
pv
::
view
::
DsoSignal
>
dsoSig
;
BOOST_FOREACH
(
const
boost
::
shared_ptr
<
view
::
Signal
>
s
,
_session
.
get_signals
())
{
if
(
dsoSig
=
dynamic_pointer_cast
<
view
::
DsoSignal
>
(
s
))
{
if
(
(
dsoSig
=
dynamic_pointer_cast
<
view
::
DsoSignal
>
(
s
))
)
{
if
(
dsoSig
->
get_index
()
==
_index
&&
dsoSig
->
enabled
())
{
data
=
dsoSig
->
dso_data
();
break
;
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/device/device.cpp
View file @
856e1803
...
...
@@ -69,12 +69,12 @@ QString Device::format_device_title() const
assert
(
_sdi
);
if
(
_sdi
->
vendor
&&
_sdi
->
vendor
[
0
])
{
s
<<
_sdi
->
vendor
;
if
((
_sdi
->
model
&&
_sdi
->
model
[
0
])
||
(
_sdi
->
version
&&
_sdi
->
version
[
0
]))
s
<<
' '
;
}
//
if (_sdi->vendor && _sdi->vendor[0]) {
//
s << _sdi->vendor;
//
if ((_sdi->model && _sdi->model[0]) ||
//
(_sdi->version && _sdi->version[0]))
//
s << ' ';
//
}
if
(
_sdi
->
model
&&
_sdi
->
model
[
0
])
{
s
<<
_sdi
->
model
;
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/device/devinst.cpp
View file @
856e1803
...
...
@@ -174,7 +174,7 @@ double DevInst::get_sample_time()
return
sample_time
;
}
GSList
*
DevInst
::
get_dev_mode_list
()
const
GSList
*
DevInst
::
get_dev_mode_list
()
{
assert
(
_owner
);
sr_dev_inst
*
const
sdi
=
dev_inst
();
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/device/devinst.h
View file @
856e1803
...
...
@@ -107,7 +107,7 @@ public:
* @return The returned device mode list from the driver, or NULL if the
* mode list could not be read.
*/
GSList
*
get_dev_mode_list
();
const
GSList
*
get_dev_mode_list
();
/**
* @brief Get the device name from the driver
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/dialogs/about.cpp
View file @
856e1803
...
...
@@ -58,8 +58,8 @@ About::About(QWidget *parent) :
QString
thanks
=
tr
(
"<font size=16>Special Thanks</font><br />"
"<a href=
\"
%1
\"
style=
\"
color:#C0C0C0
\"
>All backers on kickstarter</a><br />"
"<a href=
\"
%
1
\"
style=
\"
color:#C0C0C0
\"
>All members of Sigrok project</a><br />"
"All contributors of open-source projects</a><br />"
"<a href=
\"
%
2
\"
style=
\"
color:#C0C0C0
\"
>All members of Sigrok project</a><br />"
"All contributors of
all
open-source projects</a><br />"
"<br /><br />"
)
.
arg
(
"https://www.kickstarter.com/projects/dreamsourcelab/dslogic-multifunction-instruments-for-everyone"
)
.
arg
(
"http://sigrok.org/"
);
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/dialogs/deviceoptions.cpp
View file @
856e1803
...
...
@@ -48,10 +48,11 @@ DeviceOptions::DeviceOptions(QWidget *parent, boost::shared_ptr<pv::device::DevI
_props_box
->
setLayout
(
get_property_form
(
_props_box
));
_layout
.
addWidget
(
_props_box
);
QGroupBox
*
dynamic_box
=
new
QGroupBox
(
dynamic_widget
(
_dynamic_layout
),
_
dynamic_box
=
new
QGroupBox
(
dynamic_widget
(
_dynamic_layout
),
this
);
dynamic_box
->
setLayout
(
&
_dynamic_layout
);
_layout
.
addWidget
(
dynamic_box
);
_dynamic_box
->
setLayout
(
&
_dynamic_layout
);
_layout
.
addWidget
(
_dynamic_box
);
_dynamic_box
->
setVisible
(
_dynamic_box
->
title
()
!=
NULL
);
_layout
.
addStretch
(
1
);
_layout
.
addWidget
(
&
_button_box
);
...
...
@@ -333,6 +334,7 @@ void DeviceOptions::mode_check()
if
(
mode
!=
_mode
)
{
dynamic_widget
(
_dynamic_layout
);
_dynamic_box
->
setVisible
(
_dynamic_box
->
title
()
!=
NULL
);
_mode
=
mode
;
}
}
...
...
@@ -356,9 +358,12 @@ void DeviceOptions::mode_check()
void
DeviceOptions
::
channel_check
()
{
QRadioButton
*
sc
=
dynamic_cast
<
QRadioButton
*>
(
sender
());
QString
text
=
sc
->
text
();
text
.
remove
(
'&'
);
if
(
sc
!=
NULL
)
_dev_inst
->
set_config
(
NULL
,
NULL
,
SR_CONF_CHANNEL_MODE
,
g_variant_new_string
(
sc
->
text
()
.
toUtf8
().
data
()));
_dev_inst
->
set_config
(
NULL
,
NULL
,
SR_CONF_CHANNEL_MODE
,
g_variant_new_string
(
text
.
toUtf8
().
data
()));
dynamic_widget
(
_dynamic_layout
);
_dynamic_box
->
setVisible
(
_dynamic_box
->
title
()
!=
NULL
);
}
void
DeviceOptions
::
channel_enable
()
...
...
@@ -424,20 +429,27 @@ QString DeviceOptions::dynamic_widget(QGridLayout& inner_layout) {
logic_probes
(
inner_layout
);
return
tr
(
"Channels"
);
}
else
if
(
_dev_inst
->
dev_inst
()
->
mode
==
DSO
)
{
_config_button
=
new
QPushButton
(
tr
(
"Auto Calibration"
),
this
);
inner_layout
.
addWidget
(
_config_button
,
0
,
0
,
1
,
1
);
connect
(
_config_button
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
zero_adj
()));
_cali_button
=
new
QPushButton
(
tr
(
"Manual Calibration"
),
this
);
inner_layout
.
addWidget
(
_cali_button
,
1
,
0
,
1
,
1
);
connect
(
_cali_button
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
on_calibration
()));
return
tr
(
"Calibration"
);
GVariant
*
gvar
=
_dev_inst
->
get_config
(
NULL
,
NULL
,
SR_CONF_HAVE_ZERO
);
if
(
gvar
!=
NULL
)
{
bool
have_zero
=
g_variant_get_boolean
(
gvar
);
g_variant_unref
(
gvar
);
if
(
have_zero
)
{
_config_button
=
new
QPushButton
(
tr
(
"Auto Calibration"
),
this
);
inner_layout
.
addWidget
(
_config_button
,
0
,
0
,
1
,
1
);
connect
(
_config_button
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
zero_adj
()));
_cali_button
=
new
QPushButton
(
tr
(
"Manual Calibration"
),
this
);
inner_layout
.
addWidget
(
_cali_button
,
1
,
0
,
1
,
1
);
connect
(
_cali_button
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
on_calibration
()));
return
tr
(
"Calibration"
);
}
}
}
else
if
(
_dev_inst
->
dev_inst
()
->
mode
==
ANALOG
)
{
analog_probes
(
inner_layout
);
return
tr
(
"Channels"
);
}
else
{
return
tr
(
"Undefined"
);
}
return
NULL
;
}
void
DeviceOptions
::
analog_probes
(
QGridLayout
&
layout
)
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/dialogs/deviceoptions.h
View file @
856e1803
...
...
@@ -86,6 +86,7 @@ private:
QVBoxLayout
_layout
;
toolbars
::
TitleBar
*
_titlebar
;
QGroupBox
*
_dynamic_box
;
QGridLayout
_dynamic_layout
;
QVector
<
QLabel
*>
_probes_label_list
;
QVector
<
QCheckBox
*>
_probes_checkBox_list
;
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/dialogs/fftoptions.cpp
View file @
856e1803
...
...
@@ -57,7 +57,7 @@ FftOptions::FftOptions(QWidget *parent, SigSession &session) :
// setup _ch_combobox
BOOST_FOREACH
(
const
boost
::
shared_ptr
<
view
::
Signal
>
s
,
_session
.
get_signals
())
{
boost
::
shared_ptr
<
view
::
DsoSignal
>
dsoSig
;
if
(
dsoSig
=
dynamic_pointer_cast
<
view
::
DsoSignal
>
(
s
))
{
if
(
(
dsoSig
=
dynamic_pointer_cast
<
view
::
DsoSignal
>
(
s
))
)
{
_ch_combobox
->
addItem
(
dsoSig
->
get_name
(),
qVariantFromValue
(
dsoSig
->
get_index
()));
}
}
...
...
@@ -77,7 +77,7 @@ FftOptions::FftOptions(QWidget *parent, SigSession &session) :
std
::
vector
<
int
>
dbv_ranges
;
BOOST_FOREACH
(
const
boost
::
shared_ptr
<
view
::
Trace
>
t
,
_session
.
get_math_signals
())
{
boost
::
shared_ptr
<
view
::
MathTrace
>
mathTrace
;
if
(
mathTrace
=
dynamic_pointer_cast
<
view
::
MathTrace
>
(
t
))
{
if
(
(
mathTrace
=
dynamic_pointer_cast
<
view
::
MathTrace
>
(
t
))
)
{
windows
=
mathTrace
->
get_math_stack
()
->
get_windows_support
();
length
=
mathTrace
->
get_math_stack
()
->
get_length_support
();
view_modes
=
mathTrace
->
get_view_modes_support
();
...
...
@@ -127,7 +127,7 @@ FftOptions::FftOptions(QWidget *parent, SigSession &session) :
// load current settings
BOOST_FOREACH
(
const
boost
::
shared_ptr
<
view
::
Trace
>
t
,
_session
.
get_math_signals
())
{
boost
::
shared_ptr
<
view
::
MathTrace
>
mathTrace
;
if
(
mathTrace
=
dynamic_pointer_cast
<
view
::
MathTrace
>
(
t
))
{
if
(
(
mathTrace
=
dynamic_pointer_cast
<
view
::
MathTrace
>
(
t
))
)
{
if
(
mathTrace
->
enabled
())
{
_en_checkbox
->
setChecked
(
true
);
for
(
int
i
=
0
;
i
<
_ch_combobox
->
count
();
i
++
)
{
...
...
@@ -216,7 +216,7 @@ void FftOptions::accept()
BOOST_FOREACH
(
const
boost
::
shared_ptr
<
view
::
Trace
>
t
,
_session
.
get_math_signals
())
{
boost
::
shared_ptr
<
view
::
MathTrace
>
mathTrace
;
if
(
mathTrace
=
dynamic_pointer_cast
<
view
::
MathTrace
>
(
t
))
{
if
(
(
mathTrace
=
dynamic_pointer_cast
<
view
::
MathTrace
>
(
t
))
)
{
mathTrace
->
set_enable
(
false
);
if
(
mathTrace
->
get_index
()
==
_ch_combobox
->
currentData
().
toInt
())
{
mathTrace
->
get_math_stack
()
->
set_dc_ignore
(
_dc_checkbox
->
isChecked
());
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/dialogs/search.cpp
View file @
856e1803
...
...
@@ -54,7 +54,7 @@ Search::Search(QWidget *parent, SigSession &session, std::map<uint16_t, QString>
_session
.
get_signals
())
{
assert
(
sig
);
boost
::
shared_ptr
<
view
::
LogicSignal
>
logic_sig
;
if
(
logic_sig
=
boost
::
dynamic_pointer_cast
<
view
::
LogicSignal
>
(
sig
))
{
if
(
(
logic_sig
=
boost
::
dynamic_pointer_cast
<
view
::
LogicSignal
>
(
sig
))
)
{
QLineEdit
*
search_lineEdit
=
new
QLineEdit
(
this
);
if
(
pattern
.
find
(
logic_sig
->
get_index
())
!=
pattern
.
end
())
search_lineEdit
->
setText
(
pattern
[
logic_sig
->
get_index
()]);
...
...
@@ -115,7 +115,7 @@ std::map<uint16_t, QString> Search::get_pattern()
_session
.
get_signals
())
{
assert
(
sig
);
boost
::
shared_ptr
<
view
::
LogicSignal
>
logic_sig
;
if
(
logic_sig
=
boost
::
dynamic_pointer_cast
<
view
::
LogicSignal
>
(
sig
))
{
if
(
(
logic_sig
=
boost
::
dynamic_pointer_cast
<
view
::
LogicSignal
>
(
sig
))
)
{
pattern
[
logic_sig
->
get_index
()]
=
_search_lineEdit_vec
[
index
]
->
text
();
index
++
;
}
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/dock/dsotriggerdock.cpp
View file @
856e1803
...
...
@@ -356,7 +356,7 @@ void DsoTriggerDock::init()
channel_comboBox
->
clear
();
BOOST_FOREACH
(
const
boost
::
shared_ptr
<
view
::
Signal
>
s
,
_session
.
get_signals
())
{
boost
::
shared_ptr
<
view
::
DsoSignal
>
dsoSig
;
if
(
dsoSig
=
dynamic_pointer_cast
<
view
::
DsoSignal
>
(
s
))
{
if
(
(
dsoSig
=
dynamic_pointer_cast
<
view
::
DsoSignal
>
(
s
))
)
{
channel_comboBox
->
addItem
(
dsoSig
->
get_name
(),
qVariantFromValue
(
dsoSig
->
get_index
()));
}
}
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/dock/measuredock.cpp
View file @
856e1803
...
...
@@ -254,6 +254,7 @@ void MeasureDock::cursor_moving()
void
MeasureDock
::
reCalc
()
{
cursor_update
();
update_dist
();
update_edge
();
}
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/mainframe.cpp
View file @
856e1803
...
...
@@ -22,6 +22,8 @@
#include "mainframe.h"
#include "toolbars/titlebar.h"
#include "dialogs/dsmessagebox.h"
#include "dialogs/dsdialog.h"
#include "mainwindow.h"
#include <QVBoxLayout>
...
...
@@ -30,9 +32,14 @@
#include <QHoverEvent>
#include <QPixmap>
#include <QPainter>
#include <QLabel>
#include <QDialogButtonBox>
#include <QBitmap>
#include <QResizeEvent>
#include <QDesktopWidget>
#include <QDesktopServices>
#include <QPushButton>
#include <QMessageBox>
#include <QApplication>
#include <algorithm>
...
...
@@ -357,8 +364,8 @@ void MainFrame::readSettings()
QSettings
settings
;
QDesktopWidget
*
desktopWidget
=
QApplication
::
desktop
();
QRect
deskRect
=
desktopWidget
->
availableGeometry
();
QPoint
default_upleft
=
QPoint
((
deskRect
.
width
()
-
min
Width
)
/
2
,
(
deskRect
.
height
()
-
min
Height
)
/
2
);
QSize
default_size
=
QSize
(
min
Width
,
min
Height
);
QPoint
default_upleft
=
QPoint
((
deskRect
.
width
()
-
def
Width
)
/
2
,
(
deskRect
.
height
()
-
def
Height
)
/
2
);
QSize
default_size
=
QSize
(
def
Width
,
def
Height
);
settings
.
beginGroup
(
"MainFrame"
);
bool
isMax
=
settings
.
value
(
"isMax"
,
false
).
toBool
();
...
...
@@ -386,4 +393,47 @@ void MainFrame::readSettings()
}
}
void
MainFrame
::
setTaskbarProgress
(
int
progress
)
{
(
void
)
progress
;
}
void
MainFrame
::
show_doc
()
{
const
QString
DOC_KEY
(
"ShowDocuments"
);
QSettings
settings
;
if
(
!
settings
.
contains
(
DOC_KEY
))
{
dialogs
::
DSDialog
dlg
(
this
);
dlg
.
setTitle
(
tr
(
"Document"
));
QLabel
tipsLabel
;
tipsLabel
.
setPixmap
(
QPixmap
(
":/icons/showDoc.png"
));
QMessageBox
msg
;
msg
.
setWindowFlags
(
Qt
::
Dialog
|
Qt
::
FramelessWindowHint
|
Qt
::
WindowSystemMenuHint
);
msg
.
setContentsMargins
(
0
,
0
,
0
,
0
);
connect
(
&
msg
,
SIGNAL
(
buttonClicked
(
QAbstractButton
*
)),
&
dlg
,
SLOT
(
accept
()));
QPushButton
*
noMoreButton
=
msg
.
addButton
(
tr
(
"Not Show Again"
),
QMessageBox
::
ActionRole
);
msg
.
addButton
(
tr
(
"Ignore"
),
QMessageBox
::
ActionRole
);
QPushButton
*
openButton
=
msg
.
addButton
(
tr
(
"Open"
),
QMessageBox
::
ActionRole
);
QVBoxLayout
layout
;
layout
.
addWidget
(
&
tipsLabel
);
layout
.
addWidget
(
&
msg
,
0
,
Qt
::
AlignRight
);
layout
.
setContentsMargins
(
0
,
0
,
0
,
0
);
dlg
.
layout
()
->
addLayout
(
&
layout
);
dlg
.
exec
();
if
(
msg
.
clickedButton
()
==
openButton
)
{
QDir
dir
(
DS_RES_PATH
);
dir
.
cdUp
();
QDesktopServices
::
openUrl
(
QUrl
(
"file:///"
+
dir
.
absolutePath
()
+
"/ug.pdf"
));
}
if
(
msg
.
clickedButton
()
==
noMoreButton
)
settings
.
setValue
(
DOC_KEY
,
false
);
}
}
}
// namespace pv
This diff is collapsed.
Click to expand it.
DSView/pv/mainframe.h
View file @
856e1803
...
...
@@ -38,12 +38,19 @@ namespace toolbars {
class
TitleBar
;
}
namespace
dialogs
{
class
DSMessageBox
;
class
DSDialog
;
}
class
MainFrame
:
public
QFrame
{
Q_OBJECT
public:
static
const
int
minWidth
=
800
;
static
const
int
minHeight
=
680
;
static
const
int
minWidth
=
600
;
static
const
int
minHeight
=
500
;
static
const
int
defWidth
=
900
;
static
const
int
defHeight
=
680
;
public:
static
const
int
Margin
=
5
;
...
...
@@ -77,6 +84,8 @@ public slots:
void
showNormal
();
void
showMaximized
();
void
showMinimized
();
void
show_doc
();
void
setTaskbarProgress
(
int
progress
);
private:
void
hide_border
();
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/mainwindow.cpp
View file @
856e1803
...
...
@@ -43,6 +43,7 @@
#include <QDockWidget>
#include <QDebug>
#include <QDesktopWidget>
#include <QDesktopServices>
#include <QKeyEvent>
#include <QEvent>
#include <QtGlobal>
...
...
@@ -176,12 +177,12 @@ void MainWindow::setup_ui()
SLOT
(
run_stop
()));
connect
(
_sampling_bar
,
SIGNAL
(
instant_stop
()),
this
,
SLOT
(
instant_stop
()));
connect
(
_sampling_bar
,
SIGNAL
(
sample_count
_changed
()),
_trigger_widget
,
connect
(
_sampling_bar
,
SIGNAL
(
duration
_changed
()),
_trigger_widget
,
SLOT
(
device_updated
()));
connect
(
_sampling_bar
,
SIGNAL
(
duration_changed
()),
_view
,
SLOT
(
timebase_changed
()));
connect
(
_sampling_bar
,
SIGNAL
(
show_calibration
()),
_view
,
SLOT
(
show_calibration
()));
connect
(
_sampling_bar
,
SIGNAL
(
hide_calibration
()),
_view
,
SLOT
(
hide_calibration
()));
connect
(
_dso_trigger_widget
,
SIGNAL
(
set_trig_pos
(
int
)),
_view
,
SLOT
(
set_trig_pos
(
int
)));
connect
(
_view
,
SIGNAL
(
auto_trig
(
int
)),
_dso_trigger_widget
,
...
...
@@ -252,7 +253,11 @@ void MainWindow::setup_ui()
SLOT
(
reCalc
()));
connect
(
&
_session
,
SIGNAL
(
repeat_resume
()),
this
,
SLOT
(
repeat_resume
()));
connect
(
&
_session
,
SIGNAL
(
update_capture
()),
_view
,
SLOT
(
update_hori_res
()),
Qt
::
DirectConnection
);
connect
(
&
_session
,
SIGNAL
(
cur_samplerate_changed
()),
_measure_widget
,
SLOT
(
cursor_update
()));
connect
(
_view
,
SIGNAL
(
cursor_update
()),
_measure_widget
,
SLOT
(
cursor_update
()));
connect
(
_view
,
SIGNAL
(
cursor_moving
()),
_measure_widget
,
...
...
@@ -307,11 +312,11 @@ void MainWindow::update_device_list()
shared_ptr
<
pv
::
device
::
DevInst
>
selected_device
=
_session
.
get_device
();
_device_manager
.
add_device
(
selected_device
);
_sampling_bar
->
set_device_list
(
_device_manager
.
devices
(),
selected_device
);
_session
.
init_signals
();
_sampling_bar
->
set_device_list
(
_device_manager
.
devices
(),
selected_device
);
shared_ptr
<
pv
::
device
::
File
>
file_dev
;
if
(
file_dev
=
dynamic_pointer_cast
<
pv
::
device
::
File
>
(
selected_device
))
{
if
(
(
file_dev
=
dynamic_pointer_cast
<
pv
::
device
::
File
>
(
selected_device
))
)
{
#ifdef ENABLE_DECODE
// load decoders
StoreSession
ss
(
_session
);
...
...
@@ -457,7 +462,7 @@ void MainWindow::run_stop()
_session
.
start_capture
(
false
,
boost
::
bind
(
&
MainWindow
::
session_error
,
this
,
QString
(
tr
(
"Capture failed"
)),
_1
));
_view
->
capture_init
(
false
);
_view
->
capture_init
();
break
;
case
SigSession
::
Running
:
...
...
@@ -475,7 +480,7 @@ void MainWindow::instant_stop()
_session
.
start_capture
(
true
,
boost
::
bind
(
&
MainWindow
::
session_error
,
this
,
QString
(
tr
(
"Capture failed"
)),
_1
));
_view
->
capture_init
(
true
);
_view
->
capture_init
();
break
;
case
SigSession
::
Running
:
...
...
@@ -633,6 +638,10 @@ void MainWindow::on_trigger(bool visible)
void
MainWindow
::
commit_trigger
(
bool
instant
)
{
int
i
=
0
;
const
QString
TRIG_KEY
(
"WarnofMultiTrig"
);
QSettings
settings
;
ds_trigger_init
();
if
(
_session
.
get_device
()
->
dev_inst
()
->
mode
!=
LOGIC
||
...
...
@@ -645,8 +654,37 @@ void MainWindow::commit_trigger(bool instant)
{
assert
(
s
);
boost
::
shared_ptr
<
view
::
LogicSignal
>
logicSig
;
if
(
logicSig
=
dynamic_pointer_cast
<
view
::
LogicSignal
>
(
s
))
logicSig
->
commit_trig
();
if
((
logicSig
=
dynamic_pointer_cast
<
view
::
LogicSignal
>
(
s
)))
{
if
(
logicSig
->
commit_trig
())
i
++
;
}
}
if
(
!
settings
.
contains
(
TRIG_KEY
)
&&
i
>
1
)
{
dialogs
::
DSMessageBox
msg
(
this
);
msg
.
mBox
()
->
setText
(
tr
(
"Trigger"
));
msg
.
mBox
()
->
setInformativeText
(
tr
(
"Trigger setted on multiple channels! "
"Capture will Only triggered when all setted channels fullfill at one sample"
));
msg
.
mBox
()
->
setIcon
(
QMessageBox
::
Information
);
QPushButton
*
noMoreButton
=
msg
.
mBox
()
->
addButton
(
tr
(
"Not Show Again"
),
QMessageBox
::
ActionRole
);
QPushButton
*
cancelButton
=
msg
.
mBox
()
->
addButton
(
tr
(
"Clear Trig"
),
QMessageBox
::
ActionRole
);
msg
.
mBox
()
->
addButton
(
tr
(
"Continue"
),
QMessageBox
::
ActionRole
);
msg
.
exec
();
if
(
msg
.
mBox
()
->
clickedButton
()
==
cancelButton
)
{
BOOST_FOREACH
(
const
boost
::
shared_ptr
<
view
::
Signal
>
s
,
_session
.
get_signals
())
{
assert
(
s
);
boost
::
shared_ptr
<
view
::
LogicSignal
>
logicSig
;
if
((
logicSig
=
dynamic_pointer_cast
<
view
::
LogicSignal
>
(
s
)))
{
logicSig
->
set_trig
(
view
::
LogicSignal
::
NONTRIG
);
logicSig
->
commit_trig
();
}
}
}
if
(
msg
.
mBox
()
->
clickedButton
()
==
noMoreButton
)
settings
.
setValue
(
TRIG_KEY
,
false
);
}
}
}
...
...
@@ -783,8 +821,6 @@ bool MainWindow::load_session(QString name)
if
(
!
isEnabled
)
probe
->
enabled
=
false
;
}
_sampling_bar
->
update_sample_rate_selector
();
_trigger_widget
->
device_updated
();
//_session.init_signals();
_session
.
reload
();
...
...
@@ -799,12 +835,12 @@ bool MainWindow::load_session(QString name)
s
->
set_name
(
g_strdup
(
obj
[
"name"
].
toString
().
toStdString
().
c_str
()));
boost
::
shared_ptr
<
view
::
LogicSignal
>
logicSig
;
if
(
logicSig
=
dynamic_pointer_cast
<
view
::
LogicSignal
>
(
s
))
{
if
(
(
logicSig
=
dynamic_pointer_cast
<
view
::
LogicSignal
>
(
s
))
)
{
logicSig
->
set_trig
(
obj
[
"strigger"
].
toDouble
());
}
boost
::
shared_ptr
<
view
::
DsoSignal
>
dsoSig
;
if
(
dsoSig
=
dynamic_pointer_cast
<
view
::
DsoSignal
>
(
s
))
{
if
(
(
dsoSig
=
dynamic_pointer_cast
<
view
::
DsoSignal
>
(
s
))
)
{
dsoSig
->
load_settings
();
dsoSig
->
set_zero_vrate
(
obj
[
"zeroPos"
].
toDouble
(),
true
);
dsoSig
->
set_trig_vrate
(
obj
[
"trigValue"
].
toDouble
());
...
...
@@ -812,7 +848,7 @@ bool MainWindow::load_session(QString name)
}
boost
::
shared_ptr
<
view
::
AnalogSignal
>
analogSig
;
if
(
analogSig
=
dynamic_pointer_cast
<
view
::
AnalogSignal
>
(
s
))
{
if
(
(
analogSig
=
dynamic_pointer_cast
<
view
::
AnalogSignal
>
(
s
))
)
{
analogSig
->
set_zero_vrate
(
obj
[
"zeroPos"
].
toDouble
(),
true
);
analogSig
->
commit_settings
();
}
...
...
@@ -822,6 +858,10 @@ bool MainWindow::load_session(QString name)
}
}
// update UI settings
_sampling_bar
->
update_sample_rate_selector
();
_trigger_widget
->
device_updated
();
// load trigger settings
if
(
sessionObj
.
contains
(
"trigger"
))
{
_trigger_widget
->
set_session
(
sessionObj
[
"trigger"
].
toObject
());
...
...
@@ -898,12 +938,12 @@ bool MainWindow::store_session(QString name)
s_obj
[
"colour"
]
=
QJsonValue
::
fromVariant
(
s
->
get_colour
());
boost
::
shared_ptr
<
view
::
LogicSignal
>
logicSig
;
if
(
logicSig
=
dynamic_pointer_cast
<
view
::
LogicSignal
>
(
s
))
{
if
(
(
logicSig
=
dynamic_pointer_cast
<
view
::
LogicSignal
>
(
s
))
)
{
s_obj
[
"strigger"
]
=
logicSig
->
get_trig
();
}
boost
::
shared_ptr
<
view
::
DsoSignal
>
dsoSig
;
if
(
dsoSig
=
dynamic_pointer_cast
<
view
::
DsoSignal
>
(
s
))
{
if
(
(
dsoSig
=
dynamic_pointer_cast
<
view
::
DsoSignal
>
(
s
))
)
{
s_obj
[
"vdiv"
]
=
QJsonValue
::
fromVariant
(
static_cast
<
qulonglong
>
(
dsoSig
->
get_vDialValue
()));
s_obj
[
"vfactor"
]
=
QJsonValue
::
fromVariant
(
static_cast
<
qulonglong
>
(
dsoSig
->
get_factor
()));
s_obj
[
"coupling"
]
=
dsoSig
->
get_acCoupling
();
...
...
@@ -912,7 +952,7 @@ bool MainWindow::store_session(QString name)
}
boost
::
shared_ptr
<
view
::
AnalogSignal
>
analogSig
;
if
(
analogSig
=
dynamic_pointer_cast
<
view
::
AnalogSignal
>
(
s
))
{
if
(
(
analogSig
=
dynamic_pointer_cast
<
view
::
AnalogSignal
>
(
s
))
)
{
s_obj
[
"vdiv"
]
=
QJsonValue
::
fromVariant
(
static_cast
<
qulonglong
>
(
analogSig
->
get_vdiv
()));
s_obj
[
"coupling"
]
=
analogSig
->
get_acCoupling
();
s_obj
[
"zeroPos"
]
=
analogSig
->
get_zero_vrate
();
...
...
@@ -992,7 +1032,7 @@ bool MainWindow::eventFilter(QObject *object, QEvent *event)
case
Qt
::
Key_0
:
BOOST_FOREACH
(
const
shared_ptr
<
view
::
Signal
>
s
,
sigs
)
{
shared_ptr
<
view
::
DsoSignal
>
dsoSig
;
if
(
dsoSig
=
dynamic_pointer_cast
<
view
::
DsoSignal
>
(
s
))
{
if
(
(
dsoSig
=
dynamic_pointer_cast
<
view
::
DsoSignal
>
(
s
))
)
{
if
(
dsoSig
->
get_index
()
==
0
)
dsoSig
->
set_vDialActive
(
!
dsoSig
->
get_vDialActive
());
else
...
...
@@ -1005,7 +1045,7 @@ bool MainWindow::eventFilter(QObject *object, QEvent *event)
case
Qt
::
Key_1
:
BOOST_FOREACH
(
const
shared_ptr
<
view
::
Signal
>
s
,
sigs
)
{
shared_ptr
<
view
::
DsoSignal
>
dsoSig
;
if
(
dsoSig
=
dynamic_pointer_cast
<
view
::
DsoSignal
>
(
s
))
{
if
(
(
dsoSig
=
dynamic_pointer_cast
<
view
::
DsoSignal
>
(
s
))
)
{
if
(
dsoSig
->
get_index
()
==
1
)
dsoSig
->
set_vDialActive
(
!
dsoSig
->
get_vDialActive
());
else
...
...
@@ -1018,7 +1058,7 @@ bool MainWindow::eventFilter(QObject *object, QEvent *event)
case
Qt
::
Key_Up
:
BOOST_FOREACH
(
const
shared_ptr
<
view
::
Signal
>
s
,
sigs
)
{
shared_ptr
<
view
::
DsoSignal
>
dsoSig
;
if
(
dsoSig
=
dynamic_pointer_cast
<
view
::
DsoSignal
>
(
s
))
{
if
(
(
dsoSig
=
dynamic_pointer_cast
<
view
::
DsoSignal
>
(
s
))
)
{
if
(
dsoSig
->
get_vDialActive
())
{
dsoSig
->
go_vDialNext
();
update
();
...
...
@@ -1030,7 +1070,7 @@ bool MainWindow::eventFilter(QObject *object, QEvent *event)
case
Qt
::
Key_Down
:
BOOST_FOREACH
(
const
shared_ptr
<
view
::
Signal
>
s
,
sigs
)
{
shared_ptr
<
view
::
DsoSignal
>
dsoSig
;
if
(
dsoSig
=
dynamic_pointer_cast
<
view
::
DsoSignal
>
(
s
))
{
if
(
(
dsoSig
=
dynamic_pointer_cast
<
view
::
DsoSignal
>
(
s
))
)
{
if
(
dsoSig
->
get_vDialActive
())
{
dsoSig
->
go_vDialPre
();
update
();
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/prop/binding/deviceoptions.cpp
View file @
856e1803
...
...
@@ -47,7 +47,7 @@ DeviceOptions::DeviceOptions(struct sr_dev_inst *sdi) :
GVariant
*
gvar_opts
,
*
gvar_list
;
gsize
num_opts
;
if
((
sr_config_list
(
sdi
->
driver
,
sdi
,
NULL
,
SR_CONF_DEVICE_
CONFIG
S
,
if
((
sr_config_list
(
sdi
->
driver
,
sdi
,
NULL
,
SR_CONF_DEVICE_
OPTION
S
,
&
gvar_opts
)
!=
SR_OK
))
/* Driver supports no device instance options. */
return
;
...
...
@@ -109,7 +109,6 @@ DeviceOptions::DeviceOptions(struct sr_dev_inst *sdi) :
case
SR_CONF_CLOCK_TYPE
:
case
SR_CONF_CLOCK_EDGE
:
case
SR_CONF_INSTANT
:
case
SR_CONF_DATALOCK
:
bind_bool
(
name
,
key
);
break
;
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/prop/binding/probeoptions.cpp
View file @
856e1803
...
...
@@ -215,11 +215,11 @@ QString ProbeOptions::print_gvariant(GVariant *const gvar)
QString
ProbeOptions
::
print_vdiv
(
GVariant
*
const
gvar
)
{
uint64_t
p
,
q
;
uint64_t
p
,
q
;
g_variant_get
(
gvar
,
"t"
,
&
p
);
if
(
p
<
1000ULL
)
{
q
=
1000
;
}
else
if
(
p
<
1000000ULL
)
{
}
else
{
q
=
1
;
p
/=
1000
;
}
...
...
This diff is collapsed.
Click to expand it.
Prev
1
2
3
4
5
6
Next
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