allow multiple bitbang interfaces
[openocd/ztw.git] / src / server / httpd / preconfig.tcl
blob8308deb41119dfa447fae5f6af3e724d33b7f4be
1 # converted to .tcl by html2tcl.tcl
2 set buffer ""
3 append buffer {
10 <html xmlns="http://www.w3.org/TR/REC-html40">
11 <head>
12 <title>Zylin ZY1000 JTAG debugger</title>
13 <meta charset="utf-8" content="text/html" http-equiv="Content-Type"/>
14 <link type="text/css" rel="stylesheet" href="menuweb.css"/>
15 </head>
18 set console ""
19 set upload_filename /ram/upload
21 append buffer {
22 <body style="margin:0px;">
23 <div style="width:974px;height:85px;">
24 <div style="float:left;position:relative;left:32px;width:478px;">
25 <a href="/">
26 <img src="menu_cuts/logo_top.png" style="border:0px;"/>
27 </a>
28 </div>
29 <div style="float:left;position:relative;height:26px; width:278px;left:122px;background-image:url('menu_cuts/top_right.png');">
30 <div style="position:relative;left:15px;top:4px;" class="textlight">
32 append buffer [capture version]
33 append buffer {
34 </div>
35 </div>
36 </div>
37 <table style="padding:0px;border-collapse:collapse;">
38 <tr>
39 <td style="width:33px;">
40 <div style="width:20px;height:510px;">
41 &nbsp;
42 </div>
43 </td>
44 <td style="vertical-align:top;height:100%;width:140px;padding:0px;">
45 <table style="padding:0px;border-collapse:collapse;height:100%;width:140px;">
46 <tr style="height:59px;">
47 <td/>
48 </tr>
49 <tr>
50 <td style="width:140px;height:38px;background-image:url('menu_cuts/v_tab.png');background-repeat: no-repeat;">
51 <div style="position:relative;left:10px;top:10px;font-weight:bold;">
52 <a href="index.tcl" style="">Target Status</a>
53 </div>
54 </td>
55 </tr>
56 <tr>
57 <td style="width:140px;height:38px;background-image:url('menu_cuts/v_tab_selected.png');background-repeat: no-repeat;">
58 <div style="position:relative;left:10px;top:10px;font-weight:bold;">
59 <a href="preconfig.tcl" style="font-weight: bold;">Select Target Config</a>
60 </div>
61 </td>
62 </tr>
63 <tr>
64 <td style="width:140px;height:38px;background-image:url('menu_cuts/v_tab.png');background-repeat: no-repeat;">
65 <div style="position:relative;left:10px;top:10px;font-weight:bold;">
66 <a href="editconfigs.tcl" style="">Edit Configurations</a>
67 </div>
68 </td>
69 </tr>
70 <tr>
71 <td style="width:140px;height:38px;background-image:url('menu_cuts/v_tab.png');background-repeat: no-repeat;">
72 <div style="position:relative;left:10px;top:10px;font-weight:bold;">
73 <a href="reload.tcl" style="">Reload Config Scripts</a>
74 </div>
75 </td>
76 </tr>
77 <tr>
78 <td style="width:140px;height:35px;background-image:url('menu_cuts/v_1.png')"/>
79 </tr>
80 <tr>
81 <td style="width:140px;background-image:url('menu_cuts/v_2_tile.png')"/>
82 </tr>
83 <tr>
84 <td style="width:140px;height:140px;background-image:url('menu_cuts/v_3.png')"/>
85 </tr>
86 </table>
87 </td>
88 <td style="vertical-align:top;padding:0px;height:100%">
89 <table style="padding:0px;border-collapse:collapse;height:100%;">
90 <tr>
91 <td>
92 <table style="padding:0px;border-collapse:collapse;">
93 <tr>
94 <td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1_selected.png');background-repeat: no-repeat;">
95 <div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;">
96 <a href="index.tcl" style="font-weight: bold;">Config Target</a>
97 </div>
98 </td>
99 <td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1.png');background-repeat: no-repeat;">
100 <div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;">
101 <a href="flashinfo.tcl">Flash</a>
102 </div>
103 </td>
104 <td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1.png');background-repeat: no-repeat;">
105 <div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;">
106 <a href="browsemem.tcl">Memory</a>
107 </div>
108 </td>
109 <td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1.png');background-repeat: no-repeat;">
110 <div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;">
111 <a href="openocd.tcl">OpenOCD</a>
112 </div>
113 </td>
114 </tr>
115 </table>
116 </td>
117 </tr>
118 <tr>
119 <td style="height:30px;width:535px;background-image:url('menu_cuts/center_top.png');background-repeat: no-repeat;background-position:top right;" colspan="6">
120 <div style="width:500px;background-color:#ffffff;height:100%;">
121 &nbsp;
122 </div>
123 </td>
124 </tr>
125 <tr>
126 <td style="background-color:#ffffff;text-indent:30px;height:40px;" colspan="6">
127 <H1>Select Preconfigured Target</H1>
128 </td>
129 </tr>
130 <tr style="height:100%;">
131 <td style="background-color:#ffffff;padding-left:30px;padding-right:30px;width=535px;height:100%;" colspan="6">
136 set form_target [formfetch form_target]
137 set form_action [formfetch form_action]
139 append buffer {<form enctype="multipart/form-data" action="preconfig.tcl" method="post">}
140 if {[string compare $form_action "Select and reload"]==0} {
141 capture_catch "trunc /config/settings/openocd.cfg"
142 capture_catch "append_file /config/settings/openocd.cfg script target/$form_target"
143 reboot
146 set form_target [load_target]
148 set files [ls /rom/target]
149 set files [lunion $files [ls /config/settings/target]]
150 set files [lsort $files]
152 if {[string compare $form_action "Select and reload"]!=0} {
154 append buffer {
155 <table><tr>
156 <td style="padding-top:1px;">
157 <select name="form_target">
160 set foundTarget 0
161 foreach i $files {
162 if {[string match *.cfg $i]} {
164 append buffer {
165 <option
168 if {[string compare $form_target $i]==0} {
169 set foundTarget 1
170 append buffer {selected="selected"}
172 append buffer {
173 value="}
174 append buffer $i
175 append buffer {">}
176 append buffer $i
177 append buffer {</option>
183 if {$foundTarget==0} {
185 append buffer {
186 <option selected="selected" value="">Preconfigured target not active</option>
191 append buffer {
192 </select>
193 </td>
194 <td class="buttonspacesmall">&nbsp</td>
195 <td>
196 <input type="submit" name="form_action" value="Select and reload">
198 &nbsp;&nbsp;&nbsp;&nbsp;
199 <a href="editconfigs.tcl?form_action=Load&form_selected=}
200 append buffer "target/$form_target"
201 append buffer {">Edit target configuration</a>
202 </td>
203 </tr></table>
206 } else {
207 append buffer "Reloading setting(ca. 30 seconds)..."
210 append buffer {
212 </form>
214 </td>
215 </tr>
219 set toggle_details [formfetch toggle_details]
220 if {[string length $toggle_details]==0} {
221 set toggle_details 0
223 set show_details [load_var show_details]
224 if {[string length $show_details]==0} {
225 set show_details 0
227 if {$toggle_details==1} {
228 set show_details [expr 1-$show_details]
229 save_var show_details $show_details
232 if {[string length $console]!=0} {
234 append buffer {
235 <tr style="height:100%;">
236 <td style="height:100%;background-color:red;" colspan="6">
237 <table style="padding:0px;border-collapse:collapse;background-color:#ffffff;width:100%" class="textgray">
238 <td style="width:25px;">&nbsp;</td>
241 if {$show_details==1} {
242 append buffer <
243 append buffer {td style="background-color:#dddddd;padding-left:5px;padding-right:5px;padding-top:3px;padding-bottom:3px;"}
244 append buffer >
245 } else {
246 append buffer <
247 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;"}
248 append buffer >
251 append buffer {
252 <a class="openocd" href="preconfig.tcl?toggle_details=1">
255 if {$show_details==1} {
256 append buffer "Hide details"
257 append buffer <br/>
258 } else {
259 append buffer {<div style="position:relative;top:7px;text-align:center;">}
260 append buffer "Show details"
261 append buffer {</div>}
264 append buffer {
265 </a>
268 if {$show_details==1} {
269 append buffer $console
272 append buffer {</td>}
274 if {$show_details!=1} {
275 append buffer {<td>&nbsp;</td>}
278 append buffer {
279 <td style="width:25px;">&nbsp;</td>
280 </table>
281 </td>
282 </tr>
287 append buffer {
288 <tr>
289 <td style="height:30px;background-image:url('menu_cuts/center_bottom.png');background-repeat: no-repeat;background-position:top right;" colspan="6">
290 <div style="width:500px;background-color:#ffffff;height:100%;">
291 &nbsp;
292 </div>
293 </td>
294 </tr>
295 </table>
296 </td>
297 <td style="width:6px;"/>
298 <td style="width:245px;height:100%">
299 <table style="padding:0px;border-collapse:collapse;height:100%;">
300 <tr>
301 <td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab2_selected.png');background-repeat: no-repeat;">
302 <div style="position:relative;top:7px;;font-weight:bold;text-align:center;width:100px;" class="textgray">
303 Documentation
304 </div>
305 </td>
306 <td width="40px">
307 &nbsp;
308 </td>
309 <td/>
310 </tr>
311 <tr>
312 <td style="height:10px;width:245px;background-image:url('menu_cuts/right_top_small.png');" colspan="3"/>
313 </tr>
314 <tr>
315 <td style="background-color:#d8d7d7;width:245px;padding-left:10px;padding-buttom:10px;line-height:17px;" colspan="3">
316 <a target="_blank" href="http://www.zylin.com/zy1000/ZY1000_Quick_Start_Guide.pdf">Quick Start Manual</a>
317 <br/>
318 <a target="_blank" href="http://www.zylin.com/zy1000/openocd.pdf">OpenOCD Manual</a>
319 <br/>
320 <a target="_blank" href="http://www.zylin.com/zy1000_contact.html">Contact Zylin AS</a>
321 </td>
322 </tr>
323 <tr>
324 <td style="background-color:#d8d7d7;height:15px;" colspan="3"/>
325 </tr>
326 <tr>
327 <td colspan="3">
328 <table style="padding:0px;border-collapse:collapse;">
329 <td style="background-color:#d8d7d7;width:10px;height:1px"/>
330 <td style="background-color:#999999;width:225px; height:1px;"/>
331 <td style="background-color:#d8d7d7;width:10px;height:1px"/>
332 </table>
333 </td>
334 </tr>
335 <tr>
336 <td style="background-color:#d8d7d7;height:15px;" colspan="3"/>
337 </tr>
338 <tr style="height:100%;">
339 <td style="height:100%;background-color:#d8d7d7;padding-left:10px;padding-right:10px;" colspan="3" class="textgray">
341 <p>ZY1000 comes with complete configurations for various targets.</p>
342 <p>These predefined configurations include reset init scripts and flash configuration.</p>
343 <p><b>Select and reload</b> - Select configuration and reboot ZY1000 unit.</p>
345 </td>
346 </tr>
347 <tr>
348 <td style="height:30px;background-image:url('menu_cuts/right_bottom.png');" colspan="3">
349 &nbsp;
350 </td>
351 </tr>
352 </table>
353 </td>
354 </tr>
355 <tr>
356 <td/>
357 <td>
358 <img border="0" src="menu_cuts/logo_bottom.png"/>
359 </td>
360 </tr>
361 </table>
362 </body>
363 </html>
426 start_chunked "html"
427 write_chunked $buffer
428 end_chunked