Ignore:
Timestamp:
06/28/2016 02:25:42 PM (10 years ago)
Author:
jdalbey
Message:

Merge 305 modifications into trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/tmcsim/paramicscommunicator/ParamicsFileReader.java

    r40 r47  
    55import java.io.FileWriter; 
    66import java.io.IOException; 
     7import java.text.SimpleDateFormat; 
    78import java.util.Observable; 
    89import java.util.Timer; 
     
    6768     */ 
    6869    private long readerInterval; 
     70    /** 
     71     * Time formatter for diagnostic messages 
     72     */ 
     73    private SimpleDateFormat formatter; 
    6974 
    7075    /** 
     
    8085        public void run() 
    8186        { 
    82 //            paramLogger.logp(Level.INFO, 
    83 //                    "ParamicsFileReader.ReaderTimerTask", "run()", 
    84 //                    "Waiting for " + inputFile + " to be modified."); 
     87//            System.out.println( 
     88//                    "Checking last modified time on " + inputFile.getName() 
     89//                    + formatter.format(lastModified) + ":" + formatter.format(inputFile.lastModified())); 
     90 
    8591            if (lastModified < inputFile.lastModified()) 
    8692            { 
    87 //                paramLogger.logp(Level.INFO, 
    88 //                        "ParamicsFileReader.ReaderTimerTask", "run()", 
    89 //                        "Cool, " + inputFile + " has been modified, let's read it."); 
    9093 
    9194                try 
     
    101104                    Element messageElem = readerDoc.createElement(PARAMICS_COMM_TAGS.MESSAGE.tag); 
    102105                    String fileContents = readFromFile(); 
    103  //                   int stringlen = Math.min(160, fileContents.length()-1); 
    104                     // Log two lines that were read 
    105 //                    paramLogger.logp(Level.INFO, 
    106 //                            "ParamicsFileReader.ReaderTimerTask", "run()", 
    107 //                            "Nice, we read " + fileContents.length() + " bytes."); 
    108106                    messageElem.appendChild(readerDoc.createTextNode(fileContents)); 
    109107                    readerElem.appendChild(messageElem); 
     
    142140        try 
    143141        { 
     142            formatter = new SimpleDateFormat("HH:mm:ss"); 
    144143            readerID = id; 
    145144            readerInterval = interval; 
     
    159158        { 
    160159            paramLogger.logp(Level.SEVERE, "ParamicsFileReader", 
    161                     "Constructor()", "Exception in initializing file reading.", ioe); 
     160                    "Constructor()", "Exception in initializing file reading of "+workingDir + targetFile, ioe); 
    162161        } 
    163162    } 
     
    194193 
    195194        lastModified = inputFile.lastModified(); 
     195//        System.out.println( 
     196//                "Read from a file last modified at " + formatter.format(lastModified)); 
    196197 
    197198        setChanged(); 
Note: See TracChangeset for help on using the changeset viewer.