Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
elphel-web-393
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
elphel-web-393
Commits
89621f29
Commit
89621f29
authored
Aug 23, 2017
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dl exif histories if '?debug' in GET
parent
0221ad74
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
123 additions
and
26 deletions
+123
-26
index.php
src/snapshot/index.php
+61
-23
snapshot.js
src/snapshot/snapshot.js
+62
-3
No files found.
src/snapshot/index.php
View file @
89621f29
...
@@ -29,6 +29,8 @@
...
@@ -29,6 +29,8 @@
$trig_master
=
-
1
;
$trig_master
=
-
1
;
$trig_master_port
=
-
1
;
$trig_master_port
=
-
1
;
$dl_exif_histories
=
0
;
for
(
$i
=
0
;
$i
<
4
;
$i
++
){
for
(
$i
=
0
;
$i
<
4
;
$i
++
){
$sensor
=
$path
.
"/sensor
{
$i
}
0"
;
$sensor
=
$path
.
"/sensor
{
$i
}
0"
;
...
@@ -47,7 +49,12 @@
...
@@ -47,7 +49,12 @@
$trig_master_port
=
$trig_master
+
$port0
;
$trig_master_port
=
$trig_master
+
$port0
;
}
}
if
(
isset
(
$_GET
[
'debug'
])){
$dl_exif_histories
=
1
;
}
if
(
$trig_master
>=
0
){
if
(
$trig_master
>=
0
){
if
(
isset
(
$_GET
[
'trig'
])){
if
(
isset
(
$_GET
[
'trig'
])){
// just in case one wants to override master
// just in case one wants to override master
...
@@ -60,6 +67,34 @@
...
@@ -60,6 +67,34 @@
die
(
"trigger ok: http://
{
$_SERVER
[
'SERVER_ADDR'
]
}
:
$trig_master_port
/trig/pointers"
);
die
(
"trigger ok: http://
{
$_SERVER
[
'SERVER_ADDR'
]
}
:
$trig_master_port
/trig/pointers"
);
}
}
// get exif data from all buffers in a single text file
if
(
isset
(
$_GET
[
'exifs'
])){
if
(
isset
(
$_GET
[
'sensor_port'
])){
$port
=
$_GET
[
'sensor_port'
];
}
else
{
$port
=
$available_ports
[
0
]
-
$port0
;
}
$circbuf_pointers
=
elphel_get_circbuf_pointers
(
$port
,
1
);
// get metas
$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'
])
);
}
print_r
(
$meta
);
die
();
}
}
}
?>
?>
...
@@ -131,10 +166,13 @@
...
@@ -131,10 +166,13 @@
<script>
<script>
var
ip
=
location
.
origin
;
var
ip
=
location
.
origin
;
var
href
=
location
.
href
;
//
var href = location.href;
var
ports
=
[
<?php
echo
implode
(
","
,
$available_ports
);
?>
];
var
ports
=
[
<?php
echo
implode
(
","
,
$available_ports
);
?>
];
var
trig_master
=
<?php
echo
$trig_master
;
?>
;
var
trig_master
=
<?php
echo
$trig_master
;
?>
;
var
trig_master_port
=
<?php
echo
$trig_master_port
;
?>
;
var
trig_master_port
=
<?php
echo
$trig_master_port
;
?>
;
var
dl_exif_histories
=
<?php
echo
$dl_exif_histories
;
?>
;
</script>
</script>
</head>
</head>
...
...
src/snapshot/snapshot.js
View file @
89621f29
var
tp_old
=
0
;
var
tp_old
=
0
;
var
DLC
=
0
;
var
DLC
=
0
;
var
DLC_exif
=
0
;
var
filenames
=
[];
function
take_snapshot
(){
function
take_snapshot
(){
...
@@ -31,7 +33,7 @@ function read_trig_master(){
...
@@ -31,7 +33,7 @@ function read_trig_master(){
function
trigger
(){
function
trigger
(){
$
.
ajax
({
$
.
ajax
({
url
:
href
+
"?trig"
,
url
:
"?trig"
,
success
:
function
(){
success
:
function
(){
setTimeout
(
function
(){
setTimeout
(
function
(){
...
@@ -46,7 +48,8 @@ function download_all(rtp){
...
@@ -46,7 +48,8 @@ function download_all(rtp){
DLC
=
0
;
DLC
=
0
;
ports
.
forEach
(
function
(
c
,
i
){
ports
.
forEach
(
function
(
c
,
i
){
download_single
(
ip
+
":"
+
c
+
"/timestamp_name/img"
);
//download_single(ip+":"+c+"/timestamp_name/img");
download_single
(
ip
+
":"
+
c
+
"/timestamp_name/bimg"
);
});
});
}
}
...
@@ -71,7 +74,12 @@ function download_single(addr){
...
@@ -71,7 +74,12 @@ function download_single(addr){
DLC
++
;
DLC
++
;
if
(
DLC
==
ports
.
length
){
if
(
DLC
==
ports
.
length
){
if
(
$
(
"#synced"
).
prop
(
"checked"
))
{
if
(
$
(
"#synced"
).
prop
(
"checked"
))
{
if
(
dl_exif_histories
==
1
){
console
.
log
(
"getting exif histories"
);
get_exifs
();
}
else
{
read_tp
();
read_tp
();
}
}
else
{
}
else
{
$
(
"#snapshot"
).
attr
(
"disabled"
,
false
);
$
(
"#snapshot"
).
attr
(
"disabled"
,
false
);
}
}
...
@@ -100,6 +108,8 @@ function pass_to_file_reader(filename,fileblob){
...
@@ -100,6 +108,8 @@ function pass_to_file_reader(filename,fileblob){
}
}
}
}
filenames
.
push
(
filename
);
var
url
=
window
.
URL
.
createObjectURL
(
fileblob
);
var
url
=
window
.
URL
.
createObjectURL
(
fileblob
);
var
a
=
$
(
'<a>'
)
var
a
=
$
(
'<a>'
)
...
@@ -158,6 +168,55 @@ function pass_to_file_reader(filename,fileblob){
...
@@ -158,6 +168,55 @@ function pass_to_file_reader(filename,fileblob){
}
}
function
get_exifs
(){
DLC_exif
=
0
;
filenames
.
forEach
(
function
(
c
,
i
){
var
base
=
c
.
split
(
"."
);
base
=
base
[
0
];
var
port
=
base
.
split
(
"_"
);
port
=
port
[
2
];
var
filename
=
base
+
"_exifs.txt"
;
var
addr
=
"?exifs&sensor_port="
+
port
;
var
http
=
new
XMLHttpRequest
();
http
.
open
(
"GET"
,
addr
,
true
);
http
.
responseType
=
"blob"
;
http
.
onload
=
function
(
e
){
if
(
this
.
status
===
200
)
{
// To access the header, had to add
// printf("Access-Control-Expose-Headers: Content-Disposition\r\n");
// to imgsrv
//var filename = this.getResponseHeader("Content-Disposition");
pass_to_file_reader
(
filename
,
http
.
response
);
DLC_exif
++
;
if
(
DLC_exif
==
ports
.
length
){
if
(
$
(
"#synced"
).
prop
(
"checked"
))
{
// empty
filenames
=
[];
read_tp
();
}
else
{
$
(
"#snapshot"
).
attr
(
"disabled"
,
false
);
}
}
}
}
http
.
send
();
});
}
function
read_tp
(){
function
read_tp
(){
var
param
=
"TRIG_PERIOD"
;
var
param
=
"TRIG_PERIOD"
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment