if (iter != prev_sigs.end()) {
// Copy the signal from the old set to the new
signal = *iter;
- auto logic_signal = dynamic_pointer_cast<
- view::LogicSignal>(signal);
- if (logic_signal)
- logic_signal->set_logic_data(
- logic_data_);
} else {
// Create a new signal
signalbase = shared_ptr<data::SignalBase>(
switch(channel->type()->id()) {
case SR_CHANNEL_LOGIC:
+ signalbase->set_data(logic_data_);
signal = shared_ptr<view::Signal>(
new view::LogicSignal(*this,
- device_, signalbase, logic_data_));
+ device_, signalbase));
all_signal_data_.insert(logic_data_);
signalbases_.insert(signalbase);
break;
LogicSignal::LogicSignal(
pv::Session &session,
shared_ptr<devices::Device> device,
- shared_ptr<data::SignalBase> base,
- shared_ptr<data::Logic> data) :
+ shared_ptr<data::SignalBase> base) :
Signal(session, base),
signal_height_(QFontMetrics(QApplication::font()).height() * 2),
device_(device),
- data_(data),
trigger_none_(nullptr),
trigger_rising_(nullptr),
trigger_high_(nullptr),
shared_ptr<pv::data::SignalData> LogicSignal::data() const
{
- return data_;
+ return base_->logic_data();
}
shared_ptr<pv::data::Logic> LogicSignal::logic_data() const
{
- return data_;
-}
-
-void LogicSignal::set_logic_data(std::shared_ptr<pv::data::Logic> data)
-{
- data_ = data;
+ return base_->logic_data();
}
std::pair<int, int> LogicSignal::v_extents() const
vector< pair<int64_t, bool> > edges;
assert(base_);
- assert(data_);
assert(owner_);
const int y = get_visual_y();
const float low_offset = y + 0.5f;
const deque< shared_ptr<pv::data::LogicSegment> > &segments =
- data_->logic_segments();
+ base_->logic_data()->logic_segments();
if (segments.empty())
return;
public:
LogicSignal(pv::Session &session,
std::shared_ptr<devices::Device> device,
- std::shared_ptr<data::SignalBase> base,
- std::shared_ptr<pv::data::Logic> data);
+ std::shared_ptr<data::SignalBase> base);
virtual ~LogicSignal() = default;
std::shared_ptr<pv::data::Logic> logic_data() const;
- void set_logic_data(std::shared_ptr<pv::data::Logic> data);
-
/**
* Computes the vertical extents of the contents of this row item.
* @return A pair containing the minimum and maximum y-values.
int signal_height_;
std::shared_ptr<pv::devices::Device> device_;
- std::shared_ptr<pv::data::Logic> data_;
const sigrok::TriggerMatchType *trigger_match_;
QToolBar *trigger_bar_;