void WaveformMarkRange::setup(const QString& group, const QDomNode& node, const WaveformSignalColors& signalColors) { m_activeColor = XmlParse::selectNodeQString(node, "Color"); if (m_activeColor == "") { //vRince kind of legacy fallback ... // As a fallback, grab the mark color from the parent's MarkerColor m_activeColor = signalColors.getAxesColor(); qDebug() << "Didn't get mark Color, using parent's <AxesColor>:" << m_activeColor; } else { m_activeColor = WSkinColor::getCorrectColor(m_activeColor); } m_disabledColor = XmlParse::selectNodeQString(node, "DisabledColor"); if (m_disabledColor == "") { //vRince kind of legacy fallback ... // Read the text color, otherwise use the parent's SignalColor. m_disabledColor = signalColors.getSignalColor(); qDebug() << "Didn't get mark TextColor, using parent's <SignalColor>:" << m_disabledColor; } m_markStartPointControl = maybeMakeControl(ControlObject::getControl( ConfigKey(group, XmlParse::selectNodeQString(node, "StartControl")))); m_markEndPointControl = maybeMakeControl(ControlObject::getControl( ConfigKey(group, XmlParse::selectNodeQString(node, "EndControl")))); m_markEnabledControl = maybeMakeControl(ControlObject::getControl( ConfigKey(group, XmlParse::selectNodeQString(node, "EnabledControl")))); }
void WaveformMark::setup(const QString& group, const QDomNode& node, const WaveformSignalColors& signalColors) { QString item = XmlParse::selectNodeQString(node, "Control"); ControlObject* pPointControl = ControlObject::getControl(ConfigKey(group, item)); if (pPointControl) { m_pointControl = new ControlObjectThreadMain(pPointControl); } m_color = XmlParse::selectNodeQString(node, "Color"); if (m_color == "") { // As a fallback, grab the color from the parent's AxesColor m_color = signalColors.getAxesColor(); qDebug() << "Didn't get mark <Color>, using parent's <AxesColor>:" << m_color; } else { m_color = WSkinColor::getCorrectColor(m_color); } m_textColor = XmlParse::selectNodeQString(node, "TextColor"); if (m_textColor == "") { // Read the text color, otherwise use the parent's BgColor. m_textColor = signalColors.getBgColor(); qDebug() << "Didn't get mark <TextColor>, using parent's <BgColor>:" << m_textColor; } QString markAlign = XmlParse::selectNodeQString(node, "Align"); if (markAlign.contains("bottom", Qt::CaseInsensitive)) { m_align = Qt::AlignBottom; } else { m_align = Qt::AlignTop; // Default } m_text = XmlParse::selectNodeQString(node, "Text"); m_pixmapPath = XmlParse::selectNodeQString(node,"Pixmap"); }
WaveformMarkProperties::WaveformMarkProperties(const QDomNode& node, const SkinContext& context, const WaveformSignalColors& signalColors) { m_color = context.selectString(node, "Color"); if (!m_color.isValid()) { // As a fallback, grab the color from the parent's AxesColor m_color = signalColors.getAxesColor(); qDebug() << "Didn't get mark <Color>, using parent's <AxesColor>:" << m_color; } else { m_color = WSkinColor::getCorrectColor(m_color); } m_textColor = context.selectString(node, "TextColor"); if (!m_textColor.isValid()) { // Read the text color, otherwise use the parent's BgColor. m_textColor = signalColors.getBgColor(); qDebug() << "Didn't get mark <TextColor>, using parent's <BgColor>:" << m_textColor; } QString markAlign = context.selectString(node, "Align"); m_align = decodeAlignmentFlags(markAlign, Qt::AlignBottom | Qt::AlignHCenter); m_text = context.selectString(node, "Text"); m_pixmapPath = context.selectString(node, "Pixmap"); if (!m_pixmapPath.isEmpty()) { m_pixmapPath = context.getSkinPath(m_pixmapPath); } }
void WaveformRenderMark::setup(const QDomNode& node, const SkinContext& context) { WaveformSignalColors signalColors = *m_waveformRenderer->getWaveformSignalColors(); m_marks.setup(m_waveformRenderer->getGroup(), node, context, signalColors); WaveformMarkPointer defaultMark(m_marks.getDefaultMark()); QColor defaultColor = defaultMark ? defaultMark->getProperties().fillColor() : signalColors.getAxesColor(); m_predefinedColorsRepresentation = context.getCueColorRepresentation(node, defaultColor); }
WaveformMarkRange::WaveformMarkRange( const QString& group, const QDomNode& node, const SkinContext& context, const WaveformSignalColors& signalColors) : m_activeColor(context.selectString(node, "Color")), m_disabledColor(context.selectString(node, "DisabledColor")), m_durationTextColor(context.selectString(node, "DurationTextColor")) { if (!m_activeColor.isValid()) { //vRince kind of legacy fallback ... // As a fallback, grab the mark color from the parent's MarkerColor m_activeColor = signalColors.getAxesColor(); qDebug() << "Didn't get mark Color, using parent's <AxesColor>:" << m_activeColor; } else { m_activeColor = WSkinColor::getCorrectColor(m_activeColor); } if (!m_disabledColor.isValid()) { //vRince kind of legacy fallback ... // Read the text color, otherwise use the parent's SignalColor. m_disabledColor = signalColors.getSignalColor(); qDebug() << "Didn't get mark TextColor, using parent's <SignalColor>:" << m_disabledColor; } QString startControl = context.selectString(node, "StartControl"); if (!startControl.isEmpty()) { DEBUG_ASSERT(!m_markStartPointControl); // has not been created yet m_markStartPointControl = std::make_unique<ControlProxy>(group, startControl); } QString endControl = context.selectString(node, "EndControl"); if (!endControl.isEmpty()) { DEBUG_ASSERT(!m_markEndPointControl); // has not been created yet m_markEndPointControl = std::make_unique<ControlProxy>(group, endControl); } QString enabledControl = context.selectString(node, "EnabledControl"); if (!enabledControl.isEmpty()) { DEBUG_ASSERT(!m_markEnabledControl); // has not been created yet m_markEnabledControl = std::make_unique<ControlProxy>(group, enabledControl); } QString visibilityControl = context.selectString(node, "VisibilityControl"); if (!visibilityControl.isEmpty()) { DEBUG_ASSERT(!m_markVisibleControl); // has not been created yet ConfigKey key = ConfigKey::parseCommaSeparated(visibilityControl); m_markVisibleControl = std::make_unique<ControlProxy>(key); } QString durationTextLocation = context.selectString(node, "DurationTextLocation"); if (durationTextLocation == "before") { m_durationTextLocation = DurationTextLocation::Before; } else { m_durationTextLocation = DurationTextLocation::After; } }