namespace data {
class Analog;
class AnalogSegment;
+class DecodeSignal;
class Logic;
class LogicSegment;
class SignalBase;
Running
};
+ static shared_ptr<sigrok::Context> sr_context;
+
public:
Session(DeviceManager &device_manager, QString name);
double get_samplerate() const;
+ uint32_t get_segment_count() const;
+
void register_view(shared_ptr<views::ViewBase> view);
void deregister_view(shared_ptr<views::ViewBase> view);
const unordered_set< shared_ptr<data::SignalBase> > signalbases() const;
+ bool all_segments_complete(uint32_t segment_id) const;
+
#ifdef ENABLE_DECODE
- bool add_decoder(srd_decoder *const dec);
+ shared_ptr<data::DecodeSignal> add_decode_signal();
- void remove_decode_signal(shared_ptr<data::SignalBase> signalbase);
+ void remove_decode_signal(shared_ptr<data::DecodeSignal> signal);
#endif
private:
void free_unused_memory();
+ void signal_new_segment();
+ void signal_segment_completed();
+
void feed_in_header();
void feed_in_meta(shared_ptr<sigrok::Meta> meta);
void feed_in_trigger();
void feed_in_frame_begin();
+ void feed_in_frame_end();
void feed_in_logic(shared_ptr<sigrok::Logic> logic);
shared_ptr<data::LogicSegment> cur_logic_segment_;
map< shared_ptr<sigrok::Channel>, shared_ptr<data::AnalogSegment> >
cur_analog_segments_;
+ int32_t highest_segment_id_;
std::thread sampling_thread_;
bool out_of_memory_;
bool data_saved_;
+ bool frame_began_;
Q_SIGNALS:
void capture_state_changed(int state);
void trigger_event(util::Timestamp location);
- void frame_began();
+ void new_segment(int new_segment_id);
+ void segment_completed(int segment_id);
void data_received();
- void frame_ended();
-
void add_view(const QString &title, views::ViewType type,
Session *session);