Commit eff38d20 authored by Andrey Filippov's avatar Andrey Filippov

Started multicam2 files for lwir16

parent c86c08b9
......@@ -361,6 +361,13 @@ function parse_port(port){
var pn = p.attr('index');
var mux = p.attr('mux');
var sensors = p.attr('sensor');
var format = pp_parse_format(p.find('color'));
var quality = p.find('quality').text()+'%';
// alert(format);
// alert(format.includes("tiff"));
if (format.includes("tiff")){
quality = "lossless"
}
var res = [
'<tr>',
......@@ -369,12 +376,12 @@ function parse_port(port){
' <td>'+sensors+'</td>',
' <td class=\'center\'>'+pp_parse_sensor_run(p.find('sensor_run'))+'</td>',
' <td class=\'center\'>'+pp_parse_sensor_run(p.find('compressor_run'))+'</td>',
' <td class=\'center\'>'+pp_parse_format(p.find('color'))+'</td>',
' <td class=\'center\'>'+p.find('quality').text()+'%</td>',
' <td class=\'center\'>'+format+'</td>',
' <td class=\'center\'>'+quality+'</td>',
' <td class=\'center\'>'+p.find('woi_width').text()+'x'+p.find('woi_height').text()+'</td>',
' <td class=\'center\'>'+p.find('trig').text()+'</td>',
' <td class=\'center\'>'+p.find('trig_master').text()+'</td>',
' <td class=\'center\'>'+pp_parse_trig_period(p.find('trig_period').text(),p.find('expos').text())+'</td>',
' <td class=\'center\'>'+pp_parse_trig_period(p.find('trig_period').text(),p.find('trig_decimate').text(),p.find('expos').text())+'</td>',
' <td class=\'center\'>'+pp_parse_trig_p(p.find('trig_out').text())+'</td>',
' <td class=\'center\'>'+pp_parse_trig_p(p.find('trig_condition').text())+'</td>',
' <td class=\'right\'>'+pp_parse_expos(p.find('expos').text(),p.find('trig_period').text())+'</td>',
......@@ -433,10 +440,11 @@ function pp_parse_trig_p(str){
}
function pp_calc_trig_period(str){
function pp_calc_trig_period(str, sdecimate){
var clock = 100000000;
var v = parseInt(str);
v = v/clock;
var decimate = 1.0 + parseInt(sdecimate)
v = v/clock*decimate;
return v;
}
......@@ -446,9 +454,9 @@ function pp_calc_exposure(str){
return v;
}
function pp_parse_trig_period(period,str){
function pp_parse_trig_period(period,decimate,str){
var per = pp_calc_trig_period(period);
var per = pp_calc_trig_period(period, decimate);
var exp = pp_calc_exposure(str);
var fps = (1/per);
......@@ -477,10 +485,12 @@ function pp_parse_format(str){
if (fmt==5){
fmt = "jp4";
}else if (fmt==0){
} else if (fmt==15){
fmt = "tiff";
} else if (fmt==0){
color = "rgb(240,160,0)";
fmt = "jpeg";
}else{
} else{
color = "rgb(230,0,0)";
fmt = "else";
}
......
......@@ -238,6 +238,7 @@ function get_port_info($port){
'TRIG' => 0,
'TRIG_MASTER' => 0,
'TRIG_PERIOD' => 0,
'TRIG_DECIMATE' => 0,
'TRIG_CONDITION' => 0,
'TRIG_OUT' => 0,
'GAINR' => 0,
......
......@@ -5,9 +5,13 @@ INSTDOCS = 0644
INSTALL = install
DOCS= index.html \
index1.html \
index2.html \
multicam.js \
multicam2.js \
multicam.css \
multicam.php
multicam2.css \
multicam.php \
multicam2.php
ZIPDOCS= zip/deflate.js \
zip/inflate.js \
......
<!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='multicam2.js'></script>
<link rel='stylesheet' type='text/css' href='multicam2.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='display_all'>
<div id='display_previews'></div>
<div id='display_controls'>
<button type="button" class="collapsible">Recording Status</button>
<div id='display_status'></div>
<button type="button" class="collapsible">Eyesis Controls</button>
<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> <!-- settings table -->
</div> <!-- id='settings' -->
</div> <!-- controls -->
</div>
</body>
</html>
\ No newline at end of file
#settings{
padding:5px;
}
table td {
padding-right:10px;
}
.btn.active:focus, .btn:focus{
outline:none;
}
.btn-toggle{
padding: 1px 0px;
}
#edit_addrs{
padding: 2px;
}
#ea_btn{
outline:none;
font-weight:bold;
}
#addrs{
padding: 0px 2px 2px 2px;
}
#eai_text{
resize:none;
margin:0px;
}
#edit_addrs_input{
position:absolute;
top:2px;
left:2px;
border:1px solid rgb(169,169,169);
padding:2px;
background: white;
z-index: 100;
}
#eai_text_div{
line-height:14px;
}
#rec_start{
outline:none;
border: 0px solid #00AA66;
}
.rec_outer{
position:relative;
width:50px;
height:50px;
border-radius:50%;
border: 1px solid rgba(100,100,100,1);
background: white;
}
.rec_inner{
position:relative;
top:25%;
left:25%;
width:50%;
height:50%;
border-radius:50%;
background: rgb(166,14,14);
}
.rec_outer:active{
border: 1px solid rgb(166,14,14);
}
.rec_outer_active{
border: 1px solid rgb(166,14,14);
}
.rec_inner_running{
top:5%;
left:5%;
width:90%;
height:90%;
}
.port_preview{
width:200px;
}
.hist_preview{
border:1px solid rgba(200,200,200,0.5);
width:200px;
}
#display{
padding:5px;
}
hr{
margin-top:2px;
margin-bottom:2px;
}
#display_status th, #s_device{
text-align:center;
}
#s_space{
text-align:right;
}
#display_status td, #display_status th{
border:1px solid rgba(100,100,100,0.8);
padding:2px 5px;
}
.port_preview canvas,#display{
padding:0px;
}
#system_tests{
margin:5px;
}
#display_all {
display: flex;
}
#display_preview {
flex: 0 0 65%;
}
#controls {
flex: 1;
}
.ip_text{
display: none;
}
.collapsible {
background-color: #777;
color: white;
cursor: pointer;
padding: 2px;
width: 100%;
border: none;
text-align: center;
outline: none;
font-size: 10px;
font-weight: bold;
}
.active, .collapsible:hover {
background-color: #555;
}
.content {
padding: 0 18px;
display: none;
overflow: hidden;
background-color: #f1f1f1;
}
This diff is collapsed.
<?php
include "../include/elphel_functions_include.php";
$cmd = "donothing";
if (isset($_GET['cmd']))
$cmd = $_GET['cmd'];
else if (isset($argv[1]))
$cmd = $argv[1];
$config = "/var/volatile/html/multicam.xml";
// path to sysfs for port scanning
$portspath = "/sys/devices/soc0/elphel393-detect_sensors@0";
// total number of ports in 10393
$nports = 4;
$port0 = 2323;
// extract ip addresses
if ($_SERVER['REQUEST_METHOD']==="POST"){
$list = file_get_contents("php://input");
}else{
if (isset($_GET['ip'])){
$list = $_GET['ip'];
}else{
$list = $_SERVER['SERVER_ADDR'];
}
}
$ips = explode(',',$list);
// allow CORS
header('Access-Control-Allow-Origin: *');
switch($cmd){
case "ports":
print(getports());
break;
case "write":
// write
// use get and post requests
write_config($config,$ips);
print("ok");
break;
case "snapshot":
send_zipped_images($ips);
break;
case "read":
default:
// will never need read - config is in http://camip/var/multicam.xml
// read
print(file_get_contents($config));
}
function write_config($config,$ips){
$list = "";
foreach($ips as $ip){
$list .= "\t<camera>$ip</camera>\n";
}
$xml = "<?xml version='1.0' standalone='yes'?>\n";
$xml .= "<Document>\n";
$xml .= $list;
$xml .= "</Document>\n";
file_put_contents($config,$xml);
return 0;
}
function getports(){
global $nports, $portspath, $port0;
$res = "\t<camera ip='".$_SERVER['SERVER_ADDR']."'>\n";
for($i=0;$i<$nports;$i++){
$sensor = $portspath."/sensor{$i}0";
// the file is always there actually
if(is_file($sensor)){
$c = trim(file_get_contents($sensor));
$p = $port0+$i;
$res .= "\t\t<port index='$i' port='$p'>$c</port>\n";
}
}
$res .= "\t</camera>\n";
$xml = "<?xml version='1.0' standalone='yes'?>\n";
$xml .= "<Document>\n";
$xml .= $res;
$xml .= "</Document>\n";
return $xml;
}
function send_zipped_images($ips){
}
?>
\ No newline at end of file
#!/bin/bash
ssh root@192.168.0.41 "sync" &
scp /home/elphel/git/elphel393/rootfs-elphel/elphel-web-393/src/multicam/multicam2.* root@192.168.0.42:/www/pages/multicam/
scp /home/elphel/git/elphel393/rootfs-elphel/elphel-web-393/src/multicam/multicam2.* root@192.168.0.43:/www/pages/multicam/
scp /home/elphel/git/elphel393/rootfs-elphel/elphel-web-393/src/multicam/multicam2.* root@192.168.0.44:/www/pages/multicam/
scp /home/elphel/git/elphel393/rootfs-elphel/elphel-web-393/src/multicam/multicam2.* root@192.168.0.45:/www/pages/multicam/
scp /home/elphel/git/elphel393/rootfs-elphel/elphel-web-393/src/diagnostics/index.html root@192.168.0.42:/www/pages/diagnostics/
scp /home/elphel/git/elphel393/rootfs-elphel/elphel-web-393/src/diagnostics/index.html root@192.168.0.43:/www/pages/diagnostics/
scp /home/elphel/git/elphel393/rootfs-elphel/elphel-web-393/src/diagnostics/index.html root@192.168.0.44:/www/pages/diagnostics/
scp /home/elphel/git/elphel393/rootfs-elphel/elphel-web-393/src/diagnostics/index.html root@192.168.0.45:/www/pages/diagnostics/
scp /home/elphel/git/elphel393/rootfs-elphel/elphel-web-393/src/diagnostics/diagnostics.css root@192.168.0.42:/www/pages/diagnostics/
scp /home/elphel/git/elphel393/rootfs-elphel/elphel-web-393/src/diagnostics/diagnostics.css root@192.168.0.43:/www/pages/diagnostics/
scp /home/elphel/git/elphel393/rootfs-elphel/elphel-web-393/src/diagnostics/diagnostics.css root@192.168.0.44:/www/pages/diagnostics/
scp /home/elphel/git/elphel393/rootfs-elphel/elphel-web-393/src/diagnostics/diagnostics.css root@192.168.0.45:/www/pages/diagnostics/
scp /home/elphel/git/elphel393/rootfs-elphel/elphel-web-393/src/diagnostics/diagnostics.js root@192.168.0.42:/www/pages/diagnostics/
scp /home/elphel/git/elphel393/rootfs-elphel/elphel-web-393/src/diagnostics/diagnostics.js root@192.168.0.43:/www/pages/diagnostics/
scp /home/elphel/git/elphel393/rootfs-elphel/elphel-web-393/src/diagnostics/diagnostics.js root@192.168.0.44:/www/pages/diagnostics/
scp /home/elphel/git/elphel393/rootfs-elphel/elphel-web-393/src/diagnostics/diagnostics.js root@192.168.0.45:/www/pages/diagnostics/
scp /home/elphel/git/elphel393/rootfs-elphel/elphel-web-393/src/diagnostics/diagnostics.php root@192.168.0.42:/www/pages/
scp /home/elphel/git/elphel393/rootfs-elphel/elphel-web-393/src/diagnostics/diagnostics.php root@192.168.0.43:/www/pages/
scp /home/elphel/git/elphel393/rootfs-elphel/elphel-web-393/src/diagnostics/diagnostics.php root@192.168.0.44:/www/pages/
scp /home/elphel/git/elphel393/rootfs-elphel/elphel-web-393/src/diagnostics/diagnostics.php root@192.168.0.45:/www/pages/
ssh root@192.168.0.41 "sync"
ssh root@192.168.0.42 "sync"
ssh root@192.168.0.43 "sync"
ssh root@192.168.0.44 "sync"
ssh root@192.168.0.45 "sync"
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