Classify streams and generators consistently across database loaders

This commit is contained in:
eyck committed 2026-11-14 18:36:47 +01:00
1 parent 591fe2c4c7
commit 6668151a53
19 files changed
+149 -81

No files matched your search

@@ -421,13 +421,13 @@ 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) {
stream.addEvent(new TxEvent(loader, EventKind.SINGLE, id, scvTx.beginTime));
gen.addEvent(new TxEvent(loader, EventKind.SINGLE, id, scvTx.beginTime));
stream.addEvent(new TxEvent(loader, EventKind.SINGLE, id, scvTx.beginTime, stream.getType()));
gen.addEvent(new TxEvent(loader, EventKind.SINGLE, id, scvTx.beginTime, gen.getType()));
} else {
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.addEvent(new TxEvent(loader, EventKind.BEGIN, id, scvTx.beginTime, stream.getType()));
gen.addEvent(new TxEvent(loader, EventKind.BEGIN, id, scvTx.beginTime, gen.getType()));
stream.addEvent(new TxEvent(loader, EventKind.END, id, scvTx.endTime, stream.getType()));
gen.addEvent(new TxEvent(loader, EventKind.END, id, scvTx.endTime, gen.getType()));
}
if (nextLine != null && nextLine.charAt(0) == 'a') {
int idx = 0;
@@ -26,6 +26,8 @@ class TxEvent implements ITxEvent {
/** The kind. */
final EventKind kind;
private final WaveformType waveformType;
/** The transaction. */
final long transaction;
@@ -40,12 +42,14 @@ class TxEvent implements ITxEvent {
* @param kind the kind
* @param transaction the transaction
* @param time the time
* @param waveformType the type of the owning waveform
*/
TxEvent(TextDbLoader loader, EventKind kind, Long transaction, Long time) {
TxEvent(TextDbLoader loader, EventKind kind, Long transaction, Long time, WaveformType waveformType) {
this.loader = loader;
this.kind = kind;
this.transaction = transaction;
this.time = time;
this.waveformType = waveformType;
}
/**
@@ -56,7 +60,7 @@ class TxEvent implements ITxEvent {
*/
@Override
public ITxEvent duplicate() throws CloneNotSupportedException {
return new TxEvent(loader, kind, transaction, time);
return new TxEvent(loader, kind, transaction, time, waveformType);
}
/**
@@ -69,16 +73,6 @@ class TxEvent implements ITxEvent {
return kind.toString() + "@" + time + " of tx #" + transaction;
}
/**
* Gets the type.
*
* @return the type
*/
@Override
public WaveformType getType() {
return WaveformType.STREAM;
}
/**
* Gets the kind.
*
@@ -16,6 +16,7 @@ import java.util.List;
import com.minres.scviewer.database.DirectionType;
import com.minres.scviewer.database.IWaveform;
import com.minres.scviewer.database.WaveformType;
/**
* The Class TxGenerator.
@@ -45,6 +46,11 @@ class TxGenerator extends AbstractTxStream {
stream.addChild(this);
}
@Override
public WaveformType getType() {
return WaveformType.GENERATOR;
}
/**
* Checks if is same.
*