return result;
}
+bool SignalBase::has_samples() const
+{
+ bool result = false;
+
+ if (channel_type_ == AnalogChannel)
+ {
+ shared_ptr<Analog> data = dynamic_pointer_cast<Analog>(data_);
+ if (data) {
+ auto segments = data->analog_segments();
+ if ((segments.size() > 0) && (segments.front()->get_sample_count() > 0))
+ result = true;
+ }
+ }
+
+ if (channel_type_ == LogicChannel)
+ {
+ shared_ptr<Logic> data = dynamic_pointer_cast<Logic>(data_);
+ if (data) {
+ auto segments = data->logic_segments();
+ if ((segments.size() > 0) && (segments.front()->get_sample_count() > 0))
+ result = true;
+ }
+ }
+
+ return result;
+}
+
SignalBase::ConversionType SignalBase::get_conversion_type() const
{
return conversion_type_;
*/
bool segment_is_complete(uint32_t segment_id) const;
+ /**
+ * Determines whether this signal has any sample data at all.
+ */
+ bool has_samples() const;
+
/**
* Queries the kind of conversion performed on this channel.
*/
{
set_all_channels_conditionally([](const shared_ptr<SignalBase> signal)
{
+ // Never enable channels without sample data
+ if (!signal->has_samples())
+ return false;
+
// Non-logic channels are considered to always have a signal
if (signal->type() != SignalBase::LogicChannel)
return true;