MCPcopy Create free account
hub / github.com/UtilitechAS/amsreader-firmware / modifyDayPlot

Method modifyDayPlot

lib/SvelteUi/src/AmsWebServer.cpp:2757–2780  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2755}
2756
2757void AmsWebServer::modifyDayPlot() {
2758 if(!checkSecurity(1))
2759 return;
2760
2761 for(uint8_t i = 0; i < 24; i++) {
2762 snprintf_P(buf, BufferSize, PSTR("i%02d"), i);
2763 if(server.hasArg(buf)) {
2764 ds->setHourImport(i, server.arg(buf).toDouble() * 1000);
2765 }
2766 snprintf_P(buf, BufferSize, PSTR("e%02d"), i);
2767 if(server.hasArg(buf)) {
2768 ds->setHourExport(i, server.arg(buf).toDouble() * 1000);
2769 }
2770 }
2771 bool ret = ds->save();
2772
2773 snprintf_P(buf, BufferSize, RESPONSE_JSON,
2774 "true",
2775 "",
2776 ret ? "true" : "false"
2777 );
2778 server.setContentLength(strlen(buf));
2779 server.send(200, MIME_JSON, buf);
2780}
2781
2782void AmsWebServer::modifyMonthPlot() {
2783 if(!checkSecurity(1))

Callers

nothing calls this directly

Calls 3

setHourImportMethod · 0.80
setHourExportMethod · 0.80
saveMethod · 0.45

Tested by

no test coverage detected