Changeset 433 in tmcsimulator
- Timestamp:
- 07/07/2019 11:17:08 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 4 edited
- 1 moved
-
scripts/cad_event_script.xml (added)
-
scripts/documented_script.txt (added)
-
scripts/experimental_practice.xml (added)
-
scripts/media_log_only.xml (moved) (moved from trunk/scripts/one-incident.xml)
-
webapps/common/js/revision_number.dat (modified) (1 diff)
-
webapps/dynamicdata/highway_status.json (modified) (14 diffs)
-
webapps/dynamicdata/unifiedlog.html (added)
-
webapps/unifiedlogger/cad_watcher.py (added)
-
webapps/unifiedlogger/cms_watcher.py (modified) (3 diffs)
-
webapps/unifiedlogger/logging_service.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/webapps/common/js/revision_number.dat
r429 r433 1 1 2 var revisionNumber = "4 26";2 var revisionNumber = "431"; 3 3 -
trunk/webapps/dynamicdata/highway_status.json
r429 r433 4304 4304 }, 4305 4305 "properties": 4306 {"street": "PAULARINO 2", "color": " lime", "perpx": "0.725068", "perpy": "-0.688678"}4306 {"street": "PAULARINO 2", "color": "yellow", "perpx": "0.725068", "perpy": "-0.688678"} 4307 4307 }, 4308 4308 { … … 4315 4315 }, 4316 4316 "properties": 4317 {"street": "PAULARINO 2", "color": " lime", "perpx": "0.719864", "perpy": "-0.694115"}4317 {"street": "PAULARINO 2", "color": "yellow", "perpx": "0.719864", "perpy": "-0.694115"} 4318 4318 }, 4319 4319 { … … 4755 4755 }, 4756 4756 "properties": 4757 {"street": "MACARTHU1", "color": " lime", "perpx": "-0.710326", "perpy": "0.703873"}4757 {"street": "MACARTHU1", "color": "red", "perpx": "-0.710326", "perpy": "0.703873"} 4758 4758 }, 4759 4759 { … … 4766 4766 }, 4767 4767 "properties": 4768 {"street": "MACARTHU2", "color": " lime", "perpx": "-0.710326", "perpy": "0.703873"}4768 {"street": "MACARTHU2", "color": "red", "perpx": "-0.710326", "perpy": "0.703873"} 4769 4769 }, 4770 4770 { … … 4777 4777 }, 4778 4778 "properties": 4779 {"street": "DYER 1", "color": " lime", "perpx": "0", "perpy": "0"}4779 {"street": "DYER 1", "color": "red", "perpx": "0", "perpy": "0"} 4780 4780 }, 4781 4781 { … … 4788 4788 }, 4789 4789 "properties": 4790 {"street": "DYER 2", "color": " lime", "perpx": "-0.708914", "perpy": "0.705295"}4790 {"street": "DYER 2", "color": "red", "perpx": "-0.708914", "perpy": "0.705295"} 4791 4791 }, 4792 4792 { … … 4799 4799 }, 4800 4800 "properties": 4801 {"street": "WARNER", "color": " lime", "perpx": "-0.711107", "perpy": "0.703084"}4801 {"street": "WARNER", "color": "red", "perpx": "-0.711107", "perpy": "0.703084"} 4802 4802 }, 4803 4803 { … … 4810 4810 }, 4811 4811 "properties": 4812 {"street": "EDINGER 1", "color": " lime", "perpx": "0", "perpy": "0"}4812 {"street": "EDINGER 1", "color": "yellow", "perpx": "0", "perpy": "0"} 4813 4813 }, 4814 4814 { … … 12013 12013 }, 12014 12014 "properties": 12015 {"street": "JAMBOREE1", "color": " lime", "perpx": "0.400805", "perpy": "0.916164"}12015 {"street": "JAMBOREE1", "color": "yellow", "perpx": "0.400805", "perpy": "0.916164"} 12016 12016 }, 12017 12017 { … … 12024 12024 }, 12025 12025 "properties": 12026 {"street": "JAMBOREE2", "color": " lime", "perpx": "0.400805", "perpy": "0.916164"}12026 {"street": "JAMBOREE2", "color": "red", "perpx": "0.400805", "perpy": "0.916164"} 12027 12027 }, 12028 12028 { … … 12035 12035 }, 12036 12036 "properties": 12037 {"street": "MACARTHUR 1", "color": " lime", "perpx": "0.408917", "perpy": "0.912572"}12037 {"street": "MACARTHUR 1", "color": "red", "perpx": "0.408917", "perpy": "0.912572"} 12038 12038 }, 12039 12039 { … … 12046 12046 }, 12047 12047 "properties": 12048 {"street": "AIRPORT", "color": " lime", "perpx": "0.321527", "perpy": "0.9469"}12048 {"street": "AIRPORT", "color": "red", "perpx": "0.321527", "perpy": "0.9469"} 12049 12049 }, 12050 12050 { … … 12057 12057 }, 12058 12058 "properties": 12059 {"street": "HOV AT 55N FLYOVER**", "color": " lime", "perpx": "0.271933", "perpy": "0.962316"}12059 {"street": "HOV AT 55N FLYOVER**", "color": "red", "perpx": "0.271933", "perpy": "0.962316"} 12060 12060 }, 12061 12061 { … … 12068 12068 }, 12069 12069 "properties": 12070 {"street": "RED HILL", "color": " lime", "perpx": "0.126754", "perpy": "0.991934"}12070 {"street": "RED HILL", "color": "red", "perpx": "0.126754", "perpy": "0.991934"} 12071 12071 }, 12072 12072 { -
trunk/webapps/unifiedlogger/cms_watcher.py
r431 r433 56 56 msgList[idx]['cms']['message']['phase2']['Line3']) 57 57 58 # Compare previous messages to current messages to look for changes 59 def compare(): 58 def setup(): 59 extractMessages(initialize()) 60 61 # compare previous messages to current messages to look for changes 62 def getLogEntries(): 60 63 global prevList, currList 61 64 msgList = readFile() … … 80 83 return results 81 84 82 def setup():83 msgList = initialize()84 extractMessages(msgList)85 86 85 def main(): 87 86 global currList … … 90 89 while True: 91 90 # Look for changed messages 92 answer = compare()91 answer = getLogEntries() 93 92 # Output results 94 93 for item in answer: -
trunk/webapps/unifiedlogger/logging_service.py
r431 r433 1 import cms_watcher, time, json1 import cms_watcher, cad_watcher, time, json 2 2 # Unified Logging Service 3 3 # jdalbey 7/6/2019 … … 16 16 17 17 def main(): 18 # Delete any previously existing output file 19 f = open("../dynamicdata/unifiedlog.html", "w") 20 startHTML = "<HTML><HEAD><meta http-equiv=\"refresh\" content=\"5\" /></HEAD><BODY><PRE>" 21 f.write(startHTML); 22 f.close() 18 23 # List of the available plugin modules 19 plugins = ["cms_watcher" ]24 plugins = ["cms_watcher","cad_watcher"] 20 25 #FOR each plugin LOOP 21 26 for plugin in plugins: 22 27 # dynamically load the setup function for this plugin 23 plugmodule = locals()[plugin]28 plugmodule = globals()[plugin] 24 29 setupfunc = getattr(plugmodule, 'setup') 25 30 #Call setup … … 33 38 # Reset Output Buffer 34 39 output = "" 40 results = [] 35 41 # FOR each plugin LOOP 36 42 for plugin in plugins: 37 43 # dynamically load the setup function for this plugin 38 plugmodule = locals()[plugin]39 comparefunc = getattr(plugmodule, 'compare')44 plugmodule = globals()[plugin] 45 getfunc = getattr(plugmodule, 'getLogEntries') 40 46 41 47 # Run the plugin process returning new log entries 42 results = comparefunc() # Look for changed messages 48 results = getfunc() 49 # Append simulation time and the log entries to the Output Buffer 50 for item in results: 51 trimmed_item = item.strip() 52 if len(trimmed_item) > 0: 53 output += timeStamp + " " + trimmed_item + "\n" 43 54 # END LOOP 44 # Append simulation time and the log entries to the Output Buffer45 for item in results:46 output += timeStamp + " " + item + "\n"47 55 # IF the Output Buffer has any contents THEN 48 56 if len(output) > 0: 49 57 # Write (append) Output Buffer to unified log file 50 print output 58 print output, 59 f = open("../dynamicdata/unifiedlog.html", "a") 60 f.write(output) 61 f.close() 51 62 # END IF 52 63 # Wait one second
Note: See TracChangeset
for help on using the changeset viewer.
