Browse Source

Merge branch 'release/2.12.0'

master
Eyck Jentzsch 2 months ago
parent
commit
5604c3ee5e
54 changed files with 476 additions and 467 deletions
  1. +1
    -1
      features/com.minres.scviewer.database.feature/pom.xml
  2. +1
    -1
      features/com.minres.scviewer.e4.feature/pom.xml
  3. +1
    -1
      features/com.minres.scviewer.e4.platform.feature/pom.xml
  4. +1
    -1
      features/com.minres.scviewer.feature/pom.xml
  5. +1
    -1
      features/com.minres.scviewer.ui.feature/pom.xml
  6. +1
    -1
      plugins/com.minres.scviewer.database.sqlite/pom.xml
  7. +9
    -2
      plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/AbstractTxStream.java
  8. +0
    -1
      plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/SQLiteDbLoader.java
  9. +2
    -4
      plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/Tx.java
  10. +6
    -0
      plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxEvent.java
  11. +1
    -7
      plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxGenerator.java
  12. +1
    -2
      plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxStream.java
  13. +1
    -1
      plugins/com.minres.scviewer.database.text/pom.xml
  14. +53
    -27
      plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/AbstractTxStream.java
  15. +80
    -89
      plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TextDbLoader.java
  16. +38
    -38
      plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/Tx.java
  17. +10
    -0
      plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TxEvent.java
  18. +1
    -21
      plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TxGenerator.java
  19. +0
    -36
      plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TxStream.java
  20. +1
    -1
      plugins/com.minres.scviewer.database.ui.swt/pom.xml
  21. +48
    -7
      plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/ArrowPainter.java
  22. +38
    -41
      plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/StreamPainter.java
  23. +15
    -7
      plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/WaveformCanvas.java
  24. +12
    -11
      plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/WaveformView.java
  25. +1
    -1
      plugins/com.minres.scviewer.database.vcd/pom.xml
  26. +1
    -1
      plugins/com.minres.scviewer.database.vcd/src/com/minres/scviewer/database/vcd/VCDDbLoader.java
  27. +1
    -1
      plugins/com.minres.scviewer.database.vcd/src/com/minres/scviewer/database/vcd/VCDSignal.java
  28. +1
    -1
      plugins/com.minres.scviewer.database/pom.xml
  29. +3
    -2
      plugins/com.minres.scviewer.database/src/com/minres/scviewer/database/IWaveform.java
  30. +17
    -17
      plugins/com.minres.scviewer.database/src/com/minres/scviewer/database/internal/WaveformDb.java
  31. +1
    -8
      plugins/com.minres.scviewer.database/src/com/minres/scviewer/database/tx/ITx.java
  32. +8
    -0
      plugins/com.minres.scviewer.database/src/com/minres/scviewer/database/tx/ITxEvent.java
  33. +0
    -27
      plugins/com.minres.scviewer.database/src/com/minres/scviewer/database/tx/ITxGenerator.java
  34. +1
    -1
      plugins/com.minres.scviewer.e4.application/META-INF/MANIFEST.MF
  35. BIN
      plugins/com.minres.scviewer.e4.application/icons/lightbulb_off.png
  36. BIN
      plugins/com.minres.scviewer.e4.application/icons/stream.png
  37. BIN
      plugins/com.minres.scviewer.e4.application/icons/stream_hier.png
  38. +1
    -2
      plugins/com.minres.scviewer.e4.application/pom.xml
  39. +1
    -0
      plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/internal/status/HeapStatus.java
  40. +2
    -2
      plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/DesignBrowser.java
  41. +40
    -49
      plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/TransactionList.java
  42. +15
    -4
      plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/provider/TxDbLabelProvider.java
  43. +1
    -1
      plugins/com.minres.scviewer.ui/pom.xml
  44. +1
    -1
      plugins/com.minres.scviewer.ui/src/com/minres/scviewer/ui/views/provider/TxDbTreeLabelProvider.java
  45. +15
    -2
      pom.xml
  46. +3
    -3
      products/com.minres.scviewer.e4.product/pom.xml
  47. +2
    -2
      products/com.minres.scviewer.e4.product/scviewer.product
  48. +1
    -1
      releng/com.minres.scviewer.target/pom.xml
  49. +2
    -16
      releng/com.minres.scviewer.updateSite/pom.xml
  50. +4
    -4
      tests/com.minres.scviewer.database.test/DatabaseServicesTest.launch
  51. +1
    -1
      tests/com.minres.scviewer.database.test/OSGI-INF/component.xml
  52. +1
    -1
      tests/com.minres.scviewer.database.test/pom.xml
  53. +5
    -18
      tests/com.minres.scviewer.database.test/src/com/minres/scviewer/database/test/DatabaseServicesTest.java
  54. +25
    -0
      tests/com.minres.scviewer.database.test/src/com/minres/scviewer/database/test/TestWaveformDbFactory.java

+ 1
- 1
features/com.minres.scviewer.database.feature/pom.xml View File

@ -5,7 +5,7 @@
<parent>
<groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId>
<version>2.11.2-SNAPSHOT</version>
<version>2.12.0-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<version>3.0.0-SNAPSHOT</version>

+ 1
- 1
features/com.minres.scviewer.e4.feature/pom.xml View File

@ -5,7 +5,7 @@
<parent>
<groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId>
<version>2.11.2-SNAPSHOT</version>
<version>2.12.0-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<version>1.1.0-SNAPSHOT</version>

+ 1
- 1
features/com.minres.scviewer.e4.platform.feature/pom.xml View File

@ -5,7 +5,7 @@
<parent>
<groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId>
<version>2.11.2-SNAPSHOT</version>
<version>2.12.0-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<version>1.0.0-SNAPSHOT</version>

+ 1
- 1
features/com.minres.scviewer.feature/pom.xml View File

@ -5,7 +5,7 @@
<parent>
<groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId>
<version>2.11.2-SNAPSHOT</version>
<version>2.12.0-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<version>1.1.0-SNAPSHOT</version>

+ 1
- 1
features/com.minres.scviewer.ui.feature/pom.xml View File

@ -5,7 +5,7 @@
<parent>
<groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId>
<version>2.11.2-SNAPSHOT</version>
<version>2.12.0-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<version>1.1.0-SNAPSHOT</version>

+ 1
- 1
plugins/com.minres.scviewer.database.sqlite/pom.xml View File

@ -4,7 +4,7 @@
<parent>
<groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId>
<version>2.11.2-SNAPSHOT</version>
<version>2.12.0-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<packaging>eclipse-plugin</packaging>

+ 9
- 2
plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/AbstractTxStream.java View File

@ -39,14 +39,14 @@ abstract class AbstractTxStream extends HierNode implements IWaveform {
private List<RelationType> usedRelationsList;
public AbstractTxStream(IDatabase database, String name, long streamId) {
protected AbstractTxStream(IDatabase database, String name, long streamId) {
super(name);
this.database=database;
this.streamId=streamId;
}
@Override
public int getWidth() {
public int getRowCount() {
if(maxConcurrency==null){
StringBuilder sb = new StringBuilder();
sb.append("SELECT MAX(concurrencyLevel) as concurrencyLevel FROM ScvTx where stream=");
@ -126,4 +126,11 @@ abstract class AbstractTxStream extends HierNode implements IWaveform {
return WaveformType.TRANSACTION;
}
/**
* Calculate concurrency.
*/
public void calculateConcurrency() {
}
}

+ 0
- 1
plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/SQLiteDbLoader.java View File

@ -99,7 +99,6 @@ public class SQLiteDbLoader implements IWaveformDbLoader {
@Override
public void load(IWaveformDb db, File file) throws InputFormatException {
dispose();
database=new SQLiteDatabase(file.getAbsolutePath(), db);
database.setData("TIMERESOLUTION", 1L);
SQLiteDatabaseSelectHandler<ScvSimProps> handler = new SQLiteDatabaseSelectHandler<>(ScvSimProps.class, database);

+ 2
- 4
plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/Tx.java View File

@ -28,7 +28,6 @@ import com.minres.scviewer.database.sqlite.tables.ScvTxEvent;
import com.minres.scviewer.database.sqlite.tables.ScvTxRelation;
import com.minres.scviewer.database.tx.ITx;
import com.minres.scviewer.database.tx.ITxAttribute;
import com.minres.scviewer.database.tx.ITxGenerator;
import com.minres.scviewer.database.tx.ITxRelation;
public class Tx implements ITx {
@ -61,12 +60,11 @@ public class Tx implements ITx {
}
@Override
public ITxGenerator getGenerator() {
public IWaveform getGenerator() {
return trGenerator;
}
@Override
public int getConcurrencyIndex() {
int getConcurrencyIndex() {
return scvTx.getConcurrencyLevel();
}

+ 6
- 0
plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxEvent.java View File

@ -56,4 +56,10 @@ public class TxEvent implements ITxEvent {
public WaveformType getType() {
return WaveformType.TRANSACTION;
}
@Override
public int getRowIndex() {
return ((Tx)tx).getConcurrencyIndex();
}
}

+ 1
- 7
plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxGenerator.java View File

@ -22,9 +22,8 @@ import com.minres.scviewer.database.sqlite.db.SQLiteDatabaseSelectHandler;
import com.minres.scviewer.database.sqlite.tables.ScvGenerator;
import com.minres.scviewer.database.sqlite.tables.ScvTx;
import com.minres.scviewer.database.tx.ITx;
import com.minres.scviewer.database.tx.ITxGenerator;
public class TxGenerator extends AbstractTxStream implements ITxGenerator {
public class TxGenerator extends AbstractTxStream {
private TxStream stream;
@ -44,11 +43,6 @@ public class TxGenerator extends AbstractTxStream implements ITxGenerator {
return (long) scvGenerator.getId();
}
@Override
public IWaveform getStream() {
return stream;
}
@Override
public String getName() {
return scvGenerator.getName();

+ 1
- 2
plugins/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/TxStream.java View File

@ -26,7 +26,6 @@ import com.minres.scviewer.database.sqlite.tables.ScvGenerator;
import com.minres.scviewer.database.sqlite.tables.ScvStream;
import com.minres.scviewer.database.sqlite.tables.ScvTx;
import com.minres.scviewer.database.tx.ITx;
import com.minres.scviewer.database.tx.ITxGenerator;
public class TxStream extends AbstractTxStream {
@ -54,7 +53,7 @@ public class TxStream extends AbstractTxStream {
return (long) scvStream.getId();
}
public List<ITxGenerator> getGenerators() {
public List<IWaveform> getGenerators() {
if(generators==null){
SQLiteDatabaseSelectHandler<ScvGenerator> handler = new SQLiteDatabaseSelectHandler<>(
ScvGenerator.class, database, "stream="+scvStream.getId());

+ 1
- 1
plugins/com.minres.scviewer.database.text/pom.xml View File

@ -6,7 +6,7 @@
<parent>
<groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId>
<version>2.11.2-SNAPSHOT</version>
<version>2.12.0-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<packaging>eclipse-plugin</packaging>

+ 53
- 27
plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/AbstractTxStream.java View File

@ -13,15 +13,16 @@ package com.minres.scviewer.database.text;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map.Entry;
import java.util.NavigableMap;
import java.util.TreeMap;
import com.minres.scviewer.database.EventKind;
import com.minres.scviewer.database.HierNode;
import com.minres.scviewer.database.IEvent;
import com.minres.scviewer.database.IWaveform;
import com.minres.scviewer.database.WaveformType;
import com.minres.scviewer.database.tx.ITx;
import com.minres.scviewer.database.tx.ITxEvent;
/**
@ -38,8 +39,8 @@ abstract class AbstractTxStream extends HierNode implements IWaveform {
/** The events. */
TreeMap<Long, IEvent[]> events = new TreeMap<>();
/** The concurrency calculated. */
boolean concurrencyCalculated = false;
/** The max concurrency. */
private int rowCount = -1;
/**
* Instantiates a new abstract tx stream.
@ -48,7 +49,7 @@ abstract class AbstractTxStream extends HierNode implements IWaveform {
* @param id the id
* @param name the name
*/
public AbstractTxStream(TextDbLoader loader, Long id, String name) {
protected AbstractTxStream(TextDbLoader loader, Long id, String name) {
super(name);
this.loader = loader;
this.id = id;
@ -77,8 +78,6 @@ abstract class AbstractTxStream extends HierNode implements IWaveform {
*/
@Override
public NavigableMap<Long, IEvent[]> getEvents() {
if (!concurrencyCalculated)
calculateConcurrency();
return events;
}
@ -90,8 +89,6 @@ abstract class AbstractTxStream extends HierNode implements IWaveform {
*/
@Override
public IEvent[] getEventsAtTime(Long time) {
if (!concurrencyCalculated)
calculateConcurrency();
return events.get(time);
}
@ -103,8 +100,6 @@ abstract class AbstractTxStream extends HierNode implements IWaveform {
*/
@Override
public IEvent[] getEventsBeforeTime(Long time) {
if (!concurrencyCalculated)
calculateConcurrency();
Entry<Long, IEvent[]> e = events.floorEntry(time);
if (e == null)
return new IEvent[] {};
@ -132,28 +127,59 @@ abstract class AbstractTxStream extends HierNode implements IWaveform {
return id;
}
/**
* Gets the width.
*
* @return the width
*/
@Override
public int getRowCount() {
if (rowCount<0)
calculateConcurrency();
return rowCount;
}
/**
* Calculate concurrency.
*/
synchronized void calculateConcurrency() {
if (concurrencyCalculated)
void calculateConcurrency() {
if (rowCount>=0)
return;
ArrayList<Long> rowendtime = new ArrayList<>();
events.entrySet().stream().forEach(entry -> {
IEvent[] values = entry.getValue();
Arrays.asList(values).stream().filter(e -> e.getKind() == EventKind.BEGIN).forEach(evt -> {
Tx tx = (Tx) ((TxEvent) evt).getTransaction();
ArrayList<Long> rowEndTime = new ArrayList<>();
HashMap<Long, Integer> rowByTxId = new HashMap<>();
for(Entry<Long, IEvent[]> entry: events.entrySet()) {
for(IEvent evt:entry.getValue()) {
TxEvent txEvt = (TxEvent) evt;
ITx tx = txEvt.getTransaction();
int rowIdx = 0;
for (; rowIdx < rowendtime.size() && rowendtime.get(rowIdx) > tx.getBeginTime(); rowIdx++)
;
if (rowendtime.size() <= rowIdx)
rowendtime.add(tx.getEndTime());
else
rowendtime.set(rowIdx, tx.getEndTime());
tx.setConcurrencyIndex(rowIdx);
});
});
concurrencyCalculated = true;
switch(evt.getKind()) {
case END:
Long txId = txEvt.getTransaction().getId();
txEvt.setConcurrencyIndex(rowByTxId.get(txId));
rowByTxId.remove(txId);
break;
case SINGLE:
for (; rowIdx < rowEndTime.size() && rowEndTime.get(rowIdx)>tx.getBeginTime(); rowIdx++);
if (rowEndTime.size() <= rowIdx)
rowEndTime.add(tx.getEndTime());
else
rowEndTime.set(rowIdx, tx.getEndTime());
((TxEvent) evt).setConcurrencyIndex(rowIdx);
break;
case BEGIN:
for (; rowIdx < rowEndTime.size() && rowEndTime.get(rowIdx)>tx.getBeginTime(); rowIdx++);
if (rowEndTime.size() <= rowIdx)
rowEndTime.add(tx.getEndTime());
else
rowEndTime.set(rowIdx, tx.getEndTime());
((TxEvent) evt).setConcurrencyIndex(rowIdx);
rowByTxId.put(tx.getId(), rowIdx);
break;
}
}
}
rowCount=rowEndTime.size()>0?rowEndTime.size():1;
getChildNodes().parallelStream().forEach(c -> ((TxGenerator)c).calculateConcurrency());
}
}

+ 80
- 89
plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TextDbLoader.java View File

@ -28,14 +28,13 @@ import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.zip.GZIPInputStream;
import org.eclipse.collections.impl.map.mutable.UnifiedMap;
import org.mapdb.DB;
import org.mapdb.DB.HashMapMaker;
import org.mapdb.DB.TreeMapSink;
import org.mapdb.DBMaker;
import org.mapdb.HTreeMap;
import org.mapdb.Serializer;
@ -106,6 +105,26 @@ public class TextDbLoader implements IWaveformDbLoader {
/** The Constant x. */
static final byte[] x = "scv_tr_stream".getBytes();
/**
* Adds the property change listener.
*
* @param l the l
*/
@Override
public void addPropertyChangeListener(PropertyChangeListener l) {
pcs.addPropertyChangeListener(l);
}
/**
* Removes the property change listener.
*
* @param l the l
*/
@Override
public void removePropertyChangeListener(PropertyChangeListener l) {
pcs.removePropertyChangeListener(l);
}
/**
* Gets the max time.
*
@ -116,8 +135,29 @@ public class TextDbLoader implements IWaveformDbLoader {
return maxTime;
}
/**
* Gets the transaction.
*
* @param txId the tx id
* @return the transaction
*/
public ITx getTransaction(long txId) {
if (txCache.containsKey(txId))
return txCache.get(txId);
if(transactions.containsKey(txId)) {
Tx tx = new Tx(this, transactions.get(txId));
txCache.put(txId, tx);
return tx;
} else {
throw new IllegalArgumentException();
}
}
public ScvTx getScvTx(long id) {
return transactions.get(id);
if(transactions.containsKey(id))
return transactions.get(id);
else
throw new IllegalArgumentException();
}
/**
@ -130,6 +170,15 @@ public class TextDbLoader implements IWaveformDbLoader {
return new ArrayList<>(txStreams.values());
}
/**
* Gets the all relation types.
*
* @return the all relation types
*/
public Collection<RelationType> getAllRelationTypes() {
return relationTypes.values();
}
/**
* Can load.
*
@ -156,6 +205,22 @@ public class TextDbLoader implements IWaveformDbLoader {
return false;
}
/**
* Checks if is gzipped.
*
* @param f the f
* @return true, if is gzipped
*/
private static boolean isGzipped(File f) {
try (InputStream is = new FileInputStream(f)) {
byte[] signature = new byte[2];
int nread = is.read(signature); // read the gzip signature
return nread == 2 && signature[0] == (byte) 0x1f && signature[1] == (byte) 0x8b;
} catch (IOException e) {
return false;
}
}
/**
* Load.
*
@ -188,28 +253,14 @@ public class TextDbLoader implements IWaveformDbLoader {
TextDbParser parser = new TextDbParser(this);
try {
// parser.txSink = mapDb.treeMap("transactions", Serializer.LONG, Serializer.JAVA).createFromSink();
parser.txSink = mapDb.hashMap("transactions", Serializer.LONG, Serializer.JAVA).create();
parser.parseInput(gzipped ? new GZIPInputStream(new FileInputStream(file)) : new FileInputStream(file));
// transactions = parser.txSink.create();
transactions = parser.txSink;
} catch (IllegalArgumentException | ArrayIndexOutOfBoundsException e) {
} catch (Exception e) {
throw new InputFormatException(e.toString());
}
for (TxStream stream : txStreams.values()) {
Thread t = new Thread() {
@Override
public void run() {
try {
stream.calculateConcurrency();
} catch (Exception e) {
/* don't let exceptions bubble up */ }
}
};
threads.add(t);
t.start();
}
txStreams.values().parallelStream().forEach(TxStream::calculateConcurrency);
}
/**
@ -231,31 +282,6 @@ public class TextDbLoader implements IWaveformDbLoader {
}
}
/**
* Checks if is gzipped.
*
* @param f the f
* @return true, if is gzipped
*/
private static boolean isGzipped(File f) {
try (InputStream is = new FileInputStream(f)) {
byte[] signature = new byte[2];
int nread = is.read(signature); // read the gzip signature
return nread == 2 && signature[0] == (byte) 0x1f && signature[1] == (byte) 0x8b;
} catch (IOException e) {
return false;
}
}
/**
* Gets the all relation types.
*
* @return the all relation types
*/
public Collection<RelationType> getAllRelationTypes() {
return relationTypes.values();
}
/**
* The Class TextDbParser.
*/
@ -321,6 +347,11 @@ public class TextDbLoader implements IWaveformDbLoader {
}
if (curLine != null)
parseLine(curLine, nextLine);
for(Entry<Long, ScvTx> e: transactionById.entrySet()) {
ScvTx scvTx = e.getValue();
scvTx.endTime=loader.maxTime;
txSink.put(e.getKey(), scvTx);
}
}
/**
@ -368,8 +399,6 @@ public class TextDbLoader implements IWaveformDbLoader {
ScvTx scvTx = new ScvTx(id, gen.stream.getId(), genId,
Long.parseLong(tokens[3]) * stringToScale(tokens[4]));
loader.maxTime = loader.maxTime > scvTx.beginTime ? loader.maxTime : scvTx.beginTime;
TxStream stream = loader.txStreams.get(gen.stream.getId());
stream.setConcurrency(stream.getConcurrency() + 1);
if (nextLine != null && nextLine.charAt(0) == 'a') {
int idx = 0;
while (nextLine != null && nextLine.charAt(0) == 'a') {
@ -391,18 +420,14 @@ public class TextDbLoader implements IWaveformDbLoader {
TxGenerator gen = loader.txGenerators.get(scvTx.generatorId);
TxStream stream = loader.txStreams.get(gen.stream.getId());
if (scvTx.beginTime == scvTx.endTime) {
TxEvent evt = new TxEvent(loader, EventKind.SINGLE, id, scvTx.beginTime);
stream.addEvent(evt);
gen.addEvent(evt);
stream.addEvent(new TxEvent(loader, EventKind.SINGLE, id, scvTx.beginTime));
gen.addEvent(new TxEvent(loader, EventKind.SINGLE, id, scvTx.beginTime));
} else {
TxEvent begEvt = new TxEvent(loader, EventKind.BEGIN, id, scvTx.beginTime);
stream.addEvent(begEvt);
gen.addEvent(begEvt);
TxEvent endEvt = new TxEvent(loader, EventKind.END, id, scvTx.endTime);
stream.addEvent(endEvt);
gen.addEvent(endEvt);
stream.addEvent(new TxEvent(loader, EventKind.BEGIN, id, scvTx.beginTime));
gen.addEvent(new TxEvent(loader, EventKind.BEGIN, id, scvTx.beginTime));
stream.addEvent(new TxEvent(loader, EventKind.END, id, scvTx.endTime));
gen.addEvent(new TxEvent(loader, EventKind.END, id, scvTx.endTime));
}
stream.setConcurrency(stream.getConcurrency() - 1);
if (nextLine != null && nextLine.charAt(0) == 'a') {
int idx = 0;
while (nextLine != null && nextLine.charAt(0) == 'a') {
@ -521,38 +546,4 @@ public class TextDbLoader implements IWaveformDbLoader {
}
/**
* Gets the transaction.
*
* @param txId the tx id
* @return the transaction
*/
public ITx getTransaction(long txId) {
if (txCache.containsKey(txId))
return txCache.get(txId);
Tx tx = new Tx(this, txId);
txCache.put(txId, tx);
return tx;
}
/**
* Adds the property change listener.
*
* @param l the l
*/
@Override
public void addPropertyChangeListener(PropertyChangeListener l) {
pcs.addPropertyChangeListener(l);
}
/**
* Removes the property change listener.
*
* @param l the l
*/
@Override
public void removePropertyChangeListener(PropertyChangeListener l) {
pcs.removePropertyChangeListener(l);
}
}

+ 38
- 38
plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/Tx.java View File

@ -19,7 +19,6 @@ import java.util.stream.Collectors;
import com.minres.scviewer.database.IWaveform;
import com.minres.scviewer.database.tx.ITx;
import com.minres.scviewer.database.tx.ITxAttribute;
import com.minres.scviewer.database.tx.ITxGenerator;
import com.minres.scviewer.database.tx.ITxRelation;
/**
@ -29,9 +28,15 @@ class Tx implements ITx {
/** The loader. */
private final TextDbLoader loader;
private ScvTx scvTx =null;
/** The id. */
private long id;
private final long id;
private final long generatorId;
private final long streamId;
/** The begin time. */
long beginTime = -1;
@ -39,9 +44,6 @@ class Tx implements ITx {
/** The end time. */
long endTime = -1;
/** The concurrency index. */
private int concurrencyIndex;
/**
* Instantiates a new tx.
*
@ -51,6 +53,10 @@ class Tx implements ITx {
public Tx(TextDbLoader loader, ScvTx scvTx) {
this.loader = loader;
id = scvTx.id;
generatorId=scvTx.generatorId;
streamId=scvTx.streamId;
beginTime=scvTx.beginTime;
endTime=scvTx.endTime;
}
/**
@ -59,9 +65,11 @@ class Tx implements ITx {
* @param loader the loader
* @param txId the tx id
*/
public Tx(TextDbLoader loader, long txId) {
public Tx(TextDbLoader loader, long id, long generatorId, long streamId) {
this.loader = loader;
id = txId;
this.id = id;
this.generatorId=generatorId;
this.streamId = streamId;
}
/**
@ -113,7 +121,7 @@ class Tx implements ITx {
return true;
if (obj == null || getClass() != obj.getClass())
return false;
return this.loader.getScvTx(id).equals(((Tx) obj).loader.getScvTx(id));
return this.getScvTx().equals(((Tx) obj).getScvTx());
}
/**
@ -123,7 +131,7 @@ class Tx implements ITx {
*/
@Override
public int hashCode() {
return loader.getScvTx(id).hashCode();
return getScvTx().hashCode();
}
/**
@ -143,7 +151,7 @@ class Tx implements ITx {
*/
@Override
public Long getId() {
return loader.getScvTx(id).id;
return getScvTx().id;
}
/**
@ -153,7 +161,7 @@ class Tx implements ITx {
*/
@Override
public IWaveform getStream() {
return loader.txStreams.get(loader.getScvTx(id).streamId);
return loader.txStreams.get(streamId);
}
/**
@ -162,8 +170,8 @@ class Tx implements ITx {
* @return the generator
*/
@Override
public ITxGenerator getGenerator() {
return loader.txGenerators.get(loader.getScvTx(id).generatorId);
public IWaveform getGenerator() {
return loader.txGenerators.get(generatorId);
}
/**
@ -173,8 +181,11 @@ class Tx implements ITx {
*/
@Override
public Long getBeginTime() {
if (beginTime < 0)
beginTime = loader.getScvTx(id).beginTime;
if (beginTime < 0) {
ScvTx tx = scvTx==null?loader.getScvTx(id):getScvTx();
beginTime = tx.beginTime;
endTime = tx.endTime;
}
return beginTime;
}
@ -185,8 +196,11 @@ class Tx implements ITx {
*/
@Override
public Long getEndTime() {
if (endTime < 0)
endTime = loader.getScvTx(id).endTime;
if (endTime < 0) {
ScvTx tx = scvTx==null?loader.getScvTx(id):getScvTx();
beginTime = tx.beginTime;
endTime = tx.endTime;
}
return endTime;
}
@ -196,26 +210,7 @@ class Tx implements ITx {
* @param time the new end time
*/
void setEndTime(Long time) {
loader.getScvTx(id).endTime = time;
}
/**
* Gets the concurrency index.
*
* @return the concurrency index
*/
@Override
public int getConcurrencyIndex() {
return concurrencyIndex;
}
/**
* Sets the concurrency index.
*
* @param idx the new concurrency index
*/
void setConcurrencyIndex(int idx) {
concurrencyIndex = idx;
getScvTx().endTime = time;
}
/**
@ -225,7 +220,12 @@ class Tx implements ITx {
*/
@Override
public List<ITxAttribute> getAttributes() {
return loader.getScvTx(id).attributes;
return getScvTx().attributes;
}
private ScvTx getScvTx() {
if(scvTx==null)
scvTx=loader.getScvTx(id);
return scvTx;
}
}

+ 10
- 0
plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TxEvent.java View File

@ -32,6 +32,7 @@ class TxEvent implements ITxEvent {
/** The time. */
final long time;
private int concurrencyIdx=-1;
/**
* Instantiates a new tx event.
*
@ -107,4 +108,13 @@ class TxEvent implements ITxEvent {
public ITx getTransaction() {
return loader.getTransaction(transaction);
}
@Override
public int getRowIndex() {
return concurrencyIdx;
}
public void setConcurrencyIndex(int idx) {
concurrencyIdx=idx;
}
}

+ 1
- 21
plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TxGenerator.java View File

@ -15,12 +15,11 @@ import java.util.ArrayList;
import java.util.List;
import com.minres.scviewer.database.IWaveform;
import com.minres.scviewer.database.tx.ITxGenerator;
/**
* The Class TxGenerator.
*/
class TxGenerator extends AbstractTxStream implements ITxGenerator {
class TxGenerator extends AbstractTxStream {
/** The stream. */
TxStream stream;
@ -45,16 +44,6 @@ class TxGenerator extends AbstractTxStream implements ITxGenerator {
stream.addChild(this);
}
/**
* Gets the stream.
*
* @return the stream
*/
@Override
public IWaveform getStream() {
return stream;
}
/**
* Checks if is same.
*
@ -94,13 +83,4 @@ class TxGenerator extends AbstractTxStream implements ITxGenerator {
return stream.getKind();
}
/**
* Gets the width.
*
* @return the width
*/
@Override
public int getWidth() {
return stream.getWidth();
}
}

+ 0
- 36
plugins/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TxStream.java View File

@ -55,40 +55,4 @@ class TxStream extends AbstractTxStream {
return kind;
}
/** The max concurrency. */
private int maxConcurrency = 0;
/** The concurrency. */
private int concurrency = 0;
/**
* Sets the concurrency.
*
* @param concurrency the new concurrency
*/
void setConcurrency(int concurrency) {
this.concurrency = concurrency;
if (concurrency > maxConcurrency)
maxConcurrency = concurrency;
}
/**
* Gets the concurrency.
*
* @return the concurrency
*/
int getConcurrency() {
return this.concurrency;
}
/**
* Gets the width.
*
* @return the width
*/
@Override
public int getWidth() {
return maxConcurrency;
}
}

+ 1
- 1
plugins/com.minres.scviewer.database.ui.swt/pom.xml View File

@ -5,7 +5,7 @@
<parent>
<groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId>
<version>2.11.2-SNAPSHOT</version>
<version>2.12.0-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<version>3.0.0-SNAPSHOT</version>

+ 48
- 7
plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/ArrowPainter.java View File

@ -10,9 +10,11 @@
*******************************************************************************/
package com.minres.scviewer.database.ui.swt.internal;
import java.util.Arrays;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
import java.util.Optional;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
@ -21,8 +23,12 @@ import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Display;
import com.minres.scviewer.database.IEvent;
import com.minres.scviewer.database.IHierNode;
import com.minres.scviewer.database.IWaveform;
import com.minres.scviewer.database.RelationType;
import com.minres.scviewer.database.tx.ITx;
import com.minres.scviewer.database.tx.ITxEvent;
import com.minres.scviewer.database.tx.ITxRelation;
import com.minres.scviewer.database.ui.WaveformColors;
@ -78,6 +84,12 @@ public class ArrowPainter implements IPainter {
}
}
private int getConcurrencyIndex(ITx tx) {
IEvent[] eventList = tx.getStream().getEvents().floorEntry(tx.getBeginTime()).getValue();
Optional<Integer> res = Arrays.stream(eventList).map(e -> ((ITxEvent)e).getRowIndex()).findFirst();
return res.isPresent()? res.get():0;
}
protected void calculateGeometries() {
deferUpdate = false;
iRect.clear();
@ -88,9 +100,9 @@ public class ArrowPainter implements IPainter {
deferUpdate = true;
return;
}
int laneHeight = painter.getHeight() / tx.getStream().getWidth();
int laneHeight = painter.getHeight() / tx.getStream().getRowCount();
txRectangle = new Rectangle((int) (tx.getBeginTime() / scaleFactor),
waveCanvas.rulerHeight + painter.getVerticalOffset() + laneHeight * tx.getConcurrencyIndex(),
waveCanvas.rulerHeight + painter.getVerticalOffset() + laneHeight * getConcurrencyIndex(tx),
(int) ((tx.getEndTime() - tx.getBeginTime()) / scaleFactor), laneHeight);
deriveGeom(tx.getIncomingRelations(), iRect, false);
deriveGeom(tx.getOutgoingRelations(), oRect, true);
@ -99,17 +111,46 @@ public class ArrowPainter implements IPainter {
protected void deriveGeom(Collection<ITxRelation> relations, List<LinkEntry> res, boolean useTarget) {
for (ITxRelation iTxRelation : relations) {
ITx otherTx = useTarget ? iTxRelation.getTarget() : iTxRelation.getSource();
if (waveCanvas.wave2painterMap.containsKey(otherTx.getStream())) {
IWaveformPainter painter = waveCanvas.wave2painterMap.get(otherTx.getStream());
Rectangle bb = createLinkEntry(otherTx, otherTx.getStream());
if(bb!=null){
res.add(new LinkEntry(bb, iTxRelation.getRelationType()));
return;
} else {
for(IHierNode gen:otherTx.getStream().getChildNodes()) {
if(gen instanceof IWaveform) {
bb = createLinkEntry(otherTx, (IWaveform) gen);
if(bb!=null){
res.add(new LinkEntry(bb, iTxRelation.getRelationType()));
return;
}
}
}
}
}
}
private Rectangle createLinkEntry(ITx otherTx, IWaveform iWaveform) {
if (waveCanvas.wave2painterMap.containsKey(iWaveform)) {
IWaveformPainter painter = waveCanvas.wave2painterMap.get(otherTx.getStream());
if(painter==null) {
for(IHierNode gen:otherTx.getStream().getChildNodes()) {
if(gen instanceof IWaveform) {
painter = waveCanvas.wave2painterMap.get(gen);
if(painter!=null)
break;
}
}
}
if(painter!=null) {
int height = waveCanvas.styleProvider.getTrackHeight();
Rectangle bb = new Rectangle(
return new Rectangle(
(int) (otherTx.getBeginTime() / scaleFactor),
waveCanvas.rulerHeight + painter.getVerticalOffset() + height * otherTx.getConcurrencyIndex(),
waveCanvas.rulerHeight + painter.getVerticalOffset() + height * getConcurrencyIndex(otherTx),
(int) ((otherTx.getEndTime() - otherTx.getBeginTime()) / scaleFactor),
height);
res.add(new LinkEntry(bb, iTxRelation.getRelationType()));
}
}
return null;
}
@Override

+ 38
- 41
plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/StreamPainter.java View File

@ -10,10 +10,9 @@
*******************************************************************************/
package com.minres.scviewer.database.ui.swt.internal;
import java.util.Collection;
import java.util.Map.Entry;
import java.util.NavigableMap;
import java.util.TreeSet;
import java.util.TreeMap;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
@ -37,19 +36,18 @@ public class StreamPainter extends TrackPainter{
private IWaveform stream;
private int txBase;
private int txHeight;
private TreeSet<ITx> seenTx;
private TreeMap<ITx, ITxEvent> seenTx;
public StreamPainter(WaveformCanvas waveCanvas, boolean even, TrackEntry trackEntry) {
super(trackEntry, even);
this.waveCanvas = waveCanvas;
this.stream=trackEntry.waveform;
this.seenTx=new TreeSet<>();
this.seenTx=new TreeMap<>();
}
@SuppressWarnings("unchecked")
public void paintArea(Projection proj, Rectangle area) {
if(stream.getEvents().size()==0) return;
int trackHeight=trackEntry.height/stream.getWidth();
int trackHeight=trackEntry.height/stream.getRowCount();
txBase=trackHeight/5;
txHeight=trackHeight*3/5;
if(trackEntry.selected) {
@ -65,8 +63,8 @@ public class StreamPainter extends TrackPainter{
long beginTime = beginPos*scaleFactor;
long endTime = beginTime + area.width*scaleFactor;
Entry<Long, ?> firstTx=stream.getEvents().floorEntry(beginTime);
Entry<Long, ?> lastTx=stream.getEvents().ceilingEntry(endTime);
Entry<Long, IEvent[]> firstTx=stream.getEvents().floorEntry(beginTime);
Entry<Long, IEvent[]> lastTx=stream.getEvents().ceilingEntry(endTime);
if(firstTx==null) firstTx = stream.getEvents().firstEntry();
if(lastTx==null) lastTx=stream.getEvents().lastEntry();
proj.setFillRule(SWT.FILL_EVEN_ODD);
@ -77,46 +75,51 @@ public class StreamPainter extends TrackPainter{
for( int y1=area.y+trackHeight/2; y1<area.y+trackEntry.height; y1+=trackHeight)
proj.drawLine(area.x, y1, area.x+area.width, y1);
if(firstTx==lastTx) {
for(ITxEvent txEvent: class="o">(Collection<? extends ITxEvent>)firstTx.getValue())
drawTx(proj, area, txEvent.getTransaction(), false);
for(IEvent txEvent: firstTx.getValue())
drawTx(proj, area, ((ITxEvent)txEvent).getTransaction(), ((ITxEvent)txEvent).getRowIndex(), false);
}else{
seenTx.clear();
NavigableMap<Long, IEvent[]> entries = stream.getEvents().subMap(firstTx.getKey(), true, lastTx.getKey(), true);
boolean highlighed=false;
ITxEvent highlighed=null;
proj.setForeground(this.waveCanvas.styleProvider.getColor(WaveformColors.LINE));
long selectedId=waveCanvas.currentSelection!=null? waveCanvas.currentSelection.getId():-1;
for(Entry<Long, IEvent[]> entry: entries.entrySet())
for(IEvent evt:entry.getValue()){
ITx tx = ((ITxEvent) evt).getTransaction();
highlighed|=selectedId==tx.getId();
for(IEvent e:entry.getValue()){
ITxEvent evt = (ITxEvent) e;
ITx tx = evt.getTransaction();
if(selectedId==tx.getId())
highlighed=evt;
switch(evt.getKind()) {
case BEGIN:
seenTx.add(tx);
seenTx.put(tx, evt);
break;
case END:
drawTx(proj, area, tx, evt.getRowIndex(), false);
seenTx.remove(tx);
break;
case SINGLE:
drawTx(proj, area, tx, false);
drawTx(proj, area, tx, evt.getRowIndex(), false);
break;
}
}
for(ITx tx:seenTx){
drawTx(proj, area, tx, false);
}
if(highlighed){
seenTx.entrySet().stream().forEach(e -> {
drawTx(proj, area, e.getKey(), e.getValue().getRowIndex(), false);
});
if(highlighed!=null){
proj.setForeground(this.waveCanvas.styleProvider.getColor(WaveformColors.LINE_HIGHLITE));
drawTx(proj, area, waveCanvas.currentSelection, true);
drawTx(proj, area, highlighed.getTransaction(), highlighed.getRowIndex(), true);
}
}
}
protected void drawTx(Projection proj, Rectangle area, ITx tx, boolean highlighted ) {
protected void drawTx(Projection proj, Rectangle area, ITx tx, int concurrencyIndex, boolean highlighted ) {
// compute colors
Color[] transColor = waveCanvas.styleProvider.computeColor( tx.getGenerator().getName());
proj.setBackground(transColor[highlighted?1:0]);
int offset = tx.getConcurrencyIndex()*this.waveCanvas.styleProvider.getTrackHeight();
int offset = concurrencyIndex*this.waveCanvas.styleProvider.getTrackHeight();
Rectangle bb = new Rectangle(
(int)(tx.getBeginTime()/this.waveCanvas.getScaleFactor()), area.y+offset+txBase,
(int)((tx.getEndTime()-tx.getBeginTime())/this.waveCanvas.getScaleFactor()), txHeight);
@ -164,25 +167,19 @@ public class StreamPainter extends TrackPainter{
protected ITx getTxFromEntry(int lane, int offset, Entry<Long, IEvent[]> firstTx) {
long timePoint=offset*waveCanvas.getScaleFactor();
for(IEvent evt:firstTx.getValue()){
if(evt instanceof ITxEvent) {
ITx tx=((ITxEvent)evt).getTransaction();
if((evt.getKind()==EventKind.BEGIN || evt.getKind()==EventKind.SINGLE)&&
tx.getConcurrencyIndex()==lane && tx.getBeginTime()<=timePoint && tx.getEndTime()>=timePoint){
return ((ITxEvent)evt).getTransaction();
}
}
}
// now with some fuzziness
timePoint=(offset-5)*waveCanvas.getScaleFactor();
long timePointLow=(offset-5)*waveCanvas.getScaleFactor();
long timePointHigh=(offset+5)*waveCanvas.getScaleFactor();
for(IEvent evt:firstTx.getValue()){
if(evt instanceof ITxEvent) {
ITx tx=((ITxEvent)evt).getTransaction();
if((evt.getKind()==EventKind.BEGIN || evt.getKind()==EventKind.SINGLE) &&
tx.getConcurrencyIndex()==lane && tx.getBeginTime()<=timePointHigh && tx.getEndTime()>=timePoint){
return ((ITxEvent)evt).getTransaction();
}
for(IEvent e:firstTx.getValue()){
if(e instanceof ITxEvent) {
ITxEvent evt = (ITxEvent) e;
ITx tx=evt.getTransaction();
if(
(evt.getKind()==EventKind.SINGLE && evt.getTime()==timePoint) ||
(evt.getKind()==EventKind.SINGLE && evt.getTime()>timePointLow && evt.getTime()<timePointHigh) ||
(evt.getKind()==EventKind.BEGIN && evt.getRowIndex()==lane && evt.getTime()<=timePoint && tx.getEndTime()>=timePoint)
){
return tx;
}
}
}
return null;

+ 15
- 7
plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/WaveformCanvas.java View File

@ -11,10 +11,12 @@
package com.minres.scviewer.database.ui.swt.internal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map.Entry;
import java.util.Optional;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ControlAdapter;
@ -32,9 +34,11 @@ import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.ScrollBar;
import com.google.common.collect.Lists;
import com.minres.scviewer.database.IEvent;
import com.minres.scviewer.database.IWaveform;
import com.minres.scviewer.database.RelationType;
import com.minres.scviewer.database.tx.ITx;
import com.minres.scviewer.database.tx.ITxEvent;
import com.minres.scviewer.database.ui.IWaveformStyleProvider;
import com.minres.scviewer.database.ui.IWaveformView;
import com.minres.scviewer.database.ui.TrackEntry;
@ -424,13 +428,17 @@ public class WaveformCanvas extends Canvas {
}
for (IWaveformPainter painter : wave2painterMap.values()) {
if (painter instanceof StreamPainter && ((StreamPainter) painter).getStream() == tx.getStream()) {
int top = painter.getVerticalOffset() + styleProvider.getTrackHeight() * tx.getConcurrencyIndex();
int bottom = top + styleProvider.getTrackHeight();
if (top < -origin.y) {
setOrigin(origin.x, -(top-styleProvider.getTrackHeight()));
} else if (bottom > (size.y - origin.y)) {
setOrigin(origin.x, size.y - bottom);
}
Entry<Long, IEvent[]> entry = tx.getStream().getEvents().floorEntry(tx.getBeginTime());
Optional<IEvent> res = Arrays.stream(entry.getValue()).filter(e -> ((ITxEvent)e).getTransaction().equals(tx)).findFirst();
if(res.isPresent()) {
int top = painter.getVerticalOffset() + styleProvider.getTrackHeight() * ((ITxEvent)res.get()).getRowIndex();
int bottom = top + styleProvider.getTrackHeight();
if (top < -origin.y) {
setOrigin(origin.x, -(top-styleProvider.getTrackHeight()));
} else if (bottom > (size.y - origin.y)) {
setOrigin(origin.x, size.y - bottom);
}
}
}
}
}

+ 12
- 11
plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/WaveformView.java View File

@ -514,7 +514,7 @@ public class WaveformView implements IWaveformView {
streamEntry.vOffset = tracksVerticalHeight;
if (streamEntry.waveform.getType() == WaveformType.TRANSACTION) {
streamEntry.currentValue = "";
streamEntry.height *= streamEntry.waveform.getWidth();
streamEntry.height *= streamEntry.waveform.getRowCount();
painter = new StreamPainter(waveformCanvas, even, streamEntry);
} else if (streamEntry.waveform.getType() == WaveformType.SIGNAL) {
streamEntry.currentValue = "---";
@ -579,17 +579,18 @@ public class WaveformView implements IWaveformView {
entry.currentValue = Double.toString(val);
}
} else if (entry.waveform.getType() == WaveformType.TRANSACTION) {
ITx[] resultsList = new ITx[entry.waveform.getWidth()];
ITx[] resultsList = new ITx[entry.waveform.getRowCount()];
Entry<Long, IEvent[]> firstTx = entry.waveform.getEvents().floorEntry(time);
if (firstTx != null) {
do {
for (IEvent evt : firstTx.getValue()) {
if (evt instanceof ITxEvent) {
ITx tx = ((ITxEvent) evt).getTransaction();
for (IEvent e : firstTx.getValue()) {
if (e instanceof ITxEvent) {
ITxEvent evt = ((ITxEvent) e);
ITx tx = evt.getTransaction();
if ((evt.getKind() == EventKind.BEGIN || evt.getKind() == EventKind.SINGLE)
&& tx.getBeginTime() <= time && tx.getEndTime() >= time
&& resultsList[tx.getConcurrencyIndex()] == null)
resultsList[tx.getConcurrencyIndex()] = ((ITxEvent) evt).getTransaction();
&& resultsList[evt.getRowIndex()] == null)
resultsList[evt.getRowIndex()] = evt.getTransaction();
}
}
firstTx = entry.waveform.getEvents().lowerEntry(firstTx.getKey());
@ -1036,7 +1037,7 @@ public class WaveformView implements IWaveformView {
TrackEntry trackEntry = trackVerticalOffset.get(firstKey);
IWaveform w = trackEntry.waveform;
if (w.getType() == WaveformType.TRANSACTION)
subArea.height *= w.getWidth();
subArea.height *= w.getRowCount();
drawTextFormat(gc, subArea, firstKey, w.getFullName(), trackEntry.selected);
} else {
for (Entry<Integer, TrackEntry> entry : trackVerticalOffset.subMap(firstKey, true, lastKey, true)
@ -1044,7 +1045,7 @@ public class WaveformView implements IWaveformView {
IWaveform w = entry.getValue().waveform;
subArea.height = styleProvider.getTrackHeight();
if (w.getType() == WaveformType.TRANSACTION)
subArea.height *= w.getWidth();
subArea.height *= w.getRowCount();
drawTextFormat(gc, subArea, entry.getKey(), w.getFullName(), entry.getValue().selected);
}
}
@ -1065,7 +1066,7 @@ public class WaveformView implements IWaveformView {
TrackEntry trackEntry = trackVerticalOffset.get(firstKey);
IWaveform w = trackEntry.waveform;
if (w.getType() == WaveformType.TRANSACTION)
subArea.height *= w.getWidth();
subArea.height *= w.getRowCount();
drawValue(gc, subArea, firstKey, trackEntry.currentValue, trackEntry.selected);
} else {
for (Entry<Integer, TrackEntry> entry : trackVerticalOffset.subMap(firstKey, true, lastKey, true)
@ -1073,7 +1074,7 @@ public class WaveformView implements IWaveformView {
IWaveform w = entry.getValue().waveform;
subArea.height = styleProvider.getTrackHeight();
if (w.getType() == WaveformType.TRANSACTION)
subArea.height *= w.getWidth();
subArea.height *= w.getRowCount();
drawValue(gc, subArea, entry.getKey(), entry.getValue().currentValue,
entry.getValue().selected);
}

+ 1
- 1
plugins/com.minres.scviewer.database.vcd/pom.xml View File

@ -5,7 +5,7 @@
<parent>
<groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId>
<version>2.11.2-SNAPSHOT</version>
<version>2.12.0-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<packaging>eclipse-plugin</packaging>

+ 1
- 1
plugins/com.minres.scviewer.database.vcd/src/com/minres/scviewer/database/vcd/VCDDbLoader.java View File

@ -204,7 +204,7 @@ public class VCDDbLoader implements IWaveformDbLoader, IVCDDatabaseBuilder {
@Override
public int getNetWidth(int intValue) {
VCDSignal<?> signal = (VCDSignal<?>) signals.get(intValue);
return signal.getWidth();
return signal.getRowCount();
}
/* (non-Javadoc)

+ 1
- 1
plugins/com.minres.scviewer.database.vcd/src/com/minres/scviewer/database/vcd/VCDSignal.java View File

@ -109,7 +109,7 @@ public class VCDSignal extends HierNode implements IWaveform {
}
@Override
public int getWidth() {
public int getRowCount() {
return width;
}

+ 1
- 1
plugins/com.minres.scviewer.database/pom.xml View File

@ -4,7 +4,7 @@
<parent>
<groupId>com.minres.scviewer</groupId>
<artifactId>com.minres.scviewer.parent</artifactId>
<version>2.11.2-SNAPSHOT</version>
<version>2.12.0-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<packaging>eclipse-plugin</packaging>

+ 3
- 2
plugins/com.minres.scviewer.database/src/com/minres/scviewer/database/IWaveform.java View File

@ -12,6 +12,7 @@ package com.minres.scviewer.database;
import java.util.NavigableMap;
// TODO: Auto-generated Javadoc
/**
* The Interface IWaveform.