1
- classdef DataArray < nix .Entity
1
+ classdef DataArray < nix .NamedEntity & nix . MetadataMixIn & nix . SourcesMixIn
2
2
% DataArray nix DataArray object
3
3
4
- properties (Hidden )
5
- info
6
- sourcesCache
7
- metadataCache
8
- end ;
9
-
4
+ properties (Hidden )
5
+ % namespace reference for nix-mx functions
6
+ alias = ' DataArray'
7
+ end
8
+
10
9
properties (Dependent )
11
- id
12
- type
13
- name
14
- definition
15
- label
16
- shape
17
- unit
18
- dimensions
19
- polynom_coefficients
20
-
21
- sources
10
+ dimensions % should not be dynamic due to complex set operation
22
11
end ;
23
12
24
13
methods
25
14
function obj = DataArray(h )
26
-
15
+
16
+
17
+
27
18
28
- obj.sourcesCache.lastUpdate = 0 ;
29
- obj.sourcesCache.data = {};
30
- obj.metadataCache.lastUpdate = 0 ;
31
- obj.metadataCache.data = {};
19
+ % assign dynamic properties
20
+ nix .Dynamic .add_dyn_attr(obj , ' label' , ' rw' );
21
+ nix .Dynamic .add_dyn_attr(obj , ' unit' , ' rw' );
22
+ nix .Dynamic .add_dyn_attr(obj , ' expansionOrigin' , ' rw' );
23
+ nix .Dynamic .add_dyn_attr(obj , ' polynom_coefficients' , ' rw' );
24
+ nix .Dynamic .add_dyn_attr(obj , ' shape' , ' rw' );
32
25
end ;
33
26
34
- function nfo = get .info(obj )
35
- nfo = nix_mx(' DataArray::describe' , obj .nix_handle );
36
- end
37
-
38
- function id = get .id(obj )
39
- id = obj .info .id ;
40
- end ;
41
-
42
- function type = get .type(obj )
43
- type = obj .info .type ;
44
- end ;
45
-
46
- function name = get .name(obj )
47
- name = obj .info .name ;
48
- end ;
49
-
50
- function definition = get .definition(obj )
51
- definition = obj .info .definition ;
52
- end ;
53
-
54
- function label = get .label(obj )
55
- label = obj .info .label ;
56
- end ;
57
-
58
- function shape = get .shape(obj )
59
- shape = obj .info .shape ;
60
- end ;
61
-
62
- function unit = get .unit(obj )
63
- unit = obj .info .unit ;
64
- end ;
65
-
66
27
function dimensions = get .dimensions(obj )
67
28
dimensions = obj .info .dimensions ;
68
29
end ;
69
-
70
- function polynom_coefficients = get .polynom_coefficients(obj )
71
- polynom_coefficients = obj .info .polynom_coefficients ;
72
- end ;
73
30
74
31
% -----------------
75
32
% Data access methods
@@ -89,32 +46,5 @@ function write_all(obj, data) % TODO add (optional) offset
89
46
nix_mx(' DataArray::writeAll' , obj .nix_handle , tmp );
90
47
end ;
91
48
92
- % -----------------
93
- % Sources methods
94
- % -----------------
95
-
96
- function [] = add_source(obj , add_this )
97
- obj.sourcesCache = nix .Utils .add_entity(obj , ...
98
- add_this , ' nix.Source' , ' DataArray::addSource' , obj .sourcesCache );
99
- end ;
100
-
101
- function delCheck = remove_source(obj , del )
102
- [delCheck , obj .sourcesCache ] = nix .Utils .delete_entity(obj , ...
103
- del , ' nix.Source' , ' DataArray::removeSource' , obj .sourcesCache );
104
- end ;
105
-
106
- function sources = get .sources(obj )
107
- [obj .sourcesCache , sources ] = nix .Utils .fetchObjList(obj .updatedAt , ...
108
- ' DataArray::sources' , obj .nix_handle , obj .sourcesCache , @nix .Source );
109
- end ;
110
-
111
- % -----------------
112
- % Metadata methods
113
- % -----------------
114
-
115
- function metadata = open_metadata(obj )
116
- [obj .metadataCache , metadata ] = nix .Utils .fetchObj(obj .updatedAt , ...
117
- ' DataArray::openMetadataSection' , obj .nix_handle , obj .metadataCache , @nix .Section );
118
- end ;
119
49
end ;
120
50
end
0 commit comments