Skip to content

Commit

Permalink
Add SampleTime field to ASH raw data viewer..
Browse files Browse the repository at this point in the history
  • Loading branch information
akardapolov committed Aug 26, 2016
1 parent 25dacfb commit 33bba4f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/org/ash/history/ASHDatabaseH.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
import java.io.File;
import java.io.IOException;
import java.sql.SQLException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;

/**
Expand Down Expand Up @@ -439,6 +441,7 @@ public DefaultTableModel getASHRawData(double begin, double end) throws Database

DefaultTableModel model = new DefaultTableModel(new String[] {
"SampleID",
"SampleTime",
"SessionID",
"SessionSerial",
"Username",
Expand Down Expand Up @@ -498,6 +501,11 @@ public DefaultTableModel getASHRawData(double begin, double end) throws Database
while (ashIdTimeIter.hasNext()) {
AshIdTime ashIdTimeMain = ashIdTimeIter.next();

Long sampleTimeLong = (long) ashIdTimeMain.getsampleTime();
Date td = new Date(sampleTimeLong.longValue());
DateFormat df = new SimpleDateFormat("dd.MM.yyyy HH.mm.ss");
String reportDateStr = df.format(td);

/* Do a filter on ActiveSessionHistory by SampleID (detail). */
EntityCursor<ActiveSessionHistory> ActiveSessionHistoryCursor =
dao.getActiveSessionHistoryByAshId().subIndex(ashIdTimeMain.getsampleId()).entities();
Expand All @@ -513,6 +521,7 @@ public DefaultTableModel getASHRawData(double begin, double end) throws Database

model.addRow(new Object[] {
ASH.getSampleId(),
reportDateStr,
ASH.getSessionId(),
(long)ASH.getSessionSerial(),
username,
Expand Down

0 comments on commit 33bba4f

Please sign in to comment.