Classify streams and generators consistently across database loaders
This commit is contained in:
1 parent
591fe2c4c7
commit
6668151a53
19 files changed
+149
-81
No files matched your search
+6
-6
@@ -243,13 +243,13 @@ public class FtrDbLoader implements IWaveformDbLoader {
|
||||
FtrTx scvTx = new FtrTx(txId, stream.getId(), genId, startTime, endTime, blockId, blockOffset);
|
||||
updateTransactions(txId, scvTx);
|
||||
if (scvTx.beginTime == scvTx.endTime) {
|
||||
stream.addEvent(new TxEvent(this, EventKind.SINGLE, txId, scvTx.beginTime));
|
||||
gen.addEvent(new TxEvent(this, EventKind.SINGLE, txId, scvTx.beginTime));
|
||||
stream.addEvent(new TxEvent(this, EventKind.SINGLE, txId, scvTx.beginTime, stream.getType()));
|
||||
gen.addEvent(new TxEvent(this, EventKind.SINGLE, txId, scvTx.beginTime, gen.getType()));
|
||||
} else {
|
||||
stream.addEvent(new TxEvent(this, EventKind.BEGIN, txId, scvTx.beginTime));
|
||||
gen.addEvent(new TxEvent(this, EventKind.BEGIN, txId, scvTx.beginTime));
|
||||
stream.addEvent(new TxEvent(this, EventKind.END, txId, scvTx.endTime));
|
||||
gen.addEvent(new TxEvent(this, EventKind.END, txId, scvTx.endTime));
|
||||
stream.addEvent(new TxEvent(this, EventKind.BEGIN, txId, scvTx.beginTime, stream.getType()));
|
||||
gen.addEvent(new TxEvent(this, EventKind.BEGIN, txId, scvTx.beginTime, gen.getType()));
|
||||
stream.addEvent(new TxEvent(this, EventKind.END, txId, scvTx.endTime, stream.getType()));
|
||||
gen.addEvent(new TxEvent(this, EventKind.END, txId, scvTx.endTime, gen.getType()));
|
||||
}
|
||||
break;
|
||||
default: { // skip over 7:begin attr, 8:record attr, 9:end attr
|
||||
|
||||
+6
-12
@@ -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(FtrDbLoader loader, EventKind kind, Long transaction, Long time) {
|
||||
TxEvent(FtrDbLoader 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.
|
||||
*
|
||||
|
||||
+6
@@ -16,6 +16,7 @@ import java.util.List;
|
||||
import com.minres.scviewer.database.DirectionType;
|
||||
import com.minres.scviewer.database.IEventList;
|
||||
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.
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user