diff --git a/view_altimeter.h b/view_altimeter.h index a9f13a2..13d2df7 100644 --- a/view_altimeter.h +++ b/view_altimeter.h @@ -105,30 +105,32 @@ class ViewAltimeter : public View { eSealevelMetric, }; + // ----- static + dynamic screen text + // clang-format off #define nTextAltimeter 15 TextField txtAltimeter[nTextAltimeter] = { - // text x,y color align font - {"Altitude", -1, 18, cTITLE, ALIGNCENTER, eFONTSMALLEST}, // [eTitle] screen title, centered - {"mm-dd", 48, 18, cWARN, ALIGNLEFT, eFONTSMALLEST}, // [eDate] - {"0#", 48, 36, cWARN, ALIGNLEFT, eFONTSMALLEST}, // [eNumSat] - {"hh:mm", 276, 18, cWARN, ALIGNRIGHT, eFONTSMALLEST}, // [eTimeHHMM] - {"ss", 276, 36, cWARN, ALIGNRIGHT, eFONTSMALLEST}, // [eTimeSS] + {"Altitude", -1, 18, cTITLE, ALIGNCENTER, eFONTSMALLEST}, // [eTitle] screen title, centered + {"mm-dd", 60, 18, cWARN, ALIGNLEFT, eFONTSMALLEST}, // [eDate] + {"0#", 60, 36, cWARN, ALIGNLEFT, eFONTSMALLEST}, // [eNumSat] + {"hh:mm", 276, 18, cWARN, ALIGNRIGHT, eFONTSMALLEST}, // [eTimeHHMM] + {"ss", 276, 36, cWARN, ALIGNRIGHT, eFONTSMALLEST}, // [eTimeSS] - {"Barometer:", col1, yRow1, cLABEL, ALIGNLEFT, eFONTSMALL}, // [eBaroLabel] - {"12.3", col2, yRow1, cVALUE, ALIGNRIGHT, eFONTBIG}, // [eBaroValue] - {"ft", col3, yRow1, cLABEL, ALIGNLEFT, eFONTSMALL}, // [eBaroUnits] + {"Barometer:", col1, yRow1, cLABEL, ALIGNLEFT, eFONTSMALL}, // [eBaroLabel] + {"12.3", col2, yRow1, cVALUE, ALIGNRIGHT, eFONTBIG}, // [eBaroValue] + {"ft", col3, yRow1, cLABEL, ALIGNLEFT, eFONTSMALL}, // [eBaroUnits] - {"GPS:", col1, yRow2, cLABEL, ALIGNLEFT, eFONTSMALL}, // [eGpsLabel] - {"4567.8", col2, yRow2, cVALUE, ALIGNRIGHT, eFONTBIG}, // [eGpsValue] - {"ft", col3, yRow2, cLABEL, ALIGNLEFT, eFONTSMALL}, // [eGpsUnits] + {"GPS:", col1, yRow2, cLABEL, ALIGNLEFT, eFONTSMALL}, // [eGpsLabel] + {"4567.8", col2, yRow2, cVALUE, ALIGNRIGHT, eFONTBIG}, // [eGpsValue] + {"ft", col3, yRow2, cLABEL, ALIGNLEFT, eFONTSMALL}, // [eGpsUnits] {"Enter local sea level pressure.", - -1, 162, cFAINT, ALIGNCENTER, eFONTSMALLEST}, // [ePrompt1] + -1, 162, cFAINT, ALIGNCENTER, eFONTSMALLEST}, // [ePrompt1] {"Accuracy depends on your input.", -1, 184, cFAINT, ALIGNCENTER, eFONTSMALLEST}, // [ePrompt21] {"34.567 inHg", -1, 208, cVALUE, ALIGNCENTER, eFONTSMALLEST}, // [eSealevelEnglish] {"1111.1 hPa", -1, 230, cVALUE, ALIGNCENTER, eFONTSMALLEST}, // [eSealevelMetric] }; + // clang-format on enum buttonID { ePressurePlus, @@ -228,7 +230,7 @@ class ViewAltimeter : public View { // loop using _increasing_ pressure until altitudes match while (baroAltitude < model->gAltitude) { - + /* debug Serial.print(count); Serial.print(". "); Serial.print(baroAltitude); @@ -237,6 +239,7 @@ class ViewAltimeter : public View { Serial.print(" Pa, "); Serial.print(gpsAltitude); Serial.println(" m"); + /* */ sealevelPa += delta(); if (++count > 1000) @@ -253,6 +256,7 @@ class ViewAltimeter : public View { // loop using _decreasing_ pressure until altitudes match while (baroAltitude > gpsAltitude) { + /* debug Serial.print(count); Serial.print(". "); Serial.print(baroAltitude); @@ -261,6 +265,7 @@ class ViewAltimeter : public View { Serial.print(" Pa, while GPS altitude is "); Serial.print(gpsAltitude); Serial.println(" m"); + /* */ sealevelPa -= delta(); if (++count > 1000) diff --git a/view_baro.h b/view_baro.h index 399dbf7..623b6a8 100644 --- a/view_baro.h +++ b/view_baro.h @@ -147,8 +147,8 @@ class ViewBaro : public View { const int yBot = gScreenHeight - MARGIN - DESCENDERS - TEXTHEIGHT; const int yTop = yBot - graphHeight; - // ========== text screen layout =================================== - // these are names for the array indexes, must be named in same order as array below + // ----- screen text + // names for the array indexes, must be named in same order as array below enum txtIndex { eTitle = 0, eDate, @@ -159,17 +159,19 @@ class ViewBaro : public View { unitPressure, }; + // ----- static + dynamic screen text + // clang-format off #define numBaroFields 7 TextField txtBaro[numBaroFields] = { - // text x,y color align font - {"Baroduino", -1, 18, cTITLE, ALIGNCENTER, eFONTSMALLEST}, // [eTitle] screen title, centered - {"01-02", 48, 18, cWARN, ALIGNLEFT, eFONTSMALLEST}, // [eDate] - {"0#", 48, 36, cWARN, ALIGNLEFT, eFONTSMALLEST}, // [eNumSat] - {"12:34", 276, 18, cWARN, ALIGNRIGHT, eFONTSMALLEST}, // [eTimeHHMM] - {"56", 276, 36, cWARN, ALIGNRIGHT, eFONTSMALLEST}, // [eTimeSS] - {"30.000", 162, 46, ILI9341_WHITE, ALIGNRIGHT, eFONTSMALL}, // [valPressure] + {"Baroduino", -1, 18, cTITLE, ALIGNCENTER, eFONTSMALLEST}, // [eTitle] screen title, centered + {"01-02", 60, 18, cWARN, ALIGNLEFT, eFONTSMALLEST}, // [eDate] + {"0#", 60, 36, cWARN, ALIGNLEFT, eFONTSMALLEST}, // [eNumSat] + {"12:34", 276, 18, cWARN, ALIGNRIGHT, eFONTSMALLEST}, // [eTimeHHMM] + {"56", 276, 36, cWARN, ALIGNRIGHT, eFONTSMALLEST}, // [eTimeSS] + {"30.000", 162, 46, ILI9341_WHITE, ALIGNRIGHT, eFONTSMALL}, // [valPressure] {"inHg", 180, 46, ILI9341_WHITE, ALIGNLEFT, eFONTSMALL}, // [unitPressure] }; + // clang-format on void showReadings() { clearScreen(yTop, graphHeight); // erase only the graph area, not the whole screen, to reduce blinking diff --git a/view_grid.cpp b/view_grid.cpp index d77bee7..ce15fe2 100644 --- a/view_grid.cpp +++ b/view_grid.cpp @@ -167,13 +167,12 @@ void drawNumSatellites() { void drawCoinBatteryVoltage() { setFontSize(0); char sVoltage[12]; - float coinVoltage = gpsBattery.getCoinBatteryVoltage(); + float coinVoltage = gpsBattery.readCoinBatteryVoltage(); floatToCharArray(sVoltage, sizeof(sVoltage), coinVoltage, 2); strcat(sVoltage, "v"); -#if defined(ARDUINO_ADAFRUIT_FEATHER_RP2040) - // Show battery voltage only on Griduino PCB v7+ + + // Show battery voltage only on Griduino PCB v7+ (todo) txtGrid[COINBATT].print(sVoltage); -#endif } void drawAltitude() { diff --git a/view_sat_count.h b/view_sat_count.h index da09b46..a587135 100644 --- a/view_sat_count.h +++ b/view_sat_count.h @@ -121,10 +121,10 @@ class ViewSatCount : public View { #define nSatCountValues 11 TextField txtValues[nSatCountValues] = { {"Satellites", -1, yRow1,cTITLE, ALIGNCENTER, eFONTSMALLEST}, // [TITLE] view title, centered - {"01-02", 48, 18, cWARN, ALIGNLEFT, eFONTSMALLEST}, // [eDate] - {"0#", 48, 36, cWARN, ALIGNLEFT, eFONTSMALLEST}, // [eNumSat] - {"12:34", 276, 18, cWARN, ALIGNRIGHT, eFONTSMALLEST}, // [eTimeHHMM] - {"56", 276, 36, cWARN, ALIGNRIGHT, eFONTSMALLEST}, // [eTimeSS] + {"mm-dd", 60, 18, cWARN, ALIGNLEFT, eFONTSMALLEST}, // [eDate] + {"0#", 60, 36, cWARN, ALIGNLEFT, eFONTSMALLEST}, // [eNumSat] + {"hh:mm", 276, 18, cWARN, ALIGNRIGHT, eFONTSMALLEST}, // [eTimeHHMM] + {"ss", 276, 36, cWARN, ALIGNRIGHT, eFONTSMALLEST}, // [eTimeSS] {"10+", labelX, yRow10, ILI9341_GREEN, ALIGNLEFT, eFONTSMALLEST}, // [TEN] {" 8", labelX, yRow8, ILI9341_GREEN, ALIGNLEFT, eFONTSMALLEST}, // [EIGHT] {" 6", labelX, yRow6, ILI9341_GREEN, ALIGNLEFT, eFONTSMALLEST}, // [SIX]