Skip to content
Snippets Groups Projects
Commit 873b6fe5 authored by Federico Felici's avatar Federico Felici
Browse files

Remove all cfs demo related things from the core

parent 8748c442
No related branches found
No related tags found
No related merge requests found
Showing
with 0 additions and 674 deletions
**/*.sldd
**/*.cfg
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
function algo_cfs1_harness_run(obj)
% run harness and check the result
% load tunable control parameters from mds
shot = 1; % shot reference
obj.actualize(shot);
% Input Data - must be structure of timeseries matching input bus structure
% time = 0:obj.gettiming.dt:1;
% data = single(sin(2*pi*time*10)');
% % NB: these struct name and types must match the corresponding data bus
% tsStructData = struct('simple_signal',timeseries(data,time,'Name','Test Input Data'));
% SimIn object to customize configuration of Simulation run for test
SimIn = Simulink.SimulationInput([obj.getname '_harness']);
% Create cfs1 Input dataset for this model
% Dataset = createInputDataset(obj.getname);
% assign input data signal to Simulink.Signal object
% DataIn = Simulink.SimulationData.Signal;
% DataIn.Values = tsStructData;
% assign as first element in input data set
% isig = find(contains(Dataset.getElementNames,'signal_in')); % find input signal index
% Dataset = Dataset.setElement(isig,DataIn); %#ok<FNDSB>
% SimIn.ExternalInput = Dataset; % assign this as external input for simulation
% Custom parameters for this run to save outport data
SimIn = SimIn.setModelParameter('SaveOutput','on'); % set to save outport signals
SimIn = SimIn.setModelParameter('SignalLogging','on'); % set to save log signals
SimIn = SimIn.setModelParameter('OutputSaveName','SimOut');
SimIn = SimIn.setModelParameter('SaveFormat','Dataset');
SimIn = SimIn.setModelParameter('StartTime',num2str(obj.gettiming().t_start));
SimIn = SimIn.setModelParameter('StopTime',num2str(obj.gettiming().t_stop));
SimIn = SimIn.setModelParameter('FixedStep',num2str(obj.gettiming().dt));
% simulate - simulate only single types to save time
result = sim(SimIn);
% check output port data
tp = Simulink.data.evalinGlobal(obj.getname,'algo_cfs1_tp.Value');
fp = Simulink.data.evalinGlobal(obj.getname,'algo_cfs1_fp');
input = evalin('base','algo_cfs1_inbus1');
input1 = input.signal1.Data;
input2 = input.signal2.Data;
output1 = result.simout.signal1.Data;
output2 = result.simout.signal2.Data;
size(input1)
size(output1)
maxerror1 = 0.1;
maxerror2 = 0.1;
assert(max(abs(output1 - input1.*tp.gain))<maxerror1,'Wrong output 1!');
assert(max(abs(output2 - (input2.*tp.refmodel.gain+fp.refmodel.offset)))<maxerror2,'Wrong output 2!');
% check logs which contain a SCDsignal type data
% logsout = result.logsout;
%
% signal = logsout.getElement('SCDsignal type bus').Values.Value;
% Quality = logsout.getElement('SCDsignal type bus').Values.QualityTag;
% State = logsout.getElement('SCDsignal type bus').Values.ProductionState;
%
% assert(all(State .Data == ProductionState.RUNNING),'ProductionState must be RUNNING');
% assert(all(Quality.Data == QualityTag.GOOD ),'QualityTag must be RUNNING' );
end
% Bus object: SCDalgo_cfs1_inBus
clear elems;
elems(1) = Simulink.BusElement;
elems(1).Name = 'signal1';
elems(1).Dimensions = 1;
elems(1).DimensionsMode = 'Fixed';
elems(1).DataType = 'single';
elems(1).SampleTime = -1;
elems(1).Complexity = 'real';
elems(1).Min = [];
elems(1).Max = [];
elems(1).DocUnits = '';
elems(1).Description = '';
elems(2) = Simulink.BusElement;
elems(2).Name = 'signal2';
elems(2).Dimensions = 1;
elems(2).DimensionsMode = 'Fixed';
elems(2).DataType = 'single';
elems(2).SampleTime = -1;
elems(2).Complexity = 'real';
elems(2).Min = [];
elems(2).Max = [];
elems(2).DocUnits = '';
elems(2).Description = '';
ii=3;
elems(ii) = Simulink.BusElement;
elems(ii).Name = 'signal3';
elems(ii).Dimensions = 1;
elems(ii).DimensionsMode = 'Fixed';
elems(ii).DataType = 'single';
elems(ii).SampleTime = -1;
elems(ii).Complexity = 'real';
elems(ii).Min = [];
elems(ii).Max = [];
elems(ii).DocUnits = '';
elems(ii).Description = '';
ii=4;
elems(ii) = Simulink.BusElement;
elems(ii).Name = 'signal4';
elems(ii).Dimensions = 1;
elems(ii).DimensionsMode = 'Fixed';
elems(ii).DataType = 'single';
elems(ii).SampleTime = -1;
elems(ii).Complexity = 'real';
elems(ii).Min = [];
elems(ii).Max = [];
elems(ii).DocUnits = '';
elems(ii).Description = '';
ii=5;
elems(ii) = Simulink.BusElement;
elems(ii).Name = 'signal5';
elems(ii).Dimensions = 1;
elems(ii).DimensionsMode = 'Fixed';
elems(ii).DataType = 'single';
elems(ii).SampleTime = -1;
elems(ii).Complexity = 'real';
elems(ii).Min = [];
elems(ii).Max = [];
elems(ii).DocUnits = '';
elems(ii).Description = '';
algo_cfs1_inBus = Simulink.Bus;
algo_cfs1_inBus.HeaderFile = '';
algo_cfs1_inBus.Description = '';
algo_cfs1_inBus.DataScope = 'Auto';
algo_cfs1_inBus.Alignment = -1;
algo_cfs1_inBus.Elements = elems;
clear elems;
function fp = algo_cfs1_loadfp(obj)
%% Load other fixed parameters
fp.timing = obj.gettiming;
fp.refmodel.offset = 1; % a fixed parameter
%% cfs1 and 2 combined sim setup
%algo_cfs1and2_harness_setup(obj);
end
\ No newline at end of file
function TP = algo_cfs1_loadtp()
% Setup tunable control params default values
TP.enable = true;
TP.gain = single(2);
TP.refmodel.gain = single(4); % another gain used in referenced model
TP.rowvect = int32([1 2 3]);
TP.colvect = single([1 2 3]');
TP.matrix = int8([1 2; 3 4]);
end
% Bus object: SCDalgo_cfs1_outBus
clear elems;
elems(1) = Simulink.BusElement;
elems(1).Name = 'signal1';
elems(1).Dimensions = 1;
elems(1).DimensionsMode = 'Fixed';
%elems(1).DataType = 'Bus:SCDBus_single_11_Vector';
elems(1).DataType = 'single';
elems(1).SampleTime = -1;
elems(1).Complexity = 'real';
elems(1).Min = [];
elems(1).Max = [];
elems(1).DocUnits = '';
elems(1).Description = '';
elems(2) = Simulink.BusElement;
elems(2).Name = 'signal2';
elems(2).Dimensions = 1;
elems(2).DimensionsMode = 'Fixed';
%elems(2).DataType = 'Bus:SCDBus_int32_Scalar';
elems(2).DataType = 'single';
elems(2).SampleTime = -1;
elems(2).Complexity = 'real';
elems(2).Min = [];
elems(2).Max = [];
elems(2).DocUnits = '';
elems(2).Description = '';
elems(3) = Simulink.BusElement;
elems(3).Name = 'signal3';
elems(3).Dimensions = 1;
elems(3).DimensionsMode = 'Fixed';
elems(3).DataType = 'single';
elems(3).SampleTime = -1;
elems(3).Complexity = 'real';
elems(3).Min = [];
elems(3).Max = [];
elems(3).DocUnits = '';
elems(3).Description = '';
ii=4;
elems(ii) = Simulink.BusElement;
elems(ii).Name = 'signal4';
elems(ii).Dimensions = 1;
elems(ii).DimensionsMode = 'Fixed';
elems(ii).DataType = 'single';
elems(ii).SampleTime = -1;
elems(ii).Complexity = 'real';
elems(ii).Min = [];
elems(ii).Max = [];
elems(ii).DocUnits = '';
elems(ii).Description = '';
ii=5;
elems(ii) = Simulink.BusElement;
elems(ii).Name = 'signal5';
elems(ii).Dimensions = 1;
elems(ii).DimensionsMode = 'Fixed';
elems(ii).DataType = 'single';
elems(ii).SampleTime = -1;
elems(ii).Complexity = 'real';
elems(ii).Min = [];
elems(ii).Max = [];
elems(ii).DocUnits = '';
elems(ii).Description = '';
algo_cfs1_outBus = Simulink.Bus;
algo_cfs1_outBus.HeaderFile = '';
algo_cfs1_outBus.Description = '';
algo_cfs1_outBus.DataScope = 'Auto';
algo_cfs1_outBus.Alignment = -1;
algo_cfs1_outBus.Elements = elems;
clear elems;
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
function [busNames,Buses] = algo_cfs1_signal_buses()
% [busNames,Buses] = SCDalgo_cfs1_signal_buses()
% Define some buses needed for the cfs1
%% Define signal buses for various SCDsignal types
% Data examples for which to create buses
D = {...
ones(11,1,'single'),...
ones(3,3,'single'),...
int32(1)};
% Create buses for these signals and add them to the list
[Buses,busNames] = deal(cell(numel(D),1)); % init
for ii = 1:numel(D)
mydata = D{ii};
mysig = SCDsignal(mydata); % create SCDsignal object for this data example
mybus = mysig.createBus; % create Bus for this signal using object method
% Store
Buses{ii} = mybus;
busNames{ii} = mybus.Description;
end
%% Add output structure: a bus that includes only SCDsignal data types
% First add 3 busElements for the three signals defined above
for ii=1:3
elems(ii) = Simulink.BusElement;
elems(ii).Name = sprintf('signal%d',ii);
elems(ii).Dimensions = 1;
elems(ii).DimensionsMode = 'Fixed';
elems(ii).DataType = sprintf('Bus: %s',busNames{ii});
end
% Define output bus with these elements
outBus = Simulink.Bus;
outBus.HeaderFile = '';
outBus.Description = '';
outBus.DataScope = 'Auto';
outBus.Alignment = -1;
outBus.Elements = elems;
clear elems;
% append to list
busNames{end+1} = 'algo_cfs1_bus1';
Buses{end+1} = outBus;
% init bus
elems(1)=Simulink.BusElement;
elems(1).Name='clipgain1';
elems(1).DataType='single';
elems(2)=Simulink.BusElement;
elems(2).Name='tstart1';
elems(2).DataType='single';
elems(3)=Simulink.BusElement;
elems(3).Name='tstop1';
elems(3).DataType='single';
elems(4)=Simulink.BusElement;
elems(4).Name='enable1';
elems(4).DataType='boolean';
initBus = Simulink.Bus;
initBus.HeaderFile = '';
initBus.Description = '';
initBus.DataScope = 'Auto';
initBus.Alignment = -1;
initBus.Elements = elems;
clear elems;
% append to list
busNames{end+1} = 'algo_cfs1_init1';
Buses{end+1} = initBus;
end
classdef algo_cfs1_test < SCDalgo_test
properties
algoobj = @algoobj_cfs1;
end
end
\ No newline at end of file
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
function obj = algoobj_cfs1()
%% Doublets SPC controller algorithm
obj = SCDclass_algo('algo_cfs1');
%% Timing of the algorithm
obj=obj.settiming(-1,1e-3,1.0);
%% Fixed parameters init functions
obj=obj.addfpinitfcn('algo_cfs1_loadfp','algo_cfs1_fp');
%% Tunable parameters structure name
obj=obj.addtunparamstruct('algo_cfs1_tp', @()algo_cfs1_loadtp(), false);
%% Tunable parameters
parshot=2;
mdsserver='scd.epfl.ch';
mdstree ='scdds';
obj=obj.addparameter(SCDclass_mdsparnumeric('cfs1.params.enable' ,'enable' ,'mdshelp','a bool param',...
'mdsvalid','1','srcsrv',mdsserver,'srctree',mdstree));
obj=obj.addparameter(SCDclass_mdsparnumeric('cfs1.params.gain' ,'gain' ,'mdshelp','a tunable gain',...
'mdsvalid','1','srcsrv',mdsserver,'srctree',mdstree));
obj=obj.addparameter(SCDclass_mdsparnumeric('cfs1.params.refmodel.gain' ,'refmodel.gain' ,'mdshelp','a tunable gain',...
'mdsvalid','1','srcsrv',mdsserver,'srctree',mdstree));
obj=obj.addparameter(SCDclass_mdsparnumeric('cfs1.params.rowvect' ,'rowvect' ,'mdshelp','a row vector',...
'mdsvalid','1','srcsrv',mdsserver,'srctree',mdstree));
obj=obj.addparameter(SCDclass_mdsparnumeric('cfs1.params.colvect' ,'colvect' ,'mdshelp','a column vector',...
'mdsvalid','1','srcsrv',mdsserver,'srctree',mdstree));
obj=obj.addparameter(SCDclass_mdsparnumeric('cfs1.params.matrix' ,'matrix' ,'mdshelp','a matrix',...
'mdsvalid','1','srcsrv',mdsserver,'srctree',mdstree));
%% 2nd tunable parameters structure/parameters
% obj=obj.addtunparamstruct('algo_cfs1_tp2', @()algo_cfs1_loadtp(), false);
% obj=obj.addparameter(SCDclass_mdsparnumeric('cfs1.params.kb1','enable' ,'srcsrv','spcpc171.epfl.ch','srctree','martetest','shot',parshot));
%% Wavegens
obj=obj.addwavegenbasetruct('algo_cfs1_inbus1');
obj=obj.addwavegen(SCDclass_mdswgsigsingle( 'cfs1.inputs.signal1','signal1' ,'srcsrv',mdsserver,'srctree',mdstree));
obj=obj.addwavegen(SCDclass_mdswgsigsingle( 'cfs1.inputs.signal2','signal2' ,'srcsrv',mdsserver,'srctree',mdstree));
%% 2nd wavegen base structure/signals
% obj=obj.addwavegenbasetruct('algo_cfs1_inbus2');
% obj=obj.addwavegen(SCDclass_mdswgsigsingle( 'ai.ch003','signal1' ,'srcsrv','spcpc171.epfl.ch','srctree','martetest','shot',parshot));
% obj=obj.addwavegen(SCDclass_mdswgsigsingle( 'ai.ch004','signal2' ,'srcsrv','spcpc171.epfl.ch','srctree','martetest','shot',parshot));
%% Buses
obj = obj.addbus('algo_cfs1_inBus', 'algo_cfs1_inBus_def' );
obj = obj.addbus('algo_cfs1_outBus', 'algo_cfs1_outBus_def' );
% function handle that returns cell arays of buses and busnames to be
% registered
obj = obj.addbus('',@() algo_cfs1_signal_buses());
%obj = obj.addbus('',@() algo_cfs1_proc_out_bus());
%obj = obj.addbus('',@() algo_cfs2_proc_out_bus());
%% Tasks
%% Print (optional)
obj.printinfo;
end
>MDSPARAMS1<
>RTAPPPRESL<
>RTAPPSL<
>RTAPPPOSTSL<
>DATA<
>STATES<
% This script creates a testable
% MARTe2 cfg file for the cfs1 algorithm
% with these specifications:
%
% tunable parameters MDSplus link via MDSObjLoader instatiation
% tunable waveforms MDSplus link via MDSObjWavegen instantiation
% single realtime thread, LinuxTimer synched at 1kHz
% algorithms output MDSplus link via standard MDSWriter
%
% it is assumend that a cfs1 algorithm decritpion object
% has already been siccessfully defined, inited and setup, via:
% obj=algo_cfs1; obj.init; obj.setup;
%% Parameters
% source MDSplus shotnumber
mdssrcshot=-1;
% destination MDSplus shotnumber (-1 stands for increment current by 1)
mdsdstshot=-1;
% verbosity level
verbosity=2;
% MDS writer period
mdsperiod=0.001;
% MDSWriter segment length
mdsseglen=2000;
startpath=pwd;
fcnpath=fileparts(mfilename('fullpath'));
eval(sprintf('cd %s',fcnpath));
%% MDSParameters stub
fid=fopen('MDSPARAMS1.cfg','w');
obj.printMARTe2parconfig(-1,fid);
fclose(fid);
system('sed -i ''s/obj1.printMARTe2parconfig(-1);//g'' MDSPARAMS1.cfg');
system('sed -i ''s/MDSParameters/MDSParamLoader1/g'' MDSPARAMS1.cfg');
%% MDSWavegen stub
fid=fopen('MDSWAVEGEN1.cfg','w');
wg1dim=obj.printMARTe2wgbusconfig(-1,'algo_cfs1_inBus',1000,fid);
fclose(fid);
system('sed -i ''s/obj.printMARTe2wgbusconfig(-1,''algo_cfs1_inBus'',1000);//g'' MDSWAVEGEN1.cfg');
system('sed -i ''s/MDSWavegen_algo_cfs1_inBus_1/MDSWavegen_1/g'' MDSWAVEGEN1.cfg');
system('sed -i ''s/wavegen_algo_cfs1_inBus_1/wavegen_1/g'' MDSWAVEGEN1.cfg');
%% Structured bus stubs
algo_cfs1_inbus =Simulink.data.evalinGlobal('algo_cfs1','algo_cfs1_inBus');
inputbusflat =genbusstructstub('INPUTBUSSTRUCT1.cfg',algo_cfs1_inbus,'input','DDB1');
algo_cfs1_outbus=Simulink.data.evalinGlobal('algo_cfs1','algo_cfs1_outBus');
outputbusflat=genbusstructstub('OUTPUTBUSSTRUCT1.cfg',algo_cfs1_outbus,'output','DDB1');
%% Wavegen input stubs
genbusflatstub1('INPUTBUSFLAT1.cfg',inputbusflat,'DDB1')
%% StorageBroker output stubs
genbusflatstub1('OUTPUTBUSFLAT1DDB1.cfg',outputbusflat,'DDB1')
genbusflatstub1('OUTPUTBUSFLAT1MDS1.cfg',outputbusflat,'MDSWriter_1')
%% MDSWriter stubs
genbusflatstub2('OUTPUTBUSMDSWRITER1.cfg',outputbusflat,'cfs1.outputs','MDSW1PERIOD','MDSW1SEGLEN');
%% cfg build
system('cp algo_cfs1.cfgsrc algo_cfs1.cfg');
system('sed -i -e "/>MDSPARAMS1</r MDSPARAMS1.cfg" -e "/>MDSPARAMS1</d" algo_cfs1.cfg');
system('sed -i -e "/>RTAPPPRESL</r rtapp-presl.cfgsrc" -e "/>RTAPPPRESL</d" algo_cfs1.cfg');
system('sed -i -e "/>RTAPPSL</r rtapp-simulinkwrapper.cfgsrc" -e "/>RTAPPSL</d" algo_cfs1.cfg');
system('sed -i -e "/>RTAPPPOSTSL</r rtapp-postsl.cfgsrc" -e "/>RTAPPPOSTSL</d" algo_cfs1.cfg');
system('sed -i -e "/>DATA</r data.cfgsrc" -e "/>DATA</d" algo_cfs1.cfg');
system('sed -i -e "/>STATES</r states.cfgsrc" -e "/>STATES</d" algo_cfs1.cfg');
system('sed -i -e "/>INPUTBUSFLAT1</r INPUTBUSFLAT1.cfg" -e "/>INPUTBUSFLAT1</d" algo_cfs1.cfg');
system('sed -i -e "/>INPUTBUSSTRUCT1</r INPUTBUSSTRUCT1.cfg" -e "/>INPUTBUSSTRUCT1</d" algo_cfs1.cfg');
system('sed -i -e "/>OUTPUTBUSSTRUCT1</r OUTPUTBUSSTRUCT1.cfg" -e "/>OUTPUTBUSSTRUCT1</d" algo_cfs1.cfg');
system('sed -i -e "/>OUTPUTBUSFLAT1DDB1</r OUTPUTBUSFLAT1DDB1.cfg" -e "/>OUTPUTBUSFLAT1DDB1</d" algo_cfs1.cfg');
system('sed -i -e "/>OUTPUTBUSFLAT1MDS1</r OUTPUTBUSFLAT1MDS1.cfg" -e "/>OUTPUTBUSFLAT1MDS1</d" algo_cfs1.cfg');
system('sed -i -e "/>MDSWAVEGEN1</r MDSWAVEGEN1.cfg" -e "/>MDSWAVEGEN1</d" algo_cfs1.cfg');
system('sed -i -e "/>OUTPUTBUSMDSWRITER1</r OUTPUTBUSMDSWRITER1.cfg" -e "/>OUTPUTBUSMDSWRITER1</d" algo_cfs1.cfg');
system(sprintf('sed -i "s/>WAVEGEN1_ELEMS</%d/g" algo_cfs1.cfg',wg1dim));
%% cfg adapt
system(sprintf('sed -i "s/MDSSRCSHOT/%d/g" algo_cfs1.cfg',mdssrcshot));
system(sprintf('sed -i "s/MDSDSTSHOT/%d/g" algo_cfs1.cfg',mdsdstshot));
system(sprintf('sed -i "s/VERBOSITY/%d/g" algo_cfs1.cfg',verbosity));
system(sprintf('sed -i "s/MDSW1PERIOD/%d/g" algo_cfs1.cfg',mdsperiod));
system(sprintf('sed -i "s/MDSW1SEGLEN/%d/g" algo_cfs1.cfg',mdsseglen));
+Data = {
Class = ReferenceContainer
DefaultDataSource = DDB1
+DDB1 = { Class = GAMDataSource }
+LoggerDataSource = { Class = LoggerDataSource }
+Timings = { Class = TimingDataSource }
+Timer = {
Class = LinuxTimer
SleepNature = "Busy" // Default | Busy
ExecutionMode = RealTimeThread // IndependentThread | RealTimeThread
CPUMask = 0x8 // IndependentThread CPU mask
Signals = {
Counter = { Type = uint32 }
Time = { Type = uint32 }
}
}
>MDSWAVEGEN1<
+MDSWriter_1 = {
Class = MDSWriter
NumberOfBuffers = 10000 //Compulsory. Number of buffers in the circular buffer defined above. Each buffer is capable of holding a copy of all the DataSourceI signals.
CPUMask = 0x8 //Compulsory. Affinity assigned to the threads responsible for asynchronously flush data into the MDSplus database.
StackSize = 10000000 //Compulsory. Stack size of the thread above.
TreeName = "scdds" //Compulsory. Name of the MDSplus tree.
PulseNumber = MDSDSTSHOT //Optional. If -1 a new pulse will be created and the MDSplus pulse number incremented.
StoreOnTrigger = 1 //Compulsory. If 0 all the data in the circular buffer is continuously stored. If 1 data is stored when the Trigger signal is 1 (see below).
EventName = "updatejScope" //Compulsory. Event sent to jScope when TimeRefresh seconds have elapsed.
TimeRefresh = 5 //Compulsory. An event with the name set in the property EventName is sent to jScope when TimeRefresh seconds have elapsed.
NumberOfPreTriggers = 0 //Compulsory iff StoreOnTrigger = 1. Number of cycles to store before the trigger.
NumberOfPostTriggers = 0 //Compulsory iff StoreOnTrigger = 1. Number of cycles to store after the trigger.
Signals = {
Trigger = { //Compulsory when StoreOnTrigger = 1. Must be set in index 0 of the Signals node. When the value of this signal is 1 data will be stored.
Type = uint8 //Type must be uint8
}
Time = { //Compulsory when StoreOnTrigger = 1. Can be store in any index, but TimeSignal must be set = 1
Type = uint32 //Type must be uint32 or int32
TimeSignal = 1 //When set, this signal will be considered as the time source against which all signals will be stored.
TimeSignalMultiplier = 1e-6 //Default = 1e-6. Multiplier to convert the time signal units into seconds,
}
Thread1_Cycletime = { NodeName = "cfs1.system.CH01" Period = MDSW1PERIOD AutomaticSegmentation = 0 MakeSegmentAfterNWrites = MDSW1SEGLEN SamplePhase = 0 }
GAMSimulink1_ReadTime = { NodeName = "cfs1.system.CH02" Period = MDSW1PERIOD AutomaticSegmentation = 0 MakeSegmentAfterNWrites = MDSW1SEGLEN SamplePhase = 0 }
GAMSimulink1_ExecTime = { NodeName = "cfs1.system.CH03" Period = MDSW1PERIOD AutomaticSegmentation = 0 MakeSegmentAfterNWrites = MDSW1SEGLEN SamplePhase = 0 }
GAMSimulink1_WriteTime = { NodeName = "cfs1.system.CH04" Period = MDSW1PERIOD AutomaticSegmentation = 0 MakeSegmentAfterNWrites = MDSW1SEGLEN SamplePhase = 0 }
>OUTPUTBUSMDSWRITER1<
}
/*
+Messages = { //Optional. If set a message will be fired every time one of the events below occur
Class = ReferenceContainer
+TreeOpenedOK = { //Optional, but if set, the name of the Object shall be TreeOpenedOK. If set a message containing a ConfigurationDatabase with param1=PULSE_NUMBER will be sent to the Destination, every time the Tree is successfully opened
Class = Message
Destination = SomeObject
Function = SomeFunction
Mode = ExpectsReply
}
+TreeOpenedFail = { //Optional, but if set, the name of the Object shall be TreeOpenedFail. If set a message will be sent to the Destination, every time the Tree cannot be successfully opened
Class = Message
Destination = SomeObject
Function = SomeFunction
Mode = ExpectsReply
}
+TreeFlushed = { //Optional, but if set, the name of the Object shall be TreeFlushed. If set a message will be sent to the Destination, every time the Tree is flushed.
Class = Message
Destination = SomeObject
Function = SomeFunction
Mode = ExpectsReply
}
}
*/
}
}
+StorageBroker = {
Class = IOGAM
InputSignals = {
Trigger = { DataSource = DDB1 Type = uint8 }
Time = { DataSource = DDB1 Type = uint32 }
Thread1_CycleTime = { DataSource = Timings Type = uint32 Alias = State1.Thread1_CycleTime }
GAMSimulink1_ReadTime = { DataSource = Timings Type = uint32 }
GAMSimulink1_ExecTime = { DataSource = Timings Type = uint32 }
GAMSimulink1_WriteTime = { DataSource = Timings Type = uint32 }
>OUTPUTBUSFLAT1DDB1<
}
OutputSignals = {
Trigger = { DataSource = MDSWriter_1 Type = uint8 }
Time = { DataSource = MDSWriter_1 Type = uint32 }
Thread1_Cycletime = { DataSource = MDSWriter_1 Type = uint32 }
GAMSimulink1_ReadTime = { DataSource = MDSWriter_1 Type = uint32 }
GAMSimulink1_ExecTime = { DataSource = MDSWriter_1 Type = uint32 }
GAMSimulink1_WriteTime = { DataSource = MDSWriter_1 Type = uint32 }
>OUTPUTBUSFLAT1MDS1<
}
}
}
$TestApp = {
Class = RealTimeApplication
+Functions = {
Class = ReferenceContainer
+GAMTimer = {
Class = IOGAM
InputSignals = {
Counter = { DataSource = Timer Type = uint32 }
Time = { Frequency = 1000 DataSource = Timer Type = uint32 }
}
OutputSignals = {
Counter = { DataSource = DDB1 Type = uint32 }
Time = { DataSource = DDB1 Type = uint32 }
}
}
+TimeConversion = {
Class = ConversionGAM
InputSignals = {
Time = { DataSource = DDB1 Type = uint32 }
}
OutputSignals = {
TimeSec = { DataSource = DDB1 Type = float32 Gain = 0.000001 }
}
}
+Constants = {
Class = ConstantGAM
OutputSignals = {
zero = { DataSource = DDB1 Type = float32 NumberOfElements = 1 NumberOfDimensions=0 Default=0 }
Trigger = { DataSource = DDB1 Type = uint8 NumberOfElements = 1 NumberOfDimensions=0 Default=1 }
}
}
+Wavegen1TimeBroker = {
Class = IOGAM
InputSignals = {
Time = { DataSource = DDB1 Type = uint32 }
}
OutputSignals = {
time = { DataSource = MDSWavegen_1 Type = int32 }
}
}
+Wavegen1DataBroker = {
Class = IOGAM
InputSignals = {
wavegen_1 = { DataSource = MDSWavegen_1 Type = float32 NumberOfElements = >WAVEGEN1_ELEMS< }
}
OutputSignals = {
>INPUTBUSFLAT1<
}
}
\ No newline at end of file
+GAMSimulink1 = {
Class = SimulinkWrapperGAM
Library = "/root/MARTe2-examples/Simulinkso/algo_cfs1.so"
SymbolPrefix = "algo_cfs1"
Verbosity = VERBOSITY
SkipInvalidTunableParams = 0
TunableParamExternalSource= "MDSParamLoader1"
//NonVirtualBusMode = "ByteArray" // NOTE: homogeneus buses are not handled correctly, wrong
// handling of NumberOfElements = 1
NonVirtualBusMode = "Structured"
InputSignals = {
realtime = { DataSource = DDB1 Type = float32 NumberOfElements = 1 NumberOfDimensions=0 Alias = TimeSec }
>INPUTBUSSTRUCT1<
}
OutputSignals = {
>OUTPUTBUSSTRUCT1<
}
/*
Parameters = {
k1 = (float32) 2.5
}
*/
}
+States = {
Class = ReferenceContainer
+State1 = {
Class = RealTimeState
+Threads = {
Class = ReferenceContainer
+Thread1 = {
Class = RealTimeThread
CPUs = 0x4
Functions = {
GAMTimer
TimeConversion
Constants
Wavegen1TimeBroker
Wavegen1DataBroker
GAMSimulink1
StorageBroker
//LoggerBroker
}
}
}
}
}
+Scheduler = {
Class = GAMScheduler
TimingDataSource = Timings
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment