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

1. timer

2. link to pars
3. set to sensor's center
parent 626d4ea8
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -113,12 +113,14 @@
  <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="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 />
  <a href="hwmon.html"           title="hwmon.html">Temperature monitor</a><br />
  <a href="update_software.html" title="update NAND flash">Update firmware</a><br />
  <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="/debugfs.html" title="Linux Kernel Dynamic Debug helper interface (debug device drivers)">DebugFS</a><br />
</div>
<body>
</html>
+7 −3
Original line number Diff line number Diff line
@@ -5,9 +5,8 @@
    <meta name="author" content="?"/>
    <link rel="stylesheet" href="/js/bootstrap/css/bootstrap.css">
    <style>
      #control-panel{
        padding: 5px 5px 0px 5px;
      }
      #links-panel,
      #control-panel,
      #display-panel{
        padding: 5px 5px 0px 5px;
      }
@@ -19,9 +18,14 @@
    <table>
    <tr>
      <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'>
          <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>
          <span id='status'></status>
        </div>
      </td>
    </tr>
+49 −22
Original line number Diff line number Diff line
@@ -25,22 +25,29 @@
 *  for the JavaScript code in this page.
 */

var display_object;

$(function(){

  $("#init").on('click',function(){
    console.log("init photo finish");
    wait_start();
    $.ajax({
      url: "photo-finish.php?cmd=init",
      success: function(){
        console.log("success");
        wait_stop("init done");
      }
    });
  });

  $("#refresh").on('click',function(){
    console.log("refresh images");
    wait_start();
    display_object.data.refresh();
  });

    t1 = $("#display-panel").jp4({
  display_object = $("#display-panel").jp4({
    ip:"127.0.0.1",
    port:2323,
    width:600,
@@ -49,32 +56,30 @@ $(function(){
    webworker_path:"/js"
  });

  $("#display-panel").on("canvas_ready",function(){
    canvas_ready_handler(this);
  });

  var t1 = $("#display-panel").jp4({
    ip:"127.0.0.1",
    port:2323,
    width:600,
    fast:true,
    lowres:0,
    webworker_path:"/js"
});

  $("#display-panel").on("canvas_ready",function(){
function canvas_ready_handler(elem){

    // get display canvas - hide
    var cnv_old = $(this).find("#display")[0];
    // find display canvas from original plugin
    var cnv_old = $(elem).find("#display")[0];
    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");
    }

    var w = cnv_old.width;
    var h = cnv_old.height;

    var parent = $(cnv_old).parent();

    cnv_new = $("<canvas>",{id:"display2"});
    parent.append(cnv_new);

    var ctx = cnv_new[0].getContext("2d");

    ctx.canvas.width=h;
@@ -86,6 +91,28 @@ $(function(){
    ctx.drawImage(cnv_old,0,0,w,h,0,0,w,h);
    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+")");
}
+5 −4
Original line number Diff line number Diff line
@@ -55,13 +55,14 @@ $pars_init_0 = array(
$pars_init_1 = array(
  'COLOR' => 5,
  'TRIG' => 4,
  'TRIG_PERIOD' => 100000, // 2000fps
  'TRIG_PERIOD' => 50000, // 2000fps
  'PF_HEIGHT' => 2,
  'WOI_HEIGHT' => 16, // for faster work
  'WOI_HEIGHT' => 16 // for faster work
);

$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(
@@ -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_1,$frame_num+6);
  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);