SDRAngel
4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
|
#include <scaleengine.h>
Classes | |
struct | Tick |
Public Types | |
typedef QList< Tick > | TickList |
Public Member Functions | |
ScaleEngine () | |
void | setOrientation (Qt::Orientation orientation) |
void | setFont (const QFont &font) |
void | setSize (float size) |
float | getSize () |
void | setRange (Unit::Physical physicalUnit, float rangeMin, float rangeMax) |
void | setMakeOpposite (bool makeOpposite) |
void | setFixedDecimalPlaces (int decimalPlaces) |
float | getPosFromValue (double value) |
float | getValueFromPos (double pos) |
const TickList & | getTickList () |
QString | getRangeMinStr () |
QString | getRangeMaxStr () |
float | getScaleWidth () |
Private Member Functions | |
QString | formatTick (double value, int decimalPlaces) |
void | calcCharSize () |
void | calcScaleFactor () |
double | calcMajorTickUnits (double distance, int *retDecimalPlaces) |
int | calcTickTextSize (double distance) |
void | forceTwoTicks () |
void | reCalc () |
double | majorTickValue (int tick) |
double | minorTickValue (int tick) |
Private Attributes | |
Qt::Orientation | m_orientation |
QFont | m_font |
float | m_charSize |
float | m_size |
Unit::Physical | m_physicalUnit |
float | m_rangeMin |
float | m_rangeMax |
bool | m_recalc |
double | m_scale |
QString | m_unitStr |
TickList | m_tickList |
double | m_majorTickValueDistance |
double | m_firstMajorTickValue |
int | m_numMinorTicks |
int | m_decimalPlaces |
int | m_fixedDecimalPlaces |
bool | m_makeOpposite |
Definition at line 28 of file scaleengine.h.
typedef QList<Tick> ScaleEngine::TickList |
Definition at line 37 of file scaleengine.h.
ScaleEngine::ScaleEngine | ( | ) |
Definition at line 513 of file scaleengine.cpp.
|
private |
Definition at line 83 of file scaleengine.cpp.
References i, m_charSize, m_font, m_orientation, and leansdr::max().
Referenced by setFont().
|
private |
Definition at line 213 of file scaleengine.cpp.
References floor().
Referenced by calcTickTextSize(), and reCalc().
|
private |
Definition at line 103 of file scaleengine.cpp.
References Unit::AngleDegrees, Unit::Decibel, Unit::DecibelMicroVolt, Unit::DecibelMilliWatt, Unit::Frequency, Unit::Information, m_physicalUnit, m_rangeMax, m_rangeMin, m_scale, m_unitStr, Unit::None, Unit::Percent, Unit::Scientific, Unit::Time, Unit::TimeHMS, and Unit::Volt.
Referenced by reCalc().
|
private |
Definition at line 299 of file scaleengine.cpp.
References calcMajorTickUnits(), formatTick(), m_rangeMax, m_rangeMin, and m_scale.
Referenced by reCalc().
|
private |
Definition at line 318 of file scaleengine.cpp.
References formatTick(), getPosFromValue(), m_decimalPlaces, m_font, m_orientation, m_rangeMax, m_rangeMin, m_scale, m_tickList, ScaleEngine::Tick::major, ScaleEngine::Tick::pos, ScaleEngine::Tick::text, ScaleEngine::Tick::textPos, and ScaleEngine::Tick::textSize.
Referenced by reCalc().
|
private |
Definition at line 31 of file scaleengine.cpp.
References floor(), m_fixedDecimalPlaces, m_makeOpposite, m_physicalUnit, m_scale, Unit::Scientific, and Unit::TimeHMS.
Referenced by calcTickTextSize(), forceTwoTicks(), getRangeMaxStr(), getRangeMinStr(), and reCalc().
float ScaleEngine::getPosFromValue | ( | double | value | ) |
Definition at line 581 of file scaleengine.cpp.
References m_rangeMax, m_rangeMin, and m_size.
Referenced by GLSpectrum::applyChanges(), forceTwoTicks(), reCalc(), and GLSpectrum::wheelEvent().
QString ScaleEngine::getRangeMaxStr | ( | ) |
Definition at line 604 of file scaleengine.cpp.
References formatTick(), m_decimalPlaces, m_rangeMax, m_scale, and m_unitStr.
QString ScaleEngine::getRangeMinStr | ( | ) |
Definition at line 597 of file scaleengine.cpp.
References formatTick(), m_decimalPlaces, m_rangeMin, m_scale, and m_unitStr.
float ScaleEngine::getScaleWidth | ( | ) |
Definition at line 611 of file scaleengine.cpp.
References i, m_tickList, leansdr::max(), and reCalc().
Referenced by GLSpectrum::applyChanges().
|
inline |
Definition at line 80 of file scaleengine.h.
Referenced by GLScope::paintGL(), GLSpectrum::paintGL(), and GLSpectrum::wheelEvent().
const ScaleEngine::TickList & ScaleEngine::getTickList | ( | ) |
Definition at line 591 of file scaleengine.cpp.
References m_tickList, and reCalc().
Referenced by GLSpectrum::applyChanges(), GLScope::applyConfig(), GLScope::paintGL(), GLSpectrum::paintGL(), LevelMeterVU::resized(), LevelMeterSignalDB::resized(), GLScope::setHorizontalDisplays(), GLScope::setPolarDisplays(), GLScope::setUniqueDisplays(), and GLScope::setVerticalDisplays().
float ScaleEngine::getValueFromPos | ( | double | pos | ) |
Definition at line 586 of file scaleengine.cpp.
References m_rangeMax, m_rangeMin, and m_size.
Referenced by GLSpectrum::mouseMoveEvent(), and GLSpectrum::mousePressEvent().
|
private |
Definition at line 501 of file scaleengine.cpp.
References m_firstMajorTickValue, and m_majorTickValueDistance.
Referenced by reCalc().
|
private |
Definition at line 506 of file scaleengine.cpp.
References m_majorTickValueDistance, and m_numMinorTicks.
Referenced by reCalc().
|
private |
Definition at line 343 of file scaleengine.cpp.
References calcMajorTickUnits(), calcScaleFactor(), calcTickTextSize(), floor(), forceTwoTicks(), formatTick(), getPosFromValue(), i, m_charSize, m_decimalPlaces, m_firstMajorTickValue, m_font, m_majorTickValueDistance, m_numMinorTicks, m_orientation, m_rangeMax, m_rangeMin, m_recalc, m_scale, m_size, m_tickList, ScaleEngine::Tick::major, majorTickValue(), minorTickValue(), ScaleEngine::Tick::pos, ScaleEngine::Tick::text, ScaleEngine::Tick::textPos, and ScaleEngine::Tick::textSize.
Referenced by getScaleWidth(), and getTickList().
|
inline |
Definition at line 83 of file scaleengine.h.
void ScaleEngine::setFont | ( | const QFont & | font | ) |
Definition at line 537 of file scaleengine.cpp.
References calcCharSize(), m_font, and m_recalc.
Referenced by GLScope::GLScope(), LevelMeterSignalDB::LevelMeterSignalDB(), and LevelMeterVU::LevelMeterVU().
|
inline |
Definition at line 82 of file scaleengine.h.
Referenced by GLSpectrum::applyChanges().
void ScaleEngine::setOrientation | ( | Qt::Orientation | orientation | ) |
Definition at line 531 of file scaleengine.cpp.
References m_orientation, and m_recalc.
Referenced by GLScope::GLScope(), LevelMeterSignalDB::LevelMeterSignalDB(), and LevelMeterVU::LevelMeterVU().
void ScaleEngine::setRange | ( | Unit::Physical | physicalUnit, |
float | rangeMin, | ||
float | rangeMax | ||
) |
Definition at line 554 of file scaleengine.cpp.
References m_physicalUnit, m_rangeMax, m_rangeMin, and m_recalc.
Referenced by GLSpectrum::applyChanges(), GLScope::applyConfig(), LevelMeterSignalDB::LevelMeterSignalDB(), LevelMeterVU::LevelMeterVU(), LevelMeterSignalDB::setRange(), and GLScope::setYScale().
void ScaleEngine::setSize | ( | float | size | ) |
Definition at line 544 of file scaleengine.cpp.
References m_recalc, and m_size.
Referenced by GLSpectrum::applyChanges(), LevelMeterVU::resized(), LevelMeterSignalDB::resized(), GLScope::setHorizontalDisplays(), GLScope::setPolarDisplays(), GLScope::setUniqueDisplays(), and GLScope::setVerticalDisplays().
|
private |
Definition at line 43 of file scaleengine.h.
Referenced by calcCharSize(), and reCalc().
|
private |
Definition at line 59 of file scaleengine.h.
Referenced by forceTwoTicks(), getRangeMaxStr(), getRangeMinStr(), and reCalc().
|
private |
Definition at line 57 of file scaleengine.h.
Referenced by majorTickValue(), and reCalc().
|
private |
Definition at line 60 of file scaleengine.h.
Referenced by formatTick().
|
private |
Definition at line 42 of file scaleengine.h.
Referenced by calcCharSize(), forceTwoTicks(), reCalc(), and setFont().
|
private |
Definition at line 56 of file scaleengine.h.
Referenced by majorTickValue(), minorTickValue(), and reCalc().
|
private |
Definition at line 61 of file scaleengine.h.
Referenced by formatTick().
|
private |
Definition at line 58 of file scaleengine.h.
Referenced by minorTickValue(), and reCalc().
|
private |
Definition at line 41 of file scaleengine.h.
Referenced by calcCharSize(), forceTwoTicks(), reCalc(), and setOrientation().
|
private |
Definition at line 47 of file scaleengine.h.
Referenced by calcScaleFactor(), formatTick(), and setRange().
|
private |
Definition at line 49 of file scaleengine.h.
Referenced by calcScaleFactor(), calcTickTextSize(), forceTwoTicks(), getPosFromValue(), getRangeMaxStr(), getValueFromPos(), reCalc(), and setRange().
|
private |
Definition at line 48 of file scaleengine.h.
Referenced by calcScaleFactor(), calcTickTextSize(), forceTwoTicks(), getPosFromValue(), getRangeMinStr(), getValueFromPos(), reCalc(), and setRange().
|
private |
Definition at line 52 of file scaleengine.h.
Referenced by reCalc(), setFont(), setOrientation(), setRange(), and setSize().
|
private |
Definition at line 53 of file scaleengine.h.
Referenced by calcScaleFactor(), calcTickTextSize(), forceTwoTicks(), formatTick(), getRangeMaxStr(), getRangeMinStr(), and reCalc().
|
private |
Definition at line 46 of file scaleengine.h.
Referenced by getPosFromValue(), getValueFromPos(), reCalc(), and setSize().
|
private |
Definition at line 55 of file scaleengine.h.
Referenced by forceTwoTicks(), getScaleWidth(), getTickList(), and reCalc().
|
private |
Definition at line 54 of file scaleengine.h.
Referenced by calcScaleFactor(), getRangeMaxStr(), and getRangeMinStr().