mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
Replace SampleFlags IS_FIRST/IS_LAST with NEW_SIMULATION
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
This commit is contained in:
parent
f583b04d15
commit
97b769a80d
4 changed files with 6 additions and 7 deletions
|
@ -49,8 +49,8 @@ enum class SampleFlags {
|
|||
HAS_TS_ORIGIN | HAS_TS_RECEIVED, // Include origin timestamp in output.
|
||||
HAS_ALL = (1 << 5) - 1, // Enable all output options.
|
||||
|
||||
IS_FIRST = (1 << 16), // This sample is the first of a new simulation case
|
||||
IS_LAST = (1 << 17) // This sample is the last of a running simulation case
|
||||
NEW_SIMULATION =
|
||||
(1 << 16), // This sample is the first of a new simulation case
|
||||
};
|
||||
|
||||
struct Sample {
|
||||
|
|
|
@ -50,7 +50,7 @@ public:
|
|||
"(previous->sequence={}, current->sequence={})",
|
||||
node->getName(), prev->sequence, smp->sequence);
|
||||
|
||||
smp->flags |= (int)SampleFlags::IS_FIRST;
|
||||
smp->flags |= (int)SampleFlags::NEW_SIMULATION;
|
||||
|
||||
// Restart hooks
|
||||
for (auto k : node->in.hooks)
|
||||
|
|
|
@ -108,7 +108,7 @@ int PathSource::read(int i) {
|
|||
/* We reset the sample length after each restart of the simulation.
|
||||
* This is necessary for the test_rtt node to work properly.
|
||||
*/
|
||||
if (tomux_smps[i]->flags & (int)SampleFlags::IS_FIRST)
|
||||
if (tomux_smps[i]->flags & (int)SampleFlags::NEW_SIMULATION)
|
||||
muxed_smps[i]->length = 0;
|
||||
|
||||
muxed_smps[i]->ts = tomux_smps[i]->ts;
|
||||
|
|
|
@ -22,8 +22,7 @@ SampleFlags = {
|
|||
HAS_DATA = 16, -- "(1 << 5)" Include values in output.
|
||||
HAS_ALL = 15, -- "(1 << 6) -1" Enable all output options.
|
||||
|
||||
IS_FIRST = 65536, -- "(1 << 16)" This sample is the first of a new simulation case
|
||||
IS_LAST = 131072 -- "(1 << 17)" This sample is the last of a running simulation case
|
||||
NEW_SIMULATION = 65536, -- "(1 << 16)" This sample is the first of a new simulation case
|
||||
}
|
||||
|
||||
|
||||
|
@ -71,7 +70,7 @@ end
|
|||
|
||||
|
||||
function process(smp)
|
||||
info("Process test_hook")
|
||||
info("Process test_hook")
|
||||
|
||||
if smp.sequence == 1 then
|
||||
dump_sample(smp)
|
||||
|
|
Loading…
Add table
Reference in a new issue