+ if (signal->type() == data::SignalBase::LogicChannel) {
+ // All logic channels share the same data segments
+ shared_ptr<data::Logic> ldata = signal->logic_data();
+
+ const deque< shared_ptr<data::LogicSegment> > &lsegments =
+ ldata->logic_segments();
+
+ if (lsegments.empty()) {
+ error_ = tr("Can't save logic channel without data.");
+ return false;
+ }
+
+ lsegment = lsegments.front();
+ any_segment = lsegment;
+ }
+
+ if (signal->type() == data::SignalBase::AnalogChannel) {
+ // Each analog channel has its own segments
+ shared_ptr<data::Analog> adata = signal->analog_data();
+
+ const deque< shared_ptr<data::AnalogSegment> > &asegments =
+ adata->analog_segments();
+
+ if (asegments.empty()) {
+ error_ = tr("Can't save analog channel without data.");
+ return false;
+ }
+
+ asegment_list.push_back(asegments.front());
+ any_segment = asegments.front();
+
+ achannel_list.push_back(signal);
+ }
+ }