root/cdat/tags/CDAT-4.3.0.RC1/laserver/custom.js

Revision 1945, 2.5 kB (checked in by drach, 7 years ago)

Added hooks for line plots.

Line 
1 //Custom JavaScript include file
2 //Add your JavaScript customizations here
3
4 CdatOperations = {
5   test: ["Boxfill (GIF)","test"],
6   cdat_iso: ["Isofill (GIF)", "cdat_iso", "gif"],
7   cdat_data: ["NetCDF", "cdat_data", "nc"],
8   cdat_anim: ["Animation", "cdat_anim", "gif"],
9   cdat_box_ps: ["Boxfill (PostScript)","cdat_box_ps","ps"],
10   cdat_iso_ps: ["Isofill (PostScript)","cdat_iso_ps","ps"],
11   cdat_box_cgm: ["Boxfill (CGM)","cdat_box_cgm","cgm"],
12   cdat_iso_cgm: ["Isofill (CGM)","cdat_iso_cgm","cgm"],
13   cdat_line: ["X-Y Plot","cdat_line","gif"]
14 };
15
16 // Define the new LAS user interface operations
17 // The form is Operation(UI_op, UI_label, server_op, server_output_format)
18 // This places an entry in the Operations dictionary.
19 var newop = new Operation('test', 'Boxfill', 'test', 'gif');
20 var cdat_iso = new Operation('cdat_iso','Isofill','cdat_iso','gif');
21 var cdat_data = new Operation('cdat_data','NetCDF', 'cdat_data', 'nc');
22 var cdat_anim = new Operation('cdat_anim','Animation','cdat_anim','gif');
23 var cdat_box_ps = new Operation('cdat_box_ps','Boxfill (PostScript)','cdat_box_ps','ps');
24 var cdat_iso_ps = new Operation('cdat_iso_ps','Isofill (PostScript)','cdat_iso_ps','ps');
25 var cdat_box_cgm = new Operation('cdat_box_cgm','Boxfill (CGM)','cdat_box_cgm','cgm');
26 var cdat_iso_cgm = new Operation('cdat_iso_cgm','Isofill (CGM)','cdat_iso_cgm','cgm');
27 var cdat_line = new Operation('cdat_line','X-Y Plot','cdat_line','gif');
28
29 // Define the TestServer object, as defined in the new XML operation test
30 function TestServer(index, dataset, url, name) {
31     this.base = V;
32     this.base(index, dataset, url, name);
33 }
34
35 // Inherit from the V (Variable) base class
36 setInherit("TestServer", "V");
37
38 // Return an array containing a list of LAS user interface operations
39 // that are to be displayed in the Select Product menu.
40 TestServer.prototype.getOpMenuList = function(mode, view) {
41     if (view.length == 1){
42         return ['cdat_line','cdat_data'];
43     } else if (view.length == 2){
44         return ['test', 'cdat_iso', 'cdat_data', 'cdat_box_ps', 'cdat_iso_ps', 'cdat_box_cgm', 'cdat_iso_cgm'];
45     } else if (view.length == 3){
46         return ['cdat_data', 'cdat_anim'];
47     } else {
48         return ['cdat_data'];
49     }
50 }
51
52 // Return the LAS server operation to be associated with the passed
53 // output and view. This should not be confused with a LAS user interface
54 // operation.
55 TestServer.prototype.getOpType = function(output, view) {
56     var type = CdatOperations[output][1];
57     return type;
58 }
59
60 // Don't allow this variable to be compared to other variables
61 TestServer.prototype.allowCompare = function() { return false; }
Note: See TracBrowser for help on using the browser.