torsten@472: /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz torsten@472: * Software engineering by Intevation GmbH torsten@472: * torsten@472: * This file is Free Software under the GNU GPL (v>=3) torsten@472: * and comes with ABSOLUTELY NO WARRANTY! Check out raimund@497: * the documentation coming with IMIS-Labordaten-Application for details. torsten@472: */ torsten@472: torsten@323: /** torsten@323: * Model class for Zusatzwerte torsten@323: */ torsten@106: Ext.define('Lada.model.Zusatzwert', { torsten@336: extend: 'Lada.model.Base', raimund@491: raimund@491: fields: [{ raimund@497: name: 'id' raimund@491: }, { raimund@497: name: 'probeId' raimund@491: }, { raimund@497: name: 'pzsId' raimund@491: }, { raimund@497: name: 'nwgZuMesswert', raimund@491: type: 'float' raimund@491: }, { raimund@497: name: 'messwertPzs', raimund@491: type: 'float' raimund@491: }, { raimund@497: name: 'messfehler', raimund@491: type: 'float' raimund@491: }, { raimund@497: name: 'letzteAenderung', raimund@491: type: 'date', raimund@491: convert: Lada.lib.Helpers.ts2date, raimund@491: defaultValue: new Date() raimund@491: }], raimund@491: raimund@497: idProperty: 'id', raimund@491: torsten@106: proxy: { torsten@106: type: 'rest', torsten@106: url: 'server/rest/zusatzwert', torsten@106: reader: { torsten@106: type: 'json', torsten@106: root: 'data' torsten@122: }, torsten@122: writer: { torsten@122: type: 'json', torsten@411: // TODO: Check if this function is really needed (torsten) raimund@497: // <2013-09-18 15:58> raimund@497: writeEverything: true torsten@106: } torsten@131: }, raimund@491: torsten@142: getMesseinheit: function(pzsId) { raimund@496: var zstore = Ext.data.StoreManager.get('staProbenzusaetze'); raimund@496: var mstore = Ext.data.StoreManager.get('staMesseinheiten'); torsten@142: var mehId = zstore.getById(pzsId).get('mehId'); raimund@488: var record = mstore.getById(mehId); torsten@142: return record.get('einheit'); torsten@106: } torsten@106: });