/************************ * * This file contains the html code for the webpage served by the ethernet module. The webpage shows the state and conditions * of the inputs as well as the analog values. * *************************/ /******************** * Function to serve the webpage showing the interlock system status * *********************/ void serve_webpage(void) { String condition_txt; switch (currentState) { case 0: condition_txt = "Rebooting..."; break; case 1: condition_txt = "normal"; break; case 2: condition_txt = "Cage Door Trip"; break; case 3: condition_txt = "Vacuum Trip"; break; case 4: condition_txt = "Source Trip"; break; } EthernetClient client = server.available(); if (client) { //Serial.println("new client"); // an http request ends with a blank line boolean currentLineIsBlank = true; while (client.connected()) { if (client.available()) { char c = client.read(); //Serial.write(c); // if you've gotten to the end of the line (received a newline // character) and the line is blank, the http request has ended, // so you can send a reply if (c == '\n' && currentLineIsBlank) { // send a standard http response header client.println("HTTP/1.1 200 OK"); client.println("Content-Type: text/html"); client.println("Connection: close"); // the connection will be closed after completion of the response client.println("Refresh: 5"); // refresh the page automatically every 5 sec client.println(); client.println(""); client.println(""); client.println("
"); client.println("Input Conditions | "); client.println(""); client.println(" | Output Relays | "); client.println(""); client.println(" | Measurements | "); client.println("
---|---|---|---|---|
Reset Switch: | "); client.print(""); client.print((input[0]==input_normal[0]) ? "normal" : "TRIPPED"); client.println(" | "); client.println("Switch LED: | "); client.print(""); client.print((output[0]==0) ? "Off" : "Flashing Red"); client.println(" | "); client.print("Tritium Detector: "); client.print(tSniffer, 1); client.println(" uCi/m^3 | "); client.println("
Emergency Interlock Switch: | "); client.print(""); client.print((input[1]==input_normal[1]) ? "normal" : "TRIPPED"); client.println(" | "); client.println("Buzzer: | "); client.print(""); client.print((output[1]==1) ? "Buzzing" : "Off"); client.println(" | "); client.print("Vacuum Gauge: "); client.print(vacuum); client.println("E-6 Torr | "); client.println("
Cage Door Contact: | "); client.print(""); client.print((input[2]==input_normal[2]) ? "normal" : "TRIPPED"); client.println(" | "); client.println("Cage Door Trip LED: | "); client.print(""); client.print((output[2]==0) ? "Green/Off" : "Red"); client.println(" | "); client.print("Titanium Sublimation Pump: "); client.print(subPump, 1); client.println(" Amps | "); client.println("
Fume Hood Flow Switch: | "); client.print(""); client.print((input[3]==input_normal[3]) ? "normal" : "TRIPPED"); client.println(" | "); client.println("Vacuum Trip LED: | "); client.print(""); client.print((output[3]==0) ? "Green/Off" : "Red"); client.println(" | "); client.println(""); client.println(" |
Vacuum Condition - Ground: | "); client.print(""); client.print((input[4]==input_normal[4]) ? "normal" : "TRIPPED"); client.println(" | "); client.println("Source Trip LED: | "); client.print(""); client.print((output[4]==0) ? "Green/Off" : "Red"); client.println(" | "); client.println(""); client.println(" |
Tritium Detector: | "); client.print(""); client.print((input[5]==input_normal[5]) ? "normal" : "TRIPPED"); client.println(" | "); client.println("Pre-accelerator Power Supply: | "); client.print(""); client.print((output[5]==1) ? "Unlocked" : "Locked Out"); client.println(" | "); client.println(""); client.println(" |
UNUSED | "); client.print(""); client.print((input[6]==input_normal[6]) ? "normal" : "TRIPPED"); client.println(" | "); client.println("Gate Valve - Ground: | "); client.print(""); client.print((output[6]==1) ? "Open" : "Closed"); client.println(" | "); client.println(""); client.println(" |
Building Power Failure: | "); client.print(""); client.print((input[7]==input_normal[7]) ? "normal" : "TRIPPED"); client.println(" | "); client.println("Gate Valve - Mid Potential: | "); client.print(""); client.print((output[7]==1) ? "Open" : "Closed"); client.println(" | "); client.println(""); client.println(" |
Coolant Flow At Pump: | "); client.print(""); client.print((input[8]==input_normal[8]) ? "normal" : "TRIPPED"); client.println(" | "); client.println("UNUSED | "); client.print(""); client.print((output[8]==0) ? "Open" : "Closed"); client.println(" | "); client.println(""); client.println(" |
Vacuum Condition - Mid Potential: | "); client.print(""); client.print((input[9]==input_normal[9]) ? "normal" : "TRIPPED"); client.println(" | "); client.println("UNUSED | "); client.print(""); client.print((output[9]==0) ? "Open" : "Closed"); client.println(" | "); client.println(""); client.println(" |
UNUSED | "); client.print(""); client.print((input[10]==input_normal[10]) ? "normal" : "TRIPPED"); client.println(" | "); client.println("UNUSED | "); client.print(""); client.print((output[10]==0) ? "Open" : "Closed"); client.println(" | "); client.println(""); client.println(" |
Coolant Flow At Source: | "); client.print(""); client.print((input[11]==input_normal[11]) ? "normal" : "TRIPPED"); client.println(" | "); client.println("UNUSED | "); client.print(""); client.print((output[11]==0) ? "Open" : "Closed"); client.println(" | "); client.println(""); client.println(" |
Smoke Detector At Source: | "); client.print(""); client.print((input[12]==input_normal[12]) ? "normal" : "TRIPPED"); client.println(" | "); client.println("UNUSED | "); client.print(""); client.print((output[12]==0) ? "Open" : "Closed"); client.println(" | "); client.println(""); client.println(" |
UNUSED | "); client.print(""); client.print((input[13]==input_normal[13]) ? "normal" : "TRIPPED"); client.println(" | "); client.println("High-voltage Power Supplies: | "); client.print(""); client.print((output[13]==1) ? "Unlocked" : "Locked Out"); client.println(" | "); client.println(""); client.println(" |
UNUSED | "); client.print(""); client.print((input[14]==input_normal[14]) ? "normal" : "TRIPPED"); client.println(" | "); client.println("Boiler: | "); client.print(""); client.print((output[14]==1) ? "Unlocked" : "Locked Out"); client.println(" | "); client.println(""); client.println(" |
UNUSED | "); client.print(""); client.print((input[15]==input_normal[15]) ? "normal" : "TRIPPED"); client.println(" | "); client.println("Ionizer: | "); client.print(""); client.print((output[15]==1) ? "Unlocked" : "Locked Out"); client.println(" | "); client.println(""); client.println(" |