1 | <html> |
---|
2 | <head> |
---|
3 | <meta http-equiv="pragma" content="no-cache"> |
---|
4 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
---|
5 | <title>Contour plot set-up : level definition</title> |
---|
6 | <link rel="stylesheet" href="ether.css" type="text/css"> |
---|
7 | <script language="JavaScript" type="text/JavaScript"> |
---|
8 | |
---|
9 | var tabColourI=new Array(17); |
---|
10 | var tabColour=new Array(17); |
---|
11 | tabColourI[0]="127,255,212"; |
---|
12 | tabColour[0]="Aquamarine"; |
---|
13 | tabColourI[1]="0,0,0"; |
---|
14 | tabColour[1]="Black"; |
---|
15 | tabColourI[2]="0,0,255"; |
---|
16 | tabColour[2]="Blue"; |
---|
17 | tabColourI[3]="127,255,0"; |
---|
18 | tabColour[3]="Chartreuse"; |
---|
19 | tabColourI[4]="0,255,255"; |
---|
20 | tabColour[4]="Cyan"; |
---|
21 | tabColourI[5]="0,255,0"; |
---|
22 | tabColour[5]="Green"; |
---|
23 | tabColourI[6]="255,0,255"; |
---|
24 | tabColour[6]="Magenta"; |
---|
25 | tabColourI[7]="176,48,96"; |
---|
26 | tabColour[7]="Maroon"; |
---|
27 | tabColourI[8]="255,165,0"; |
---|
28 | tabColour[8]="Orange"; |
---|
29 | tabColourI[9]="218,112,214"; |
---|
30 | tabColour[9]="Orchid"; |
---|
31 | tabColourI[10]="160,32,240"; |
---|
32 | tabColour[10]="Purple"; |
---|
33 | tabColourI[11]="255,0,0"; |
---|
34 | tabColour[11]="Red"; |
---|
35 | tabColourI[12]="46,139,87"; |
---|
36 | tabColour[12]="Sea green"; |
---|
37 | tabColourI[13]="160,82,45"; |
---|
38 | tabColour[13]="Sienna"; |
---|
39 | tabColourI[14]="238,210,238"; |
---|
40 | tabColour[14]="Thistle"; |
---|
41 | tabColourI[15]="255,255,0"; |
---|
42 | tabColour[15]="Yellow"; |
---|
43 | tabColourI[16]="255,255,255"; |
---|
44 | tabColour[16]="White"; |
---|
45 | tabColourI[17]="255,127,80"; |
---|
46 | tabColour[17]="Coral"; |
---|
47 | |
---|
48 | |
---|
49 | tabLineStyle=new Array(6); |
---|
50 | tabLineStyle[0]="Solid"; |
---|
51 | tabLineStyle[1]="Dotted"; |
---|
52 | tabLineStyle[2]="Dashed"; |
---|
53 | tabLineStyle[3]="Dash dot"; |
---|
54 | tabLineStyle[4]="Dash dot dot"; |
---|
55 | tabLineStyle[5]="Long dashes"; |
---|
56 | |
---|
57 | |
---|
58 | function findLibelleCouleur(tab,tab2,couleur) { |
---|
59 | var retour='undefined'; |
---|
60 | for (i=0;i<tab.length;i++) { |
---|
61 | if (tab[i]==couleur) { |
---|
62 | retour=tab2[i]; |
---|
63 | break; |
---|
64 | } |
---|
65 | } |
---|
66 | return retour; |
---|
67 | } |
---|
68 | |
---|
69 | |
---|
70 | |
---|
71 | function addLevel() { |
---|
72 | if (!isPresent(document.myForm.contour_level_set_value.value,0) && document.myForm.defined_levels.length==10) alert('Can not add level : the maximum number of levels is reached'); |
---|
73 | else if (isNaN(document.myForm.contour_level_set_value.value)) alert('The level must be a numeric value'); |
---|
74 | else if (document.myForm.contour_level_set_value.value!="") { |
---|
75 | isPresent(document.myForm.contour_level_set_value.value,1); |
---|
76 | var elem=document.createElement("OPTION"); |
---|
77 | |
---|
78 | elem.text+=findLibelleCouleur(tabColourI,tabColour,document.myForm.contour_user_set_colour.value); |
---|
79 | elem.text+='/'; |
---|
80 | elem.text+=tabLineStyle[document.myForm.contour_user_set_linestyle.value]; |
---|
81 | elem.text+=' : '; |
---|
82 | elem.text+=document.myForm.contour_level_set_value.value; |
---|
83 | |
---|
84 | |
---|
85 | elem.value=document.myForm.contour_level_set_value.value+'@'+document.myForm.contour_user_set_colour.value+'@'; |
---|
86 | elem.value+=document.myForm.contour_user_set_label_flag.value+'@'; |
---|
87 | elem.value+=document.myForm.contour_user_set_linestyle.value+'@'+document.myForm.contour_user_set_line_thickness.value; |
---|
88 | |
---|
89 | niv=findPosition(document.myForm.contour_level_set_value.value); |
---|
90 | if (niv!=null) { |
---|
91 | //niv=niv+1; |
---|
92 | document.myForm.defined_levels.add(elem,niv); |
---|
93 | document.myForm.defined_levels.options[niv].selected=true; |
---|
94 | } |
---|
95 | else { |
---|
96 | document.myForm.defined_levels.add(elem,-1); |
---|
97 | niv=1; |
---|
98 | } |
---|
99 | |
---|
100 | } |
---|
101 | else alert("Miss a level value"); |
---|
102 | |
---|
103 | } |
---|
104 | |
---|
105 | |
---|
106 | function findPosition(valeur) { |
---|
107 | sel=document.myForm.defined_levels; |
---|
108 | retour=null; |
---|
109 | |
---|
110 | for (i=0 ; i<sel.length ; i++) { |
---|
111 | chaine=sel.options[i].value; |
---|
112 | chaine1=chaine.split('@'); |
---|
113 | temp1=parseFloat(chaine1[0]); |
---|
114 | |
---|
115 | if (i==0 && temp1<=parseFloat(valeur)) { |
---|
116 | retour=i; |
---|
117 | break; |
---|
118 | } |
---|
119 | else if (!(i==sel.length-1)) { |
---|
120 | chaine=sel.options[i+1].value; |
---|
121 | chaine2=chaine.split('@'); |
---|
122 | temp2=parseFloat(chaine2[0]); |
---|
123 | myval=parseFloat(valeur); |
---|
124 | if (myval <= temp1 && myval >= temp2) { |
---|
125 | retour=i+1; |
---|
126 | break; |
---|
127 | } |
---|
128 | } |
---|
129 | |
---|
130 | } |
---|
131 | |
---|
132 | return retour; |
---|
133 | } |
---|
134 | |
---|
135 | |
---|
136 | function recupLevel() { |
---|
137 | sel=document.myForm.defined_levels; |
---|
138 | |
---|
139 | for (var i=0;i<sel.length;i++) { |
---|
140 | if (sel.options[i].selected) { |
---|
141 | chaine=sel.options[i].value; |
---|
142 | chaine1=chaine.split('@'); |
---|
143 | document.myForm.contour_level_set_value.value=chaine1[0]; |
---|
144 | document.myForm.contour_user_set_colour.value=chaine1[1]; |
---|
145 | document.myForm.contour_user_set_label_flag.value=chaine1[2]; |
---|
146 | document.myForm.contour_user_set_linestyle.value=chaine1[3]; |
---|
147 | document.myForm.contour_user_set_line_thickness.value=chaine1[4]; |
---|
148 | } |
---|
149 | } |
---|
150 | |
---|
151 | } |
---|
152 | |
---|
153 | function isPresent(valeur,del) { |
---|
154 | var sel=document.myForm.defined_levels; |
---|
155 | var retour=false; |
---|
156 | var temp1=parseFloat(valeur); |
---|
157 | var chaine=''; |
---|
158 | for (var i=0;i<sel.length;i++) { |
---|
159 | chaine=sel.options[i].value; |
---|
160 | chaine1=chaine.split('@'); |
---|
161 | temp2=parseFloat(chaine1[0]); |
---|
162 | |
---|
163 | if (temp2==temp1) { |
---|
164 | if (del==1) sel.remove(i); |
---|
165 | retour=true; |
---|
166 | break; |
---|
167 | } |
---|
168 | |
---|
169 | } |
---|
170 | |
---|
171 | return retour; |
---|
172 | } |
---|
173 | |
---|
174 | //!-- |
---|
175 | function deplace () { |
---|
176 | var chaine=""; |
---|
177 | var tab1=new Array(); |
---|
178 | var tab2=new Array(); |
---|
179 | var i=0, j=0; |
---|
180 | var elem; |
---|
181 | |
---|
182 | window.moveTo(25,25); |
---|
183 | document.myForm.sel_par_abs.value=window.opener.document.thisForm.form_par_abs.value; |
---|
184 | document.myForm.sel_unit_abs.value=window.opener.document.thisForm.sel_unit_abs.value; |
---|
185 | document.myForm.sel_unit_abs2.value=window.opener.document.thisForm.sel_unit_abs.value; |
---|
186 | if (window.opener.document.thisForm.sel_sspar_abs.value==".") document.myForm.sel_sspar_abs.value="None"; |
---|
187 | else document.myForm.sel_sspar_abs.value=window.opener.document.thisForm.sel_sspar_abs.value; |
---|
188 | |
---|
189 | document.myForm.userLevels.value=window.opener.document.thisForm.userLevels.value; |
---|
190 | chaine=document.myForm.userLevels.value; |
---|
191 | sel=document.myForm.defined_levels; |
---|
192 | tab1=chaine.split("&"); |
---|
193 | if (chaine!='') for(i=0;i<tab1.length;i++) { |
---|
194 | tab2=tab1[i].split("@"); |
---|
195 | elem=document.createElement("OPTION"); |
---|
196 | |
---|
197 | elem.text+=findLibelleCouleur(tabColourI,tabColour,tab2[1]); |
---|
198 | elem.text+='/'; |
---|
199 | elem.text+=tabLineStyle[tab2[3]]; |
---|
200 | elem.text+=' : '; |
---|
201 | elem.text+=tab2[0]; |
---|
202 | |
---|
203 | |
---|
204 | elem.value=tab2[0]+'@'+tab2[1]+'@'; |
---|
205 | elem.value+=tab2[2]+'@'; |
---|
206 | elem.value+=tab2[3]+'@'+tab2[4]; |
---|
207 | document.myForm.defined_levels.add(elem,null); |
---|
208 | |
---|
209 | } |
---|
210 | |
---|
211 | |
---|
212 | |
---|
213 | } |
---|
214 | |
---|
215 | function loadSetting() { |
---|
216 | |
---|
217 | sel=document.myForm.defined_levels; |
---|
218 | document.myForm.userLevels.value=""; |
---|
219 | for (var i=0;i<sel.length;i++) { |
---|
220 | document.myForm.userLevels.value+=sel.options[i].value; |
---|
221 | if (i<sel.length-1) document.myForm.userLevels.value+='&'; |
---|
222 | |
---|
223 | } |
---|
224 | |
---|
225 | window.opener.document.thisForm.userLevels.value=document.myForm.userLevels.value; |
---|
226 | window.close(); |
---|
227 | |
---|
228 | |
---|
229 | } |
---|
230 | |
---|
231 | function deleteSetting() { |
---|
232 | |
---|
233 | sel=document.myForm.defined_levels; |
---|
234 | for (var i=0;i<sel.length;i++) { |
---|
235 | if (sel.options[i].selected && confirm('Remove this level ?')) sel.remove(i); |
---|
236 | } |
---|
237 | } |
---|
238 | |
---|
239 | function resetSetting() { |
---|
240 | sel=document.myForm.defined_levels; |
---|
241 | if (confirm('Remove all levels ?')) { |
---|
242 | while (sel.options.length>0) { |
---|
243 | sel.options[0]=null; |
---|
244 | } |
---|
245 | } |
---|
246 | |
---|
247 | } |
---|
248 | |
---|
249 | |
---|
250 | //--> |
---|
251 | </script> |
---|
252 | </head> |
---|
253 | <body bgcolor="#ffffff" onload="Javascript:deplace()"> |
---|
254 | <table cellpaddin=2 cellspacing=2 width="100%"> |
---|
255 | <tr><td class="titreN"><b>CONTOUR PLOT SET-UP : LEVEL DEFINITION</b></td></tr> |
---|
256 | <tr><td class="rubrique"><b>WORKING PARAMETER</b></td></tr> |
---|
257 | </table> |
---|
258 | <form name="myForm"> |
---|
259 | <input type="hidden" name="userLevels" value=""> |
---|
260 | <table border="0" cellpadding="2" cellspacing="2"> |
---|
261 | <tr> |
---|
262 | <td class="ssrubrique" align="right">ATMOSPHERIC PARAMETER</td> |
---|
263 | <td align="left"><input type="text" name="sel_par_abs" value="" size="15" disabled></td> |
---|
264 | <td class="ssrubrique" align="right">Units</td> |
---|
265 | <td align="left"><input type="text" name="sel_unit_abs" value="" size="12" disabled></td> |
---|
266 | <td class="ssrubrique" align="right">Sub-parameter</td> |
---|
267 | <td align="left"><input type="text" name="sel_sspar_abs" value="" size="10" disabled></td> |
---|
268 | </tr> |
---|
269 | </table> |
---|
270 | |
---|
271 | <table border="0" cellpadding="2" cellspacing="2" width="100%"> |
---|
272 | <tr><td> </td></tr> |
---|
273 | <tr><td class="rubrique" colspan=3><b>CONTOUR LEVEL DEFINITION</b></td></tr> |
---|
274 | <tr> |
---|
275 | <td> |
---|
276 | <table border="1" cellpadding="1" cellspacing="0"> |
---|
277 | <tr> |
---|
278 | <td class="ssrubrique" align="right">Defined Levels</td> |
---|
279 | </tr> |
---|
280 | <tr> |
---|
281 | <td class="normal" height="90"> |
---|
282 | <select size=10 length=50 name="defined_levels"></select> |
---|
283 | </td> |
---|
284 | </tr> |
---|
285 | </table> |
---|
286 | </td> |
---|
287 | <td valign="bottom"> |
---|
288 | <img src="Icons/flecheG.gif" width="75" height="20" onClick="addLevel();"><br> |
---|
289 | <img src="Icons/flecheD.gif" width="75" height="20" onClick="recupLevel();"><br><br> |
---|
290 | <img src="Icons/suppr.gif" width="75" height="20" onClick="deleteSetting();"><br> |
---|
291 | </td> |
---|
292 | <td> |
---|
293 | <table border="1" cellpadding="2" cellspacing="0"> |
---|
294 | <tr> |
---|
295 | <td> |
---|
296 | <table border="0" cellpadding="2" cellspacing="2"> |
---|
297 | <tr> |
---|
298 | <td class="ssrubrique" valign="top" align="right">Level Value</td> |
---|
299 | <td align="left"><input type="text" name="contour_level_set_value" size="10"></td> |
---|
300 | <td align="right" class="ssrubrique">Units <td> |
---|
301 | <td><input type="text" name="sel_unit_abs2" value="" disabled></td> |
---|
302 | </tr> |
---|
303 | <tr> |
---|
304 | <td nowrap align="right" class="ssrubrique">Contour line label</td> |
---|
305 | <td align="left"> |
---|
306 | <select size="1" name="contour_user_set_label_flag"> |
---|
307 | <option value="1">Default</option> |
---|
308 | <option value="0">No</option> |
---|
309 | <option value="1">Yes</option> |
---|
310 | </select> |
---|
311 | </td> |
---|
312 | </tr> |
---|
313 | <tr> |
---|
314 | <td align="right" nowrap class="ssrubrique">Contour line colour</td> |
---|
315 | <td align="left"> |
---|
316 | <select name="contour_user_set_colour"> |
---|
317 | <option value="0,0,0">Default</option> |
---|
318 | <option value="127,255,212">Aquamarine</option> |
---|
319 | <option value="0,0,0">Black</option> |
---|
320 | <option value="0,0,255">Blue</option> |
---|
321 | <option value="127,255,0">Chartreuse</option> |
---|
322 | <option value="255,127,80">Coral</option> |
---|
323 | <option value="0,255,255">Cyan</option> |
---|
324 | <option value="0,255,0">Green</option> |
---|
325 | <option value="255,0,255">Magenta</option> |
---|
326 | <option value="176,48,96">Maroon</option> |
---|
327 | <option value="255,165,0">Orange</option> |
---|
328 | <option value="218,112,214">Orchid</option> |
---|
329 | <option value="160,32,240">Purple</option> |
---|
330 | <option value="255,0,0">Red</option> |
---|
331 | <option value="46,139,87">Sea green</option> |
---|
332 | <option value="160,82,45">Sienna</option> |
---|
333 | <option value="238,210,238">Thistle</option> |
---|
334 | <option value="255,255,255">White</option> |
---|
335 | <option value="255,255,0">Yellow</option> |
---|
336 | </select> |
---|
337 | </td> |
---|
338 | </tr> |
---|
339 | <tr> |
---|
340 | <td align="right" nowrap class="ssrubrique">Contour line linestyle</td> |
---|
341 | <td align="left"> |
---|
342 | <select name="contour_user_set_linestyle"> |
---|
343 | <option value="0">Default</option> |
---|
344 | <option value="3">Dash dot</option> |
---|
345 | <option value="4">Dash dot dot</option> |
---|
346 | <option value="2">Dashed</option> |
---|
347 | <option value="1">Dotted</option> |
---|
348 | <option value="5">Long dashes</option> |
---|
349 | <option value="0">Solid</option> |
---|
350 | </select> |
---|
351 | </td> |
---|
352 | </tr> |
---|
353 | <tr> |
---|
354 | <td align="right" class="ssrubrique">Contour line thickness</td> |
---|
355 | <td align="left"> |
---|
356 | <select size="1" name="contour_user_set_line_thickness"> |
---|
357 | <option value="1">Default</option> |
---|
358 | <option value="0">0</option> |
---|
359 | <option value="1">1</option> |
---|
360 | <option value="2">2</option> |
---|
361 | <option value="3">3</option> |
---|
362 | </select> |
---|
363 | </td> |
---|
364 | </tr> |
---|
365 | </table> |
---|
366 | </td> |
---|
367 | </tr> |
---|
368 | </table> |
---|
369 | </td> |
---|
370 | </tr> |
---|
371 | </table> |
---|
372 | |
---|
373 | <div align="center"> |
---|
374 | <a href="Javascript:window.loadSetting()"><img src="Icons/valid.gif" width="75" height="25" border="0"></a> <a href="Javascript:window.close()"><img src="Icons/cancel.gif" width="75" height="25" border="0"></a> <a href="Javascript:resetSetting()"><img src="Icons/reset.gif" width="75" height="25" border="0"></a> |
---|
375 | </div> |
---|
376 | </form> |
---|
377 | </body> |
---|
378 | </html> |
---|