...
 
Commits (64)
# Runs 'make', 'make install', and 'make clean' in specified subdirectories
SUBDIRS := src/php_top src/python_tests src/debugfs-webgui src/jp4-canvas src/update src/eyesis4pi src/index src/pointers src/snapshot src/jp4-viewer src/photofinish src/multicam src/diagnostics # src1
SUBDIRS := src/php_top src/python_tests src/debugfs-webgui src/jp4-canvas src/update src/eyesis4pi \
src/index src/pointers src/snapshot src/jp4-viewer src/photofinish src/multicam src/diagnostics src/lwir16 # src1
INSTALLDIRS = $(SUBDIRS:%=install-%)
CLEANDIRS = $(SUBDIRS:%=clean-%)
......
......@@ -21,18 +21,33 @@
<builder arguments="web-393" command="${workspace_loc:/elphel-web-393/scripts/run_bitbake.sh}" enableCleanBuild="false" enabledIncrementalBuild="true" id="org.eclipse.cdt.build.core.settings.default.builder.365026764" incrementalBuildTarget="-c install -f" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="org.eclipse.cdt.build.core.settings.default.builder" />
<tool id="org.eclipse.cdt.build.core.settings.holder.libs.785882741" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs" />
<tool id="org.eclipse.cdt.build.core.settings.holder.982996495" name="Assembly" superClass="org.eclipse.cdt.build.core.settings.holder">
<option id="org.eclipse.cdt.build.core.settings.holder.symbols.772251241" superClass="org.eclipse.cdt.build.core.settings.holder.symbols" valueType="definedSymbols">
<listOptionValue builtIn="false" value="__arm__=1" />
</option>
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.8554647" languageId="org.eclipse.cdt.core.assembly" languageName="Assembly" sourceContentType="org.eclipse.cdt.core.asmSource" superClass="org.eclipse.cdt.build.core.settings.holder.inType" />
</tool>
<tool id="org.eclipse.cdt.build.core.settings.holder.480226500" name="GNU C++" superClass="org.eclipse.cdt.build.core.settings.holder">
<option id="org.eclipse.cdt.build.core.settings.holder.symbols.994702313" superClass="org.eclipse.cdt.build.core.settings.holder.symbols" valueType="definedSymbols">
<listOptionValue builtIn="false" value="__arm__=1" />
</option>
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1347472659" languageId="org.eclipse.cdt.core.g++" languageName="GNU C++" sourceContentType="org.eclipse.cdt.core.cxxSource,org.eclipse.cdt.core.cxxHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType" />
</tool>
<tool id="org.eclipse.cdt.build.core.settings.holder.1686385332" name="GNU C" superClass="org.eclipse.cdt.build.core.settings.holder">
<option id="org.eclipse.cdt.build.core.settings.holder.symbols.1940520547" superClass="org.eclipse.cdt.build.core.settings.holder.symbols" valueType="definedSymbols">
<listOptionValue builtIn="false" value="__arm__=1" />
</option>
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.716913472" languageId="org.eclipse.cdt.core.gcc" languageName="GNU C" sourceContentType="org.eclipse.cdt.core.cSource,org.eclipse.cdt.core.cHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType" />
</tool>
<tool id="org.eclipse.cdt.build.core.settings.holder.559915258" name="LLVM bytecode assembly" superClass="org.eclipse.cdt.build.core.settings.holder">
<option id="org.eclipse.cdt.build.core.settings.holder.symbols.1625690961" superClass="org.eclipse.cdt.build.core.settings.holder.symbols" valueType="definedSymbols">
<listOptionValue builtIn="false" value="__arm__=1" />
</option>
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1886099197" languageId="org.eclipse.cdt.managedbuilder.llvm.ui.llvmAssembly" languageName="LLVM bytecode assembly" sourceContentType="org.eclipse.cdt.managedbuilder.llvm.ui.llvmAssemblySource" superClass="org.eclipse.cdt.build.core.settings.holder.inType" />
</tool>
<tool id="org.eclipse.cdt.build.core.settings.holder.1960214219" name="UPC" superClass="org.eclipse.cdt.build.core.settings.holder">
<option id="org.eclipse.cdt.build.core.settings.holder.symbols.1302332589" superClass="org.eclipse.cdt.build.core.settings.holder.symbols" valueType="definedSymbols">
<listOptionValue builtIn="false" value="__arm__=1" />
</option>
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1593701683" languageId="org.eclipse.cdt.core.parser.upc.upc" languageName="UPC" sourceContentType="org.eclipse.cdt.core.parser.upc.upcSource" superClass="org.eclipse.cdt.build.core.settings.holder.inType" />
</tool>
</toolChain>
......@@ -60,4 +75,5 @@
<resource resourceType="PROJECT" workspacePath="/elphel-web-393" />
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets" />
</cproject>
\ No newline at end of file
......@@ -2,8 +2,11 @@ DOCUMENTROOT=$(DESTDIR)/www/pages
OWN = -o root -g root
INSTDOCS = 0644
INSTALL = install
DOCS= index.html \
index.php
DOCS= img.html \
index.html \
index.php \
index1.php \
mjpeg.html
all:
@echo "make all in src"
......
<html>
<head>
<style>
body {
margin: 0px;
}
#cnv_div {
border: 0px solid red;
}
#display{
height: 100%;
}
</style>
</head>
<body>
<div id='cnv_div'></div>
<script src="js/elphel.js"></script>
<script src="js/UTIF.js"></script>
<script src="js/jquery-3.1.1.js"></script>
<script src="js/jcanvas.js"></script>
<script src="js/exif.js"></script>
<script src="js/jquery-jp4.js"></script>
<script>
const IMGSRV_PORT0 = 2323;
const params = new URLSearchParams(location.search);
const port = params.get('port') || 0;
const refresh = params.get('refresh') || 5;
if (params.get('port')===null){
let s = "";
if (location.search===""){
s = "?port="+port;
}else{
s = location.search+"&port="+port;
}
window.history.pushState('', '', location.pathname+s);
}
let imgsrv_port = IMGSRV_PORT0 + parseInt(port);
let t1 = $("#cnv_div").jp4({src:"http://"+location.host+":"+imgsrv_port+"/img",width:1600,fast:true,lowres:2,debug:false,refresh:true});
</script>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
<html>
<head>
<style>
body {
margin: 0px;
}
canvas {
height: 100%;
border: 0px solid red;
}
</style>
</head>
<body>
<canvas id='cnv'></canvas>
<script>
const IMGSRV_PORT0 = 2323;
const params = new URLSearchParams(location.search);
const port = params.get('port') || 0;
const refresh = params.get('refresh') || 5;
if (params.get('port')===null){
let s = "";
if (location.search===""){
s = "?port="+port;
}else{
s = location.search+"&port="+port;
}
window.history.pushState('', '', location.pathname+s);
}
let imgsrv_port = IMGSRV_PORT0 + parseInt(port);
let cnv = document.getElementById('cnv');
let ctx = cnv.getContext('2d');
let img = new Image();
img.onload = function() {
canvas_resize();
refreshCanvas();
};
img.src = location.origin+":"+imgsrv_port+"/mimg";
window.addEventListener("resize", ()=>{
canvas_resize();
});
///////////////////////////////////////////////////////////////////////////////////
function canvas_resize(){
ctx.canvas.width = img.width;
ctx.canvas.height = img.height;
}
window.setInterval("refreshCanvas()", refresh);
function refreshCanvas(){
try{
ctx.drawImage(img,0,0,ctx.canvas.width,ctx.canvas.height);
}catch(err){
img.src = location.origin+":2323/mimg";
}
};
</script>
</body>
</html>
\ No newline at end of file
......@@ -7,6 +7,7 @@ DOCS= jp4-canvas.html \
LIBS= elphel.js \
exif.js \
UTIF.js \
jquery-jp4.js \
jcanvas.js \
webworker.js
......
This diff is collapsed.
......@@ -129,13 +129,13 @@ var Elphel = {
* @lowres - valid values: 1 (not scaled), 2, 4, 8 (lowest resolution)
*
*/
reorderBlocksJP4_lowres: function(pixels,width,height,format="JP4",mosaic=[["Gr","R"],["B" ,"Gb"]],lowres){
//reorderBlocksJP4_lowres: function(pixels,width,height,format="JP4",mosaic=[["Gr","R"],["B" ,"Gb"]],lowres){
reorderBlocksJP4_lowres: async function(pixels,width,height,format="JP4",mosaic=[["Gr","R"],["B" ,"Gb"]],lowres){
// the output image is 1/4 because demosaicing = 4 single color channel pixels are put into 1 rgb pixel
var oPixels = new Uint8Array(pixels.length/4);
// check
if ((lowres!=1)&&(lowres!=2)&&(lowres!=4)&&(lowres!=8)){
if (![1,2,4,8].includes(lowres)){
lowres = 4;
}
......@@ -692,4 +692,4 @@ var Elphel = {
console.log("Test message from elphel.js: ok");
}
}
\ No newline at end of file
}
......@@ -44,10 +44,26 @@ $port0 = 2323;
$pointers = elphel_get_circbuf_pointers(intval($port)-$port0,1);
$pointer = $pointers[count($pointers)-1]['circbuf_pointer'];
$contents = file_get_contents("http://$ip:$port/$rel");
$acao = "*";
$ct = "image/jpeg";
// pass some headers from file_get_contents
// $http_response_header is auto populated
foreach($http_response_header as $h){
$hv = explode(":",$h);
if ($hv[0]=="Access-Control-Allow-Origin"){
$acao = trim($hv[1]);
}else if ($hv[0]=="Content-Type"){
$ct = trim($hv[1]);
}
}
// allow CORS
header('Access-Control-Allow-Origin: *');
header('Content-type:image/jpeg');
echo file_get_contents("http://$ip:$port/$pointer/$rel");
header("Access-Control-Allow-Origin: $acao");
header("Content-Type: $ct");
echo $contents;
//echo file_get_contents("http://$ip:$port/$rel");
die();
......
......@@ -7,15 +7,16 @@
<body>
<table>
<tr>
<td><div id='test1'></div></td>
<td><div id='test2'></div></td>
<td valign='top'><div id='test1'></div></td>
<td valign='top'><div id='test2'></div></td>
</tr>
<tr>
<td><div id='test3'></div></td>
<td><div id='test4'></div></td>
<td valign='top'><div id='test3'></div></td>
<td valign='top'><div id='test4'></div></td>
</tr>
</table>
<script src="js/elphel.js"></script>
<script src="js/UTIF.js"></script>
<script src="js/jquery-3.1.1.js"></script>
<script src="js/jcanvas.js"></script>
<script src="js/exif.js"></script>
......
......@@ -26,10 +26,10 @@
*/
$(function(){
var t1 = $("#test1").jp4({ip:"127.0.0.1",port:2323,width:600,fast:true,lowres:4});
var t2 = $("#test2").jp4({ip:"127.0.0.1",port:2324,width:600,fast:true,lowres:4});
var t3 = $("#test3").jp4({ip:"127.0.0.1",port:2325,width:600,fast:true,lowres:4});
var t4 = $("#test4").jp4({ip:"127.0.0.1",port:2326,width:600,fast:true,lowres:4});
let t1 = $("#test1").jp4({src:"http://"+location.host+":"+2323+"/img",width:600,fast:true,lowres:4,debug:false,refresh:false});
let t2 = $("#test2").jp4({src:"http://"+location.host+":"+2324+"/img",width:600,fast:true,lowres:4,debug:false,refresh:false});
let t3 = $("#test3").jp4({src:"http://"+location.host+":"+2325+"/img",width:600,fast:true,lowres:4,debug:false,refresh:false});
let t4 = $("#test4").jp4({src:"http://"+location.host+":"+2326+"/img",width:600,fast:true,lowres:4,debug:false,refresh:false});
});
This diff is collapsed.
importScripts('elphel.js');
self.onmessage = function(e) {
var W = e.data.width;
var H = e.data.height;
var Mosaic = e.data.mosaic;
var Format = e.data.format;
var settings = e.data.settings;
var Pixels = new Uint8Array(e.data.pixels);
if (settings.lowres==0){
var reorderedPixels = Elphel.Pixels.reorderBlocksJPx(Pixels,W,H,Format,Mosaic,settings.fast);
//reorder first then downscale
if (settings.fast){
W = W/2;
H = H/2;
onmessage = async (e) => {
let W = e.data.width;
let H = e.data.height;
let Mosaic = e.data.mosaic;
let Format = e.data.format;
let settings = e.data.settings;
let Pixels = new Uint8Array(e.data.pixels);
let reorderedPixels;
if (settings.lowres==0){
reorderedPixels = Elphel.Pixels.reorderBlocksJPx(Pixels,W,H,Format,Mosaic,settings.fast);
//reorder first then downscale
if (settings.fast){
W = W/2;
H = H/2;
}
}else{
reorderedPixels = await Elphel.Pixels.reorderBlocksJP4_lowres(Pixels,W,H,Format,Mosaic,settings.lowres);
W = W/2;
H = H/2;
}
}else{
var reorderedPixels = Elphel.Pixels.reorderBlocksJP4_lowres(Pixels,W,H,Format,Mosaic,settings.lowres);
W = W/2;
H = H/2;
}
Elphel.Pixels.applySaturation(reorderedPixels,W,H,2);
postMessage({
width: W,
height: H,
pixels: reorderedPixels.buffer
},[reorderedPixels.buffer]);
Elphel.Pixels.applySaturation(reorderedPixels,W,H,2);
//Elphel.test();
this.close();
postMessage({
width: W,
height: H,
pixels: reorderedPixels.buffer
},[reorderedPixels.buffer]);
};
\ No newline at end of file
//Elphel.test();
this.close();
};
......@@ -8,6 +8,7 @@
<script src="../js/jquery-3.1.1.js"></script>
<script src="../js/jcanvas.js"></script>
<script src="../js/exif.js"></script>
<script src="../js/UTIF.js"></script>
<script src="../js/jquery-jp4.js"></script>
<script type='text/javascript' src='jp4-viewer.js'></script>
......
......@@ -27,7 +27,7 @@ function parseURL(){
$(function(){
$.ajax({
url: "http://192.168.0.9:2323",
url: location.host+":2323",
success: function(){
console.log("success");
}
......@@ -54,6 +54,8 @@ function handleImage(e) {
reader.onload = function(event){
//$("#smallimage").attr("src",event.target.result);
console.log("File loaded");
$("#jp4view").html("");
var view = $("<div>",{id:"img"});
......@@ -63,7 +65,7 @@ function handleImage(e) {
//console.log(SETTINGS.width);
view.jp4({image:myimg, fromhtmlinput: true, width:SETTINGS.width,fast:true, lowres:SETTINGS.quality, webworker_path:"../js"});
view.jp4({src:myimg, fromhtmlinput: true, width:SETTINGS.width,fast:true, lowres:SETTINGS.quality, webworker_path:"../js"});
//view.jp4({image:"test.jp4", input: false, width:1200,fast:true, lowres:1});
$("#jp4view").append(view);
......
DOCUMENTROOT=$(DESTDIR)/www/pages/lwir16
OWN = -o root -g root
INSTDOCS = 0644
INSTEXE = 0755
SYSCONFDIR =/etc
CONFDIR = $(SYSCONFDIR)/elphel393
INSTALL = install
DOCS= index.html
PHP_SCRIPTS_EXE=lwir16.php \
test_int.php \
test_wpipe.php \
test_ps.php
CONFIGS = lwir16.ini
all:
@echo "make all in src"
install:
@echo "make install in src"
$(INSTALL) $(OWN) -d $(DOCUMENTROOT)
$(INSTALL) $(OWN) -m $(INSTDOCS) $(DOCS) $(DOCUMENTROOT)
$(INSTALL) $(OWN) -m $(INSTEXE) $(PHP_SCRIPTS_EXE) $(DOCUMENTROOT)
$(INSTALL) -d $(DESTDIR)$(SYSCONFDIR)
$(INSTALL) -d $(DESTDIR)$(CONFDIR)
$(INSTALL) $(OWN) -m $(INSTDOCS) $(CONFIGS) $(DESTDIR)$(CONFDIR)
clean:
@echo "make clean in src"
This diff is collapsed.
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
pre_delay = 3.0
ffc_period = 30.0
ffc_groups = 2
ffc_frames = 8
ffc = 1
tiff_telem = 1
tiff_mn = 0
tiff_mx = 65535
tiff_bin_shift = 1
tiff_auto = 0
debug = 1
# no spaces around commas!
CMD = INIT,START
\ No newline at end of file
This diff is collapsed.
#!/usr/bin/php
<?php
set_include_path ( get_include_path () . PATH_SEPARATOR . '/www/pages/include' );
include 'show_source_include.php';
include "elphel_functions_include.php"; // includes curl functions
$pipe_cmd="/tmp/pipe_cmd";
$pipe_response="/tmp/pipe_response";
$mode=0600;
declare(ticks = 1);
pcntl_signal(SIGTERM, "signal_handler");
pcntl_signal(SIGINT, "signal_handler");
function signal_handler($signal) {
switch($signal) {
case SIGTERM:
print "Caught SIGTERM\n";
exit;
case SIGKILL:
print "Caught SIGKILL\n";
exit;
case SIGINT:
print "Caught SIGINT\n";
exit;
}
}
if(file_exists($pipe_cmd)){
unlink($pipe_cmd); //delete pipe if it was already there - waiting prevents signal handling!
}
while(1) {
if(file_exists($pipe_cmd)) {
//block and read from the pipe
$f = fopen($pipe_cmd,"r");
echo "(r) opened cmd\n";
$l = fgets($f);
fclose ($f);
echo "(r) closed cmd\n";
unlink($pipe_cmd); //delete pipe
echo "(r) deleted cmd\n";
if(!file_exists($pipe_response)) {
// create the pipe
umask(0);
posix_mkfifo($pipe_response,$mode);
}
$fr = fopen($pipe_response,"w");
fwrite($fr,"response1: ".$l);
fwrite($fr,"response2: ".$l);
fwrite($fr,"response3: ".$l);
echo "(r) sent responses\n";
sleep(1);
fclose ($fr);
echo "(r) closed response pipe\n";
}
//
}
?>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.