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
95f2bf89
Commit
95f2bf89
authored
Jun 29, 2014
by
DreamSourceLab
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
v0.3
parent
a6a3024d
Changes
70
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
70 changed files
with
7238 additions
and
58653 deletions
+7238
-58653
COPYING
COPYING
+674
-674
DSLogic-gui/CMakeFiles/CMakeDetermineCompilerABI_C.bin
DSLogic-gui/CMakeFiles/CMakeDetermineCompilerABI_C.bin
+0
-0
DSLogic-gui/CMakeFiles/CMakeDetermineCompilerABI_CXX.bin
DSLogic-gui/CMakeFiles/CMakeDetermineCompilerABI_CXX.bin
+0
-0
DSLogic-gui/CMakeFiles/CompilerIdC/a.out
DSLogic-gui/CMakeFiles/CompilerIdC/a.out
+0
-0
DSLogic-gui/CMakeFiles/CompilerIdCXX/a.out
DSLogic-gui/CMakeFiles/CompilerIdCXX/a.out
+0
-0
DSLogic-gui/CMakeLists.txt
DSLogic-gui/CMakeLists.txt
+6
-2
DSLogic-gui/INSTALL
DSLogic-gui/INSTALL
+49
-49
DSLogic-gui/NEWS
DSLogic-gui/NEWS
+5
-5
DSLogic-gui/configs/DSLogic.bin
DSLogic-gui/configs/DSLogic.bin
+0
-0
DSLogic-gui/configs/DSLogic.fw
DSLogic-gui/configs/DSLogic.fw
+0
-0
DSLogic-gui/install_manifest.txt
DSLogic-gui/install_manifest.txt
+0
-3
DSLogic-gui/ltrace.txt
DSLogic-gui/ltrace.txt
+0
-28775
DSLogic-gui/pv/data/dsosnapshot.cpp
DSLogic-gui/pv/data/dsosnapshot.cpp
+7
-7
DSLogic-gui/pv/data/dsosnapshot.h
DSLogic-gui/pv/data/dsosnapshot.h
+4
-4
DSLogic-gui/pv/dialogs/deviceoptions.cpp
DSLogic-gui/pv/dialogs/deviceoptions.cpp
+1
-0
DSLogic-gui/pv/dock/dsotriggerdock.cpp
DSLogic-gui/pv/dock/dsotriggerdock.cpp
+196
-0
DSLogic-gui/pv/dock/dsotriggerdock.h
DSLogic-gui/pv/dock/dsotriggerdock.h
+76
-0
DSLogic-gui/pv/mainwindow.cpp
DSLogic-gui/pv/mainwindow.cpp
+87
-7
DSLogic-gui/pv/mainwindow.h
DSLogic-gui/pv/mainwindow.h
+10
-0
DSLogic-gui/pv/prop/binding/binding_deviceoptions.cpp
DSLogic-gui/pv/prop/binding/binding_deviceoptions.cpp
+10
-3
DSLogic-gui/pv/sigsession.cpp
DSLogic-gui/pv/sigsession.cpp
+291
-25
DSLogic-gui/pv/sigsession.h
DSLogic-gui/pv/sigsession.h
+21
-11
DSLogic-gui/pv/toolbars/devicebar.cpp
DSLogic-gui/pv/toolbars/devicebar.cpp
+6
-5
DSLogic-gui/pv/toolbars/devicebar.h
DSLogic-gui/pv/toolbars/devicebar.h
+0
-1
DSLogic-gui/pv/toolbars/samplingbar.cpp
DSLogic-gui/pv/toolbars/samplingbar.cpp
+30
-1
DSLogic-gui/pv/toolbars/samplingbar.h
DSLogic-gui/pv/toolbars/samplingbar.h
+2
-0
DSLogic-gui/pv/view/dsldial.cpp
DSLogic-gui/pv/view/dsldial.cpp
+110
-0
DSLogic-gui/pv/view/dsldial.h
DSLogic-gui/pv/view/dsldial.h
+48
-0
DSLogic-gui/pv/view/dsosignal.cpp
DSLogic-gui/pv/view/dsosignal.cpp
+23
-19
DSLogic-gui/pv/view/dsosignal.h
DSLogic-gui/pv/view/dsosignal.h
+6
-4
DSLogic-gui/pv/view/groupsignal.cpp
DSLogic-gui/pv/view/groupsignal.cpp
+3
-3
DSLogic-gui/pv/view/header.cpp
DSLogic-gui/pv/view/header.cpp
+150
-60
DSLogic-gui/pv/view/header.h
DSLogic-gui/pv/view/header.h
+6
-15
DSLogic-gui/pv/view/signal.cpp
DSLogic-gui/pv/view/signal.cpp
+426
-72
DSLogic-gui/pv/view/signal.h
DSLogic-gui/pv/view/signal.h
+85
-23
DSLogic-gui/pv/view/view.cpp
DSLogic-gui/pv/view/view.cpp
+70
-7
DSLogic-gui/pv/view/view.h
DSLogic-gui/pv/view/view.h
+6
-1
DSLogic-gui/pv/view/viewport.cpp
DSLogic-gui/pv/view/viewport.cpp
+60
-18
DSLogic-gui/pv/view/viewport.h
DSLogic-gui/pv/view/viewport.h
+8
-1
DSLogic-gui/res/DSLogic.bin
DSLogic-gui/res/DSLogic.bin
+0
-0
DSLogic-gui/res/DSLogic.fw
DSLogic-gui/res/DSLogic.fw
+0
-0
DSLogic-gui/stylesheet.qss
DSLogic-gui/stylesheet.qss
+17
-13
DSLogic-gui/test/CMakeLists.txt
DSLogic-gui/test/CMakeLists.txt
+273
-14
DSLogic-gui/test/COPYING
DSLogic-gui/test/COPYING
+674
-0
DSLogic-gui/test/DSLogic.qrc
DSLogic-gui/test/DSLogic.qrc
+0
-0
DSLogic-gui/test/INSTALL
DSLogic-gui/test/INSTALL
+49
-0
DSLogic-gui/test/NEWS
DSLogic-gui/test/NEWS
+5
-0
DSLogic-gui/test/README
DSLogic-gui/test/README
+72
-0
DSLogic-gui/test/config.h.in
DSLogic-gui/test/config.h.in
+34
-0
DSLogic-gui/test/extdef.h
DSLogic-gui/test/extdef.h
+32
-0
DSLogic-gui/test/main.cpp
DSLogic-gui/test/main.cpp
+163
-0
DSLogic-gui/test/stylesheet.qss
DSLogic-gui/test/stylesheet.qss
+279
-0
DSLogic-gui/trace.txt
DSLogic-gui/trace.txt
+0
-9339
INSTALL
INSTALL
+100
-100
NEWS
NEWS
+30
-18
README
README
+57
-57
libsigrok4DSLogic/configure.changed
libsigrok4DSLogic/configure.changed
+0
-16365
libsigrok4DSLogic/hardware/DSLogic/command.c
libsigrok4DSLogic/hardware/DSLogic/command.c
+208
-177
libsigrok4DSLogic/hardware/DSLogic/command.h
libsigrok4DSLogic/hardware/DSLogic/command.h
+93
-79
libsigrok4DSLogic/hardware/DSLogic/dslogic.c
libsigrok4DSLogic/hardware/DSLogic/dslogic.c
+1956
-1615
libsigrok4DSLogic/hardware/DSLogic/dslogic.h
libsigrok4DSLogic/hardware/DSLogic/dslogic.h
+212
-196
libsigrok4DSLogic/hardware/common/ezusb.c
libsigrok4DSLogic/hardware/common/ezusb.c
+143
-143
libsigrok4DSLogic/hardware/common/usb.c
libsigrok4DSLogic/hardware/common/usb.c
+245
-245
libsigrok4DSLogic/hardware/demo/demo.c
libsigrok4DSLogic/hardware/demo/demo.c
+69
-1
libsigrok4DSLogic/hwdriver.c
libsigrok4DSLogic/hwdriver.c
+6
-2
libsigrok4DSLogic/libsigrok.h
libsigrok4DSLogic/libsigrok.h
+30
-3
libsigrok4DSLogic/libsigrok4DSLogic.pc
libsigrok4DSLogic/libsigrok4DSLogic.pc
+0
-15
libsigrok4DSLogic/libsigrok4DSLogic.pc.in
libsigrok4DSLogic/libsigrok4DSLogic.pc.in
+15
-15
libsigrok4DSLogic/libusbhp.c
libsigrok4DSLogic/libusbhp.c
+0
-392
libsigrok4DSLogic/version.h
libsigrok4DSLogic/version.h
+0
-69
No files found.
COPYING
View file @
95f2bf89
This diff is collapsed.
Click to expand it.
DSLogic-gui/CMakeFiles/CMakeDetermineCompilerABI_C.bin
deleted
100644 → 0
View file @
a6a3024d
File deleted
DSLogic-gui/CMakeFiles/CMakeDetermineCompilerABI_CXX.bin
deleted
100644 → 0
View file @
a6a3024d
File deleted
DSLogic-gui/CMakeFiles/CompilerIdC/a.out
deleted
100644 → 0
View file @
a6a3024d
File deleted
DSLogic-gui/CMakeFiles/CompilerIdCXX/a.out
deleted
100644 → 0
View file @
a6a3024d
File deleted
DSLogic-gui/CMakeLists.txt
View file @
95f2bf89
...
...
@@ -85,8 +85,8 @@ set(DS_TITLE DSLogic)
set
(
DS_DESCRIPTION
"A GUI for DSLogic"
)
set
(
DS_VERSION_MAJOR 0
)
set
(
DS_VERSION_MINOR
2
)
set
(
DS_VERSION_MICRO
1
)
set
(
DS_VERSION_MINOR
3
)
set
(
DS_VERSION_MICRO
0
)
set
(
DS_VERSION_STRING
${
DS_VERSION_MAJOR
}
.
${
DS_VERSION_MINOR
}
.
${
DS_VERSION_MICRO
}
)
...
...
@@ -156,6 +156,8 @@ set(DSLogic_SOURCES
pv/view/view.cpp
pv/view/viewport.cpp
pv/view/dsosignal.cpp
pv/view/dsldial.cpp
pv/dock/dsotriggerdock.cpp
)
set
(
DSLogic_HEADERS
...
...
@@ -187,6 +189,8 @@ set(DSLogic_HEADERS
pv/view/view.h
pv/view/dsosignal.h
pv/view/viewport.h
pv/view/dsldial.h
pv/dock/dsotriggerdock.h
)
set
(
DSLogic_FORMS
...
...
DSLogic-gui/INSTALL
View file @
95f2bf89
-------------------------------------------------------------------------------
INSTALL
-------------------------------------------------------------------------------
Requirements
------------
- git
- g++
- make
- libtool
- pkg-config >= 0.22
- cmake >= 2.6
- libglib >= 2.28.0
- Qt >= 4.5
- libboost >= 1.42 (including the following libs):
- libboost-system
- libboost-thread
- libsigrok4DSLogic >= 0.2.0
Building and installing
-----------------------
Get the DSLogic-gui source code from: www.dreamsourcelab.com/download.html
In order to build it, run:
$ cd DSLogic-gui
$ cmake .
$ make
For installing PulseView:
$ make install
See the following wiki page for more (OS-specific) instructions:
http://sigrok.org/wiki/Building
Creating a source distribution package
--------------------------------------
In order to build a source package begin with an unconfigured source tree.
$ mkdir dist
$ cd dist
$ cmake ..
$ make package_source
-------------------------------------------------------------------------------
INSTALL
-------------------------------------------------------------------------------
Requirements
------------
- git
- g++
- make
- libtool
- pkg-config >= 0.22
- cmake >= 2.6
- libglib >= 2.28.0
- Qt >= 4.5
- libboost >= 1.42 (including the following libs):
- libboost-system
- libboost-thread
- libsigrok4DSLogic >= 0.2.0
Building and installing
-----------------------
Get the DSLogic-gui source code from: www.dreamsourcelab.com/download.html
In order to build it, run:
$ cd DSLogic-gui
$ cmake .
$ make
For installing PulseView:
$ make install
See the following wiki page for more (OS-specific) instructions:
http://sigrok.org/wiki/Building
Creating a source distribution package
--------------------------------------
In order to build a source package begin with an unconfigured source tree.
$ mkdir dist
$ cd dist
$ cmake ..
$ make package_source
DSLogic-gui/NEWS
View file @
95f2bf89
0.1.0 (2013-12-15)
------------------
* Initial release.
0.1.0 (2013-12-15)
------------------
* Initial release.
DSLogic-gui/configs/DSLogic.bin
deleted
100644 → 0
View file @
a6a3024d
File deleted
DSLogic-gui/configs/DSLogic.fw
deleted
100644 → 0
View file @
a6a3024d
File deleted
DSLogic-gui/install_manifest.txt
deleted
100644 → 0
View file @
a6a3024d
/usr/local/bin/DSLogic
/usr/local/bin/res/DSLogic.fw
/usr/local/bin/res/DSLogic.bin
DSLogic-gui/ltrace.txt
deleted
100644 → 0
View file @
a6a3024d
This diff is collapsed.
Click to expand it.
DSLogic-gui/pv/data/dsosnapshot.cpp
View file @
95f2bf89
...
...
@@ -70,8 +70,8 @@ void DsoSnapshot::append_payload(const sr_datafeed_dso &dso)
append_payload_to_envelope_levels
();
}
const
uint
16_t
*
DsoSnapshot
::
get_samples
(
int64_t
start_sample
,
int64_t
end_sample
)
const
const
uint
8_t
*
DsoSnapshot
::
get_samples
(
int64_t
start_sample
,
int64_t
end_sample
,
uint16_t
index
)
const
{
assert
(
start_sample
>=
0
);
assert
(
start_sample
<
(
int64_t
)
get_sample_count
());
...
...
@@ -85,7 +85,7 @@ const uint16_t* DsoSnapshot::get_samples(
// memcpy(data, (uint16_t*)_data + start_sample, sizeof(uint16_t) *
// (end_sample - start_sample));
// return data;
return
(
uint
16_t
*
)
_data
+
start_sample
;
return
(
uint
8_t
*
)
_data
+
start_sample
*
_channel_num
+
index
;
}
void
DsoSnapshot
::
get_envelope_section
(
EnvelopeSection
&
s
,
...
...
@@ -150,7 +150,7 @@ void DsoSnapshot::append_payload_to_envelope_levels()
dest_ptr
=
e0
.
samples
+
prev_length
;
// Iterate through the samples to populate the first level mipmap
const
uint
16_t
*
const
stop_src_ptr
=
(
uint16
_t
*
)
_data
+
const
uint
8_t
*
const
stop_src_ptr
=
(
uint8
_t
*
)
_data
+
e0
.
length
*
EnvelopeScaleFactor
*
_channel_num
;
// for (const uint16_t *src_ptr = (uint16_t*)_data +
// prev_length * EnvelopeScaleFactor;
...
...
@@ -163,13 +163,13 @@ void DsoSnapshot::append_payload_to_envelope_levels()
// *dest_ptr++ = sub_sample;
// }
for
(
const
uint
16_t
*
src_ptr
=
(
uint16
_t
*
)
_data
+
for
(
const
uint
8_t
*
src_ptr
=
(
uint8
_t
*
)
_data
+
prev_length
*
EnvelopeScaleFactor
*
_channel_num
+
i
;
src_ptr
<
stop_src_ptr
;
src_ptr
+=
EnvelopeScaleFactor
*
_channel_num
)
{
const
uint
16
_t
*
begin_src_ptr
=
const
uint
8
_t
*
begin_src_ptr
=
src_ptr
;
const
uint
16
_t
*
const
end_src_ptr
=
const
uint
8
_t
*
const
end_src_ptr
=
src_ptr
+
EnvelopeScaleFactor
*
_channel_num
;
EnvelopeSample
sub_sample
;
...
...
DSLogic-gui/pv/data/dsosnapshot.h
View file @
95f2bf89
...
...
@@ -40,8 +40,8 @@ class DsoSnapshot : public Snapshot
public:
struct
EnvelopeSample
{
uint
16
_t
min
;
uint
16
_t
max
;
uint
8
_t
min
;
uint
8
_t
max
;
};
struct
EnvelopeSection
...
...
@@ -74,8 +74,8 @@ public:
void
append_payload
(
const
sr_datafeed_dso
&
dso
);
const
uint
16
_t
*
get_samples
(
int64_t
start_sample
,
int64_t
end_sample
)
const
;
const
uint
8
_t
*
get_samples
(
int64_t
start_sample
,
int64_t
end_sample
,
uint16_t
index
)
const
;
void
get_envelope_section
(
EnvelopeSection
&
s
,
uint64_t
start
,
uint64_t
end
,
float
min_length
,
int
probe_index
)
const
;
...
...
DSLogic-gui/pv/dialogs/deviceoptions.cpp
View file @
95f2bf89
...
...
@@ -194,6 +194,7 @@ void DeviceOptions::disable_all_probes()
void
DeviceOptions
::
mode_changed
(
QString
mode
)
{
(
void
)
mode
;
// Commit mode
sr_config_set
(
_sdi
,
SR_CONF_DEVICE_MODE
,
g_variant_new_string
(
_mode_comboBox
.
currentText
().
toLocal8Bit
()));
setup_probes
();
...
...
DSLogic-gui/pv/dock/dsotriggerdock.cpp
0 → 100644
View file @
95f2bf89
/*
* This file is part of the DSLogic-gui project.
* DSLogic-gui is based on PulseView.
*
* Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
* Copyright (C) 2013 DreamSourceLab <dreamsourcelab@dreamsourcelab.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "dsotriggerdock.h"
#include "../sigsession.h"
#include <QObject>
#include <QLabel>
#include <QRadioButton>
#include <QPainter>
#include <QStyleOption>
#include <QMessageBox>
#include <QVector>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include "libsigrok4DSLogic/libsigrok.h"
namespace
pv
{
namespace
dock
{
DsoTriggerDock
::
DsoTriggerDock
(
QWidget
*
parent
,
SigSession
&
session
)
:
QWidget
(
parent
),
_session
(
session
)
{
QLabel
*
position_label
=
new
QLabel
(
"Trigger Position: "
,
this
);
position_spinBox
=
new
QSpinBox
(
this
);
position_spinBox
->
setRange
(
0
,
99
);
position_spinBox
->
setButtonSymbols
(
QAbstractSpinBox
::
NoButtons
);
position_slider
=
new
QSlider
(
Qt
::
Horizontal
,
this
);
position_slider
->
setRange
(
0
,
99
);
connect
(
position_slider
,
SIGNAL
(
valueChanged
(
int
)),
position_spinBox
,
SLOT
(
setValue
(
int
)));
connect
(
position_spinBox
,
SIGNAL
(
valueChanged
(
int
)),
position_slider
,
SLOT
(
setValue
(
int
)));
connect
(
position_slider
,
SIGNAL
(
valueChanged
(
int
)),
this
,
SLOT
(
pos_changed
(
int
)));
QLabel
*
tSource_labe
=
new
QLabel
(
"Trigger Sources: "
,
this
);
QRadioButton
*
auto_radioButton
=
new
QRadioButton
(
"Auto"
);
auto_radioButton
->
setChecked
(
true
);
QRadioButton
*
ch0_radioButton
=
new
QRadioButton
(
"Channel 0"
);
QRadioButton
*
ch1_radioButton
=
new
QRadioButton
(
"Channel 1"
);
QRadioButton
*
ch0a1_radioButton
=
new
QRadioButton
(
"Channel 0 && Channel 1"
);
QRadioButton
*
ch0o1_radioButton
=
new
QRadioButton
(
"Channel 0 | Channel 1"
);
connect
(
auto_radioButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
source_changed
()));
connect
(
ch0_radioButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
source_changed
()));
connect
(
ch1_radioButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
source_changed
()));
connect
(
ch0a1_radioButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
source_changed
()));
connect
(
ch0o1_radioButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
source_changed
()));
QLabel
*
tType_labe
=
new
QLabel
(
"Trigger Types: "
,
this
);
QRadioButton
*
rising_radioButton
=
new
QRadioButton
(
"Rising Edge"
);
rising_radioButton
->
setChecked
(
true
);
QRadioButton
*
falling_radioButton
=
new
QRadioButton
(
"Falling Edge"
);
connect
(
rising_radioButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
type_changed
()));
connect
(
falling_radioButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
type_changed
()));
source_group
=
new
QButtonGroup
(
this
);
type_group
=
new
QButtonGroup
(
this
);
source_group
->
addButton
(
auto_radioButton
);
source_group
->
addButton
(
ch0_radioButton
);
source_group
->
addButton
(
ch1_radioButton
);
source_group
->
addButton
(
ch0a1_radioButton
);
source_group
->
addButton
(
ch0o1_radioButton
);
source_group
->
setId
(
auto_radioButton
,
DSO_TRIGGER_AUTO
);
source_group
->
setId
(
ch0_radioButton
,
DSO_TRIGGER_CH0
);
source_group
->
setId
(
ch1_radioButton
,
DSO_TRIGGER_CH1
);
source_group
->
setId
(
ch0a1_radioButton
,
DSO_TRIGGER_CH0A1
);
source_group
->
setId
(
ch0o1_radioButton
,
DSO_TRIGGER_CH0O1
);
type_group
->
addButton
(
rising_radioButton
);
type_group
->
addButton
(
falling_radioButton
);
type_group
->
setId
(
rising_radioButton
,
DSO_TRIGGER_RISING
);
type_group
->
setId
(
falling_radioButton
,
DSO_TRIGGER_FALLING
);
QVBoxLayout
*
layout
=
new
QVBoxLayout
(
this
);
QGridLayout
*
gLayout
=
new
QGridLayout
();
gLayout
->
addWidget
(
position_label
,
0
,
0
);
gLayout
->
addWidget
(
position_spinBox
,
0
,
1
);
gLayout
->
addWidget
(
new
QLabel
(
this
),
0
,
2
);
gLayout
->
addWidget
(
position_slider
,
1
,
0
,
1
,
3
);
gLayout
->
addWidget
(
new
QLabel
(
this
),
2
,
0
);
gLayout
->
addWidget
(
tSource_labe
,
3
,
0
);
gLayout
->
addWidget
(
auto_radioButton
,
4
,
0
);
gLayout
->
addWidget
(
ch0_radioButton
,
5
,
0
);
gLayout
->
addWidget
(
ch1_radioButton
,
5
,
1
);
gLayout
->
addWidget
(
ch0a1_radioButton
,
6
,
0
);
gLayout
->
addWidget
(
ch0o1_radioButton
,
6
,
1
);
gLayout
->
addWidget
(
new
QLabel
(
this
),
7
,
0
);
gLayout
->
addWidget
(
tType_labe
,
8
,
0
);
gLayout
->
addWidget
(
rising_radioButton
,
9
,
0
);
gLayout
->
addWidget
(
falling_radioButton
,
10
,
0
);
gLayout
->
setColumnStretch
(
3
,
1
);
layout
->
addLayout
(
gLayout
);
layout
->
addStretch
(
1
);
setLayout
(
layout
);
}
DsoTriggerDock
::~
DsoTriggerDock
()
{
}
void
DsoTriggerDock
::
paintEvent
(
QPaintEvent
*
)
{
QStyleOption
opt
;
opt
.
init
(
this
);
QPainter
p
(
this
);
style
()
->
drawPrimitive
(
QStyle
::
PE_Widget
,
&
opt
,
&
p
,
this
);
}
void
DsoTriggerDock
::
pos_changed
(
int
pos
)
{
int
ret
;
quint32
real_pos
;
real_pos
=
pos
*
_session
.
get_total_sample_len
()
/
100.0
f
;
real_pos
=
(
_session
.
get_last_sample_rate
()
>
SR_MHZ
(
100
))
?
real_pos
/
2
:
real_pos
;
ret
=
sr_config_set
(
_session
.
get_device
(),
SR_CONF_HORIZ_TRIGGERPOS
,
g_variant_new_uint32
(
real_pos
));
if
(
ret
!=
SR_OK
)
{
QMessageBox
msg
(
this
);
msg
.
setText
(
"Trigger Setting Issue"
);
msg
.
setInformativeText
(
"Change horiz trigger position failed!"
);
msg
.
setStandardButtons
(
QMessageBox
::
Ok
);
msg
.
setIcon
(
QMessageBox
::
Warning
);
msg
.
exec
();
}
}
void
DsoTriggerDock
::
source_changed
()
{
int
id
=
source_group
->
checkedId
();
int
ret
;
ret
=
sr_config_set
(
_session
.
get_device
(),
SR_CONF_TRIGGER_SOURCE
,
g_variant_new_byte
(
id
));
if
(
ret
!=
SR_OK
)
{
QMessageBox
msg
(
this
);
msg
.
setText
(
"Trigger Setting Issue"
);
msg
.
setInformativeText
(
"Change trigger source failed!"
);
msg
.
setStandardButtons
(
QMessageBox
::
Ok
);
msg
.
setIcon
(
QMessageBox
::
Warning
);
msg
.
exec
();
}
}
void
DsoTriggerDock
::
type_changed
()
{
int
id
=
type_group
->
checkedId
();
int
ret
;
ret
=
sr_config_set
(
_session
.
get_device
(),
SR_CONF_TRIGGER_SLOPE
,
g_variant_new_byte
(
id
));
if
(
ret
!=
SR_OK
)
{
QMessageBox
msg
(
this
);
msg
.
setText
(
"Trigger Setting Issue"
);
msg
.
setInformativeText
(
"Change trigger type failed!"
);
msg
.
setStandardButtons
(
QMessageBox
::
Ok
);
msg
.
setIcon
(
QMessageBox
::
Warning
);
msg
.
exec
();
}
}
void
DsoTriggerDock
::
device_change
()
{
if
(
strcmp
(
_session
.
get_device
()
->
driver
->
name
,
"DSLogic"
)
!=
0
)
{
position_spinBox
->
setDisabled
(
true
);
position_slider
->
setDisabled
(
true
);
}
else
{
position_spinBox
->
setDisabled
(
false
);
position_slider
->
setDisabled
(
false
);
}
}
}
// namespace dock
}
// namespace pv
DSLogic-gui/pv/dock/dsotriggerdock.h
0 → 100644
View file @
95f2bf89
/*
* This file is part of the DSLogic-gui project.
* DSLogic-gui is based on PulseView.
*
* Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
* Copyright (C) 2013 DreamSourceLab <dreamsourcelab@dreamsourcelab.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef DSLOGIC_PV_DSOTRIGGERDOCK_H
#define DSLOGIC_PV_DSOTRIGGERDOCK_H
#include <QDockWidget>
#include <QSlider>
#include <QSpinBox>
#include <QButtonGroup>
#include <vector>
#include <libsigrok4DSLogic/libsigrok.h>
namespace
pv
{
class
SigSession
;
namespace
dock
{
class
DsoTriggerDock
:
public
QWidget
{
Q_OBJECT
public:
DsoTriggerDock
(
QWidget
*
parent
,
SigSession
&
session
);
~
DsoTriggerDock
();
void
paintEvent
(
QPaintEvent
*
);
void
device_change
();
signals:
private
slots
:
void
pos_changed
(
int
pos
);
void
source_changed
();
void
type_changed
();
private:
private:
SigSession
&
_session
;
QSpinBox
*
position_spinBox
;
QSlider
*
position_slider
;
QButtonGroup
*
source_group
;
QButtonGroup
*
type_group
;
};
}
// namespace dock
}
// namespace pv
#endif // DSLOGIC_PV_DSOTRIGGERDOCK_H
DSLogic-gui/pv/mainwindow.cpp
View file @
95f2bf89
...
...
@@ -57,6 +57,7 @@
#include "dock/protocoldock.h"
#include "dock/triggerdock.h"
#include "dock/dsotriggerdock.h"
#include "dock/measuredock.h"
#include "dock/searchdock.h"
...
...
@@ -235,6 +236,14 @@ void MainWindow::setup_ui()
_trigger_widget
=
new
dock
::
TriggerDock
(
_trigger_dock
,
_session
);
_trigger_dock
->
setWidget
(
_trigger_widget
);
_dso_trigger_dock
=
new
QDockWidget
(
tr
(
"Trigger Setting..."
),
this
);
_dso_trigger_dock
->
setFeatures
(
QDockWidget
::
NoDockWidgetFeatures
);
_dso_trigger_dock
->
setAllowedAreas
(
Qt
::
RightDockWidgetArea
);
_dso_trigger_dock
->
setVisible
(
false
);
_dso_trigger_widget
=
new
dock
::
DsoTriggerDock
(
_dso_trigger_dock
,
_session
);
_dso_trigger_dock
->
setWidget
(
_dso_trigger_widget
);
// Setup _view widget
_view
=
new
pv
::
view
::
View
(
_session
,
this
);
_vertical_layout
->
addWidget
(
_view
);
...
...
@@ -250,9 +259,9 @@ void MainWindow::setup_ui()
SLOT
(
update
()));
connect
(
_sampling_bar
,
SIGNAL
(
device_reload
()),
this
,
SLOT
(
init
()));
connect
(
_sampling_bar
,
SIGNAL
(
run_stop
()),
this
,
SLOT
(
run_stop
()));
addToolBar
(
_sampling_bar
);
connect
(
_sampling_bar
,
SIGNAL
(
run_stop
()),
this
,
SLOT
(
run_stop
()));
addToolBar
(
_sampling_bar
);
addToolBar
(
_trig_bar
);
addToolBar
(
_device_bar
);
addToolBar
(
_file_bar
);
...
...
@@ -296,6 +305,7 @@ void MainWindow::setup_ui()
_trigger_dock
->
setObjectName
(
tr
(
"triggerDock"
));
addDockWidget
(
Qt
::
RightDockWidgetArea
,
_protocol_dock
);
addDockWidget
(
Qt
::
RightDockWidgetArea
,
_trigger_dock
);
addDockWidget
(
Qt
::
RightDockWidgetArea
,
_dso_trigger_dock
);
addDockWidget
(
Qt
::
RightDockWidgetArea
,
_measure_dock
);
addDockWidget
(
Qt
::
BottomDockWidgetArea
,
_search_dock
);
...
...
@@ -312,6 +322,8 @@ void MainWindow::setup_ui()
SLOT
(
device_detach
()));
connect
(
&
_session
,
SIGNAL
(
test_data_error
()),
this
,
SLOT
(
test_data_error
()));
connect
(
&
_session
,
SIGNAL
(
dso_ch_changed
(
uint16_t
)),
this
,
SLOT
(
dso_ch_changed
(
uint16_t
)));
connect
(
_view
,
SIGNAL
(
cursor_update
()),
_measure_widget
,
SLOT
(
cursor_update
()));
...
...
@@ -327,6 +339,14 @@ void MainWindow::init()
_trigger_widget
->
device_change
();
if
(
_session
.
get_device
())
_session
.
init_signals
(
_session
.
get_device
());
if
(
_session
.
get_device
()
->
mode
==
DSO
)
{
_sampling_bar
->
set_record_length
(
DefaultDSODepth
*
2
);
_sampling_bar
->
set_sample_rate
(
DefaultDSORate
*
2
);
_sampling_bar
->
enable_toggle
(
false
);
_view
->
hDial_changed
(
0
);
}
else
if
(
_session
.
get_device
()
->
mode
==
LOGIC
)
{
_sampling_bar
->
enable_toggle
(
true
);
}
}
void
MainWindow
::
update
()
...
...
@@ -377,6 +397,8 @@ void MainWindow::update_device_list(struct sr_dev_inst *selected_device)
// #ifdef HAVE_LA_DSLOGIC
_session
.
start_hotplug_proc
(
boost
::
bind
(
&
MainWindow
::
session_error
,
this
,
QString
(
"Hotplug failed"
),
_1
));
_session
.
start_dso_ctrl_proc
(
boost
::
bind
(
&
MainWindow
::
session_error
,
this
,
QString
(
"Hotplug failed"
),
_1
));
// #endif
}
...
...
@@ -446,11 +468,39 @@ void MainWindow::device_selected()
_sampling_bar
->
set_device
(
_device_bar
->
get_selected_device
());
_sampling_bar
->
update_sample_rate_selector
();
_view
->
show_trig_cursor
(
false
);
_trigger_dock
->
setVisible
(
false
);
_dso_trigger_dock
->
setVisible
(
false
);
_protocol_dock
->
setVisible
(
false
);
_measure_dock
->
setVisible
(
false
);
_search_dock
->
setVisible
(
false
);
init
();
}
else
{
show_session_error
(
"Open Device Failed"
,
"the selected device can't be opened!"
);
}
if
(
_device_bar
->
get_selected_device
()
->
mode
==
DSO
)
{
QMessageBox
msg
(
this
);
msg
.
setText
(
"Zero Adjustment"
);
msg
.
setInformativeText
(
"Please left both of channels unconnect for zero adjustment!"
);
msg
.
setStandardButtons
(
QMessageBox
::
Ok
);
msg
.
setIcon
(
QMessageBox
::
Warning
);
msg
.
exec
();
int
ret
=
sr_config_set
(
_device_bar
->
get_selected_device
(),
SR_CONF_ZERO
,
g_variant_new_boolean
(
TRUE
));
if
(
ret
!=
SR_OK
)
{
QMessageBox
msg
(
this
);
msg
.
setText
(
"Zero Adjustment Issue"
);
msg
.
setInformativeText
(
"Can't send out the command of zero adjustment!"
);
msg
.
setStandardButtons
(
QMessageBox
::
Ok
);
msg
.
setIcon
(
QMessageBox
::
Warning
);
msg
.
exec
();
}
else
{
run_stop
();
g_usleep
(
100000
);
run_stop
();
}
}
}
void
MainWindow
::
device_attach
()
...
...
@@ -508,6 +558,31 @@ void MainWindow::run_stop()
_sampling_bar
->
enable_run_stop
(
true
);
}
void
MainWindow
::
dso_ch_changed
(
uint16_t
num
)
{
if
(
num
==
1
)
{
_sampling_bar
->
set_record_length
(
DefaultDSODepth
*
2
);
_sampling_bar
->
set_sample_rate
(
DefaultDSORate
*
2
);
_session
.
set_total_sample_len
(
_sampling_bar
->
get_record_length
());
if
(
_session
.
get_capture_state
()
==
SigSession
::
Running
)
{
_session
.
stop_capture
();
_session
.
start_capture
(
_sampling_bar
->
get_record_length
(),
boost
::
bind
(
&
MainWindow
::
session_error
,
this
,
QString
(
"Capture failed"
),
_1
));
}
}
else
{
_sampling_bar
->
set_record_length
(
DefaultDSODepth
);
_sampling_bar
->
set_sample_rate
(
DefaultDSORate
);
_session
.
set_total_sample_len
(
_sampling_bar
->
get_record_length
());
if
(
_session
.
get_capture_state
()
==
SigSession
::
Running
)
{
_session
.
stop_capture
();
_session
.
start_capture
(
_sampling_bar
->
get_record_length
(),
boost
::
bind
(
&
MainWindow
::
session_error
,
this
,
QString
(
"Capture failed"
),
_1
));
}
}
}
void
MainWindow
::
test_data_error
()
{
_session
.
stop_capture
();
...
...
@@ -521,12 +596,14 @@ void MainWindow::test_data_error()
void
MainWindow
::
capture_state_changed
(
int
state
)
{
_sampling_bar
->
enable_toggle
(
state
!=
SigSession
::
Running
);
_trig_bar
->
enable_toggle
(
state
!=
SigSession
::
Running
);
if
(
_session
.
get_device
()
->
mode
!=
DSO
)
{
_sampling_bar
->
enable_toggle
(
state
!=
SigSession
::
Running
);
_trig_bar
->
enable_toggle
(
state
!=
SigSession
::
Running
);
_measure_dock
->
widget
()
->
setEnabled
(
state
!=
SigSession
::
Running
);
}
_device_bar
->
enable_toggle
(
state
!=
SigSession
::
Running
);
_file_bar
->
enable_toggle
(
state
!=
SigSession
::
Running
);
_sampling_bar
->
set_sampling
(
state
==
SigSession
::
Running
);
_measure_dock
->
widget
()
->
setEnabled
(
state
!=
SigSession
::
Running
);
_view
->
on_state_changed
(
state
!=
SigSession
::
Running
);
}
...
...
@@ -537,7 +614,10 @@ void MainWindow::on_protocol(bool visible)
void
MainWindow
::
on_trigger
(
bool
visible
)
{
_trigger_dock
->
setVisible
(
visible
);
if
(
_session
.
get_device
()
->
mode
!=
DSO
)
_trigger_dock
->
setVisible
(
visible
);
else
_dso_trigger_dock
->
setVisible
(
visible
);
}
void
MainWindow
::
on_measure
(
bool
visible
)
...
...
DSLogic-gui/pv/mainwindow.h
View file @
95f2bf89
...
...
@@ -54,6 +54,7 @@ class LogoBar;
namespace
dock
{
class
ProtocolDock
;
class
TriggerDock
;
class
DsoTriggerDock
;
class
MeasureDock
;
class
SearchDock
;
}
...
...
@@ -66,6 +67,10 @@ class MainWindow : public QMainWindow
{
Q_OBJECT
private: