public static class TestSignalRecorder.Time extends TestSignalRecorder
TestSignalRecorder.Empty, TestSignalRecorder.Time| Modifier and Type | Field and Description |
|---|---|
(package private) java.lang.String |
format |
(package private) int |
posNum |
(package private) java.lang.StringBuilder |
sbTime |
(package private) int |
time0 |
(package private) int |
timeStep |
(package private) int |
timeStep10 |
(package private) int |
timeStep5 |
lenClean, moduleName, pos| Constructor and Description |
|---|
Time(java.lang.String format,
int factor) |
| Modifier and Type | Method and Description |
|---|---|
int |
addSignals(int time,
int lenCurr,
boolean bAdd)
This operation should be implemented to add the necessary signals to all existing lines
which are created or cleaned in the overridden
TestSignalRecorder.clean() and registered with TestSignalRecorder.registerLine(StringBuilder, String). |
void |
registerLines() |
addSignals, checkLen, clean, endSignals, getLine, output, registerLinejava.lang.StringBuilder sbTime
java.lang.String format
int timeStep
int timeStep5
int timeStep10
int time0
int posNum
public Time(java.lang.String format,
int factor)
format - factor - public void registerLines()
registerLines in class TestSignalRecorderpublic int addSignals(int time,
int lenCurr,
boolean bAdd)
throws java.io.IOException
TestSignalRecorderTestSignalRecorder.clean() and registered with TestSignalRecorder.registerLine(StringBuilder, String).
Usage example/pattern:
(at)Override public int addSignals ( int time, boolean bAdd ) throws IOException {
BlinkingLedCt mdl = BlinkingLedCt.this;
int zCurr = this.sbCt.length(); // current length for this time
int zAdd = 0; // >0 then position of new length for this time
if(mdl.ref.clkDiv.q.ce) { // because the own states switches only with this ce, the signals should also recorded only then.
if(mdl.q.ctLow == 1) { // on this condition
this.wrCt = 5; // switch on, write 5 steps info
}
if(--this.wrCt >0) { // if one of the 5 infos shouls be written:
StringFunctions_C.appendHex(this.sbCtLow, mdl.q.ctLow,4).append(' '); //append info
StringFunctions_C.appendHex(this.sbCt, mdl.q.ct,2); //append info
if(checkLen(this.sbtime, zCurr)) { // add the time information if here is space.
StringFunctions_C.appendIntPict(this.sbtime, time, "33'331.111.11"); // append time info
}
zAdd = this.sbCtLow.length(); //length of buffers for new time determined by the sbCtLow, the longest entry.
}
else if(this.wrCt ==0) { // end of the 5 steps, append .... as separation
this.sbCtLow.append("..... ");
zAdd = this.sbCtLow.length(); //length of buffers for new time determined by the sbCtLow, the longest entry.
}
}// if ce
return zAdd; // will be used in TestSignalRecorderSet.addSignals(zAdd) to set all lines to this length
}//addSignals
Here signals are only added if the ce of the other module is set. Elsewhere the operation returns 0.
This is sensible because signals either changes only with this ce, or they are interesting only in ce steps.
addSignals in class TestSignalRecordertime - the system time may be used for outputlenCurr - the current length of the StringBuilder lines before adding for this timestamp.
This parameter can be used for TestSignalRecorder.checkLen(StringBuilder, int).bAdd - true then other TestSignalsRecorders have added an information in this step time before.
This information can be used to decide whether to add.
But it depends on the order of registering in TestSignalRecorderSet.registerRecorder(TestSignalRecorder).
If you want to use this function, this test generator is subordinate, it accepts the behavior of the recorders before
delivered in the return value of this operation.
If the return value of all called before addSignals(...) operation is 0, then this value is false
on usage of TestSignalRecorderSet.addSignals(int).java.io.IOException