1 | /** ***************************************************** **/ |
---|
2 | /** ********************** MEDIAS *********************** **/ |
---|
3 | /** ***************************************************** **/ |
---|
4 | |
---|
5 | //Retourne l'objet permettant de faire de l'AJAX en fonction du browser |
---|
6 | function getXmlHttpObject(handler){ |
---|
7 | var objXMLHttp=null; |
---|
8 | if (window.XMLHttpRequest){// Firefox et autres |
---|
9 | objXMLHttp=new XMLHttpRequest(); |
---|
10 | }else if (window.ActiveXObject){// Internet Explorer |
---|
11 | try{ |
---|
12 | objXMLHttp=new ActiveXObject("Msxml2.XMLHTTP") //For IE>=6 |
---|
13 | }catch(ex1){ |
---|
14 | try{ |
---|
15 | objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP") //For IE5.5 |
---|
16 | }catch(ex2){ |
---|
17 | objXMLHttp=null; |
---|
18 | } |
---|
19 | } |
---|
20 | } |
---|
21 | return objXMLHttp; |
---|
22 | } |
---|
23 | |
---|
24 | // Fonction permettant d'ajouter un contact au jeu cÎté serveur |
---|
25 | function addContact(chemin) { |
---|
26 | var url = chemin+"/NewContact.do"; |
---|
27 | xmlHttp = getXmlHttpObject(); |
---|
28 | if (xmlHttp == null) { |
---|
29 | alert ("Browser does not support HTTP Request"); |
---|
30 | return; |
---|
31 | } |
---|
32 | xmlHttp.onreadystatechange = new Function("addContactClient('"+chemin+"');"); |
---|
33 | xmlHttp.open("POST",url,true); |
---|
34 | xmlHttp.send(url); |
---|
35 | } |
---|
36 | |
---|
37 | // Fonction permettant d'ajouter un contact au jeu cÎté client |
---|
38 | function addContactClient(chemin) { |
---|
39 | if(xmlHttp.readyState==4 || xmlHttp.readyState=='complete') { |
---|
40 | var tableCadre = document.getElementById('cadreContacts'); |
---|
41 | var lignes = tableCadre.getElementsByTagName('table'); |
---|
42 | var nbElem = lignes.length; |
---|
43 | var table = document.createElement('table'); |
---|
44 | if (nbElem == 0 || lignes[nbElem-1].className == "impair") |
---|
45 | table.className = "pair"; |
---|
46 | else |
---|
47 | table.className = "impair"; |
---|
48 | table.innerHTML = |
---|
49 | '<tbody>'+ |
---|
50 | '<tr>'+ |
---|
51 | '<td rowspan="8" nowrap="nowrap">'+messContact+' '+nbElem+'</td>'+ |
---|
52 | '<td>'+messNom+' : </td>'+ |
---|
53 | '<td colspan="2"><input id="contactNom_'+nbElem+'" name="metadata.pres.contacts['+nbElem+'].nom" value="" type="text"></td>'+ |
---|
54 | '</tr>'+ |
---|
55 | '<tr>'+ |
---|
56 | '<td>'+messPrenom+' : </td>'+ |
---|
57 | '<td colspan="2"><input id="contactPrenom_'+nbElem+'" name="metadata.pres.contacts['+nbElem+'].prenom" value="" type="text"></td>'+ |
---|
58 | '</tr>'+ |
---|
59 | '<tr>'+ |
---|
60 | '<td>'+messOrg+' : </td>'+ |
---|
61 | '<td colspan="2"><input id="contactOrg_'+nbElem+'" name="metadata.pres.contacts['+nbElem+'].organisme" value="" type="text"></td>'+ |
---|
62 | '</tr>'+ |
---|
63 | '<tr>'+ |
---|
64 | '<td>'+messMail+' * : </td>'+ |
---|
65 | '<td colspan="2"><input id="contactMail_'+nbElem+'" name="metadata.pres.contacts['+nbElem+'].com.medias.mail" value="" type="text"></td>'+ |
---|
66 | '</tr>'+ |
---|
67 | '<tr>'+ |
---|
68 | '<td>'+messMdp+' * : </td>'+ |
---|
69 | '<td colspan="2"><input id="contactMdp_'+nbElem+'" name="metadata.pres.contacts['+nbElem+'].mdp" value="" type="text"></td>'+ |
---|
70 | '</tr>'+ |
---|
71 | '<tr>'+ |
---|
72 | '<td rowspan="3">'+messRole+' * : </td>'+ |
---|
73 | '<td colspan="2"><input id="contactDef_'+nbElem+'" name="metadata.pres.contacts['+nbElem+'].role" value="default" type="radio" checked>'+messDef+'</td>'+ |
---|
74 | '</tr>'+ |
---|
75 | '<tr>'+ |
---|
76 | '<td colspan="2"><input id="contactPi_'+nbElem+'" name="metadata.pres.contacts['+nbElem+'].role" value="pi" type="radio">'+messPi+'</td>'+ |
---|
77 | '</tr>'+ |
---|
78 | '<tr>'+ |
---|
79 | '<td><input id="contactTech_'+nbElem+'" name="metadata.pres.contacts['+nbElem+'].role" value="tech" type="radio">'+messTech+'</td>'+ |
---|
80 | '<td><input onclick="removeContact(\''+chemin+'\','+nbElem+')" value="'+messDelPers+'" type="button"></td>'+ |
---|
81 | '</tr>'+ |
---|
82 | '</tbody>'; |
---|
83 | tableCadre.appendChild(table); |
---|
84 | } |
---|
85 | } |
---|
86 | |
---|
87 | //Fonction permettant de supprimer un contact au jeu cÎté serveur |
---|
88 | function removeContact(chemin, indexContact) { |
---|
89 | var url = chemin+"/RemoveContact.do?num="+indexContact; |
---|
90 | xmlHttp = getXmlHttpObject(); |
---|
91 | if (xmlHttp == null) { |
---|
92 | alert ("Browser does not support HTTP Request"); |
---|
93 | return; |
---|
94 | } |
---|
95 | xmlHttp.onreadystatechange = new Function("removeContactClient("+indexContact+");"); |
---|
96 | xmlHttp.open("POST",url,true); |
---|
97 | xmlHttp.send(url); |
---|
98 | } |
---|
99 | |
---|
100 | // Fonction permettant de supprimer un contact au jeu cÎté client |
---|
101 | function removeContactClient(indexContact) { |
---|
102 | if(xmlHttp.readyState==4 || xmlHttp.readyState=='complete') { |
---|
103 | var tableCadre = document.getElementById('cadreContacts'); |
---|
104 | var lignes = tableCadre.getElementsByTagName('table'); |
---|
105 | var nbElem = lignes.length; |
---|
106 | // On décale les valeurs intercalées |
---|
107 | for (var num = indexContact ; num < nbElem - 1 ; num++) { |
---|
108 | document.getElementById('contactNom_'+num).value = document.getElementById('contactNom_'+(num+1)).value; |
---|
109 | document.getElementById('contactPrenom_'+num).value = document.getElementById('contactPrenom_'+(num+1)).value; |
---|
110 | document.getElementById('contactOrg_'+num).value = document.getElementById('contactOrg_'+(num+1)).value; |
---|
111 | document.getElementById('contactMail_'+num).value = document.getElementById('contactMail_'+(num+1)).value; |
---|
112 | document.getElementById('contactMdp_'+num).value = document.getElementById('contactMdp_'+(num+1)).value; |
---|
113 | document.getElementById('contactDef_'+num).checked = document.getElementById('contactDef_'+(num+1)).checked; |
---|
114 | document.getElementById('contactPi_'+num).checked = document.getElementById('contactPi_'+(num+1)).checked; |
---|
115 | document.getElementById('contactTech_'+num).checked = document.getElementById('contactTech_'+(num+1)).checked; |
---|
116 | } |
---|
117 | // On efface la ligne |
---|
118 | tableCadre.removeChild(lignes[nbElem-1]); |
---|
119 | } |
---|
120 | } |
---|
121 | |
---|
122 | //Fonction permettant d'ajouter une plateforme au jeu cÎté serveur |
---|
123 | function addPlat(chemin) { |
---|
124 | var url = chemin+"/NewPlat.do"; |
---|
125 | xmlHttp = getXmlHttpObject(); |
---|
126 | if (xmlHttp == null) { |
---|
127 | alert ("Browser does not support HTTP Request"); |
---|
128 | return; |
---|
129 | } |
---|
130 | xmlHttp.onreadystatechange = new Function("addPlatClient('"+chemin+"');"); |
---|
131 | xmlHttp.open("POST",url,true); |
---|
132 | xmlHttp.send(url); |
---|
133 | } |
---|
134 | |
---|
135 | //Fonction permettant d'ajouter une plateforme au jeu cÎté client |
---|
136 | function addPlatClient(chemin) { |
---|
137 | if(xmlHttp.readyState==4 || xmlHttp.readyState=='complete') { |
---|
138 | var tableCadre = document.getElementById('cadrePlats'); |
---|
139 | var lignes = tableCadre.getElementsByTagName('table'); |
---|
140 | var nbElem = lignes.length/2; |
---|
141 | var table = document.createElement('table'); |
---|
142 | if (nbElem == 0 || lignes[lignes.length-2].className == "impair") |
---|
143 | table.className = "pair"; |
---|
144 | else |
---|
145 | table.className = "impair"; |
---|
146 | var nomCat = document.getElementById('nomCateg').value; |
---|
147 | var listePlats; |
---|
148 | if (nomCat == "AVION") { |
---|
149 | listePlats = '<option value="ATR-42">ATR-42</option>'+ |
---|
150 | '<option value="Piper-Aztec">Piper-Aztec</option>'; |
---|
151 | } else if (nomCat == "SURF_FIXE") { |
---|
152 | listePlats = '<option value="Ballon Air de Paris">Ballon Air de Paris</option>'+ |
---|
153 | '<option value="Champs-sur-Marne">Champs-sur-Marne</option>'+ |
---|
154 | '<option value="Créteil">Créteil</option>'+ |
---|
155 | '<option value="Grignon">Grignon</option>'+ |
---|
156 | '<option value="Jussieu">Jussieu</option>'+ |
---|
157 | '<option value="LHVP">LHVP</option>'+ |
---|
158 | '<option value="Livry-Gargan">Livry-Gargan</option>'+ |
---|
159 | '<option value="Roissy">Roissy</option>'+ |
---|
160 | '<option value="SIRTA">SIRTA</option>'+ |
---|
161 | '<option value="Tour Eiffel">Tour Eiffel</option>'; |
---|
162 | } else { |
---|
163 | listePlats = '<option value="CEA-LIDAR">CEA-LIDAR</option>'+ |
---|
164 | '<option value="MPI-DOAS">MPI-DOAS</option>'+ |
---|
165 | '<option value="MPI-MOLA">MPI-MOLA</option>'+ |
---|
166 | '<option value="PSI">PSI</option>'; |
---|
167 | } |
---|
168 | table.innerHTML = |
---|
169 | '<tbody>'+ |
---|
170 | '<tr>'+ |
---|
171 | '<td rowspan="9" nowrap="nowrap">'+messPlat+' '+nbElem+'</td>'+ |
---|
172 | '<td>'+messPlatNom+' * : </td>'+ |
---|
173 | '<td colspan="2">'+ |
---|
174 | '<select id="platNom_'+nbElem+'" name="metadata.contenuPrevu.plateformes['+nbElem+'].nom" onchange="majListPlat('+nbElem+')">'+ |
---|
175 | '<option value="-">-</option>'+ |
---|
176 | listePlats+ |
---|
177 | '</select>'+ |
---|
178 | ' '+messOth+' '+ |
---|
179 | '<input id="platOth_'+nbElem+'" name="metadata.contenuPrevu.plateformes['+nbElem+'].nomOth" value="" type="text" size="10" onchange="majListPlat('+nbElem+')">'+ |
---|
180 | '</td>'+ |
---|
181 | '</tr>'+ |
---|
182 | '<tr>'+ |
---|
183 | '<td>'+messDesc+' : </td>'+ |
---|
184 | '<td colspan="2"><textarea id="platDesc_'+nbElem+'" name="metadata.contenuPrevu.plateformes['+nbElem+'].desc" cols="50"></textarea></td>'+ |
---|
185 | '</tr>'+ |
---|
186 | '<tr>'+ |
---|
187 | '<td>'+messPlatImg+' : </td>'+ |
---|
188 | '<td colspan="2"><table width="100%"><tbody><tr><td colspan="2">'+ |
---|
189 | '<img src="'+chemin+'/images/utils/uploadText.png"> <input name="metadata.contenuPrevu.plateformes['+nbElem+'].newFile" value="" type="file"><input name="mess['+nbElem+']" value="Upload" type="submit">'+ |
---|
190 | '</td></tr></tbody></table></td>'+ |
---|
191 | '</tr>'+ |
---|
192 | '<tr>'+ |
---|
193 | '<td>'+messPlatLatMin+' : </td>'+ |
---|
194 | '<td><input id="platLatMin_'+nbElem+'" name=""metadata.contenuPrevu.plateformes['+nbElem+'].lat_min" value="" type="text"></td>'+ |
---|
195 | '<td>'+messPlatLatForm+'</td>'+ |
---|
196 | '</tr>'+ |
---|
197 | '<tr>'+ |
---|
198 | '<td>'+messPlatLatMax+' : </td>'+ |
---|
199 | '<td><input id="platLatMax_'+nbElem+'" name=""metadata.contenuPrevu.plateformes['+nbElem+'].lat_max" value="" type="text"></td>'+ |
---|
200 | '<td>'+messPlatLatForm+'</td>'+ |
---|
201 | '</tr>'+ |
---|
202 | '<tr>'+ |
---|
203 | '<td>'+messPlatLonMin+' : </td>'+ |
---|
204 | '<td><input id="platLonMin_'+nbElem+'" name=""metadata.contenuPrevu.plateformes['+nbElem+'].lon_min" value="" type="text"></td>'+ |
---|
205 | '<td>'+messPlatLonForm+'</td>'+ |
---|
206 | '</tr>'+ |
---|
207 | '<tr>'+ |
---|
208 | '<td>'+messPlatLonMax+' : </td>'+ |
---|
209 | '<td><input id="platLonMax_'+nbElem+'" name=""metadata.contenuPrevu.plateformes['+nbElem+'].lon_max" value="" type="text"></td>'+ |
---|
210 | '<td>'+messPlatLonForm+'</td>'+ |
---|
211 | '</tr>'+ |
---|
212 | '<tr>'+ |
---|
213 | '<td>'+messPlatAltMin+' : </td>'+ |
---|
214 | '<td colspan="2"><input id="platAltMin_'+nbElem+'" name=""metadata.contenuPrevu.plateformes['+nbElem+'].alt_min" value="" type="text"></td>'+ |
---|
215 | '</tr>'+ |
---|
216 | '<tr>'+ |
---|
217 | '<td>'+messPlatAltMax+' : </td>'+ |
---|
218 | '<td><input id="platAltMax_'+nbElem+'" name=""metadata.contenuPrevu.plateformes['+nbElem+'].alt_max" value="" type="text"></td>'+ |
---|
219 | '<td><input onclick="removePlat(\''+chemin+'\','+nbElem+')" value="'+messDelPlat+'" type="button"></td>'+ |
---|
220 | '</tr>'+ |
---|
221 | '</tbody>'; |
---|
222 | tableCadre.appendChild(table); |
---|
223 | // On rajoute une ligne à la liste de plateformes associés aux capteurs |
---|
224 | var tableCapts = document.getElementById('cadreCapts'); |
---|
225 | var selectPlats = tableCapts.getElementsByTagName('select'); |
---|
226 | for (var numsel = 0; numsel < selectPlats.length ; numsel++) { |
---|
227 | if (numsel % 2 != 0) { |
---|
228 | var opt = document.createElement('option'); |
---|
229 | opt.text = '-'; |
---|
230 | opt.value = '-'; |
---|
231 | selectPlats[numsel].appendChild(opt); |
---|
232 | } |
---|
233 | } |
---|
234 | } |
---|
235 | } |
---|
236 | |
---|
237 | //Fonction permettant de supprimer une plateforme au jeu cÎté serveur |
---|
238 | function removePlat(chemin, indexPlat) { |
---|
239 | var url = chemin+"/RemovePlat.do?num="+indexPlat; |
---|
240 | xmlHttp = getXmlHttpObject(); |
---|
241 | if (xmlHttp == null) { |
---|
242 | alert ("Browser does not support HTTP Request"); |
---|
243 | return; |
---|
244 | } |
---|
245 | xmlHttp.onreadystatechange = new Function("removePlatClient("+indexPlat+");"); |
---|
246 | xmlHttp.open("POST",url,true); |
---|
247 | xmlHttp.send(url); |
---|
248 | } |
---|
249 | |
---|
250 | //Fonction permettant de supprimer une plateforme au jeu cÎté client |
---|
251 | function removePlatClient(indexPlat) { |
---|
252 | if(xmlHttp.readyState==4 || xmlHttp.readyState=='complete') { |
---|
253 | var tableCadre = document.getElementById('cadrePlats'); |
---|
254 | var lignes = tableCadre.getElementsByTagName('table'); |
---|
255 | var nbElem = lignes.length/2; |
---|
256 | // On décale les valeurs intercalées |
---|
257 | for (var num = indexPlat ; num < nbElem - 1 ; num++) { |
---|
258 | document.getElementById('platNom_'+num).value = document.getElementById('platNom_'+(num+1)).value; |
---|
259 | document.getElementById('platOth_'+num).value = document.getElementById('platOth_'+(num+1)).value; |
---|
260 | document.getElementById('platDesc_'+num).value = document.getElementById('platDesc_'+(num+1)).value; |
---|
261 | document.getElementById('platLatMin_'+num).value = document.getElementById('platLatMin_'+(num+1)).value; |
---|
262 | document.getElementById('platLatMax_'+num).value = document.getElementById('platLatMax_'+(num+1)).value; |
---|
263 | document.getElementById('platLonMin_'+num).value = document.getElementById('platLonMin_'+(num+1)).value; |
---|
264 | document.getElementById('platLonMax_'+num).value = document.getElementById('platLonMax_'+(num+1)).value; |
---|
265 | document.getElementById('platAltMin_'+num).value = document.getElementById('platAltMin_'+(num+1)).value; |
---|
266 | document.getElementById('platAltMax_'+num).value = document.getElementById('platAltMax_'+(num+1)).value; |
---|
267 | } |
---|
268 | // On efface la ligne |
---|
269 | tableCadre.removeChild(lignes[lignes.length-2]); |
---|
270 | // On efface une ligne à la liste de plateformes associés aux capteurs |
---|
271 | var tableCapts = document.getElementById('cadreCapts'); |
---|
272 | var selectPlats = tableCapts.getElementsByTagName('select'); |
---|
273 | for (var numsel = 0; numsel < selectPlats.length ; numsel++) { |
---|
274 | if (numsel % 2 != 0) { |
---|
275 | var options = selectPlats[numsel].getElementsByTagName("option"); |
---|
276 | selectPlats[numsel].removeChild(options[indexPlat]); |
---|
277 | } |
---|
278 | } |
---|
279 | } |
---|
280 | } |
---|
281 | |
---|
282 | //Fonction permettant d'ajouter un capteur au jeu cÎté serveur |
---|
283 | function addCapt(chemin) { |
---|
284 | var url = chemin+"/NewCapt.do"; |
---|
285 | xmlHttp = getXmlHttpObject(); |
---|
286 | if (xmlHttp == null) { |
---|
287 | alert ("Browser does not support HTTP Request"); |
---|
288 | return; |
---|
289 | } |
---|
290 | xmlHttp.onreadystatechange = new Function("addCaptClient('"+chemin+"');"); |
---|
291 | xmlHttp.open("POST",url,true); |
---|
292 | xmlHttp.send(url); |
---|
293 | } |
---|
294 | |
---|
295 | //Fonction permettant d'ajouter un capteur au jeu cÎté client |
---|
296 | function addCaptClient(chemin) { |
---|
297 | if(xmlHttp.readyState==4 || xmlHttp.readyState=='complete') { |
---|
298 | var tableCadre = document.getElementById('cadreCapts'); |
---|
299 | var lignes = tableCadre.getElementsByTagName('table'); |
---|
300 | var nbElem = lignes.length; |
---|
301 | var table = document.createElement('table'); |
---|
302 | if (nbElem == 0 || lignes[nbElem-1].className == "impair") |
---|
303 | table.className = "pair"; |
---|
304 | else |
---|
305 | table.className = "impair"; |
---|
306 | var listeCapts ='<option value="Aerosol Collector">Aerosol Collector</option>'+ |
---|
307 | '<option value="Aerosol Mass Spectrometer">Aerosol Mass Spectrometer</option>'+ |
---|
308 | '<option value="Aerosol/Cloud Particle Sizer">Aerosol/Cloud Particle Sizer</option>'+ |
---|
309 | '<option value="Aethalometer">Aethalometer</option>'+ |
---|
310 | '<option value="Airpointer">Airpointer</option>'+ |
---|
311 | '<option value="Anemometer">Anemometer</option>'+ |
---|
312 | '<option value="Autoanalyser">Autoanalyser</option>'+ |
---|
313 | '<option value="AWS (Automated Weather System)">AWS (Automated Weather System)</option>'+ |
---|
314 | '<option value="Backscatter LIDAR">Backscatter LIDAR</option>'+ |
---|
315 | '<option value="Balance">Balance</option>'+ |
---|
316 | '<option value="Camera">Camera</option>'+ |
---|
317 | '<option value="Carbon Analyser">Carbon Analyser</option>'+ |
---|
318 | '<option value="Ceilometer">Ceilometer</option>'+ |
---|
319 | '<option value="Chemiluminescence">Chemiluminescence</option>'+ |
---|
320 | '<option value="CHN Analyzer (Carbon, Hydrogen, Nitrogen)">CHN Analyzer (Carbon, Hydrogen, Nitrogen)</option>'+ |
---|
321 | '<option value="CIMS Mass Spectrometer">CIMS Mass Spectrometer</option>'+ |
---|
322 | '<option value="CO2 Analyser">CO2 Analyser</option>'+ |
---|
323 | '<option value="CPC (Condensation Particle Counter)">CPC (Condensation Particle Counter)</option>'+ |
---|
324 | '<option value="Disdrometer">Disdrometer</option>'+ |
---|
325 | '<option value="Dropsonde">Dropsonde</option>'+ |
---|
326 | '<option value="EAS (Electrical Aerosol Spectrometer)">EAS (Electrical Aerosol Spectrometer)</option>'+ |
---|
327 | '<option value="EC-OC">EC-OC</option>'+ |
---|
328 | '<option value="Eddy Correlation Device">Eddy Correlation Device</option>'+ |
---|
329 | '<option value="Gas Analyser">Gas Analyser</option>'+ |
---|
330 | '<option value="Gas Chromatograph">Gas Chromatograph</option>'+ |
---|
331 | '<option value="Gas Sampler">Gas Sampler</option>'+ |
---|
332 | '<option value="GPS Receiver">GPS Receiver</option>'+ |
---|
333 | '<option value="HTDMA (Hygroscopicity Tandem Differential Mobility Analyser)">HTDMA (Hygroscopicity Tandem Differential Mobility Analyser)</option>'+ |
---|
334 | '<option value="Humidity Sensor">Humidity Sensor</option>'+ |
---|
335 | '<option value="Interferometer">Interferometer</option>'+ |
---|
336 | '<option value="LIDAR (Light Detection and Ranging)">LIDAR (Light Detection and Ranging)</option>'+ |
---|
337 | '<option value="MAAP (Multi Angle Absorption Photometer)">MAAP (Multi Angle Absorption Photometer)</option>'+ |
---|
338 | '<option value="Magnetometer">Magnetometer</option>'+ |
---|
339 | '<option value="Meteo Station">Meteo Station</option>'+ |
---|
340 | '<option value="Microscope">Microscope</option>'+ |
---|
341 | '<option value="Nephelometer">Nephelometer</option>'+ |
---|
342 | '<option value="OPC (Optic Particle Counter)">OPC (Optic Particle Counter)</option>'+ |
---|
343 | '<option value="Oxygen Analyser">Oxygen Analyser</option>'+ |
---|
344 | '<option value="Ozone Analyser">Ozone Analyser</option>'+ |
---|
345 | '<option value="Particle Detector">Particle Detector</option>'+ |
---|
346 | '<option value="PH Meter">PH Meter</option>'+ |
---|
347 | '<option value="Photometer">Photometer</option>'+ |
---|
348 | '<option value="PILS-IC">PILS-IC</option>'+ |
---|
349 | '<option value="PILS-TOC">PILS-TOC</option>'+ |
---|
350 | '<option value="Pressure Sensor">Pressure Sensor</option>'+ |
---|
351 | '<option value="PSAP (Particle Soot Absorption Photometer)">PSAP (Particle Soot Absorption Photometer)</option>'+ |
---|
352 | '<option value="PTRMS">PTRMS</option>'+ |
---|
353 | '<option value="RADAR (Radio Detection and Ranging)">RADAR (Radio Detection and Ranging)</option>'+ |
---|
354 | '<option value="Radiometer">Radiometer</option>'+ |
---|
355 | '<option value="Radiosonde">Radiosonde</option>'+ |
---|
356 | '<option value="Rain gauge">Rain gauge</option>'+ |
---|
357 | '<option value="SMPS (Scanning Mobility Particle Sizer)">SMPS (Scanning Mobility Particle Sizer)</option>'+ |
---|
358 | '<option value="SODAR (Sound Detection and Ranging)">SODAR (Sound Detection and Ranging)</option>'+ |
---|
359 | '<option value="Spectrometer">Spectrometer</option>'+ |
---|
360 | '<option value="Spectroradiometer">Spectroradiometer</option>'+ |
---|
361 | '<option value="TDMPS">TDMPS</option>'+ |
---|
362 | '<option value="Temperature Sensor">Temperature Sensor</option>'+ |
---|
363 | '<option value="TEOM (Tapered Element Oscillating Microbalance)">TEOM (Tapered Element Oscillating Microbalance)</option>'+ |
---|
364 | '<option value="Tethersonde">Tethersonde</option>'+ |
---|
365 | '<option value="UVAPS (Ultraviolet Aerodynamic Particle Sizer)">UVAPS (Ultraviolet Aerodynamic Particle Sizer)</option>'+ |
---|
366 | '<option value="Video Camera">Video Camera</option>'+ |
---|
367 | '<option value="Visual Observations">Visual Observations</option>'+ |
---|
368 | '<option value="VSMPS (Volatility Scanning Mobility Particle Sizer)">VSMPS (Volatility Scanning Mobility Particle Sizer)</option>'+ |
---|
369 | '<option value="VTDMA (Volatility Tandem Differential Mobility Analyser)">VTDMA (Volatility Tandem Differential Mobility Analyser)</option>'+ |
---|
370 | '<option value="Wet Deposition Collector">Wet Deposition Collector</option>'+ |
---|
371 | '<option value="Wet/Dry Precipitation Sampler">Wet/Dry Precipitation Sampler</option>'+ |
---|
372 | '<option value="Wind Profiler">Wind Profiler</option>'; |
---|
373 | var tablePlats = document.getElementById('cadrePlats'); |
---|
374 | var selectPlats = tablePlats.getElementsByTagName('select'); |
---|
375 | var listePlats = ""; |
---|
376 | for (var num = 0 ; num < selectPlats.length ; num++) { |
---|
377 | listePlats += '<option value="'+selectPlats[num].value+'">'+selectPlats[num].value+'</option>'; |
---|
378 | } |
---|
379 | table.innerHTML = |
---|
380 | '<tbody>'+ |
---|
381 | '<tr>'+ |
---|
382 | '<td rowspan="6" nowrap="nowrap">'+messCapt+' '+nbElem+'</td>'+ |
---|
383 | '<td>'+messCaptType+' * : </td>'+ |
---|
384 | '<td colspan="2">'+ |
---|
385 | '<select id="captType_'+nbElem+'" name="metadata.contenuPrevu.capteurs['+nbElem+'].type" onchange="majListCapt('+nbElem+')">'+ |
---|
386 | '<option value="-">-</option>'+ |
---|
387 | listeCapts+ |
---|
388 | '</select>'+ |
---|
389 | ' '+messOth+' '+ |
---|
390 | '<input id="captOth_'+nbElem+'" name="metadata.contenuPrevu.capteurs['+nbElem+'].typeOth" value="" type="text" onchange="majListCapt('+nbElem+')">'+ |
---|
391 | '</td>'+ |
---|
392 | '</tr>'+ |
---|
393 | '<tr>'+ |
---|
394 | '<td>'+messCaptFab+' : </td>'+ |
---|
395 | '<td colspan="2"><input id="captFab_'+nbElem+'" name="metadata.contenuPrevu.capteurs['+nbElem+'].fabriquant" value="" type="text" onchange="majListCapt('+nbElem+')"></td>'+ |
---|
396 | '</tr>'+ |
---|
397 | '<tr>'+ |
---|
398 | '<td>'+messCaptMod+' : </td>'+ |
---|
399 | '<td colspan="2"><input id="captMod_'+nbElem+'" name="metadata.contenuPrevu.capteurs['+nbElem+'].modele" value="" type="text" onchange="majListCapt('+nbElem+')"></td>'+ |
---|
400 | '</tr>'+ |
---|
401 | '<tr>'+ |
---|
402 | '<td>'+messCaptNum+' : </td>'+ |
---|
403 | '<td colspan="2"><input id="captNum_'+nbElem+'" name="metadata.contenuPrevu.capteurs['+nbElem+'].num" value="" type="text" onchange="majListCapt('+nbElem+')"></td>'+ |
---|
404 | '</tr>'+ |
---|
405 | '<tr>'+ |
---|
406 | '<td>'+messCaptEta+' : </td>'+ |
---|
407 | '<td colspan="2"><textarea id="captEta_'+nbElem+'" name="metadata.contenuPrevu.capteurs['+nbElem+'].etalon"></textarea></td>'+ |
---|
408 | '</tr>'+ |
---|
409 | '<tr>'+ |
---|
410 | '<td>'+messCaptPlat+' * : </td>'+ |
---|
411 | '<td>'+ |
---|
412 | '<select id="captPlat_'+nbElem+'" name="metadata.contenuPrevu.capteurs['+nbElem+'].nomPlateforme">'+ |
---|
413 | listePlats+ |
---|
414 | '</select>'+ |
---|
415 | '</td>'+ |
---|
416 | '<td><input onclick="removeCapt(\''+chemin+'\','+nbElem+')" value="'+messDelCapt+'" type="button"></td>'+ |
---|
417 | '</tr>'+ |
---|
418 | '</tbody>'; |
---|
419 | tableCadre.appendChild(table); |
---|
420 | // On rajoute une ligne à la liste de capteurs associés aux paramÚtres |
---|
421 | var tableParams = document.getElementById('cadreParams'); |
---|
422 | var selectCapts = tableParams.getElementsByTagName('select'); |
---|
423 | for (var numsel = 0; numsel < selectCapts.length ; numsel++) { |
---|
424 | if (numsel % 4 == 3) { |
---|
425 | var opt = document.createElement('option'); |
---|
426 | opt.text = '-'; |
---|
427 | opt.value = '-'; |
---|
428 | selectCapts[numsel].appendChild(opt); |
---|
429 | } |
---|
430 | } |
---|
431 | } |
---|
432 | } |
---|
433 | |
---|
434 | //Fonction permettant de supprimer un capteur au jeu cÎté serveur |
---|
435 | function removeCapt(chemin, indexCapt) { |
---|
436 | var url = chemin+"/RemoveCapt.do?num="+indexCapt; |
---|
437 | xmlHttp = getXmlHttpObject(); |
---|
438 | if (xmlHttp == null) { |
---|
439 | alert ("Browser does not support HTTP Request"); |
---|
440 | return; |
---|
441 | } |
---|
442 | xmlHttp.onreadystatechange = new Function("removeCaptClient("+indexCapt+");"); |
---|
443 | xmlHttp.open("POST",url,true); |
---|
444 | xmlHttp.send(url); |
---|
445 | } |
---|
446 | |
---|
447 | //Fonction permettant de supprimer un capteur au jeu cÎté client |
---|
448 | function removeCaptClient(indexCapt) { |
---|
449 | if(xmlHttp.readyState==4 || xmlHttp.readyState=='complete') { |
---|
450 | var tableCadre = document.getElementById('cadreCapts'); |
---|
451 | var lignes = tableCadre.getElementsByTagName('table'); |
---|
452 | var nbElem = lignes.length; |
---|
453 | // On décale les valeurs intercalées |
---|
454 | for (var num = indexCapt ; num < nbElem - 1 ; num++) { |
---|
455 | document.getElementById('captType_'+num).value = document.getElementById('captType_'+(num+1)).value; |
---|
456 | document.getElementById('captOth_'+num).value = document.getElementById('captOth_'+(num+1)).value; |
---|
457 | document.getElementById('captFab_'+num).value = document.getElementById('captFab_'+(num+1)).value; |
---|
458 | document.getElementById('captMod_'+num).value = document.getElementById('captMod_'+(num+1)).value; |
---|
459 | document.getElementById('captNum_'+num).value = document.getElementById('captNum_'+(num+1)).value; |
---|
460 | document.getElementById('captEta_'+num).value = document.getElementById('captEta_'+(num+1)).value; |
---|
461 | document.getElementById('captPlat_'+num).value = document.getElementById('captPlat_'+(num+1)).value; |
---|
462 | } |
---|
463 | // On efface la ligne |
---|
464 | tableCadre.removeChild(lignes[lignes.length-1]); |
---|
465 | // On efface une ligne à la liste de capteurs associés aux paramÚtres |
---|
466 | var tableParams = document.getElementById('cadreParams'); |
---|
467 | var selectCapts = tableParams.getElementsByTagName('select'); |
---|
468 | for (var numsel = 0; numsel < selectCapts.length ; numsel++) { |
---|
469 | if (numsel % 4 == 3) { |
---|
470 | var options = selectCapts[numsel].getElementsByTagName("option"); |
---|
471 | selectCapts[numsel].removeChild(options[indexCapt]); |
---|
472 | } |
---|
473 | } |
---|
474 | } |
---|
475 | } |
---|
476 | |
---|
477 | //Fonction permettant d'ajouter un paramÚtre au jeu cÎté serveur |
---|
478 | function addParam(chemin) { |
---|
479 | var url = chemin+"/NewParam.do"; |
---|
480 | xmlHttp = getXmlHttpObject(); |
---|
481 | if (xmlHttp == null) { |
---|
482 | alert ("Browser does not support HTTP Request"); |
---|
483 | return; |
---|
484 | } |
---|
485 | xmlHttp.onreadystatechange = new Function("addParamClient('"+chemin+"');"); |
---|
486 | xmlHttp.open("POST",url,true); |
---|
487 | xmlHttp.send(url); |
---|
488 | } |
---|
489 | |
---|
490 | //Fonction permettant d'ajouter un paramÚtre au jeu cÎté client |
---|
491 | function addParamClient(chemin) { |
---|
492 | if(xmlHttp.readyState==4 || xmlHttp.readyState=='complete') { |
---|
493 | var tableCadre = document.getElementById('cadreParams'); |
---|
494 | var lignes = tableCadre.getElementsByTagName('table'); |
---|
495 | var nbElem = lignes.length; |
---|
496 | var table = document.createElement('table'); |
---|
497 | if (nbElem == 0 || lignes[nbElem-1].className == "impair") |
---|
498 | table.className = "pair"; |
---|
499 | else |
---|
500 | table.className = "impair"; |
---|
501 | var listeUnits = '<option value="no unit">no unit</option>'+ |
---|
502 | '<option value="deg">°</option>'+ |
---|
503 | '<option value="degC">°C</option>'+ |
---|
504 | '<option value="degK">°K</option>'+ |
---|
505 | '<option value="%">%</option>'+ |
---|
506 | '<option value="cm-3">cm-3</option>'+ |
---|
507 | '<option value="hPa">hPa</option>'+ |
---|
508 | '<option value="m">m</option>'+ |
---|
509 | '<option value="m-1">m-1</option>'+ |
---|
510 | '<option value="mbar">mbar</option>'+ |
---|
511 | '<option value="mm">mm</option>'+ |
---|
512 | '<option value="mm-1">mm-1</option>'+ |
---|
513 | '<option value="mm.h-1">mm.h-1</option>'+ |
---|
514 | '<option value="m.s-1">m.s-1</option>'+ |
---|
515 | '<option value="microg.m-3">µg.m-3</option>'+ |
---|
516 | '<option value="ng.m-3">ng.m-3</option>'+ |
---|
517 | '<option value="ppbv">ppbv</option>'+ |
---|
518 | '<option value="ppmv">ppmv</option>'+ |
---|
519 | '<option value="pptv">pptv</option>'+ |
---|
520 | '<option value="s">s</option>'+ |
---|
521 | '<option value="s-1">s-1</option>'+ |
---|
522 | '<option value="W.m-2">W.m-2</option>'; |
---|
523 | var listeCategs = '<option value="Gas Species">Gas Species</option>'+ |
---|
524 | '<option value="Aerosol Chemical Composition/Mass">Aerosol Chemical Composition/Mass</option>'+ |
---|
525 | '<option value="Aerosol Properties">Aerosol Properties</option>'+ |
---|
526 | '<option value="Meteo/Radiation">Meteo/Radiation</option>'+ |
---|
527 | '<option value="Aircraft Parameters">Aircraft Parameters</option>'+ |
---|
528 | '<option value="VOC">VOC</option>'+ |
---|
529 | '<option value="Sums of VOC from PTRMS">Sums of VOC from PTRMS</option>'; |
---|
530 | var cadreCapts = document.getElementById('cadreCapts'); |
---|
531 | var tableCapts = cadreCapts.getElementsByTagName('table'); |
---|
532 | var listeCapts = ""; |
---|
533 | for (var num = 0 ; num < tableCapts.length ; num++) { |
---|
534 | var type = document.getElementById('captType_'+num).value; |
---|
535 | var typeOth = document.getElementById('captOth_'+num).value; |
---|
536 | var fab = document.getElementById('captFab_'+num).value; |
---|
537 | var mod = document.getElementById('captMod_'+num).value; |
---|
538 | var nums = document.getElementById('captNum_'+num).value; |
---|
539 | if (type == "-") |
---|
540 | type = typeOth; |
---|
541 | if (fab != "") |
---|
542 | fab = " "+fab; |
---|
543 | if (mod != "") |
---|
544 | mod = " "+mod; |
---|
545 | if (nums != "") |
---|
546 | nums = " "+nums; |
---|
547 | var nomCapt = type+fab+mod+nums; |
---|
548 | listeCapts += '<option value="'+nomCapt+'">'+nomCapt+'</option>'; |
---|
549 | } |
---|
550 | table.innerHTML = |
---|
551 | '<tbody>'+ |
---|
552 | '<tr>'+ |
---|
553 | '<td rowspan="4" nowrap="nowrap">'+messParam+' '+nbElem+'</td>'+ |
---|
554 | '<td>'+messParamCat+' * : </td>'+ |
---|
555 | '<td colspan="2">'+ |
---|
556 | '<select id="paramCat_'+nbElem+'" name="metadata.contenuPrevu.params['+nbElem+'].categorie" onchange="majListParam(this.selectedIndex,'+nbElem+')">'+ |
---|
557 | '<option value="-">-</option>'+ |
---|
558 | listeCategs+ |
---|
559 | '</select>'+ |
---|
560 | ' '+messOth+' '+ |
---|
561 | '<input id="catOth_'+nbElem+'" name="metadata.contenuPrevu.params['+nbElem+'].categOth" value="" type="text">'+ |
---|
562 | '</td>'+ |
---|
563 | '</tr>'+ |
---|
564 | '<tr>'+ |
---|
565 | '<td>'+messParamNom+' * : </td>'+ |
---|
566 | '<td colspan="2">'+ |
---|
567 | '<select id="paramNom_'+nbElem+'" name="metadata.contenuPrevu.params['+nbElem+'].nom" >'+ |
---|
568 | '<option value="-">-</option>'+ |
---|
569 | '</select>'+ |
---|
570 | ' '+messOth+' '+ |
---|
571 | '<input id="paramNomOth_'+nbElem+'" name="metadata.contenuPrevu.params['+nbElem+'].nomOth" value="" type="text">'+ |
---|
572 | '</td>'+ |
---|
573 | '</tr>'+ |
---|
574 | // '<tr>'+ |
---|
575 | // '<td>'+messParamAb+' : </td>'+ |
---|
576 | // '<td colspan="2"><input id="paramAb_'+nbElem+'" name="metadata.contenuPrevu.params['+nbElem+'].abrev" value="" type="text"></td>'+ |
---|
577 | // '</tr>'+ |
---|
578 | '<tr>'+ |
---|
579 | '<td>'+messParamUnit+' * : </td>'+ |
---|
580 | '<td colspan="2">'+ |
---|
581 | '<select id="paramUnit_'+nbElem+'" name="metadata.contenuPrevu.params['+nbElem+'].unite">'+ |
---|
582 | '<option value="-">-</option>'+ |
---|
583 | listeUnits+ |
---|
584 | '</select>'+ |
---|
585 | ' '+messOth+' '+ |
---|
586 | '<input id="unitOth_'+nbElem+'" name="metadata.contenuPrevu.params['+nbElem+'].uniteOth" value="" type="text">'+ |
---|
587 | '</td>'+ |
---|
588 | '</tr>'+ |
---|
589 | '<tr>'+ |
---|
590 | '<td>'+messParamCapt+' * : </td>'+ |
---|
591 | '<td>'+ |
---|
592 | '<select id="paramCapt_'+nbElem+'" name="metadata.contenuPrevu.params['+nbElem+'].nomCapteur">'+ |
---|
593 | listeCapts+ |
---|
594 | '</select>'+ |
---|
595 | '</td>'+ |
---|
596 | '<td><input onclick="removeParam(\''+chemin+'\','+nbElem+')" value="'+messDelParam+'" type="button"></td>'+ |
---|
597 | '</tr>'+ |
---|
598 | '</tbody>'; |
---|
599 | tableCadre.appendChild(table); |
---|
600 | } |
---|
601 | } |
---|
602 | |
---|
603 | //Fonction permettant de supprimer un paramÚtre au jeu cÎté serveur |
---|
604 | function removeParam(chemin, indexParam) { |
---|
605 | var url = chemin+"/RemoveParam.do?num="+indexParam; |
---|
606 | xmlHttp = getXmlHttpObject(); |
---|
607 | if (xmlHttp == null) { |
---|
608 | alert ("Browser does not support HTTP Request"); |
---|
609 | return; |
---|
610 | } |
---|
611 | xmlHttp.onreadystatechange = new Function("removeParamClient("+indexParam+");"); |
---|
612 | xmlHttp.open("POST",url,true); |
---|
613 | xmlHttp.send(url); |
---|
614 | } |
---|
615 | |
---|
616 | //Fonction permettant de supprimer un paramÚtre au jeu cÎté client |
---|
617 | function removeParamClient(indexParam) { |
---|
618 | if(xmlHttp.readyState==4 || xmlHttp.readyState=='complete') { |
---|
619 | var tableCadre = document.getElementById('cadreParams'); |
---|
620 | var lignes = tableCadre.getElementsByTagName('table'); |
---|
621 | var nbElem = lignes.length; |
---|
622 | // On décale les valeurs intercalées |
---|
623 | for (var num = indexParam ; num < nbElem - 1 ; num++) { |
---|
624 | document.getElementById('paramNom_'+num).value = document.getElementById('paramNom_'+(num+1)).value; |
---|
625 | document.getElementById('paramNomOth_'+num).value = document.getElementById('paramNomOth_'+(num+1)).value; |
---|
626 | // document.getElementById('paramAb_'+num).value = document.getElementById('paramAb_'+(num+1)).value; |
---|
627 | document.getElementById('paramCat_'+num).value = document.getElementById('paramCat_'+(num+1)).value; |
---|
628 | document.getElementById('catOth_'+num).value = document.getElementById('catOth_'+(num+1)).value; |
---|
629 | document.getElementById('paramUnit_'+num).value = document.getElementById('paramUnit_'+(num+1)).value; |
---|
630 | document.getElementById('unitOth_'+num).value = document.getElementById('unitOth_'+(num+1)).value; |
---|
631 | document.getElementById('paramCapt_'+num).value = document.getElementById('paramCapt_'+(num+1)).value; |
---|
632 | } |
---|
633 | // On efface la ligne |
---|
634 | tableCadre.removeChild(lignes[lignes.length-1]); |
---|
635 | } |
---|
636 | } |
---|