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

Committer:
andrewboyson
Date:
Wed Jun 10 11:45:38 2020 +0000
Revision:
92:2d1ca4dcbca7
Parent:
91:8b192efd0288
Child:
96:18a3813bb4b5
Made changes to the javascript in web pages displaying temperatures in line with the changes to the 1-wire library.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
andrewboyson 47:229338b3adcb 1 "//Radiator script\n"
andrewboyson 47:229338b3adcb 2 "'use strict';\n"
andrewboyson 47:229338b3adcb 3 "\n"
andrewboyson 47:229338b3adcb 4 "let hallTemperature = '';\n"
andrewboyson 47:229338b3adcb 5 "let programTimerOutput = false;\n"
andrewboyson 47:229338b3adcb 6 "let radiatorMode = false;\n"
andrewboyson 47:229338b3adcb 7 "let radiatorOverride = false;\n"
andrewboyson 47:229338b3adcb 8 "let radiatorPump = false;\n"
andrewboyson 47:229338b3adcb 9 "let nightSetPoint = '';\n"
andrewboyson 47:229338b3adcb 10 "let frostSetPoint = '';\n"
andrewboyson 47:229338b3adcb 11 "\n"
andrewboyson 47:229338b3adcb 12 "function parse()\n"
andrewboyson 47:229338b3adcb 13 "{\n"
andrewboyson 47:229338b3adcb 14 " let lines = Ajax.response.split('\\n');\n"
andrewboyson 92:2d1ca4dcbca7 15 " hallTemperature = Ajax.hexToSignedInt16(lines[0]);\n"
andrewboyson 92:2d1ca4dcbca7 16 " programTimerOutput = Ajax.hexToBit (lines[1], 0);\n"
andrewboyson 92:2d1ca4dcbca7 17 " radiatorMode = Ajax.hexToBit (lines[1], 1);\n"
andrewboyson 92:2d1ca4dcbca7 18 " radiatorOverride = Ajax.hexToBit (lines[1], 2);\n"
andrewboyson 92:2d1ca4dcbca7 19 " radiatorPump = Ajax.hexToBit (lines[1], 3);\n"
andrewboyson 92:2d1ca4dcbca7 20 " nightSetPoint = Ajax.hexToSignedInt16(lines[2], 16);\n"
andrewboyson 92:2d1ca4dcbca7 21 " frostSetPoint = Ajax.hexToSignedInt16(lines[3], 16);\n"
andrewboyson 47:229338b3adcb 22 "}\n"
andrewboyson 47:229338b3adcb 23 "function display()\n"
andrewboyson 47:229338b3adcb 24 "{\n"
andrewboyson 47:229338b3adcb 25 " let elem;\n"
andrewboyson 92:2d1ca4dcbca7 26 " elem = Ajax.getElementOrNull('ajax-hall-html' ); if (elem) elem.textContent = OneWire.DS18B20ToString(hallTemperature);\n"
andrewboyson 47:229338b3adcb 27 " elem = Ajax.getElementOrNull('ajax-program-toggle' ); if (elem) elem.setAttribute('dir', programTimerOutput ? 'rtl' : 'ltr');\n"
andrewboyson 47:229338b3adcb 28 " elem = Ajax.getElementOrNull('ajax-mode-toggle' ); if (elem) elem.setAttribute('dir', radiatorMode ? 'rtl' : 'ltr');\n"
andrewboyson 47:229338b3adcb 29 " elem = Ajax.getElementOrNull('ajax-override-toggle'); if (elem) elem.setAttribute('dir', radiatorOverride ? 'rtl' : 'ltr');\n"
andrewboyson 47:229338b3adcb 30 " elem = Ajax.getElementOrNull('ajax-radiator-toggle'); if (elem) elem.setAttribute('dir', radiatorPump ? 'rtl' : 'ltr');\n"
andrewboyson 47:229338b3adcb 31 " elem = Ajax.getElementOrNull('ajax-night-set-point'); if (elem) elem.value = nightSetPoint;\n"
andrewboyson 47:229338b3adcb 32 " elem = Ajax.getElementOrNull('ajax-frost-set-point'); if (elem) elem.value = frostSetPoint;\n"
andrewboyson 47:229338b3adcb 33 "}\n"
andrewboyson 47:229338b3adcb 34 "\n"
andrewboyson 47:229338b3adcb 35 "Ajax.server = '/radiator-ajax';\n"
andrewboyson 47:229338b3adcb 36 "Ajax.onResponse = function() { parse(); display(); };\n"
andrewboyson 47:229338b3adcb 37 "Ajax.init();\n"
andrewboyson 47:229338b3adcb 38 ""