Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
389 lines
12 KiB
INI
389 lines
12 KiB
INI
+TCPMessageProxy = {
|
|
Class = TCPSocketMessageProxyExample
|
|
Port = 24680
|
|
|
|
}
|
|
// echo -e "Destination=StateMachine\nFunction=GOTOSTATE2" | nc 127.0.0.1 24680
|
|
+StateMachine = {
|
|
Class = StateMachine
|
|
+INITIAL = {
|
|
Class = ReferenceContainer
|
|
+START = {
|
|
Class = StateMachineEvent
|
|
NextState = "STATE1"
|
|
NextStateError = "ERROR"
|
|
Timeout = 0
|
|
+ChangeToState1Msg = {
|
|
Class = Message
|
|
Destination = TestApp
|
|
Mode = ExpectsReply
|
|
Function = PrepareNextState
|
|
+Parameters = {
|
|
Class = ConfigurationDatabase
|
|
param1 = State1
|
|
}
|
|
}
|
|
+StartNextStateExecutionMsg = {
|
|
Class = Message
|
|
Destination = TestApp
|
|
Function = StartNextStateExecution
|
|
Mode = ExpectsReply
|
|
}
|
|
}
|
|
}
|
|
+STATE1 = {
|
|
Class = ReferenceContainer
|
|
+GOTOSTATE2 = {
|
|
Class = StateMachineEvent
|
|
NextState = "STATE2"
|
|
NextStateError = "ERROR"
|
|
Timeout = 0
|
|
+PrepareChangeToState2Msg = {
|
|
Class = Message
|
|
Destination = TestApp
|
|
Mode = ExpectsReply
|
|
Function = PrepareNextState
|
|
+Parameters = {
|
|
Class = ConfigurationDatabase
|
|
param1 = State2
|
|
}
|
|
}
|
|
+StopCurrentStateExecutionMsg = {
|
|
Class = Message
|
|
Destination = TestApp
|
|
Function = StopCurrentStateExecution
|
|
Mode = ExpectsReply
|
|
}
|
|
+StartNextStateExecutionMsg = {
|
|
Class = Message
|
|
Destination = TestApp
|
|
Function = StartNextStateExecution
|
|
Mode = ExpectsReply
|
|
}
|
|
+TriggerPSUMsg = {
|
|
Class = Message
|
|
Destination = "TestApp.Data.UartOutDS"
|
|
Function = GoWaitTrigger
|
|
Mode = ExpectsReply
|
|
}
|
|
}
|
|
+ERROR = {
|
|
Class = StateMachineEvent
|
|
NextState = "ERROR"
|
|
NextStateError = "ERROR"
|
|
}
|
|
}
|
|
+STATE2 = {
|
|
Class = ReferenceContainer
|
|
+GOTOSTATE3 = {
|
|
Class = StateMachineEvent
|
|
NextState = "STATE3"
|
|
NextStateError = "ERROR"
|
|
Timeout = 0
|
|
+PrepareChangeToState3Msg = {
|
|
Class = Message
|
|
Destination = TestApp
|
|
Mode = ExpectsReply
|
|
Function = PrepareNextState
|
|
+Parameters = {
|
|
Class = ConfigurationDatabase
|
|
param1 = State3
|
|
}
|
|
}
|
|
+StopCurrentStateExecutionMsg = {
|
|
Class = Message
|
|
Destination = TestApp
|
|
Function = StopCurrentStateExecution
|
|
Mode = ExpectsReply
|
|
}
|
|
+StartNextStateExecutionMsg = {
|
|
Class = Message
|
|
Destination = TestApp
|
|
Function = StartNextStateExecution
|
|
Mode = ExpectsReply
|
|
}
|
|
+TriggerPSUMsg = {
|
|
Class = Message
|
|
Destination = "TestApp.Data.UartOutDS"
|
|
Function = TriggerPSU
|
|
Mode = ExpectsReply
|
|
}
|
|
}
|
|
+ERROR = {
|
|
Class = StateMachineEvent
|
|
NextState = "ERROR"
|
|
NextStateError = "ERROR"
|
|
}
|
|
}
|
|
+STATE3 = {
|
|
Class = ReferenceContainer
|
|
+GOTOSTATE1 = {
|
|
Class = StateMachineEvent
|
|
NextState = "STATE1"
|
|
NextStateError = "ERROR"
|
|
Timeout = 0
|
|
+PrepareChangeToState1Msg = {
|
|
Class = Message
|
|
Destination = TestApp
|
|
Mode = ExpectsReply
|
|
Function = PrepareNextState
|
|
+Parameters = {
|
|
Class = ConfigurationDatabase
|
|
param1 = State1
|
|
}
|
|
}
|
|
+StopCurrentStateExecutionMsg = {
|
|
Class = Message
|
|
Destination = TestApp
|
|
Function = StopCurrentStateExecution
|
|
Mode = ExpectsReply
|
|
}
|
|
+StartNextStateExecutionMsg = {
|
|
Class = Message
|
|
Destination = TestApp
|
|
Function = StartNextStateExecution
|
|
Mode = ExpectsReply
|
|
}
|
|
+TriggerPSUMsg = {
|
|
Class = Message
|
|
Destination = "TestApp.Data.UartOutDS"
|
|
Function = GoOnlineIdle
|
|
Mode = ExpectsReply
|
|
}
|
|
}
|
|
+ERROR = {
|
|
Class = StateMachineEvent
|
|
NextState = "ERROR"
|
|
NextStateError = "ERROR"
|
|
}
|
|
}
|
|
+ERROR = {
|
|
Class = ReferenceContainer
|
|
+ENTER = {
|
|
Class = ReferenceContainer
|
|
+StopCurrentStateExecutionMsg = {
|
|
Class = Message
|
|
Destination = TestApp
|
|
Function = StopCurrentStateExecution
|
|
Mode = ExpectsReply
|
|
}
|
|
+PrepareChangeToErrorMsg = {
|
|
Class = Message
|
|
Destination = TestApp
|
|
Mode = ExpectsReply
|
|
Function = PrepareNextState
|
|
+Parameters = {
|
|
Class = ConfigurationDatabase
|
|
param1 = StateError
|
|
}
|
|
}
|
|
+StartNextStateExecutionMsg = {
|
|
Class = Message
|
|
Destination = TestApp
|
|
Function = StartNextStateExecution
|
|
Mode = ExpectsReply
|
|
}
|
|
}
|
|
+RESET = {
|
|
Class = StateMachineEvent
|
|
NextState = "STATE1"
|
|
NextStateError = "STATE1"
|
|
Timeout = 0
|
|
+StopCurrentStateExecutionMsg = {
|
|
Class = Message
|
|
Destination = TestApp
|
|
Function = StopCurrentStateExecution
|
|
Mode = ExpectsReply
|
|
}
|
|
+PrepareChangeToState1Msg = {
|
|
Class = Message
|
|
Destination = TestApp
|
|
Mode = ExpectsReply
|
|
Function = PrepareNextState
|
|
+Parameters = {
|
|
Class = ConfigurationDatabase
|
|
param1 = State1
|
|
}
|
|
}
|
|
+StartNextStateExecutionMsg = {
|
|
Class = Message
|
|
Destination = TestApp
|
|
Function = StartNextStateExecution
|
|
Mode = ExpectsReply
|
|
}
|
|
}
|
|
}
|
|
}
|
|
$TestApp = {
|
|
Class = RealTimeApplication
|
|
+Functions = {
|
|
Class = ReferenceContainer
|
|
+GAMTimer = {
|
|
Class = IOGAM
|
|
InputSignals = {
|
|
Counter = {
|
|
DataSource = Timer
|
|
Type = uint32
|
|
}
|
|
Time = {
|
|
Frequency = 2
|
|
DataSource = Timer
|
|
Type = uint32
|
|
}
|
|
}
|
|
OutputSignals = {
|
|
Counter = {
|
|
DataSource = DDB1
|
|
Type = uint32
|
|
}
|
|
Time = {
|
|
DataSource = DDB1
|
|
Type = uint32
|
|
}
|
|
}
|
|
}
|
|
+GAMWF = {
|
|
Class = WaveformGAM::WaveformSin
|
|
Amplitude = 200.0
|
|
Frequency = 0.1
|
|
Phase = 0.0
|
|
Offset = 200.1
|
|
InputSignals = {
|
|
Time = {
|
|
DataSource = "DDB1"
|
|
Type = uint32
|
|
}
|
|
}
|
|
OutputSignals = {
|
|
Reference1 = {
|
|
DataSource = "DDB1"
|
|
Type = float32
|
|
}
|
|
}
|
|
}
|
|
+GAMDisplay = {
|
|
Class = IOGAM
|
|
InputSignals = {
|
|
Time = {
|
|
DataSource = DDB1
|
|
Type = uint32
|
|
}
|
|
Reference1 = {
|
|
DataSource = DDB1
|
|
Type = float32
|
|
}
|
|
}
|
|
OutputSignals = {
|
|
Time = {
|
|
DataSource = LoggerDataSource
|
|
Type = uint32
|
|
}
|
|
Reference1 = {
|
|
DataSource = LoggerDataSource
|
|
Type = float32
|
|
}
|
|
}
|
|
}
|
|
+SerialOutGAM = {
|
|
Class = IOGAM
|
|
InputSignals = {
|
|
Reference1 = {
|
|
DataSource = DDB1
|
|
Type = float32
|
|
}
|
|
}
|
|
OutputSignals = {
|
|
SerialOut = {
|
|
DataSource = UartOutDS
|
|
Type = float32
|
|
Trigger = 1
|
|
}
|
|
}
|
|
}
|
|
}
|
|
+Data = {
|
|
Class = ReferenceContainer
|
|
DefaultDataSource = DDB1
|
|
+DDB1 = {
|
|
Class = GAMDataSource
|
|
}
|
|
+LoggerDataSource = {
|
|
Class = LoggerDataSource
|
|
}
|
|
+Timings = {
|
|
Class = TimingDataSource
|
|
}
|
|
+Timer = {
|
|
Class = LinuxTimer
|
|
SleepNature = "Default"
|
|
Signals = {
|
|
Counter = {
|
|
Type = uint32
|
|
}
|
|
Time = {
|
|
Type = uint32
|
|
}
|
|
}
|
|
}
|
|
+UartOutDS = {
|
|
Class = PSUCommunicator::PSUCommunicatorTX
|
|
PortName = "/dev/ttyS0" //Name of the UART port, Mandatory
|
|
//PortName = "/dev/ttyLoopWr" //Name of the UART port, Mandatory
|
|
BaudRate = 921600
|
|
//BaudRate = 115200 // 9600 10.851 µs / Byte
|
|
//115200 576000//BAUD UART rate
|
|
Timeout = 200000 //Maximum time to wait for data
|
|
CPUMask = 8 //Affinity of the CPU of where to read data from
|
|
SerialTimeout = 1000
|
|
PointOfZeroCurrent = 50.0 //5.100000e+02
|
|
CurrentStep = 1.0 //929700e+00
|
|
Signals = {
|
|
SerialOut = {
|
|
Type = float32 //Mandatory. Only type that is supported.
|
|
OutputRange = 10.0 //Mandatory. The channel Module Output Range in volt.
|
|
}
|
|
}
|
|
}
|
|
}
|
|
+States = {
|
|
Class = ReferenceContainer
|
|
+State1 = {
|
|
Class = RealTimeState
|
|
+Threads = {
|
|
Class = ReferenceContainer
|
|
+Thread1 = {
|
|
Class = RealTimeThread
|
|
CPUs = 0x1
|
|
Functions = {GAMTimer GAMWF SerialOutGAM GAMDisplay}
|
|
}
|
|
}
|
|
}
|
|
+State2 = {
|
|
Class = RealTimeState
|
|
+Threads = {
|
|
Class = ReferenceContainer
|
|
+Thread1 = {
|
|
Class = RealTimeThread
|
|
CPUs = 0x1
|
|
Functions = {GAMTimer GAMWF SerialOutGAM GAMDisplay}
|
|
}
|
|
}
|
|
}
|
|
+State3 = {
|
|
Class = RealTimeState
|
|
+Threads = {
|
|
Class = ReferenceContainer
|
|
+Thread1 = {
|
|
Class = RealTimeThread
|
|
CPUs = 0x1
|
|
Functions = {GAMTimer GAMWF SerialOutGAM GAMDisplay}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
+Scheduler = {
|
|
Class = GAMScheduler
|
|
TimingDataSource = Timings
|
|
}
|
|
}
|