projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove Header::BaselineOffset and move arrows as needed instead
[pulseview.git]
/
pv
/
session.cpp
diff --git
a/pv/session.cpp
b/pv/session.cpp
index 0056e460b81ad92b2ef075bc43014914bd16ba3e..eec1a051b5a8838ba3f81b58c0759adbadb024a9 100644
(file)
--- a/
pv/session.cpp
+++ b/
pv/session.cpp
@@
-17,32
+17,25
@@
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
-#ifdef _WIN32
-// Windows: Avoid boost/thread namespace pollution (which includes windows.h).
-#define NOGDI
-#define NORESOURCE
-#endif
-#include <boost/thread/locks.hpp>
-#include <boost/thread/shared_mutex.hpp>
-
#include <QFileInfo>
#include <cassert>
#include <QFileInfo>
#include <cassert>
+#include <memory>
#include <mutex>
#include <stdexcept>
#include <sys/stat.h>
#include <mutex>
#include <stdexcept>
#include <sys/stat.h>
-#include "session.hpp"
#include "devicemanager.hpp"
#include "devicemanager.hpp"
+#include "session.hpp"
#include "data/analog.hpp"
#include "data/analogsegment.hpp"
#include "data/analog.hpp"
#include "data/analogsegment.hpp"
+#include "data/decode/decoder.hpp"
#include "data/decoderstack.hpp"
#include "data/logic.hpp"
#include "data/logicsegment.hpp"
#include "data/signalbase.hpp"
#include "data/decoderstack.hpp"
#include "data/logic.hpp"
#include "data/logicsegment.hpp"
#include "data/signalbase.hpp"
-#include "data/decode/decoder.hpp"
#include "devices/hardwaredevice.hpp"
#include "devices/inputfile.hpp"
#include "devices/hardwaredevice.hpp"
#include "devices/inputfile.hpp"
@@
-62,10
+55,6
@@
#include <libsigrokdecode/libsigrokdecode.h>
#endif
#include <libsigrokdecode/libsigrokdecode.h>
#endif
-using boost::shared_lock;
-using boost::shared_mutex;
-using boost::unique_lock;
-
using std::bad_alloc;
using std::dynamic_pointer_cast;
using std::find_if;
using std::bad_alloc;
using std::dynamic_pointer_cast;
using std::find_if;
@@
-81,9
+70,9
@@
using std::mutex;
using std::pair;
using std::recursive_mutex;
using std::runtime_error;
using std::pair;
using std::recursive_mutex;
using std::runtime_error;
-using std::set;
using std::shared_ptr;
using std::string;
using std::shared_ptr;
using std::string;
+using std::unique_ptr;
using std::unordered_set;
using std::vector;
using std::unordered_set;
using std::vector;
@@
-92,18
+81,13
@@
using sigrok::Channel;
using sigrok::ConfigKey;
using sigrok::DatafeedCallbackFunction;
using sigrok::Error;
using sigrok::ConfigKey;
using sigrok::DatafeedCallbackFunction;
using sigrok::Error;
-using sigrok::Header;
using sigrok::InputFormat;
using sigrok::Logic;
using sigrok::Meta;
using sigrok::InputFormat;
using sigrok::Logic;
using sigrok::Meta;
-using sigrok::OutputFormat;
using sigrok::Packet;
using sigrok::Packet;
-using sigrok::PacketPayload;
using sigrok::Session;
using sigrok::Session;
-using sigrok::SessionDevice;
using Glib::VariantBase;
using Glib::VariantBase;
-using Glib::Variant;
namespace pv {
Session::Session(DeviceManager &device_manager, QString name) :
namespace pv {
Session::Session(DeviceManager &device_manager, QString name) :
@@
-788,6
+772,9
@@
void Session::update_signals()
all_signal_data_.insert(logic_data_);
signalbase->set_data(logic_data_);
all_signal_data_.insert(logic_data_);
signalbase->set_data(logic_data_);
+
+ connect(this, SIGNAL(capture_state_changed(int)),
+ signalbase.get(), SLOT(on_capture_state_changed(int)));
}
signal = shared_ptr<views::TraceView::Signal>(
}
signal = shared_ptr<views::TraceView::Signal>(
@@
-806,6
+793,9
@@
void Session::update_signals()
shared_ptr<data::Analog> data(new data::Analog());
all_signal_data_.insert(data);
signalbase->set_data(data);
shared_ptr<data::Analog> data(new data::Analog());
all_signal_data_.insert(data);
signalbase->set_data(data);
+
+ connect(this, SIGNAL(capture_state_changed(int)),
+ signalbase.get(), SLOT(on_capture_state_changed(int)));
}
signal = shared_ptr<views::TraceView::Signal>(
}
signal = shared_ptr<views::TraceView::Signal>(
@@
-816,7
+806,7
@@
void Session::update_signals()
}
default:
}
default:
- assert(
0
);
+ assert(
false
);
break;
}
}
break;
}
}
@@
-865,7
+855,7
@@
void Session::sample_thread_proc(function<void (const QString)> error_handler)
// Confirm that SR_DF_END was received
if (cur_logic_segment_) {
qDebug("SR_DF_END was not received.");
// Confirm that SR_DF_END was received
if (cur_logic_segment_) {
qDebug("SR_DF_END was not received.");
- assert(
0
);
+ assert(
false
);
}
// Optimize memory usage
}
// Optimize memory usage
@@
-987,12
+977,15
@@
void Session::feed_in_analog(shared_ptr<Analog> analog)
const vector<shared_ptr<Channel>> channels = analog->channels();
const unsigned int channel_count = channels.size();
const size_t sample_count = analog->num_samples() / channel_count;
const vector<shared_ptr<Channel>> channels = analog->channels();
const unsigned int channel_count = channels.size();
const size_t sample_count = analog->num_samples() / channel_count;
- const float *data = static_cast<const float *>(analog->data_pointer());
bool sweep_beginning = false;
bool sweep_beginning = false;
+ unique_ptr<float> data(new float[analog->num_samples()]);
+ analog->get_data_as_float(data.get());
+
if (signalbases_.empty())
update_signals();
if (signalbases_.empty())
update_signals();
+ float *channel_data = data.get();
for (auto channel : channels) {
shared_ptr<data::AnalogSegment> segment;
for (auto channel : channels) {
shared_ptr<data::AnalogSegment> segment;
@@
-1026,7
+1019,7
@@
void Session::feed_in_analog(shared_ptr<Analog> analog)
assert(segment);
// Append the samples in the segment
assert(segment);
// Append the samples in the segment
- segment->append_interleaved_samples(data++, sample_count,
+ segment->append_interleaved_samples(
channel_
data++, sample_count,
channel_count);
}
channel_count);
}
@@
-1041,7
+1034,7
@@
void Session::feed_in_analog(shared_ptr<Analog> analog)
void Session::data_feed_in(shared_ptr<sigrok::Device> device,
shared_ptr<Packet> packet)
{
void Session::data_feed_in(shared_ptr<sigrok::Device> device,
shared_ptr<Packet> packet)
{
- static bool frame_began
=
false;
+ static bool frame_began
=
false;
(void)device;
(void)device;