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
8ffa3c91
Commit
8ffa3c91
authored
9 years ago
by
DreamSourceLab
Browse files
Options
Download
Email Patches
Plain Diff
add support for path with chinese characters
parent
4348c2a8
Changes
29
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
198 additions
and
72 deletions
+198
-72
DSView/CMakeLists.txt
DSView/CMakeLists.txt
+8
-4
DSView/pv/device/device.cpp
DSView/pv/device/device.cpp
+2
-2
DSView/pv/device/device.h
DSView/pv/device/device.h
+1
-1
DSView/pv/device/devinst.h
DSView/pv/device/devinst.h
+1
-1
DSView/pv/device/file.cpp
DSView/pv/device/file.cpp
+5
-5
DSView/pv/device/file.h
DSView/pv/device/file.h
+4
-4
DSView/pv/device/inputfile.cpp
DSView/pv/device/inputfile.cpp
+8
-9
DSView/pv/device/inputfile.h
DSView/pv/device/inputfile.h
+3
-3
DSView/pv/device/sessionfile.cpp
DSView/pv/device/sessionfile.cpp
+2
-2
DSView/pv/device/sessionfile.h
DSView/pv/device/sessionfile.h
+1
-1
DSView/pv/devicemanager.cpp
DSView/pv/devicemanager.cpp
+3
-2
DSView/pv/mainwindow.cpp
DSView/pv/mainwindow.cpp
+16
-9
DSView/pv/prop/binding/binding_deviceoptions.cpp
DSView/pv/prop/binding/binding_deviceoptions.cpp
+3
-3
DSView/pv/prop/string.cpp
DSView/pv/prop/string.cpp
+2
-2
DSView/pv/sigsession.cpp
DSView/pv/sigsession.cpp
+14
-11
DSView/pv/sigsession.h
DSView/pv/sigsession.h
+3
-3
DSView/pv/toolbars/filebar.cpp
DSView/pv/toolbars/filebar.cpp
+2
-2
DSView/pv/toolbars/samplingbar.cpp
DSView/pv/toolbars/samplingbar.cpp
+2
-2
DSView/res/DSCope1.dsc
DSView/res/DSCope1.dsc
+4
-4
DSView/res/DSLogic0.dsc
DSView/res/DSLogic0.dsc
+114
-2
No files found.
DSView/CMakeLists.txt
View file @
8ffa3c91
...
...
@@ -357,10 +357,14 @@ install(FILES res/DSLogicPro.fw DESTINATION bin/res/)
install
(
FILES res/DSLogicPro.bin DESTINATION bin/res/
)
install
(
FILES res/DSCope.fw DESTINATION bin/res/
)
install
(
FILES res/DSCope.bin DESTINATION bin/res/
)
install
(
FILES res/DSLogic_ini.dsc DESTINATION bin/res/
)
install
(
FILES res/DSLogic_ini.dsc.bak DESTINATION bin/res/
)
install
(
FILES res/DSCope_ini.dsc DESTINATION bin/res/
)
install
(
FILES res/DSCope_ini.dsc.bak DESTINATION bin/res/
)
install
(
FILES res/DSLogic0.dsc DESTINATION bin/res/
)
install
(
FILES res/DSLogic0.def.dsc DESTINATION bin/res/
)
install
(
FILES res/DSLogic1.dsc DESTINATION bin/res/
)
install
(
FILES res/DSLogic1.def.dsc DESTINATION bin/res/
)
install
(
FILES res/DSLogic2.dsc DESTINATION bin/res/
)
install
(
FILES res/DSLogic2.def.dsc DESTINATION bin/res/
)
install
(
FILES res/DSCope1.dsc DESTINATION bin/res/
)
install
(
FILES res/DSCope1.def.dsc DESTINATION bin/res/
)
#===============================================================================
#= Packaging (handled by CPack)
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/device/device.cpp
View file @
8ffa3c91
...
...
@@ -64,7 +64,7 @@ void Device::release()
sr_dev_close
(
_sdi
);
}
std
::
s
tring
Device
::
format_device_title
()
const
QS
tring
Device
::
format_device_title
()
const
{
ostringstream
s
;
...
...
@@ -86,7 +86,7 @@ std::string Device::format_device_title() const
if
(
_sdi
->
version
&&
_sdi
->
version
[
0
])
s
<<
_sdi
->
version
;
return
s
.
str
();
return
QString
::
fromStdString
(
s
.
str
()
)
;
}
bool
Device
::
is_trigger_enabled
()
const
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/device/device.h
View file @
8ffa3c91
...
...
@@ -38,7 +38,7 @@ public:
void
release
();
std
::
s
tring
format_device_title
()
const
;
QS
tring
format_device_title
()
const
;
bool
is_trigger_enabled
()
const
;
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/device/devinst.h
View file @
8ffa3c91
...
...
@@ -59,7 +59,7 @@ public:
SigSession
*
owner
()
const
;
virtual
std
::
s
tring
format_device_title
()
const
=
0
;
virtual
QS
tring
format_device_title
()
const
=
0
;
GVariant
*
get_config
(
const
sr_channel
*
ch
,
const
sr_channel_group
*
group
,
int
key
);
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/device/file.cpp
View file @
8ffa3c91
...
...
@@ -32,19 +32,19 @@ using std::string;
namespace
pv
{
namespace
device
{
File
::
File
(
const
std
::
s
tring
path
)
:
File
::
File
(
QS
tring
path
)
:
_path
(
path
)
{
}
std
::
s
tring
File
::
format_device_title
()
const
QS
tring
File
::
format_device_title
()
const
{
return
boost
::
filesystem
::
path
(
_path
).
filename
().
string
()
;
return
_path
;
}
File
*
File
::
create
(
const
s
tring
&
name
)
File
*
File
::
create
(
QS
tring
name
)
{
if
(
sr_session_load
(
name
.
c_str
())
==
SR_OK
)
{
if
(
sr_session_load
(
name
.
toLocal8Bit
().
data
())
==
SR_OK
)
{
GSList
*
devlist
=
NULL
;
sr_session_dev_list
(
&
devlist
);
sr_session_destroy
();
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/device/file.h
View file @
8ffa3c91
...
...
@@ -32,16 +32,16 @@ namespace device {
class
File
:
public
DevInst
{
protected:
File
(
const
std
::
s
tring
path
);
File
(
QS
tring
path
);
public:
static
File
*
create
(
const
std
::
s
tring
&
name
);
static
File
*
create
(
QS
tring
name
);
public:
std
::
s
tring
format_device_title
()
const
;
QS
tring
format_device_title
()
const
;
protected:
const
std
::
s
tring
_path
;
const
QS
tring
_path
;
};
}
// device
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/device/inputfile.cpp
View file @
8ffa3c91
...
...
@@ -34,7 +34,7 @@ using std::string;
namespace
pv
{
namespace
device
{
InputFile
::
InputFile
(
const
std
::
s
tring
&
path
)
:
InputFile
::
InputFile
(
QS
tring
path
)
:
File
(
path
),
_input
(
NULL
)
{
...
...
@@ -71,8 +71,7 @@ void InputFile::release()
_input
=
NULL
;
}
sr_input_format
*
InputFile
::
determine_input_file_format
(
const
string
&
filename
)
sr_input_format
*
InputFile
::
determine_input_file_format
(
const
QString
filename
)
{
int
i
;
...
...
@@ -85,7 +84,7 @@ sr_input_format* InputFile::determine_input_file_format(
/* Otherwise, try to find an input module that can handle this file. */
for
(
i
=
0
;
inputs
[
i
];
i
++
)
{
if
(
inputs
[
i
]
->
format_match
(
filename
.
c_str
()))
if
(
inputs
[
i
]
->
format_match
(
filename
.
toLocal8Bit
().
data
()))
break
;
}
...
...
@@ -98,19 +97,19 @@ sr_input_format* InputFile::determine_input_file_format(
return
inputs
[
i
];
}
sr_input
*
InputFile
::
load_input_file_format
(
const
s
tring
&
filename
,
sr_input
*
InputFile
::
load_input_file_format
(
const
QS
tring
filename
,
sr_input_format
*
format
)
{
struct
stat
st
;
sr_input
*
in
;
if
(
!
format
&&
!
(
format
=
determine_input_file_format
(
filename
.
c_str
()
)))
{
determine_input_file_format
(
filename
)))
{
/* The exact cause was already logged. */
throw
tr
(
"Failed to load file"
);
}
if
(
stat
(
filename
.
c_str
(),
&
st
)
==
-
1
)
if
(
stat
(
filename
.
toLocal8Bit
().
data
(),
&
st
)
==
-
1
)
throw
tr
(
"Failed to load file"
);
/* Initialize the input module. */
...
...
@@ -121,7 +120,7 @@ sr_input* InputFile::load_input_file_format(const string &filename,
in
->
format
=
format
;
in
->
param
=
NULL
;
if
(
in
->
format
->
init
&&
in
->
format
->
init
(
in
,
filename
.
c_str
())
!=
SR_OK
)
{
in
->
format
->
init
(
in
,
filename
.
toLocal8Bit
().
data
())
!=
SR_OK
)
{
throw
tr
(
"Failed to load file"
);
}
...
...
@@ -137,7 +136,7 @@ void InputFile::run()
assert
(
_input
);
assert
(
_input
->
format
);
assert
(
_input
->
format
->
loadfile
);
_input
->
format
->
loadfile
(
_input
,
_path
.
c_str
());
_input
->
format
->
loadfile
(
_input
,
_path
.
toLocal8Bit
().
data
());
}
}
// device
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/device/inputfile.h
View file @
8ffa3c91
...
...
@@ -35,7 +35,7 @@ namespace device {
class
InputFile
:
public
File
{
public:
InputFile
(
const
std
::
s
tring
&
path
);
InputFile
(
QS
tring
path
);
sr_dev_inst
*
dev_inst
()
const
;
...
...
@@ -55,9 +55,9 @@ private:
* or NULL if no input format was selected or auto-detected.
*/
static
sr_input_format
*
determine_input_file_format
(
const
std
::
s
tring
&
filename
);
const
QS
tring
filename
);
static
sr_input
*
load_input_file_format
(
const
std
::
s
tring
&
filename
,
static
sr_input
*
load_input_file_format
(
const
QS
tring
filename
,
sr_input_format
*
format
);
private:
sr_input
*
_input
;
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/device/sessionfile.cpp
View file @
8ffa3c91
...
...
@@ -26,7 +26,7 @@
namespace
pv
{
namespace
device
{
SessionFile
::
SessionFile
(
const
std
::
s
tring
&
path
)
:
SessionFile
::
SessionFile
(
QS
tring
path
)
:
File
(
path
),
_sdi
(
NULL
)
{
...
...
@@ -41,7 +41,7 @@ void SessionFile::use(SigSession *owner) throw(QString)
{
assert
(
!
_sdi
);
if
(
sr_session_load
(
_path
.
c_str
())
!=
SR_OK
)
if
(
sr_session_load
(
_path
.
toLocal8Bit
().
data
())
!=
SR_OK
)
throw
tr
(
"Failed to open file.
\n
"
);
GSList
*
devlist
=
NULL
;
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/device/sessionfile.h
View file @
8ffa3c91
...
...
@@ -30,7 +30,7 @@ namespace device {
class
SessionFile
:
public
File
{
public:
SessionFile
(
const
std
::
s
tring
&
path
);
SessionFile
(
QS
tring
path
);
sr_dev_inst
*
dev_inst
()
const
;
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/devicemanager.cpp
View file @
8ffa3c91
...
...
@@ -106,8 +106,9 @@ std::list<boost::shared_ptr<device::DevInst> > DeviceManager::driver_scan(
QDir
dir
(
QCoreApplication
::
applicationDirPath
());
if
(
!
dir
.
cd
(
"res"
))
return
driver_devices
;
std
::
string
str
=
dir
.
absolutePath
().
toStdString
()
+
"/"
;
strcpy
(
config_path
,
str
.
c_str
());
QString
str
=
dir
.
absolutePath
()
+
"/"
;
QString
str_utf8
=
QString
::
fromLocal8Bit
(
str
.
toLocal8Bit
());
strcpy
(
config_path
,
str_utf8
.
toUtf8
().
data
());
}
// Do the scan
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/mainwindow.cpp
View file @
8ffa3c91
...
...
@@ -318,7 +318,7 @@ void MainWindow::update_device_list()
if
(
strcmp
(
selected_device
->
dev_inst
()
->
driver
->
name
,
"demo"
)
!=
0
)
{
_logo_bar
->
dsl_connected
(
true
);
QString
ses_name
=
config_path
+
QString
::
from
Local8Bit
(
selected_device
->
dev_inst
()
->
driver
->
name
)
+
QString
::
from
Utf8
(
selected_device
->
dev_inst
()
->
driver
->
name
)
+
QString
::
number
(
selected_device
->
dev_inst
()
->
mode
)
+
".dsc"
;
load_session
(
ses_name
);
...
...
@@ -336,7 +336,8 @@ void MainWindow::reload()
void
MainWindow
::
load_file
(
QString
file_name
)
{
try
{
_session
.
set_file
(
file_name
.
toStdString
());
//_session.set_file(file_name.toStdString());
_session
.
set_file
(
file_name
);
}
catch
(
QString
e
)
{
show_session_error
(
tr
(
"Failed to load "
)
+
file_name
,
e
);
_session
.
set_default_device
(
boost
::
bind
(
&
MainWindow
::
session_error
,
this
,
...
...
@@ -571,7 +572,7 @@ void MainWindow::on_save()
bool
MainWindow
::
load_session
(
QString
name
)
{
QFile
sessionFile
(
name
.
toStdString
().
c_str
()
);
QFile
sessionFile
(
name
);
if
(
!
sessionFile
.
open
(
QIODevice
::
ReadOnly
))
{
QMessageBox
msg
(
this
);
msg
.
setText
(
tr
(
"File Error"
));
...
...
@@ -582,8 +583,8 @@ bool MainWindow::load_session(QString name)
return
false
;
}
Q
ByteArray
sessionData
=
sessionFile
.
readAll
();
QJsonDocument
sessionDoc
=
QJsonDocument
::
fromJson
(
sessionData
);
Q
String
sessionData
=
QString
::
fromUtf8
(
sessionFile
.
readAll
()
)
;
QJsonDocument
sessionDoc
=
QJsonDocument
::
fromJson
(
sessionData
.
toUtf8
()
);
QJsonObject
sessionObj
=
sessionDoc
.
object
();
// check device and mode
...
...
@@ -617,7 +618,7 @@ bool MainWindow::load_session(QString name)
else
if
(
info
->
datatype
==
SR_T_FLOAT
)
_session
.
get_device
()
->
set_config
(
NULL
,
NULL
,
info
->
key
,
g_variant_new_double
(
sessionObj
[
info
->
name
].
toDouble
()));
else
if
(
info
->
datatype
==
SR_T_CHAR
)
_session
.
get_device
()
->
set_config
(
NULL
,
NULL
,
info
->
key
,
g_variant_new_string
(
sessionObj
[
info
->
name
].
toString
().
to
Local8Bit
()));
_session
.
get_device
()
->
set_config
(
NULL
,
NULL
,
info
->
key
,
g_variant_new_string
(
sessionObj
[
info
->
name
].
toString
().
to
Utf8
()));
}
}
_sampling_bar
->
update_record_length
();
...
...
@@ -680,8 +681,8 @@ bool MainWindow::load_session(QString name)
bool
MainWindow
::
store_session
(
QString
name
)
{
QFile
sessionFile
(
name
.
toStdString
().
c_str
()
);
if
(
!
sessionFile
.
open
(
QIODevice
::
WriteOnly
))
{
QFile
sessionFile
(
name
);
if
(
!
sessionFile
.
open
(
QIODevice
::
WriteOnly
|
QIODevice
::
Text
))
{
QMessageBox
msg
(
this
);
msg
.
setText
(
tr
(
"File Error"
));
msg
.
setInformativeText
(
tr
(
"Couldn't open session file to write!"
));
...
...
@@ -690,6 +691,9 @@ bool MainWindow::store_session(QString name)
msg
.
exec
();
return
false
;
}
QTextStream
outStream
(
&
sessionFile
);
outStream
.
setCodec
(
"UTF-8"
);
outStream
.
setGenerateByteOrderMark
(
true
);
GVariant
*
gvar_opts
;
GVariant
*
gvar
;
...
...
@@ -748,8 +752,11 @@ bool MainWindow::store_session(QString name)
sessionVar
[
"trigger"
]
=
_trigger_widget
->
get_session
();
}
QJsonDocument
sessionDoc
(
sessionVar
);
sessionFile
.
write
(
sessionDoc
.
toJson
());
//sessionFile.write(QString::fromUtf8(sessionDoc.toJson()));
outStream
<<
QString
::
fromUtf8
(
sessionDoc
.
toJson
());
sessionFile
.
close
();
return
true
;
}
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/prop/binding/binding_deviceoptions.cpp
View file @
8ffa3c91
...
...
@@ -66,7 +66,7 @@ DeviceOptions::DeviceOptions(struct sr_dev_inst *sdi) :
if
(
sr_config_list
(
_sdi
->
driver
,
_sdi
,
NULL
,
key
,
&
gvar_list
)
!=
SR_OK
)
gvar_list
=
NULL
;
const
QString
name
(
info
->
name
);
const
QString
name
(
info
->
label
);
switch
(
key
)
{
...
...
@@ -194,11 +194,11 @@ QString DeviceOptions::print_gvariant(GVariant *const gvar)
QString
s
;
if
(
g_variant_is_of_type
(
gvar
,
G_VARIANT_TYPE
(
"s"
)))
s
=
QString
(
g_variant_get_string
(
gvar
,
NULL
));
s
=
QString
::
fromUtf8
(
g_variant_get_string
(
gvar
,
NULL
));
else
{
gchar
*
const
text
=
g_variant_print
(
gvar
,
FALSE
);
s
=
QString
(
text
);
s
=
QString
::
fromUtf8
(
text
);
g_free
(
text
);
}
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/prop/string.cpp
View file @
8ffa3c91
...
...
@@ -47,7 +47,7 @@ QWidget* String::get_widget(QWidget *parent, bool auto_commit)
_line_edit
=
new
QLineEdit
(
parent
);
_line_edit
->
setText
(
QString
::
fromUtf8
(
g_variant_get_string
(
value
,
NULL
)));
g_variant_get_string
(
value
,
NULL
)));
g_variant_unref
(
value
);
if
(
auto_commit
)
...
...
@@ -65,7 +65,7 @@ void String::commit()
return
;
QByteArray
ba
=
_line_edit
->
text
().
toLocal8Bit
();
_setter
(
g_variant_new_string
(
ba
.
data
()));
_setter
(
g_variant_new_string
(
ba
.
data
()));
}
void
String
::
on_text_edited
(
const
QString
&
)
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/sigsession.cpp
View file @
8ffa3c91
...
...
@@ -158,7 +158,8 @@ void SigSession::set_device(boost::shared_ptr<device::DevInst> dev_inst) throw(Q
}
}
void
SigSession
::
set_file
(
const
string
&
name
)
throw
(
QString
)
void
SigSession
::
set_file
(
QString
name
)
throw
(
QString
)
{
// Deslect the old device, because file type detection in File::create
// destorys the old session inside libsigrok.
...
...
@@ -176,7 +177,7 @@ void SigSession::set_file(const string &name) throw(QString)
}
}
void
SigSession
::
save_file
(
const
std
::
s
tring
&
name
){
void
SigSession
::
save_file
(
const
QS
tring
name
){
const
deque
<
boost
::
shared_ptr
<
pv
::
data
::
LogicSnapshot
>
>
&
snapshots
=
_logic_data
->
get_snapshots
();
if
(
snapshots
.
empty
())
...
...
@@ -185,7 +186,7 @@ void SigSession::save_file(const std::string &name){
const
boost
::
shared_ptr
<
pv
::
data
::
LogicSnapshot
>
&
snapshot
=
snapshots
.
front
();
sr_session_save
(
name
.
c_str
(),
_dev_inst
->
dev_inst
(),
sr_session_save
(
name
.
toLocal8Bit
().
data
(),
_dev_inst
->
dev_inst
(),
(
unsigned
char
*
)
snapshot
->
get_data
(),
snapshot
->
unit_size
(),
snapshot
->
get_sample_count
());
...
...
@@ -213,7 +214,7 @@ void SigSession::cancelSaveFile(){
saveFileThreadRunning
=
false
;
}
void
SigSession
::
export_file
(
const
std
::
s
tring
&
name
,
QWidget
*
parent
,
const
std
::
s
tring
&
ext
){
void
SigSession
::
export_file
(
const
QS
tring
name
,
QWidget
*
parent
,
const
QS
tring
ext
){
boost
::
shared_ptr
<
pv
::
data
::
Snapshot
>
snapshot
;
int
channel_type
;
...
...
@@ -240,7 +241,7 @@ void SigSession::export_file(const std::string &name, QWidget* parent, const std
while
(
*
supportedModules
){
if
(
*
supportedModules
==
NULL
)
break
;
if
(
!
strcmp
((
*
supportedModules
)
->
id
,
ext
.
c_str
())){
if
(
!
strcmp
((
*
supportedModules
)
->
id
,
ext
.
toLocal8Bit
().
data
())){
outModule
=
*
supportedModules
;
break
;
}
...
...
@@ -251,7 +252,7 @@ void SigSession::export_file(const std::string &name, QWidget* parent, const std
GHashTable
*
params
=
g_hash_table_new
(
g_str_hash
,
g_str_equal
);
GVariant
*
filenameGVariant
=
g_variant_new_string
(
name
.
c_str
());
GVariant
*
filenameGVariant
=
g_variant_new_
byte
string
(
name
.
toLocal8Bit
().
data
());
g_hash_table_insert
(
params
,
(
char
*
)
"filename"
,
filenameGVariant
);
GVariant
*
typeGVariant
=
g_variant_new_int16
(
channel_type
);
g_hash_table_insert
(
params
,
(
char
*
)
"type"
,
typeGVariant
);
...
...
@@ -270,9 +271,11 @@ void SigSession::export_file(const std::string &name, QWidget* parent, const std
output
.
param
=
NULL
;
if
(
outModule
->
init
)
outModule
->
init
(
&
output
,
params
);
QFile
file
(
name
.
c_str
()
);
QFile
file
(
name
);
file
.
open
(
QIODevice
::
WriteOnly
|
QIODevice
::
Text
);
QTextStream
out
(
&
file
);
out
.
setCodec
(
"UTF-8"
);
out
.
setGenerateByteOrderMark
(
true
);
QFuture
<
void
>
future
;
if
(
_dev_inst
->
dev_inst
()
->
mode
==
LOGIC
)
{
future
=
QtConcurrent
::
run
([
&
]{
...
...
@@ -294,7 +297,7 @@ void SigSession::export_file(const std::string &name, QWidget* parent, const std
p
.
payload
=
&
lp
;
outModule
->
receive
(
&
output
,
&
p
,
&
data_out
);
if
(
data_out
){
out
<<
(
char
*
)
data_out
->
str
;
out
<<
QString
::
fromUtf8
(
(
char
*
)
data_out
->
str
)
;
g_string_free
(
data_out
,
TRUE
);
}
emit
progressSaveFileValueChanged
(
i
*
100
/
numsamples
);
...
...
@@ -333,8 +336,8 @@ void SigSession::export_file(const std::string &name, QWidget* parent, const std
QFutureWatcher
<
void
>
watcher
;
Qt
::
WindowFlags
flags
=
Qt
::
CustomizeWindowHint
;
QProgressDialog
dlg
(
QString
::
fromUtf8
(
"Exporting data... It can take a while."
),
QString
::
fromUtf8
(
"Cancel"
),
0
,
100
,
parent
,
flags
);
QProgressDialog
dlg
(
tr
(
"Exporting data... It can take a while."
),
tr
(
"Cancel"
),
0
,
100
,
parent
,
flags
);
dlg
.
setWindowModality
(
Qt
::
WindowModal
);
watcher
.
setFuture
(
future
);
connect
(
&
watcher
,
SIGNAL
(
finished
()),
&
dlg
,
SLOT
(
cancel
()));
...
...
@@ -832,9 +835,9 @@ void SigSession::refresh(int holdtime)
_analog_data
->
clear
();
_cur_analog_snapshot
.
reset
();
}
data_updated
();
_data_lock
=
true
;
_refresh_timer
.
start
(
holdtime
);
data_updated
();
}
void
SigSession
::
data_unlock
()
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/sigsession.h
View file @
8ffa3c91
...
...
@@ -114,13 +114,13 @@ public:
void
set_device
(
boost
::
shared_ptr
<
device
::
DevInst
>
dev_inst
)
throw
(
QString
);
void
set_file
(
const
std
::
s
tring
&
name
)
void
set_file
(
QS
tring
name
)
throw
(
QString
);
void
save_file
(
const
std
::
s
tring
&
name
);
void
save_file
(
const
QS
tring
name
);
void
set_default_device
(
boost
::
function
<
void
(
const
QString
)
>
error_handler
);
void
export_file
(
const
std
::
s
tring
&
name
,
QWidget
*
parent
,
const
std
::
s
tring
&
ext
);
void
export_file
(
const
QS
tring
name
,
QWidget
*
parent
,
const
QS
tring
ext
);
void
set_default_device
();
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/toolbars/filebar.cpp
View file @
8ffa3c91
...
...
@@ -182,7 +182,7 @@ void FileBar::on_actionExport_triggered(){
QString
ext
=
list
.
first
();
if
(
f
.
suffix
().
compare
(
ext
))
file_name
+=
tr
(
"."
)
+
ext
;
_session
.
export_file
(
file_name
.
toStdString
(),
this
,
ext
.
toStdString
()
);
_session
.
export_file
(
file_name
,
this
,
ext
);
}
}
}
...
...
@@ -215,7 +215,7 @@ void FileBar::on_actionSave_triggered()
QFileInfo
f
(
file_name
);
if
(
f
.
suffix
().
compare
(
"dsl"
))
file_name
.
append
(
tr
(
".dsl"
));
_session
.
save_file
(
file_name
.
toStdString
()
);
_session
.
save_file
(
file_name
);
}
}
}
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/toolbars/samplingbar.cpp
View file @
8ffa3c91
...
...
@@ -173,7 +173,7 @@ void SamplingBar::set_device_list(
BOOST_FOREACH
(
shared_ptr
<
pv
::
device
::
DevInst
>
dev_inst
,
devices
)
{
assert
(
dev_inst
);
const
s
tring
title
=
dev_inst
->
format_device_title
();
const
QS
tring
title
=
dev_inst
->
format_device_title
();
const
void
*
id
=
dev_inst
->
get_id
();
assert
(
id
);
...
...
@@ -181,7 +181,7 @@ void SamplingBar::set_device_list(
selected_index
=
_device_selector
.
count
();
_device_selector_map
[
id
]
=
dev_inst
;
_device_selector
.
addItem
(
title
.
c_str
()
,
_device_selector
.
addItem
(
title
,
qVariantFromValue
((
void
*
)
id
));
}
...
...
This diff is collapsed.
Click to expand it.
DSView/res/DSCope1.dsc
View file @
8ffa3c91
{
{
"Device": "DSCope",
"DeviceMode": 1,
"Horizontal trigger position": "0",
"Operation Mode": "Normal",
"Sample count": "1048576",
"Sample rate": "
5
0000",
"Time base": "
200000
0000",
"Sample rate": "
10000
0000",
"Time base": "
1
0000",
"Trigger hold off": "0",
"Trigger slope": "0",
"Trigger source": "0",
"channel": [
{
"colour": "#eeb211",
"coupling":
1
,
"coupling":
0
,
"enabled": true,
"index": 0,
"name": "0",
...
...
This diff is collapsed.
Click to expand it.
DSView/res/DSLogic0.dsc
View file @
8ffa3c91
{
{
"Device": "DSLogic",
"DeviceMode": 0,
"Filter Targets": "None",
...
...
@@ -6,13 +6,53 @@
"Operation Mode": "Normal",
"Sample count": "16777216",
"Sample rate": "100000000",
"Threshold Level":
"1.8/2.5/3.3V Level"
,
"Threshold Level":
1
,
"Trigger hold off": "0",
"Trigger slope": "0",
"Trigger source": "0",
"Using Clock Negedge": 0,
"Using External Clock": 0,
"channel": [
{
"colour": "#16191a",
"enabled": true,
"index": 0,
"name": "0",
"strigger": 0,
"type": 10000
},
{
"colour": "#8f5202",
"enabled": true,
"index": 1,
"name": "1",
"strigger": 0,
"type": 10000
},
{
"colour": "#cc0000",
"enabled": true,
"index": 2,
"name": "2",
"strigger": 0,
"type": 10000
},
{
"colour": "#f57900",
"enabled": true,
"index": 3,
"name": "3",
"strigger": 0,
"type": 10000
},
{
"colour": "#edd400",
"enabled": true,
"index": 4,
"name": "4",
"strigger": 0,
"type": 10000
},
{
"colour": "#73d216",
"enabled": true,
...
...
@@ -21,6 +61,62 @@
"strigger": 0,
"type": 10000
},
{
"colour": "#3465a4",
"enabled": true,
"index": 6,
"name": "6",
"strigger": 0,
"type": 10000
},
{
"colour": "#75507b",
"enabled": true,
"index": 7,
"name": "7",
"strigger": 0,
"type": 10000
},
{
"colour": "#16191a",
"enabled": true,
"index": 8,
"name": "8",
"strigger": 0,
"type": 10000
},
{
"colour": "#8f5202",
"enabled": true,
"index": 9,
"name": "9",
"strigger": 0,
"type": 10000
},
{
"colour": "#cc0000",
"enabled": true,
"index": 10,
"name": "10",
"strigger": 0,
"type": 10000
},
{
"colour": "#f57900",
"enabled": true,
"index": 11,
"name": "11",
"strigger": 0,
"type": 10000
},
{
"colour": "#edd400",
"enabled": true,
"index": 12,
"name": "12",
"strigger": 0,
"type": 10000
},
{
"colour": "#73d216",
"enabled": true,
...
...
@@ -28,6 +124,22 @@
"name": "13",
"strigger": 0,
"type": 10000
},
{
"colour": "#3465a4",
"enabled": true,
"index": 14,
"name": "14",
"strigger": 0,
"type": 10000
},
{
"colour": "#75507b",
"enabled": true,
"index": 15,
"name": "15",
"strigger": 0,
"type": 10000
}
],
"trigger": {
...
...
This diff is collapsed.
Click to expand it.
Prev
1
2
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