Commit 89e5422e authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

1. timer

2. link to pars
3. set to sensor's center
parent 626d4ea8
...@@ -113,12 +113,14 @@ ...@@ -113,12 +113,14 @@
<a href="camogmgui.php" title="Store video/images to the camera's storage">Recorder</a><br /> <a href="camogmgui.php" title="Store video/images to the camera's storage">Recorder</a><br />
<a href="snapshot/" title="Take a snapshot and download from the camera">Snapshot</a><br /> <a href="snapshot/" title="Take a snapshot and download from the camera">Snapshot</a><br />
<a href="raw.php" title="Take a snapshot and download raw pixel data from the camera">Snapshot (raw image data)</a><br /> <a href="raw.php" title="Take a snapshot and download raw pixel data from the camera">Snapshot (raw image data)</a><br />
<a href="photofinish/" title="Scanline mode demo">Photo finish demo</a><br />
<br /> <br />
<a href="hwmon.html" title="hwmon.html">Temperature monitor</a><br /> <a href="hwmon.html" title="hwmon.html">Temperature monitor</a><br />
<a href="update_software.html" title="update NAND flash">Update firmware</a><br /> <a href="update_software.html" title="update NAND flash">Update firmware</a><br />
<br /> <br />
<a title="docs" href="http://wiki.elphel.com/index.php?title=Tmp_manual">User manual</a><br /> <a title="docs" href="http://wiki.elphel.com/index.php?title=Tmp_manual">User manual</a><br />
<a href="jp4-viewer/?width=1200&quality=1" title="preview jp4 images (drag and drop from PC)">JP4 Viewer</a><br /> <a href="jp4-viewer/?width=1200&quality=1" title="preview jp4 images (drag and drop from PC)">JP4 Viewer</a><br />
<a href="/debugfs.html" title="Linux Kernel Dynamic Debug helper interface (debug device drivers)">DebugFS</a><br />
</div> </div>
<body> <body>
</html> </html>
...@@ -5,9 +5,8 @@ ...@@ -5,9 +5,8 @@
<meta name="author" content="?"/> <meta name="author" content="?"/>
<link rel="stylesheet" href="/js/bootstrap/css/bootstrap.css"> <link rel="stylesheet" href="/js/bootstrap/css/bootstrap.css">
<style> <style>
#control-panel{ #links-panel,
padding: 5px 5px 0px 5px; #control-panel,
}
#display-panel{ #display-panel{
padding: 5px 5px 0px 5px; padding: 5px 5px 0px 5px;
} }
...@@ -19,9 +18,14 @@ ...@@ -19,9 +18,14 @@
<table> <table>
<tr> <tr>
<td> <td>
<div id='links-panel'>
<a title='Photo finish related pars'
href='/parsedit.php?sensor_port=0&WB_EN&AUTOEXP_ON&EXPOS&COMPRESSOR_RUN&TRIG&TRIG_PERIOD&PF_HEIGHT&WOI_HEIGHT&WOI_TOP&WOI_LEFT&WOI_WIDTH&refresh'>Parameter Editor (port 0)</a>
</div>
<div id='control-panel'> <div id='control-panel'>
<button id='init' title='init linescan mode' class='btn btn-default btn-danger '>init</button> <button id='init' title='init linescan mode' class='btn btn-default btn-danger '>init</button>
<button id='refresh' title='refresh image (no sync)' class='btn btn-default btn-success '>refresh</button> <button id='refresh' title='refresh image (no sync)' class='btn btn-default btn-success '>refresh</button>
<span id='status'></status>
</div> </div>
</td> </td>
</tr> </tr>
......
...@@ -25,33 +25,29 @@ ...@@ -25,33 +25,29 @@
* for the JavaScript code in this page. * for the JavaScript code in this page.
*/ */
var display_object;
$(function(){ $(function(){
$("#init").on('click',function(){ $("#init").on('click',function(){
console.log("init photo finish"); console.log("init photo finish");
wait_start();
$.ajax({ $.ajax({
url: "photo-finish.php?cmd=init", url: "photo-finish.php?cmd=init",
success: function(){ success: function(){
console.log("success"); console.log("success");
wait_stop("init done");
} }
}); });
}); });
$("#refresh").on('click',function(){ $("#refresh").on('click',function(){
console.log("refresh images"); console.log("refresh images");
wait_start();
t1 = $("#display-panel").jp4({ display_object.data.refresh();
ip:"127.0.0.1",
port:2323,
width:600,
fast:true,
lowres:0,
webworker_path:"/js"
});
}); });
var t1 = $("#display-panel").jp4({ display_object = $("#display-panel").jp4({
ip:"127.0.0.1", ip:"127.0.0.1",
port:2323, port:2323,
width:600, width:600,
...@@ -61,19 +57,28 @@ $(function(){ ...@@ -61,19 +57,28 @@ $(function(){
}); });
$("#display-panel").on("canvas_ready",function(){ $("#display-panel").on("canvas_ready",function(){
canvas_ready_handler(this);
});
// get display canvas - hide });
var cnv_old = $(this).find("#display")[0];
$(cnv_old).hide(); function canvas_ready_handler(elem){
var w = cnv_old.width; // find display canvas from original plugin
var h = cnv_old.height; var cnv_old = $(elem).find("#display")[0];
var parent = $(cnv_old).parent();
var parent = $(cnv_old).parent(); // init
if (parent.find("#display2").length==0){
$(cnv_old).hide();
cnv_new = $("<canvas>",{id:"display2"});
parent.append(cnv_new);
}else{
cnv_new = parent.find("#display2");
}
cnv_new = $("<canvas>",{id:"display2"}); var w = cnv_old.width;
parent.append(cnv_new); var h = cnv_old.height;
var ctx = cnv_new[0].getContext("2d"); var ctx = cnv_new[0].getContext("2d");
...@@ -86,6 +91,28 @@ $(function(){ ...@@ -86,6 +91,28 @@ $(function(){
ctx.drawImage(cnv_old,0,0,w,h,0,0,w,h); ctx.drawImage(cnv_old,0,0,w,h,0,0,w,h);
ctx.restore(); ctx.restore();
}); wait_stop("refresh done");
}
});
var wait_interval;
var timeout_counter;
function wait_start(){
timeout_counter = 30;
clearInterval(wait_interval);
wait_interval = setInterval(wait_tick,1000);
}
function wait_stop(msg){
clearInterval(wait_interval);
$("#status").html(msg);
}
function wait_tick(){
if (timeout_counter==0){
wait_stop("Timeout");
}else{
timeout_counter--;
}
$("#status").html("waiting("+timeout_counter+")");
}
...@@ -55,13 +55,14 @@ $pars_init_0 = array( ...@@ -55,13 +55,14 @@ $pars_init_0 = array(
$pars_init_1 = array( $pars_init_1 = array(
'COLOR' => 5, 'COLOR' => 5,
'TRIG' => 4, 'TRIG' => 4,
'TRIG_PERIOD' => 100000, // 2000fps 'TRIG_PERIOD' => 50000, // 2000fps
'PF_HEIGHT' => 2, 'PF_HEIGHT' => 2,
'WOI_HEIGHT' => 16, // for faster work 'WOI_HEIGHT' => 16 // for faster work
); );
$pars_init_2 = array( $pars_init_2 = array(
'WOI_HEIGHT' => 8000 // equals to 10 seconds for 400fps 'WOI_HEIGHT' => 8000, // equals to 10 seconds for 400fps
'WOI_TOP' => 968 // scan at the sensor's center
); );
$pars_init_3 = array( $pars_init_3 = array(
...@@ -77,7 +78,7 @@ if ($cmd=="init"){ ...@@ -77,7 +78,7 @@ if ($cmd=="init"){
elphel_set_P_arr($sensor_port,$pars_init_0,$frame_num+3); elphel_set_P_arr($sensor_port,$pars_init_0,$frame_num+3);
elphel_set_P_arr($sensor_port,$pars_init_1,$frame_num+6); elphel_set_P_arr($sensor_port,$pars_init_1,$frame_num+6);
elphel_set_P_arr($sensor_port,$pars_init_2,$frame_num+9); elphel_set_P_arr($sensor_port,$pars_init_2,$frame_num+9);
elphel_set_P_arr($sensor_port,$pars_init_3,$frame_num+11); elphel_set_P_arr($sensor_port,$pars_init_3,$frame_num+12);
elphel_wait_frame_abs($sensor_port,$frame_num+12); elphel_wait_frame_abs($sensor_port,$frame_num+12);
......
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