Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: oldheating gps motorhome heating
fault/http-fault-html.c@58:e5ab14ef6ea6, 2019-03-08 (annotated)
- Committer:
- andrewboyson
- Date:
- Fri Mar 08 16:07:56 2019 +0000
- Revision:
- 58:e5ab14ef6ea6
- Parent:
- 56:f6e814fe0159
- Child:
- 59:309e78f243dd
Tidied a load of routines in page module
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| andrewboyson | 16:0edbb832ffcc | 1 | #include <stdio.h> |
| andrewboyson | 16:0edbb832ffcc | 2 | |
| andrewboyson | 30:6a08abbe6301 | 3 | #include "http.h" |
| andrewboyson | 30:6a08abbe6301 | 4 | #include "page.h" |
| andrewboyson | 30:6a08abbe6301 | 5 | #include "page-derived.h" |
| andrewboyson | 30:6a08abbe6301 | 6 | #include "http-server.h" |
| andrewboyson | 30:6a08abbe6301 | 7 | #include "fault.h" |
| andrewboyson | 16:0edbb832ffcc | 8 | |
| andrewboyson | 16:0edbb832ffcc | 9 | void HttpFaultHtml() |
| andrewboyson | 16:0edbb832ffcc | 10 | { |
| andrewboyson | 16:0edbb832ffcc | 11 | HttpOk("text/html; charset=UTF-8", "no-cache", NULL, NULL); |
| andrewboyson | 35:dc4333b13aba | 12 | PageAddHeader(PageSite, "Fault", "settings.css", NULL); |
| andrewboyson | 30:6a08abbe6301 | 13 | PageAddNav(FAULT_PAGE); |
| andrewboyson | 30:6a08abbe6301 | 14 | PageAddH1(PageSite, "Fault"); |
| andrewboyson | 16:0edbb832ffcc | 15 | |
| andrewboyson | 16:0edbb832ffcc | 16 | PageAddH2("Last fault"); |
| andrewboyson | 16:0edbb832ffcc | 17 | int faultType = FaultTypeGet(); |
| andrewboyson | 16:0edbb832ffcc | 18 | char text[20]; |
| andrewboyson | 16:0edbb832ffcc | 19 | FaultTypeToString(faultType, sizeof(text), text); |
| andrewboyson | 16:0edbb832ffcc | 20 | PageAddLabelledValue("Fault type", 17, text); |
| andrewboyson | 16:0edbb832ffcc | 21 | if (faultType) |
| andrewboyson | 16:0edbb832ffcc | 22 | { |
| andrewboyson | 17:a08749ce4cb6 | 23 | FaultZoneToString(FaultZoneGet(), sizeof(text), text); |
| andrewboyson | 17:a08749ce4cb6 | 24 | PageAddLabelledValue("Fault zone", 17, text); |
| andrewboyson | 16:0edbb832ffcc | 25 | PageAddLabelledInt("After point", 17, FaultPointGet()); |
| andrewboyson | 58:e5ab14ef6ea6 | 26 | PageAddInputButton(0, "Clear fault", "clear", "/fault", "faultclear"); |
| andrewboyson | 16:0edbb832ffcc | 27 | } |
| andrewboyson | 16:0edbb832ffcc | 28 | else |
| andrewboyson | 16:0edbb832ffcc | 29 | { |
| andrewboyson | 58:e5ab14ef6ea6 | 30 | PageAddInputButton(0, "Test fault", "test", "/fault", "faulttest"); |
| andrewboyson | 16:0edbb832ffcc | 31 | } |
| andrewboyson | 16:0edbb832ffcc | 32 | |
| andrewboyson | 16:0edbb832ffcc | 33 | PageAddEnd(); |
| andrewboyson | 16:0edbb832ffcc | 34 | } |
| andrewboyson | 16:0edbb832ffcc | 35 |