case SR_PROBE_ANALOG:
signal = shared_ptr<view::Signal>(
new view::AnalogSignal(probe->name,
- _analog_data));
+ _analog_data, probe->index));
break;
}
namespace pv {
namespace view {
-AnalogSignal::AnalogSignal(QString name, shared_ptr<data::Analog> data) :
+const QColor AnalogSignal::SignalColours[4] = {
+ QColor(0xC4, 0xA0, 0x00), // Yellow
+ QColor(0x87, 0x20, 0x7A), // Magenta
+ QColor(0x20, 0x4A, 0x87), // Blue
+ QColor(0x4E, 0x9A, 0x06) // Green
+};
+
+AnalogSignal::AnalogSignal(QString name, shared_ptr<data::Analog> data,
+ int probe_index) :
Signal(name),
_data(data)
{
- _colour = Qt::blue;
+ _colour = SignalColours[probe_index % countof(SignalColours)];
}
void AnalogSignal::paint(QPainter &p, int y, int left, int right, double scale,
class AnalogSignal : public Signal
{
+private:
+ static const QColor SignalColours[4];
+
public:
AnalogSignal(QString name,
- boost::shared_ptr<pv::data::Analog> data);
+ boost::shared_ptr<pv::data::Analog> data, int probe_index);
/**
* Paints the signal with a QPainter