Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
classdef SCDclass_mdsparfixdimvectorint < SCDclass_mdspar
% A constant 1D vector integer (matlab cast to int32) MDS+ parameter
% If the number of elements is different w.r.t. the
% property dimension, the size is adjusted by zero
% filling or clipping
properties(Access=private)
dimension
end
methods
function obj=SCDclass_mdsparfixdimvectorint(srctdimodel, destparam, destdimension, varargin)
obj@SCDclass_mdspar(srctdimodel, destparam, varargin);
obj.classname=mfilename;
obj.dimension=destdimension;
end
function actualizedata(obj, shot)
obj=obj.preactualizecommon(shot);
numelements=numel(obj.value);
if(numelements<obj.dimension)
localgetcommand=sprintf('[%s; zeros(%d,1)]',obj.getcommand, obj.dimension-numelements);
elseif(numelements>obj.dimension)
localgetcommand=sprintf('%s(1:%d)', obj.getcommand, obj.dimension);
else
localgetcommand=obj.getcommand;
end
obj.assignstring=sprintf('%s=%s;',obj.assignvar,localgetcommand);
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;
fprintf(' Parameter fixed dimension is: %d\n',obj.dimension);
end
function entrystring = genMARTe2entry(obj, shot)
entrystring=obj.genMARTe2entrycommon(shot);
entrystring=[entrystring ' }'];
end
end
end