|
169 | 169 | end |
170 | 170 |
|
171 | 171 | %-check for duplicate column names-% |
| 172 | + for c = 1:length(cols) |
| 173 | + if ~isempty(intersect(cols{c}.name,fieldnames(obj))) |
| 174 | + errkey = 'gridCols:duplicateName'; |
| 175 | + error(errkey, gridmsg(errkey)) |
| 176 | + end |
| 177 | + end |
172 | 178 |
|
173 | 179 | %-endpoint-% |
174 | 180 | endpoint = obj.Endpoints.Col; |
|
184 | 190 | errkey = 'gridGeneric:genericError'; |
185 | 191 | error(errkey,[gridmsg(errkey) response.detail]); |
186 | 192 | end |
| 193 | + |
| 194 | + %-append new columns-% |
| 195 | + for c = 1:length(cols) |
| 196 | + obj.File.cols{end + 1} = response.cols{c}; |
| 197 | + obj.Data.(cols{c}.name) = cols{c}.data; |
| 198 | + obj.addColProps; |
| 199 | + end |
187 | 200 | end |
188 | 201 | end |
189 | 202 |
|
|
195 | 208 | fields = fieldnames(obj.Data); |
196 | 209 |
|
197 | 210 | for d = 1:length(fields) |
198 | | - |
199 | | - % add property field |
200 | | - addprop(obj,fields{d}); |
201 | | - |
202 | | - % create column object |
203 | | - plotlycol = plotlycolumn(obj.Data.(fields{d}), ... |
204 | | - obj.File.cols{d}.name, obj.File.cols{d}.uid, obj.File.fid); |
205 | | - |
206 | | - % initialize property field |
207 | | - obj.(fields{d}) = plotlycol; |
| 211 | + if ~isprop(obj, fields{d}) |
| 212 | + |
| 213 | + % add property field |
| 214 | + addprop(obj,fields{d}); |
| 215 | + |
| 216 | + % create column object |
| 217 | + plotlycol = plotlycolumn(obj.Data.(fields{d}), ... |
| 218 | + obj.File.cols{d}.name, obj.File.cols{d}.uid, obj.File.fid); |
| 219 | + |
| 220 | + % initialize property field |
| 221 | + obj.(fields{d}) = plotlycol; |
| 222 | + |
| 223 | + end |
208 | 224 | end |
209 | 225 |
|
210 | 226 | end |
211 | 227 |
|
212 | | - function varargout = makecall(obj, request, endpoint, payload) |
| 228 | + function response = makecall(obj, request, endpoint, payload) |
| 229 | + |
| 230 | + %-initialize ouptut-% |
| 231 | + response = ''; |
213 | 232 |
|
214 | 233 | %-encoding-% |
215 | 234 | encoder = sun.misc.BASE64Encoder(); |
|
229 | 248 | response_handler(resp); |
230 | 249 |
|
231 | 250 | %-structure resp-% |
232 | | - varargout{1} = loadjson(resp); |
| 251 | + response = loadjson(resp); |
233 | 252 | end |
234 | 253 | end |
235 | 254 | end |
|
0 commit comments