Implemented new C++ logic

This commit is contained in:
Martino Ferrari
2026-06-12 15:25:13 +02:00
parent 617b5bd712
commit f25bd7f08e
220 changed files with 39185 additions and 850 deletions
+107
View File
@@ -0,0 +1,107 @@
/**
* @file LTTBGTest.cpp
* @brief Unit tests for the StreamHub LTTB decimation.
*
* @copyright Copyright 2015 F4E | European Joint Undertaking for ITER and
* the Development of Fusion Energy ('Fusion for Energy').
* Licensed under the EUPL, Version 1.1 or - as soon they will be approved
* by the European Commission - subsequent versions of the EUPL (the "Licence")
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl
*
* @warning Unless required by applicable law or agreed to in writing,
* software distributed under the Licence is distributed on an "AS IS"
* basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the Licence permissions and limitations under the Licence.
*/
#include "LTTB.h"
#include <gtest/gtest.h>
#include <math.h>
using StreamHub::LTTBDecimate;
using MARTe::float64;
using MARTe::uint32;
TEST(LTTBGTest, TestEmptyInput) {
float64 t[4] = {0.0};
float64 v[4] = {0.0};
EXPECT_EQ(0u, LTTBDecimate(t, v, 0u, t, v, 4u));
}
TEST(LTTBGTest, TestPassthroughWhenSmall) {
float64 tIn[5] = {0.0, 1.0, 2.0, 3.0, 4.0};
float64 vIn[5] = {5.0, 6.0, 7.0, 8.0, 9.0};
float64 tOut[5], vOut[5];
ASSERT_EQ(5u, LTTBDecimate(tIn, vIn, 5u, tOut, vOut, 10u));
for (uint32 i = 0u; i < 5u; i++) {
EXPECT_DOUBLE_EQ(tIn[i], tOut[i]);
EXPECT_DOUBLE_EQ(vIn[i], vOut[i]);
}
}
TEST(LTTBGTest, TestDecimateCountAndEndpoints) {
const uint32 n = 1000u;
static float64 tIn[1000], vIn[1000];
for (uint32 i = 0u; i < n; i++) {
tIn[i] = static_cast<float64>(i) * 0.001;
vIn[i] = sin(tIn[i] * 50.0);
}
static float64 tOut[100], vOut[100];
ASSERT_EQ(100u, LTTBDecimate(tIn, vIn, n, tOut, vOut, 100u));
/* First and last points preserved */
EXPECT_DOUBLE_EQ(tIn[0], tOut[0]);
EXPECT_DOUBLE_EQ(tIn[n - 1u], tOut[99]);
/* Output time strictly increasing */
for (uint32 i = 1u; i < 100u; i++) {
EXPECT_LT(tOut[i - 1u], tOut[i]);
}
}
TEST(LTTBGTest, TestSpikePreserved) {
const uint32 n = 500u;
static float64 tIn[500], vIn[500];
for (uint32 i = 0u; i < n; i++) {
tIn[i] = static_cast<float64>(i);
vIn[i] = 0.0;
}
vIn[250] = 100.0; /* single spike in a flat signal */
static float64 tOut[50], vOut[50];
const uint32 nOut = LTTBDecimate(tIn, vIn, n, tOut, vOut, 50u);
ASSERT_EQ(50u, nOut);
bool spikeFound = false;
for (uint32 i = 0u; i < nOut; i++) {
if (vOut[i] == 100.0) { spikeFound = true; }
}
EXPECT_TRUE(spikeFound);
}
TEST(LTTBGTest, TestOutputPointsExistInInput) {
const uint32 n = 200u;
static float64 tIn[200], vIn[200];
for (uint32 i = 0u; i < n; i++) {
tIn[i] = static_cast<float64>(i);
vIn[i] = cos(static_cast<float64>(i) * 0.3);
}
static float64 tOut[20], vOut[20];
const uint32 nOut = LTTBDecimate(tIn, vIn, n, tOut, vOut, 20u);
ASSERT_EQ(20u, nOut);
/* Every output sample must be an actual input sample (no interpolation) */
for (uint32 i = 0u; i < nOut; i++) {
const uint32 idx = static_cast<uint32>(tOut[i]);
EXPECT_DOUBLE_EQ(tIn[idx], tOut[i]);
EXPECT_DOUBLE_EQ(vIn[idx], vOut[i]);
}
}
TEST(LTTBGTest, TestThresholdBelowThreeCopiesAll) {
float64 tIn[10], vIn[10];
for (uint32 i = 0u; i < 10u; i++) {
tIn[i] = static_cast<float64>(i);
vIn[i] = static_cast<float64>(i);
}
float64 tOut[10], vOut[10];
/* threshold < 3 → fast path copies everything */
EXPECT_EQ(10u, LTTBDecimate(tIn, vIn, 10u, tOut, vOut, 2u));
}
+1
View File
@@ -0,0 +1 @@
include Makefile.inc
+54
View File
@@ -0,0 +1,54 @@
#############################################################
#
# Copyright 2015 F4E | European Joint Undertaking for ITER
# and the Development of Fusion Energy ('Fusion for Energy')
#
# Licensed under the EUPL, Version 1.1 or - as soon they
# will be approved by the European Commission - subsequent
# versions of the EUPL (the "Licence");
# You may not use this work except in compliance with the
# Licence.
# You may obtain a copy of the Licence at:
#
# http://ec.europa.eu/idabc/eupl
#
# Unless required by applicable law or agreed to in
# writing, software distributed under the Licence is
# distributed on an "AS IS" basis,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
# express or implied.
# See the Licence for the specific language governing
# permissions and limitations under the Licence.
#
#############################################################
OBJSX = TriggerEngineSrc.x SignalRingBufferGTest.x TriggerEngineGTest.x LTTBGTest.x
PACKAGE=Applications
ROOT_DIR=../../..
MAKEDEFAULTDIR=$(MARTe2_DIR)/MakeDefaults
include $(MAKEDEFAULTDIR)/MakeStdLibDefs.$(TARGET)
INCLUDES += -I.
INCLUDES += -I$(ROOT_DIR)/Source/Applications/StreamHub
INCLUDES += -I$(ROOT_DIR)/Common/UDP
INCLUDES += -I$(ROOT_DIR)/Source/Components/Interfaces/UDPStream
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L0Types
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L1Portability
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L2Objects
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L3Streams
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Configuration
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L1Portability
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L3Services
INCLUDES += -I$(MARTe2_DIR)/Source/Core/FileSystem/L1Portability
INCLUDES += -I$(MARTe2_DIR)/Source/Core/FileSystem/L3Streams
INCLUDES += -I$(MARTe2_DIR)/Lib/gtest-1.7.0/include
all: $(OBJS) \
$(BUILD_DIR)/StreamHubTest$(LIBEXT)
echo $(OBJS)
include depends.$(TARGET)
include $(MAKEDEFAULTDIR)/MakeStdLibRules.$(TARGET)
@@ -0,0 +1,224 @@
/**
* @file SignalRingBufferGTest.cpp
* @brief Unit tests for the StreamHub SignalRingBuffer (ReadSince/ReadRange).
*
* @copyright Copyright 2015 F4E | European Joint Undertaking for ITER and
* the Development of Fusion Energy ('Fusion for Energy').
* Licensed under the EUPL, Version 1.1 or - as soon they will be approved
* by the European Commission - subsequent versions of the EUPL (the "Licence")
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl
*
* @warning Unless required by applicable law or agreed to in writing,
* software distributed under the Licence is distributed on an "AS IS"
* basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the Licence permissions and limitations under the Licence.
*/
#include "SignalRingBuffer.h"
#include <gtest/gtest.h>
using StreamHub::SignalRingBuffer;
using MARTe::float64;
using MARTe::uint32;
using MARTe::uint64;
TEST(SignalRingBufferGTest, TestAllocateZeroFails) {
SignalRingBuffer rb;
ASSERT_FALSE(rb.Allocate(0u));
}
TEST(SignalRingBufferGTest, TestReadLastNInOrder) {
SignalRingBuffer rb;
ASSERT_TRUE(rb.Allocate(8u));
for (uint32 i = 0u; i < 5u; i++) {
rb.Write(static_cast<float64>(i), static_cast<float64>(10u + i));
}
float64 t[10], v[10];
ASSERT_EQ(5u, rb.Read(t, v, 10u));
for (uint32 i = 0u; i < 5u; i++) {
EXPECT_DOUBLE_EQ(static_cast<float64>(i), t[i]);
EXPECT_DOUBLE_EQ(static_cast<float64>(10u + i), v[i]);
}
}
TEST(SignalRingBufferGTest, TestWrapOverwritesOldest) {
SignalRingBuffer rb;
ASSERT_TRUE(rb.Allocate(4u));
for (uint32 i = 0u; i < 6u; i++) {
rb.Write(static_cast<float64>(i), static_cast<float64>(i));
}
ASSERT_EQ(4u, rb.Count());
EXPECT_EQ(static_cast<uint64>(6u), rb.TotalWritten());
float64 t[4], v[4];
ASSERT_EQ(4u, rb.Read(t, v, 4u));
/* Oldest two (t=0,1) were overwritten */
EXPECT_DOUBLE_EQ(2.0, t[0]);
EXPECT_DOUBLE_EQ(5.0, t[3]);
}
TEST(SignalRingBufferGTest, TestReadRangeMiddle) {
SignalRingBuffer rb;
ASSERT_TRUE(rb.Allocate(16u));
for (uint32 i = 0u; i < 10u; i++) {
rb.Write(static_cast<float64>(i), static_cast<float64>(i) * 2.0);
}
float64 t[16], v[16];
/* [2.5, 6.5] → t = 3,4,5,6 */
ASSERT_EQ(4u, rb.ReadRange(2.5, 6.5, t, v, 16u));
EXPECT_DOUBLE_EQ(3.0, t[0]);
EXPECT_DOUBLE_EQ(6.0, t[3]);
EXPECT_DOUBLE_EQ(12.0, v[3]);
}
TEST(SignalRingBufferGTest, TestReadRangeInclusiveBounds) {
SignalRingBuffer rb;
ASSERT_TRUE(rb.Allocate(16u));
for (uint32 i = 0u; i < 10u; i++) {
rb.Write(static_cast<float64>(i), 0.0);
}
float64 t[16], v[16];
/* Bounds are inclusive on both sides */
ASSERT_EQ(5u, rb.ReadRange(2.0, 6.0, t, v, 16u));
EXPECT_DOUBLE_EQ(2.0, t[0]);
EXPECT_DOUBLE_EQ(6.0, t[4]);
}
TEST(SignalRingBufferGTest, TestReadRangeAfterWrap) {
SignalRingBuffer rb;
ASSERT_TRUE(rb.Allocate(4u));
for (uint32 i = 0u; i < 6u; i++) {
rb.Write(static_cast<float64>(i), static_cast<float64>(i));
}
float64 t[4], v[4];
/* Whole range: only retained points t=2..5 */
ASSERT_EQ(4u, rb.ReadRange(0.0, 10.0, t, v, 4u));
EXPECT_DOUBLE_EQ(2.0, t[0]);
EXPECT_DOUBLE_EQ(5.0, t[3]);
/* Narrow range crossing the physical wrap point */
ASSERT_EQ(1u, rb.ReadRange(3.5, 4.5, t, v, 4u));
EXPECT_DOUBLE_EQ(4.0, t[0]);
}
TEST(SignalRingBufferGTest, TestReadRangeInvalid) {
SignalRingBuffer rb;
float64 t[4], v[4];
/* Unallocated */
EXPECT_EQ(0u, rb.ReadRange(0.0, 1.0, t, v, 4u));
ASSERT_TRUE(rb.Allocate(4u));
/* Empty */
EXPECT_EQ(0u, rb.ReadRange(0.0, 1.0, t, v, 4u));
rb.Write(1.0, 1.0);
/* Inverted range */
EXPECT_EQ(0u, rb.ReadRange(2.0, 1.0, t, v, 4u));
/* Disjoint range */
EXPECT_EQ(0u, rb.ReadRange(5.0, 9.0, t, v, 4u));
}
TEST(SignalRingBufferGTest, TestReadRangeMaxOutCap) {
SignalRingBuffer rb;
ASSERT_TRUE(rb.Allocate(16u));
for (uint32 i = 0u; i < 10u; i++) {
rb.Write(static_cast<float64>(i), 0.0);
}
float64 t[3], v[3];
ASSERT_EQ(3u, rb.ReadRange(0.0, 9.0, t, v, 3u));
EXPECT_DOUBLE_EQ(0.0, t[0]);
EXPECT_DOUBLE_EQ(2.0, t[2]);
}
TEST(SignalRingBufferGTest, TestReadSinceBasic) {
SignalRingBuffer rb;
ASSERT_TRUE(rb.Allocate(8u));
uint64 cursor = 0u;
float64 t[8], v[8];
for (uint32 i = 0u; i < 3u; i++) {
rb.Write(static_cast<float64>(i), static_cast<float64>(i));
}
ASSERT_EQ(3u, rb.ReadSince(cursor, t, v, 8u));
EXPECT_EQ(static_cast<uint64>(3u), cursor);
EXPECT_DOUBLE_EQ(0.0, t[0]);
EXPECT_DOUBLE_EQ(2.0, t[2]);
/* Nothing new */
EXPECT_EQ(0u, rb.ReadSince(cursor, t, v, 8u));
/* Two more points: only the new ones are returned */
rb.Write(3.0, 3.0);
rb.Write(4.0, 4.0);
ASSERT_EQ(2u, rb.ReadSince(cursor, t, v, 8u));
EXPECT_DOUBLE_EQ(3.0, t[0]);
EXPECT_DOUBLE_EQ(4.0, t[1]);
EXPECT_EQ(static_cast<uint64>(5u), cursor);
}
TEST(SignalRingBufferGTest, TestReadSinceOverrunClamps) {
SignalRingBuffer rb;
ASSERT_TRUE(rb.Allocate(4u));
uint64 cursor = 0u;
float64 t[8], v[8];
for (uint32 i = 0u; i < 10u; i++) {
rb.Write(static_cast<float64>(i), static_cast<float64>(i));
}
/* 10 written, only 4 retained: clamp to oldest available (t=6..9) */
ASSERT_EQ(4u, rb.ReadSince(cursor, t, v, 8u));
EXPECT_DOUBLE_EQ(6.0, t[0]);
EXPECT_DOUBLE_EQ(9.0, t[3]);
EXPECT_EQ(static_cast<uint64>(10u), cursor);
}
TEST(SignalRingBufferGTest, TestReadSinceMaxOutChunks) {
SignalRingBuffer rb;
ASSERT_TRUE(rb.Allocate(8u));
uint64 cursor = 0u;
float64 t[8], v[8];
for (uint32 i = 0u; i < 5u; i++) {
rb.Write(static_cast<float64>(i), static_cast<float64>(i));
}
/* Consume in chunks of 2: cursor must advance only by what was read */
ASSERT_EQ(2u, rb.ReadSince(cursor, t, v, 2u));
EXPECT_DOUBLE_EQ(0.0, t[0]);
EXPECT_DOUBLE_EQ(1.0, t[1]);
ASSERT_EQ(2u, rb.ReadSince(cursor, t, v, 2u));
EXPECT_DOUBLE_EQ(2.0, t[0]);
EXPECT_DOUBLE_EQ(3.0, t[1]);
ASSERT_EQ(1u, rb.ReadSince(cursor, t, v, 2u));
EXPECT_DOUBLE_EQ(4.0, t[0]);
EXPECT_EQ(static_cast<uint64>(5u), cursor);
}
TEST(SignalRingBufferGTest, TestReadSinceAfterReallocate) {
SignalRingBuffer rb;
ASSERT_TRUE(rb.Allocate(8u));
uint64 cursor = 0u;
float64 t[8], v[8];
for (uint32 i = 0u; i < 5u; i++) {
rb.Write(static_cast<float64>(i), static_cast<float64>(i));
}
ASSERT_EQ(5u, rb.ReadSince(cursor, t, v, 8u));
/* Re-Allocate resets totalWritten: a stale cursor must not underflow */
ASSERT_TRUE(rb.Allocate(8u));
EXPECT_EQ(0u, rb.ReadSince(cursor, t, v, 8u));
EXPECT_EQ(static_cast<uint64>(0u), cursor);
rb.Write(100.0, 1.0);
ASSERT_EQ(1u, rb.ReadSince(cursor, t, v, 8u));
EXPECT_DOUBLE_EQ(100.0, t[0]);
}
TEST(SignalRingBufferGTest, TestClear) {
SignalRingBuffer rb;
ASSERT_TRUE(rb.Allocate(8u));
rb.Write(1.0, 1.0);
rb.Write(2.0, 2.0);
rb.Clear();
EXPECT_EQ(0u, rb.Count());
float64 t[8], v[8];
EXPECT_EQ(0u, rb.Read(t, v, 8u));
}
@@ -0,0 +1,222 @@
/**
* @file TriggerEngineGTest.cpp
* @brief Unit tests for the StreamHub hub-side trigger FSM.
*
* @copyright Copyright 2015 F4E | European Joint Undertaking for ITER and
* the Development of Fusion Energy ('Fusion for Energy').
* Licensed under the EUPL, Version 1.1 or - as soon they will be approved
* by the European Commission - subsequent versions of the EUPL (the "Licence")
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl
*
* @warning Unless required by applicable law or agreed to in writing,
* software distributed under the Licence is distributed on an "AS IS"
* basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the Licence permissions and limitations under the Licence.
*/
#include "TriggerEngine.h"
#include <gtest/gtest.h>
using namespace StreamHub;
using MARTe::float64;
static TriggerConfig MakeConfig(TrigEdge edge, float64 threshold,
float64 windowSec, float64 prePercent,
TrigAcqMode mode = kTrigNormal) {
TriggerConfig cfg;
cfg.signalKey = "src:sig";
cfg.edge = edge;
cfg.threshold = threshold;
cfg.windowSec = windowSec;
cfg.prePercent = prePercent;
cfg.mode = mode;
return cfg;
}
TEST(TriggerEngineGTest, TestInitialState) {
TriggerEngine eng;
EXPECT_EQ(kTrigIdle, eng.GetState());
EXPECT_FALSE(eng.GetStopped());
float64 tt, pre, post;
EXPECT_FALSE(eng.GetFiredWindow(tt, pre, post));
}
TEST(TriggerEngineGTest, TestIdleIgnoresSamples) {
TriggerEngine eng;
eng.SetConfig(MakeConfig(kEdgeRising, 0.5, 1.0, 20.0));
eng.CheckSample(1.0, 0.0);
eng.CheckSample(2.0, 1.0); /* would fire if armed */
EXPECT_EQ(kTrigIdle, eng.GetState());
}
TEST(TriggerEngineGTest, TestRisingEdgeFires) {
TriggerEngine eng;
eng.SetConfig(MakeConfig(kEdgeRising, 0.5, 1.0, 20.0));
eng.Arm();
EXPECT_EQ(kTrigArmed, eng.GetState());
eng.CheckSample(1.0, 0.0); /* primes prevValue */
eng.CheckSample(2.0, 1.0); /* 0.0 < 0.5 <= 1.0 → fire */
EXPECT_EQ(kTrigCollecting, eng.GetState());
float64 tt, pre, post;
ASSERT_TRUE(eng.GetFiredWindow(tt, pre, post));
EXPECT_DOUBLE_EQ(2.0, tt);
EXPECT_DOUBLE_EQ(0.2, pre); /* 1.0 s × 20 % */
EXPECT_DOUBLE_EQ(0.8, post);
}
TEST(TriggerEngineGTest, TestFirstSampleNeverFires) {
TriggerEngine eng;
eng.SetConfig(MakeConfig(kEdgeRising, 0.5, 1.0, 20.0));
eng.Arm();
/* First sample above threshold must only prime the detector */
eng.CheckSample(1.0, 2.0);
EXPECT_EQ(kTrigArmed, eng.GetState());
}
TEST(TriggerEngineGTest, TestFallingEdgeFires) {
TriggerEngine eng;
eng.SetConfig(MakeConfig(kEdgeFalling, 0.5, 1.0, 50.0));
eng.Arm();
eng.CheckSample(1.0, 1.0);
eng.CheckSample(2.0, 1.5); /* rising: must not fire */
EXPECT_EQ(kTrigArmed, eng.GetState());
eng.CheckSample(3.0, 0.2); /* 1.5 > 0.5 >= 0.2 → fire */
EXPECT_EQ(kTrigCollecting, eng.GetState());
float64 tt, pre, post;
ASSERT_TRUE(eng.GetFiredWindow(tt, pre, post));
EXPECT_DOUBLE_EQ(3.0, tt);
EXPECT_DOUBLE_EQ(0.5, pre);
EXPECT_DOUBLE_EQ(0.5, post);
}
TEST(TriggerEngineGTest, TestBothEdgesFire) {
TriggerEngine eng;
eng.SetConfig(MakeConfig(kEdgeBoth, 0.0, 1.0, 0.0));
eng.Arm();
eng.CheckSample(1.0, -1.0);
eng.CheckSample(2.0, 1.0); /* rising through 0 */
EXPECT_EQ(kTrigCollecting, eng.GetState());
eng.Arm();
eng.CheckSample(3.0, 1.0);
eng.CheckSample(4.0, -1.0); /* falling through 0 */
EXPECT_EQ(kTrigCollecting, eng.GetState());
}
TEST(TriggerEngineGTest, TestNoFireBelowThreshold) {
TriggerEngine eng;
eng.SetConfig(MakeConfig(kEdgeRising, 5.0, 1.0, 20.0));
eng.Arm();
eng.CheckSample(1.0, 0.0);
eng.CheckSample(2.0, 1.0);
eng.CheckSample(3.0, 4.9);
EXPECT_EQ(kTrigArmed, eng.GetState());
}
TEST(TriggerEngineGTest, TestConfigClamping) {
TriggerEngine eng;
eng.SetConfig(MakeConfig(kEdgeRising, 0.0, 100.0, 150.0));
TriggerConfig cfg = eng.GetConfig();
EXPECT_DOUBLE_EQ(10.0, cfg.windowSec);
EXPECT_DOUBLE_EQ(100.0, cfg.prePercent);
eng.SetConfig(MakeConfig(kEdgeRising, 0.0, 1.0e-6, -5.0));
cfg = eng.GetConfig();
EXPECT_DOUBLE_EQ(1.0e-4, cfg.windowSec);
EXPECT_DOUBLE_EQ(0.0, cfg.prePercent);
}
TEST(TriggerEngineGTest, TestConfigEpochIncrements) {
TriggerEngine eng;
MARTe::uint32 e0 = eng.GetConfigEpoch();
eng.SetConfig(MakeConfig(kEdgeRising, 0.0, 1.0, 20.0));
EXPECT_EQ(e0 + 1u, eng.GetConfigEpoch());
eng.SetConfig(MakeConfig(kEdgeFalling, 1.0, 2.0, 30.0));
EXPECT_EQ(e0 + 2u, eng.GetConfigEpoch());
}
TEST(TriggerEngineGTest, TestMarkTriggeredOnlyFromCollecting) {
TriggerEngine eng;
eng.SetConfig(MakeConfig(kEdgeRising, 0.5, 1.0, 20.0));
/* Not collecting: no-op */
eng.MarkTriggered();
EXPECT_EQ(kTrigIdle, eng.GetState());
eng.Arm();
eng.MarkTriggered();
EXPECT_EQ(kTrigArmed, eng.GetState());
/* Collecting → triggered */
eng.CheckSample(1.0, 0.0);
eng.CheckSample(2.0, 1.0);
ASSERT_EQ(kTrigCollecting, eng.GetState());
eng.MarkTriggered();
EXPECT_EQ(kTrigTriggered, eng.GetState());
}
TEST(TriggerEngineGTest, TestDisarmResetsEverything) {
TriggerEngine eng;
eng.SetConfig(MakeConfig(kEdgeRising, 0.5, 1.0, 20.0));
eng.Arm();
eng.SetStopped(true);
eng.CheckSample(1.0, 0.0);
eng.CheckSample(2.0, 1.0);
ASSERT_EQ(kTrigCollecting, eng.GetState());
eng.Disarm();
EXPECT_EQ(kTrigIdle, eng.GetState());
EXPECT_FALSE(eng.GetStopped());
float64 tt, pre, post;
EXPECT_FALSE(eng.GetFiredWindow(tt, pre, post));
}
TEST(TriggerEngineGTest, TestRearmResetsEdgeDetection) {
TriggerEngine eng;
eng.SetConfig(MakeConfig(kEdgeRising, 0.5, 1.0, 20.0));
eng.Arm();
eng.CheckSample(1.0, 0.0);
eng.CheckSample(2.0, 1.0);
eng.MarkTriggered();
ASSERT_EQ(kTrigTriggered, eng.GetState());
/* Re-arm: first sample only primes even if it crosses the threshold
* relative to the value seen before the re-arm. */
eng.Arm();
EXPECT_EQ(kTrigArmed, eng.GetState());
eng.CheckSample(3.0, 0.0);
EXPECT_EQ(kTrigArmed, eng.GetState());
eng.CheckSample(4.0, 1.0);
EXPECT_EQ(kTrigCollecting, eng.GetState());
float64 tt, pre, post;
ASSERT_TRUE(eng.GetFiredWindow(tt, pre, post));
EXPECT_DOUBLE_EQ(4.0, tt);
}
TEST(TriggerEngineGTest, TestStoppedFlag) {
TriggerEngine eng;
EXPECT_FALSE(eng.GetStopped());
eng.SetStopped(true);
EXPECT_TRUE(eng.GetStopped());
eng.SetStopped(false);
EXPECT_FALSE(eng.GetStopped());
}
TEST(TriggerEngineGTest, TestWindowLatchedAtFireTime) {
TriggerEngine eng;
eng.SetConfig(MakeConfig(kEdgeRising, 0.5, 1.0, 20.0));
eng.Arm();
eng.CheckSample(1.0, 0.0);
eng.CheckSample(2.0, 1.0);
ASSERT_EQ(kTrigCollecting, eng.GetState());
/* Config edits after the fire must not change the latched window */
eng.SetConfig(MakeConfig(kEdgeRising, 0.5, 10.0, 50.0));
float64 tt, pre, post;
ASSERT_TRUE(eng.GetFiredWindow(tt, pre, post));
EXPECT_DOUBLE_EQ(0.2, pre);
EXPECT_DOUBLE_EQ(0.8, post);
}
@@ -0,0 +1,19 @@
/**
* @file TriggerEngineSrc.cpp
* @brief Compiles the StreamHub TriggerEngine implementation into the test
* library (StreamHub builds an executable, not a linkable archive).
*
* @copyright Copyright 2015 F4E | European Joint Undertaking for ITER and
* the Development of Fusion Energy ('Fusion for Energy').
* Licensed under the EUPL, Version 1.1 or - as soon they will be approved
* by the European Commission - subsequent versions of the EUPL (the "Licence")
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl
*
* @warning Unless required by applicable law or agreed to in writing,
* software distributed under the Licence is distributed on an "AS IS"
* basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the Licence permissions and limitations under the Licence.
*/
#include "../../../Source/Applications/StreamHub/TriggerEngine.cpp"
@@ -0,0 +1,246 @@
../../../Build/x86-linux/Applications/StreamHub/LTTBGTest.o: LTTBGTest.cpp ../../../Source/Applications/StreamHub/LTTB.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Architecture/x86_gcc/CompilerTypes.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-internal.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-port.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-message.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-string.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-filepath.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-type-util.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-death-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-death-test-internal.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-param-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-param-util.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-linked_ptr.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-printers.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-param-util-generated.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest_prod.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-test-part.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-typed-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest_pred_impl.h
../../../Build/x86-linux/Applications/StreamHub/SignalRingBufferGTest.o: SignalRingBufferGTest.cpp \
../../../Source/Applications/StreamHub/SignalRingBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Architecture/x86_gcc/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FastPollingMutexSem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Atomic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/AtomicA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorInformation.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ErrorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TemplateParametersVerificator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/HighResolutionTimerA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimerCalibrator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-internal.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-port.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-message.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-string.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-filepath.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-type-util.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-death-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-death-test-internal.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-param-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-param-util.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-linked_ptr.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-printers.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-param-util-generated.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest_prod.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-test-part.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-typed-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest_pred_impl.h
../../../Build/x86-linux/Applications/StreamHub/TriggerEngineGTest.o: TriggerEngineGTest.cpp \
../../../Source/Applications/StreamHub/TriggerEngine.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Architecture/x86_gcc/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FastPollingMutexSem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Atomic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/AtomicA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorInformation.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ErrorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TemplateParametersVerificator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/HighResolutionTimerA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimerCalibrator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapManager.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/CharBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/BufferedStreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassProperties.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectsDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/StandardHeap.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../Generic/StandardHeap_Generic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Introspection.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/IntrospectionEntry.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TypeDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BasicType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolderT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/IteratorT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Iterator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SortFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SearchFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/LoadableLibrary.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticList.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Matrix.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Vector.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/MemoryOperationsHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FormatDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/IOBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamStringIOBuffer.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-internal.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-port.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-message.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-string.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-filepath.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-type-util.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-death-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-death-test-internal.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-param-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-param-util.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-linked_ptr.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-printers.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-param-util-generated.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest_prod.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-test-part.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-typed-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest_pred_impl.h
../../../Build/x86-linux/Applications/StreamHub/TriggerEngineSrc.o: TriggerEngineSrc.cpp \
../../../Source/Applications/StreamHub/TriggerEngine.cpp \
../../../Source/Applications/StreamHub/TriggerEngine.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Architecture/x86_gcc/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FastPollingMutexSem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Atomic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/AtomicA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorInformation.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ErrorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TemplateParametersVerificator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/HighResolutionTimerA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimerCalibrator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapManager.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/CharBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/BufferedStreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassProperties.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectsDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/StandardHeap.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../Generic/StandardHeap_Generic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Introspection.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/IntrospectionEntry.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TypeDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BasicType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolderT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/IteratorT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Iterator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SortFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SearchFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/LoadableLibrary.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticList.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Matrix.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Vector.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/MemoryOperationsHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FormatDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/IOBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamStringIOBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/AdvancedErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassProperties.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamMemoryReference.h
@@ -0,0 +1,246 @@
LTTBGTest.o: LTTBGTest.cpp ../../../Source/Applications/StreamHub/LTTB.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Architecture/x86_gcc/CompilerTypes.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-internal.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-port.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-message.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-string.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-filepath.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-type-util.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-death-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-death-test-internal.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-param-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-param-util.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-linked_ptr.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-printers.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-param-util-generated.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest_prod.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-test-part.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-typed-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest_pred_impl.h
SignalRingBufferGTest.o: SignalRingBufferGTest.cpp \
../../../Source/Applications/StreamHub/SignalRingBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Architecture/x86_gcc/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FastPollingMutexSem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Atomic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/AtomicA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorInformation.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ErrorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TemplateParametersVerificator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/HighResolutionTimerA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimerCalibrator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-internal.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-port.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-message.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-string.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-filepath.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-type-util.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-death-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-death-test-internal.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-param-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-param-util.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-linked_ptr.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-printers.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-param-util-generated.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest_prod.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-test-part.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-typed-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest_pred_impl.h
TriggerEngineGTest.o: TriggerEngineGTest.cpp \
../../../Source/Applications/StreamHub/TriggerEngine.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Architecture/x86_gcc/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FastPollingMutexSem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Atomic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/AtomicA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorInformation.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ErrorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TemplateParametersVerificator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/HighResolutionTimerA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimerCalibrator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapManager.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/CharBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/BufferedStreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassProperties.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectsDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/StandardHeap.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../Generic/StandardHeap_Generic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Introspection.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/IntrospectionEntry.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TypeDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BasicType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolderT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/IteratorT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Iterator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SortFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SearchFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/LoadableLibrary.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticList.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Matrix.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Vector.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/MemoryOperationsHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FormatDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/IOBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamStringIOBuffer.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-internal.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-port.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-message.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-string.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-filepath.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-type-util.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-death-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-death-test-internal.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-param-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-param-util.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-linked_ptr.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-printers.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-param-util-generated.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest_prod.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-test-part.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-typed-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest_pred_impl.h
TriggerEngineSrc.o: TriggerEngineSrc.cpp \
../../../Source/Applications/StreamHub/TriggerEngine.cpp \
../../../Source/Applications/StreamHub/TriggerEngine.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Architecture/x86_gcc/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FastPollingMutexSem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Atomic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/AtomicA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorInformation.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ErrorType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TemplateParametersVerificator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Architecture/x86_gcc/HighResolutionTimerA.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HighResolutionTimer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/HighResolutionTimerCalibrator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeStamp.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapManager.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/CharBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitBoolean.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/BufferedStreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TimeoutType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassProperties.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectsDatabase.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GlobalObjectI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/StandardHeap.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../Generic/StandardHeap_Generic.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItem.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CString.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Introspection.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/IntrospectionEntry.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/TypeDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BasicType.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/BitRange.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/ZeroTerminatedArray.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolderT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/IteratorT.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Iterator.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListable.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SortFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/SearchFilter.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/LoadableLibrary.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticList.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StaticListHolder.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Matrix.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Vector.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/MemoryOperationsHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/FormatDescriptor.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/IOBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamStringIOBuffer.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/AdvancedErrorManagement.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassProperties.h \
/home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamMemoryReference.h
@@ -31,6 +31,7 @@ MAKEDEFAULTDIR=$(MARTe2_DIR)/MakeDefaults
include $(MAKEDEFAULTDIR)/MakeStdLibDefs.$(TARGET)
INCLUDES += -I.
INCLUDES += -I$(ROOT_DIR)/Source/Components/Interfaces/UDPStream
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L0Types
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L1Portability
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L2Objects
@@ -0,0 +1,20 @@
../../../../Build/x86-linux/Components/DataSources/UDPStreamer/UDPStreamerGTest.o: UDPStreamerGTest.cpp \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-internal.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-port.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-message.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-string.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-filepath.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-type-util.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-death-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-death-test-internal.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-param-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-param-util.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-linked_ptr.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-printers.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-param-util-generated.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest_prod.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-test-part.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-typed-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest_pred_impl.h \
UDPStreamerTest.h
@@ -0,0 +1,20 @@
UDPStreamerGTest.o: UDPStreamerGTest.cpp \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-internal.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-port.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-message.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-string.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-filepath.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-type-util.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-death-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-death-test-internal.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-param-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-param-util.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-linked_ptr.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-printers.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/internal/gtest-param-util-generated.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest_prod.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-test-part.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest-typed-test.h \
/home/martino/workspace/MARTe2/Lib/gtest-1.7.0/include/gtest/gtest_pred_impl.h \
UDPStreamerTest.h
+364
View File
@@ -0,0 +1,364 @@
/**
* streamhub_demo.cfg — MARTe2 app for the StreamHub demo.
*
* Three real-time threads, each feeding a UDPStreamer instance.
* No DebugService — monitoring is done via StreamHub + WebSocket clients.
*
* Thread1 1 kHz — scalar signals → UDPStreamer port 44500
* Counter, Time, Sine1 (1 Hz, 5 V), Sine2 (0.3 Hz, 3 V)
* Accumulate mode, multicast group 239.0.0.1 data port 44503
*
* Thread2 5 kHz — packed arrays → UDPStreamer port 44501
* Ch1 float32[1000] @ 1 kHz (TimeMode = FirstSample)
* Ch2 float32[1000] @ 10 kHz (TimeMode = LastSample)
*
* Thread3 5 kHz — FullArray + per-sample timestamps → UDPStreamer port 44502
* Ch3 float32[1000] @ 3 kHz (TimeMode = FullArray)
* Ch4 float32[1000] @ 500 Hz (TimeMode = FullArray)
*/
$App = {
Class = RealTimeApplication
+Functions = {
Class = ReferenceContainer
// ── Thread1: 1 kHz scalar signals ────────────────────────────────────
+TimerGAM = {
Class = IOGAM
InputSignals = {
Counter = {
DataSource = Timer
Type = uint32
Frequency = 1000
}
Time = {
DataSource = Timer
Type = uint32
}
}
OutputSignals = {
Counter = { DataSource = DDB1 Type = uint32 }
Time = { DataSource = DDB1 Type = uint32 }
}
}
+SineGAM1 = {
Class = SineArrayGAM
Frequency = 1.0
Amplitude = 5.0
Phase = 0.0
Offset = 0.0
SamplingRate = 1000.0
OutputSignals = {
Sine1 = { DataSource = DDB1 Type = float32 }
}
}
+SineGAM2 = {
Class = SineArrayGAM
Frequency = 0.3
Amplitude = 3.0
Phase = 1.0472
Offset = 0.0
SamplingRate = 1000.0
OutputSignals = {
Sine2 = { DataSource = DDB1 Type = float32 }
}
}
+StreamerGAM1 = {
Class = IOGAM
InputSignals = {
Counter = { DataSource = DDB1 Type = uint32 }
Time = { DataSource = DDB1 Type = uint32 }
Sine1 = { DataSource = DDB1 Type = float32 }
Sine2 = { DataSource = DDB1 Type = float32 }
}
OutputSignals = {
Counter = { DataSource = Streamer1 Type = uint32 }
Time = { DataSource = Streamer1 Type = uint32 }
Sine1 = { DataSource = Streamer1 Type = float32 }
Sine2 = { DataSource = Streamer1 Type = float32 }
}
}
// ── Thread2: 5 kHz packed arrays (FirstSample / LastSample) ──────────
+FastTimerGAM = {
Class = IOGAM
InputSignals = {
Time = {
DataSource = FastTimer
Type = uint32
Frequency = 5000
}
}
OutputSignals = {
Time = { DataSource = DDB2 Type = uint32 }
}
}
+SineGAM3 = {
Class = SineArrayGAM
Frequency = 1000.0
Amplitude = 1.0
Phase = 0.0
Offset = 0.0
SamplingRate = 5000000.0
OutputSignals = {
Ch1 = {
DataSource = DDB2
Type = float32
NumberOfDimensions = 1
NumberOfElements = 1000
}
}
}
+SineGAM4 = {
Class = SineArrayGAM
Frequency = 10000.0
Amplitude = 0.5
Phase = 1.5708
Offset = 0.0
SamplingRate = 5000000.0
OutputSignals = {
Ch2 = {
DataSource = DDB2
Type = float32
NumberOfDimensions = 1
NumberOfElements = 1000
}
}
}
+StreamerGAM2 = {
Class = IOGAM
InputSignals = {
Time = { DataSource = DDB2 Type = uint32 }
Ch1 = { DataSource = DDB2 Type = float32 NumberOfDimensions = 1 NumberOfElements = 1000 }
Ch2 = { DataSource = DDB2 Type = float32 NumberOfDimensions = 1 NumberOfElements = 1000 }
}
OutputSignals = {
Time = { DataSource = Streamer2 Type = uint32 }
Ch1 = { DataSource = Streamer2 Type = float32 NumberOfDimensions = 1 NumberOfElements = 1000 }
Ch2 = { DataSource = Streamer2 Type = float32 NumberOfDimensions = 1 NumberOfElements = 1000 }
}
}
// ── Thread3: 5 kHz FullArray with per-sample timestamps ──────────────
+FullArrTimerGAM = {
Class = IOGAM
InputSignals = {
Time = {
DataSource = FullArrTimer
Type = uint32
Frequency = 5000
}
}
OutputSignals = {
Time = { DataSource = DDB3 Type = uint32 }
}
}
+SineGAM5 = {
Class = SineArrayGAM
Frequency = 3000.0
Amplitude = 2.0
Phase = 0.0
Offset = 0.0
SamplingRate = 5000000.0
OutputSignals = {
Ch3 = {
DataSource = DDB3
Type = float32
NumberOfDimensions = 1
NumberOfElements = 1000
}
}
}
+SineGAM6 = {
Class = SineArrayGAM
Frequency = 500.0
Amplitude = 3.0
Phase = 0.7854
Offset = 0.0
SamplingRate = 5000000.0
OutputSignals = {
Ch4 = {
DataSource = DDB3
Type = float32
NumberOfDimensions = 1
NumberOfElements = 1000
}
}
}
+TimeArrayGAM1 = {
Class = TimeArrayGAM
SamplingRate = 5000000.0
Anchor = FirstSample
InputSignals = {
Time = { DataSource = DDB3 Type = uint32 }
}
OutputSignals = {
TimeArray = {
DataSource = DDB3
Type = uint64
NumberOfDimensions = 1
NumberOfElements = 1000
}
}
}
+StreamerGAM3 = {
Class = IOGAM
InputSignals = {
TimeArray = { DataSource = DDB3 Type = uint64 NumberOfDimensions = 1 NumberOfElements = 1000 }
Ch3 = { DataSource = DDB3 Type = float32 NumberOfDimensions = 1 NumberOfElements = 1000 }
Ch4 = { DataSource = DDB3 Type = float32 NumberOfDimensions = 1 NumberOfElements = 1000 }
}
OutputSignals = {
TimeArray = { DataSource = Streamer3 Type = uint64 NumberOfDimensions = 1 NumberOfElements = 1000 }
Ch3 = { DataSource = Streamer3 Type = float32 NumberOfDimensions = 1 NumberOfElements = 1000 }
Ch4 = { DataSource = Streamer3 Type = float32 NumberOfDimensions = 1 NumberOfElements = 1000 }
}
}
}
+Data = {
Class = ReferenceContainer
DefaultDataSource = DDB1
+DDB1 = { Class = GAMDataSource }
+DDB2 = { Class = GAMDataSource }
+DDB3 = { Class = GAMDataSource }
+Timer = {
Class = LinuxTimer
SleepNature = "Default"
Signals = {
Counter = { Type = uint32 }
Time = { Type = uint32 }
}
}
+FastTimer = {
Class = LinuxTimer
SleepNature = "Default"
Signals = {
Counter = { Type = uint32 }
Time = { Type = uint32 }
}
}
+FullArrTimer = {
Class = LinuxTimer
SleepNature = "Default"
Signals = {
Counter = { Type = uint32 }
Time = { Type = uint32 }
}
}
+Streamer1 = {
Class = UDPStreamer
Port = 44500
MulticastGroup = "239.0.0.1"
DataPort = 44503
MaxPayloadSize = 1400
PublishingMode = "Accumulate"
MinRefreshRate = 100
Signals = {
Counter = { Type = uint32 }
Time = { Type = uint32 Unit = "us" }
Sine1 = { Type = float32 Unit = "V" RangeMin = -5.0 RangeMax = 5.0 }
Sine2 = { Type = float32 Unit = "V" RangeMin = -3.0 RangeMax = 3.0 }
}
}
+Streamer2 = {
Class = UDPStreamer
Port = 44501
MaxPayloadSize = 1400
PublishingMode = "Decimate"
Ratio = 50
Signals = {
Time = { Type = uint32 Unit = "us" }
Ch1 = {
Type = float32 Unit = "V"
NumberOfDimensions = 1 NumberOfElements = 1000
TimeMode = FirstSample TimeSignal = Time SamplingRate = 5000000.0
}
Ch2 = {
Type = float32 Unit = "V"
NumberOfDimensions = 1 NumberOfElements = 1000
TimeMode = LastSample TimeSignal = Time SamplingRate = 5000000.0
}
}
}
+Streamer3 = {
Class = UDPStreamer
Port = 44502
MaxPayloadSize = 1400
PublishingMode = "Decimate"
Ratio = 50
Signals = {
TimeArray = {
Type = uint64 Unit = "ns"
NumberOfDimensions = 1 NumberOfElements = 1000
}
Ch3 = {
Type = float32 Unit = "V"
NumberOfDimensions = 1 NumberOfElements = 1000
TimeMode = FullArray TimeSignal = TimeArray
}
Ch4 = {
Type = float32 Unit = "V"
NumberOfDimensions = 1 NumberOfElements = 1000
TimeMode = FullArray TimeSignal = TimeArray
}
}
}
+Timings = { Class = TimingDataSource }
}
+States = {
Class = ReferenceContainer
+Running = {
Class = RealTimeState
+Threads = {
Class = ReferenceContainer
+Thread1 = {
Class = RealTimeThread
CPUs = 0x1
Functions = {TimerGAM SineGAM1 SineGAM2 StreamerGAM1}
}
+Thread2 = {
Class = RealTimeThread
CPUs = 0x2
Functions = {FastTimerGAM SineGAM3 SineGAM4 StreamerGAM2}
}
+Thread3 = {
Class = RealTimeThread
CPUs = 0x4
Functions = {FullArrTimerGAM SineGAM5 SineGAM6 TimeArrayGAM1 StreamerGAM3}
}
}
}
}
+Scheduler = {
Class = GAMScheduler
TimingDataSource = Timings
}
}
+7
View File
@@ -0,0 +1,7 @@
module streamhub-e2e
go 1.21
require github.com/gorilla/websocket v1.5.1
require golang.org/x/net v0.17.0 // indirect
+4
View File
@@ -0,0 +1,4 @@
github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
+499
View File
@@ -0,0 +1,499 @@
// Command streamhub-e2e is an end-to-end test client for the C++ StreamHub.
//
// It connects to a running StreamHub WebSocket endpoint (with at least one
// connected UDPStreamer source, e.g. the stack launched by run_e2e_test.sh)
// and verifies the full protocol:
//
// 1. "sources" event with at least one connected source
// 2. "config" event per source with at least one signal
// 3. binary v1 data pushes: parseable, per-signal monotonic time,
// timestamps within a few seconds of wall clock (Unix time base)
// 4. "stats" event with a positive receive rate
// 5. WS zoom round-trip: reqId echoed, points returned in [t0,t1]
// 6. hub-side trigger: setTrigger+arm → triggerState(armed) → binary v2
// capture frame with the latched pre/post window
//
// Exit code 0 on success; 1 with a FAIL message otherwise.
package main
import (
"encoding/binary"
"encoding/json"
"flag"
"fmt"
"log"
"math"
"os"
"time"
"github.com/gorilla/websocket"
)
var hub = flag.String("hub", "127.0.0.1:8090", "StreamHub host:port")
var timeout = flag.Duration("timeout", 30*time.Second, "overall test timeout")
var verbose = flag.Bool("v", false, "log every received event")
// ---------------------------------------------------------------------------
// Wire types (subset of the StreamHub JSON protocol)
// ---------------------------------------------------------------------------
type sourceInfo struct {
ID string `json:"id"`
Label string `json:"label"`
Addr string `json:"addr"`
State string `json:"state"`
}
type signalInfo struct {
Name string `json:"name"`
TypeCode uint32 `json:"typeCode"`
NumRows uint32 `json:"numRows"`
NumCols uint32 `json:"numCols"`
TimeMode int `json:"timeMode"`
Rate float64 `json:"samplingRate"`
}
type statInfo struct {
State string `json:"state"`
TotalReceived uint64 `json:"totalReceived"`
RateHz float64 `json:"rateHz"`
CycleHist []f64 `json:"cycleHist"`
}
type f64 = float64
type zoomPoints struct {
T []float64 `json:"t"`
V []float64 `json:"v"`
}
type event struct {
Type string `json:"type"`
Sources json.RawMessage `json:"sources"`
SourceID string `json:"sourceId"`
Signals json.RawMessage `json:"signals"`
ReqID uint32 `json:"reqId"`
State string `json:"state"`
TrigTime float64 `json:"trigTime"`
}
// Parsed binary v1 push frame: sourceId → signal → samples.
type pushFrame struct {
sourceID string
signals map[string]zoomPoints
}
// Parsed binary v2 capture frame.
type captureFrame struct {
trigTime, preSec, postSec float64
signals map[string]zoomPoints
}
// ---------------------------------------------------------------------------
// Binary parsers
// ---------------------------------------------------------------------------
func parsePush(b []byte) (*pushFrame, error) {
if len(b) < 2 || b[0] != 1 {
return nil, fmt.Errorf("not a v1 frame")
}
idLen := int(b[1])
off := 2
if len(b) < off+idLen+4 {
return nil, fmt.Errorf("truncated header")
}
f := &pushFrame{sourceID: string(b[off : off+idLen]),
signals: map[string]zoomPoints{}}
off += idLen
nSig := int(binary.LittleEndian.Uint32(b[off:]))
off += 4
for s := 0; s < nSig; s++ {
if len(b) < off+2 {
return nil, fmt.Errorf("truncated keyLen (sig %d)", s)
}
keyLen := int(binary.LittleEndian.Uint16(b[off:]))
off += 2
if len(b) < off+keyLen+4 {
return nil, fmt.Errorf("truncated key (sig %d)", s)
}
key := string(b[off : off+keyLen])
off += keyLen
n := int(binary.LittleEndian.Uint32(b[off:]))
off += 4
if len(b) < off+16*n {
return nil, fmt.Errorf("truncated data (sig %s n=%d)", key, n)
}
pts := zoomPoints{T: make([]float64, n), V: make([]float64, n)}
for i := 0; i < n; i++ {
pts.T[i] = math.Float64frombits(binary.LittleEndian.Uint64(b[off+8*i:]))
}
off += 8 * n
for i := 0; i < n; i++ {
pts.V[i] = math.Float64frombits(binary.LittleEndian.Uint64(b[off+8*i:]))
}
off += 8 * n
f.signals[key] = pts
}
return f, nil
}
func parseCapture(b []byte) (*captureFrame, error) {
if len(b) < 1+24+4 || b[0] != 2 {
return nil, fmt.Errorf("not a v2 frame")
}
rdF64 := func(off int) float64 {
return math.Float64frombits(binary.LittleEndian.Uint64(b[off:]))
}
f := &captureFrame{
trigTime: rdF64(1), preSec: rdF64(9), postSec: rdF64(17),
signals: map[string]zoomPoints{},
}
off := 25
nSig := int(binary.LittleEndian.Uint32(b[off:]))
off += 4
for s := 0; s < nSig; s++ {
keyLen := int(binary.LittleEndian.Uint16(b[off:]))
off += 2
key := string(b[off : off+keyLen])
off += keyLen
n := int(binary.LittleEndian.Uint32(b[off:]))
off += 4
if len(b) < off+16*n {
return nil, fmt.Errorf("truncated capture (sig %s n=%d)", key, n)
}
pts := zoomPoints{T: make([]float64, n), V: make([]float64, n)}
for i := 0; i < n; i++ {
pts.T[i] = math.Float64frombits(binary.LittleEndian.Uint64(b[off+8*i:]))
}
off += 8 * n
for i := 0; i < n; i++ {
pts.V[i] = math.Float64frombits(binary.LittleEndian.Uint64(b[off+8*i:]))
}
off += 8 * n
f.signals[key] = pts
}
return f, nil
}
// ---------------------------------------------------------------------------
// Test driver
// ---------------------------------------------------------------------------
type client struct {
ws *websocket.Conn
deadline time.Time
sources []sourceInfo
configs map[string][]signalInfo // sourceId → signals
pushes []*pushFrame
stats map[string]statInfo
zooms map[uint32]map[string]zoomPoints
trigSt []string // observed triggerState sequence
captures []*captureFrame
}
func (c *client) send(v interface{}) {
b, _ := json.Marshal(v)
if err := c.ws.WriteMessage(websocket.TextMessage, b); err != nil {
fail("ws write: %v", err)
}
}
// pump reads one WS message (with a short read deadline) and dispatches it.
func (c *client) pump() {
c.ws.SetReadDeadline(time.Now().Add(500 * time.Millisecond))
mt, data, err := c.ws.ReadMessage()
if err != nil {
if websocket.IsUnexpectedCloseError(err) {
fail("ws closed: %v", err)
}
return // read timeout — fine
}
switch mt {
case websocket.BinaryMessage:
if len(data) == 0 {
return
}
switch data[0] {
case 1:
if f, err := parsePush(data); err == nil {
c.pushes = append(c.pushes, f)
} else {
fail("bad v1 frame: %v", err)
}
case 2:
if f, err := parseCapture(data); err == nil {
c.captures = append(c.captures, f)
} else {
fail("bad v2 frame: %v", err)
}
default:
fail("unknown binary frame version %d", data[0])
}
case websocket.TextMessage:
var ev event
if err := json.Unmarshal(data, &ev); err != nil {
fail("bad JSON event: %v (%.120s)", err, data)
}
if *verbose {
log.Printf("event %-12s %.160s", ev.Type, data)
}
switch ev.Type {
case "sources":
var srcs []sourceInfo
if err := json.Unmarshal(ev.Sources, &srcs); err == nil {
c.sources = srcs
}
case "config":
var sigs []signalInfo
if err := json.Unmarshal(ev.Signals, &sigs); err == nil {
c.configs[ev.SourceID] = sigs
} else {
log.Printf("config parse error: %v (%.200s)", err, data)
}
case "stats":
var st map[string]statInfo
if err := json.Unmarshal(ev.Sources, &st); err == nil {
c.stats = st
}
case "zoom":
var body struct {
Signals map[string]zoomPoints `json:"signals"`
}
if err := json.Unmarshal(data, &body); err == nil {
c.zooms[ev.ReqID] = body.Signals
}
case "triggerState":
c.trigSt = append(c.trigSt, ev.State)
}
}
}
// waitFor pumps messages until cond() or the step deadline expires.
func (c *client) waitFor(what string, d time.Duration, cond func() bool) {
end := time.Now().Add(d)
if end.After(c.deadline) {
end = c.deadline
}
for time.Now().Before(end) {
if cond() {
log.Printf("OK %s", what)
return
}
c.pump()
}
fail("timeout waiting for %s", what)
}
func fail(format string, args ...interface{}) {
fmt.Printf("FAIL "+format+"\n", args...)
os.Exit(1)
}
func main() {
flag.Parse()
url := "ws://" + *hub + "/ws"
log.Printf("connecting to %s", url)
ws, _, err := websocket.DefaultDialer.Dial(url, nil)
if err != nil {
fail("dial %s: %v", url, err)
}
defer ws.Close()
c := &client{
ws: ws,
deadline: time.Now().Add(*timeout),
configs: map[string][]signalInfo{},
zooms: map[uint32]map[string]zoomPoints{},
}
// ── 1. sources ────────────────────────────────────────────────────────
c.send(map[string]interface{}{"type": "getSources"})
c.waitFor("sources event with a connected source", 10*time.Second, func() bool {
for _, s := range c.sources {
if s.State == "connected" {
return true
}
}
return false
})
// ── 2. config per connected source ───────────────────────────────────
for _, s := range c.sources {
log.Printf("source %s (%s): state=%s", s.ID, s.Label, s.State)
c.send(map[string]interface{}{"type": "getConfig", "sourceId": s.ID})
}
c.waitFor("config with signals for every connected source", 10*time.Second, func() bool {
for _, s := range c.sources {
if s.State != "connected" {
continue
}
if len(c.configs[s.ID]) == 0 {
return false
}
}
return len(c.sources) > 0
})
// ── 3. binary pushes: wall-clock time base + monotonicity ────────────
c.waitFor("binary v1 data pushes (>=10 frames)", 10*time.Second, func() bool {
return len(c.pushes) >= 10
})
now := float64(time.Now().UnixNano()) / 1e9
seen := map[string][]float64{} // last times per src:sig
for _, f := range c.pushes {
for key, pts := range f.signals {
full := f.sourceID + ":" + key
for i, t := range pts.T {
if math.Abs(t-now) > 30.0 {
fail("timestamp not wall-clock: %s t=%.3f now=%.3f", full, t, now)
}
prev := seen[full]
if len(prev) > 0 && t < prev[len(prev)-1]-1e-9 {
fail("non-monotonic time on %s: %.9f after %.9f (i=%d)",
full, t, prev[len(prev)-1], i)
}
seen[full] = append(seen[full], t)
}
}
}
if len(seen) == 0 {
fail("pushes contained no signal data")
}
log.Printf("OK wall-clock & monotonic time on %d signal streams", len(seen))
// ── 4. stats ──────────────────────────────────────────────────────────
c.send(map[string]interface{}{"type": "getStats"})
c.waitFor("stats with positive rate", 10*time.Second, func() bool {
for _, st := range c.stats {
if st.State == "connected" && st.RateHz > 0 && st.TotalReceived > 0 {
return true
}
}
return false
})
// ── 5. zoom round-trip ───────────────────────────────────────────────
// Use the busiest streamed signal and the time range we actually saw.
var zoomKey string
var zMax int
for k, ts := range seen {
if len(ts) > zMax {
zMax, zoomKey = len(ts), k
}
}
ts := seen[zoomKey]
t1 := ts[len(ts)-1]
t0 := t1 - 0.5
const reqID = 4242
c.send(map[string]interface{}{
"type": "zoom", "reqId": reqID, "t0": t0, "t1": t1, "n": 200,
"signals": zoomKey,
})
c.waitFor(fmt.Sprintf("zoom reply (reqId=%d, %s)", reqID, zoomKey),
10*time.Second, func() bool {
sigs, ok := c.zooms[reqID]
if !ok {
return false
}
pts, ok := sigs[zoomKey]
if !ok || len(pts.T) < 2 {
fail("zoom reply missing %s (got %d signals)", zoomKey, len(sigs))
}
for _, t := range pts.T {
if t < t0-1e-6 || t > t1+1e-6 {
fail("zoom point outside range: t=%.9f not in [%.9f,%.9f]", t, t0, t1)
}
}
return true
})
// ── 6. trigger: arm → capture ────────────────────────────────────────
// Trigger on an *oscillating* signal at its mean observed value: a
// monotonic ramp (counter, time array) crosses its past mean only once,
// before arming, so a rising edge would never fire on it. Pick the
// busiest signal whose last push frame is non-monotonic (a sine).
lastVals := map[string][]float64{}
for _, f := range c.pushes {
for name, pts := range f.signals {
if len(pts.V) >= 4 {
lastVals[f.sourceID+":"+name] = pts.V
}
}
}
trigKey := ""
tMaxPts := 0
for k, vs := range lastVals {
monotonic := true
for i := 1; i < len(vs); i++ {
if vs[i] < vs[i-1] {
monotonic = false
break
}
}
if !monotonic && len(seen[k]) > tMaxPts {
tMaxPts, trigKey = len(seen[k]), k
}
}
if trigKey == "" {
fail("no oscillating signal found for trigger test")
}
vals := lastVals[trigKey]
mean := 0.0
for _, v := range vals {
mean += v
}
mean /= float64(len(vals))
log.Printf(" trigger signal %s, threshold %.6g", trigKey, mean)
c.send(map[string]interface{}{
"type": "setTrigger", "signal": trigKey, "edge": "rising",
"threshold": mean, "windowSec": 0.1, "prePercent": 20.0,
"mode": "single",
})
c.send(map[string]interface{}{"type": "arm"})
// The trigger can fire within microseconds of arming (5 MS/s sine), so
// the broadcast emitted by the arm command may already say "collecting"
// or even "triggered" — any of these proves the arm was accepted.
c.waitFor("triggerState: armed/collecting/triggered", 5*time.Second, func() bool {
for _, s := range c.trigSt {
if s == "armed" || s == "collecting" || s == "triggered" {
return true
}
}
return false
})
c.waitFor("binary v2 capture frame", 15*time.Second, func() bool {
return len(c.captures) > 0
})
cap0 := c.captures[0]
if math.Abs(cap0.preSec-0.02) > 1e-9 || math.Abs(cap0.postSec-0.08) > 1e-9 {
fail("capture window mismatch: pre=%.6f post=%.6f (want 0.02/0.08)",
cap0.preSec, cap0.postSec)
}
pts, ok := cap0.signals[trigKey]
if !ok || len(pts.T) == 0 {
fail("capture missing trigger signal %s (%d signals)", trigKey, len(cap0.signals))
}
for _, t := range pts.T {
if t < cap0.trigTime-cap0.preSec-1e-3 || t > cap0.trigTime+cap0.postSec+1e-3 {
fail("capture point outside window: t=%.9f trig=%.9f", t, cap0.trigTime)
}
}
log.Printf("OK capture: trig=%.6f pre=%.3fs post=%.3fs %d signals",
cap0.trigTime, cap0.preSec, cap0.postSec, len(cap0.signals))
c.waitFor("triggerState: triggered", 5*time.Second, func() bool {
for _, s := range c.trigSt {
if s == "triggered" {
return true
}
}
return false
})
c.send(map[string]interface{}{"type": "disarm"})
fmt.Println("PASS streamhub-e2e: all checks passed")
}
BIN
View File
Binary file not shown.
+2
View File
@@ -9,6 +9,7 @@ MAKEDEFAULTDIR=$(MARTe2_DIR)/MakeDefaults
include $(MAKEDEFAULTDIR)/MakeStdLibDefs.$(TARGET)
INCLUDES += -I$(ROOT_DIR)/Common/UDP
INCLUDES += -I$(ROOT_DIR)/Source/Components/Interfaces/UDPStream
INCLUDES += -I$(ROOT_DIR)/Source/Components/Interfaces/DebugService
INCLUDES += -I$(ROOT_DIR)/Source/Components/Interfaces/TCPLogger
@@ -34,6 +35,7 @@ INCLUDES += -I$(MARTe2_Components_DIR)/Source/Components/DataSources/LinuxTimer
LIBRARIES += -L$(MARTe2_DIR)/Build/$(TARGET)/Core -lMARTe2
LIBRARIES += -L$(MARTe2_Components_DIR)/Build/$(TARGET)/Components/DataSources/LinuxTimer -lLinuxTimer
LIBRARIES += -L$(MARTe2_Components_DIR)/Build/$(TARGET)/Components/GAMs/IOGAM -lIOGAM
LIBRARIES += -L$(ROOT_DIR)/Build/$(TARGET)/Components/Interfaces/UDPStream -lUDPStream
LIBRARIES += -L$(ROOT_DIR)/Build/$(TARGET)/Components/Interfaces/DebugService -lDebugService
LIBRARIES += -L$(ROOT_DIR)/Build/$(TARGET)/Components/Interfaces/TCPLogger -lTcpLogger