new hardware

This commit is contained in:
2022-03-21 08:48:30 +01:00
parent c6dbbd4a02
commit eb976bcb6c
169 changed files with 172343 additions and 129089 deletions

View File

@@ -1,10 +1,10 @@
#include "gui.h"
c_onScreenButton ma20("20m", (uint8_t)mA20, LocBottom);
c_onScreenButton ma200("200m", (uint8_t)mA200, LocBottom);
c_onScreenButton ma1000("1A", (uint8_t)mA1000, LocBottom);
c_onScreenButton mauto("Auto", (uint8_t)mAuto, LocBottom);
c_onScreenButton bsetup("Conf", 5, LocBottom);
c_onScreenButton ma20("20m", (uint8_t)mA20, LocBottom, BUTTON1);
c_onScreenButton ma200("200m", (uint8_t)mA200, LocBottom, BUTTON2);
c_onScreenButton ma1000("1A", (uint8_t)mA1000, LocBottom, BUTTON3);
c_onScreenButton mauto("Auto", (uint8_t)mAuto, LocBottom, BUTTON4);
c_onScreenButton bsetup("Conf", 5, LocBottom, BUTTON5);
c_onScreenButton errorState("ER", 6, LocRight, &getErrorState);
c_onScreenButton okState("OK", 7, LocRight, &getOkState);
c_onScreenButton openState("Open", 8, LocRight, &getOpenState);
@@ -16,7 +16,7 @@ displayState CurrentGuiState;
void initGui(void)
{
Serial.print("Init GUI: ");
log_i("Init GUI: ");
uint16_t screenwidth = getDisplayWidth() - 1;
uint16_t buttonwidth = ((screenwidth / mLast) - CONTROLLOFFSET * 2) - 1;
uint16_t currentWidth = 0;
@@ -39,7 +39,7 @@ void initGui(void)
wifiState.begin(IndicatorXpos, currentYpos += (INDICATORHEIGHT - 1), INDICATORWIDTH, INDICATORHEIGHT, INDICATORRADIUS);
//fill vector
Serial.print("Store");
log_i("Store");
MainScreen.push_back(ma20);
MainScreen.push_back(ma200);
MainScreen.push_back(ma1000);
@@ -58,7 +58,7 @@ void initGui(void)
CurrentGuiState = mainscreen;
Serial.println("OK");
log_i("OK");
}
void drawMainSceenButtons()
@@ -80,17 +80,17 @@ void drawMainscreenValues()
drawDashedHLine(0, 12, 220);
drawDashedVLine(40, 12, 33);
getDisplay()->setFont(FONT8);
getDisplay()->drawStr(5, 8, "Fs:100Hz LP");
u8g2_SetFont(getDisplay(),FONT8);
u8g2_DrawStr(getDisplay(), 5, 8, "Fs:100Hz LP");
getDisplay()->setFont(FONT24);
u8g2_SetFont(getDisplay(), FONT24);
//display.drawStr(60, 45, String(getValue()).c_str());
getDisplay()->setCursor(60, 45);
getDisplay()->printf("%4.2f", getValue());
uint16_t stringwidth = getDisplay()->getStrWidth(showValue("", getValue(), "").c_str());
getDisplay()->setFont(u8g2_font_8x13_t_symbols);
getDisplay()->drawUTF8(60 + stringwidth + 3, 43, "mΩ");
u8g2_DrawStr(getDisplay(), 60, 45, String(getValue()).c_str());
//u8g2_DrawStr(getDisplay(), 60, 45);
uint16_t stringwidth = u8g2_GetStrWidth(getDisplay(), showValue("", getValue(), "").c_str());
u8g2_SetFont(getDisplay(), u8g2_font_8x13_t_symbols);
u8g2_DrawUTF8(getDisplay(), 60 + stringwidth + 3, 43, "mΩ");
//drawProgressBar(0, 40, 127, 5, getBar());
}
@@ -100,6 +100,14 @@ void drawMainScreen()
drawMainscreenValues();
}
void handleGUIButtons(void)
{
for (auto &&i : MainScreen)
{
i.handle();
}
}
void handleGui(void)
{
clearDisplay();