Changeset 551 in tmcsimulator


Ignore:
Timestamp:
12/26/2019 03:14:52 PM (6 years ago)
Author:
jdalbey
Message:

Multi-file commit to implement saving evaluation ratings from einotebook to a log file and merging with unified log. Also fix defect #212. cgi-bin/saveEvals.py cgi-bin/saveRatingsToLog.py common/js/displayutils.js common/js/fileutils.js common/js/revision_number.dat common/unifiedlog.css dynamicdata/CADcomments.log dynamicdata/caddetails.csv dynamicdata cms_messages.json dynamicdata/har_messages.json dynamicdata highway_status.json dynamicdata/ratings.csv dynamicdata/unifiedlog.csv dynamicdata/unifiedlog_final.csv einotebook/roles/index.html einotebook roles/roles.js einotebook/script/index.html einotebook/script scrollframe.js einotebook/scripts/Evaluation.js einotebook/scripts/Event.js mergelogs.bash unifiedlogdisplay.html unifiedlogmonitor.html

Location:
trunk/webapps
Files:
7 added
2 deleted
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/webapps/cgi-bin/saveEvals.py

    r547 r551  
    77output = "" 
    88for j in range(1, 3): 
    9     output +=  form.getvalue('group'+str(j)) 
    10     output += ", " 
     9    rating =  form.getvalue('evaluationGroup'+str(j)) 
     10    if rating is not None: 
     11        output +=  form.getvalue('evaluationGroup'+str(j)) 
     12        output += ", " 
    1113 
    1214print "Content-type:text/html\r\n\r\n" 
  • trunk/webapps/common/js/displayutils.js

    r386 r551  
    1414} 
    1515 
     16// Load a CSV file and convert to a string of formatted HTML 
     17// @param filename the file containing the CSV input 
     18// @param targetDiv the div element in which the HTML should be placed. 
     19function loadLog(filename, targetDiv) 
     20{ 
     21    // Asynchronous file read of unified log data 
     22    loadJSON("dynamicdata/" + filename, function(response) 
     23    { 
     24        // Format the csv data into an HTML table 
     25        var allRows = response.split(/\r?\n|\r/); 
     26        var table = '<table>'; 
     27        // Put the last log entry at the TOP of the table 
     28        for (var singleRow = allRows.length-1; singleRow >= 0; singleRow--) 
     29        { 
     30            var rowCells = allRows[singleRow].split(','); 
     31            var msg_type = ""; // color white is default 
     32 
     33            // trimming white space in the type field  
     34            // ingore the empty line  
     35            if (rowCells.length > 1)  
     36            { 
     37                rowCells[1] = rowCells[1].trim(); 
     38            } 
     39            var label = String(rowCells[1]); 
     40            var info = String(rowCells[3]).trim(); 
     41            // Implement ticket #190  
     42            // Checking for the type of logging information  
     43            if (label.startsWith("CAD")) { 
     44                msg_type = "class=\"CAD\""; 
     45                if (info.startsWith("Detail")) { 
     46                    msg_type = "class=\"CADdetail\""; 
     47                } 
     48            } else if (label.startsWith("Activity")) { 
     49                msg_type = "class=\"Activity\""; 
     50            //} else if (rowCells[1] == "CMS Activated.") { 
     51            } else if (label.startsWith("CMS")) { 
     52                msg_type = "class=\"CMS\""; 
     53            } else if (label.startsWith("Eval")) { 
     54                msg_type = "class=\"Evaluation\""; 
     55            }  
     56 
     57            // add the message type class to that row  
     58            table += '<tr ' + msg_type + '>'; 
     59            for (var rowCell = 0; rowCell < rowCells.length; rowCell++) 
     60            { 
     61                table += '<td>'; 
     62                table += rowCells[rowCell]; 
     63                table += '</td>'; 
     64            } 
     65            table += '</tr>'; 
     66        } 
     67        table += '</table>'; 
     68        targetDiv.innerHTML = table; 
     69    } 
     70    ); 
     71} 
  • trunk/webapps/common/js/fileutils.js

    r442 r551  
    1     // Load the dynamic json file for highways, etc. 
    2     // Ref: https://codepen.io/KryptoniteDove/post/load-json-file-locally-using-pure-javascript 
    3     function loadJSON(inFile, callback) 
     1// Load the dynamic json file for highways, etc. 
     2// Ref: https://codepen.io/KryptoniteDove/post/load-json-file-locally-using-pure-javascript 
     3function loadJSON(inFile, callback) 
     4{ 
     5    var xobj = new XMLHttpRequest(); 
     6    // Assume XML unless filename ends with .json 
     7    if (inFile.endsWith(".json")) 
    48    { 
    5         var xobj = new XMLHttpRequest(); 
    6         // Assume XML unless filename ends with .json 
    7         if (inFile.endsWith(".json")) 
     9        xobj.overrideMimeType("application/json"); 
     10    } 
     11    if (inFile.endsWith(".csv")) 
     12    { 
     13        xobj.overrideMimeType("text/csv"); 
     14    } 
     15    xobj.open('GET', inFile, true); 
     16    xobj.onreadystatechange = function() 
     17    { 
     18        if (xobj.readyState == 4 && xobj.status == "200") 
    819        { 
    9             xobj.overrideMimeType("application/json"); 
     20            callback(xobj.responseText); 
    1021        } 
    11         if (inFile.endsWith(".csv")) 
    12         { 
    13             xobj.overrideMimeType("text/csv"); 
    14         } 
    15         xobj.open('GET', inFile, true); 
    16         xobj.onreadystatechange = function() 
    17         { 
    18             if (xobj.readyState == 4 && xobj.status == "200") 
    19             { 
    20                 callback(xobj.responseText); 
    21             } 
    22         }; 
    23         // We want ajax to ignore any cached responses 
    24         xobj.setRequestHeader('If-Modified-Since', 'Sat, 01 Jan 2000 01:01:01 GMT') 
    25         xobj.send(null); 
     22    }; 
     23    // We want ajax to ignore any cached responses 
     24    xobj.setRequestHeader('If-Modified-Since', 'Sat, 01 Jan 2000 01:01:01 GMT') 
     25    xobj.send(null); 
     26} 
     27 
     28/* Retrieve URL parameters passed to a web page 
     29   @return a dictionary of key/value pairs 
     30*/ 
     31function getQueryParms() 
     32{ 
     33    var items = {}; 
     34    var query = window.location.search.substring(1); 
     35    var parms = query.split("&"); 
     36    // Examine each parameter 
     37    for (var i = 0, max = parms.length; i < max; i++) 
     38    { 
     39        // check for trailing & with no param 
     40        if (parms[i] === "")  
     41            continue; // skip it 
     42 
     43        var param = parms[i].split("="); 
     44        // If it's valid add it to dictionary 
     45        items[decodeURIComponent(param[0])] = decodeURIComponent(param[1] || ""); 
    2646    } 
    27  
     47    return items 
     48} 
  • trunk/webapps/common/js/revision_number.dat

    r547 r551  
    11 
    2     var revisionNumber = "540"; 
     2    var revisionNumber = "549"; 
    33     
  • trunk/webapps/dynamicdata/CADcomments.log

    r547 r551  
    1 CAD log, Simulation Started at 7 Dec 2019 09:20:08 with incidents 100 187 188 189 190 191  
     1CAD Log, Simulation Started at 26 Dec 2019 16:40:07 with incidents 100 187 188 189 190 191  
     2CAD Log, Incident #187, Jose Trainee: HELLO TMC WORLD 
     3CAD Log, Incident #187, Jose Trainee: SEND ICE CREAM 
     4CAD Log, Simulation Paused. 
  • trunk/webapps/dynamicdata/cms_messages.json

    r463 r551  
    4949{"cms":{"index":"84","message":{"displayTime":"","phase1":{"Line1":"","Line2":"","Line3":""},"phase2":{"Line1":"","Line2":"","Line3":""}}}}, 
    5050{"cms":{"index":"85","message":{"displayTime":"","phase1":{"Line1":"","Line2":"","Line3":""},"phase2":{"Line1":"","Line2":"","Line3":""}}}}, 
    51 {"cms":{"index":"86","message":{"displayTime":"","phase1":{"Line1":"AAAAAA","Line2":"","Line3":""},"phase2":{"Line1":"","Line2":"","Line3":""}}}}, 
     51{"cms":{"index":"86","message":{"displayTime":"","phase1":{"Line1":"","Line2":"","Line3":""},"phase2":{"Line1":"","Line2":"","Line3":""}}}}, 
    5252{"cms":{"index":"87","message":{"displayTime":"","phase1":{"Line1":"","Line2":"","Line3":""},"phase2":{"Line1":"","Line2":"","Line3":""}}}}, 
    5353{"cms":{"index":"88","message":{"displayTime":"","phase1":{"Line1":"","Line2":"","Line3":""},"phase2":{"Line1":"","Line2":"","Line3":""}}}}, 
  • trunk/webapps/dynamicdata/har_messages.json

    r463 r551  
    11{"data":[ 
    22{"har":{"index":"WPMW407 1620 AM","message":{"displayTime":"","phase1":{"Line1":"GOOD NIGHT"}}}}, 
    3 {"har":{"index":"KNNN868 1620 AM","message":{"displayTime":"","phase1":{"Line1":"HELLO WORLD"}}}} 
     3{"har":{"index":"KNNN868 1620 AM","message":{"displayTime":"","phase1":{"Line1":"SAMPLE HAR MESSAGE"}}}} 
    44]} 
  • trunk/webapps/dynamicdata/highway_status.json

    r547 r551  
    47554755       }, 
    47564756   "properties":  
    4757        {"street": "MACARTHU1", "color": "lime", "perpx": "-0.710326", "perpy": "0.703873"} 
     4757       {"street": "MACARTHU1", "color": "red", "perpx": "-0.710326", "perpy": "0.703873"} 
    47584758},   
    47594759{ 
     
    47664766       }, 
    47674767   "properties":  
    4768        {"street": "MACARTHU2", "color": "lime", "perpx": "-0.710326", "perpy": "0.703873"} 
     4768       {"street": "MACARTHU2", "color": "red", "perpx": "-0.710326", "perpy": "0.703873"} 
    47694769},   
    47704770{ 
     
    47774777       }, 
    47784778   "properties":  
    4779        {"street": "DYER 1", "color": "lime", "perpx": "0", "perpy": "0"} 
     4779       {"street": "DYER 1", "color": "red", "perpx": "0", "perpy": "0"} 
    47804780},   
    47814781{ 
     
    1204612046       }, 
    1204712047   "properties":  
    12048        {"street": "AIRPORT", "color": "lime", "perpx": "0.321527", "perpy": "0.9469"} 
     12048       {"street": "AIRPORT", "color": "yellow", "perpx": "0.321527", "perpy": "0.9469"} 
    1204912049},   
    1205012050{ 
     
    1205712057       }, 
    1205812058   "properties":  
    12059        {"street": "HOV AT 55N FLYOVER**", "color": "lime", "perpx": "0.271933", "perpy": "0.962316"} 
     12059       {"street": "HOV AT 55N FLYOVER**", "color": "yellow", "perpx": "0.271933", "perpy": "0.962316"} 
    1206012060},   
    1206112061{ 
     
    1206812068       }, 
    1206912069   "properties":  
    12070        {"street": "RED HILL", "color": "lime", "perpx": "0.126754", "perpy": "0.991934"} 
     12070       {"street": "RED HILL", "color": "yellow", "perpx": "0.126754", "perpy": "0.991934"} 
    1207112071},   
    1207212072{ 
  • trunk/webapps/dynamicdata/unifiedlog.csv

    r547 r551  
    1 0:01:17, CMS Activated.,N SR-55  5.38 Baker Street, 'BBBBB:::::' 
    2 0:01:17, CMS Activated.,N I-405 15.18 MAGNOLIA ST, 'SLOW FOR THE::CONE ZONE:ROAD WORK:AHEAD:' 
    3 0:01:17, CMS Activated.,S I-405 12.04 NEW HAMPSHIRE, 'AAAAAA:::::' 
    4 0:01:17, CAD log, Simulation Started,  loaded incidents 100 187 188 189 190 191 
    5 0:01:17, Activity Log.,Ha Khanh Duy,001  Per 32-1 NB rte 405 blocked 
    6 0:01:17, Activity Log.,Gross Angelo,001  HCC NOTIFIED 
    7 0:01:17, Activity Log.,Gross Angelo,001  32-1 Vehicle Disabled S 55@ 405 1308 hours 
    8 0:01:17, Activity Log.,,021 10-98 Assignment Completed 75-1 
    9 0:01:17, Activity Log.,,021 10-98 Let's get pizza. 75-1 
    10 0:01:17, Activity Log.,Bailey Mary,001  Incident Created 
    11 0:01:17, Activity Log.,Hockaday Neil,002  Incident Created 
    12 0:01:17, Activity Log.,Ally Neil,002  Incident Created 
    13 0:01:17, CAD log, Simulation Started,  loaded incidents 100 187 
    14 0:00:05, CAD log, Simulation Started,  loaded incidents 100 187 188 189 190 191 
    15 0:00:10, CAD log, Simulation Paused. 
    16 0:00:12, CAD log, Simulation Started,  loaded incidents 100 187 188 189 190 191 
    17 0:00:05, CAD log, Simulation Started,  loaded incidents 100 187 188 189 190 191 
    18 0:00:25, CAD log, Incident #187, A: HELLO WORLD 
    19 0:00:36, CAD log, Simulation Paused. 
     100:01:18, CMS Activated,N SR-55  5.38 Baker Street, 'BBBBB:::::' 
     200:01:18, CMS Activated,N I-405 15.18 MAGNOLIA ST, 'SLOW FOR THE::CONE ZONE:ROAD WORK:AHEAD:' 
     300:01:18, CAD Log, Simulation Started at 26 Dec 2019 16:40:07 with incidents 100 187 188 189 190 191 
     400:01:18, CAD Log, Incident #187, Jose Trainee: HELLO TMC WORLD 
     500:01:18, Activity Log,Ha Khanh Duy,001  Per 32-1 NB rte 405 blocked 
     600:01:18, Activity Log,Gross Angelo,001  HCC NOTIFIED 
     700:01:18, Activity Log,Gross Angelo,001  32-1 Vehicle Disabled S 55@ 405 1308 hours 
     800:01:18, Activity Log,,021 10-98 Assignment Completed 75-1 
     900:01:18, Activity Log,,021 10-98 Let's get pizza. 75-1 
     1000:01:18, Activity Log,Bailey Mary,001  Incident Created 
     1100:01:18, Activity Log,Hockaday Neil,002  Incident Created 
     1200:01:18, Activity Log,Quan Ally,002  Incident Created 
     1300:01:53, CMS Activated,N SR-73 24.91 North of Jamboree, 'LINES ON ROAD:::::' 
     1400:02:28, CMS Updated, N SR-73 24.91 North of Jamboree, 'SNOW ON ROAD:::::' 
     1500:03:13, CAD Log, Incident #187, Jose Trainee: SEND ICE CREAM 
     1600:03:33, CMS Deactivated, N SR-73 24.91 North of Jamboree 
     1700:04:04, CAD Log, Simulation Paused. 
  • trunk/webapps/einotebook/roles/index.html

    r548 r551  
    99    <script type="text/javascript" src="roles.js"></script>  
    1010    <script type="text/javascript" src="../scripts/cookies.js"></script> 
    11     <title>Script</title> 
     11    <title>Roles</title> 
    1212  </head> 
    1313  <body> 
    1414    
    15     <button class="jumpToCurrentEvent"  
    16             onclick="jumpToLastExecutedEvent()">Jump to Current Event</button> 
     15    <!--button class="jumpToCurrentEvent"  
     16            onclick="jumpToLastExecutedEvent()">Jump to Current Event</button--> 
    1717    <!-- A combo box for which role is to be displayed on the page --> 
    1818    <select id="desiredRole" onchange="changeRole()"> 
     
    2222      <option value="CHP RADIO">CHP RADIO</option> 
    2323    </select> 
    24     <iframe id='view' src='../script/scrollframe.html' frameborder='0' scrolling='yes' 
     24    <iframe id='rolesview' src='../script/scrollframe.html' frameborder='0' scrolling='yes' 
    2525            width='100%'></iframe> 
    2626 
  • trunk/webapps/einotebook/roles/roles.js

    r540 r551  
    4949function highlightLatestEvent()  
    5050{ 
     51    // workaround for defect #212 is disable this function 
     52    return;  
     53 
    5154    Roles.events.setEmphasis();  // Set text colors on all events 
    5255 
     
    6972        Roles.incidents = theIncidents; 
    7073        Roles.events = theEvents; 
    71         Roles.events.win = document.getElementById("view").contentWindow; 
    72         Roles.events.doc = getDocumentFromFrame('view'); 
     74    // workaround for defect #212 is delete these two lines so they don't conflict 
     75    //   with the Scripts.events.win 
     76        //Roles.events.win = document.getElementById("view").contentWindow; 
     77        //Roles.events.doc = getDocumentFromFrame('view'); 
    7378    // reset SELECT box to default value 
    7479    document.getElementById("desiredRole").value = "TELEPHONE CONVERSATION"; 
     
    108113         
    109114        // display events in iframe 
    110         getDocumentFromFrame('view').body.innerHTML = html;      
     115        getDocumentFromFrame('rolesview').body.innerHTML = html;         
    111116    
    112117        // resize iframe to appropriate height 
     
    150155{ 
    151156    var height = document.documentElement.clientHeight; 
    152     height -= pageY(document.getElementById('view')); 
     157    height -= pageY(document.getElementById('rolesview')); 
    153158    height = (height < 0) ? 0 : height - 10; 
    154     document.getElementById('view').style.height = height + 'px'; 
     159    document.getElementById('rolesview').style.height = height + 'px'; 
    155160} 
    156161 
  • trunk/webapps/einotebook/script/index.html

    r548 r551  
    2020            width='100%'></iframe> 
    2121 
    22       </form> 
     22       
    2323    
    2424  </body> 
  • trunk/webapps/einotebook/script/scrollframe.js

    r548 r551  
    1212} 
    1313 
     14// Collect all the ratings from the events  
    1415function collectRatings()  
    1516{ 
     17    var output = "" 
     18    var ratingCount = 0 
    1619    // Consider each event in the incident script 
    1720    for (var evtidx = 0; evtidx < events.length; evtidx++) 
     
    2730                // If it not the default value we want to save it 
    2831                if (item.rating > 0) 
    29                 { 
    30                     console.log("collecting event"+evtidx + " at " + events[evtidx].time.format() +" "+item.type + " " + item.rating) 
     32                {   // Build a string for the log in this format: 
     33                    //03:01:00, Evaluation, CMS, Poor 
     34                    output += events[evtidx].time.format() +", Evaluation, "+item.type + ", " + item.ratingQualities[item.rating] + "\n" 
     35                    ratingCount += 1;   
    3136                } 
    3237            } 
    3338        } 
    3439    } 
     40    submitRatings(output); 
     41    alert(ratingCount + " rating were saved.") 
    3542} 
    3643 
     
    5562*/ 
    5663 
    57 // TODO 
    58 function submitRatings() 
     64// Send the string of ratings to the server 
     65function submitRatings(logString) 
    5966{ 
    6067        // Using POST to send the data  
    6168        var xhr = new XMLHttpRequest(); 
    62         xhr.open("POST", "../../cgi-bin/saveRatings.py", true); 
     69        xhr.open("POST", "/cgi-bin/saveRatingsToLog.py", true); 
    6370        xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); 
    6471        // send the collected data 
    65         xhr.send("msg="+outString); 
     72        xhr.send("msg="+logString); 
    6673} 
  • trunk/webapps/einotebook/scripts/Evaluation.js

    r548 r551  
    1010     
    1111    //========== public constants ==========// 
     12    this.ratingQualities = ["", "Worst","Poor","Average","Good","Best"]; 
    1213    this.id = Evaluation.id; 
    1314    this.ratingGroupName = "evaluationGroup" + this.id;     
     
    7576 
    7677        this.rating = givenRating; 
    77  
    78         console.log(this.ratingGroupName + " recordRating of " + this.rating ) 
     78        //console.log(this.ratingGroupName + " recordRating of " + this.rating ) 
    7979    } 
    8080 
     
    103103               "<table align='right' class='evaluationScale'>" + 
    104104               "<tr>" + 
    105                "<td class='eventRadioButtonSmallScale'>Best</td>" + 
    106                "<td class='eventRadioButtonSmallScale'>Good</td>" + 
    107                "<td class='eventRadioButtonSmallScale'>Average</td>" + 
    108                "<td class='eventRadioButtonSmallScale'>Poor</td>" + 
    109                "<td class='eventRadioButtonSmallScale'>Worst</td>" + 
     105               "<td class='eventRadioButtonSmallScale'>"+this.ratingQualities[5]+"</td>" + 
     106               "<td class='eventRadioButtonSmallScale'>"+this.ratingQualities[4]+"</td>" + 
     107               "<td class='eventRadioButtonSmallScale'>"+this.ratingQualities[3]+"</td>" + 
     108               "<td class='eventRadioButtonSmallScale'>"+this.ratingQualities[2]+"</td>" + 
     109               "<td class='eventRadioButtonSmallScale'>"+this.ratingQualities[1]+"</td>" + 
    110110               "</tr>" + 
    111111               "<tr>" + 
  • trunk/webapps/einotebook/scripts/Event.js

    r540 r551  
    178178        function focus() 
    179179        { 
    180                 /* This method was discarded because it moved the scroll bar of the parent of 
     180                /* This next 3 lines were discarded because it moved the scroll bar of the parent of 
    181181                 * the given window in addition to the scroll bar of the given window.. 
    182182                var positionOfPound = window.location.indexOf("#"); 
     
    184184                window.location = rootLocation + "#" + eventAnchorName; 
    185185                */ 
    186                 events.win.scrollTo(0, absoluteTop(events.doc.getElementById(this.eventHeaderID))); 
     186                events.win.scrollTo(0, absoluteTop(events.doc.getElementById(this.eventHeaderID))); 
    187187        } 
    188188         
     
    195195        if (events.doc.getElementById(this.eventHeaderID) != null) 
    196196        { 
    197                 events.doc.getElementById(this.eventHeaderID).style.borderColor = "blue"; 
     197                events.doc.getElementById(this.eventHeaderID).style.borderColor = "blue"; 
    198198                events.doc.getElementById(this.eventHeaderID).style.backgroundColor = "yellow"; 
    199199                events.doc.getElementById(this.eventHeaderID).style.color = "black"; 
  • trunk/webapps/unifiedlogmonitor.html

    r512 r551  
    44  <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> 
    55    <title>Unified Logger v</title>  
    6 <style> 
    7 * { 
    8   box-sizing: border-box; 
    9 } 
    10 body { 
    11    background-color: #000033; 
    12    color: goldenrod 
    13 } 
    14  
    15 /* Color Code for unified logger */  
    16 .CAD-log{ 
    17     color: #00FFFF; 
    18 } 
    19 .Activity-log{ 
    20     color: #32CD32; 
    21 } 
    22 .CMS-Activated{ 
    23     color: #FFFF00; 
    24 } 
    25  
    26 /* Padding for table cells */ 
    27 td { padding-top:2px; padding-right:10px; padding-bottom:2px; padding-left:10px; } 
    28 /* styling for messages */ 
    29 #msgs{ 
    30   padding: 15px 10% 15px 10%; 
    31   font-size: 20px; 
    32   font-family: monospace; 
    33   font-weight:lighter; 
    34   color: white; 
    35   padding-left: 2%; 
    36   padding-right: 2%; 
    37 } 
    38 </style> 
     6<link href="common/unifiedlog.css" rel="stylesheet" type="text/css"> 
    397</head> 
    408<body> 
    419<div class="row"> 
    42     <p id="msgs"></p> 
     10    <p id="display"></p> 
    4311</div> 
    4412    <script  src="common/js/fileutils.js"></script> 
     
    4614    <script  src="common/js/displayutils.js"></script>  
    4715   <script> 
    48 // Load the unified log  
    49 function loadLog() 
     16function showLog() 
    5017{ 
    51     var display = document.getElementById("msgs"); 
    52     display.innerHTML = "" 
    53     // Asynchronous file read of unified log data 
    54     loadJSON("dynamicdata/unifiedlog.csv", function(response) 
    55     { 
    56         // Format the csv data into an HTML table 
    57         var allRows = response.split(/\r?\n|\r/); 
    58         var table = '<table>'; 
    59         // Put the last log entry at the TOP of the table 
    60         for (var singleRow = allRows.length-1; singleRow >= 0; singleRow--) 
    61         { 
    62             var rowCells = allRows[singleRow].split(','); 
    63             var msg_type = ""; 
    64  
    65             // trimming white space in the type of messages  
    66             // ingore the emtpy line  
    67             if (rowCells.length > 1) { 
    68                 console.log("row cell " , rowCells[1]); 
    69                 rowCells[1] = rowCells[1].trim(); 
    70             } 
    71             // Implement ticket #190  
    72             // Checking for the type of logging information  
    73             if (rowCells[1] == "CAD log") { 
    74                 msg_type = "class=\"CAD-log\""; 
    75             } else if (rowCells[1] == "Activity Log.") { 
    76                 msg_type = "class=\"Activity-log\""; 
    77             } else if (rowCells[1] == "CMS Activated.") { 
    78                 msg_type = "class=\"CMS-Activated\""; 
    79             }  
    80             // add the message type class to that row  
    81             table += '<tr ' + msg_type + '>'; 
    82             for (var rowCell = 0; rowCell < rowCells.length; rowCell++) 
    83             { 
    84                 table += '<td>'; 
    85                 table += rowCells[rowCell]; 
    86                 table += '</td>'; 
    87             } 
    88             table += '</tr>'; 
    89         } 
    90         table += '</table>'; 
    91         // Add the table to the messages div 
    92         display.innerHTML += table; 
    93     } 
    94     ); 
     18    var display = document.getElementById("display"); 
     19    // Utility reads from given file and puts into given DIV 
     20    loadLog("unifiedlog.csv", display); 
     21    // Start a timer to do this again in 5 seconds 
     22    var x = setTimeout(showLog, 5000); 
    9523} 
    9624// Start 
    9725showRevision(); 
    98 loadLog(); 
    99 // start an interval timer to refresh the log every 5 seconds 
    100 var displayTimer = setInterval(loadLog, 5000); 
     26showLog(); 
    10127   </script> 
    10228  </body> 
Note: See TracChangeset for help on using the changeset viewer.