Commit db7f83b0 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

fps, manual exposure, auto exposure limit

parent 5b87fb74
...@@ -85,6 +85,14 @@ ...@@ -85,6 +85,14 @@
.btn-toggle{ .btn-toggle{
padding: 1px 0px; padding: 1px 0px;
} }
#aexp_limit,
#exposure,
#fps{
width: 50px;
height: 1.4em;
text-align:right;
margin-top: 1px;
}
</style> </style>
</head> </head>
<body> <body>
...@@ -107,7 +115,7 @@ ...@@ -107,7 +115,7 @@
$href1 = "$sandp/bimg"; $href1 = "$sandp/bimg";
$href2 = "$sandp/mimg"; $href2 = "$sandp/mimg";
$table_contents .= "<td>"; $table_contents .= "<td valign='top'>";
$table_contents .= "<div class='port_window img_window'>"; $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\"><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>"; $table_contents .= "<div><a href=\"$href1\"><div index='$i' class='port_preview'></div></a></div>";
...@@ -124,6 +132,21 @@ ...@@ -124,6 +132,21 @@
$awb_on = elphel_get_P_value($master_port,ELPHEL_WB_EN); $awb_on = elphel_get_P_value($master_port,ELPHEL_WB_EN);
$aexp_on = elphel_get_P_value($master_port,ELPHEL_AUTOEXP_ON); $aexp_on = elphel_get_P_value($master_port,ELPHEL_AUTOEXP_ON);
$aexp_max = elphel_get_P_value($master_port,ELPHEL_AUTOEXP_EXP_MAX);
$aexp_max = round($aexp_max/100)/10;
$trig_period = elphel_get_P_value($master_port,ELPHEL_TRIG_PERIOD);
if ($trig_period!=1){ // single
$trig_period_step_s = 0.00000001;
$trig_period_s = $trig_period*$trig_period_step_s;
$fps = round(1/$trig_period_s*10)/10;
}else{
$fps = 10;
}
$expos = elphel_get_P_value($master_port,ELPHEL_EXPOS);
$expos = round($expos/100)/10;
echo "<table><tr>$table_contents</tr></table>\n"; echo "<table><tr>$table_contents</tr></table>\n";
echo "<br/>"; echo "<br/>";
...@@ -132,7 +155,22 @@ ...@@ -132,7 +155,22 @@
?> ?>
<table> <table>
<tr id="toggle_awb" title='Auto White Balance'> <tr>
<td>
<span title='Frames Per Second. Set internal trigger per second. WARNING: Trigger can be programmed to be faster than real fps. In that case some triggers are ignored.'>FPS:</span>
</td>
<td><input id='fps' type='text' value='<?php echo $fps;?>' pname='TRIG_PERIOD' /></td>
</tr>
<tr>
<td>
<span title='Initial read from master port, applied to all ports'>Manual Exposure:</span>
</td>
<td><input id='exposure' type='text' value='<?php echo $expos;?>' pname='EXPOS'/> ms</td>
</tr>
</table>
<br/>
<table>
<tr id="toggle_awb_div" title='Auto White Balance'>
<td> <td>
Auto WB: Auto WB:
</td> </td>
...@@ -143,7 +181,7 @@ ...@@ -143,7 +181,7 @@
</div> </div>
</td> </td>
</tr> </tr>
<tr id="toggle_aexp" title='Auto Exposure'> <tr id="toggle_aexp_div" title='Auto Exposure'>
<td> <td>
Auto Exposure: Auto Exposure:
</td> </td>
...@@ -153,6 +191,10 @@ ...@@ -153,6 +191,10 @@
<button class="btn btn-xs <?php echo (!$aexp_on)?"btn-danger active":"btn-default";?>">OFF</button> <button class="btn btn-xs <?php echo (!$aexp_on)?"btn-danger active":"btn-default";?>">OFF</button>
</div> </div>
</td> </td>
<td>
<span title="Auto Exposure Limit in ms">Limit:
</td>
<td><input id='aexp_limit' type='text' value='<?php echo $aexp_max;?>' pname='AUTOEXP_EXP_MAX'/> ms</td>
</tr> </tr>
</table> </table>
<br /> <br />
...@@ -176,12 +218,14 @@ ...@@ -176,12 +218,14 @@
<script> <script>
var jp4_previews_enable = true; var jp4_previews_enable = true;
var jp4_previews = [];
$(function(){ $(function(){
check_time(); check_time();
init_awb_toggle(); init_awb_toggle();
init_aexp_toggle(); init_aexp_toggle();
init_jp4_previews(); init_jp4_previews();
init_inputs();
}); });
async function check_time(){ async function check_time(){
...@@ -197,7 +241,7 @@ ...@@ -197,7 +241,7 @@
$('.port_preview').each(function(){ $('.port_preview').each(function(){
index = parseInt($(this).attr("index")); index = parseInt($(this).attr("index"));
if (jp4_previews_enable) { if (jp4_previews_enable) {
$(this).jp4({ip:location.host,port:2323+index,width:300,fast:true,lowres:4}); jp4_previews[index] = $(this).jp4({ip:location.host,port:2323+index,width:300,fast:true,lowres:4});
//$(this).jp4({src:"http://"+location.host+":"+(2323+index)+"/img",width:300,fast:true,lowres:4}); //$(this).jp4({src:"http://"+location.host+":"+(2323+index)+"/img",width:300,fast:true,lowres:4});
}else{ }else{
$(this).html("<img width='300' src='http://"+location.host+":"+(2323+index)+"/img' />"); $(this).html("<img width='300' src='http://"+location.host+":"+(2323+index)+"/img' />");
...@@ -273,6 +317,46 @@ function init_aexp_toggle(){ ...@@ -273,6 +317,46 @@ function init_aexp_toggle(){
}); });
} }
async function init_inputs(){
$("input").change(function(){
let pname = $(this).attr('pname');
let pvalue = $(this).val();
switch(pname){
case "AUTOEXP_EXP_MAX":
pvalue = parseInt(pvalue*1000);
set_param(pname,pvalue,()=>{
console.log("ok");
});
break;
case "EXPOS":
pvalue = parseInt(pvalue*1000);
// autoexp off
if ($('#toggle_aexp').find('.btn.active').html()==="ON"){
$('#toggle_aexp').click();
}
set_param(pname,pvalue,()=>{
console.log("ok");
});
break;
case "TRIG_PERIOD":
pvalue = parseInt(1/pvalue*10e7);
set_param(pname,pvalue,()=>{
console.log("ok");
});
break;
default:
}
});
}
async function set_param(pname,pvalue,callback){
$.ajax({
url: "parsedit.php?immediate&sensor_port=<?php echo $master_port;?>&"+pname+"="+pvalue+"&*"+pname+"=0xf",
success: callback
});
}
</script> </script>
<body> <body>
</html> </html>
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