Changeset 14512


Ignore:
Timestamp:
10/24/12 08:49:55 (12 years ago)
Author:
neise
Message:
new version, with new buttons, checked HTML and span tags
File:
1 edited

Legend:

Unmodified
Added
Removed
  • firmware/InterlockArduino/src/webserver/webserver.ino

    r14511 r14512  
    5252//char * my_input_names[] = {"FC_OK", "BP_ON", "IL_ON", "FL_OK", "FP_EN", "X_ON", "Y_ON", "Z_OK"};
    5353
    54 char * my_input_names[] = { "Is the cooling liquid flow meter measuring enough throuput?",
    55                             "Is Bias Power enabled?",
    56                             "Is 24VDC Interlock power supply enabled?",
    57                             "Is the Level of the cooling liquid ok?",
    58                             "Is the Pump powered?",
    59                             "Is the Drive Cabinet Enable Signal on?",
    60                             "Is the Drive Cabinet Power Signal on?",
    61                             "Is Drive Container Enabled?"};
     54char * my_input_names[] = { "Is the cooling liquid flow meter measuring enough throuput? ",
     55                            "Is Bias Power enabled? ",
     56                            "Is 24VDC Interlock power supply enabled? ",
     57                            "Is the Level of the cooling liquid ok? ",
     58                            "Is the Pump powered? ",
     59                            "<br />Is the Drive Cabinet Enable Signal on? ",
     60                            "Is the Drive Cabinet Power Signal on? ",
     61                            "Is Drive Container Enabled? "};
     62
     63char * my_input_span_id[] = {"flow_meter", "bias_power", "power_24v", "level", "pump", "drive_enable", "drive_power", "drive_on"};
     64
    6265int Number_of_Buttons = 3;
    6366// This is in HTML called the VALUE of the button,
     
    170173           {
    171174             get_http_found = true;
    172              if (eth.indexOf(String("pump_on=")) !=-1){
     175             if (eth.indexOf(String("cam_on=")) !=-1){
    173176               Serial.println("User request: Enable Pump");
    174177               digitalWrite( FC_ON, HIGH);
     
    176179                  fc_on_time += 3000;
    177180             }
    178              else if (eth.indexOf(String("pump_off=")) !=-1)
     181             else if (eth.indexOf(String("cam_off=")) !=-1)
    179182             {
    180183               Serial.println("User request: Disable Pump");
     
    182185               fc_off_time = 500;
    183186             }
    184              else if (eth.indexOf(String("toggle_drive=")) !=-1)
     187             else if (eth.indexOf(String("drive_toggle=")) !=-1)
    185188             {
    186189                Serial.println("User request: Toggle Drive");
     
    248251 
    249252  // add a meta refresh tag, so the browser pulls again every 5 seconds:
    250   client->print("<meta http-equiv=\"refresh\" content=\"1 URL=index.html\">"); 
     253  client->println("<meta http-equiv=\"refresh\" content=\"5; URL=index.html\" />");
     254  client->println("<meta http-equiv=\"Content-type\" content=\"text/html;charset=UTF-8\" />"); 
    251255 
    252256  client->println("<title>FACT camera power interlock control</title></head><body>");
     
    260264    client->print(my_input_names[ch]);
    261265    client->print(" :");
    262     client->print(my_inputs[ch]);
    263     client->print(" is ");
     266    client->print("    ");
     267    client->print("<span id=\"");
     268    client->print(my_input_span_id[ch]);
     269    client->print("\" title=\"");
    264270    if ( digitalRead(my_inputs[ch]) )
    265271    {
    266       client->print("<font color=\"green\" size=20>HIGH</font>");
     272      client->print("1\"> Yes");
     273      //client->print(" Yes ");
    267274    }
    268275    else
    269276    {
    270       client->print("<font color=\"red\" size=20>LOW</font>");
     277      client->print("0\"> No ");
     278      //client->print(" No ");
    271279    }
    272     client->println("<br />");
     280    client->println("</span> <br />");
    273281  }
    274282}
Note: See TracChangeset for help on using the changeset viewer.