comparison app/controller/form/Messprogramm.js @ 784:f0b26df02157

Handle deskriptoren in messprogramm like in probe.
author Raimund Renkert <raimund.renkert@intevation.de>
date Wed, 13 May 2015 10:23:39 +0200
parents 5a153d36ed4e
children b8fd43021c29
comparison
equal deleted inserted replaced
783:afdbe3770b99 784:f0b26df02157
37 change: this.synchronizeSlider, 37 change: this.synchronizeSlider,
38 blur: this.checkPeriod 38 blur: this.checkPeriod
39 }, 39 },
40 'messprogrammform probenintervall combobox': { 40 'messprogrammform probenintervall combobox': {
41 select: this.updateIntervalls 41 select: this.updateIntervalls
42 },
43 'messprogrammform panel[xtype="deskriptor] combobox': {
44 select: this.deskriptorSelect
42 } 45 }
43 }); 46 });
44 }, 47 },
45 /** 48 /**
46 * When the Probenintervall was changed, update the Sliders 49 * When the Probenintervall was changed, update the Sliders
229 field.up('fieldset').showWarningOrError(true, msg, false, ''); 232 field.up('fieldset').showWarningOrError(true, msg, false, '');
230 } else { 233 } else {
231 field.up('fieldset').clearMessages(); 234 field.up('fieldset').clearMessages();
232 } 235 }
233 } 236 }
234 }}); 237 },
238
239 deskriptorSelect: function(field, records) {
240 var desk = field.up('deskriptor');
241 var media = field.up('messprogrammform').down('textfield[name="mediaDesk"]');
242 var current = media.getValue().split(' ');
243 this.clearChildDesk(field.up('deskriptor'), current);
244 if (current.length < 13) {
245 for (var i = 0; i <= 12; i++) {
246 if (i === 0) {
247 current.push('D:');
248 }
249 else if (i === desk.layer + 1) {
250 var value;
251 if (records[0].get('sn') < 10) {
252 value = '0' + records[0].get('sn');
253 }
254 else {
255 value = records[0].get('sn');
256 }
257 current.push(value);
258 }
259 else {
260 current.push('00');
261 }
262 }
263 }
264 else {
265 var value;
266 if (records[0].get('sn') < 10) {
267 value = '0' + records[0].get('sn');
268 }
269 else {
270 value = records[0].get('sn');
271 }
272 current[desk.layer + 1] = value;
273 }
274 media.setValue(current.join(' ').trim());
275 },
276
277 clearChildDesk: function(field, media) {
278 var allS = field.up('fieldset').items.items;
279 for (var i = field.layer + 1; i < 12; i++) {
280 allS[i].clearValue();
281 media[i + 1] = '00';
282 }
283 }
284 });

http://lada.wald.intevation.org