reset_decode(true);
}
+void DecodeSignal::set_name(QString name)
+{
+ SignalBase::set_name(name);
+
+ update_output_signals();
+}
+
+void DecodeSignal::set_color(QColor color)
+{
+ SignalBase::set_color(color);
+
+ update_output_signals();
+}
+
const vector< shared_ptr<Decoder> >& DecodeSignal::decoder_stack() const
{
return stack_;
shared_ptr<data::SignalBase> signal =
make_shared<data::SignalBase>(nullptr, LogicChannel);
signal->set_internal_name(logic_ch.id);
- signal->set_name(logic_ch.id);
signal->set_index(index);
signal->set_data(logic_data);
output_signals_.push_back(signal);
}
}
- // TODO Delete signals that no longer have a corresponding decoder (also from session)
+ for (shared_ptr<SignalBase> s : output_signals_) {
+ s->set_name(s->internal_name() + " (" + name() + ")");
+ s->set_color(color());
+ }
+
// TODO Assert that all sample rates are the same as the session's
- // TODO Set colors to the same as the decoder's background color
}
void DecodeSignal::set_initial_pin_state(const uint16_t channel_id, const int init_state)
DecodeSignal(pv::Session &session);
virtual ~DecodeSignal();
+ /**
+ * Sets the name of the signal.
+ */
+ virtual void set_name(QString name);
+
+ /**
+ * Set the color of the signal.
+ */
+ virtual void set_color(QColor color);
+
bool is_decode_signal() const;
const vector< shared_ptr<Decoder> >& decoder_stack() const;
/**
* Set the color of the signal.
*/
- void set_color(QColor color);
+ virtual void set_color(QColor color);
/**
* Get the background color of the signal.