diff --git a/Common/Client/go/wshub/export.go b/Common/Client/go/wshub/export.go new file mode 100644 index 0000000..77ee9bb --- /dev/null +++ b/Common/Client/go/wshub/export.go @@ -0,0 +1,119 @@ +package wshub + +import ( + "fmt" + "net/http" + "sort" + "strconv" + "strings" + "time" + + "github.com/parquet-go/parquet-go" +) + +// ExportSample is one row of the binary export: a single stored sample, in +// long ("tidy") form, keyed by source and signal with its own timestamp. +// +// Keeping each signal's samples as its own rows — rather than resampling onto a +// shared time grid — is what makes the export hole-free: per-signal streams of +// different lengths export exactly as stored, nothing is fabricated, and +// nothing is dropped. +type ExportSample struct { + Source string `parquet:"source"` + Signal string `parquet:"signal"` + Time float64 `parquet:"time"` + Value float64 `parquet:"value"` +} + +// exportChunkRows bounds each batched write and, via MaxRowsPerRowGroup, the +// size of each parquet row group: memory stays bounded however large the +// export is, because a finished row group is flushed to the HTTP stream. +const exportChunkRows = 65536 + +// exportWriteBuffer is the parquet writer's output buffer: larger than the +// 32KiB default means fewer writes on the HTTP stream for a multi-GB export. +const exportWriteBuffer = 1 << 20 + +// HandleExport serves GET /api/export?t0=..&t1=..[&signals=a,b] as a Parquet +// file containing every stored sample of the named signals in [t0, t1]. +// +// Unlike /api/zoom there is no decimation: the file holds the full contents of +// the rings. At rates above the ring budget those contents are min/max buckets +// (the finest resolution the hub retains); at lower rates they are verbatim. +func (h *Hub) HandleExport(w http.ResponseWriter, r *http.Request) { + q := r.URL.Query() + t0, err0 := strconv.ParseFloat(q.Get("t0"), 64) + t1, err1 := strconv.ParseFloat(q.Get("t1"), 64) + if err0 != nil || err1 != nil || t1 <= t0 { + http.Error(w, "invalid t0/t1", http.StatusBadRequest) + return + } + var keys []string + if s := strings.TrimSpace(q.Get("signals")); s != "" { + keys = strings.Split(s, ",") + for i := range keys { + keys[i] = strings.TrimSpace(keys[i]) + } + } + + // Snapshot the rings we will read. A signal removed mid-export must not + // silently drop rows from the file. + h.ringsMu.RLock() + refs := make(map[string]*sigRing) + if keys == nil { + for k, rb := range h.rings { + refs[k] = rb + } + } else { + for _, k := range keys { + if rb, ok := h.rings[k]; ok { + refs[k] = rb + } + } + } + h.ringsMu.RUnlock() + if len(refs) == 0 { + http.Error(w, "no signals", http.StatusNotFound) + return + } + + // Deterministic column order. + names := make([]string, 0, len(refs)) + for k := range refs { + names = append(names, k) + } + sort.Strings(names) + + w.Header().Set("Content-Type", "application/vnd.apache.parquet") + w.Header().Set("Content-Disposition", + fmt.Sprintf("attachment; filename=\"signals_%d.parquet\"", time.Now().Unix())) + + writer := parquet.NewGenericWriter[ExportSample](w, + parquet.MaxRowsPerRowGroup(exportChunkRows), + parquet.WriteBufferSize(exportWriteBuffer), + ) + batch := make([]ExportSample, 0, exportChunkRows) + for _, key := range names { + st, sv := refs[key].slice(t0, t1) + colon := strings.IndexByte(key, ':') + source, signal := key, key + if colon >= 0 { + source = key[:colon] + signal = key[colon+1:] + } + for i := range st { + batch = append(batch, ExportSample{Source: source, Signal: signal, Time: st[i], Value: sv[i]}) + if len(batch) >= exportChunkRows { + if _, err := writer.Write(batch); err != nil { + // Client went away or the stream broke; stop writing. + return + } + batch = batch[:0] + } + } + } + if len(batch) > 0 { + _, _ = writer.Write(batch) + } + _ = writer.Close() +} diff --git a/Common/Client/go/wshub/export_test.go b/Common/Client/go/wshub/export_test.go new file mode 100644 index 0000000..f32745d --- /dev/null +++ b/Common/Client/go/wshub/export_test.go @@ -0,0 +1,87 @@ +package wshub + +import ( + "bytes" + "net/http/httptest" + "testing" + + "github.com/parquet-go/parquet-go" +) + +func TestHandleExportParquetFullResolution(t *testing.T) { + h := NewHub() + // Two signals with different lengths and offset time bases: the export must + // keep every sample of each, on its own timestamps (no holes, no + // resampling, no decimation). + sig1 := newSigRing(10000) + sig2 := newSigRing(10000) + t1, v1 := make([]float64, 1000), make([]float64, 1000) + for i := range t1 { + t1[i] = float64(i) * 0.001 + v1[i] = float64(i) * 2 + } + sig1.write(t1, v1) + t2, v2 := make([]float64, 500), make([]float64, 500) + for i := range t2 { + t2[i] = 0.1 + float64(i)*0.002 + v2[i] = -float64(i) + } + sig2.write(t2, v2) + h.rings["s1:Ch1"] = sig1 + h.rings["s1:Ch2"] = sig2 + + req := httptest.NewRequest("GET", "/api/export?t0=0&t1=2&signals=s1:Ch1,s1:Ch2", nil) + rec := httptest.NewRecorder() + h.HandleExport(rec, req) + if rec.Code != 200 { + t.Fatalf("status = %d, want 200 (body: %s)", rec.Code, rec.Body.String()) + } + + reader := parquet.NewGenericReader[ExportSample](bytes.NewReader(rec.Body.Bytes())) + defer reader.Close() + + var got []ExportSample + buf := make([]ExportSample, 1000) + for { + n, err := reader.Read(buf) + got = append(got, buf[:n]...) + if err != nil { + break + } + } + if len(got) != 1500 { + t.Fatalf("rows = %d, want 1500 (every sample of both signals)", len(got)) + } + ch1 := filterExportSamples(got, "s1", "Ch1") + ch2 := filterExportSamples(got, "s1", "Ch2") + if len(ch1) != 1000 || len(ch2) != 500 { + t.Fatalf("ch1=%d ch2=%d rows, want 1000/500 (no holes, no resampling)", len(ch1), len(ch2)) + } + if ch1[0].Time != 0 || ch1[0].Value != 0 || ch1[999].Time != 0.999 || ch1[999].Value != 1998 { + t.Fatalf("ch1 endpoints wrong: first=%+v last=%+v", ch1[0], ch1[999]) + } + if ch2[0].Time != 0.1 || ch2[499].Time != 0.1+499*0.002 || ch2[499].Value != -499 { + t.Fatalf("ch2 endpoints wrong: first=%+v last=%+v", ch2[0], ch2[499]) + } +} + +func filterExportSamples(rows []ExportSample, source, signal string) []ExportSample { + out := make([]ExportSample, 0, len(rows)) + for _, r := range rows { + if r.Source == source && r.Signal == signal { + out = append(out, r) + } + } + return out +} + +func TestHandleExportParquetBadRange(t *testing.T) { + h := NewHub() + h.rings["s1:Ch1"] = newSigRing(10) + req := httptest.NewRequest("GET", "/api/export?t0=2&t1=1", nil) + rec := httptest.NewRecorder() + h.HandleExport(rec, req) + if rec.Code != 400 { + t.Fatalf("status = %d, want 400 for inverted range", rec.Code) + } +} diff --git a/Source/Components/GAMs/PulseGeneratorGAM/Makefile.gcc b/Source/Components/GAMs/PulseGeneratorGAM/Makefile.gcc new file mode 100644 index 0000000..a9c3668 --- /dev/null +++ b/Source/Components/GAMs/PulseGeneratorGAM/Makefile.gcc @@ -0,0 +1,25 @@ +############################################################# +# +# 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. +# +############################################################# + +include Makefile.inc diff --git a/Source/Components/GAMs/PulseGeneratorGAM/Makefile.inc b/Source/Components/GAMs/PulseGeneratorGAM/Makefile.inc new file mode 100644 index 0000000..ba4317b --- /dev/null +++ b/Source/Components/GAMs/PulseGeneratorGAM/Makefile.inc @@ -0,0 +1,52 @@ +############################################################# +# +# 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 = PulseGeneratorGAM.x + +PACKAGE=Components/GAMs +ROOT_DIR=../../../../ +MAKEDEFAULTDIR=$(MARTe2_DIR)/MakeDefaults + +include $(MAKEDEFAULTDIR)/MakeStdLibDefs.$(TARGET) + +INCLUDES += -I. +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/L4Messages +INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Configuration +INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L5GAMs +INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L1Portability +INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L3Services +INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L4Messages + +all: $(OBJS) \ + $(BUILD_DIR)/PulseGeneratorGAM$(LIBEXT) \ + $(BUILD_DIR)/PulseGeneratorGAM$(DLLEXT) + echo $(OBJS) + +-include depends.$(TARGET) + +include $(MAKEDEFAULTDIR)/MakeStdLibRules.$(TARGET) diff --git a/Source/Components/GAMs/PulseGeneratorGAM/PulseGeneratorGAM.cpp b/Source/Components/GAMs/PulseGeneratorGAM/PulseGeneratorGAM.cpp new file mode 100644 index 0000000..8d935b2 --- /dev/null +++ b/Source/Components/GAMs/PulseGeneratorGAM/PulseGeneratorGAM.cpp @@ -0,0 +1,325 @@ +/** + * @file PulseGeneratorGAM.cpp + * @brief Source file for class PulseGeneratorGAM + * @date 29/08/2026 + * @author Martino Ferrari + * + * @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. + */ + +#define DLL_API + +/*---------------------------------------------------------------------------*/ +/* Standard header includes */ +/*---------------------------------------------------------------------------*/ +#include +#include +#include + +/*---------------------------------------------------------------------------*/ +/* Project header includes */ +/*---------------------------------------------------------------------------*/ +#include "AdvancedErrorManagement.h" +#include "PulseGeneratorGAM.h" + +/*---------------------------------------------------------------------------*/ +/* Method definitions */ +/*---------------------------------------------------------------------------*/ + +namespace MARTe { + +/* File-local PRNG helpers: uniform [0,1) and gaussian (Box-Muller). */ +static float64 PulseRandUnit() { + return static_cast(rand()) / (static_cast(RAND_MAX) + 1.0); +} + +static float64 PulseGaussian(float64 sigma) { + float64 u1 = PulseRandUnit(); + if (u1 < 1e-12) { + u1 = 1e-12; + } + float64 u2 = PulseRandUnit(); + static const float64 TWO_PI = 6.28318530717958647692; + return sigma * std::sqrt(-2.0 * std::log(u1)) * std::cos(TWO_PI * u2); +} + +PulseGeneratorGAM::PulseGeneratorGAM() : + GAM(), + samplingRate(1000000.0), + rampUpMs(1.0), + rampDownMs(100.0), + highLevel(-40000.0), + noiseStdDev(333.33), + emiAmplitude(5000.0), + emiProbabilityPerSample(0.00001), + emiSpikeSamples(5u), + plateauMsDefault(500.0), + autoTriggerPeriodMs(0.0), + seed(0u), + nElements(0u), + outputBuf(NULL_PTR(float32 *)), + triggerIn(NULL_PTR(float32 *)), + plateauMsIn(NULL_PTR(float32 *)), + phase(PulsePhaseOff), + startLevel(0.0), + currentLevel(0.0), + phaseElapsed(0ull), + phaseTotal(0ull), + rampUpSamples(0ull), + rampDownSamples(0ull), + plateauSamples(0ull), + prevTrigger(0.0), + samplesSinceTrigger(0ull), + spikeRemaining(0u), + spikeValue(0.0) { +} + +PulseGeneratorGAM::~PulseGeneratorGAM() { +} + +bool PulseGeneratorGAM::Initialise(StructuredDataI &data) { + bool ok = GAM::Initialise(data); + if (ok && !data.Read("SamplingRate", samplingRate)) { + samplingRate = 1000000.0; + } + if (ok && !data.Read("RampUpMs", rampUpMs)) { + rampUpMs = 1.0; + } + if (ok && !data.Read("RampDownMs", rampDownMs)) { + rampDownMs = 100.0; + } + if (ok && !data.Read("HighLevel", highLevel)) { + highLevel = -40000.0; + } + if (ok && !data.Read("NoiseStdDev", noiseStdDev)) { + noiseStdDev = 333.33; + } + if (ok && !data.Read("EMIAmplitude", emiAmplitude)) { + emiAmplitude = 5000.0; + } + if (ok && !data.Read("EMIProbabilityPerSample", emiProbabilityPerSample)) { + emiProbabilityPerSample = 0.00001; + } + if (ok && !data.Read("EMISpikeSamples", emiSpikeSamples)) { + emiSpikeSamples = 5u; + } + if (ok && !data.Read("PlateauMsDefault", plateauMsDefault)) { + plateauMsDefault = 500.0; + } + if (ok && !data.Read("AutoTriggerPeriodMs", autoTriggerPeriodMs)) { + autoTriggerPeriodMs = 0.0; + } + if (ok && !data.Read("Seed", seed)) { + seed = 0u; + } + + if (ok && (samplingRate <= 0.0)) { + REPORT_ERROR(ErrorManagement::InitialisationError, + "PulseGeneratorGAM: SamplingRate must be > 0."); + ok = false; + } + if (ok && (rampUpMs < 0.0)) { + REPORT_ERROR(ErrorManagement::InitialisationError, + "PulseGeneratorGAM: RampUpMs must be >= 0."); + ok = false; + } + if (ok && (rampDownMs <= 0.0)) { + REPORT_ERROR(ErrorManagement::InitialisationError, + "PulseGeneratorGAM: RampDownMs must be > 0."); + ok = false; + } + if (ok && (noiseStdDev < 0.0)) { + REPORT_ERROR(ErrorManagement::InitialisationError, + "PulseGeneratorGAM: NoiseStdDev must be >= 0."); + ok = false; + } + if (ok && ((emiProbabilityPerSample < 0.0) || (emiProbabilityPerSample > 1.0))) { + REPORT_ERROR(ErrorManagement::InitialisationError, + "PulseGeneratorGAM: EMIProbabilityPerSample must be in [0, 1]."); + ok = false; + } + if (ok && (autoTriggerPeriodMs < 0.0)) { + REPORT_ERROR(ErrorManagement::InitialisationError, + "PulseGeneratorGAM: AutoTriggerPeriodMs must be >= 0."); + ok = false; + } + + if (ok) { + rampUpSamples = static_cast(rampUpMs * samplingRate / 1000.0); + rampDownSamples = static_cast(rampDownMs * samplingRate / 1000.0); + if (rampUpSamples == 0ull) { + REPORT_ERROR(ErrorManagement::Warning, + "PulseGeneratorGAM: RampUpMs too short for the sample rate; " + "the ramp phase is skipped."); + } + if (seed == 0u) { + srand(static_cast(time(0))); + } else { + srand(seed); + } + } + return ok; +} + +bool PulseGeneratorGAM::Setup() { + bool ok = (GetNumberOfOutputSignals() == 1u); + if (!ok) { + REPORT_ERROR(ErrorManagement::InitialisationError, + "PulseGeneratorGAM: exactly one output signal is required."); + return false; + } + + uint32 sz = 0u; + ok = GetSignalByteSize(OutputSignals, 0u, sz); + if (ok) { + nElements = sz / static_cast(sizeof(float32)); + outputBuf = reinterpret_cast(GetOutputSignalMemory(0u)); + ok = (outputBuf != NULL_PTR(float32 *)) && (nElements > 0u); + if (!ok) { + REPORT_ERROR(ErrorManagement::InitialisationError, + "PulseGeneratorGAM: failed to resolve output signal memory."); + } + } + + uint32 nIn = GetNumberOfInputSignals(); + if (ok && (nIn == 1u)) { + triggerIn = reinterpret_cast(GetInputSignalMemory(0u)); + ok = (triggerIn != NULL_PTR(float32 *)); + } else if (ok && (nIn == 2u)) { + triggerIn = reinterpret_cast(GetInputSignalMemory(0u)); + plateauMsIn = reinterpret_cast(GetInputSignalMemory(1u)); + ok = (triggerIn != NULL_PTR(float32 *)) && (plateauMsIn != NULL_PTR(float32 *)); + } else if (ok && (nIn > 2u)) { + REPORT_ERROR(ErrorManagement::InitialisationError, + "PulseGeneratorGAM: at most two input signals are supported " + "(Trigger, PlateauMs)."); + ok = false; + } + return ok; +} + +void PulseGeneratorGAM::StartSequence(float64 plateauMs) { + phase = PulsePhaseRampUp; + startLevel = currentLevel; + phaseElapsed = 0ull; + phaseTotal = rampUpSamples; + plateauSamples = static_cast(plateauMs * samplingRate / 1000.0); + samplesSinceTrigger = 0ull; + /* Skip zero-length phases (e.g. RampUpMs that rounds to 0 samples). */ + if (phaseTotal == 0ull) { + AdvanceToNextPhase(); + } +} + +void PulseGeneratorGAM::AdvanceToNextPhase() { + for (;;) { + if (phase == PulsePhaseRampUp) { + phase = PulsePhaseFlat; + phaseElapsed = 0ull; + phaseTotal = plateauSamples; + } else if (phase == PulsePhaseFlat) { + phase = PulsePhaseRampDown; + phaseElapsed = 0ull; + phaseTotal = rampDownSamples; + } else { + phase = PulsePhaseOff; + phaseElapsed = 0ull; + currentLevel = 0.0; + return; + } + if (phaseTotal > 0ull) { + return; + } + } +} + +bool PulseGeneratorGAM::Execute() { + /* Trigger detection: rising edge on the optional Trigger input. */ + float64 trig = 0.0; + if (triggerIn != NULL_PTR(float32 *)) { + trig = static_cast(*triggerIn); + } + bool rising = ((prevTrigger < 0.5) && (trig >= 0.5)); + prevTrigger = trig; + + float64 plateauMs = plateauMsDefault; + if (plateauMsIn != NULL_PTR(float32 *)) { + plateauMs = static_cast(*plateauMsIn); + } + if (plateauMs < 0.0) { + plateauMs = 0.0; + } + + if (rising) { + StartSequence(plateauMs); + } else if (autoTriggerPeriodMs > 0.0) { + uint64 autoSamples = static_cast(autoTriggerPeriodMs * samplingRate / 1000.0); + if ((autoSamples > 0ull) && (samplesSinceTrigger >= autoSamples)) { + StartSequence(plateauMs); + } + } + + for (uint32 i = 0u; i < nElements; i++) { + float64 base = 0.0; + switch (phase) { + case PulsePhaseRampUp: + base = startLevel + + (highLevel - startLevel) * (static_cast(phaseElapsed) / + static_cast(phaseTotal)); + break; + case PulsePhaseFlat: + base = highLevel; + break; + case PulsePhaseRampDown: + base = highLevel * (1.0 - static_cast(phaseElapsed) / + static_cast(phaseTotal)); + break; + case PulsePhaseOff: + default: + base = 0.0; + break; + } + currentLevel = base; + + if (phase != PulsePhaseOff) { + phaseElapsed++; + if (phaseElapsed >= phaseTotal) { + AdvanceToNextPhase(); + } + } + + /* Always-on gaussian noise plus random EMI spikes (on and off phase). */ + float64 noise = 0.0; + if (noiseStdDev > 0.0) { + noise = PulseGaussian(noiseStdDev); + } + float64 emi = 0.0; + if (spikeRemaining > 0u) { + emi = spikeValue; + spikeRemaining--; + } else if ((emiProbabilityPerSample > 0.0) && (PulseRandUnit() < emiProbabilityPerSample)) { + spikeValue = ((rand() & 1u) == 0u) ? emiAmplitude : -emiAmplitude; + spikeRemaining = (emiSpikeSamples > 0u) ? emiSpikeSamples : 1u; + emi = spikeValue; + spikeRemaining--; + } + + outputBuf[i] = static_cast(base + noise + emi); + } + samplesSinceTrigger += static_cast(nElements); + return true; +} + +CLASS_REGISTER(PulseGeneratorGAM, "1.0") + +} /* namespace MARTe */ diff --git a/Source/Components/GAMs/PulseGeneratorGAM/PulseGeneratorGAM.h b/Source/Components/GAMs/PulseGeneratorGAM/PulseGeneratorGAM.h new file mode 100644 index 0000000..71edae2 --- /dev/null +++ b/Source/Components/GAMs/PulseGeneratorGAM/PulseGeneratorGAM.h @@ -0,0 +1,162 @@ +/** + * @file PulseGeneratorGAM.h + * @brief GAM that synthesizes a triggered high-voltage pulse waveform. + * @date 29/08/2026 + * @author Martino Ferrari + * + * @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. + * + * @details Emulates a charged-capacitor pulse discharge on a high-voltage bus: + * + * - on a rising edge of the (optional) Trigger input — the EPICS "start" + * setpoint — the output ramps linearly from its current level to HighLevel + * over RampUpMs (default 1 ms, the charger ramp); + * - it then holds HighLevel flat for PlateauMs — read from the (optional) + * PlateauMs input at trigger time, i.e. the EPICS "duration" setpoint; + * - finally it ramps back to 0 over RampDownMs (default 100 ms, the + * capacitive discharge); + * - until the next trigger the output sits at 0 (the "off" phase). + * + * Gaussian noise (NoiseStdDev, default 333.33 V → 3σ ≈ ±1000 V) is added to + * every sample, and random EMI spikes of ±EMIAmplitude (default 5000 V, + * probability EMIProbabilityPerSample per sample, EMISpikeSamples long) strike + * during both the on and off phases. + * + * With no Trigger input connected, AutoTriggerPeriodMs > 0 self-triggers the + * sequence periodically so the GAM runs standalone. + * + * Configuration: + *
+ * +MyGAM = {
+ *     Class = PulseGeneratorGAM
+ *     SamplingRate            = 1000000.0  // must match the output signal rate
+ *     RampUpMs                = 1.0
+ *     RampDownMs              = 100.0
+ *     HighLevel               = -40000.0
+ *     NoiseStdDev             = 333.33
+ *     EMIAmplitude            = 5000.0
+ *     EMIProbabilityPerSample = 0.00001
+ *     EMISpikeSamples         = 5
+ *     PlateauMsDefault        = 500.0     // used when PlateauMs input absent
+ *     AutoTriggerPeriodMs     = 0.0       // 0 = external trigger only
+ *     Seed                    = 0         // PRNG seed; 0 = from wall clock
+ *     InputSignals = {                    // optional: 0, 1 or 2 inputs
+ *         Trigger   = { DataSource = DDB; Type = float32 }
+ *         PlateauMs = { DataSource = DDB; Type = float32 }
+ *     }
+ *     OutputSignals = {
+ *         HV = { DataSource = DDB; Type = float32; NumberOfElements = 1000 }
+ *     }
+ * }
+ * 
+ */ + +#ifndef PULSEGENERATORGAM_H_ +#define PULSEGENERATORGAM_H_ + +/*---------------------------------------------------------------------------*/ +/* Standard header includes */ +/*---------------------------------------------------------------------------*/ + +/*---------------------------------------------------------------------------*/ +/* Project header includes */ +/*---------------------------------------------------------------------------*/ +#include "CompilerTypes.h" +#include "GAM.h" + +/*---------------------------------------------------------------------------*/ +/* Class declaration */ +/*---------------------------------------------------------------------------*/ + +namespace MARTe { + +class PulseGeneratorGAM : public GAM { +public: + CLASS_REGISTER_DECLARATION() + + /** + * @brief Constructor. Sets safe defaults. + */ + PulseGeneratorGAM(); + + /** + * @brief Destructor. + */ + virtual ~PulseGeneratorGAM(); + + /** + * @brief Reads the waveform parameters from config and seeds the PRNG. + */ + virtual bool Initialise(StructuredDataI &data); + + /** + * @brief Resolves the output array and the optional input scalars. + * @return true if exactly one float32 output signal and at most two inputs. + */ + virtual bool Setup(); + + /** + * @brief Emits the next block of waveform samples (noise + EMI included). + * @return true always. + */ + virtual bool Execute(); + +private: + /** @brief Pulse state machine phases. */ + typedef enum { + PulsePhaseOff = 0u, /**< Output at 0 V, waiting for a trigger */ + PulsePhaseRampUp = 1u, /**< Charger ramp: startLevel → HighLevel */ + PulsePhaseFlat = 2u, /**< Holding HighLevel for the plateau */ + PulsePhaseRampDown = 3u /**< Discharge ramp: HighLevel → 0 */ + } PulsePhase; + + float64 samplingRate; /**< Sample rate [Hz] */ + float64 rampUpMs; /**< Charger ramp duration [ms] */ + float64 rampDownMs; /**< Discharge ramp duration [ms] */ + float64 highLevel; /**< Plateau level [V] */ + float64 noiseStdDev; /**< Gaussian noise sigma [V] */ + float64 emiAmplitude; /**< EMI spike amplitude [V] */ + float64 emiProbabilityPerSample; /**< Probability of starting an EMI spike per sample */ + uint32 emiSpikeSamples; /**< Length of one EMI spike [samples] */ + float64 plateauMsDefault; /**< Plateau used when the PlateauMs input is absent [ms] */ + float64 autoTriggerPeriodMs; /**< Self-trigger period [ms]; 0 = external only */ + uint32 seed; /**< PRNG seed; 0 = wall clock */ + + uint32 nElements; /**< Output samples per Execute() call */ + float32 *outputBuf; /**< Output waveform memory */ + float32 *triggerIn; /**< Optional rising-edge trigger input */ + float32 *plateauMsIn; /**< Optional plateau-duration input [ms] */ + + PulsePhase phase; /**< Current state machine phase */ + float64 startLevel; /**< Waveform level when the current ramp started */ + float64 currentLevel; /**< Clean (pre-noise) level of the last emitted sample */ + uint64 phaseElapsed; /**< Samples consumed in the current phase */ + uint64 phaseTotal; /**< Total samples of the current phase */ + uint64 rampUpSamples; /**< RampUpMs expressed in samples */ + uint64 rampDownSamples; /**< RampDownMs expressed in samples */ + uint64 plateauSamples; /**< Plateau for the current pulse [samples] */ + float64 prevTrigger; /**< Previous Trigger input value (edge detection) */ + uint64 samplesSinceTrigger; /**< Samples since the last trigger (auto-trigger) */ + uint32 spikeRemaining; /**< Samples left in the current EMI spike */ + float64 spikeValue; /**< Signed amplitude of the current EMI spike */ + + /** @brief Starts a new pulse: ramp up from the current level. */ + void StartSequence(float64 plateauMs); + + /** @brief Advances to the next phase, skipping zero-length ones. */ + void AdvanceToNextPhase(); +}; + +} /* namespace MARTe */ + +#endif /* PULSEGENERATORGAM_H_ */ diff --git a/Source/Components/GAMs/PulseGeneratorGAM/depends.x86-linux b/Source/Components/GAMs/PulseGeneratorGAM/depends.x86-linux new file mode 100644 index 0000000..42b6ec9 --- /dev/null +++ b/Source/Components/GAMs/PulseGeneratorGAM/depends.x86-linux @@ -0,0 +1,113 @@ +../../../..//Build/x86-linux/Components/GAMs/PulseGeneratorGAM/PulseGeneratorGAM.o: PulseGeneratorGAM.cpp \ + /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/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/L0Types/Architecture/x86_gcc/CompilerTypes.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/GeneralDefinitions.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TemplateParametersVerificator.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.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/BitRange.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.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/L3Streams/StreamMemoryReference.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/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/../../ErrorManagement.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../GeneralDefinitions.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../Generic/StandardHeap_Generic.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/Architecture/x86_gcc/AtomicA.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.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/BitBoolean.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/HeapManager.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.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/L3Streams/CharBuffer.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \ + PulseGeneratorGAM.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/GAM.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/DataSourceI.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationDatabase.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/AnyObject.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/CLASSREGISTER.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItemT.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilderT.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationDatabaseNode.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Fnv1aHashFunction.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/HashFunction.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Reference.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerFilter.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerNode.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceT.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/UnorderedMap.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapManager.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerFilterObjectName.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/TypeConversion.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Vector.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamString.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamStringIOBuffer.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/StatefulI.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/ExecutableI.h diff --git a/Source/Components/GAMs/PulseGeneratorGAM/dependsRaw.x86-linux b/Source/Components/GAMs/PulseGeneratorGAM/dependsRaw.x86-linux new file mode 100644 index 0000000..312b2f8 --- /dev/null +++ b/Source/Components/GAMs/PulseGeneratorGAM/dependsRaw.x86-linux @@ -0,0 +1,113 @@ +PulseGeneratorGAM.o: PulseGeneratorGAM.cpp \ + /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/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/L0Types/Architecture/x86_gcc/CompilerTypes.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/GeneralDefinitions.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TemplateParametersVerificator.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.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/BitRange.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.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/L3Streams/StreamMemoryReference.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/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/../../ErrorManagement.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../GeneralDefinitions.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../Generic/StandardHeap_Generic.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/Architecture/x86_gcc/AtomicA.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.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/BitBoolean.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/HeapManager.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.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/L3Streams/CharBuffer.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \ + PulseGeneratorGAM.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/GAM.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/DataSourceI.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationDatabase.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/AnyObject.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/CLASSREGISTER.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItemT.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilderT.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationDatabaseNode.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Fnv1aHashFunction.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/HashFunction.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Reference.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerFilter.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerNode.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceT.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/UnorderedMap.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapManager.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerFilterObjectName.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/TypeConversion.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Vector.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamString.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamStringIOBuffer.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/StatefulI.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/ExecutableI.h diff --git a/Source/Components/GAMs/SlowControlGAM/Makefile.gcc b/Source/Components/GAMs/SlowControlGAM/Makefile.gcc new file mode 100644 index 0000000..a9c3668 --- /dev/null +++ b/Source/Components/GAMs/SlowControlGAM/Makefile.gcc @@ -0,0 +1,25 @@ +############################################################# +# +# 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. +# +############################################################# + +include Makefile.inc diff --git a/Source/Components/GAMs/SlowControlGAM/Makefile.inc b/Source/Components/GAMs/SlowControlGAM/Makefile.inc new file mode 100644 index 0000000..f608af3 --- /dev/null +++ b/Source/Components/GAMs/SlowControlGAM/Makefile.inc @@ -0,0 +1,52 @@ +############################################################# +# +# 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 = SlowControlGAM.x + +PACKAGE=Components/GAMs +ROOT_DIR=../../../../ +MAKEDEFAULTDIR=$(MARTe2_DIR)/MakeDefaults + +include $(MAKEDEFAULTDIR)/MakeStdLibDefs.$(TARGET) + +INCLUDES += -I. +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/L4Messages +INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Configuration +INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L5GAMs +INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L1Portability +INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L3Services +INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L4Messages + +all: $(OBJS) \ + $(BUILD_DIR)/SlowControlGAM$(LIBEXT) \ + $(BUILD_DIR)/SlowControlGAM$(DLLEXT) + echo $(OBJS) + +-include depends.$(TARGET) + +include $(MAKEDEFAULTDIR)/MakeStdLibRules.$(TARGET) diff --git a/Source/Components/GAMs/SlowControlGAM/SlowControlGAM.cpp b/Source/Components/GAMs/SlowControlGAM/SlowControlGAM.cpp new file mode 100644 index 0000000..eb44148 --- /dev/null +++ b/Source/Components/GAMs/SlowControlGAM/SlowControlGAM.cpp @@ -0,0 +1,129 @@ +/** + * @file SlowControlGAM.cpp + * @brief Source file for class SlowControlGAM + * @date 29/08/2026 + * @author Martino Ferrari + * + * @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. + */ + +#define DLL_API + +/*---------------------------------------------------------------------------*/ +/* Standard header includes */ +/*---------------------------------------------------------------------------*/ + +/*---------------------------------------------------------------------------*/ +/* Project header includes */ +/*---------------------------------------------------------------------------*/ +#include "AdvancedErrorManagement.h" +#include "SlowControlGAM.h" + +/*---------------------------------------------------------------------------*/ +/* Method definitions */ +/*---------------------------------------------------------------------------*/ + +namespace MARTe { + +SlowControlGAM::SlowControlGAM() : + GAM(), + triggerPeriodMs(5000.0), + triggerWidthMs(10.0), + plateauMs(500.0), + cycleFrequency(1000.0), + cycleCount(0ull), + triggerOut(NULL_PTR(float32 *)), + plateauOut(NULL_PTR(float32 *)) { +} + +SlowControlGAM::~SlowControlGAM() { +} + +bool SlowControlGAM::Initialise(StructuredDataI &data) { + bool ok = GAM::Initialise(data); + if (ok && !data.Read("TriggerPeriodMs", triggerPeriodMs)) { + triggerPeriodMs = 5000.0; + } + if (ok && !data.Read("TriggerWidthMs", triggerWidthMs)) { + triggerWidthMs = 10.0; + } + if (ok && !data.Read("PlateauMs", plateauMs)) { + plateauMs = 500.0; + } + if (ok && !data.Read("CycleFrequency", cycleFrequency)) { + cycleFrequency = 1000.0; + } + + if (ok && (triggerPeriodMs <= 0.0)) { + REPORT_ERROR(ErrorManagement::InitialisationError, + "SlowControlGAM: TriggerPeriodMs must be > 0."); + ok = false; + } + if (ok && ((triggerWidthMs < 0.0) || (triggerWidthMs > triggerPeriodMs))) { + REPORT_ERROR(ErrorManagement::InitialisationError, + "SlowControlGAM: TriggerWidthMs must be in [0, TriggerPeriodMs]."); + ok = false; + } + if (ok && (plateauMs < 0.0)) { + REPORT_ERROR(ErrorManagement::InitialisationError, + "SlowControlGAM: PlateauMs must be >= 0."); + ok = false; + } + if (ok && (cycleFrequency <= 0.0)) { + REPORT_ERROR(ErrorManagement::InitialisationError, + "SlowControlGAM: CycleFrequency must be > 0."); + ok = false; + } + return ok; +} + +bool SlowControlGAM::Setup() { + bool ok = (GetNumberOfOutputSignals() == 2u); + if (!ok) { + REPORT_ERROR(ErrorManagement::InitialisationError, + "SlowControlGAM: exactly two output signals are required " + "(Trigger, PlateauMs)."); + return false; + } + triggerOut = reinterpret_cast(GetOutputSignalMemory(0u)); + plateauOut = reinterpret_cast(GetOutputSignalMemory(1u)); + ok = (triggerOut != NULL_PTR(float32 *)) && (plateauOut != NULL_PTR(float32 *)); + if (!ok) { + REPORT_ERROR(ErrorManagement::InitialisationError, + "SlowControlGAM: failed to resolve output signal memory."); + } + return ok; +} + +bool SlowControlGAM::Execute() { + /* One Execute() is one RT cycle; convert the configured milliseconds to + * cycle counts using the cycle rate. */ + float64 msPerCycle = 1000.0 / cycleFrequency; + uint64 period = static_cast(triggerPeriodMs / msPerCycle + 0.5); + uint64 width = static_cast(triggerWidthMs / msPerCycle + 0.5); + if (period == 0ull) { + period = 1ull; + } + if (width > period) { + width = period; + } + uint64 t = cycleCount % period; + *triggerOut = (t < width) ? 1.0f : 0.0f; + *plateauOut = static_cast(plateauMs); + cycleCount++; + return true; +} + +CLASS_REGISTER(SlowControlGAM, "1.0") + +} /* namespace MARTe */ diff --git a/Source/Components/GAMs/SlowControlGAM/SlowControlGAM.h b/Source/Components/GAMs/SlowControlGAM/SlowControlGAM.h new file mode 100644 index 0000000..ac9d459 --- /dev/null +++ b/Source/Components/GAMs/SlowControlGAM/SlowControlGAM.h @@ -0,0 +1,107 @@ +/** + * @file SlowControlGAM.h + * @brief GAM that emulates EPICS slow-control setpoints. + * @date 29/08/2026 + * @author Martino Ferrari + * + * @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. + * + * @details Stands in for the EPICS inputs that drive the PulseGeneratorGAM in + * the real plant: it outputs a periodic square-wave "start" trigger and a + * plateau-duration setpoint. Durations are configured in milliseconds and + * converted to RT-cycle counts using CycleFrequency (default 1000 Hz = one + * 1 ms cycle), so the trigger stays correct at any cycle rate: + * + * - Trigger = 1 while (cycle % cyclesPerPeriod) < cyclesPerWidth, else 0 + * (a rising edge every TriggerPeriodMs); + * - PlateauMs = the configured value, constant until re-configured. + * + * Configuration: + *
+ * +MyGAM = {
+ *     Class = SlowControlGAM
+ *     TriggerPeriodMs = 5000   // time between pulses [ms]
+ *     TriggerWidthMs  = 10     // trigger pulse width [ms]
+ *     PlateauMs       = 500    // pulse plateau duration setpoint [ms]
+ *     CycleFrequency  = 1000   // RT cycle rate [Hz]; 1000 = 1 ms/cycle
+ *     OutputSignals = {
+ *         Trigger   = { DataSource = DDB; Type = float32 }
+ *         PlateauMs = { DataSource = DDB; Type = float32 }
+ *     }
+ * }
+ * 
+ */ + +#ifndef SLOWCONTROLGAM_H_ +#define SLOWCONTROLGAM_H_ + +/*---------------------------------------------------------------------------*/ +/* Standard header includes */ +/*---------------------------------------------------------------------------*/ + +/*---------------------------------------------------------------------------*/ +/* Project header includes */ +/*---------------------------------------------------------------------------*/ +#include "CompilerTypes.h" +#include "GAM.h" + +/*---------------------------------------------------------------------------*/ +/* Class declaration */ +/*---------------------------------------------------------------------------*/ + +namespace MARTe { + +class SlowControlGAM : public GAM { +public: + CLASS_REGISTER_DECLARATION() + + /** + * @brief Constructor. Sets safe defaults. + */ + SlowControlGAM(); + + /** + * @brief Destructor. + */ + virtual ~SlowControlGAM(); + + /** + * @brief Reads TriggerPeriodMs, TriggerWidthMs, PlateauMs from config. + */ + virtual bool Initialise(StructuredDataI &data); + + /** + * @brief Resolves the two output scalars. + * @return true if exactly two float32 output signals are present. + */ + virtual bool Setup(); + + /** + * @brief Emits the next trigger/plateau setpoint pair. + * @return true always. + */ + virtual bool Execute(); + +private: + float64 triggerPeriodMs; /**< Time between trigger pulses [ms] */ + float64 triggerWidthMs; /**< Trigger pulse width [ms] */ + float64 plateauMs; /**< Plateau duration setpoint [ms] */ + float64 cycleFrequency; /**< RT cycle rate [Hz]; 1000 = 1 ms/cycle */ + uint64 cycleCount; /**< RT cycle counter (1 cycle = 1 ms) */ + float32 *triggerOut; /**< Output: trigger square wave */ + float32 *plateauOut; /**< Output: plateau duration setpoint */ +}; + +} /* namespace MARTe */ + +#endif /* SLOWCONTROLGAM_H_ */ diff --git a/Source/Components/GAMs/SlowControlGAM/depends.x86-linux b/Source/Components/GAMs/SlowControlGAM/depends.x86-linux new file mode 100644 index 0000000..beeac9e --- /dev/null +++ b/Source/Components/GAMs/SlowControlGAM/depends.x86-linux @@ -0,0 +1,113 @@ +../../../..//Build/x86-linux/Components/GAMs/SlowControlGAM/SlowControlGAM.o: SlowControlGAM.cpp \ + /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/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/L0Types/Architecture/x86_gcc/CompilerTypes.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/GeneralDefinitions.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TemplateParametersVerificator.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.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/BitRange.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.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/L3Streams/StreamMemoryReference.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/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/../../ErrorManagement.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../GeneralDefinitions.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../Generic/StandardHeap_Generic.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/Architecture/x86_gcc/AtomicA.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.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/BitBoolean.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/HeapManager.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.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/L3Streams/CharBuffer.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \ + SlowControlGAM.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/GAM.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/DataSourceI.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationDatabase.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/AnyObject.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/CLASSREGISTER.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItemT.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilderT.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationDatabaseNode.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Fnv1aHashFunction.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/HashFunction.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Reference.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerFilter.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerNode.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceT.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/UnorderedMap.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapManager.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerFilterObjectName.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/TypeConversion.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Vector.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamString.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamStringIOBuffer.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/StatefulI.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/ExecutableI.h diff --git a/Source/Components/GAMs/SlowControlGAM/dependsRaw.x86-linux b/Source/Components/GAMs/SlowControlGAM/dependsRaw.x86-linux new file mode 100644 index 0000000..d77b0f0 --- /dev/null +++ b/Source/Components/GAMs/SlowControlGAM/dependsRaw.x86-linux @@ -0,0 +1,113 @@ +SlowControlGAM.o: SlowControlGAM.cpp \ + /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/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/L0Types/Architecture/x86_gcc/CompilerTypes.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/GeneralDefinitions.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/FractionalInteger.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TypeCharacteristics.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/TemplateParametersVerificator.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/CompilerTypes.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/BitRange.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/GeneralDefinitions.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/L3Streams/StreamMemoryReference.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/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/../../ErrorManagement.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../../GeneralDefinitions.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Environment/Linux/../Generic/StandardHeap_Generic.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/Architecture/x86_gcc/AtomicA.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/ErrorManagement.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/Sleep.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/BitBoolean.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/HeapManager.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapI.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/L3Streams/CharBuffer.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StreamI.h \ + SlowControlGAM.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/GAM.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/DataSourceI.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationDatabase.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/AnyObject.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/AnyType.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/CLASSREGISTER.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ClassRegistryItemT.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ObjectBuilderT.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/ConfigurationDatabaseNode.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Fnv1aHashFunction.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/HashFunction.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/LinkedListHolder.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Object.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/Reference.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerFilter.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerNode.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceT.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/UnorderedMap.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/HeapManager.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L1Portability/StringHelper.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainerFilterObjectName.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/ReferenceContainer.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L2Objects/StructuredDataI.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L4Configuration/TypeConversion.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L0Types/Vector.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamString.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L3Streams/StreamStringIOBuffer.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/StatefulI.h \ + /home/martino/workspace/MARTe2/Source/Core/BareMetal/L5GAMs/ExecutableI.h