Changeset 642 in tmcsimulator for branches/LCSv2/controllers


Ignore:
Timestamp:
03/15/2021 04:49:10 PM (5 years ago)
Author:
jdalbey
Message:

LCS revise format of log file messages

Location:
branches/LCSv2/controllers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/LCSv2/controllers/default.py

    r641 r642  
    11# added comments for testing 
    22# Constants 
    3 kLogfile = "LCSlogfile.txt" 
     3kLogfile = "../TMCrepo/trunk/webapps/dynamicdata/LCSlogfile.txt" 
    44kSimtimefile = "sim_elapsedtime.json"  #"../webapps/dynamicdata/sim_elapsed_time.json" 
    55hwys = ['','1','5', '22', '55', '57', '73', '74', '91', '133', '142', '241', '261', '405', '605'] 
     
    198198            db(db.closures.closureid == session.statustype[4:]).update(**{fieldname:now.strftime("%H%M")}) 
    199199            # Log the update to external file 
    200             logmessage = getSimTime() + ", LCS status update: " + session.username + ", " + session.statustype[4:] + ", " + session.statustype[0:4] + ", " + session.statuser + " " + "\n" 
     200            logmessage = getSimTime() + ", LCS status update, " + session.username + ", " + session.statustype[4:] + " / " + session.statustype[0:4] + " / " + session.statuser + "\n" 
    201201            text_file = open(kLogfile, "a") 
    202202            text_file.write(logmessage) 
     
    323323        session.flash = 'New lane closure added: ' + newID + ' ' + newLognum + ': ' + selectedlanes 
    324324        # Log the new closure to external file. Username, closureID, route, dir, type of closure, type of work 
    325         logmessage = getSimTime() + ", LCS new closure: " + session.username + ", " + newID + '.' + newLognum + ', ' + form.vars.route + form.vars.direction + ', ' + form.vars.closuretype + ', ' + form.vars.worktype + "\n" 
     325        logmessage = getSimTime() + ", LCS new closure, " + session.username + ", " + newID + '.' + newLognum + ' / ' + form.vars.route + form.vars.direction + ' / ' + form.vars.closuretype + ' / ' + form.vars.worktype + "\n" 
    326326        text_file = open(kLogfile, "a") 
    327327        text_file.write(logmessage) 
  • branches/LCSv2/controllers/default.py.bak

    r641 r642  
    11# added comments for testing 
    22# Constants 
    3 kLogfile = "samplelogfile.txt" 
     3kLogfile = "LCSlogfile.txt" 
    44kSimtimefile = "sim_elapsedtime.json"  #"../webapps/dynamicdata/sim_elapsed_time.json" 
    55hwys = ['','1','5', '22', '55', '57', '73', '74', '91', '133', '142', '241', '261', '405', '605'] 
     
    1717        if len(item) > 0: 
    1818            users.append(item) 
     19    # build the form 
    1920    form = FORM(LABEL('User:',_for='username', _class="label username-label"), 
    2021                #INPUT(_name='username', _size='15', _style="font-size: 18px;"), BR(), 
     
    197198            db(db.closures.closureid == session.statustype[4:]).update(**{fieldname:now.strftime("%H%M")}) 
    198199            # Log the update to external file 
    199             logmessage = getSimTime() + ", LCS status update: " + session.username + ", " + session.statustype[4:] + ", " + session.statustype[0:4] + ", " + session.statuser + " " + "\n" 
     200            logmessage = getSimTime() + ", LCS status update, " + session.username + ", " + session.statustype[4:] + " / " + session.statustype[0:4] + " / " + session.statuser + "\n" 
    200201            text_file = open(kLogfile, "a") 
    201202            text_file.write(logmessage) 
     
    322323        session.flash = 'New lane closure added: ' + newID + ' ' + newLognum + ': ' + selectedlanes 
    323324        # Log the new closure to external file. Username, closureID, route, dir, type of closure, type of work 
    324         logmessage = getSimTime() + ", LCS new closure: " + session.username + ", " + newID + '.' + newLognum + ', ' + form.vars.route + form.vars.direction + ', ' + form.vars.closuretype + ', ' + form.vars.worktype + "\n" 
     325        logmessage = getSimTime() + ", LCS new closure, " + session.username + ", " + newID + '.' + newLognum + ' / ' + form.vars.route + form.vars.direction + ' / ' + form.vars.closuretype + ' / ' + form.vars.worktype + "\n" 
    325326        text_file = open(kLogfile, "a") 
    326327        text_file.write(logmessage) 
Note: See TracChangeset for help on using the changeset viewer.