...
 
Commits (159)
......@@ -11,3 +11,12 @@ sysroots
bitbake-logs
temp
all_sources.lst
excluding.lst
including.lst
doxygen.tag
/image
/scripts
/html
# Runs 'make', 'make install', and 'make clean' in specified subdirectories
SUBDIRS := src/php_top src/python_tests src/debugfs-webgui # 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 # src1
INSTALLDIRS = $(SUBDIRS:%=install-%)
CLEANDIRS = $(SUBDIRS:%=clean-%)
......@@ -14,13 +14,13 @@ $(SUBDIRS):
install: $(INSTALLDIRS)
echo "make install top"
$(INSTALLDIRS):
$(INSTALLDIRS):
$(MAKE) -C $(@:install-%=%) install
clean: $(CLEANDIRS)
@echo "make clean top"
$(CLEANDIRS):
$(CLEANDIRS):
$(MAKE) -C $(@:clean-%=%) clean
.PHONY: all install clean $(SUBDIRS) $(INSTALLDIRS) $(CLEANDIRS)
......
......@@ -3,61 +3,61 @@
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="0.1221820363">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="0.1221820363" moduleId="org.eclipse.cdt.core.settings" name="Default">
<externalSettings/>
<externalSettings />
<extensions>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser" />
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser" />
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser" />
<extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser" />
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser" />
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser" />
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildProperties="" description="" id="0.1221820363" name="Default" parent="org.eclipse.cdt.build.core.prefbase.cfg">
<folderInfo id="0.1221820363." name="/" resourcePath="">
<toolChain id="org.eclipse.cdt.build.core.prefbase.toolchain.1043274217" name="No ToolChain" resourceTypeBasedDiscovery="false" superClass="org.eclipse.cdt.build.core.prefbase.toolchain">
<targetPlatform id="org.eclipse.cdt.build.core.prefbase.toolchain.1043274217.1071800033" name=""/>
<builder arguments="web-393" command="${workspace_loc:/elphel-web-393/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"/>
<targetPlatform id="org.eclipse.cdt.build.core.prefbase.toolchain.1043274217.1071800033" name="" />
<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">
<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"/>
<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">
<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"/>
<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">
<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"/>
<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">
<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"/>
<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">
<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"/>
<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>
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="src"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="src" />
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings" />
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="elphel-web-393.null.1071524317" name="elphel-web-393"/>
<project id="elphel-web-393.null.1071524317" name="elphel-web-393" />
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="" />
<scannerConfigBuildInfo instanceId="0.1221820363">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="" />
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders" />
<storageModule moduleId="refreshScope" versionNumber="2">
<configuration configurationName="Default">
<resource resourceType="PROJECT" workspacePath="/elphel-web-393"/>
<resource resourceType="PROJECT" workspacePath="/elphel-web-393" />
</configuration>
</storageModule>
</cproject>
</cproject>
\ No newline at end of file
......@@ -2,7 +2,7 @@
<launchConfiguration type="org.eclipse.ui.externaltools.ProgramBuilderLaunchConfigurationType">
<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED" value="true"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/elphel-web-393/run_bitbake.sh}"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/elphel-web-393/scripts/run_bitbake.sh}"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="incremental,"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="web-393 -c target_scp -f"/>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
......
......@@ -53,4 +53,51 @@ input {
.tp{
width:20px;
height:20px;
}
\ No newline at end of file
}
#some-cog{
font-size:30px;
margin-right:5px;
}
.gly-spin {
-webkit-animation: spin 0.13s infinite linear;
-moz-animation: spin 0.13s infinite linear;
-o-animation: spin 0.13s infinite linear;
animation: spin 0.13s infinite linear;
}
@-moz-keyframes spin {
0% {
-moz-transform: rotate(0deg);
}
100% {
-moz-transform: rotate(359deg);
}
}
@-webkit-keyframes spin {
0% {
-webkit-transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(359deg);
}
}
@-o-keyframes spin {
0% {
-o-transform: rotate(0deg);
}
100% {
-o-transform: rotate(359deg);
}
}
@keyframes spin {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(359deg);
transform: rotate(359deg);
}
}
<html>
<!DOCTYPE html>
<html lang="en">
<head>
<script src="js/jquery-2.2.3.min.js"></script>
<meta charset="utf-8"/>
<script src="js/jquery-2.2.3.js"></script>
<script src="jquery.ajax.queue.js"></script>
<script src="debugfs.js"></script>
<script src="js/bootstrap/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="js/bootstrap/css/bootstrap.min.css"/>
<script src="js/bootstrap/js/bootstrap.js"></script>
<link rel="stylesheet" href="js/bootstrap/css/bootstrap.css"/>
<link rel="stylesheet" href="debugfs.css"/>
</head>
<body onload='init()'>
<body>
</body>
</html>
\ No newline at end of file
/*
FILE NAME : debugfs.js
DESCRIPTION: dynamic debug frontend
REVISION: 1.00
AUTHOR: Oleg Dzhimiev <oleg@elphel.com>
LICENSE: AGPL, see http://www.gnu.org/licenses/agpl.txt
Copyright (C) 2016 Elphel, Inc.
*/
/**
* @file debugfs.js
* @brief debugfs js
* @copyright Copyright (C) 2016 Elphel Inc.
* @author Oleg Dzhimiev <oleg@elphel.com>
*
* @licstart The following is the entire license notice for the
* JavaScript code in this page.
*
* The JavaScript code in this page is free software: you can
* redistribute it and/or modify it under the terms of the GNU
* General Public License (GNU GPL) as published by the Free Software
* Foundation, either version 3 of the License, or (at your option)
* any later version. The code is distributed WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
*
* As additional permission under GNU GPL version 3 section 7, you
* may distribute non-source (e.g., minimized or compacted) forms of
* that code without the copy of the GNU GPL normally required by
* section 4, provided you include this license notice and a URL
* through which recipients can access the Corresponding Source.
*
* @licend The above is the entire license notice
* for the JavaScript code in this page.
*/
window.onload = function(){
init();
}
var CUT_STRING_LIMIT = 20;
var NLINES = 30;
......@@ -40,9 +62,11 @@ function init(){
}).css({margin:"0px 0px 0px 10px"}).html("Save to persistent storage");
b1.click(function(){
spin_start();
$.ajax({
url: "debugfs.php?cmd=savetofs",
queue: true
queue: true,
success: spin_stop
});
});
......@@ -52,9 +76,11 @@ function init(){
}).css({margin:"0px 0px 0px 10px"}).html("Apply to debugfs");
b2.click(function(){
spin_start();
$.ajax({
url: "debugfs.php?cmd=restore",
queue: true
queue: true,
success: spin_stop
});
});
......@@ -72,7 +98,7 @@ function init(){
f1.html("&nbsp;l&nbsp;").append(f1_cb);
f2.html("&nbsp;m&nbsp;").append(f2_cb);
f3.html("&nbsp;t&nbsp;").append(f3_cb);
var b3 = $("<button>",{
title: "Enable/disable debug messages for selected files"
}).css({
......@@ -80,27 +106,43 @@ function init(){
}).html("Switch off debug").click(function(){
if ($(this).html()=="Switch off debug"){
$(this).html("Switch on debug");
spin_start();
$.ajax({
url: "debugfs.php?cmd=setflag&flag=-p",
queue: true
queue: true,
success: spin_stop
});
}else{
$(this).html("Switch off debug");
spin_start();
$.ajax({
url: "debugfs.php?cmd=restore",
queue: true
queue: true,
success: spin_stop
});
}
});
$("body").append($("<div>",{id:"control_panel"}).css({
padding:"15px 20px 20px 20px",
padding:"15px 60px 20px 20px",
background: "rgba(100,200,100,1)",
position: "fixed",
"z-index": "100",
border: "1px solid rgba(180,180,180,0.5)"
}).append(b0).append(b1).append(b2).append(b3).append(f0).append(f1).append(f2).append(f3));
var busy_icon = $("<span>",{id:"some-cog",class:"glyphicon glyphicon-globe"}).css({
position: "absolute",
top: Math.floor($("#control_panel").outerHeight(true)/2-17)+"px",
right: "12px"
});
$("#control_panel").append(busy_icon);
spin_start();
//busy_icon.addClass("glyphicon glyphicon-globe");
var shift = $("#control_panel").outerHeight(true)+parseInt($("#control_panel").css("top"),10)+2;
//list header
......@@ -174,10 +216,13 @@ function init(){
else sign = "-";
flag = $(this).attr("id")[0];
spin_start();
$.ajax({
url: "debugfs.php?cmd=setflag&flag="+sign+flag,
queue: true
queue: true,
success: spin_stop
});
});
......@@ -188,10 +233,20 @@ function init(){
//when everything is parsed. do something.
// apply config to debugfs
$("#b2").click();
spin_stop();
}
});
}
function spin_start(){
$("#some-cog").addClass("gly-spin");
}
function spin_stop(){
$("#some-cog").removeClass("gly-spin");
}
function fill_content(record,index,target){
target.html("");
......@@ -271,9 +326,11 @@ function fill_content_rebind_events(){
debugfs_data[index].configs[j].lines[subindex].flags = flags;
//console.log($(this).attr("file")+", "+$(this).attr("line")+", "+$(this).prop("checked"));
spin_start();
$.ajax({
url: "debugfs.php?cmd=echo&conf="+j+"&file="+$(this).attr("file")+"&line="+$(this).attr("line")+"&flags="+flags,
queue: true
queue: true,
success: spin_stop
});
});
......@@ -354,6 +411,7 @@ function init_ui_controls(record,index){
var id = $(this).attr("id");
id = id.substr(id.indexOf("_")+1);
file = $(this).attr("file");
spin_start();
$.ajax({
url:"debugfs.php?cmd=reread&file="+file,
queue: true,
......@@ -390,6 +448,7 @@ function init_ui_controls(record,index){
fill_content_rebind_events();
update_debugfs_config(id);
spin_stop();
}
});
});
......@@ -544,11 +603,13 @@ function dropdown_select_config(index,config_index){
function update_debugfs_config(index){
var file = debugfs_data[index].file;
console.log("syncing debugfs config");
spin_start();
//console.log(debugfs_data);
$.ajax({
type: "POST",
url: "debugfs.php?cmd=sync&file="+file,
data: JSON.stringify(debugfs_data),
dataType: "json"
dataType: "json",
complete:spin_stop
});
}
<?php
/*
FILE NAME : debugfs.php
DESCRIPTION: dynamic debug backend
REVISION: 1.00
AUTHOR: Oleg Dzhimiev <oleg@elphel.com>
LICENSE: AGPL, see http://www.gnu.org/licenses/agpl.txt
Copyright (C) 2016 Elphel, Inc.
/**
* @file debugfs.php
* @brief debugfs interface backend
* @copyright Copyright (C) 2016 Elphel Inc.
* @author Oleg Dzhimiev <oleg@elphel.com>
*
* @par <b>License</b>:
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//globals
......@@ -224,7 +236,11 @@ function filter_record_by_file($a,$f){
return $res;
}
// default CT is text/html - LibreJS can add extra tags: <html><head></head><body>response</body></html>
header("Content-Type: text/plain");
if ($cmd=="do_nothing"){
if (isset($_GET['file'])) $file = $_GET['file'];
else $file = $DEBUGFSFILE;
......
DOCUMENTROOT=$(DESTDIR)/www/pages
OWN = -o root -g root
INSTDOCS = 0644
INSTALL = install
DOCS= index.html \
diagnostics.js \
diagnostics.css
PHP_SCRIPTS= diagnostics.php
all:
@echo "make all in src"
install:
@echo "make install in src"
$(INSTALL) $(OWN) -d $(DOCUMENTROOT) $(DOCUMENTROOT)/diagnostics
$(INSTALL) $(OWN) -m $(INSTDOCS) $(DOCS) $(DOCUMENTROOT)/diagnostics
$(INSTALL) $(OWN) -m $(INSTDOCS) $(PHP_SCRIPTS) $(DOCUMENTROOT)
clean:
@echo "make clean in src"
#display_general, #display_pars, #display_ts{
padding:5px;
}
#gen_table th, #pars_table th, #ts_table th{
padding: 2px 5px;
text-align:center;
border: 1px solid rgb(150,150,150);
}
#gen_table td{
padding: 2px 5px;
text-align:center;
border: 1px solid rgb(150,150,150);
}
#pars_table td, #ts_table td{
padding: 0px 5px;
border: 1px solid rgb(150,150,150);
}
.center{
text-align:center;
}
.right{
text-align:right;
}
.left{
text-align:left;
}
h4{
padding:0px 5px;
}
.vtop{
vertical-align:top;
}
.timestamps{
font-size: 0.9em;
}
.framenumbers{
font-size: 0.9em;
}
\ No newline at end of file
This diff is collapsed.
<?php
// GLOBALS
// path to sysfs for port scanning
$portspath = "/sys/devices/soc0/elphel393-detect_sensors@0";
// total number of ports in 10393
$nports = 4;
$muxports = 3;
$port0 = 2323;
$ports = getports();
$sample_port = get_sample_port($ports);
$master_port = elphel_get_P_value($sample_port,ELPHEL_TRIG_MASTER);
//print("<pre>");
//print_r($ports);
//print("sample port = ".$sample_port);
if (isset($_GET['pointers'])){
$POINTERS_ONLY = true;
}else{
$POINTERS_ONLY = false;
}
$res = "";
$res .= "<camera ip='".$_SERVER['SERVER_ADDR']."'>\n";
if (!$POINTERS_ONLY){
$res .= "\t<master_port>".$master_port."</master_port>\n";
$res .= "\t<systime>".get_system_time()."</systime>\n";
$res .= "\t<systimestamp>".time()."</systimestamp>\n";
$res .= "\t<uptime>".get_uptime()."</uptime>\n";
$res .= "\t<temperature>".get_temperature()."\t</temperature>\n";
$res .= "\t<storage>".check_storage()."\t</storage>\n";
$res .= "\t<recorder name='camogm'>".check_camogm_running()."</recorder>\n";
$res .= "\t<gps>".check_gps($master_port)."\t</gps>\n";
}
for($i=0;$i<count($ports);$i++){
$s = implode(', ',$ports[$i]['sensors']);
$m = $ports[$i]['mux'];
$res .= "\t<port index='$i' sensor='$s' mux='$m'>".get_port_info($i)."\t</port>\n";
}
$res .= "</camera>\n";
// allow CORS
header('Access-Control-Allow-Origin: *');
$xml = "<?xml version='1.0' standalone='yes'?>\n";
$xml .= "<Document>\n";
$xml .= $res;
$xml .= "</Document>\n";
print($xml);
//functions
function check_camogm_running(){
$camogm_running = false;
exec('ps | grep "camogm"', $arr);
$check = implode("<br/>",$arr);
foreach($arr as $line){
$result = preg_match('/grep/',$line);
if (!$result) {
$camogm_running = true;
}
}
if ($camogm_running) $res = "on";
else $res = "off";
return $res;
}
function getports(){
global $nports, $muxports, $portspath, $port0;
$res = array();
for($i=0;$i<$nports;$i++){
$subres = array();
$subres['mux'] = read_port_file($portspath."/port_mux{$i}");
$subres['sensors'] = array();
for($j=0;$j<$muxports+1;$j++){
array_push($subres['sensors'],read_port_file($portspath."/sensor{$i}{$j}"));
}
array_push($res,$subres);
}
return $res;
}
function read_port_file($file){
$v = "";
if(is_file($file)){
$v = trim(file_get_contents($file));
}
return $v;
}
function get_sample_port($a){
$sample_found = false;
// errors are not expected here
//$res = -1;
$res = 0;
foreach($a as $k0=>$port){
$b = $port['sensors'];
foreach($b as $k1=>$sensor){
if ($sensor!='none'){
$sample_found = true;
break;
}
}
if ($sample_found){
$res = $k0;
break;
}
}
return $res;
}
function check_storage(){
$names = array();
$regexp = '/([0-9]+) +(sd[a-z0-9]+$)/';
exec("cat /proc/partitions", $partitions);
// the first two elements of an array are table header and empty line delimiter, skip them
for ($i = 2; $i < count($partitions); $i++) {
// select SATA devices only
if (preg_match($regexp, $partitions[$i], $name) == 1) {
$names[$name[2]] = $name[1];
$j++;
}
}
//print_r($names);
$res = "";
foreach($names as $name=>$size){
if (preg_match('/^sd[a-z]$/',$name,$matches)) {
$dev = $matches[0];
$res .= "\n\t\t<device name='$dev' size='$size'>\n";
foreach($names as $partition=>$psize){
if (preg_match('/^'.$dev.'[0-9]+$/',$partition)){
$res .= "\t\t\t<partition name='$partition' size='$psize'></partition>\n";
}
}
$res .= "\t\t</device>\n";
}
}
return $res;
}
function check_gps($port){
$circbuf_pointers = elphel_get_circbuf_pointers($port,1);
$pointer = $circbuf_pointers[count($circbuf_pointers)-1];
$exif = elphel_get_exif_elphel($port,$pointer['exif_pointer']);
if ((isset($exif['GPSLongitude']))&&(isset($exif['GPSLatitude']))){
$res = "\n";
$res .= "\t\t<lat>".$exif['GPSLatitude']."</lat>\n";
$res .= "\t\t<lon>".$exif['GPSLongitude']."</lon>\n";
}else{
$res = "N/A";
}
return $res;
}
function get_system_time(){
$res = exec('date');
return $res;
}
function get_uptime(){
$res = exec('uptime');
$res = trim($res);
$res = preg_replace('/\s+/',' ',$res);
$res = explode(' ',$res);
$out = trim($res[2],',');
return $out;
}
function get_temperature(){
$t_cpu = round(floatval(trim(file_get_contents("/tmp/core_temp"))),1);
$t_10389 = "";
$t_sda = "";
$t_sdb = "";
$temp1_input = "/sys/devices/soc0/amba@0/e0004000.ps7-i2c/i2c-0/0-001a/hwmon/hwmon0/temp1_input";
if (is_file($temp1_input)){
$t_10389 = trim(file_get_contents($temp1_input));
$t_10389 = intval($t_10389)/1000;
}
$t_sda = exec("smartctl -A /dev/sda | egrep ^194 | awk '{print $10}'");
if ($t_sda=="") $t_sda = "-";
else $t_sda = intval($t_sda);
$t_sdb = exec("smartctl -A /dev/sdb | egrep ^194 | awk '{print $10}'");
$t_sdb = "";
if ($t_sdb=="") $t_sdb = "-";
else $t_sdb = intval($t_sdb);
$res = "\n\t\t<cpu>$t_cpu</cpu>\n";
$res .= "\t\t<b10389>$t_10389</b10389>\n";
$res .= "\t\t<sda>$t_sda</sda>\n";
$res .= "\t\t<sdb>$t_sdb</sdb>\n";
return $res;
}
function get_port_info($port){
global $POINTERS_ONLY;
$pars_res = "";
$ts_res = "";
$pars = array(
'WB_EN' => 0,
'AUTOEXP_ON' => 0,
'COMPRESSOR_RUN'=> 0,
'SENSOR_RUN'=> 0,
'COLOR' => 0,
'QUALITY' => 0,
'EXPOS' => 0,
'WOI_WIDTH' => 0,
'WOI_HEIGHT' => 0,
'TRIG' => 0,
'TRIG_MASTER' => 0,
'TRIG_PERIOD' => 0,
'TRIG_CONDITION' => 0,
'TRIG_OUT' => 0,
'GAINR' => 0,
'GAING' => 0,
'GAINB' => 0,
'GAINGB' => 0,
);
$pars_res .= "\n";
if (!$POINTERS_ONLY){
$ps = elphel_get_P_arr($port,$pars);
$pars_res .= "\t\t<parameters>\n";
foreach($ps as $k=>$v){
$pars_res .= "\t\t\t<".strtolower($k).">$v</".strtolower($k).">\n";
}
$pars_res .= "\t\t</parameters>\n";
}
// get recent timestamps
$circbuf_pointers = elphel_get_circbuf_pointers($port,1);
$meta = array();
foreach($circbuf_pointers as $k=>$v){
$meta[$k] = array (
'circbuf_pointer' => $v['circbuf_pointer'],
'meta' => elphel_get_interframe_meta($port,$v['circbuf_pointer']),
'Exif' => elphel_get_exif_elphel($port, $v['exif_pointer'])
);
}
$ts_res .= "\t\t<timestamps>\n";
foreach($meta as $m){
$sec = $m['meta']['timestamp_sec'];
$usec = sprintf("%06d", $m['meta']['timestamp_usec']);
$ptr = $m['circbuf_pointer'];
$ts_res .= "\t\t\t<ts frame='{$m['Exif']['FrameNumber']}' ts='$sec.$usec' ptr='$ptr'>$sec.$usec</ts>\n";
}
$ts_res .= "\t\t</timestamps>\n";
$res = $pars_res.$ts_res;
return $res;
}
?>
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>System info</title>
<script src="../js/jquery-3.1.1.js"></script>
<link rel="stylesheet" href="../js/bootstrap/css/bootstrap.css">
<script type='text/javascript' src='diagnostics.js'></script>
<link rel='stylesheet' type='text/css' href='diagnostics.css'></link>
</head>
<body>
<h4>General info</h4>
<div id='display_general'>
<table id='gen_table'>
<tr>
<th>ip</th>
<th>time</th>
<th>uptime</th>
<th title='Temperature, &deg;C'>t</th>
<th>storage</th>
<th>camogm</th>
<th>master port</th>
<th>GPS</th>
<th>IMU</th>
</tr>
</table>
</div>
<h4>Port info</h4>
<div id='display_pars'>
<table id='pars_table'>
<tr>
<th>port</th>
<th>mux</th>
<th>sensors</th>
<th>sensor run</th>
<th>compressor run</th>
<th title='image format'>format</th>
<th>quality</th>
<th>wxh</th>
<th>TRIG</th>
<th>master</th>
<th title='TRIG_PERIOD'>period</th>
<th title='TRIG_OUT'>T_OUT</th>
<th title='TRIG_CONDITION'>T_COND</th>
<th>exposure</th>
<th>gainR</th>
<th>gainG</th>
<th>gainB</th>
<th>gainGB</th>
</tr>
</table>
</div>
<h4>Timestamps info</h4>
<div id='display_ts'>
<table id='ts_table'>
</table>
</div>
</body>
</html>
\ No newline at end of file
DOCUMENTROOT=$(DESTDIR)/www/pages
OWN = -o root -g root
INSTDOCS = 0644
INSTALL = install
DOCS= eyesis4pi_interface.php
all:
@echo "make all in src"
install:
@echo "make install in src"
$(INSTALL) $(OWN) -d $(DOCUMENTROOT)
$(INSTALL) $(OWN) -m $(INSTDOCS) $(DOCS) $(DOCUMENTROOT)
clean:
@echo "make clean in src"
<?php
/**
* @file eyesis4pi_interface.php
* @brief command interface for the eyesis4pi gui
* @copyright Copyright (C) 2016 Elphel Inc.
* @author Oleg Dzhimiev <oleg@elphel.com>
*
* @par <b>License</b>:
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
include 'include/elphel_functions_include.php';
$cmd = "donothing";
if (isset($_GET['cmd']))
$cmd = $_GET['cmd'];
else if (isset($argv[1]))
$cmd = $argv[1];
#hardcoded for eyesis4pi
$symlink = "/www/pages/ssd";
$mountpoint = "/mnt/sda1";
//$camogmdisk = "/home/root/camogm.disk";
$camogmdisk = "/mnt/sda1/camogm.disk";
$nandbootpath = "/tmp/rootfs.ro";
//if (is_dir($nandbootpath)) $camogmdisk = $nandbootpath.$camogmdisk;
$sysfs_lba_path = "/sys/devices/soc0/amba@0/80000000.elphel-ahci/";
$file_lba_start = $sysfs_lba_path."lba_start";
$file_lba_current = $sysfs_lba_path."lba_current";
$file_lba_end = $sysfs_lba_path."lba_end";
switch($cmd){
case "check_imu":
if (is_link("/dev/imu")) $res = 1;
else $res = 0;
echo $res;
break;
case "camogm_debug":
if (isset($_GET['debuglev'])){
$debuglev = $_GET['debuglev'];
}else{
$debuglev = 3;
}
if (isset($_GET['debug'])){
$debug = $_GET['debug'];
}else{
$debug = "/tmp/camogm.log";
}
exec("echo 'debug=$debug;debuglev=$debuglev' > /var/state/camogm_cmd");
echo "$cmd ok";
break;
case "camogm_kill":
exec("killall -9 camogm");
echo "$cmd ok";
break;
case "logs_download":
ini_set('memory_limit','512M');
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"{$_SERVER["SERVER_ADDR"]}.logs\"");
echo_file($sysfs_lba_path."io_error");
echo_file($file_lba_start);
echo_file($file_lba_current);
echo_file($file_lba_end);
echo_file($camogmdisk);
echo_file("/var/state/camera");
echo_file("/var/log/init_elphel393.log");
echo_file("/var/log/x393sata_control.log");
//echo_file("/var/log/x393sata_eyesis4pi.log");
echo_file("/var/state/ssd");
echo_file("/var/log/autocampars.log");
echo_file("/var/log/lighttpd.error.log");
echo_file("/var/log/lighttpd_stderr.log");
echo_file("/var/log/messages");
echo_file("/var/log/access.log");
echo_file("/tmp/camogm.log");
break;
case "external_drive":
switch_sata_connection("external");
echo "$cmd ok";
break;
case "internal_drive":
switch_sata_connection("internal");
echo "$cmd ok";
break;
case "symlink":
if (is_link($symlink)) die("already exists");
die(symlink($mountpoint,$symlink));
break;
case "free_space":
//sda1
if (is_dir($mountpoint)){
$sda1 = round(disk_free_space($mountpoint)/1024/1024/1024,2);
$sda1 .= "G";
}
//sda2
$lba_start = 0;
$lba_current = 0;
$lba_end = 0;
if (is_file($file_lba_start)) $lba_start = floatval(trim(file_get_contents($file_lba_start)));
if (is_file($file_lba_current)) $lba_current = floatval(trim(file_get_contents($file_lba_current)));
if (is_file($file_lba_end)) $lba_end = floatval(trim(file_get_contents($file_lba_end)));
if (($lba_start!=0)&&($lba_current!=0)&&($lba_end!=0)){
//$size = ((($lba_end>>10)&0x003fffff) - (($lba_current>>10)&0x003fffff))/2/1024;
$size = ($lba_end - $lba_current)/2/1024/1024;
$sda2 = round($size,2);
$sda2 .= "G";
}else{
// camogm.disk not found
if (!is_file($camogmdisk)){
$devices = get_raw_dev();
foreach($devices as $device=>$size){
//size in MB
if ($device=="/dev/sda2") {
$sda2 = round($size/1048576,2);
$sda2 .= "G";
}
}
}else{
//read camogm.disk file
$content = file_get_contents($camogmdisk);
$content = trim(preg_replace('/\n|\t{2,}/',"\t",$content));
$content_arr = explode("\t",$content);
if (count($content_arr)>=8){
$device = $content_arr[4];
$lba_current = $content_arr[6];
$lba_end = $content_arr[7];
$size = ($lba_end - $lba_current)/2/1024/1024;
$sda2 = round($size,2);
$sda2 .= "G";
}else{
//tmp
$devices = get_raw_dev();
foreach($devices as $device=>$size){
//size in MB
if ($device=="/dev/sda2") {
$sda2 = round($size/1048576,2);
$sda2 .= "G";
}
}
}
}
}
//respond_xml("{$sda1} {$sda2}");
respond_xml("{$sda1}");
break;
case "reset_camogm_fastrec":
// remove file
if (is_file($camogmdisk)){
unlink($camogmdisk);
}
// reset pointers
exec("echo 'rawdev_path=/dev/sda2' > /var/state/camogm_cmd");
//file_put_contents($file_lba_current,file_get_contents($file_lba_start));
print("reset fastrec: ok");
break;
case "refresh_camogm_fastrec":
exec("echo 'rawdev_path=/dev/sda2' > /var/state/camogm_cmd");
print("refresh fastrec: ok");
break;
case "free_space_bkp":
// results are in GB
// /dev/sda2 is not a mountpoint but a device because it does not have a file system
$res = 0;
if ($_GET['mountpoint']=="/dev/sda2"){
//root@elphel393:~# cat /home/root/camogm.disk
//Device Start LBA Current LBA End LBA
///dev/sda2 195334335 545641716 976768065
if (!is_file($camogmdisk)){
$devices = get_raw_dev();
foreach($devices as $device=>$size){
//size in MB
if ($device=="/dev/sda2") $res = round($size/1048576,2);
}
}else{
//read camogm.disk file
$res = 10;
}
}else{
if (is_dir($mountpoint)) $res = round(disk_free_space($mountpoint)/1024/1024/1024,2);
}
respond_xml($res);
break;
default:
print("nothing has been done");
}
function echo_file($f){
if (is_file($f)){
echo "$f:\n";
echo file_get_contents($f)."\n";
}else{
echo "$f: missing\n";
}
return 0;
}
function switch_sata_connection($mode){
global $mountpoint;
if ($mode=="external"){
exec("/usr/local/bin/x393sata_eyesis4pi_control.py set_zynq_esata");
}else if ($mode=="internal"){
exec("/usr/local/bin/x393sata_eyesis4pi_control.py set_zynq_ssd");
}
}
?>
DOCUMENTROOT=$(DESTDIR)/www/pages
OWN = -o root -g root
INSTDOCS = 0644
INSTALL = install
DOCS= index.html \
index.php
all:
@echo "make all in src"
install:
@echo "make install in src"
$(INSTALL) $(OWN) -d $(DOCUMENTROOT)
$(INSTALL) $(OWN) -m $(INSTDOCS) $(DOCS) $(DOCUMENTROOT)
clean:
@echo "make clean in src"
<html>
<head>
<title>Elphel 393</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<a href="#" onclick="window.open('camvc.html?sensor_port=0&reload=0', 'port 0','menubar=0, width=800, height=600, toolbar=0, location=0, personalbar=0, status=0, scrollbars=1')">Camera Control Interface - port 0</a><br />
<a href="#" onclick="window.open('camvc.html?sensor_port=1&reload=0', 'port 1','menubar=0, width=800, height=600, toolbar=0, location=0, personalbar=0, status=0, scrollbars=1')">Camera Control Interface - port 1</a><br />
<a href="#" onclick="window.open('camvc.html?sensor_port=2&reload=0', 'port 2','menubar=0, width=800, height=600, toolbar=0, location=0, personalbar=0, status=0, scrollbars=1')">Camera Control Interface - port 2</a><br />
<a href="#" onclick="window.open('camvc.html?sensor_port=3&reload=0', 'port 3','menubar=0, width=800, height=600, toolbar=0, location=0, personalbar=0, status=0, scrollbars=1')">Camera Control Interface - port 3</a><br />
<br />
<a href="autocampars.php">Parameter Editor</a><br />
<a href="camogmgui.php">Recorder</a><br />
<a href="hwmon.html">Temperature monitor</a><br />
<a title="update NAND flash" href="update_software.html">Update</a><br />
</body>
</html>
<?php
/**
* @file index.php
* @brief index page
* @copyright Copyright (C) 2017 Elphel Inc.
* @author Oleg Dzhimiev <oleg@elphel.com>
*
* @par <b>License</b>:
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
?>
<!doctype html>
<html lang="en">
<head>
<title>Elphel 393</title>
<meta charset="utf-8"/>
<script>
// for LibreJS:
/**
* @file index.php
* @copyright Copyright (C) 2017 Elphel Inc.
* @author -
*
* @licstart The following is the entire license notice for the
* JavaScript code in this page.
*
* The JavaScript code in this page is free software: you can
* redistribute it and/or modify it under the terms of the GNU
* General Public License (GNU GPL) as published by the Free Software
* Foundation, either version 3 of the License, or (at your option)
* any later version. The code is distributed WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
*
* As additional permission under GNU GPL version 3 section 7, you
* may distribute non-source (e.g., minimized or compacted) forms of
* that code without the copy of the GNU GPL normally required by
* section 4, provided you include this license notice and a URL
* through which recipients can access the Corresponding Source.
*
* @licend The above is the entire license notice
* for the JavaScript code in this page.
*/
</script>
<script type='text/javascript' src='js/jquery-3.1.1.js'></script>
<!--<script type='text/javascript' src='../js/bootstrap/js/bootstrap.js'></script>-->
<script src="js/elphel.js"></script>
<script src="js/jcanvas.js"></script>
<script src="js/exif.js"></script>
<script src="js/jquery-jp4.js"></script>
<link rel="stylesheet" href="js/bootstrap/css/bootstrap.css">
<style>
.port_window{
padding: 5px;
background: rgba(240,240,240,0.5);
border-radius: 2px;
}
.img_window{
border: 1px solid rgba(210,210,210,1);
}
.port_preview{
width:300px;
height:224px;
}
table td {
padding-right:10px;
}
.btn.active:focus, .btn:focus{
outline:none;
}
.btn-toggle{
padding: 1px 0px;
}
</style>
</head>
<body>
<div style='padding:10px'>
<?php
$port0 = 2323;
$path = "/sys/devices/soc0/elphel393-detect_sensors@0";
$table_contents = "";
$port_links = "";
$sample_port = -1;
for($i=0;$i<4;$i++){
$sensor = $path."/sensor{$i}0";
if (is_file($sensor)){
$c = trim(file_get_contents($sensor));
if ($c!="none"){
$sample_port = $i;
$sandp = "http://{$_SERVER["SERVER_ADDR"]}:".($port0+$i);
$href1 = "$sandp/bimg";
$href2 = "$sandp/mimg";
$table_contents .= "<td>";
$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\"><div index='$i' class='port_preview'></div></a></div>";
$table_contents .= "<div style='text-align:center;'>port $i: <a title='single image' href='$href1'>bimg</a>, <a title='multi-part image stream (M-JPEG)' href='$href2'>mimg</a></div>";
$table_contents .= "</div>";
$table_contents .= "</td>";
$port_links .= "<li><a href=\"#\" onclick=\"window.open('camvc.html?sensor_port=$i&reload=0', 'port $i','menubar=0, width=800, height=600, toolbar=0, location=0, personalbar=0, status=0, scrollbars=1')\">port $i</a></li>\n";
}
}
}
// check awb of master channel
$master_port = elphel_get_P_value($sample_port,ELPHEL_TRIG_MASTER);
$awb_on = elphel_get_P_value($master_port,ELPHEL_WB_EN);
$aexp_on = elphel_get_P_value($master_port,ELPHEL_AUTOEXP_ON);
echo "<table><tr>$table_contents</tr></table>\n";
echo "<br/>";
echo "Camera Control Interface<ul>$port_links</ul>\n";
?>
<table>
<tr id="toggle_awb" title='Auto White Balance'>
<td>
Auto WB:
</td>
<td>
<div id="toggle_awb" class="btn-group btn-toggle">
<button class="btn btn-xs <?php echo ($awb_on)?"btn-success active":"btn-default";?>">ON</button>
<button class="btn btn-xs <?php echo (!$awb_on)?"btn-danger active":"btn-default";?>">OFF</button>
</div>
</td>
</tr>
<tr id="toggle_aexp" title='Auto Exposure'>
<td>
Auto Exposure:
</td>
<td>
<div id="toggle_aexp" class="btn-group btn-toggle">
<button class="btn btn-xs <?php echo ($aexp_on)?"btn-success active":"btn-default";?>">ON</button>
<button class="btn btn-xs <?php echo (!$aexp_on)?"btn-danger active":"btn-default";?>">OFF</button>
</div>
</td>
</tr>
</table>
<br />
<a href="autocampars.php" title="autocampars.php">Parameter Editor</a><br />
<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="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="/diagnostics/index.html" title="Inspect camera system info">System info</a><br />
<a href="/debugfs.html" title="Linux Kernel Dynamic Debug helper interface (debug device drivers)">DebugFS</a><br />
</div>
<script>
$(function(){
init_awb_toggle();
init_aexp_toggle();
init_jp4_previews();
});
function init_jp4_previews(){
$('.port_preview').each(function(){
index = parseInt($(this).attr("index"));
$(this).jp4({ip:location.host,port:2323+index,width:300,fast:true,lowres:4});
});
}
function init_awb_toggle(){
$('#toggle_awb').click(function() {
if ($(this).find('.btn.active').html()=="ON"){
$(this).find('.btn.active').toggleClass('btn-success');
}else{
$(this).find('.btn.active').toggleClass('btn-danger');
}
// toggle active
$(this).find('.btn').toggleClass('active');
if ($(this).find('.btn.active').html()=="ON"){
wb_en = 1;
$(this).find('.btn.active').toggleClass('btn-success');
}else{
wb_en = 0;
$(this).find('.btn.active').toggleClass('btn-danger');
}
$(this).find('.btn').toggleClass('btn-default');
url = "parsedit.php?immediate&sensor_port=<?php echo $master_port;?>&WB_EN="+wb_en+"&*WB_EN=0xf";
$.ajax({
url: url,
success: function(){
console.log("awb "+(wb_en?"on":"off"));
}
});
});
}
function init_aexp_toggle(){
$('#toggle_aexp').click(function() {
if ($(this).find('.btn.active').html()=="ON"){
$(this).find('.btn.active').toggleClass('btn-success');
}else{
$(this).find('.btn.active').toggleClass('btn-danger');
}
// toggle active
$(this).find('.btn').toggleClass('active');
if ($(this).find('.btn.active').html()=="ON"){
aexp_en = 1;
$(this).find('.btn.active').toggleClass('btn-success');
}else{
aexp_en = 0;
$(this).find('.btn.active').toggleClass('btn-danger');
}
$(this).find('.btn').toggleClass('btn-default');
url = "parsedit.php?immediate&sensor_port=<?php echo $master_port;?>&AUTOEXP_ON="+aexp_en+"&*AUTOEXP_ON=0xf";
$.ajax({
url: url,
success: function(){
console.log("aexp "+(aexp_en?"on":"off"));
}
});
});
}
</script>
<body>
</html>
DOCUMENTROOT=$(DESTDIR)/www/pages
OWN = -o root -g root
INSTDOCS = 0644
INSTALL = install
DOCS= jp4-canvas.html \
jp4-canvas.js
LIBS= elphel.js \
exif.js \
jquery-jp4.js \
jcanvas.js \
webworker.js