Ignore:
Timestamp:
07/29/2019 01:36:40 PM (7 years ago)
Author:
jdalbey
Message:

Coordinator.java: Fix defect 181 in sorting CADcomments. logging_service error messages improved.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/python/unifiedlogger/logging_service.py

    r466 r471  
    44 
    55outputFilename = "unifiedlog.csv" 
    6  
     6seconds = 0 
     7# convert seconds to H:MM:SS 
     8def toHMS(seconds): 
     9    m, s = divmod(int(seconds), 60) 
     10    h, m = divmod(m, 60) 
     11    return  "%d:%02d:%02d" % (h, m, s)     
     12     
    713# Load the sim time file and extract the seconds */ 
    814def getSimTime(): 
     15    global seconds     
    916    with open ("webapps/dynamicdata/sim_elapsedtime.json", 'r') as myfile: 
    1017        jsonData=myfile.read() 
    11     seconds = 0 
    1218    try:      
    1319       seconds = json.loads(jsonData)['elapsedtime'] 
    1420    except: 
    15        print "Error loading json for elapsed time" 
     21       print "Unable to read sim time. ", 
     22       print "Proceeding with previous time: ", toHMS(seconds) 
    1623    # convert seconds to H:MM:SS 
    17     m, s = divmod(int(seconds), 60) 
    18     h, m = divmod(m, 60) 
    19     return  "%d:%02d:%02d" % (h, m, s)     
     24    return toHMS(seconds) 
    2025 
    2126def startup(): 
Note: See TracChangeset for help on using the changeset viewer.