MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / calculateAutoScaleRange

Method calculateAutoScaleRange

app/src/UI/Widgets/MultiPlot.cpp:701–718  ·  view source on GitHub ↗

* @brief Calculates the auto scale range of the multiplot. */

Source from the content-addressed store, hash-verified

699 * @brief Calculates the auto scale range of the multiplot.
700 */
701void Widgets::MultiPlot::calculateAutoScaleRange()
702{
703 const auto prevMinY = m_minY;
704 const auto prevMaxY = m_maxY;
705
706 if (m_data.isEmpty()) {
707 m_minY = 0;
708 m_maxY = 1;
709 }
710
711 else if (!computeRangeFromDatasets()) {
712 scanCurvesForRange();
713 padDerivedRange();
714 }
715
716 if (DSP::notEqual(prevMinY, m_minY) || DSP::notEqual(prevMaxY, m_maxY))
717 Q_EMIT rangeChanged();
718}
719
720/**
721 * @brief Computes Y range from dataset pltMin/pltMax bounds.

Callers

nothing calls this directly

Calls 2

notEqualFunction · 0.85
isEmptyMethod · 0.80

Tested by

no test coverage detected