Changeset 429 in tmcsimulator for trunk/webapps/einotebook/scripts/LoadEvents.js
- Timestamp:
- 07/05/2019 04:01:43 PM (7 years ago)
- File:
-
- 1 edited
-
trunk/webapps/einotebook/scripts/LoadEvents.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/webapps/einotebook/scripts/LoadEvents.js
r386 r429 85 85 var evalType = tagName.replace("_EVALUATION",""); 86 86 // Build the evaluation item 87 var facEval= new Evaluation(evalType,87 var evalItem = new Evaluation(evalType, 88 88 parseEvaluation(currEvt.childNodes[child]) ); 89 evalarray.push( facEval);89 evalarray.push(evalItem); 90 90 break; 91 91 92 92 case "CMS_EVALUATION": 93 // TODO: Complete this partial implementation 94 var result = new Array(); 95 result.push("Expected Action:"); 96 result.push("Action will appear here."); 97 var cmsEval = new Evaluation("CMS", result); 93 var cmsEval = new Evaluation("CMS", parseCMSEvaluation(currEvt.childNodes[child])); 98 94 evalarray.push(cmsEval); 99 95 break; … … 184 180 return result; 185 181 } 186 182 function parseCMSEvaluation(element) 183 { 184 var result = new Array(); 185 var locations = element.getElementsByTagName("LOCATION"); 186 if (locations.length > 0) 187 { 188 result.push("Sign Location:"); 189 result.push(locations[0].textContent); 190 } 191 var details = element.getElementsByTagName("CMS_LINE"); 192 if (details.length > 0) 193 { 194 for (detail in details) 195 { 196 if (details[detail].textContent != undefined) 197 { 198 result.push("Sample Message:"); 199 result.push(details[detail].textContent.trim()); 200 } 201 } 202 } 203 return result; 204 } 187 205 // MAIN 188 console.log("starting LoadEvents");206 //console.log("starting LoadEvents"); 189 207 try { 190 208 // the script must be located where accessible by the web server 191 209 var scriptFilename = "../dynamicdata/incident_script.xml"; 192 console.log("Attempting to load ", scriptFilename);210 console.log("Attempting to load ", scriptFilename); 193 211 // Now load the Incident Script and go parse it 194 212 loadJSON(scriptFilename, parseXml)
Note: See TracChangeset
for help on using the changeset viewer.
