httpd wip
[fw/openocd] / src / server / httpd / production.tcl
1 # converted to .tcl by html2tcl.tcl\r
2 set buffer ""\r
3 append buffer {\r
4         \r
5         \r
6 \r
7                 \r
8                 \r
9                 \r
10 \r
11 \r
12                 \r
13 \r
14 \r
15 \r
16                 \r
17 \r
18                 \r
19                 \r
20 \r
21                 \r
22 \r
23 \r
24 \r
25 \r
26                 <html xmlns="http://www.w3.org/TR/REC-html40">\r
27 <head>\r
28 <title>OpenOCD debugger</title>\r
29 <meta charset="utf-8" content="text/html" http-equiv="Content-Type"/>\r
30 <link type="text/css" rel="stylesheet" href="menuweb.css"/>\r
31 </head>\r
32 }\r
33 \r
34                                 set console ""\r
35                                 set upload_filename /ram/upload\r
36                         \r
37 append buffer {\r
38 <body style="margin:0px;">\r
39 <div style="width:974px;height:85px;">\r
40 <div style="float:left;position:relative;left:32px;width:478px;">\r
41 <a href="/">\r
42                                                         OpenOCD\r
43                                                 </a>\r
44 </div>\r
45 <div style="float:left;position:relative;height:26px; width:278px;left:122px;background-image:url('menu_cuts/top_right.png');">\r
46 <div style="position:relative;left:15px;top:4px;" class="textlight">\r
47 }\r
48 append buffer [capture version]\r
49 append buffer {\r
50 </div>\r
51 </div>\r
52 </div>\r
53 <table style="padding:0px;border-collapse:collapse;">\r
54 <tr>\r
55 <td style="width:33px;">\r
56 <div style="width:20px;height:510px;">\r
57                                                                 &nbsp;\r
58                                                         </div>\r
59 </td>\r
60 <td style="vertical-align:top;height:100%;width:140px;padding:0px;">\r
61 <table style="padding:0px;border-collapse:collapse;height:100%;width:140px;">\r
62 <tr style="height:59px;">\r
63 <td/>\r
64 </tr>\r
65 <tr>\r
66 <td style="width:140px;height:38px;background-image:url('menu_cuts/v_tab.png');background-repeat: no-repeat;">\r
67 <div style="position:relative;left:10px;top:10px;font-weight:bold;">\r
68 <a href="flashinfo.tcl" style="">Info</a>\r
69 </div>\r
70 </td>\r
71 </tr>\r
72 <tr>\r
73 <td style="width:140px;height:38px;background-image:url('menu_cuts/v_tab.png');background-repeat: no-repeat;">\r
74 <div style="position:relative;left:10px;top:10px;font-weight:bold;">\r
75 <a href="erase.tcl" style="">Erase</a>\r
76 </div>\r
77 </td>\r
78 </tr>\r
79 <tr>\r
80 <td style="width:140px;height:38px;background-image:url('menu_cuts/v_tab.png');background-repeat: no-repeat;">\r
81 <div style="position:relative;left:10px;top:10px;font-weight:bold;">\r
82 <a href="flash.tcl" style="">Program / Verify</a>\r
83 </div>\r
84 </td>\r
85 </tr>\r
86 <tr>\r
87 <td style="width:140px;height:38px;background-image:url('menu_cuts/v_tab_selected.png');background-repeat: no-repeat;">\r
88 <div style="position:relative;left:10px;top:10px;font-weight:bold;">\r
89 <a href="production.tcl" style="font-weight: bold;">Production</a>\r
90 </div>\r
91 </td>\r
92 </tr>\r
93 <tr>\r
94 <td style="width:140px;height:35px;background-image:url('menu_cuts/v_1.png')"/>\r
95 </tr>\r
96 <tr>\r
97 <td style="width:140px;background-image:url('menu_cuts/v_2_tile.png')"/>\r
98 </tr>\r
99 <tr>\r
100 <td style="width:140px;height:140px;background-image:url('menu_cuts/v_3.png')"/>\r
101 </tr>\r
102 </table>\r
103 </td>\r
104 <td style="vertical-align:top;padding:0px;height:100%">\r
105 <table style="padding:0px;border-collapse:collapse;height:100%;">\r
106 <tr>\r
107 <td>\r
108 <table style="padding:0px;border-collapse:collapse;">\r
109 <tr>\r
110 <td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1.png');background-repeat: no-repeat;">\r
111 <div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;">\r
112 <a href="index.tcl">Config Target</a>\r
113 </div>\r
114 </td>\r
115 <td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1_selected.png');background-repeat: no-repeat;">\r
116 <div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;">\r
117 <a href="flashinfo.tcl" style="font-weight: bold;">Flash</a>\r
118 </div>\r
119 </td>\r
120 <td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1.png');background-repeat: no-repeat;">\r
121 <div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;">\r
122 <a href="browsemem.tcl">Memory</a>\r
123 </div>\r
124 </td>\r
125 <td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1.png');background-repeat: no-repeat;">\r
126 <div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;">\r
127 <a href="openocd.tcl">OpenOCD</a>\r
128 </div>\r
129 </td>\r
130 </tr>\r
131 </table>\r
132 </td>\r
133 </tr>\r
134 <tr>\r
135 <td style="height:30px;width:535px;background-image:url('menu_cuts/center_top.png');background-repeat: no-repeat;background-position:top right;" colspan="6">\r
136 <div style="width:500px;background-color:#ffffff;height:100%;">\r
137                                                                                         &nbsp;\r
138                                                                                 </div>\r
139 </td>\r
140 </tr>\r
141 <tr>\r
142 <td style="background-color:#ffffff;text-indent:30px;height:40px;" colspan="6">\r
143 <H1>Production</H1>\r
144 </td>\r
145 </tr>\r
146 <tr style="height:100%;">\r
147 <td style="background-color:#ffffff;padding-left:30px;padding-right:30px;width=535px;height:100%;" colspan="6">\r
148                         }\r
149 \r
150                                 set form_action [formfetch form_action]\r
151                                 set form_serialnumber [formfetch form_serialnumber]\r
152                                 append buffer [production_info]\r
153                         \r
154 append buffer {\r
155                                 \r
156                         <form enctype="multipart/form-data" action="production.tcl" method="post">\r
157                                 <code style="white-space: nowrap;">\r
158                                         }\r
159         \r
160                                                 if {[string compare $form_action "Upload firmware"]==0} {\r
161                                                         set wrotedata [catch {writeform form_filecontent $upload_filename} result]  \r
162                                                         append buffer [encode $result]\r
163                                                         if {$wrotedata==0} {\r
164                                                                 append buffer "<br>Running production procedure<p>"\r
165                                                                 append buffer "<br>Reset and init: <br>"\r
166                                                                 \r
167                                                                 append console [encode [capture_catch {catch "production $upload_filename $form_serialnumber"}]]\r
168                                                         }\r
169                                                 }\r
170                                                 if {[string compare $form_action "Test"]==0} {\r
171                                                         append buffer "<br>Running production test. Output from first 10 seconds printed below. <p>"\r
172                                                         \r
173                                                         append console [encode [capture_catch {catch production_test}]]\r
174                                                 }\r
175                                                 if {[string compare $form_action "Power on"]==0} {\r
176                                                         append console [encode [capture_catch "power on"]]\r
177                                                 }\r
178                                                 if {[string compare $form_action "Power off"]==0} {\r
179                                                         append console [encode [capture_catch "power off"]]\r
180                                                 }\r
181                                         \r
182 append buffer {\r
183                                 </code>\r
184                                 }\r
185 \r
186                                         append buffer {<p class="formtext">Firmware file(raw binary) <input type="file" name="form_filecontent"><p>}\r
187                                         append buffer {<p class="formtext">Serial number <input type="text" name="form_serialnumber"><p>}\r
188                                 \r
189 append buffer {\r
190                                 \r
191                                 <table>\r
192                                         <tr><td style="height:15px;width:535px;">&nbsp</td></tr>\r
193                                         <tr><td style="height:1px;width:535px;background-color:#a2c5d1;"></td></tr>\r
194                                         <tr><td style="height:15px;width:535px;">&nbsp</td></tr>\r
195                                 </table>\r
196                         \r
197                                 <table><tr>\r
198                                         <td><input type="submit" name="form_action" value="Upload firmware" ></td>\r
199                                         <td class="buttonspacesmall">&nbsp</td><td><input type="submit" name="form_action" value="Test"></td>\r
200                                         <td class="buttonspacesmall">&nbsp</td><td><input type="submit" name="form_action" value="Power on"></td>\r
201                                         <td class="buttonspacesmall">&nbsp</td><td><input type="submit" name="form_action" value="Power off">\r
202                                 </tr></table>\r
203                         </form>\r
204                         \r
205                         </td>\r
206 </tr>\r
207 }\r
208 \r
209                                                                         \r
210                                                                         set toggle_details [formfetch toggle_details]\r
211                                                                         if {[string length $toggle_details]==0} {\r
212                                                                                 set toggle_details 0\r
213                                                                         }\r
214                                                                         set show_details [load_var show_details]\r
215                                                                         if {[string length $show_details]==0} {\r
216                                                                                 set show_details 0\r
217                                                                         }\r
218                                                                         if {$toggle_details==1} {\r
219                                                                                 set show_details [expr 1-$show_details]\r
220                                                                                 save_var show_details $show_details\r
221                                                                         }\r
222                                                                         \r
223                                                                         if {[string length $console]!=0} {\r
224                                                                                 \r
225 append buffer {\r
226 <tr style="height:100%;">\r
227 <td style="height:100%;background-color:red;" colspan="6">\r
228 <table style="padding:0px;border-collapse:collapse;background-color:#ffffff;width:100%" class="textgray">\r
229 <td style="width:25px;">&nbsp;</td>\r
230 }\r
231 \r
232                                                                                                                 if {$show_details==1} {\r
233                                                                                                                         append buffer <\r
234                                                                                                                         append buffer {td style="background-color:#dddddd;padding-left:5px;padding-right:5px;padding-top:3px;padding-bottom:3px;"}\r
235                                                                                                                         append buffer >\r
236                                                                                                                 } else {\r
237                                                                                                                         append buffer <\r
238                                                                                                                         append buffer {td style="background-image:url('menu_cuts/h_tab_free.png');width:110px;height:29px;background-repeat: no-repeat;background-position:top left;"}\r
239                                                                                                                         append buffer >\r
240                                                                                                                 }\r
241                                                                                                         \r
242 append buffer {\r
243 <a class="openocd" href="production.tcl?toggle_details=1">\r
244 }\r
245 \r
246                                                                                                                         if {$show_details==1} {\r
247                                                                                                                                 append buffer "Hide details"\r
248                                                                                                                                 append buffer <br/>\r
249                                                                                                                         } else {\r
250                                                                                                                                 append buffer {<div style="position:relative;top:7px;text-align:center;">}\r
251                                                                                                                                 append buffer "Show details"\r
252                                                                                                                                 append buffer {</div>}\r
253                                                                                                                         }\r
254                                                                                                                         \r
255 append buffer {\r
256 </a>\r
257 }\r
258 \r
259                                                                                                                         if {$show_details==1} {\r
260                                                                                                                                 append buffer $console\r
261                                                                                                                         }\r
262                                                                                                                 \r
263 append buffer {</td>}\r
264 \r
265                                                                                                                 if {$show_details!=1} {\r
266                                                                                                                         append buffer {<td>&nbsp;</td>}\r
267                                                                                                                 }\r
268                                                                                                          \r
269 append buffer {\r
270 <td style="width:25px;">&nbsp;</td>\r
271 </table>\r
272 </td>\r
273 </tr>\r
274 }\r
275 \r
276                                                                          }\r
277                                                                 \r
278 append buffer {\r
279 <tr>\r
280 <td style="height:30px;background-image:url('menu_cuts/center_bottom.png');background-repeat: no-repeat;background-position:top right;" colspan="6">\r
281 <div style="width:500px;background-color:#ffffff;height:100%;">\r
282                                                                                         &nbsp;\r
283                                                                                 </div>\r
284 </td>\r
285 </tr>\r
286 </table>\r
287 </td>\r
288 <td style="width:6px;"/>\r
289 <td style="width:245px;height:100%">\r
290 <table style="padding:0px;border-collapse:collapse;height:100%;">\r
291 <tr>\r
292 <td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab2_selected.png');background-repeat: no-repeat;">\r
293 <div style="position:relative;top:7px;;font-weight:bold;text-align:center;width:100px;" class="textgray">\r
294                                                                                     Documentation\r
295                                                                                  </div>\r
296 </td>\r
297 <td width="40px">\r
298                                                                                 &nbsp;\r
299                                                                         </td>\r
300 <td/>\r
301 </tr>\r
302 <tr>\r
303 <td style="height:10px;width:245px;background-image:url('menu_cuts/right_top_small.png');" colspan="3"/>\r
304 </tr>\r
305 <tr>\r
306 <td style="background-color:#d8d7d7;width:245px;padding-left:10px;padding-buttom:10px;line-height:17px;" colspan="3">\r
307 <a target="_blank" href="http://openocd.berlios.de/doc/openocd.pdf">OpenOCD Manual</a>\r
308 <br/>\r
309 </td>\r
310 </tr>\r
311 <tr>\r
312 <td style="background-color:#d8d7d7;height:15px;" colspan="3"/>\r
313 </tr>\r
314 <tr>\r
315 <td colspan="3">\r
316 <table style="padding:0px;border-collapse:collapse;">\r
317 <td style="background-color:#d8d7d7;width:10px;height:1px"/>\r
318 <td style="background-color:#999999;width:225px; height:1px;"/>\r
319 <td style="background-color:#d8d7d7;width:10px;height:1px"/>\r
320 </table>\r
321 </td>\r
322 </tr>\r
323 <tr>\r
324 <td style="background-color:#d8d7d7;height:15px;" colspan="3"/>\r
325 </tr>\r
326 <tr style="height:100%;">\r
327 <td style="height:100%;background-color:#d8d7d7;padding-left:10px;padding-right:10px;" colspan="3" class="textgray">\r
328                                 \r
329                                 The target script can implement the "production", "production_info" and "production_test" tcl proc's. These procedures\r
330                                 are used on this page. There are default implementations that do nothing.\r
331                                 \r
332                                 <p><b>Upload firmware</b> - Power cycle target, reset target and program raw binary file to flash bank 0, offset 0 and verify flash programming. Leave target powered on.</p>\r
333                                 <p><b>Test</b> -  Power up target, run 10 second target test. Output is provided via the DCC output channel. </p>\r
334                                 <p><b>Power on</b> - Power on target.</p>\r
335                                 <p><b>Power off</b> - Power off target.</p>\r
336                                 <p><b>Serial number</b> - A target script can use this string in the production procedure. Type "help production" for more info.</p>\r
337                                          \r
338                         </td>\r
339 </tr>\r
340 <tr>\r
341 <td style="height:30px;background-image:url('menu_cuts/right_bottom.png');" colspan="3">\r
342                                                                                 &nbsp;\r
343                                                                         </td>\r
344 </tr>\r
345 </table>\r
346 </td>\r
347 </tr>\r
348 </table>\r
349 </body>\r
350 </html>\r
351 \r
352 \r
353 \r
354                 \r
355 \r
356 \r
357                 \r
358 \r
359 \r
360                 \r
361 \r
362                 \r
363 \r
364 \r
365                 \r
366 \r
367 \r
368 \r
369                 \r
370 \r
371                 \r
372                 \r
373                 \r
374                 \r
375 \r
376 \r
377                 \r
378 \r
379 \r
380                 \r
381 \r
382 \r
383                 \r
384 \r
385 \r
386                 \r
387         \r
388         \r
389 }\r
390 \r
391 start_chunked "html"\r
392 write_chunked $buffer\r
393 end_chunked\r
394 \r