Commit 10412f81 authored by Andrey Filippov's avatar Andrey Filippov
Browse files

working on LWIR16 control

parent 2c148fb3
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ var apply_pending = false;

function parse_response(resp){
  var result = "";
  console.log(resp);
  console.log("parse_response(), resp="+resp);
  if (resp.getElementsByTagName("result").length!=0){
  	result = resp.getElementsByTagName("result")[0].childNodes[0].nodeValue;
  }else if (resp.getElementsByTagName("reboot").length!=0){
@@ -40,11 +40,13 @@ function parse_response(resp){
}

function send_request(rq,callback){
  console.log("send_request(), rq="+rq);
  var request = new XMLHttpRequest();
  request.open('GET', rq, true);
  request.onreadystatechange = function() {
    if (this.readyState == 4 && this.status == 200) {
      var resp = this.responseXML;
      console.log("send_request(), callback, resp="+resp);
  	  callback(resp);
    }
  };
@@ -55,8 +57,10 @@ function send_request(rq,callback){
}

function sendStatusRequest(){
    console.log("sendStatusRequest()");
    var url = "http://192.168.0.41/lwir16/lwir16.php?daemon=status";
    if (apply_pending) {
        console.log("sendStatusRequest(), apply_pending");
        var mod_pars =   modParameters();
//    console.log('mod_pars members:');
        for(const p in mod_pars) {
@@ -69,6 +73,7 @@ function sendStatusRequest(){
}

function sendRestartRequest(){
    console.log("sendRestartRequest()");
    var url = "http://192.168.0.41/lwir16/lwir16.php?daemon=restart&cmd=STATUS";
    send_request(url,parseStatusResponse);
}
@@ -76,6 +81,7 @@ function sendRestartRequest(){


function parseStatusResponse(resp){
  console.log("parseStatusResponse(), resp="+resp);
  var result = "";
//  console.log(resp);
  if (update_editable) {
@@ -158,6 +164,7 @@ function parseStatusResponse(resp){
  request_num++;
  document.getElementById("idrequest_num").value = request_num;
  update_editable = false;
  console.log("parseStatusResponse() almost Done, sending again sendStatusRequest()");
  sendStatusRequest();
}

+7 −0
Original line number Diff line number Diff line
#configuration for LWIR 16 camera 
multicam_dir = "footage01"
multicam_rperiod = 5.0
multicam_speriod = 2.0
#save current settings to overwrite those in this file
multicam_conf = "/etc/elphel393/multicamconf.xml"

ips =        "192.168.0.41,192.168.0.42,192.168.0.43,192.168.0.44,192.168.0.45"
port_masks=  "15,15,15,15,15"
duration =   100
+2 −2
Original line number Diff line number Diff line
@@ -487,7 +487,7 @@ EOT;
        return $results;
   }

   function runCapture($run_ffc, $nowait = 0, $debug=0) {
   function runCapture($run_ffc, $nowait = 0, $debug=0) { // works, but the main script hangs
       // TODO: use lwir16.ini
//       $eo_quality = 97;
//       $exposure = 1000; // 1 ms
@@ -662,7 +662,7 @@ EOT;
       $GLOBALS[CAPTURE_RUN] = 0; // until command
       $GLOBALS[LAST_FFC] = 0; // overdue
       $GLOBALS[SECUENCE_NUM] = 0;
       if ($GLOBALS[DEBUG > 1])  {
       if ($GLOBALS[DEBUG] > 1)  { // was if ($GLOBALS[DEBUG > 1])  {
           printf("--- GLOBALS: ---\n");
           print_r($GLOBALS);
       }
+2 −1
Original line number Diff line number Diff line
@@ -11,7 +11,8 @@ DOCS= index.html \
            multicam.css \
            multicam2.css \
            multicam.php \
            multicam2.php
            multicam2.php \
            reboot.html

ZIPDOCS= zip/deflate.js \
         zip/inflate.js \
+98 −4
Original line number Diff line number Diff line
@@ -25,7 +25,90 @@
      <div id='display_controls'>
         <button type="button" class="collapsible">Recording Status</button>
         <div id='display_status'></div>
         <button type="button" class="collapsible">LWIR16 Status</button>
         <div id='lwir16_status'>
           <table><tr><td>
             <table>
               <tr><td><label for="seq_num"    >Seq Num</label></td><td><input type="text" id="idsequence_num" name="seq_num"      size="5" value="?" disabled="disabled"></td></tr>
               <tr><td><label for="request_num">Requests</label></td><td><input type="text" id="idrequest_num" name="request_num"    size="5" value="?" disabled="disabled"></td></tr>
               <tr><td><label for="capture_run">Running</label></td><td><input type="checkbox" id="idcapture_run" name="capture_run" disabled="disabled"></td></tr>
             </table>
           </td><td>
             <table>
               <tr><td><label for="last_ffc"    >Last FFC</label></td><td><input type="text" id="idlast_ffc" name="last_ffc"      size="5" value="?" disabled="disabled">s</td></tr>
               <tr><td><label for="time_to_ffc" >To FFC</label></td><td><input type="text" id="idtime_to_ffc" name="time_to_ffc"   size="5" value="?" disabled="disabled">s</td></tr>
               <tr><td colspan = "2">&nbsp;</td></tr>
           </table>
           </td></tr></table>
         </div>
         <button type="button" class="collapsible">LWIR16 Controls</button>
         <div id='lwir16_controls'>

           <table><tr><td>
             <table>
               <tr><td><button id="idStartStop" name = "nStartStop" disabled="true">???</button></td>
               <td><button id="idApply" name = "nApply" disabled = "true">???</button></td>
               </tr>
               
               <tr><td><label for="idpre_delay"   >Inter-Delay</label></td><td><input type="text" id="idpre_delay" name="pre_delay"      size="5" value="?">s</td></tr>
               <tr><td><label for="duration"      >LWIR frames</label></td><td><input type="text" id="idduration" name="duration"      size="5" value="?"></td></tr>
               <tr><td><label for="duration_eo"   >RGB frames</label></td><td><input type="text" id="idduration_eo" name="duration_eo"      size="5" value="?"></td></tr>
               <tr><td><label for="compressor_run">Compress Init</label></td><td><input type="checkbox" id="idcompressor_run" name="compressor_run"></td></tr>
             </table>
           </td><td>
             <table>
               <tr><td><label for="ffc"    >FFC</label></td><td><input type="checkbox" id="idffc" name="ffc"></td></tr>
               <tr><td><label for="ffc_period"    >FFC period</label></td><td><input type="text" id="idffc_period" name="ffc_period"      size="5" value="?"></td></tr>
               <tr><td><label for="ffc_groups"    >FFC groups</label></td><td><select id="idffc_groups" name="idffc_groups">
														                         <option value="1">1</option>
														        			  	  <option value="2">2</option>
																		          <option value="4" selected="selected">4</option>
																		        </select>
                                                                         </td></tr>
               <tr><td><label for="ffc_frames"    >FFC frames</label></td><td><input type="text" id="idffc_frames" name="ffc_frames"      size="5" value="?"></td></tr>
               <tr><td><label for="debug"    >Debug</label></td><td><input type="text" id="iddebug" name="debug"      size="5" value="?"></td></tr>
           </table>
           </td></tr></table>

         </div>
         
         <button type="button" class="collapsible">Multicam Controls</button>
         <div id='multicam settings'>
		    <table>
			    <tr>
				    <td>
					    <table>
					    <th><td colspan="2">Image Refresh<td> </th>
					    <tr> <td><label>Enable</label></td>
					    <td>
					          <div id="toggle_refresh" 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><label for="ref_rate">Images</label></td>
							<td><input type="text" id="ref_rate" name="ref_rate" size="4">s</td>
						</tr><tr>
						    <td><label for="sref_rate">Status</label></td>
							<td><input type="text" id="sref_rate" name="sref_rate" size="4">s
					    </td> </tr>
					    </table>
				    </td>
				    <td>
					    <table><th><td colspan="2">SSD Recording<td> </th>
					    <tr><td><label>Record</label></td>
					      <td><div id="toggle_record" 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><label id = "root_dir" for="ssd_directory">/mnt/sda1/</label></td>
							 <td><input type="text" id="dir_name" name="ssd_directory" size="10"></td>
					    </tr><tr><td colspan="2">&nbsp;</td></tr></table>
				    </td>
			    </tr> 
		    </table>
         </div>
         <button type="button" class="collapsible">Eyesis Controls</button>
		 <div id='settings'>
		    <table>
@@ -57,6 +140,17 @@
							</div>
						</td>
		      </tr>

		      <tr id="manual_exposure_div" title='Manual Exposure'>
		        <td><label for="exposure_ms">Manual</label></td>
		        <td><input type="text" id="exposure_ms" name="exposure_ms" size="6" value="50">ms</td>
		      </tr>

		      <tr id="image_quality_div" title='Image Quality'>
		        <td><label for="jpeg_quality">Quality</label></td>
		        <td><input type="text" id="jpeg_quality" name="jpeg_quality" size="6" value="97">%</td>
		      </tr>

		      <tr>
		        <td>
		          <button id='system_tests' title='system info' class="btn btn-sm btn-success">tests</button>
Loading