[19759] | 1 | //OUTPUTDEFINITION class definition
|
---|
| 2 | //
|
---|
| 3 | // Usage:
|
---|
| 4 | // outputdefinition=new outputdefinition();
|
---|
| 5 |
|
---|
| 6 | function outputdefinition (){
|
---|
| 7 | //methods
|
---|
| 8 | this.setdefaultparameters = function(){// {{{
|
---|
[19793] | 9 | this.definitions=[];
|
---|
[19759] | 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 | }// }}}
|
---|
[19791] | 17 | this.classname= function(){// {{{
|
---|
| 18 | return "outputdefinition";
|
---|
| 19 | }// }}}
|
---|
[19787] | 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 | } // }}}
|
---|
[19791] | 29 | this.marshall=function(md,fid) { //{{{
|
---|
| 30 |
|
---|
[19860] | 31 | var enums=NewArrayFill(this.definitions.length,0);
|
---|
[19791] | 32 | for (var i=0;i<this.definitions.length;i++){
|
---|
| 33 | this.definitions[i].marshall(md,fid);
|
---|
| 34 | classdefinition=this.definitions[i].classname();
|
---|
| 35 | classdefinition=classdefinition.charAt(0).tuUpperCase() + classdefinition.slice(1); //so it matches our enums definitions.
|
---|
| 36 | enums[i]=StringToEnum(classdefinition);
|
---|
| 37 | }
|
---|
| 38 | enums=ArrayUnique(enums);
|
---|
[20297] | 39 | if (enums.length==0){ enums=NaN; }
|
---|
[19791] | 40 | WriteData(fid,'data',enums,'enum',OutputdefinitionListEnum(),'format','DoubleMat','mattype',1);
|
---|
| 41 | }//}}}
|
---|
[19860] | 42 | this.fix=function() { //{{{
|
---|
| 43 | }//}}}
|
---|
[19759] | 44 | //properties
|
---|
| 45 | // {{{
|
---|
[19793] | 46 | this.definitions = [];
|
---|
[19759] | 47 | this.setdefaultparameters();
|
---|
| 48 | //}}}
|
---|
| 49 | }
|
---|