Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dsview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Raptor Engineering Public Development
dsview
Commits
4cc02c8d
Commit
4cc02c8d
authored
Jun 25, 2016
by
DreamSourceLab
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix trigger issue @ DSO mode
parent
5bd97eb8
Changes
31
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
574 additions
and
235 deletions
+574
-235
DSView/darkstyle/style.qss
DSView/darkstyle/style.qss
+37
-2
DSView/pv/data/mathstack.cpp
DSView/pv/data/mathstack.cpp
+1
-1
DSView/pv/dock/dsotriggerdock.cpp
DSView/pv/dock/dsotriggerdock.cpp
+48
-5
DSView/pv/dock/dsotriggerdock.h
DSView/pv/dock/dsotriggerdock.h
+4
-1
DSView/pv/mainframe.cpp
DSView/pv/mainframe.cpp
+44
-10
DSView/pv/mainframe.h
DSView/pv/mainframe.h
+4
-0
DSView/pv/mainwindow.cpp
DSView/pv/mainwindow.cpp
+20
-8
DSView/pv/sigsession.cpp
DSView/pv/sigsession.cpp
+42
-1
DSView/pv/sigsession.h
DSView/pv/sigsession.h
+9
-1
DSView/pv/toolbars/filebar.cpp
DSView/pv/toolbars/filebar.cpp
+6
-1
DSView/pv/toolbars/filebar.h
DSView/pv/toolbars/filebar.h
+2
-0
DSView/pv/toolbars/titlebar.cpp
DSView/pv/toolbars/titlebar.cpp
+1
-1
DSView/pv/toolbars/titlebar.h
DSView/pv/toolbars/titlebar.h
+0
-1
DSView/pv/view/dsosignal.cpp
DSView/pv/view/dsosignal.cpp
+85
-100
DSView/pv/view/dsosignal.h
DSView/pv/view/dsosignal.h
+21
-17
DSView/pv/view/header.cpp
DSView/pv/view/header.cpp
+2
-2
DSView/pv/view/mathtrace.cpp
DSView/pv/view/mathtrace.cpp
+4
-6
DSView/pv/view/mathtrace.h
DSView/pv/view/mathtrace.h
+2
-2
DSView/pv/view/timemarker.cpp
DSView/pv/view/timemarker.cpp
+4
-2
DSView/pv/view/trace.cpp
DSView/pv/view/trace.cpp
+6
-6
DSView/pv/view/trace.h
DSView/pv/view/trace.h
+2
-2
DSView/pv/view/view.cpp
DSView/pv/view/view.cpp
+41
-11
DSView/pv/view/view.h
DSView/pv/view/view.h
+5
-4
DSView/pv/view/viewport.cpp
DSView/pv/view/viewport.cpp
+27
-3
DSView/pv/view/viewport.h
DSView/pv/view/viewport.h
+7
-0
libsigrok4DSL/hardware/DSL/dscope.c
libsigrok4DSL/hardware/DSL/dscope.c
+36
-1
libsigrok4DSL/hardware/DSL/dsl.h
libsigrok4DSL/hardware/DSL/dsl.h
+2
-0
libsigrok4DSL/hardware/DSL/dslogic.c
libsigrok4DSL/hardware/DSL/dslogic.c
+96
-46
libsigrok4DSL/hardware/demo/demo.c
libsigrok4DSL/hardware/demo/demo.c
+8
-1
libsigrok4DSL/hwdriver.c
libsigrok4DSL/hwdriver.c
+2
-0
libsigrok4DSL/libsigrok.h
libsigrok4DSL/libsigrok.h
+6
-0
No files found.
DSView/darkstyle/style.qss
View file @
4cc02c8d
...
...
@@ -958,11 +958,28 @@ QSlider::groove:horizontal {
border-radius: 2px;
}
QSlider::groove:horizontal:disabled {
border: 1px solid #3A3939;
height: 8px;
background: #282727;
margin: 2px 0;
border-radius: 2px;
}
QSlider::handle:horizontal {
background: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0.0 silver, stop: 0.2 #a8a8a8, stop: 1 #727272);
border: 1px solid #3A3939;
width: 14px;
width: 10px;
height: 14px;
margin: -4px 0;
border-radius: 2px;
}
QSlider::handle:horizontal:disabled {
background: #4A4949;
border: 1px solid #3A3939;
width: 10px;
height: 14px;
margin: -4px 0;
border-radius: 2px;
...
...
@@ -976,15 +993,33 @@ QSlider::groove:vertical {
border-radius: 2px;
}
QSlider::groove:vertical:disabled {
border: 1px solid #3A3939;
height: 8px;
background: #403F3F;
margin: 2px 0;
border-radius: 2px;
}
QSlider::handle:vertical {
background: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0.0 silver,
stop: 0.2 #a8a8a8, stop: 1 #727272);
border: 1px solid #3A3939;
width: 14px;
height: 1
4
px;
height: 1
0
px;
margin: 0 -4px;
border-radius: 2px;
}
QSlider::handle:vertical:disabled {
background: #4A4949;
border: 1px solid #3A3939;
width: 14px;
height: 10px;
margin: 0 -4px;
border-radius: 2px;
}
QToolButton#MaximizeButton {
background-color: transparent;
border-left: 1px solid QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1,
...
...
DSView/pv/data/mathstack.cpp
View file @
4cc02c8d
...
...
@@ -200,7 +200,7 @@ void MathStack::calc_fft()
_samplerate
=
1.0
;
// prepare _xn data
const
double
offset
=
dsoSig
->
get_zero
V
alue
();
const
double
offset
=
dsoSig
->
get_zero
_v
alue
();
const
double
vscale
=
dsoSig
->
get_vDialValue
()
*
dsoSig
->
get_factor
()
*
DS_CONF_DSO_VDIVS
/
(
1000
*
255.0
);
const
uint16_t
step
=
_snapshot
->
get_channel_num
()
*
_sample_interval
;
const
uint8_t
*
const
samples
=
_snapshot
->
get_samples
(
0
,
_sample_num
*
_sample_interval
-
1
,
_index
);
...
...
DSView/pv/dock/dsotriggerdock.cpp
View file @
4cc02c8d
...
...
@@ -56,7 +56,7 @@ DsoTriggerDock::DsoTriggerDock(QWidget *parent, SigSession &session) :
connect
(
position_spinBox
,
SIGNAL
(
valueChanged
(
int
)),
position_slider
,
SLOT
(
setValue
(
int
)));
connect
(
position_slider
,
SIGNAL
(
valueChanged
(
int
)),
this
,
SLOT
(
pos_changed
(
int
)));
QLabel
*
holdoff_label
=
new
QLabel
(
tr
(
"
Trigger
Hold Off Time: "
),
_widget
);
QLabel
*
holdoff_label
=
new
QLabel
(
tr
(
"Hold Off Time: "
),
_widget
);
holdoff_comboBox
=
new
QComboBox
(
_widget
);
holdoff_comboBox
->
addItem
(
tr
(
"uS"
),
qVariantFromValue
(
1000
));
holdoff_comboBox
->
addItem
(
tr
(
"mS"
),
qVariantFromValue
(
1000000
));
...
...
@@ -71,6 +71,11 @@ DsoTriggerDock::DsoTriggerDock(QWidget *parent, SigSession &session) :
connect
(
holdoff_slider
,
SIGNAL
(
valueChanged
(
int
)),
this
,
SLOT
(
hold_changed
(
int
)));
connect
(
holdoff_comboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
hold_changed
(
int
)));
QLabel
*
margin_label
=
new
QLabel
(
tr
(
"Noise Sensitivity: "
),
_widget
);
margin_slider
=
new
QSlider
(
Qt
::
Horizontal
,
_widget
);
margin_slider
->
setRange
(
0
,
15
);
connect
(
margin_slider
,
SIGNAL
(
valueChanged
(
int
)),
this
,
SLOT
(
margin_changed
(
int
)));
QLabel
*
tSource_labe
=
new
QLabel
(
tr
(
"Trigger Sources: "
),
_widget
);
QRadioButton
*
auto_radioButton
=
new
QRadioButton
(
tr
(
"Auto"
));
...
...
@@ -137,6 +142,10 @@ DsoTriggerDock::DsoTriggerDock(QWidget *parent, SigSession &session) :
gLayout
->
addWidget
(
holdoff_comboBox
,
12
,
2
);
gLayout
->
addWidget
(
holdoff_slider
,
13
,
0
,
1
,
4
);
gLayout
->
addWidget
(
new
QLabel
(
_widget
),
14
,
0
);
gLayout
->
addWidget
(
margin_label
,
15
,
0
);
gLayout
->
addWidget
(
margin_slider
,
16
,
0
,
1
,
4
);
gLayout
->
setColumnStretch
(
3
,
1
);
layout
->
addLayout
(
gLayout
);
...
...
@@ -174,10 +183,7 @@ void DsoTriggerDock::pos_changed(int pos)
msg
.
mBox
()
->
setIcon
(
QMessageBox
::
Warning
);
msg
.
exec
();
}
uint64_t
sample_limit
=
_session
.
get_device
()
->
get_sample_limit
();
uint64_t
trig_pos
=
sample_limit
*
pos
/
100
;
set_trig_pos
(
trig_pos
);
set_trig_pos
(
pos
);
}
void
DsoTriggerDock
::
hold_changed
(
int
hold
)
...
...
@@ -205,6 +211,22 @@ void DsoTriggerDock::hold_changed(int hold)
}
}
void
DsoTriggerDock
::
margin_changed
(
int
margin
)
{
int
ret
;
ret
=
_session
.
get_device
()
->
set_config
(
NULL
,
NULL
,
SR_CONF_TRIGGER_MARGIN
,
g_variant_new_byte
(
margin
));
if
(
!
ret
)
{
dialogs
::
DSMessageBox
msg
(
this
);
msg
.
mBox
()
->
setText
(
tr
(
"Trigger Setting Issue"
));
msg
.
mBox
()
->
setInformativeText
(
tr
(
"Change trigger value sensitivity failed!"
));
msg
.
mBox
()
->
setStandardButtons
(
QMessageBox
::
Ok
);
msg
.
mBox
()
->
setIcon
(
QMessageBox
::
Warning
);
msg
.
exec
();
}
}
void
DsoTriggerDock
::
source_changed
()
{
int
id
=
source_group
->
checkedId
();
...
...
@@ -254,6 +276,27 @@ void DsoTriggerDock::device_change()
void
DsoTriggerDock
::
init
()
{
if
(
_session
.
get_device
()
->
name
().
contains
(
"virtual"
))
{
foreach
(
QAbstractButton
*
btn
,
source_group
->
buttons
())
btn
->
setDisabled
(
true
);
foreach
(
QAbstractButton
*
btn
,
type_group
->
buttons
())
btn
->
setDisabled
(
true
);
holdoff_slider
->
setDisabled
(
true
);
holdoff_spinBox
->
setDisabled
(
true
);
holdoff_comboBox
->
setDisabled
(
true
);
margin_slider
->
setDisabled
(
true
);
return
;
}
else
{
foreach
(
QAbstractButton
*
btn
,
source_group
->
buttons
())
btn
->
setDisabled
(
false
);
foreach
(
QAbstractButton
*
btn
,
type_group
->
buttons
())
btn
->
setDisabled
(
false
);
holdoff_slider
->
setDisabled
(
false
);
holdoff_spinBox
->
setDisabled
(
false
);
holdoff_comboBox
->
setDisabled
(
false
);
margin_slider
->
setDisabled
(
false
);
}
// TRIGGERPOS
GVariant
*
gvar
=
_session
.
get_device
()
->
get_config
(
NULL
,
NULL
,
SR_CONF_HORIZ_TRIGGERPOS
);
...
...
DSView/pv/dock/dsotriggerdock.h
View file @
4cc02c8d
...
...
@@ -55,11 +55,12 @@ public:
void
init
();
signals:
void
set_trig_pos
(
quint64
trig_pos
);
void
set_trig_pos
(
int
percent
);
private
slots
:
void
pos_changed
(
int
pos
);
void
hold_changed
(
int
hold
);
void
margin_changed
(
int
margin
);
void
source_changed
();
void
type_changed
();
...
...
@@ -74,6 +75,8 @@ private:
QSpinBox
*
holdoff_spinBox
;
QSlider
*
holdoff_slider
;
QSlider
*
margin_slider
;
QSpinBox
*
position_spinBox
;
QSlider
*
position_slider
;
...
...
DSView/pv/mainframe.cpp
View file @
4cc02c8d
...
...
@@ -54,6 +54,7 @@ MainFrame::MainFrame(DeviceManager &device_manager,
_moving
=
false
;
_startPos
=
None
;
_freezing
=
false
;
_minimized
=
false
;
// MainWindow
_mainWindow
=
new
MainWindow
(
device_manager
,
open_file_name
,
this
);
...
...
@@ -114,6 +115,33 @@ MainFrame::MainFrame(DeviceManager &device_manager,
readSettings
();
}
void
MainFrame
::
changeEvent
(
QEvent
*
event
)
{
QFrame
::
changeEvent
(
event
);
QWindowStateChangeEvent
*
win_event
=
static_cast
<
QWindowStateChangeEvent
*
>
(
event
);
if
(
win_event
->
type
()
==
QEvent
::
WindowStateChange
)
{
if
(
win_event
->
oldState
()
&
Qt
::
WindowMinimized
)
{
if
(
_minimized
)
{
readSettings
();
_minimized
=
false
;
}
}
}
}
void
MainFrame
::
resizeEvent
(
QResizeEvent
*
event
)
{
QFrame
::
resizeEvent
(
event
);
if
(
isMaximized
())
{
hide_border
();
}
else
{
show_border
();
}
_titleBar
->
setRestoreButton
(
isMaximized
());
_layout
->
update
();
}
void
MainFrame
::
closeEvent
(
QCloseEvent
*
event
)
{
_mainWindow
->
session_save
();
...
...
@@ -162,6 +190,13 @@ void MainFrame::showMaximized()
QFrame
::
showMaximized
();
}
void
MainFrame
::
showMinimized
()
{
_minimized
=
true
;
writeSettings
();
QFrame
::
showMinimized
();
}
bool
MainFrame
::
eventFilter
(
QObject
*
object
,
QEvent
*
event
)
{
const
QEvent
::
Type
type
=
event
->
type
();
...
...
@@ -295,14 +330,6 @@ bool MainFrame::eventFilter(QObject *object, QEvent *event)
}
else
if
(
!
_draging
&&
type
==
QEvent
::
Leave
)
{
_startPos
=
None
;
setCursor
(
Qt
::
ArrowCursor
);
}
else
if
(
type
==
QEvent
::
Resize
)
{
if
(
isMaximized
())
{
hide_border
();
}
else
{
show_border
();
}
_titleBar
->
setRestoreButton
(
isMaximized
());
_layout
->
update
();
}
return
QObject
::
eventFilter
(
object
,
event
);
...
...
@@ -326,9 +353,16 @@ void MainFrame::readSettings()
QRect
deskRect
=
desktopWidget
->
availableGeometry
();
settings
.
beginGroup
(
"MainFrame"
);
resize
(
settings
.
value
(
"size"
,
QSize
(
minWidth
,
minHeight
)).
toSize
()
);
move
(
settings
.
value
(
"pos"
,
QPoint
((
deskRect
.
width
()
-
minWidth
)
/
2
,
(
deskRect
.
height
()
-
minHeight
)
/
2
)).
toPoint
()
);
QSize
size
=
settings
.
value
(
"size"
,
QSize
(
minWidth
,
minHeight
)).
toSize
(
);
QPoint
pos
=
settings
.
value
(
"pos"
,
QPoint
((
deskRect
.
width
()
-
minWidth
)
/
2
,
(
deskRect
.
height
()
-
minHeight
)
/
2
)).
toPoint
(
);
settings
.
endGroup
();
if
(
size
==
deskRect
.
size
())
{
_titleBar
->
showMaxRestore
();
}
else
{
resize
(
size
);
move
(
pos
);
}
}
}
// namespace pv
DSView/pv/mainframe.h
View file @
4cc02c8d
...
...
@@ -67,6 +67,8 @@ public:
void
showMaxRestore
();
protected:
void
changeEvent
(
QEvent
*
event
);
void
resizeEvent
(
QResizeEvent
*
event
);
void
closeEvent
(
QCloseEvent
*
event
);
bool
eventFilter
(
QObject
*
object
,
QEvent
*
event
);
...
...
@@ -74,6 +76,7 @@ public slots:
void
unfreezing
();
void
showNormal
();
void
showMaximized
();
void
showMinimized
();
private:
void
hide_border
();
...
...
@@ -103,6 +106,7 @@ private:
int
_startPos
;
QTimer
_timer
;
bool
_freezing
;
bool
_minimized
;
};
}
// namespace pv
...
...
DSView/pv/mainwindow.cpp
View file @
4cc02c8d
...
...
@@ -199,8 +199,8 @@ void MainWindow::setup_ui()
SLOT
(
show_calibration
()));
connect
(
_sampling_bar
,
SIGNAL
(
hide_calibration
()),
_view
,
SLOT
(
hide_calibration
()));
connect
(
_dso_trigger_widget
,
SIGNAL
(
set_trig_pos
(
quint64
)),
_view
,
SLOT
(
set_trig_pos
(
quint64
)));
connect
(
_dso_trigger_widget
,
SIGNAL
(
set_trig_pos
(
int
)),
_view
,
SLOT
(
set_trig_pos
(
int
)));
connect
(
_protocol_widget
,
SIGNAL
(
protocol_updated
()),
_view
,
SLOT
(
signals_changed
()));
setIconSize
(
QSize
(
40
,
40
));
...
...
@@ -318,6 +318,7 @@ void MainWindow::update_device_list()
}
if
(
!
selected_device
->
name
().
contains
(
"virtual"
))
{
_file_bar
->
set_settings_en
(
true
);
_logo_bar
->
dsl_connected
(
true
);
QString
ses_name
=
DS_RES_PATH
+
selected_device
->
name
()
+
...
...
@@ -325,9 +326,12 @@ void MainWindow::update_device_list()
".dsc"
;
load_session
(
ses_name
);
}
else
{
_file_bar
->
set_settings_en
(
false
);
_logo_bar
->
dsl_connected
(
false
);
}
_view
->
status_clear
();
_trigger_widget
->
init
();
_dso_trigger_widget
->
init
();
}
void
MainWindow
::
reload
()
...
...
@@ -416,7 +420,10 @@ void MainWindow::run_stop()
switch
(
_session
.
get_capture_state
())
{
case
SigSession
:
:
Init
:
case
SigSession
:
:
Stopped
:
_view
->
show_trig_cursor
(
false
);
if
(
_session
.
get_device
()
->
dev_inst
()
->
mode
==
DSO
)
_view
->
show_trig_cursor
(
true
);
else
_view
->
show_trig_cursor
(
false
);
_view
->
update_sample
(
false
);
commit_trigger
(
false
);
_session
.
start_capture
(
false
,
...
...
@@ -436,7 +443,10 @@ void MainWindow::instant_stop()
switch
(
_session
.
get_capture_state
())
{
case
SigSession
:
:
Init
:
case
SigSession
:
:
Stopped
:
_view
->
show_trig_cursor
(
false
);
if
(
_session
.
get_device
()
->
dev_inst
()
->
mode
==
DSO
)
_view
->
show_trig_cursor
(
true
);
else
_view
->
show_trig_cursor
(
false
);
_view
->
update_sample
(
true
);
commit_trigger
(
true
);
_session
.
start_capture
(
true
,
...
...
@@ -650,6 +660,8 @@ bool MainWindow::load_session(QString name)
for
(
unsigned
int
i
=
0
;
i
<
num_opts
;
i
++
)
{
const
struct
sr_config_info
*
const
info
=
sr_config_info_get
(
options
[
i
]);
if
(
!
sessionObj
.
contains
(
info
->
name
))
continue
;
if
(
info
->
datatype
==
SR_T_BOOL
)
_session
.
get_device
()
->
set_config
(
NULL
,
NULL
,
info
->
key
,
g_variant_new_boolean
(
sessionObj
[
info
->
name
].
toDouble
()));
else
if
(
info
->
datatype
==
SR_T_UINT64
)
...
...
@@ -709,8 +721,8 @@ bool MainWindow::load_session(QString name)
boost
::
shared_ptr
<
view
::
DsoSignal
>
dsoSig
;
if
(
dsoSig
=
dynamic_pointer_cast
<
view
::
DsoSignal
>
(
s
))
{
dsoSig
->
load_settings
();
dsoSig
->
set_zero
R
ate
(
obj
[
"zeroPos"
].
toDouble
());
dsoSig
->
set_trig
R
ate
(
obj
[
"trigValue"
].
toDouble
());
dsoSig
->
set_zero
_vr
ate
(
obj
[
"zeroPos"
].
toDouble
());
dsoSig
->
set_trig
_vr
ate
(
obj
[
"trigValue"
].
toDouble
());
}
break
;
}
...
...
@@ -791,8 +803,8 @@ bool MainWindow::store_session(QString name)
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
();
s_obj
[
"trigValue"
]
=
dsoSig
->
get_trig
R
ate
();
s_obj
[
"zeroPos"
]
=
dsoSig
->
get_zero
R
ate
();
s_obj
[
"trigValue"
]
=
dsoSig
->
get_trig
_vr
ate
();
s_obj
[
"zeroPos"
]
=
dsoSig
->
get_zero
_vr
ate
();
}
channelVar
.
append
(
s_obj
);
}
...
...
DSView/pv/sigsession.cpp
View file @
4cc02c8d
...
...
@@ -98,6 +98,7 @@ SigSession::SigSession(DeviceManager &device_manager) :
_group_cnt
=
0
;
register_hotplug_callback
();
_view_timer
.
stop
();
_noData_cnt
=
0
;
_refresh_timer
.
stop
();
_refresh_timer
.
setSingleShot
(
true
);
_data_lock
=
false
;
...
...
@@ -470,12 +471,48 @@ double SigSession::cur_sampletime() const
return
_cur_samplelimits
*
1.0
/
_cur_samplerate
;
}
void
SigSession
::
set_cur_samplerate
(
uint64_t
samplerate
)
{
assert
(
samplerate
!=
0
);
_cur_samplerate
=
samplerate
;
// sample rate for all SignalData
// Logic/Analog/Dso
if
(
_logic_data
)
_logic_data
->
set_samplerate
(
_cur_samplerate
);
if
(
_analog_data
)
_analog_data
->
set_samplerate
(
_cur_samplerate
);
if
(
_dso_data
)
_dso_data
->
set_samplerate
(
_cur_samplerate
);
// Group
if
(
_group_data
)
_group_data
->
set_samplerate
(
_cur_samplerate
);
#ifdef ENABLE_DECODE
// DecoderStack
BOOST_FOREACH
(
const
boost
::
shared_ptr
<
view
::
DecodeTrace
>
d
,
_decode_traces
)
d
->
decoder
()
->
set_samplerate
(
_cur_samplerate
);
#endif
// MathStack
BOOST_FOREACH
(
const
boost
::
shared_ptr
<
view
::
MathTrace
>
m
,
_math_traces
)
m
->
get_math_stack
()
->
set_samplerate
(
_cur_samplerate
);
}
void
SigSession
::
set_cur_samplelimits
(
uint64_t
samplelimits
)
{
assert
(
samplelimits
!=
0
);
_cur_samplelimits
=
samplelimits
;
}
void
SigSession
::
capture_init
()
{
_cur_samplerate
=
_dev_inst
->
get_sample_rate
();
_cur_samplelimits
=
_dev_inst
->
get_sample_limit
();
_data_updated
=
false
;
_view_timer
.
start
(
ViewTime
);
if
(
_dev_inst
->
dev_inst
()
->
mode
==
DSO
)
{
_view_timer
.
start
(
ViewTime
);
_noData_cnt
=
0
;
}
// Init and Set sample rate for all SignalData
// Logic/Analog/Dso
...
...
@@ -685,6 +722,10 @@ void SigSession::check_update()
if
(
_data_updated
)
{
data_updated
();
_data_updated
=
false
;
_noData_cnt
=
0
;
}
else
{
if
(
++
_noData_cnt
>=
(
WaitShowTime
/
ViewTime
))
show_wait_trigger
();
}
}
...
...
DSView/pv/sigsession.h
View file @
4cc02c8d
...
...
@@ -92,10 +92,13 @@ class SigSession : public QObject
private:
static
constexpr
float
Oversampling
=
2.0
f
;
static
const
int
ViewTime
=
50
;
static
const
int
RefreshTime
=
500
;
bool
saveFileThreadRunning
=
false
;
public:
static
const
int
ViewTime
=
50
;
static
const
int
WaitShowTime
=
1000
;
public:
enum
capture_state
{
Init
,
...
...
@@ -131,6 +134,8 @@ public:
uint64_t
cur_samplerate
()
const
;
uint64_t
cur_samplelimits
()
const
;
double
cur_sampletime
()
const
;
void
set_cur_samplerate
(
uint64_t
samplerate
);
void
set_cur_samplelimits
(
uint64_t
samplelimits
);
QDateTime
get_trigger_time
()
const
;
uint64_t
get_trigger_pos
()
const
;
...
...
@@ -272,6 +277,7 @@ private:
bool
_hot_detach
;
QTimer
_view_timer
;
int
_noData_cnt
;
QTimer
_refresh_timer
;
bool
_data_lock
;
bool
_data_updated
;
...
...
@@ -320,6 +326,8 @@ signals:
void
hardware_connect_failed
();
void
show_wait_trigger
();
public
slots
:
void
reload
();
void
refresh
(
int
holdtime
);
...
...
DSView/pv/toolbars/filebar.cpp
View file @
4cc02c8d
...
...
@@ -69,7 +69,7 @@ FileBar::FileBar(SigSession &session, QWidget *parent) :
_action_default
->
setObjectName
(
QString
::
fromUtf8
(
"actionDefault"
));
connect
(
_action_default
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
on_actionDefault_triggered
()));
_menu_session
=
new
QMenu
(
tr
(
"Se
ssion
"
),
parent
);
_menu_session
=
new
QMenu
(
tr
(
"Se
ttings
"
),
parent
);
_menu_session
->
setIcon
(
QIcon
::
fromTheme
(
"file"
,
QIcon
(
":/icons/gear.png"
)));
_menu_session
->
setObjectName
(
QString
::
fromUtf8
(
"menuSession"
));
...
...
@@ -287,5 +287,10 @@ void FileBar::enable_toggle(bool enable)
QIcon
(
":/icons/file_dis.png"
));
}
void
FileBar
::
set_settings_en
(
bool
enable
)
{
_menu_session
->
setDisabled
(
!
enable
);
}
}
// namespace toolbars
}
// namespace pv
DSView/pv/toolbars/filebar.h
View file @
4cc02c8d
...
...
@@ -42,6 +42,8 @@ public:
void
enable_toggle
(
bool
enable
);
void
set_settings_en
(
bool
enable
);
private:
void
session_error
(
...
...
DSView/pv/toolbars/titlebar.cpp
View file @
4cc02c8d
...
...
@@ -66,7 +66,7 @@ TitleBar::TitleBar(bool top, QWidget *parent, bool hasClose) :
connect
(
this
,
SIGNAL
(
normalShow
()
),
parent
,
SLOT
(
showNormal
()
)
);
connect
(
this
,
SIGNAL
(
maximizedShow
()
),
parent
,
SLOT
(
showMaximized
()
)
);
connect
(
_minimizeButton
,
SIGNAL
(
clicked
()
),
this
,
SLOT
(
showSmall
()
)
);
connect
(
_minimizeButton
,
SIGNAL
(
clicked
()
),
parent
,
SLOT
(
showMinimized
()
)
);
connect
(
_maximizeButton
,
SIGNAL
(
clicked
()
),
this
,
SLOT
(
showMaxRestore
()
)
);
}
...
...
DSView/pv/toolbars/titlebar.h
View file @
4cc02c8d
...
...
@@ -44,7 +44,6 @@ signals:
void
maximizedShow
();
public
slots
:
void
showSmall
()
{
parentWidget
()
->
showMinimized
();
}
void
showMaxRestore
();
void
setRestoreButton
(
bool
max
);
...
...
DSView/pv/view/dsosignal.cpp
View file @
4cc02c8d
This diff is collapsed.
Click to expand it.
DSView/pv/view/dsosignal.h
View file @
4cc02c8d
...
...
@@ -43,7 +43,6 @@ class DsoSignal : public Signal
private:
static
const
QColor
SignalColours
[
4
];
static
const
float
EnvelopeThreshold
;
static
const
double
TrigMargin
;
static
const
int
HitCursorMargin
=
3
;
static
const
uint64_t
vDialValueCount
=
8
;
...
...
@@ -58,9 +57,12 @@ private:
static
const
uint64_t
hDialValue
[
hDialValueCount
];
static
const
QString
hDialUnit
[
hDialUnitCount
];
static
const
int
UpMargin
;
static
const
int
DownMargin
;
static
const
int
RightMargin
;
static
const
int
UpMargin
=
30
;
static
const
int
DownMargin
=
0
;
static
const
int
RightMargin
=
30
;
static
const
uint8_t
DefaultBits
=
8
;
static
const
int
TrigMargin
=
16
;
public:
enum
DSO_MEASURE_TYPE
{
...
...
@@ -130,10 +132,10 @@ public:
uint16_t
get_hDialSel
()
const
;
uint8_t
get_acCoupling
()
const
;
void
set_acCoupling
(
uint8_t
coupling
);
void
set_trig_vpos
(
int
pos
);
void
set_trig_vpos
(
int
pos
,
bool
delta_change
);
int
get_trig_vpos
()
const
;
void
set_trig
R
ate
(
double
rate
);
double
get_trig
R
ate
()
const
;
void
set_trig
_vr
ate
(
double
rate
);
double
get_trig
_vr
ate
()
const
;
void
set_factor
(
uint64_t
factor
);
uint64_t
get_factor
();
...
...
@@ -154,15 +156,15 @@ public:
/**
* Gets the mid-Y position of this signal.
*/
int
get_zero
P
os
();
double
get_zero
R
ate
();
double
get_zero
V
alue
();
int
get_zero
_vp
os
();
double
get_zero
_vr
ate
();
double
get_zero
_v
alue
();
/**
* Sets the mid-Y position of this signal.
*/
void
set_zero
P
os
(
int
pos
);
void
set_zero
R
ate
(
double
rate
);
void
update_
zeroPos
();
void
set_zero
_vp
os
(
int
pos
);
void
set_zero
_vr
ate
(
double
rate
);
void
update_
offset
();
/**
* Paints the background layer of the trace with a QPainter
...
...
@@ -190,7 +192,7 @@ public:
const
std
::
vector
<
std
::
pair
<
uint64_t
,
bool
>
>
cur_edges
()
const
;
QRect
F
get_view_rect
()
const
;
QRect
get_view_rect
()
const
;
QRectF
get_trig_rect
(
int
left
,
int
right
)
const
;
...
...
@@ -237,10 +239,12 @@ private:
bool
_vDialActive
;
bool
_hDialActive
;
uint8_t
_acCoupling
;
uint8_t
_bits
;
double
_trig_vpos
;
double
_zeroPos
;
float
_zero_off
;
int
_trig_value
;
double
_trig_delta
;
double
_zero_vrate
;
float
_zero_value
;
uint8_t
_max
;
uint8_t
_min
;
...
...
DSView/pv/view/header.cpp
View file @
4cc02c8d
...
...
@@ -198,7 +198,7 @@ void Header::mousePressEvent(QMouseEvent *event)
// Add the Trace to the drag list
if
(
event
->
button
()
&
Qt
::
LeftButton
)
{
_drag_traces
.
push_back
(
make_pair
(
mTrace
,
mTrace
->
get_zero
P
os
()));
_drag_traces
.
push_back
(
make_pair
(
mTrace
,
mTrace
->
get_zero
_vp
os
()));
}
}
mTrace
->
set_old_v_offset
(
mTrace
->
get_v_offset
());
...
...
@@ -315,7 +315,7 @@ void Header::mouseMoveEvent(QMouseEvent *event)
}
else
{
boost
::
shared_ptr
<
DsoSignal
>
dsoSig
;
if
(
dsoSig
=
dynamic_pointer_cast
<
DsoSignal
>
(
sig
))
{
dsoSig
->
set_zero
P
os
(
y
);
dsoSig
->
set_zero
_vp
os
(
y
);
dsoSig
->
select
(
false
);
traces_moved
();
}
...
...
DSView/pv/view/mathtrace.cpp
View file @
4cc02c8d
...
...
@@ -217,13 +217,13 @@ QString MathTrace::format_freq(double freq, unsigned precision)
}
}
bool
MathTrace
::
measure
(
const
QPoint
F
&
p
)
bool
MathTrace
::
measure
(
const
QPoint
&
p
)
{
_hover_en
=
false
;
if
(
!
_view
||
!
enabled
())
return
false
;
const
QRect
F
window
=
get_view_rect
();
const
QRect
window
=
get_view_rect
();
if
(
!
window
.
contains
(
p
))
return
false
;
...
...
@@ -291,14 +291,12 @@ void MathTrace::paint_mid(QPainter &p, int left, int right)
double
vdiv
;
double
vfactor
;
double
voffset
;
BOOST_FOREACH
(
const
boost
::
shared_ptr
<
Signal
>
s
,
_session
.
get_signals
())
{
boost
::
shared_ptr
<
DsoSignal
>
dsoSig
;
if
(
dsoSig
=
dynamic_pointer_cast
<
DsoSignal
>
(
s
))
{
if
(
dsoSig
->
get_index
()
==
_math_stack
->
get_index
())
{
vdiv
=
dsoSig
->
get_vDialValue
();
vfactor
=
dsoSig
->
get_factor
();
voffset
=
dsoSig
->
get_zeroRate
();
break
;
}
}
...
...
@@ -476,10 +474,10 @@ void MathTrace::paint_type_options(QPainter &p, int right, const QPoint pt)
(
void
)
right
;
}
QRect
F
MathTrace
::
get_view_rect
()
const
QRect
MathTrace
::
get_view_rect
()
const
{
assert
(
_viewport
);
return
QRect
F
(
0
,
UpMargin
,
return
QRect
(
0
,
UpMargin
,
_viewport
->
width
()
-
RightMargin
,
_viewport
->
height
()
-
UpMargin
-
DownMargin
);
}
...
...
DSView/pv/view/mathtrace.h
View file @
4cc02c8d
...
...
@@ -95,7 +95,7 @@ public:
static
QString
format_freq
(
double
freq
,
unsigned
precision
=
Pricision
);
bool
measure
(
const
QPoint
F
&
p
);
bool
measure
(
const
QPoint
&
p
);
/**
* Paints the background layer of the trace with a QPainter
...
...
@@ -121,7 +121,7 @@ public:
**/
void
paint_fore
(
QPainter
&
p
,
int
left
,
int
right
);
QRect
F
get_view_rect
()
const
;
QRect
get_view_rect
()
const
;
protected:
void
paint_type_options
(
QPainter
&
p
,
int
right
,
const
QPoint
pt
);
...
...
DSView/pv/view/timemarker.cpp
View file @
4cc02c8d
...
...
@@ -70,8 +70,10 @@ void TimeMarker::set_index(uint64_t index)
void
TimeMarker
::
paint