Changeset 433 in tmcsimulator for trunk


Ignore:
Timestamp:
07/07/2019 11:17:08 AM (7 years ago)
Author:
jdalbey
Message:

Unified Logger v1.0. Add cad watcher plugin to logging service.

Location:
trunk
Files:
5 added
4 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/webapps/common/js/revision_number.dat

    r429 r433  
    11 
    2     var revisionNumber = "426"; 
     2    var revisionNumber = "431"; 
    33     
  • trunk/webapps/dynamicdata/highway_status.json

    r429 r433  
    43044304       }, 
    43054305   "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"} 
    43074307},   
    43084308{ 
     
    43154315       }, 
    43164316   "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"} 
    43184318},   
    43194319{ 
     
    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{ 
     
    47884788       }, 
    47894789   "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"} 
    47914791},   
    47924792{ 
     
    47994799       }, 
    48004800   "properties":  
    4801        {"street": "WARNER", "color": "lime", "perpx": "-0.711107", "perpy": "0.703084"} 
     4801       {"street": "WARNER", "color": "red", "perpx": "-0.711107", "perpy": "0.703084"} 
    48024802},   
    48034803{ 
     
    48104810       }, 
    48114811   "properties":  
    4812        {"street": "EDINGER 1", "color": "lime", "perpx": "0", "perpy": "0"} 
     4812       {"street": "EDINGER 1", "color": "yellow", "perpx": "0", "perpy": "0"} 
    48134813},   
    48144814{ 
     
    1201312013       }, 
    1201412014   "properties":  
    12015        {"street": "JAMBOREE1", "color": "lime", "perpx": "0.400805", "perpy": "0.916164"} 
     12015       {"street": "JAMBOREE1", "color": "yellow", "perpx": "0.400805", "perpy": "0.916164"} 
    1201612016},   
    1201712017{ 
     
    1202412024       }, 
    1202512025   "properties":  
    12026        {"street": "JAMBOREE2", "color": "lime", "perpx": "0.400805", "perpy": "0.916164"} 
     12026       {"street": "JAMBOREE2", "color": "red", "perpx": "0.400805", "perpy": "0.916164"} 
    1202712027},   
    1202812028{ 
     
    1203512035       }, 
    1203612036   "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"} 
    1203812038},   
    1203912039{ 
     
    1204612046       }, 
    1204712047   "properties":  
    12048        {"street": "AIRPORT", "color": "lime", "perpx": "0.321527", "perpy": "0.9469"} 
     12048       {"street": "AIRPORT", "color": "red", "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": "red", "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": "red", "perpx": "0.126754", "perpy": "0.991934"} 
    1207112071},   
    1207212072{ 
  • trunk/webapps/unifiedlogger/cms_watcher.py

    r431 r433  
    5656                    msgList[idx]['cms']['message']['phase2']['Line3']) 
    5757 
    58 # Compare previous messages to current messages to look for changes 
    59 def compare(): 
     58def setup(): 
     59     extractMessages(initialize()) 
     60 
     61# compare previous messages to current messages to look for changes 
     62def getLogEntries(): 
    6063     global prevList, currList 
    6164     msgList = readFile() 
     
    8083     return results 
    8184 
    82 def setup(): 
    83      msgList = initialize() 
    84      extractMessages(msgList) 
    85  
    8685def main(): 
    8786     global currList 
     
    9089     while True: 
    9190          # Look for changed messages 
    92           answer = compare() 
     91          answer = getLogEntries() 
    9392          # Output results 
    9493          for item in answer: 
  • trunk/webapps/unifiedlogger/logging_service.py

    r431 r433  
    1 import cms_watcher, time, json 
     1import cms_watcher, cad_watcher, time, json 
    22# Unified Logging Service 
    33# jdalbey 7/6/2019 
     
    1616 
    1717def 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()             
    1823    # List of the available plugin modules  
    19     plugins = ["cms_watcher"] 
     24    plugins = ["cms_watcher","cad_watcher"] 
    2025    #FOR each plugin LOOP 
    2126    for plugin in plugins: 
    2227        # dynamically load the setup function for this plugin 
    23         plugmodule = locals()[plugin] 
     28        plugmodule = globals()[plugin] 
    2429        setupfunc = getattr(plugmodule, 'setup') 
    2530        #Call setup 
     
    3338    #    Reset Output Buffer 
    3439        output = "" 
     40        results = [] 
    3541    #    FOR each plugin LOOP 
    3642        for plugin in plugins: 
    3743            # 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') 
    4046             
    4147    #        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" 
    4354    #    END LOOP 
    44     #    Append simulation time and the log entries to the Output Buffer 
    45         for item in results: 
    46             output += timeStamp + " " + item + "\n" 
    4755    #    IF the Output Buffer has any contents THEN 
    4856        if len(output) > 0: 
    4957    #       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()             
    5162    #    END IF 
    5263    #    Wait one second 
Note: See TracChangeset for help on using the changeset viewer.