projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Various minor whitespace and consistency fixes.
[pulseview.git]
/
pv
/
devices
/
inputfile.cpp
diff --git
a/pv/devices/inputfile.cpp
b/pv/devices/inputfile.cpp
index e92bf208bf17989039bed7b4dbbbbe277f49093f..3ddc8ae00db06042b97f5e10f599560b3d69b22b 100644
(file)
--- a/
pv/devices/inputfile.cpp
+++ b/
pv/devices/inputfile.cpp
@@
-37,19
+37,32
@@
InputFile::InputFile(const std::shared_ptr<sigrok::Context> &context,
File(file_name),
context_(context),
input_(format->create_input(options)),
File(file_name),
context_(context),
input_(format->create_input(options)),
- interrupt_(false) {
+ interrupt_(false)
+{
if (!input_)
throw QString("Failed to create input");
}
if (!input_)
throw QString("Failed to create input");
}
-void InputFile::create() {
+void InputFile::open()
+{
+ if (session_)
+ close();
+
session_ = context_->create_session();
}
session_ = context_->create_session();
}
-void InputFile::start() {
+void InputFile::close()
+{
+ if (session_)
+ session_->remove_devices();
+}
+
+void InputFile::start()
+{
}
}
-void InputFile::run() {
+void InputFile::run()
+{
char buffer[BufferSize];
bool need_device = true;
char buffer[BufferSize];
bool need_device = true;
@@
-84,7
+97,8
@@
void InputFile::run() {
input_->end();
}
input_->end();
}
-void InputFile::stop() {
+void InputFile::stop()
+{
interrupt_ = true;
}
interrupt_ = true;
}