Dependencies:   net 1-wire lpc1768 crypto clock web fram log

/media/uploads/andrewboyson/heating.sch

/media/uploads/andrewboyson/heating.brd

/media/uploads/andrewboyson/eagle.epf

http-derived/heating/http-heating-html.c

Committer:
andrewboyson
Date:
2019-01-17
Revision:
24:e3ed1b52c6e6
Child:
34:18a3fc737899

File content as of revision 24:e3ed1b52c6e6:

#include "http.h"
#include "page.h"
#include "page-derived.h"
#include "ds18b20.h"
#include "radiator.h"
#include "program.h"
#include "http-server.h"
#include "http-server-derived.h"

void HttpHeatingHtml()
{
    HttpOk("text/html; charset=UTF-8", "no-cache", NULL, NULL);
    PageAddHeader(PageSite, "Radiators", "settings.css", "heating.js");
    PageAddNav(HEATING_PAGE);
    PageAddH1(PageSite, "Radiators");
    
    int16_t temp = DS18B20ValueFromRom(RadiatorGetHallRom());
    char text[DS18B20_VALUE_STRING_LENGTH];
    DS18B20ValueToString(temp, text);
    PageAddLabelledValue("Hall"     , 10, text);
    PageAddLabelledOnOff("Winter mode"    , 10, RadiatorGetMode());
    
    PageAddH2("Parameters");
    PageAddIntInput("/heating", 0, "Winter (night)", 10, "nighttemp", 2, RadiatorGetNightTemperature());
    PageAddIntInput("/heating", 0, "Summer (frost)", 10, "frosttemp", 2, RadiatorGetFrostTemperature());
    
    PageAddH2("Output");
    PageAddLabelledOnOff("Radiator pump" , 10, RadiatorPump);
    
    PageAddEnd();

}