Skip to content

Commit

Permalink
updated white space, no functional change
Browse files Browse the repository at this point in the history
  • Loading branch information
barry-ha committed Mar 11, 2024
1 parent 585f0d2 commit 3d7c148
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 31 deletions.
33 changes: 19 additions & 14 deletions view_altimeter.h
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand All @@ -237,6 +239,7 @@ class ViewAltimeter : public View {
Serial.print(" Pa, ");
Serial.print(gpsAltitude);
Serial.println(" m");
/* */

sealevelPa += delta();
if (++count > 1000)
Expand All @@ -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);
Expand All @@ -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)
Expand Down
20 changes: 11 additions & 9 deletions view_baro.h
Expand Up @@ -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,
Expand All @@ -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
Expand Down
7 changes: 3 additions & 4 deletions view_grid.cpp
Expand Up @@ -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() {
Expand Down
8 changes: 4 additions & 4 deletions view_sat_count.h
Expand Up @@ -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]
Expand Down

0 comments on commit 3d7c148

Please sign in to comment.