source: issm/trunk/src/m/classes/outputdefinition.js@ 20500

Last change on this file since 20500 was 20500, checked in by Mathieu Morlighem, 9 years ago

merged trunk-jpl and trunk for revision 20497

File size: 1.5 KB
Line 
1//OUTPUTDEFINITION class definition
2//
3// Usage:
4// outputdefinition=new outputdefinition();
5
6function 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,fid) { //{{{
30
31 var enums=NewArrayFill(this.definitions.length,0);
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);
39 if (enums.length==0){ enums=NaN; }
40 WriteData(fid,'data',enums,'enum',OutputdefinitionListEnum(),'format','DoubleMat','mattype',1);
41 }//}}}
42 this.fix=function() { //{{{
43 }//}}}
44 //properties
45 // {{{
46 this.definitions = [];
47 this.setdefaultparameters();
48 //}}}
49}
Note: See TracBrowser for help on using the repository browser.