| 1 | //OUTPUTDEFINITION class definition
|
|---|
| 2 | //
|
|---|
| 3 | // Usage:
|
|---|
| 4 | // outputdefinition=new outputdefinition();
|
|---|
| 5 |
|
|---|
| 6 | function outputdefinition (){
|
|---|
| 7 | //methods
|
|---|
| 8 | this.setdefaultparameters = function(){// {{{
|
|---|
| 9 | this.definitions=[];
|
|---|
| 10 | }// }}}
|
|---|
| 11 | this.disp= function(){// {{{
|
|---|
| 12 | console.log(sprintf(' outputdefinition:'));
|
|---|
| 13 | fielddisplay(this,'definitions','list of potential outputs that can be requested, but which need additional data to be defined');
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 | }// }}}
|
|---|
| 17 | this.classname= function(){// {{{
|
|---|
| 18 | return "outputdefinition";
|
|---|
| 19 | }// }}}
|
|---|
| 20 | this.checkconsistency = function(md,solution,analyses) { //{{{
|
|---|
| 21 |
|
|---|
| 22 | checkfield(md,'fieldname','outputdefinition.definitions','cell',1);
|
|---|
| 23 |
|
|---|
| 24 | for (var i=0;i<this.definitions.length;i++){
|
|---|
| 25 | this.definitions[i].checkconsistency(md,solution,analyses);
|
|---|
| 26 | }
|
|---|
| 27 |
|
|---|
| 28 | } // }}}
|
|---|
| 29 | this.marshall=function(md,prefix,fid) { //{{{
|
|---|
| 30 |
|
|---|
| 31 | var data=NewArrayFill(this.definitions.length,'');
|
|---|
| 32 | for(var i=0;i<this.definitions.length;i++){
|
|---|
| 33 | this.definitions[i].marshall(md,fid,prefix);
|
|---|
| 34 | classdefinition=this.definitions[i].classname();
|
|---|
| 35 | classdefinition=classdefinition.charAt(0).toUpperCase() + classdefinition.slice(1); // we match our string definitions
|
|---|
| 36 | data[i]=classdefinition;
|
|---|
| 37 | }
|
|---|
| 38 | data=ArrayUnique(data);
|
|---|
| 39 | if(data.length==0){ data=''; }
|
|---|
| 40 |
|
|---|
| 41 | WriteData(fid,prefix,'data',data,'name','md.outputdefinition.list','format','StringArray');
|
|---|
| 42 | }//}}}
|
|---|
| 43 | this.fix=function() { //{{{
|
|---|
| 44 | }//}}}
|
|---|
| 45 | //properties
|
|---|
| 46 | // {{{
|
|---|
| 47 | this.definitions = [];
|
|---|
| 48 | this.setdefaultparameters();
|
|---|
| 49 | //}}}
|
|---|
| 50 | }
|
|---|