Показать сообщение отдельно
  #9 (permalink)  
Старый 25.05.2012, 13:13
Интересующийся
Отправить личное сообщение для berkut Посмотреть профиль Найти все сообщения от berkut
 
Регистрация: 11.05.2012
Сообщений: 28

вот веб морда целиком
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>OR-WIFI-ROBOT</title>
<link rel="stylesheet" type="text/css" href="res/main.css"/>
<script type="text/javascript">
var lastTurn = -1;
var lastPress = -1;
var lastPos = -1;

function submitUART(uartString)
{
document.getElementById('serialData').value=uartSt ring+"\n";
document.getElementById('serialForm').submit()
};

function scrollCam(val)
{
document.getElementById("scr").parentNode.scrollLe ft=val;
};

function keyPressed(e)
{
var keynum
var keychar
var numcheck

if(window.event) // IE
{
keynum = e.keyCode
}
else if(e.which) // Netscape/Firefox/Opera
{
keynum = e.which
}
keychar = String.fromCharCode(keynum);
if(keychar == "w" || keychar == "ц" || keychar == "W" || keychar == "Ц") submitUART("DrvLR=100,100");
if(keychar == "a" || keychar == "ф" || keychar == "A" || keychar == "Ф") submitUART("DrvLR=-100,100");
if(keychar == "s" || keychar == "ы" || keychar == "S" || keychar == "Ы") submitUART("DrvLR=-100,-100");
if(keychar == "d" || keychar == "в" || keychar == "D" || keychar == "В") submitUART("DrvLR=100,-100");
return true;
};

function keyUp(e)
{
var keynum
var keychar
var numcheck

if(window.event) // IE
{
keynum = e.keyCode
}
else if(e.which) // Netscape/Firefox/Opera
{
keynum = e.which
}
keychar = String.fromCharCode(keynum);
if(keychar == "w" || keychar == "ц" || keychar == "W" || keychar == "Ц") submitUART("DrvLR=0,0");
if(keychar == "a" || keychar == "ф" || keychar == "A" || keychar == "Ф") submitUART("DrvLR=0,0");
if(keychar == "s" || keychar == "ы" || keychar == "S" || keychar == "Ы") submitUART("DrvLR=0,0");
if(keychar == "d" || keychar == "в" || keychar == "D" || keychar == "В") submitUART("DrvLR=0,0");
return true;
};

window.setInterval(
function(){
var pos = document.getElementById("scr").parentNode.scrollLe ft;
if(lastPos!=pos){
submitUART("#9 P" +(pos + 700));
lastPos=pos;
};
},100
);

</script>
</head>
<body onKeyPress="return keyPressed(event)" onKeyUp="keyUp(event)">
<pre class="banner">
************************************************** ******************************************
* ____ ____ __ __ _ *
* / __ \____ ___ ____ / __ \____ / /_ ____ / /_(_)__________ _______ __ *
* / / / / __ \/ _ \/ __ \______/ /_/ / __ \/ __ \/ __ \/ __/ // ___/ ___/ / ___/ / / / *
* / /_/ / /_/ / __/ / / /_____/ _, _/ /_/ / /_/ / /_/ / /_/ // /__(__ )_ / / / /_/ / *
* \____/ .___/\___/_/ /_/ /_/ |_|\____/_.___/\____/\__/_/ \___/____/(_)_/ \__,_/ *
* /_/ *
* *
************************************************** ******************************************
</pre>
<table>

<tr>
<td>
<script type="text/javascript">
document.write("<img alt='Robot Eye' class='bot-eye' src='http://" + document.location.host + ":8080/?action=stream'/>")
</script>
<br/>
Camera control:<br>
<button type="button" onclick="scrollCam(0)">Left</button>
<button type="button" onclick="scrollCam(800)">Center</button>
<button type="button" onclick="scrollCam(1600)">Right</button>
<br/>
<div style="width:320px;height: 20px;margin-top: 15px;overflow-x: scroll;display: inline-block;"
onscroll="scrollCam(this.scrollLeft)">
<div id="scr" style="width:1920px;height: 1px;display: block;" ></div>
</div>
</td>
</tr>
<tr>
<td>
<hr style="width: 240px;margin-top: 15px">
Chassis control:<br>
<button type="button" onclick="submitUART('DrvLR=100,100')">Forward</button><br>
<button type="button" onclick="submitUART('DrvLR=-100,100')">Left</button>
<button type="button" onclick="submitUART('DrvLR=0,0')">STOP</button>
<button type="button" onclick="submitUART('DrvLR=100,-100')">Right</button><br>
<button type="button" onclick="submitUART('DrvLR=-100,-100')">Backward</button>
</td>
</tr>
<tr>
<td>
<hr style="width: 240px;margin-top: 15px">
<form id="serialForm" action="/cgi-bin/serial.cgi" method="POST" target="hidden">
<label>Serial data:<br/>
<textarea id="serialData" name="SERIAL_DATA" rows="2" cols="40">TEST SERIAL</textarea>
</label><br/>
<input type="submit" value="Send">
</form>
</td>
</tr>
</table>
<hr/>
<iframe name="hidden" src="/nothing.html" style="width: 1px;height: 1px;visibility: hidden"></iframe>
<a href="admin/index.html">Robot administration</a>
</body>
</html>
Ответить с цитированием