Cosmetics
This commit is contained in:
@@ -93,8 +93,8 @@ class SpectrumScaleWindow: public Window
|
|||||||
// Draw text scale
|
// Draw text scale
|
||||||
for (uint32_t frequency =
|
for (uint32_t frequency =
|
||||||
((reusableBuffer.spectrumAnalyser.freq - reusableBuffer.spectrumAnalyser.span / 2) / 10000000) * 10000000 + 10000000;; frequency += 10000000) {
|
((reusableBuffer.spectrumAnalyser.freq - reusableBuffer.spectrumAnalyser.span / 2) / 10000000) * 10000000 + 10000000;; frequency += 10000000) {
|
||||||
int offset = frequency - (reusableBuffer.spectrumAnalyser.freq - reusableBuffer.spectrumAnalyser.span / 2);
|
offset = frequency - (reusableBuffer.spectrumAnalyser.freq - reusableBuffer.spectrumAnalyser.span / 2);
|
||||||
int x = offset / reusableBuffer.spectrumAnalyser.step;
|
x = offset / reusableBuffer.spectrumAnalyser.step;
|
||||||
if (x >= LCD_W - 1)
|
if (x >= LCD_W - 1)
|
||||||
break;
|
break;
|
||||||
if ((frequency / 1000000) % 2 == 0) {
|
if ((frequency / 1000000) % 2 == 0) {
|
||||||
@@ -187,9 +187,10 @@ RadioSpectrumAnalyser::RadioSpectrumAnalyser(uint8_t moduleIdx) :
|
|||||||
Page(ICON_RADIO_TOOLS),
|
Page(ICON_RADIO_TOOLS),
|
||||||
moduleIdx(moduleIdx)
|
moduleIdx(moduleIdx)
|
||||||
{
|
{
|
||||||
start();
|
init();
|
||||||
buildHeader(&header);
|
buildHeader(&header);
|
||||||
buildBody(&body);
|
buildBody(&body);
|
||||||
|
start();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RadioSpectrumAnalyser::buildHeader(Window * window)
|
void RadioSpectrumAnalyser::buildHeader(Window * window)
|
||||||
@@ -204,7 +205,7 @@ void RadioSpectrumAnalyser::buildBody(FormWindow * window)
|
|||||||
new SpectrumFooterWindow(window, {0, SPECTRUM_HEIGHT + SCALE_HEIGHT, LCD_W, window->height() - SPECTRUM_HEIGHT - SCALE_HEIGHT}, moduleIdx);
|
new SpectrumFooterWindow(window, {0, SPECTRUM_HEIGHT + SCALE_HEIGHT, LCD_W, window->height() - SPECTRUM_HEIGHT - SCALE_HEIGHT}, moduleIdx);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RadioSpectrumAnalyser::start()
|
void RadioSpectrumAnalyser::init()
|
||||||
{
|
{
|
||||||
#if defined(INTERNAL_MODULE_MULTI)
|
#if defined(INTERNAL_MODULE_MULTI)
|
||||||
if (moduleIdx == INTERNAL_MODULE && g_model.moduleData[INTERNAL_MODULE].type == MODULE_TYPE_NONE) {
|
if (moduleIdx == INTERNAL_MODULE && g_model.moduleData[INTERNAL_MODULE].type == MODULE_TYPE_NONE) {
|
||||||
@@ -212,6 +213,7 @@ void RadioSpectrumAnalyser::start()
|
|||||||
setModuleType(INTERNAL_MODULE, MODULE_TYPE_MULTIMODULE);
|
setModuleType(INTERNAL_MODULE, MODULE_TYPE_MULTIMODULE);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (isModuleR9MAccess(moduleIdx)) {
|
if (isModuleR9MAccess(moduleIdx)) {
|
||||||
reusableBuffer.spectrumAnalyser.spanDefault = 20;
|
reusableBuffer.spectrumAnalyser.spanDefault = 20;
|
||||||
reusableBuffer.spectrumAnalyser.spanMax = 40;
|
reusableBuffer.spectrumAnalyser.spanMax = 40;
|
||||||
@@ -237,9 +239,12 @@ void RadioSpectrumAnalyser::start()
|
|||||||
reusableBuffer.spectrumAnalyser.track = reusableBuffer.spectrumAnalyser.freq;
|
reusableBuffer.spectrumAnalyser.track = reusableBuffer.spectrumAnalyser.freq;
|
||||||
reusableBuffer.spectrumAnalyser.step = reusableBuffer.spectrumAnalyser.span / LCD_W;
|
reusableBuffer.spectrumAnalyser.step = reusableBuffer.spectrumAnalyser.span / LCD_W;
|
||||||
reusableBuffer.spectrumAnalyser.dirty = true;
|
reusableBuffer.spectrumAnalyser.dirty = true;
|
||||||
moduleState[moduleIdx].mode = MODULE_MODE_SPECTRUM_ANALYSER;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RadioSpectrumAnalyser::start()
|
||||||
|
{
|
||||||
|
moduleState[moduleIdx].mode = MODULE_MODE_SPECTRUM_ANALYSER;
|
||||||
|
}
|
||||||
|
|
||||||
void RadioSpectrumAnalyser::stop()
|
void RadioSpectrumAnalyser::stop()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -26,15 +26,16 @@
|
|||||||
class RadioSpectrumAnalyser: public Page
|
class RadioSpectrumAnalyser: public Page
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RadioSpectrumAnalyser(uint8_t moduleIdx);
|
explicit RadioSpectrumAnalyser(uint8_t moduleIdx);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
uint8_t moduleIdx;
|
||||||
|
|
||||||
void buildHeader(Window * window);
|
void buildHeader(Window * window);
|
||||||
void buildBody(FormWindow * window);
|
void buildBody(FormWindow * window);
|
||||||
|
void init();
|
||||||
void start();
|
void start();
|
||||||
void stop();
|
void stop();
|
||||||
|
|
||||||
uint8_t moduleIdx;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _RADIO_SPECTRUM_ANALYSER_H
|
#endif // _RADIO_SPECTRUM_ANALYSER_H
|
||||||
|
|||||||
Reference in New Issue
Block a user