<?php
$stato_robot="";
$dato=0;
$motore="";
$dt=0;
$fr=500000;
//echo $robot;
if (!isset($_COOKIE["robot"])) {
die ("Non hai i permessi giusti");
}
$volte=0;
$volte=$_POST[nciclo];
$volte=$volte*1000;
$carica=1;
system("lptout 0 200");
$stato_robot="--";
for ($i=0; $i < sizeof($HTTP_POST_VARS['valore']); $i++)
{
//echo $stato_robot;
//echo $valore[$i];
$dt=$HTTP_POST_VARS['valore'][$i];
//echo $dt;
//$dato=$dato+$HTTP_POST_VARS['valore'][$i];
$dato=$dato+$dt;
if ($dt==4 ) {
$motore="1 ";
}
if ($dt==8 ) {
$motore="2 ";
}
if ($dt==16 ) {
$motore="3 ";
}
if ($dt==32 ) {
$motore="4 ";
}
if ($dt==64 ) {
$motore="5 ";
}
if ($dt==128 ) {
$motore="6 ";
}
$stato_robot=$stato_robot."motore ".$motore ;
}
$movimento=$HTTP_POST_VARS['avanti'];
//echo $movimento;
$dato=$dato+$movimento;
//echo $dato;
$invio="lptout ".$dato." ".$volte;
}
if (isset($_POST['spegni']))
{
system("lptout 0 200");
//system("lptout 0");
$volte==0;
$stato_robot="braccio disattivo";
}
?>
<HTML>
<HEAD><TITLE>Robotic controls</TITLE>
<style type="text/css">
.iframe{
position:absolute;
left:400px;
z-index:1;
top: 150px;
}
link {
color: #FF0000;
text-decoration: none;
}
a:link {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-weight: bold;
color: #FFCC00;
text-decoration: none;
}
</style>
<style type="text/css">
<!--
body {
background-color: #C0C0C0;
}
#Layer1 {
position:absolute;
width:569px;
height:389px;
z-index:1;
left: 350px;
top: 165px;
visibility: hidden;
background-color: #666666;
}
.style8 {font-family: Verdana, Arial, Helvetica, sans-serif}
#mano {
position:absolute;
width:176px;
height:219px;
z-index:2;
left: 214px;
top: 49px;
visibility: hidden;
}
#polso {
position:absolute;
width:200px;
height:115px;
z-index:3;
left: 100px;
top: 267px;
visibility: hidden;
}
#avan {
position:absolute;
width:200px;
height:115px;
z-index:4;
left: 35px;
top: 262px;
visibility: hidden;
}
#braccio {
position:absolute;
width:338px;
height:171px;
z-index:5;
left: 24px;
top: 265px;
visibility: hidden;
}
#braccio2 {
position:absolute;
width:200px;
height:115px;
z-index:6;
left: 212px;
top: 50px;
visibility: hidden;
}
#base {
position:absolute;
width:200px;
height:115px;
z-index:7;
left: 211px;
top: 51px;
visibility: hidden;
}
.style9 {color: #FF0000}
.style10 {
font-family: Verdana, Arial, Helvetica, sans-serif;
color: #FF0000;
font-weight: bold;
}
.style11 {font-family: Verdana, Arial, Helvetica, sans-serif; color: #00FF00; }
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_showHideLayers() { //v6.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
obj.visibility=v; }
}
//-->
</script>
</HEAD>
<BODY>
<div id="mano"><img src="mano.jpg" width="200" height="309"></div>
<div id="polso"><img src="polso.jpg" width="262" height="200"></div>
<div id="avan"><img src="avanbraccio.jpg" width="379" height="200"></div>
<div id="braccio"><img src="braccio.jpg" width="393" height="200"></div>
<div id="braccio2"><img src="braccio2.jpg" width="200" height="255"></div>
<div id="base"><img src="base.jpg" width="200" height="255"></div>
<table width="424" border="0" align="left" background="sfondorobot1.jpg" bgcolor="#CCCCCC">
<form action="<?php echo $_SERVER['PHP_SELF'];?>" method="POST">
<!--<form method=post action= > -->
<tr>
<td colspan="3" align="center"><input type="submit" name="spegni" value="spegni braccio"></td>
</tr>
<tr>
<td width="19%"><div align="center" class="style9"><span class="style8"><a href="#" onMouseOver="MM_showHideLayers('mano','','show','polso','','hide','avan','','hide','braccio','','hide','braccio2','','hide','base','','hide')" onMouseOut="MM_showHideLayers('mano','','hide','polso','','hide','avan','','hide','braccio','','hide','braccio2','','hide','base','','hide')">Motore 1</a> </span></div></td>
<td colspan="2" align="center" valign="middle"><div align="center">
<input type="checkbox" name="valore[]" value="4">
</div></td>
</tr>
<tr>
<td><div align="center" class="style9"><span class="style8"><a href="#" onMouseOver="MM_showHideLayers('mano','','hide','polso','','show','avan','','hide','braccio','','hide','braccio2','','hide','base','','hide')" onMouseOut="MM_showHideLayers('mano','','hide','polso','','hide','avan','','hide','braccio','','hide','braccio2','','hide','base','','hide')">Motore 2 </a></span></div></td>
<td colspan="2" align="center" valign="middle"><div align="center">
<input type="checkbox" name="valore[]" value="8">
</div></td>
</tr>
<tr>
<td><div align="center" class="style9"><span class="style8"><a href="#" onMouseOver="MM_showHideLayers('mano','','hide','polso','','hide','avan','','show','braccio','','hide','braccio2','','hide','base','','hide')" onMouseOut="MM_showHideLayers('mano','','hide','polso','','hide','avan','','hide','braccio','','hide','braccio2','','hide','base','','hide')">Motore 3</a> </span></div></td>
<td colspan="2" align="center" valign="middle">
<div align="center">
<input type="checkbox" name="valore[]" value="16">
</div> </td>
</tr>
<tr>
<td><div align="center" class="style9"><span class="style8"><a href="#" onMouseOver="MM_showHideLayers('mano','','hide','polso','','hide','avan','','hide','braccio','','show','braccio2','','hide','base','','hide')" onMouseOut="MM_showHideLayers('mano','','hide','polso','','hide','avan','','hide','braccio','','hide','braccio2','','hide','base','','hide')">Motore 4 </a></span></div></td>
<td colspan="2" align="center" valign="middle">
<div align="center">
<input type="checkbox" name="valore[]" value="32">
</div> </td>
</tr>
<tr>
<td><div align="center" class="style9"><span class="style8"><a href="#" onMouseOver="MM_showHideLayers('mano','','hide','polso','','hide','avan','','hide','braccio','','hide','braccio2','','show','base','','hide')" onMouseOut="MM_showHideLayers('mano','','hide','polso','','hide','avan','','hide','braccio','','hide','braccio2','','hide','base','','hide')">Motore 5</a> </span></div></td>
<td colspan="2" align="center" valign="middle">
<div align="center">
<input type="checkbox" name="valore[]" value="64">
</div> </td>
</tr>
<tr>
<td height="26" valign="top"><div align="center" class="style9"><span class="style8"><a href="#" onMouseOver="MM_showHideLayers('mano','','hide','polso','','hide','avan','','hide','braccio','','hide','braccio2','','hide','base','','show')" onMouseOut="MM_showHideLayers('mano','','hide','polso','','hide','avan','','hide','braccio','','hide','braccio2','','hide','base','','hide')">Motore 6</a> </span></div>
<td colspan="2" align="center" valign="top">
<input type="checkbox" name="valore[]" value="128">
<div align="center">
<input type="hidden" name="carica" value="1"></td>
</tr>
<tr>
<td height="25" align="center" valign="top"><span class="style10">Avanti/indietro </span>
<td colspan="2" align="center" valign="top"><input name="avanti" type="radio" value="1" checked>
<input name="avanti" type="radio" value="2"></td>
</tr>
<tr>
<td height="28" colspan="3" align="center" valign="top"><span class="style11">Numero impulsi</span>
<input name="nciclo" type="text" id="nciclo" value="20" size="3">
<span class="style8">(*1000) </span></tr>
<tr>
<td height="28" colspan="3" align="center" valign="top"><input name="submit" type=submit value=Select> </tr>
<tr>
<td rowspan="2" align="center" valign="middle" bgcolor="#FF0000"> <div align="center" class="style8">
<h2><strong>Stato</strong></h2>
</div>
<td height="68" colspan="2" align="center" valign="middle" bgcolor="#FF0000"><span class="style8"><?php echo $stato_robot; ?></span></td>
</tr>
<tr>
<td width="7%" height="105" align="center" valign="middle" bgcolor="#FF0000"><h2> </h2>
<p><?php echo "dato inviato:".$dato; ?></p><p> </p></td>
<td width="13%" align="center" valign="middle" bgcolor="#FF0000"><?php echo "impulsi:".$volte; ?></td>
</tr>
</form>
</table>
<p> </p>
</body></html>
|