root/cdat/trunk/laserver/custom.js

Revision 1926, 2.2 kB (checked in by drach, 7 years ago)

Added product options. plotRegion gets the server op and window size.

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 };
14
15 // Define the new LAS user interface operations
16 // The form is Operation(UI_op, UI_label, server_op, server_output_format)
17 // This places an entry in the Operations dictionary.
18 var newop = new Operation('test', 'Boxfill', 'test', 'gif');
19 var cdat_iso = new Operation('cdat_iso','Isofill','cdat_iso','gif');
20 var cdat_data = new Operation('cdat_data','NetCDF', 'cdat_data', 'nc');
21 var cdat_anim = new Operation('cdat_anim','Animation','cdat_anim','gif');
22 var cdat_box_ps = new Operation('cdat_box_ps','Boxfill (PostScript)','cdat_box_ps','ps');
23 var cdat_iso_ps = new Operation('cdat_iso_ps','Isofill (PostScript)','cdat_iso_ps','ps');
24 var cdat_box_cgm = new Operation('cdat_box_cgm','Boxfill (CGM)','cdat_box_cgm','cgm');
25 var cdat_iso_cgm = new Operation('cdat_iso_cgm','Isofill (CGM)','cdat_iso_cgm','cgm');
26
27 // Define the TestServer object, as defined in the new XML operation test
28 function TestServer(index, dataset, url, name) {
29     this.base = V;
30     this.base(index, dataset, url, name);
31 }
32
33 // Inherit from the V (Variable) base class
34 setInherit("TestServer", "V");
35
36 // Return an array containing a list of LAS user interface operations
37 // that are to be displayed in the Select Product menu.
38 TestServer.prototype.getOpMenuList = function(mode, view) {
39     return ['test', 'cdat_iso', 'cdat_data', 'cdat_anim', 'cdat_box_ps', 'cdat_iso_ps', 'cdat_box_cgm', 'cdat_iso_cgm'];
40 }
41
42 // Return the LAS server operation to be associated with the passed
43 // output and view. This should not be confused with a LAS user interface
44 // operation.
45 TestServer.prototype.getOpType = function(output, view) {
46     var type = CdatOperations[output][1];
47     return type;
48 }
49
50 // Don't allow this variable to be compared to other variables
51 TestServer.prototype.allowCompare = function() { return false; }
Note: See TracBrowser for help on using the browser.