Changeset 47 in tmcsimulator for trunk/src/tmcsim/paramicscommunicator/ParamicsFileReader.java
- Timestamp:
- 06/28/2016 02:25:42 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/tmcsim/paramicscommunicator/ParamicsFileReader.java
r40 r47 5 5 import java.io.FileWriter; 6 6 import java.io.IOException; 7 import java.text.SimpleDateFormat; 7 8 import java.util.Observable; 8 9 import java.util.Timer; … … 67 68 */ 68 69 private long readerInterval; 70 /** 71 * Time formatter for diagnostic messages 72 */ 73 private SimpleDateFormat formatter; 69 74 70 75 /** … … 80 85 public void run() 81 86 { 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 85 91 if (lastModified < inputFile.lastModified()) 86 92 { 87 // paramLogger.logp(Level.INFO,88 // "ParamicsFileReader.ReaderTimerTask", "run()",89 // "Cool, " + inputFile + " has been modified, let's read it.");90 93 91 94 try … … 101 104 Element messageElem = readerDoc.createElement(PARAMICS_COMM_TAGS.MESSAGE.tag); 102 105 String fileContents = readFromFile(); 103 // int stringlen = Math.min(160, fileContents.length()-1);104 // Log two lines that were read105 // paramLogger.logp(Level.INFO,106 // "ParamicsFileReader.ReaderTimerTask", "run()",107 // "Nice, we read " + fileContents.length() + " bytes.");108 106 messageElem.appendChild(readerDoc.createTextNode(fileContents)); 109 107 readerElem.appendChild(messageElem); … … 142 140 try 143 141 { 142 formatter = new SimpleDateFormat("HH:mm:ss"); 144 143 readerID = id; 145 144 readerInterval = interval; … … 159 158 { 160 159 paramLogger.logp(Level.SEVERE, "ParamicsFileReader", 161 "Constructor()", "Exception in initializing file reading .", ioe);160 "Constructor()", "Exception in initializing file reading of "+workingDir + targetFile, ioe); 162 161 } 163 162 } … … 194 193 195 194 lastModified = inputFile.lastModified(); 195 // System.out.println( 196 // "Read from a file last modified at " + formatter.format(lastModified)); 196 197 197 198 setChanged();
Note: See TracChangeset
for help on using the changeset viewer.
