From e1549afa07c2ac46a9324a0e63c11d0f93ef8fe9 Mon Sep 17 00:00:00 2001 From: Martino Ferrari Date: Fri, 6 Feb 2026 17:39:22 +0100 Subject: [PATCH] fixed input/out signal types --- .../JARTStateMachineGAM.cpp | 45 ++++++++++--------- .../JARTStateMachineGAM/JARTStateMachineGAM.h | 27 +++++------ 2 files changed, 37 insertions(+), 35 deletions(-) diff --git a/EC-GN-JA-PCF-IN/src/main/c++/GAMs/JARTStateMachineGAM/JARTStateMachineGAM.cpp b/EC-GN-JA-PCF-IN/src/main/c++/GAMs/JARTStateMachineGAM/JARTStateMachineGAM.cpp index 30fe3fc..f124e88 100644 --- a/EC-GN-JA-PCF-IN/src/main/c++/GAMs/JARTStateMachineGAM/JARTStateMachineGAM.cpp +++ b/EC-GN-JA-PCF-IN/src/main/c++/GAMs/JARTStateMachineGAM/JARTStateMachineGAM.cpp @@ -32,6 +32,7 @@ #include "JARTStateMachineGAM.h" #include "AdvancedErrorManagement.h" +#include "TypeDescriptor.h" /*---------------------------------------------------------------------------*/ /* Static definitions */ @@ -57,7 +58,7 @@ JARTStateMachineGAM::JARTStateMachineGAM() { mhvps_hvon = 0; // Parameters which get from Input signals. - triggerSignal = NULL_PTR(MARTe::uint32 *); + triggerSignal = NULL_PTR(MARTe::uint8 *); currentTime = NULL_PTR(MARTe::uint32 *); turn_off_delay = 2000; //us @@ -68,18 +69,18 @@ JARTStateMachineGAM::JARTStateMachineGAM() { triggerDelay_bps_swon = NULL_PTR(MARTe::uint32 *); triggerDelay_shotlen = NULL_PTR(MARTe::uint32 *); - stopRequest = NULL_PTR(MARTe::uint32 *); + stopRequest = NULL_PTR(MARTe::uint8 *); modePulseLengthLimit = NULL_PTR(MARTe::uint32 *); short_pulse_mode = NULL_PTR(MARTe::uint32 *); - modulation = NULL_PTR(MARTe::uint32 *); + modulation = NULL_PTR(MARTe::uint8 *); // write out target. outputSignal = NULL_PTR(MARTe::uint32 *); - outputBeamON = NULL_PTR(MARTe::uint32 *); - outputHVArmed = NULL_PTR(MARTe::uint32 *); - outputHVInjection = NULL_PTR(MARTe::uint32 *); - outputRFON = NULL_PTR(MARTe::uint32 *); + outputBeamON = NULL_PTR(MARTe::uint8 *); + outputHVArmed = NULL_PTR(MARTe::uint8*); + outputHVInjection = NULL_PTR(MARTe::uint8 *); + outputRFON = NULL_PTR(MARTe::uint8 *); outputBeamONTime = NULL_PTR(MARTe::uint32 *); outputRFONTime = NULL_PTR(MARTe::uint32 *); shotCounter = NULL_PTR(MARTe::uint32 *); @@ -165,7 +166,7 @@ bool JARTStateMachineGAM::Setup() { uint32 c; for (c = 0u; c < numberOfInputSignals; c++) { TypeDescriptor inputType = GetSignalType(InputSignals, c); - ok = (inputType == UnsignedInteger32Bit); + ok = (inputType == UnsignedInteger32Bit || inputType == UnsignedInteger8Bit); if (!ok) { StreamString signalName; (void) GetSignalName(InputSignals, c, signalName); @@ -181,41 +182,41 @@ bool JARTStateMachineGAM::Setup() { ok = (outputType == UnsignedInteger32Bit || outputType == UnsignedInteger8Bit); if (!ok) { StreamString signalName; - (void) GetSignalName(InputSignals, c, signalName); + (void) GetSignalName(OutputSignals, c, signalName); REPORT_ERROR(MARTe::ErrorManagement::ParametersError, "Signal %s shall be defined as uint32", signalName.Buffer()); } } } if (ok) { currentTime = reinterpret_cast(GetInputSignalMemory(0)); - triggerSignal = reinterpret_cast(GetInputSignalMemory(1)); + triggerSignal = reinterpret_cast(GetInputSignalMemory(1)); triggerDelay_mhvps_hvon = reinterpret_cast(GetInputSignalMemory(2)); triggerDelay_aps_hvon = reinterpret_cast(GetInputSignalMemory(3)); triggerDelay_aps_swon = reinterpret_cast(GetInputSignalMemory(4)); triggerDelay_bps_hvon = reinterpret_cast(GetInputSignalMemory(5)); triggerDelay_bps_swon = reinterpret_cast(GetInputSignalMemory(6)); triggerDelay_shotlen = reinterpret_cast(GetInputSignalMemory(7)); - stopRequest = reinterpret_cast(GetInputSignalMemory(8)); + stopRequest = reinterpret_cast(GetInputSignalMemory(8)); modePulseLengthLimit = reinterpret_cast(GetInputSignalMemory(9)); short_pulse_mode = reinterpret_cast(GetInputSignalMemory(10)); - modulation = reinterpret_cast(GetInputSignalMemory(11)); - pauseSet = reinterpret_cast(GetInputSignalMemory(12)); + modulation = reinterpret_cast(GetInputSignalMemory(11)); + pauseSet = reinterpret_cast(GetInputSignalMemory(12)); outputSignal = reinterpret_cast(GetOutputSignalMemory(0)); - outputBeamON = reinterpret_cast(GetOutputSignalMemory(1)); - outputHVArmed = reinterpret_cast(GetOutputSignalMemory(2)); - outputHVInjection = reinterpret_cast(GetOutputSignalMemory(3)); - outputRFON = reinterpret_cast(GetOutputSignalMemory(4)); + outputBeamON = reinterpret_cast(GetOutputSignalMemory(1)); + outputHVArmed = reinterpret_cast(GetOutputSignalMemory(2)); + outputHVInjection = reinterpret_cast(GetOutputSignalMemory(3)); + outputRFON = reinterpret_cast(GetOutputSignalMemory(4)); outputBeamONTime = reinterpret_cast(GetOutputSignalMemory(5)); outputRFONTime = reinterpret_cast(GetOutputSignalMemory(6)); shotCounter = reinterpret_cast(GetOutputSignalMemory(7)); - outputAPSHVON = reinterpret_cast(GetOutputSignalMemory(8)); - outputAPSSWON = reinterpret_cast(GetOutputSignalMemory(9)); - outputBPSHVON = reinterpret_cast(GetOutputSignalMemory(10)); - outputBPSSWON = reinterpret_cast(GetOutputSignalMemory(11)); - outputMHVPSON = reinterpret_cast(GetOutputSignalMemory(12)); + outputAPSHVON = reinterpret_cast(GetOutputSignalMemory(8)); + outputAPSSWON = reinterpret_cast(GetOutputSignalMemory(9)); + outputBPSHVON = reinterpret_cast(GetOutputSignalMemory(10)); + outputBPSSWON = reinterpret_cast(GetOutputSignalMemory(11)); + outputMHVPSON = reinterpret_cast(GetOutputSignalMemory(12)); outputSignalNI6259 = reinterpret_cast(GetOutputSignalMemory(13)); diff --git a/EC-GN-JA-PCF-IN/src/main/c++/GAMs/JARTStateMachineGAM/JARTStateMachineGAM.h b/EC-GN-JA-PCF-IN/src/main/c++/GAMs/JARTStateMachineGAM/JARTStateMachineGAM.h index e66b085..e92067a 100644 --- a/EC-GN-JA-PCF-IN/src/main/c++/GAMs/JARTStateMachineGAM/JARTStateMachineGAM.h +++ b/EC-GN-JA-PCF-IN/src/main/c++/GAMs/JARTStateMachineGAM/JARTStateMachineGAM.h @@ -32,6 +32,7 @@ /* Project header includes */ /*---------------------------------------------------------------------------*/ +#include "Architecture/x86_gcc/CompilerTypes.h" #include "GAM.h" /*---------------------------------------------------------------------------*/ @@ -174,7 +175,7 @@ private: MARTe::uint32 bps_swon; //The trigger signal (PLC_ON) - MARTe::uint32 *triggerSignal; + MARTe::uint8 *triggerSignal; //Time signal MARTe::uint32 *currentTime; @@ -188,24 +189,24 @@ private: MARTe::uint32 *triggerDelay_shotlen; // Input signal for sequence stop request. - MARTe::uint32 *stopRequest; + MARTe::uint8 *stopRequest; // Input signal for pulse length limit by mode. MARTe::uint32 *modePulseLengthLimit; // Input signal for short pulse mode. MARTe::uint32 *short_pulse_mode; // Input signal for modulation pv. - MARTe::uint32 *modulation; + MARTe::uint8 *modulation; // Input signal for pause signal set pv. - MARTe::uint32 *pauseSet; + MARTe::uint8 *pauseSet; // Output signal to which the output value will be written. // One state write One signal. MARTe::uint32 *outputSignal; // state notify output - MARTe::uint32 *outputBeamON; - MARTe::uint32 *outputHVArmed; - MARTe::uint32 *outputHVInjection; - MARTe::uint32 *outputRFON; + MARTe::uint8 *outputBeamON; + MARTe::uint8 *outputHVArmed; + MARTe::uint8 *outputHVInjection; + MARTe::uint8 *outputRFON; // elapsed time notify output; MARTe::uint32 *outputBeamONTime; MARTe::uint32 *outputRFONTime; @@ -213,11 +214,11 @@ private: MARTe::uint32 *shotCounter; // Added for HVPS state (20201117) - MARTe::uint32 *outputAPSHVON; - MARTe::uint32 *outputAPSSWON; - MARTe::uint32 *outputBPSHVON; - MARTe::uint32 *outputBPSSWON; - MARTe::uint32 *outputMHVPSON; + MARTe::uint8 *outputAPSHVON; + MARTe::uint8 *outputAPSSWON; + MARTe::uint8 *outputBPSHVON; + MARTe::uint8 *outputBPSSWON; + MARTe::uint8 *outputMHVPSON; // Output signals for NI devices MARTe::uint32 *outputSignalNI6259;