Commit c86c08b9 authored by Andrey Filippov's avatar Andrey Filippov

overdue commit of lwir16 controls from summer 2021

parent 3040e83d
......@@ -30,6 +30,8 @@
const params = new URLSearchParams(location.search);
const port = params.get('port') || 0;
const refresh = params.get('refresh') || 5;
const sensor_type = params.get('sensor_type') || '';
console.log("img.html: sensor_type="+sensor_type);
if (params.get('port')===null){
let s = "";
......@@ -42,8 +44,11 @@
}
let imgsrv_port = IMGSRV_PORT0 + parseInt(port);
let t1 = $("#cnv_div").jp4({src:"http://"+location.host+":"+imgsrv_port+"/img",width:1600,fast:true,lowres:2,debug:false,refresh:true});
if (sensor_type == "boson640") {
let t1 = $("#cnv_div").jp4({src:"http://"+location.host+":"+imgsrv_port+"/tiff_palette=2/tiff_telem=1/tiff_auto=0/tiff_convert/bimg",width:1600,fast:true,lowres:2,debug:false,refresh:true});
} else {
let t1 = $("#cnv_div").jp4({src:"http://"+location.host+":"+imgsrv_port+"/img",width:1600,fast:true,lowres:2,debug:false,refresh:true});
}
</script>
</body>
......
......@@ -122,7 +122,7 @@
$sensors = get_sensors();
$sensor_type = "none";
$preview_image_cmd=array();
foreach($sensors as $i => $sensor){
if ($sensor!="none"){
$sensor_type = $sensor;
......@@ -131,15 +131,24 @@
$sandp = "http://{$_SERVER["SERVER_ADDR"]}:".($port0+$i);
$href1 = "$sandp/bimg";
$href2 = "$sandp/mimg";
$href3 = "$sandp/tiff_palette=2/tiff_telem=1/tiff_auto=33/tiff_convert/bimg";
if ($sensor_type == 'boson640'){
$preview_image_cmd[] = '/tiff_palette=2/tiff_telem=1/tiff_auto=33/tiff_convert/bimg';
} else {
$preview_image_cmd[] = 'img';
}
$table_contents .= "<td valign='top'>";
$table_contents .= "<div class='port_window img_window'>";
//$table_contents .= "<div><a href=\"$href1\"><img class='img_window' src='$href1' style='width:300px'/></a></div>";
$table_contents .= "<div><a href=\"$href1\"><div index='$i' class='port_preview'></div></a></div>";
if ($sensor_type == boson640){
$table_contents .= "<div><a href=\"$href3\"><div index='$i' class='port_preview'></div></a></div>";
} else {
$table_contents .= "<div><a href=\"$href1\"><div index='$i' class='port_preview'></div></a></div>";
}
$table_contents .= "<div style='text-align:center;'>";
$table_contents .= "port $i: ";
$table_contents .= "port $i: (".$sensor_type.")";
$table_contents .= "<a title='single image' href='$href1'>bimg</a>, ";
$table_contents .= "<a href=\"img.html?port=$i\" title='single image, auto refreshed on load, LOW RES, displays jpeg, tiff and jp4 formats'>img</a>, ";
$table_contents .= "<a href=\"img.html?port=$i&amp;sensor_type=$sensor_type\" title='single image, auto refreshed on load, LOW RES, displays jpeg, tiff and jp4 formats'>img</a>, ";
$table_contents .= "<a title='multi-part image stream (M-JPEG). Played in browser as is.' href='$href2'>mimg</a>, ";
$table_contents .= "<a href=\"mjpeg.html?port=$i\" title='MJPEG stream played in html canvas' class='canvas_mjpeg'>canvas</a>";
$table_contents .= "</div>";
......@@ -281,9 +290,9 @@
index = parseInt($(this).attr("index"));
if (jp4_previews_enable) {
//jp4_previews[index] = $(this).jp4({ip:location.host,port:2323+index,width:300,fast:true,lowres:4});
jp4_previews[index] = $(this).jp4({src:"http://"+location.host+":"+(2323+index)+"/img",width:300,fast:true,lowres:4});
jp4_previews[index] = $(this).jp4({src:"http://"+location.host+":"+(2323+index)+"<?php echo $preview_image_cmd[0];?>",width:300,fast:true,lowres:4});
}else{
$(this).html("<img width='300' src='http://"+location.host+":"+(2323+index)+"/img' />");
$(this).html("<img width='300' src='http://"+location.host+":"+(2323+index)+"<?php echo $preview_image_cmd[0];?>' />");
}
});
}
......
......@@ -358,7 +358,7 @@ EOT;
// TODO: use lwir16.ini
$eo_quality = 97;
$exposure = 1000; // 1 ms
$autoExposureMax = 500000;
$autoExposureMax = 25000; // 500000; ~28ms - max for 10Hz
$autoExp = 1;
$gain = 2 * 0x10000;
$rScale = 1 * 0x10000;
......
......@@ -4,6 +4,7 @@ OWN = -o root -g root
INSTDOCS = 0644
INSTALL = install
DOCS= index.html \
index1.html \
multicam.js \
multicam.css \
multicam.php
......
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Multi cameras control</title>
<script src="../js/jquery-3.1.1.js"></script>
<script src="../js/elphel.js"></script>
<script src="../js/jcanvas.js"></script>
<script src="../js/UTIF.js"></script>
<script src="../js/exif.js"></script>
<script src="../js/jquery-jp4.js"></script>
<script src="../js/zip/zip.js"></script>
<link rel="stylesheet" href="../js/bootstrap/css/bootstrap.css">
<script type='text/javascript' src='multicam.js'></script>
<link rel='stylesheet' type='text/css' href='multicam.css'></link>
</head>
<!-- 192.168.0.41/multicam/index1.html?ip=192.168.0.41,192.168.0.42,192.168.0.43,192.168.0.44,192.168.0.45 -->
<body>
<div id='settings'>
<table>
<tr>
<td>
<div id='rec_button' class='rec_outer' title='start recording'>
<div class='rec_inner'></div>
</div>
</td>
<td>
<button id='snapshot' title='download snapshot' class="btn btn-sm btn-danger">snapshot</button>
</td>
</tr>
<tr id="toggle_awb" title='Auto White Balance'>
<td>Auto WB:</td>
<td>
<div id="toggle_awb" class="btn-group btn-toggle">
<button class="btn btn-xs btn-success active">ON</button>
<button class="btn btn-xs btn-default">OFF</button>
</div>
</td>
</tr>
<tr id="toggle_aexp" title='Auto Exposure'>
<td>Auto Exposure:</td>
<td>
<div id="toggle_aexp" class="btn-group btn-toggle">
<button class="btn btn-xs btn-success active">ON</button>
<button class="btn btn-xs btn-default">OFF</button>
</div>
</td>
</tr>
<tr>
<td>
<button id='system_tests' title='system info' class="btn btn-sm btn-success">tests</button>
</td>
</tr>
<tr>
<td hidden>
<br/>
<div id='edit_addrs_input' hidden>
<div id='eai_text_div'>
<textarea id='eai_text' rows='4' cols='30'></textarea>
</div>
<div id='eai_ok_div'>
<button id='eai_ok' class="btn btn-sm btn-success">ok</button>
</div>
</div>
<div id='edit_addrs' title='edit ip addresses'>
<button id='ea_btn' class="btn btn-sm btn-success">+</button>
</div>
<div id='addrs'>
</div>
</td>
</tr>
</table>
</div>
<div id='display'>
<div id='display_status'></div>
<hr/>
<div id='display_previews'></div>
</div>
</body>
</html>
\ No newline at end of file
......@@ -352,6 +352,19 @@ function init_port(cam_i,port_i){
}
});
var url = "http://"+cams[cam_i].ip+"/parsedit.php?immediate&sensor_port="+cams[cam_i].ports[port_i].index+"&BITS";
$.ajax({
url: url,
cam_i: cam_i,
port_i: port_i,
success: function(res){
bits = parseInt($(res).find("BITS").text());
cams[this.cam_i].ports[this.port_i].bits = bits;
}
});
}
// * if any attribute is not initialized it will be NaN
......@@ -477,6 +490,7 @@ function refresh_previews(){
if (cams[i].init){
for(var j=0;j<cams[i].ports.length;j++){
var cam = cams[i];
var is_lwir = cam.ports[j].bits > 8;
//var img_src = 'http://'+cam.ip+':'+cam.ports[j].port+'/img?'+ts;
var hst_src = 'http://'+cam.ip+'/pnghist.cgi?sensor_port='+cam.ports[j].index+'&sqrt=1&scale=5&average=5&height=128&fillz=1&linterpz=0&draw=2&colors=41&_time='+ts;
......@@ -486,10 +500,15 @@ function refresh_previews(){
if (!cam.ports[j].preview){
//console.log("preview does not exist");
var jp4prev = elem.find(".port_preview[index="+j+"]");
var imgsrv_img = "/img";
if (is_lwir){
imgsrv_img = "/tiff_palette=2/tiff_telem=1/tiff_auto=33/tiff_convert/bimg";
}
var preview = jp4prev.jp4({
//ip: cam.ip,
//port: cam.ports[j].port,
src: "http://"+cam.ip+":"+cam.ports[j].port+"/img",
// src: "http://"+cam.ip+":"+cam.ports[j].port+"/img",
src: "http://"+cam.ip+":"+cam.ports[j].port+imgsrv_img,
width: 200,
fast: true,
lowres:4,
......@@ -503,11 +522,10 @@ function refresh_previews(){
cam.ports[j].preview.data.refresh();
}
//console.log(jp4prev.data.getAddr());
elem.find(".hist_preview[index="+j+"]").attr('src',hst_src);
if (!is_lwir) {
elem.find(".hist_preview[index="+j+"]").attr('src',hst_src);
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment