]> sigrok.org Git - pulseview.git/blobdiff - pv/data/decode/decoder.cpp
Initial support for SRD_OUTPUT_LOGIC
[pulseview.git] / pv / data / decode / decoder.cpp
index f644b8af3a3356e03db91af8b948119e2cb4be17..b1cf42d5d0edfa7810670500d444df3eead3848e 100644 (file)
@@ -327,6 +327,26 @@ void Decoder::on_class_visibility_changed()
        annotation_visibility_changed();
 }
 
+bool Decoder::has_logic_output() const
+{
+       return (srd_decoder_->logic_output_channels != nullptr);
+}
+
+const vector<DecoderLogicOutputChannel> Decoder::logic_output_channels() const
+{
+       vector<DecoderLogicOutputChannel> result;
+
+       for (GSList *l = srd_decoder_->logic_output_channels; l; l = l->next) {
+               const srd_decoder_logic_output_channel* ch_data =
+                       (srd_decoder_logic_output_channel*)l->data;
+
+               result.emplace_back(QString::fromUtf8(ch_data->id),
+                       QString::fromUtf8(ch_data->desc), ch_data->samplerate);
+       }
+
+       return result;
+}
+
 }  // namespace decode
 }  // namespace data
 }  // namespace pv