Changeset 1001 for trunk


Ignore:
Timestamp:
11/21/12 10:09:02 (12 years ago)
Author:
fglaser
Message:
  • added event timestamp handling for JFCMonitor and JFCSimplifiedLogParser
  • jfc log files now contain event timestamp as param child of event element
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/autoquest-jfcmonitor/src/main/java/de/ugoe/cs/autoquest/jfcmonitor/JFCListener.java

    r932 r1001  
    8080                    "\" />" + StringTools.ENDLINE); 
    8181                addSourceInfo(builder, event); 
     82                addTimestampInfo(builder); 
    8283                builder.append("</event>" + StringTools.ENDLINE); 
    8384            } 
     
    9293                    "\" />" + StringTools.ENDLINE); 
    9394                addSourceInfo(builder, event); 
     95                addTimestampInfo(builder); 
    9496                builder.append("</event>" + StringTools.ENDLINE); 
    9597            } 
     
    99101                builder.append("<event id=\"" + event.getID() + "\">" + StringTools.ENDLINE); 
    100102                addSourceInfo(builder, event); 
     103                addTimestampInfo(builder); 
    101104                builder.append("</event>" + StringTools.ENDLINE); 
    102105            } 
     
    125128        builder.append(" />" + StringTools.ENDLINE); 
    126129    } 
     130     
     131    /** 
     132     * <p> 
     133     * Appends timestamp information of the event to a {@link StringBuilder}. 
     134     * </p> 
     135     *  
     136     * @param builder 
     137     *                  {@link StringBuilder} where the information is appended 
     138     */ 
     139    private void addTimestampInfo(StringBuilder builder){ 
     140        long timestamp = System.currentTimeMillis(); 
     141        builder.append(" <param name=\"timestamp\""); 
     142        builder.append(" value=\"" + Long.toString(timestamp) + "\"/>"); 
     143        builder.append(StringTools.ENDLINE); 
     144    } 
    127145 
    128146    /** 
  • trunk/autoquest-plugin-jfc/src/main/java/de/ugoe/cs/autoquest/plugin/jfc/JFCSimplifiedLogParser.java

    r990 r1001  
    9090    /** 
    9191     * <p> 
    92      * Internal handle to the parameters of the event that is currently being parsed. 
     92     * Internal handle to the source of the event that is currently being parsed. 
    9393     * </p> 
    9494     */ 
    9595    private Integer currentEventSource; 
     96     
     97    /** 
     98     * <p> 
     99     * Internal handle to the timestamp of the event that is currently being parsed. 
     100     */ 
     101    private Long currentEventTimestamp = -1l; 
    96102      
    97103    /** 
     
    335341                        if ("source".equals(atts.getValue("name"))){ 
    336342                                currentEventSource = (int) Long.parseLong(atts.getValue("value"), 16); 
     343                        } 
     344                        if ("timestamp".equals(atts.getValue("name"))){ 
     345                                currentEventTimestamp = Long.parseLong(atts.getValue("value")); 
    337346                        } 
    338347                currentEventParameters.put(atts.getValue("name"), atts.getValue("value")); 
     
    397406                    (instantiateInteraction(currentEventId, currentEventParameters), 
    398407                     (currentGUIElement == null ? lastGUIElement : currentGUIElement)); 
     408                event.setTimestamp(currentEventTimestamp); 
    399409                 
    400410                currentSequence.add(event); 
     
    402412                currentEventParameters = null; 
    403413                currentEventId = null; 
     414                currentEventTimestamp = -1l; 
    404415                 
    405416                if (currentGUIElement != null) { 
Note: See TracChangeset for help on using the changeset viewer.