Changeset 471 in tmcsimulator for trunk/src/python


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.

Location:
trunk/src/python/unifiedlogger
Files:
3 edited

Legend:

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

    r467 r471  
    3636        if ex.errno == 2: 
    3737            # 'No such file or directory 
    38             print pathToLog + " missing: assuming reset" 
     38            print pathToLog + " missing: assuming reset." 
    3939            lastLineNum = 0   #Start over 
    4040            return [] 
     
    4848        if fileSize == 0: 
    4949            # Assume this is a read sync problem: Don't modify lastLineNum 
    50             print pathToLog+" is empty." 
     50            print pathToLog+" is empty, ignoring." 
    5151            return [] 
    5252        else: # file is good, read it. 
  • 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(): 
  • trunk/src/python/unifiedlogger/wing_project.wpr

    r470 r471  
    4646                 'full-screen': False, 
    4747                 'notebook_display': 'normal', 
    48                  'notebook_percent': 0.3472840605520926, 
     48                 'notebook_percent': 0.2564559216384684, 
    4949                 'override_title': None, 
    5050                 'pagelist': [('source-assistant', 
     
    8686                          1], 
    8787        'notebook_display': 'hidden', 
    88         'notebook_percent': 0.0, 
     88        'notebook_percent': 0.30000000000000004, 
    8989        'override_title': None, 
    9090        'pagelist': [('batch-search', 
     
    183183                       'toolbox-percent': 1.0, 
    184184                       'toolbox-tree-sel': ''})], 
    185         'primary_view_state': {'editor_states': ({'bookmarks': ([[loc('activitylog_watcher.py'), 
    186         {'attrib-starts': [('getLogEntries|0|', 
    187                             42)], 
    188          'code-line': '    return currList\n', 
    189          'first-line': 37L, 
     185        'primary_view_state': {'editor_states': ({'bookmarks': ([[loc('cad_watcher.py'), 
     186        {'attrib-starts': [('isFull|0|', 
     187                            16)], 
     188         'code-line': '\n', 
     189         'first-line': 27L, 
    190190         'folded-linenos': [], 
    191          'sel-line': 48L, 
    192          'sel-line-start': 1427L, 
    193          'selection_end': 1427L, 
    194          'selection_start': 1427L, 
     191         'sel-line': 18L, 
     192         'sel-line-start': 559L, 
     193         'selection_end': 559L, 
     194         'selection_start': 559L, 
    195195         'zoom': 0L}, 
    196         1563915907.118035], 
    197         [loc('logging_service.py'), 
    198          {'attrib-starts': [('startup|0|', 
    199                              20)], 
    200           'code-line': '                trimmed_item = item.strip()\n', 
    201           'first-line': 50L, 
    202           'folded-linenos': [], 
    203           'sel-line': 57L, 
    204           'sel-line-start': 1955L, 
    205           'selection_end': 1955L, 
    206           'selection_start': 1955L, 
    207           'zoom': 0L}, 
    208          1563915945.26135], 
    209         [loc('activitylog_watcher.py'), 
    210          {'attrib-starts': [('getLogEntries|0|', 
    211                              42)], 
    212           'code-line': '    currList = []\n', 
    213           'first-line': 37L, 
    214           'folded-linenos': [], 
    215           'sel-line': 45L, 
    216           'sel-line-start': 1303L, 
    217           'selection_end': 1303L, 
    218           'selection_start': 1303L, 
    219           'zoom': 0L}, 
    220          1563916207.12504], 
    221         [loc('cms_watcher.py'), 
    222          {'attrib-starts': [('readFile|0|', 
    223                              18)], 
    224           'code-line': ' \n', 
    225           'first-line': 6L, 
    226           'folded-linenos': [], 
    227           'sel-line': 21L, 
    228           'sel-line-start': 564L, 
    229           'selection_end': 565L, 
    230           'selection_start': 565L, 
    231           'zoom': 0L}, 
    232          1563916220.372856], 
    233         [loc('activitylog_watcher.py'), 
    234          {'attrib-starts': [('getLogEntries|0|', 
    235                              42)], 
    236           'code-line': '    resultList = []\n', 
    237           'first-line': 40L, 
    238           'folded-linenos': [], 
    239           'sel-line': 48L, 
    240           'sel-line-start': 1422L, 
    241           'selection_end': 1422L, 
    242           'selection_start': 1422L, 
    243           'zoom': 0L}, 
    244          1564099965.745285], 
    245         [loc('cad_watcher.py'), 
    246          {'attrib-starts': [('isFull|0|', 
    247                              16)], 
    248           'code-line': '\n', 
    249           'first-line': 3L, 
    250           'folded-linenos': [], 
    251           'sel-line': 18L, 
    252           'sel-line-start': 559L, 
    253           'selection_end': 559L, 
    254           'selection_start': 559L, 
    255           'zoom': 0L}, 
    256          1564102192.752733], 
    257         [loc('__main__.py'), 
    258          {'attrib-starts': [], 
    259           'code-line': 'import logging_service, os, ConfigParser\n', 
    260           'first-line': 0L, 
    261           'folded-linenos': [], 
    262           'sel-line': 0L, 
    263           'sel-line-start': 0L, 
    264           'selection_end': 40L, 
    265           'selection_start': 28L, 
    266           'zoom': 0L}, 
    267          1564182621.22245], 
    268         [loc('logging_service.py'), 
    269          {'attrib-starts': [('startup|0|', 
    270                              20)], 
    271           'code-line': '            # dynamically load the get log function '\ 
    272                        'for this plugin\n', 
    273           'first-line': 38L, 
    274           'folded-linenos': [], 
    275           'sel-line': 49L, 
    276           'sel-line-start': 1561L, 
    277           'selection_end': 1603L, 
    278           'selection_start': 1603L, 
    279           'zoom': 0L}, 
    280          1564182682.881746], 
    281         [loc('cad_watcher.py'), 
    282          {'attrib-starts': [('isFull|0|', 
    283                              16)], 
    284           'code-line': '\n', 
    285           'first-line': 27L, 
    286           'folded-linenos': [], 
    287           'sel-line': 18L, 
    288           'sel-line-start': 559L, 
    289           'selection_end': 559L, 
    290           'selection_start': 559L, 
    291           'zoom': 0L}, 
    292          1564182715.806107], 
     196        1564182715.806107], 
    293197        [loc('logging_service.py'), 
    294198         {'attrib-starts': [('startup|0|', 
     
    424328          'selection_start': 1613L, 
    425329          'zoom': 0L}, 
    426          1564324057.330601]], 
     330         1564324057.330601], 
     331        [loc('activitylog_watcher.py'), 
     332         {'attrib-starts': [('getLogEntries|0|', 
     333                             42)], 
     334          'code-line': '        desiredFields = "Activity Log.,"+name+","+co'\ 
     335                       'de+","+msg\n', 
     336          'first-line': 33L, 
     337          'folded-linenos': [], 
     338          'sel-line': 55L, 
     339          'sel-line-start': 1666L, 
     340          'selection_end': 1728L, 
     341          'selection_start': 1728L, 
     342          'zoom': 0L}, 
     343         1564408367.809524], 
     344        [loc('cad_watcher.py'), 
     345         {'attrib-starts': [('getLogEntries|0|', 
     346                             24)], 
     347          'code-line': "            msgList = text_file.read().split('\\n')"\ 
     348                       "\n", 
     349          'first-line': 38L, 
     350          'folded-linenos': [], 
     351          'sel-line': 52L, 
     352          'sel-line-start': 1613L, 
     353          'selection_end': 1613L, 
     354          'selection_start': 1613L, 
     355          'zoom': 0L}, 
     356         1564408386.133798], 
     357        [loc('logging_service.py'), 
     358         {'attrib-starts': [('startup|0|', 
     359                             20)], 
     360          'code-line': '    #       Append simulation time and the log entri'\ 
     361                       'es to the Output Buffer\n', 
     362          'first-line': 15L, 
     363          'folded-linenos': [], 
     364          'sel-line': 55L, 
     365          'sel-line-start': 1843L, 
     366          'selection_end': 1851L, 
     367          'selection_start': 1851L, 
     368          'zoom': 0L}, 
     369         1564408404.830956], 
     370        [loc('cad_watcher.py'), 
     371         {'attrib-starts': [('getLogEntries|0|', 
     372                             24)], 
     373          'code-line': '            print pathToLog + " missing: assuming re'\ 
     374                       'set."\n', 
     375          'first-line': 35L, 
     376          'folded-linenos': [], 
     377          'sel-line': 37L, 
     378          'sel-line-start': 1087L, 
     379          'selection_end': 1143L, 
     380          'selection_start': 1143L, 
     381          'zoom': 0L}, 
     382         1564436972.290038], 
     383        [loc('logging_service.py'), 
     384         {'attrib-starts': [('startup|0|', 
     385                             20)], 
     386          'code-line': '    #       Append simulation time and the log entri'\ 
     387                       'es to the Output Buffer\n', 
     388          'first-line': 0L, 
     389          'folded-linenos': [], 
     390          'sel-line': 55L, 
     391          'sel-line-start': 1843L, 
     392          'selection_end': 1851L, 
     393          'selection_start': 1851L, 
     394          'zoom': 0L}, 
     395         1564436998.714792], 
     396        [loc('cad_watcher.py'), 
     397         {'attrib-starts': [('getLogEntries|0|', 
     398                             24)], 
     399          'code-line': '            print pathToLog + " missing: assuming re'\ 
     400                       'set."\n', 
     401          'first-line': 20L, 
     402          'folded-linenos': [], 
     403          'sel-line': 37L, 
     404          'sel-line-start': 1087L, 
     405          'selection_end': 1143L, 
     406          'selection_start': 1143L, 
     407          'zoom': 0L}, 
     408         1564437041.061947], 
     409        [loc('logging_service.py'), 
     410         {'attrib-starts': [('getSimTime|0|', 
     411                             13)], 
     412          'code-line': '\n', 
     413          'first-line': 0L, 
     414          'folded-linenos': [], 
     415          'sel-line': 24L, 
     416          'sel-line-start': 789L, 
     417          'selection_end': 789L, 
     418          'selection_start': 789L, 
     419          'zoom': 0L}, 
     420         1564438151.528836], 
     421        [loc('cad_watcher.py'), 
     422         {'attrib-starts': [('getLogEntries|0|', 
     423                             24)], 
     424          'code-line': '            print pathToLog + " missing: assuming re'\ 
     425                       'set."\n', 
     426          'first-line': 32L, 
     427          'folded-linenos': [], 
     428          'sel-line': 37L, 
     429          'sel-line-start': 1087L, 
     430          'selection_end': 1143L, 
     431          'selection_start': 1143L, 
     432          'zoom': 0L}, 
     433         1564438185.449366]], 
    427434        20), 
    428         'current-loc': loc('activitylog_watcher.py'), 
     435        'current-loc': loc('logging_service.py'), 
    429436        'editor-state-list': [(loc('activitylog_watcher.py'), 
    430437                               {'attrib-starts': [('getLogEntries|0|', 
     
    442449                               {'attrib-starts': [('getLogEntries|0|', 
    443450        24)], 
    444                                 'code-line': "            msgList = text_fil"\ 
    445         "e.read().split('\\n')\n", 
    446                                 'first-line': 29L, 
     451                                'code-line': '            print pathToLog + '\ 
     452        '" missing: assuming reset."\n', 
     453                                'first-line': 32L, 
    447454                                'folded-linenos': [], 
    448                                 'sel-line': 52L, 
    449                                 'sel-line-start': 1613L, 
    450                                 'selection_end': 1613L, 
    451                                 'selection_start': 1613L, 
     455                                'sel-line': 37L, 
     456                                'sel-line-start': 1087L, 
     457                                'selection_end': 1143L, 
     458                                'selection_start': 1143L, 
    452459                                'zoom': 0L}), 
    453460                              (loc('cms_watcher.py'), 
     
    473480                                'zoom': 0L}), 
    474481                              (loc('logging_service.py'), 
    475                                {'attrib-starts': [('startup|0|', 
    476         20)], 
    477                                 'code-line': '    #       Append simulation '\ 
    478         'time and the log entries to the Output Buffer\n', 
    479                                 'first-line': 21L, 
     482                               {'attrib-starts': [('getSimTime|0|', 
     483        13)], 
     484                                'code-line': '       print "Proceeding with '\ 
     485        'previous time: ", toHMS(seconds)\n', 
     486                                'first-line': 0L, 
    480487                                'folded-linenos': [], 
    481                                 'sel-line': 55L, 
    482                                 'sel-line-start': 1843L, 
    483                                 'selection_end': 1851L, 
    484                                 'selection_start': 1851L, 
     488                                'sel-line': 21L, 
     489                                'sel-line-start': 649L, 
     490                                'selection_end': 649L, 
     491                                'selection_start': 649L, 
    485492                                'zoom': 0L}), 
    486493                              (loc('__main__.py'), 
     
    495502                                'selection_start': 28L, 
    496503                                'zoom': 0L})], 
    497         'has-focus': False, 
     504        'has-focus': True, 
    498505        'locked': False}, 
    499506        [loc('activitylog_watcher.py'), 
     
    506513        u'__main__.py', 
    507514        u'cms_watcher.py', 
    508         u'logging_service.py', 
     515        u'activitylog_watcher.py', 
    509516        u'cad_watcher.py', 
    510         u'activitylog_watcher.py']}, 
     517        u'logging_service.py']}, 
    511518        'saved_notebook_display': None, 
    512519        'split_percents': {0: 0.5}, 
     
    515522        'traversal_pos': ((0, 
    516523                           3), 
    517                           1564287665.60169), 
     524                          1564437523.022983), 
    518525        'user_data': {}}, 
    519526                 'saved_notebook_display': None, 
     
    523530                 'traversal_pos': ((0, 
    524531                                    4), 
    525                                    1564325707.122876), 
     532                                   1564438041.344573), 
    526533                 'user_data': {}}, 
    527534        'window-alloc': (29, 
     
    529536                         1197, 
    530537                         722)}]} 
    531 guimgr.recent-documents = [loc('activitylog_watcher.py'), 
     538guimgr.recent-documents = [loc('logging_service.py'), 
    532539                           loc('cad_watcher.py'), 
    533                            loc('logging_service.py'), 
     540                           loc('activitylog_watcher.py'), 
    534541                           loc('__main__.py'), 
    535542                           loc('cms_watcher.py'), 
Note: See TracChangeset for help on using the changeset viewer.