MCPcopy Create free account
hub / github.com/BruceDevices/firmware / drawWebUiScreen

Function drawWebUiScreen

src/core/wifi/webInterface.cpp:274–315  ·  view source on GitHub ↗

** Function: drawWebUiScreen ** Draw information on screen of WebUI. **********************************************************************/

Source from the content-addressed store, hash-verified

272** Draw information on screen of WebUI.
273**********************************************************************/
274void drawWebUiScreen(bool mode_ap) {
275 drawMainBorderWithTitle("WebUI", true);
276
277 String txt;
278 if (!mode_ap) txt = WiFi.localIP().toString();
279 else txt = WiFi.softAPIP().toString();
280
281 int padX = 14;
282 int currentY = 55;
283
284 tft.setTextColor(bruceConfig.priColor, bruceConfig.bgColor);
285 tft.setTextSize(FP);
286
287 if (mode_ap) {
288 tft.setCursor(padX, currentY);
289 tft.print("Net: BruceNet/brucenet");
290 currentY += LH * FP + 6;
291 }
292
293 tft.setCursor(padX, currentY);
294 tft.print("Url: http://bruce.local");
295 currentY += LH * FP + 6;
296
297 tft.setCursor(padX, currentY);
298 tft.print("IP: " + txt);
299 currentY += LH * FP + 6;
300
301 tft.setCursor(padX, currentY);
302 tft.print("Usr: " + String(bruceConfig.webUI.user));
303 currentY += LH * FP + 6;
304
305 tft.setCursor(padX, currentY);
306 tft.print("Pwd: " + String(bruceConfig.webUI.pwd));
307
308 tft.setTextColor(TFT_RED, bruceConfig.bgColor);
309 tft.setTextSize(FP);
310 tft.drawCentreString("press Esc to stop", tftWidth / 2, tftHeight - 2 * LH * FP - 5, 1);
311
312#if defined(HAS_TOUCH)
313 TouchFooter();
314#endif
315}
316
317/**********************************************************************
318** Function: color565ToWebHex

Callers 1

startWebUiFunction · 0.85

Calls 7

drawMainBorderWithTitleFunction · 0.85
TouchFooterFunction · 0.85
setTextColorMethod · 0.45
setTextSizeMethod · 0.45
setCursorMethod · 0.45
printMethod · 0.45
drawCentreStringMethod · 0.45

Tested by

no test coverage detected