p.end();
return true;
-
- /*
- switch (axis) {
- case SignalController::Axis::TIME:
- relMin = m_relXMin; relMax = m_relXMax;
- tickDrawFunc = std::bind(&SignalDrawer::renderTimeScaleTick, this, &p, std::placeholders::_1, std::placeholders::_2);
- textDrawFunc = std::bind(&SignalDrawer::renderTimeScaleText, this, &p, 0, std::placeholders::_1, std::placeholders::_2);
- p.drawLine(SCALE_MARGIN_VALUE, m_gHeight + 1, m_gWidth + SCALE_MARGIN_VALUE, m_gHeight + 1);
- break;
- case SignalController::Axis::VALUE: /* VALUE axis is drawn first in order to determine offset from the left border *
- relMin = m_relYMin; relMax = m_relYMax;
- tickDrawFunc = std::bind(&SignalDrawer::renderValueScaleTick, this, &p, std::placeholders::_1, std::placeholders::_2);
- textDrawFunc = std::bind(&SignalDrawer::renderValueScaleText, this, &p, maxTextWidth, std::placeholders::_1, std::placeholders::_2);
- /* Offset from the left is now k
- p.drawLine(SCALE_MARGIN_VALUE + maxTextWidth, 0, SCALE_MARGIN_VALUE + maxTextWidth, m_gHeight);
- break;
- default:
- return false;
- }
-
- RulerDrawData rd = m_controller->getRulerDrawData(relMin, relMax, axis);
- //qDebug() << __QFUNC__ << "step" << rd.step << "relStep" << rd.relStep;
-
- /* Draw subticks before the first tick *
- {
- int ctr = 10;
- for (double subRel = rd.firstTickRel; subRel >= relMin; subRel -= rd.relStep / 10)
- tickDrawFunc(subRel, (--ctr == 5) ? TickType::TICK : TickType::SUBTICK);
- }
- /* Draw ticks *
- absVal = rd.firstTickAbs;
- for (double rel = rd.firstTickRel; rel <= relMax; rel += rd.relStep) {
- tickDrawFunc(rel, TickType::TICK);
- textDrawFunc(rel, absVal);
- absVal += rd.step;
-
- /* Draw subticks ticks *
- double subRel = rel;
- for (uint i = 1; i < 10; i++) {
- subRel += rd.relStep / 10;
- tickDrawFunc(subRel, (i == 5) ? TickType::TICK : TickType::SUBTICK);
- }
-
- }
- p.end();*/
}
void SignalDrawer::renderTimeScaleText(QPainter* const p, const double rel, const double value, const TickType tt)