Central Heating controller using the real time clock, PHY module for internet, 1-wire interface for temperature sensors, a system log and a configuration file

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

web-this/system/web-system-script.inc

Committer:
andrewboyson
Date:
2021-04-23
Revision:
106:41ed3ea0bbba
Parent:
53:c1bf7d9db507

File content as of revision 106:41ed3ea0bbba:

"//System script\n"
"'use strict';\n"
"\n"
"let serverName   = '';\n"
"let fileName     = '';\n"
"let readInterval = 0;\n"
"let writeSize    = 0;\n"
"let count        = 0;\n"
"let startTime    = null;\n"
"let framUsed     = 0;\n"
"\n"
"function parse()\n"
"{\n"
"    let lines = Ajax.response.split('\\n');\n"
"    serverName   =                       lines[0];\n"
"    fileName     =                       lines[1];\n"
"    readInterval = Ajax.hexToSignedInt16(lines[2]);\n"
"    writeSize    = Ajax.hexToSignedInt16(lines[3]);\n"
"    count        = Ajax.hexToSignedInt16(lines[4]);\n"
"    startTime    =     new Date(parseInt(lines[5], 16) * 1000);\n"
"    framUsed     = Ajax.hexToSignedInt16(lines[6]);\n"
"}\n"
"function display()\n"
"{\n"
"    let elem;\n"
"    elem = Ajax.getElementOrNull('ajax-server-name'  ); if (elem) elem.value = serverName;\n"
"    elem = Ajax.getElementOrNull('ajax-file-name'    ); if (elem) elem.value = fileName;\n"
"    elem = Ajax.getElementOrNull('ajax-read-interval'); if (elem) elem.value = readInterval;\n"
"    elem = Ajax.getElementOrNull('ajax-write-size'   ); if (elem) elem.value = writeSize;\n"
"    elem = Ajax.getElementOrNull('ajax-count'        ); if (elem) elem.textContent = count;\n"
"    elem = Ajax.getElementOrNull('ajax-start-time'   ); if (elem) elem.textContent = startTime.toISOString().substr(0, 19).split('T').join(' ') + ' UTC';\n"
"    elem = Ajax.getElementOrNull('ajax-fram-used'    ); if (elem) elem.textContent = framUsed;\n"
"}\n"
"\n"
"Ajax.server     = '/system-ajax';\n"
"Ajax.onResponse = function() { parse(); display(); };\n"
"Ajax.init();\n"
""