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

Merge remote-tracking branch 'origin/master' into add-RAPDENS

parents ff673503 772c6d8e
Branches
No related tags found
No related merge requests found
Showing
with 359 additions and 12 deletions
......@@ -99,7 +99,7 @@ function writegitinfoheader(varargin)
return
end
taginfocmd = ['git for-each-ref refs/tags/' tagname ' --format="RTCCODE TAG NAME,%(refname),HASH,%(objectname:short),CONTENTS,%(contents:subject),TAGGER,%(taggername),%(taggerdate),FULL OBJECT INFO,%(objecttype),%(objectname)"'];
taginfocmd = ['git for-each-ref refs/tags/' tagname ' --format="RTCCODE TAG NAME,%(refname),HASH,%(objectname:short),CONTENTS,%(contents:subject),TAGGER,%(taggername),TAGDATE,%(taggerdate),REFTYPE,%(objecttype),FULLHASH,%(objectname)"'];
[status,result] = system(taginfocmd);
if status~=0
......
......@@ -193,10 +193,10 @@ classdef SCDclass_expcode
end
function actualize(obj, shot, varargin)
p = inputParser;
% if a model name is given, operations will be performed
% only on it, otherwise they will be performed on all
% configured models
p = inputParser;
addParameter(p,'model','',@(x) ischar(x));
parse(p,varargin{:});
......
......@@ -30,8 +30,8 @@ classdef SCDclass_mdsparenum < SCDclass_mdspar
function actualizedata(obj, shot)
obj=obj.preactualizecommon(shot);
if(~obj.unlinked)
if ~obj.actualizable, return; end
if ~obj.unlinked
% Enumeration map fill
obj=obj.initenummap();
......
classdef SCDclass_mdsparmatrixdouble < SCDclass_mdspar
% A constant 2D matrix real (double) MDS+ parameter
properties
end
methods
function obj=SCDclass_mdsparmatrixdouble(srctdimodel, destparam, varargin)
obj@SCDclass_mdspar();
% Constructor parser customization definitions here
obj=obj.parseconstructorcommon(srctdimodel, destparam, varargin);
% Constructor parser customization results here
obj.classname=mfilename;
obj.marteclassname='MDSParMatrixDbl';
end
function actualizedata(obj, shot)
obj=obj.preactualizecommon(shot);
if ~obj.actualizable, return; end
obj.caststring=sprintf('%s=double(%s);',obj.assignvar,obj.assignvar);
obj.postactualizecommon(shot);
end
function [obj, value] = getdata(obj,shot)
[obj,value]=obj.getdatacommon(shot);
value=double(value);
end
function printinfo(obj)
obj.printinfocommon;
end
function entrystring = genMARTe2entry(obj, shot)
entrystring=obj.genMARTe2entrycommon(shot);
entrystring=[entrystring ' }'];
end
function out = casttomds(obj, in)
out = double(in);
end
end
end
classdef SCDclass_mdsparmatrixint < SCDclass_mdspar
% A constant 2D matrix integer (int32) MDS+ parameter
properties
end
methods
function obj=SCDclass_mdsparmatrixint(srctdimodel, destparam, varargin)
obj@SCDclass_mdspar();
% Constructor parser customization definitions here
obj=obj.parseconstructorcommon(srctdimodel, destparam, varargin);
% Constructor parser customization results here
obj.classname=mfilename;
obj.marteclassname='MDSParMatrixInt';
end
function actualizedata(obj, shot)
obj=obj.preactualizecommon(shot);
if ~obj.actualizable, return; end
obj.caststring=sprintf('%s=int32(%s);',obj.assignvar,obj.assignvar);
obj.postactualizecommon(shot);
end
function [obj, value] = getdata(obj,shot)
[obj,value]=obj.getdatacommon(shot);
value=int32(value);
end
function printinfo(obj)
obj.printinfocommon;
end
function entrystring = genMARTe2entry(obj, shot)
entrystring=obj.genMARTe2entrycommon(shot);
entrystring=[entrystring ' }'];
end
function out = casttomds(obj, in)
out = int32(in);
end
end
end
......@@ -35,6 +35,9 @@ classdef SCDclass_mdsparscalarbool < SCDclass_mdspar
entrystring=[entrystring ' }'];
end
function out = casttomds(obj, in)
out = uint8(in);
end
end
end
......
classdef SCDclass_mdsparscalardouble < SCDclass_mdspar
% A constant real (double) MDS+ parameter
properties
end
methods
function obj=SCDclass_mdsparscalardouble(srctdimodel, destparam, varargin)
obj@SCDclass_mdspar();
% Constructor parser customization definitions here
obj=obj.parseconstructorcommon(srctdimodel, destparam, varargin);
% Constructor parser customization results here
obj.classname=mfilename;
obj.marteclassname='MDSParScalarDbl';
end
function actualizedata(obj, shot)
obj=obj.preactualizecommon(shot);
if ~obj.actualizable, return; end
obj.caststring=sprintf('%s=double(%s);',obj.assignvar,obj.assignvar);
obj.postactualizecommon(shot);
end
function [obj, value] = getdata(obj, shot)
[obj,value]=obj.getdatacommon(shot);
value=double(value);
end
function printinfo(obj)
obj.printinfocommon;
end
function entrystring = genMARTe2entry(obj, shot)
entrystring=obj.genMARTe2entrycommon(shot);
entrystring=[entrystring ' }'];
end
function out = casttomds(obj, in)
out = double(in);
end
end
end
classdef SCDclass_mdsparvectordouble < SCDclass_mdspar
% A constant 1D vector real (double) MDS+ parameter
properties
end
methods
function obj=SCDclass_mdsparvectordouble(srctdimodel, destparam, varargin)
obj@SCDclass_mdspar();
% Constructor parser customization definitions here
obj=obj.parseconstructorcommon(srctdimodel, destparam, varargin);
% Constructor parser customization results here
obj.classname=mfilename;
obj.marteclassname='MDSParVectorDbl';
end
function actualizedata(obj, shot)
obj=obj.preactualizecommon(shot);
if ~obj.actualizable, return; end
obj.caststring=sprintf('%s=double(%s);',obj.assignvar,obj.assignvar);
obj.postactualizecommon(shot);
end
function [obj, value] = getdata(obj,shot)
[obj,value]=obj.getdatacommon(shot);
value=double(value);
end
function printinfo(obj)
obj.printinfocommon;
end
function entrystring = genMARTe2entry(obj, shot)
entrystring=[obj.genMARTe2entrycommon(shot) ' }'];
end
function out = casttomds(obj, in)
out = double(in);
end
end
end
......@@ -49,10 +49,10 @@ classdef SCDclass_taskmdsloadprevETHCAT < SCDclass_task
end
end
function [obj, value] = getdata(obj,shot)
function [value,success] = getdata(obj,shot)
switch(obj.node)
case 2
[~,value]=obj.getdataNodeETHCAT1(shot);
[value,success]=obj.getdataNodeETHCAT1(shot);
end
end
......@@ -74,7 +74,8 @@ classdef SCDclass_taskmdsloadprevETHCAT < SCDclass_task
function obj = actualizeNode(obj, shot)
dd=SCDconf_getdatadict(obj.datadictionary);
adcbus=dd.getEntry(obj.modelbus).getValue;
[~,data]=obj.getdata(shot);
[data,success]=obj.getdata(shot);
if ~success, return; end
T=timeseries;
if obj.verbose==1
fprintf('Actualizing data for bus: ''%s'' (%s, shot %d) 0%% ', obj.modelbus, obj.classname, shot);
......@@ -99,11 +100,12 @@ classdef SCDclass_taskmdsloadprevETHCAT < SCDclass_task
%%
% Node 02/03 loading functions
function [obj, value] = getdataNodeETHCAT1(obj, shot)
function [value,success] = getdataNodeETHCAT1(obj, shot)
% node02 and 03 store an equal copy of EtherCAT1 input data
% on MDS. Here we take data from the first ok node on MDS.
% This to allow loading in cases where one of the two nodes
% has not stored.
% status=0 indicates success
mdsopen('rtc',shot);
mdsnodename='node02';
T=timeseries;
......@@ -116,7 +118,7 @@ classdef SCDclass_taskmdsloadprevETHCAT < SCDclass_task
if ~isnumeric(timebase)
warning('getdataNodeETHCAT1:NoData', ...
'Could notget EtherCAT1 int16 data either from node02 or node03');
value=[];
value=[]; success=false;
return;
end
d_time = double(mdsvalueraw(['\top.' mdsnodename '.params:d_time']))*1.0e-6;
......@@ -140,6 +142,7 @@ classdef SCDclass_taskmdsloadprevETHCAT < SCDclass_task
if obj.verbose==1
fprintf('100%% \n');
end
success=true;
end
end
......
function cs = setconfigdiags(cs)
function cs = config_set_diags(cs)
% A common diagnostic settings in form
% of a in -> out update function to be used
% inside config_update_diags
......
/*
Retrieves signal corresponding to named mem/stat signal in RTC tree
call:
_sig = rtc_get(_type, _name, [_inode,[_ithread]])
arguments:
_type: "mem" or "stat"
_name: name of the signal to retrieve
_inode: [optional] retrieve dictionary from this rt-node only
_ithread: [optional] retrieve dictionary from this thread only
(must be used together with _inode)
returns:
_sig: Signal (node reference) corresponding to _name with type _type
This function requires an rtc tree to be open.
If _inode and _ithread are absent then the global dictionary is queried.
For debugging puposes a dictionary can be given as a 5th argument and it
will be used in place of the one stored in the tree.
*/
FUN PUBLIC rtc_get(_type, _name, optional _inode, optional _ithread, optional _dict)
{
_has_inode = present(_inode ) && KIND(_inode )>0;
_has_ithread = present(_ithread) && KIND(_ithread)>0;
_has_dict = present(_dict ) && KIND(_dict )>0;
if (!_has_dict)
{
_nodestr= ($SHOT>65700 || $SHOT==-1) ? "node" : "tcvrt";
_thread = _has_ithread ? ".thread"//iii(_ithread,2)//"." : "";
_node = _has_inode ? _nodestr //iii(_inode ,2)//"." : "";
_base = "\\rtc::top."//_node//_thread//"dicts:"//_type//"s";
_dict = build_path(_base);
}
_mem = size(_dict)>0 ? _dict[_name] : abort();
if (dim_of(_mem) != _name) { abort();}
return(BUILD_PATH(data(_mem)));
}
/*
Creates dictionary of mem or stat signals for the RTC tree
call:
_dict = rtc_make_dict(_type, [_inode,[_ithread]])
arguments:
_type: "mem" or "stat"
_inode: [optional] restrict dictionary to signals from this rt-node
_ithread: [optional] restrict dictionary to signals from this thread
(must be used together with _inode)
returns:
_dict: signal with node addresses as data and mem/stat names as dimension.
_dict[_name] then yields the node address corresponding to the mem named _name
*/
FUN PUBLIC rtc_make_dict(_type, optional _inode, optional _ithread)
{
_nodestr= ($SHOT>65700 || $SHOT==-1) ? "node" : "tcvrt";
_thread = present(_ithread) ? ".thread"//iii(_ithread,2) : "";
_node = present(_inode ) ? "."//_nodestr//iii(_inode,2) : "";
_base = "\\rtc::top"//_node//_thread//"***:"//_type//"_%%%";
_nids = TreeFindNodeWild(_base);
_path = getnci(_nids,"PATH");
if (size(_path)>0)
{
_len = getnci(adjustl(adjustr(_path)//":raw"),"LENGTH");
_path = pack(_path,_len>0);
}
if (size(_path)>0)
{
_name = getnci(adjustl(adjustr(_path)//":name"),"record");
_order = sort(_name);
_dict = MAKE_SIGNAL(_path[_order],*,_name[_order]);
}
else
{
_dict = MAKE_SIGNAL([],*,[]);
}
return(_dict);
}
/*
Retrieves signal corresponding to named mem signal in RTC tree
call:
_sig = rtc_mem(_name, [_inode,[_ithread]])
arguments:
_name: name of the mem signal to retrieve
_inode: [optional] retrieve dictionary from this rt-node only
_ithread: [optional] retrieve dictionary from this thread only
(must be used together with _inode)
returns:
_sig: Signal (node reference) corresponding to mem named _name
See also: rtc_get
*/
FUN PUBLIC rtc_mem(_name, optional _inode, optional _ithread, optional _dict)
{
Return(rtc_get("mem", "mem."//_name, _inode, _ithread, _dict));
}
/*
Builds a jScope plottable profile
out of a MDS+ node stored
with MARTe2 (i.e. with only the temporal
dimension available). This works only for
2D signals.
call:
_sig = rtc_profile(_s)
arguments:
_s input MDS+ channel containing
a time dependent profile in this form:
- data shape is [profile points, times]
- the first dimension is time
_d1 dimension array to be used in the build_signal expr.
returns:
a jScope plottable build_signal
expression to plot the profile
with live update capability (ctrl-Y in jScope)
*/
FUN PUBLIC rtc_profile(_s, optional in _d1)
{
_d1 = present(_d1) ? _d1 : *;
if (ndims(_s) != 2) ABORT();
Return(make_param(make_signal(transpose(DATA(_s)), *, DIM_OF(_s), _d1),help_of(_s),1));
}
/*
Retrieves signal corresponding to named stat signal in RTC tree
call:
_sig = rtc_stat(_name, [_inode,[_ithread]])
arguments:
_name: name of the stat signal to retrieve
_inode: [optional] retrieve dictionary from this rt-node only
_ithread: [optional] retrieve dictionary from this thread only
(must be used together with _inode)
returns:
_sig: Signal (node reference) corresponding to stat named _name
See also: rtc_get
*/
FUN PUBLIC rtc_stat(_name, optional _inode, optional _ithread, optional _dict)
{
Return(rtc_get("stat", _name, _inode, _ithread, _dict));
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment