#include <libsigrokdecode/libsigrokdecode.h>
+#include <pv/data/decode/decoder.hpp>
#include <pv/data/decode/row.hpp>
#include <pv/data/decode/rowdata.hpp>
#include <pv/data/signalbase.hpp>
class SignalBase;
class SignalData;
-struct DecodeChannel
+struct DecodeBinaryDataChunk
{
- uint16_t id; ///< Global numerical ID for the decode channels in the stack
- uint16_t bit_id; ///< Tells which bit within a sample represents this channel
- const bool is_optional;
- const pv::data::SignalBase *assigned_signal;
- const QString name, desc;
- int initial_pin_state;
- const shared_ptr<pv::data::decode::Decoder> decoder_;
- const srd_channel *pdch_;
+ vector<uint8_t> data;
+ uint64_t sample; ///< Number of the sample where this data was provided by the PD
+};
+
+struct DecodeBinaryClass
+{
+ const decode::Decoder* decoder;
+ const decode::DecodeBinaryClassInfo* info;
+ vector<DecodeBinaryDataChunk> chunks;
};
struct DecodeSegment
pv::util::Timestamp start_time;
double samplerate;
int64_t samples_decoded_incl, samples_decoded_excl;
+ vector<DecodeBinaryClass> binary_classes;
};
class DecodeSignal : public SignalBase
bool is_paused() const;
QString error_message() const;
- const vector<data::DecodeChannel> get_channels() const;
+ const vector<data::decode::DecodeChannel> get_channels() const;
void auto_assign_signals(const shared_ptr<pv::data::decode::Decoder> dec);
void assign_signal(const uint16_t channel_id, const SignalBase *signal);
int get_assigned_signal_count() const;
int64_t get_decoded_sample_count(uint32_t segment_id,
bool include_processing) const;
- vector<decode::Row> visible_rows() const;
+ vector<decode::Row> get_rows(bool visible_only) const;
/**
* Extracts annotations from a single row into a vector.
vector<pv::data::decode::Annotation> &dest,
uint32_t segment_id, uint64_t start_sample, uint64_t end_sample) const;
+ uint32_t get_binary_data_chunk_count(uint32_t segment_id,
+ const data::decode::Decoder* dec, uint32_t bin_class_id) const;
+ void get_binary_data_chunk(uint32_t segment_id, const data::decode::Decoder* dec,
+ uint32_t bin_class_id, uint32_t chunk_id, const vector<uint8_t> **dest,
+ uint64_t *size);
+ void get_binary_data_chunks_merged(uint32_t segment_id, const data::decode::Decoder* dec,
+ uint32_t bin_class_id, uint64_t start_sample, uint64_t end_sample,
+ vector<uint8_t> *dest) const;
+ const DecodeBinaryClass* get_binary_data_class(uint32_t segment_id,
+ const data::decode::Decoder* dec, uint32_t bin_class_id) const;
+
virtual void save_settings(QSettings &settings) const;
virtual void restore_settings(QSettings &settings);
void create_decode_segment();
static void annotation_callback(srd_proto_data *pdata, void *decode_signal);
+ static void binary_callback(srd_proto_data *pdata, void *decode_signal);
Q_SIGNALS:
+ void decoder_stacked(void* decoder); ///< decoder is of type decode::Decoder*
+ void decoder_removed(void* decoder); ///< decoder is of type decode::Decoder*
void new_annotations(); // TODO Supply segment for which they belong to
+ void new_binary_data(unsigned int segment_id, void* decoder, unsigned int bin_class_id);
void decode_reset();
void decode_finished();
void channels_updated();
private:
pv::Session &session_;
- vector<data::DecodeChannel> channels_;
+ vector<data::decode::DecodeChannel> channels_;
struct srd_session *srd_session_;