Changeset 551 in tmcsimulator for trunk/webapps/einotebook


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/einotebook
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • 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"; 
Note: See TracChangeset for help on using the changeset viewer.