Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- #NAME: External I/O
- #DESCRIPTION: Control external I/O via the web interface.
- HOME="../plugin.cgi"
- . /webs/cgi-bin/login.cgi
- if [ "$action" == "3" ]; then
- echo "$stateK1" >/dev/extout0
- echo "$stateK2" >/dev/extout1
- fi
- iK1=`cat /dev/extout0`
- iK2=`cat /dev/extout1`
- iPC1=`cat /dev/extin0`
- cat << EOF_HTML
- Content-type: text/html
- Connection: close
- <html>
- <head>
- <script language="JavaScript" src="../../js_fade.txt" type="text/JavaScript"></script>
- <script language="JavaScript" src="../../js_menu.txt" type="text/JavaScript"></script>
- <link rel="stylesheet" href="../../style.css" type="text/css" />
- <!--[if IE]><style type="text/css">@import url(../../ie.css);</style><![endif]-->
- <script type="text/JavaScript">
- var iK1 = $iK1;
- var iK2 = $iK2;
- var iPC1 = $iPC1;
- function chk()
- {
- document.xform.stateK1[1 - iK1].checked = true;
- document.xform.stateK2[1 - iK2].checked = true;
- document.xform.statePC1[1 - iPC1].checked = true;
- }
- </script>
- </head>
- <body onload="chk();">
- <div id="c_border">
- <div id="c_pfad">Plugins / External I/O</div>
- <div id="c_titel">External I/O</div>
- <form id="xform" name="xform" method="post">
- <input id="action" type="hidden" name="action" value="0">
- <div id="c_std">
- <table border="0" cellpaddig="0" cellspacing="2">
- <tr onmouseover="i_showElem(1);" onmouseout="i_showElem(0);" >
- <td width="120">Relay K1:</td>
- <td width="20"><input id="stateK1" type="radio" name="stateK1" value="1"></td>
- <td width="40">On</td>
- <td width="20"><input id="stateK1" type="radio" name="stateK1" value="0"></td>
- <td width="40">Off</td>
- </tr>
- </table>
- </div>
- <div id="c_std">
- <table border="0" cellpaddig="0" cellspacing="2">
- <tr onmouseover="i_showElem(2);" onmouseout="i_showElem(0);" >
- <td width="120">Relay K2:</td>
- <td width="20"><input id="stateK2" type="radio" name="stateK2" value="1"></td>
- <td width="40">On</td>
- <td width="20"><input id="stateK2" type="radio" name="stateK2" value="0"></td>
- <td width="40">Off</td>
- </tr>
- </table>
- </div>
- <div id="c_std">
- <table border="0" cellpaddig="0" cellspacing="2">
- <tr onmouseover="i_showElem(3);" onmouseout="i_showElem(0);" >
- <td width="120">Photocoupler PC1:</td>
- <td width="20"><input id="statePC1" type="radio" name="statePC1" value="1" disabled="disabled"></td>
- <td width="40">On</td>
- <td width="20"><input id="statePC1" type="radio" name="statePC1" value="0" disabled="disabled"></td>
- <td width="40">Off</td>
- </tr>
- </table>
- </div>
- </form>
- <div id="c_leer"></div>
- <div id="c_foot"></div>
- </div>
- <div id="c_verzoeg1"></div>
- <div id="c_verzoeg2"></div>
- </div>
- <div id="t_Frame">
- <div id="t_but1" onclick='window.location.href="$HOME";' onmouseover="rahmen(1,1);" onmouseout="rahmen(0,1);">Back <<</div>
- <div id="t_but4" onclick="subm(3);" onmouseover="rahmen(1,4);" onmouseout="rahmen(0,4);">Run <<</div>
- </div>
- <div id="i_Frame">
- <div id="i_content">
- <h2>External I/O</h2>
- <p>Control external I/O.</p>
- </div>
- <div id="i_content1">
- <h2>External I/O</h2>
- <p><b>Relay K1</b></p>
- <p>Set the state of K1 to On (activated) or Off (inactive).</p>
- </div>
- <div id="i_content2">
- <h2>External I/O</h2>
- <p><b>Relay K2</b></p>
- <p>Set the state of K2 to On (activated) or Off (inactive).</p>
- </div>
- <div id="i_content3">
- <h2>External I/O</h2>
- <p><b>Photocoupler PC1</b></p>
- <p>Shows the state of PC1, either On (activated) or Off (inactive).</p>
- </div>
- </body>
- </html>
- EOF_HTML
- a=0
- # EoF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement