Added PSU DS messages

Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
This commit is contained in:
2025-10-26 00:42:25 +01:00
parent cc8cab6d5f
commit 90591f504a
3 changed files with 46 additions and 40 deletions

View File

@@ -1,3 +1,9 @@
+TCPMessageProxy = {
Class = TCPSocketMessageProxyExample
Port = 24680
}
// echo -e "Destination=StateMachine\nFunction=GOTOSTATE2" | nc 127.0.0.1 24680
+StateMachine = { +StateMachine = {
Class = StateMachine Class = StateMachine
+INITIAL = { +INITIAL = {
@@ -54,6 +60,12 @@
Function = StartNextStateExecution Function = StartNextStateExecution
Mode = ExpectsReply Mode = ExpectsReply
} }
+TriggerPSUMsg = {
Class = Message
Destination = "TestApp.Data.UartOutDS"
Function = TriggerPSU
Mode = ExpectsReply
}
} }
+ERROR = { +ERROR = {
Class = StateMachineEvent Class = StateMachineEvent
@@ -218,46 +230,12 @@ $TestApp = {
} }
} }
} }
+GAMWF1 = { +GAMWF = {
Class = WaveformGAM::WaveformPointsDef
Points = {-1000 1000}
Times = {0 10000}
InputSignals = {
Time = {
DataSource = DDB1
Type = uint32
}
}
OutputSignals = {
Reference1 = {
DataSource = DDB1
Type = float32
}
}
}
+GAMWF2 = {
Class = WaveformGAM::WaveformPointsDef
Points = {1000 -1000}
Times = {0 10000}
InputSignals = {
Time = {
DataSource = DDB1
Type = uint32
}
}
OutputSignals = {
Reference1 = {
DataSource = DDB1
Type = float32
}
}
}
+GAMWF3 = {
Class = WaveformGAM::WaveformSin Class = WaveformGAM::WaveformSin
Amplitude = 10.0 Amplitude = 100.0
Frequency = 0.1 Frequency = 0.1
Phase = 0.0 Phase = 0.0
Offset = 1.1 Offset = 100.1
InputSignals = { InputSignals = {
Time = { Time = {
DataSource = "DDB1" DataSource = "DDB1"
@@ -363,7 +341,7 @@ $TestApp = {
+Thread1 = { +Thread1 = {
Class = RealTimeThread Class = RealTimeThread
CPUs = 0x1 CPUs = 0x1
Functions = {GAMTimer GAMWF1 SerialOutGAM GAMDisplay} Functions = {GAMTimer GAMWF SerialOutGAM GAMDisplay}
} }
} }
} }
@@ -374,7 +352,7 @@ $TestApp = {
+Thread1 = { +Thread1 = {
Class = RealTimeThread Class = RealTimeThread
CPUs = 0x1 CPUs = 0x1
Functions = {GAMTimer GAMWF2 GAMDisplay} Functions = {GAMTimer GAMWF SerialOutGAM GAMDisplay}
} }
} }
} }
@@ -385,7 +363,7 @@ $TestApp = {
+Thread1 = { +Thread1 = {
Class = RealTimeThread Class = RealTimeThread
CPUs = 0x1 CPUs = 0x1
Functions = {GAMTimer GAMWF3 GAMDisplay} Functions = {GAMTimer GAMWF GAMDisplay}
} }
} }
} }

View File

@@ -433,6 +433,26 @@ bool PSUCommunicatorTX::Synchronise() {
*/ */
return ok; return ok;
} }
// Messages
ErrorManagement::ErrorType PSUCommunicatorTX::TriggerPSU() {
ErrorManagement::ErrorType err;
REPORT_ERROR(ErrorManagement::Information,
"PSUCommunicatorTX::TriggerPSU. Got Message!");
communicatorOnlineStage = FA_COMMUNICATOR_ONLINE_DISCHARGE;
return err;
}
ErrorManagement::ErrorType PSUCommunicatorTX::GoOnline() {
ErrorManagement::ErrorType err;
REPORT_ERROR(ErrorManagement::Information,
"PSUCommunicatorTX::GoOnline. Got Message!");
communicatorOnlineStage = FA_COMMUNICATOR_ONLINE_WAIT_CODAC_TRIGGER;
return err;
}
CLASS_REGISTER(PSUCommunicatorTX, "1.0") CLASS_REGISTER(PSUCommunicatorTX, "1.0")
CLASS_METHOD_REGISTER(PSUCommunicatorTX, TriggerPSU)
CLASS_METHOD_REGISTER(PSUCommunicatorTX, GoOnline)
} // namespace MARTe } // namespace MARTe
// vim: syntax=cpp ts=2 sw=2 sts=2 sr et // vim: syntax=cpp ts=2 sw=2 sts=2 sr et

View File

@@ -197,6 +197,14 @@ public:
* @return true if the writing of all the channels is successful. * @return true if the writing of all the channels is successful.
*/ */
virtual bool Synchronise(); virtual bool Synchronise();
/**
* @brief
* @details This method
* It can be called within a
* MARTe message.
*/
ErrorManagement::ErrorType TriggerPSU();
ErrorManagement::ErrorType GoOnline();
private: private:
/** /**