Warning: Can't use blame annotator:
svn blame failed on trunk/webapps/cmsmonitor/index.html: ("Can't find a temporary directory: Internal error", 20014)

source: tmcsimulator/trunk/webapps/cmsmonitor/index.html @ 386

Revision 386, 3.3 KB checked in by jdalbey, 7 years ago (diff)

Updated LoadEvents?.js to parse all event types except CMS_EVALUATION. Modified build.xml to write svn revision number to webapps/common/js so the revision number can be included in the web page title of our apps. Write ShowRevision? function in displayutils.js to do that.

RevLine 
1<!DOCTYPE html>
2<html>
3  <head>
4<!-- Launch with  python -m CGIHTTPServer 80  -->
5  <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
6    <title>CMS Monitor v</title> 
7<style>
8* {
9  box-sizing: border-box;
10}
11body {
12   background-color: #000033;
13}
14/* Create three unequal columns that float next to each other */
15.column {
16  float: left;
17  padding: 10px;
18  background-color:black; 
19  color:goldenrod
20}
21
22.left {
23  width: 50%;
24}
25
26.middle, .right {
27  width: 25%;
28}
29
30/* Clear floats after the columns */
31.row:after {
32  content: "";
33  display: table;
34  clear: both;
35}
36</style>
37</head>
38<body onLoad="showRevision();"> 
39<div class="row">
40  <div class="column left" >
41    <h2>Active CMS Messages</h2>
42    <p id="msgs"></p>
43  </div>
44  <div class="column middle" >
45    <h2>Active HAR Messages</h2>
46    <p>Not implemented yet.</p>
47  </div>
48  <div class="column right" >
49    <h2>Active Lane Closures</h2>
50    <p>Not implemented yet.</p>
51  </div>
52</div>
53
54    <script  src="../common/js/displayutils.js"></script>
55    <script  src="../common/js/revision.js"></script>
56    <script  src="../common/js/fileutils.js"></script>
57   <script>
58    var cmsLocations = {};
59    // Load the CMS locations from the geojson file
60    function loadCMSlocations()
61    {
62        loadJSON("../cptms/data_layers/cms_locations_D12.gjson", function(response)
63        {
64            // Parse JSON string into object
65            var cmsjson = JSON.parse(response);
66            for (var i = 0; i < cmsjson.features.length; i++)
67            {
68                var item = cmsjson.features[i];
69                // Add each item to a lookup dictionary
70                cmsLocations[item.id] = item;
71            }
72        });
73    }
74    // Load the file of CMS messages
75    function loadAllcmsMessages()
76    {
77        var display = document.getElementById("msgs");
78        display.innerHTML = ""
79        loadJSON("../dynamicdata/cms_messages.json", function(response)
80        {
81            // Parse JSON string into object
82            messagejson = JSON.parse(response);
83            // Consider each message
84            for (var i = 0; i < messagejson.data.length; i++)
85            {
86                var item = messagejson.data[i];
87                // Find the location for this message
88                var cmsLoc = cmsLocations[item.cms.index];
89                // Build the message display
90                var current = (item.cms.message.phase1.Line1.toUpperCase() + ":" +
91                    item.cms.message.phase1.Line2.toUpperCase() + ":" +
92                    item.cms.message.phase1.Line3.toUpperCase() + ":" +
93                    item.cms.message.phase2.Line1.toUpperCase() +  ":" +
94                    item.cms.message.phase2.Line2.toUpperCase() + ":" +
95                    item.cms.message.phase2.Line3.toUpperCase())
96                // If the message isn't blank, append it to the list
97                if (current != ":::::")
98                {
99                    display.innerHTML += "<br>" + item.cms.index + ": " + 
100                        cmsLoc.properties.location + " " + cmsLoc.properties.street;
101                    display.innerHTML += "<br>" + current + "<br>";
102                }
103            }
104        });
105    }
106
107// Start
108loadCMSlocations();
109loadAllcmsMessages();
110// start an interval timer to refresh the cms icons every 10 seconds
111var cmsTimer = setInterval(loadAllcmsMessages, 10000);
112
113   </script>
114  </body>
115</html>
Note: See TracBrowser for help on using the repository browser.