Generation working and Compilation of MARTe components
This commit is contained in:
@@ -0,0 +1 @@
|
||||
Last SDD Generation: Tue May 13 15:53:47 UTC 2025
|
||||
@@ -0,0 +1,187 @@
|
||||
/**
|
||||
* @file JAPreProgrammedGAM.h
|
||||
* @brief Header file for class JAPreProgrammedGAM
|
||||
* @date Jan, 2019
|
||||
* @author rhari
|
||||
*
|
||||
* @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 This header file contains the declaration of the class JAPreProgrammedGAM
|
||||
* with all of its public, protected and private members. It may also include
|
||||
* definitions for inline methods which need to be visible to the compiler.
|
||||
*/
|
||||
|
||||
#ifndef GAMS_JAPREPROGRAMMEDGAM_H_
|
||||
#define GAMS_JAPREPROGRAMMEDGAM_H_
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Standard header includes */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Project header includes */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "GAM.h"
|
||||
#include "Message.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Class declaration */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* @brief GAM that update PS output value for pre-programmed operation.
|
||||
*
|
||||
* The configuration syntax is (names and signal quantity are only given as an example):
|
||||
* <pre>
|
||||
* +PreProgrammedGAM = {
|
||||
* Class = JAPreProgrammedGAM
|
||||
* Directory = "../Configurations" // Directory which has pre-pro configuration file.
|
||||
* PreProgrammedPeriodMs = 1 // RFON state is executed every millisecond.
|
||||
* InputSignals = {
|
||||
* CSV_LOAD = {
|
||||
* DataSource = EPICSCAInput
|
||||
* Type = uint32
|
||||
* }
|
||||
* Filename = {
|
||||
* Alias = CSV_NAME
|
||||
* DataSource = EPICSCAInput
|
||||
* }
|
||||
* FHPS_REF = {
|
||||
* DataSource = DDB1
|
||||
* Type = float32
|
||||
* }
|
||||
* RFON = {
|
||||
* DataSource = RealTimeThreadAsyncBridge
|
||||
* Type = uint32
|
||||
* }
|
||||
* }
|
||||
* OutputSignals = {
|
||||
* GYA_PREHEAT_TIME = {
|
||||
* DataSource = DDB1
|
||||
* Type = int32
|
||||
* }
|
||||
* MHVPS_REF = {
|
||||
* DataSource = DDB1
|
||||
* Type = float32
|
||||
* }
|
||||
* BPS_REF = {
|
||||
* DataSource = DDB1
|
||||
* Type = float32
|
||||
* }
|
||||
* APS_REF = {
|
||||
* DataSource = DDB1
|
||||
* Type = float32
|
||||
* }
|
||||
* MCPS_TRG_CURR_SET = {
|
||||
* DataSource = DDB1
|
||||
* Type = float32
|
||||
* }
|
||||
* GCPS_TRG_CURR_SET = {
|
||||
* DataSource = DDB1
|
||||
* Type = float32
|
||||
* }
|
||||
* FHPS_REF = {
|
||||
* DataSource = DDB1
|
||||
* Type = float32
|
||||
* }
|
||||
* CSV_LOADED = {
|
||||
* DataSource = DDB1
|
||||
* Type = uint32
|
||||
* }
|
||||
* CSV_ERR = {
|
||||
* DataSource = DDB1
|
||||
* Type = uint32
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
*/
|
||||
|
||||
class JAPreProgrammedGAM : public MARTe::GAM, public MARTe::StatefulI {
|
||||
public:
|
||||
CLASS_REGISTER_DECLARATION()
|
||||
|
||||
JAPreProgrammedGAM();
|
||||
|
||||
virtual ~JAPreProgrammedGAM();
|
||||
|
||||
virtual bool Initialise(MARTe::StructuredDataI & data);
|
||||
|
||||
virtual bool Setup();
|
||||
|
||||
virtual bool Execute();
|
||||
|
||||
virtual bool PrepareNextState(const MARTe::char8 * const currentStateName,
|
||||
const MARTe::char8 * const nextStateName);
|
||||
|
||||
private:
|
||||
bool LoadFile();
|
||||
|
||||
void DeleteArrays();
|
||||
|
||||
//Parameters
|
||||
MARTe::StreamString directory; //Location for prepro configuration file.
|
||||
MARTe::uint32 preProgrammedExecutaionPeriodMs; // Time between to execution cycles in milliseconds in pre-programmed mode.
|
||||
|
||||
//Input Signals
|
||||
MARTe::uint32 *loadTriggerSignal; //index:0
|
||||
MARTe::uint32 filenameSignalIndex;//index:1
|
||||
MARTe::float32 *fhpsrefSignal; //index:2
|
||||
MARTe::uint32 *rfonStateSignal; //index:3
|
||||
|
||||
//Output Signals
|
||||
MARTe::int32 *timeSignal; //index:0
|
||||
MARTe::float32 **valueSignals; //index:1-5 = BPS,APS,MC,GC,FHPS
|
||||
MARTe::uint32 *fileLoadedSignal; //index:6
|
||||
MARTe::uint32 *fileLoadErrorOutput;//index:7
|
||||
|
||||
//Internal variables
|
||||
MARTe::int32 *preProgrammedTime;
|
||||
MARTe::float32 **preProgrammedValues;
|
||||
|
||||
MARTe::uint32 startTime;
|
||||
|
||||
//Number of columns in csv, EXCLUDING the time
|
||||
MARTe::uint32 numberOfPreProgrammedValues; //is 5.(BPS, APS, MC, GC, FHPS)
|
||||
MARTe::uint32 numberOfPreProgrammedTimeRows; //This start from t=0 row.
|
||||
MARTe::uint32 currentRow;
|
||||
|
||||
// Number of milliseconds since the last time output signals were updated.
|
||||
MARTe::uint32 msCounter;
|
||||
|
||||
// Row number where the pre-programmed data begins (time == 0).
|
||||
MARTe::uint32 preProgrammedRow;
|
||||
|
||||
enum OperationMode {
|
||||
LoadFileMode, PreProgrammedMode, None
|
||||
};
|
||||
enum PreProTableDefinition {
|
||||
Time, MHVPS, BPS, APS, MCPS, GCPS, FHPS
|
||||
};
|
||||
|
||||
OperationMode mode;
|
||||
|
||||
bool resetOutputSignals;
|
||||
|
||||
// Flag determining whether file should be read (so it isn't read multiple time)
|
||||
bool readOnce;
|
||||
};
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Inline method definitions */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
#endif /* GAMS_JAPREPROGRAMMEDGAM_H_ */
|
||||
@@ -0,0 +1,103 @@
|
||||
#test configuration file2
|
||||
#Time,BPS,APS,MC,GC,FHPS
|
||||
0,10,10,10,10,10
|
||||
10,9,9,9,9,9
|
||||
20,8,8,8,8,8
|
||||
30,7,7,7,7,7
|
||||
40,6,6,6,6,6
|
||||
50,5,5,5,5,5
|
||||
60,4,4,4,4,4
|
||||
70,3,3,3,3,3
|
||||
80,2,2,2,2,2
|
||||
90,1,1,1,1,1
|
||||
100,0,0,0,0,0
|
||||
110,1,1,1,1,1
|
||||
120,2,2,2,2,2
|
||||
130,3,3,3,3,3
|
||||
140,4,4,4,4,4
|
||||
150,5,5,5,5,5
|
||||
160,6,6,6,6,6
|
||||
170,7,7,7,7,7
|
||||
180,8,8,8,8,8
|
||||
190,9,9,9,9,9
|
||||
200,10,10,10,10,10
|
||||
210,9,9,9,9,9
|
||||
220,8,8,8,8,8
|
||||
230,7,7,7,7,7
|
||||
240,6,6,6,6,6
|
||||
250,5,5,5,5,5
|
||||
260,4,4,4,4,4
|
||||
270,3,3,3,3,3
|
||||
280,2,2,2,2,2
|
||||
290,1,1,1,1,1
|
||||
300,0,0,0,0,0
|
||||
310,1,1,1,1,1
|
||||
320,2,2,2,2,2
|
||||
330,3,3,3,3,3
|
||||
340,4,4,4,4,4
|
||||
350,5,5,5,5,5
|
||||
360,6,6,6,6,6
|
||||
370,7,7,7,7,7
|
||||
380,8,8,8,8,8
|
||||
390,9,9,9,9,9
|
||||
400,10,10,10,10,10
|
||||
410,9,9,9,9,9
|
||||
420,8,8,8,8,8
|
||||
430,7,7,7,7,7
|
||||
440,6,6,6,6,6
|
||||
450,5,5,5,5,5
|
||||
460,4,4,4,4,4
|
||||
470,3,3,3,3,3
|
||||
480,2,2,2,2,2
|
||||
490,1,1,1,1,1
|
||||
500,0,0,0,0,0
|
||||
510,1,1,1,1,1
|
||||
520,2,2,2,2,2
|
||||
530,3,3,3,3,3
|
||||
540,4,4,4,4,4
|
||||
550,5,5,5,5,5
|
||||
560,6,6,6,6,6
|
||||
570,7,7,7,7,7
|
||||
580,8,8,8,8,8
|
||||
590,9,9,9,9,9
|
||||
600,10,10,10,10,10
|
||||
610,9,9,9,9,9
|
||||
620,8,8,8,8,8
|
||||
630,7,7,7,7,7
|
||||
640,6,6,6,6,6
|
||||
650,5,5,5,5,5
|
||||
660,4,4,4,4,4
|
||||
670,3,3,3,3,3
|
||||
680,2,2,2,2,2
|
||||
690,1,1,1,1,1
|
||||
700,0,0,0,0,0
|
||||
710,1,1,1,1,1
|
||||
720,2,2,2,2,2
|
||||
730,3,3,3,3,3
|
||||
740,4,4,4,4,4
|
||||
750,5,5,5,5,5
|
||||
760,6,6,6,6,6
|
||||
770,7,7,7,7,7
|
||||
780,8,8,8,8,8
|
||||
790,9,9,9,9,9
|
||||
800,10,10,10,10,10
|
||||
810,9,9,9,9,9
|
||||
820,8,8,8,8,8
|
||||
830,7,7,7,7,7
|
||||
840,6,6,6,6,6
|
||||
850,5,5,5,5,5
|
||||
860,4,4,4,4,4
|
||||
870,3,3,3,3,3
|
||||
880,2,2,2,2,2
|
||||
890,1,1,1,1,1
|
||||
900,0,0,0,0,0
|
||||
910,1,1,1,1,1
|
||||
920,2,2,2,2,2
|
||||
930,3,3,3,3,3
|
||||
940,4,4,4,4,4
|
||||
950,5,5,5,5,5
|
||||
960,6,6,6,6,6
|
||||
970,7,7,7,7,7
|
||||
980,8,8,8,8,8
|
||||
990,9,9,9,9,9
|
||||
1000,10,10,10,10,10
|
||||
Reference in New Issue
Block a user