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
9f65cb10
Commit
9f65cb10
authored
Jun 23, 2017
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
+help
parent
a52dba03
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
84 additions
and
17 deletions
+84
-17
index.php
src/snapshot/index.php
+55
-9
snapshot.js
src/snapshot/snapshot.js
+29
-8
No files found.
src/snapshot/index.php
View file @
9f65cb10
...
...
@@ -78,18 +78,21 @@
font-family
:
"Helvetica Neue"
,
Helvetica
;
}
#snapshot
{
background-color
:
#CF4040
;
/* not Green */
.button
{
font-weight
:
bold
;
border-radius
:
3px
;
outline
:
none
;
border
:
none
;
color
:
white
;
padding
:
32px
32px
;
text-align
:
center
;
text-decoration
:
none
;
display
:
inline-block
;
}
#snapshot
{
background-color
:
#CF4040
;
/* not Green */
padding
:
32px
32px
;
font-size
:
20px
;
font-weight
:
bold
;
border-radius
:
3px
;
outline
:
none
;
}
#snapshot
:hover
{
...
...
@@ -104,6 +107,26 @@
background-color
:
#A0A0A0
;
/* not Green */
}
#synced
{
width
:
25px
;
height
:
25px
;
}
#help_button
{
background-color
:
#404040
;
/* not Green */
padding
:
3px
7px
;
font-size
:
15px
;
}
#help_button
:hover
{
background-color
:
#303030
;
/* not Green */
}
#help_button
:active
{
background-color
:
#202020
;
/* not Green */
}
</style>
<script>
...
...
@@ -115,8 +138,31 @@
</head>
<body>
<button
title=
'Download images (synced) from all channels over network'
id=
'snapshot'
onclick=
'take_snapshot()'
>
Snapshot
</button>
<div>
<button
title=
'Download images from all channels over network'
id=
'snapshot'
onclick=
'take_snapshot()'
class=
'button'
>
Snapshot
</button>
</div>
<br/>
<div>
<table>
<tr>
<td
valign=
'middle'
><span
style=
'font-size:20px;line-height:25px;'
>
sync
</span></td>
<td
valign=
'middle'
><input
type=
'checkbox'
id=
'synced'
checked
/></td>
<td
valign=
'middle'
><button
id=
'help_button'
class=
'button'
onclick=
'toggle_help()'
>
?
</button></td>
</tr>
</table>
</div>
<br/>
<div
id=
'help'
style=
'display:none;'
>
<b>
if checked
</b>
:
<ul>
<li>
all ports - same timestamp
</li>
<li>
fps will be reprogrammed - set to single trigger mode then restored - careful if some other program is doing recording
</li>
</ul>
<b>
if unchecked
</b>
:
<ul>
<li>
timestamps can be different
</li>
<li>
fps will not be reprogrammed - no intereference with other recording programs, only network load.
</li>
</ul>
</div>
</body>
</html>
\ No newline at end of file
src/snapshot/snapshot.js
View file @
9f65cb10
...
...
@@ -6,7 +6,13 @@ function take_snapshot(){
$
(
"#snapshot"
).
attr
(
"disabled"
,
true
);
if
(
ports
.
length
!=
0
){
read_trig_master
();
if
(
$
(
"#synced"
).
attr
(
"checked"
)){
read_trig_master
();
}
else
{
download_all
(
false
);
}
}
else
{
console
.
log
(
"No ports detected"
);
}
...
...
@@ -50,18 +56,16 @@ function trigger(){
url
:
ip
+
"/snapshot.php?trig"
,
success
:
function
(){
setTimeout
(
download_all
,
200
);
setTimeout
(
function
(){
download_all
(
true
);
},
200
);
}
});
}
function
download_all
(){
function
restore_trig_period
(){
ports
.
forEach
(
function
(
c
,
i
){
download_single
(
ip
+
":"
+
c
+
"/bimg"
);
});
$
.
ajax
({
url
:
ip
+
"/parsedit.php?immediate&TRIG_PERIOD="
+
(
tp_old
+
1
)
+
"*-2&sensor_port="
+
trig_master
,
success
:
function
(){
...
...
@@ -81,6 +85,16 @@ function download_all(){
}
function
download_all
(
rtp
){
ports
.
forEach
(
function
(
c
,
i
){
download_single
(
ip
+
":"
+
c
+
"/bimg"
);
});
if
(
rtp
)
restore_trig_period
();
}
function
download_single
(
addr
){
var
link
=
document
.
createElement
(
'a'
);
...
...
@@ -95,4 +109,11 @@ function download_single(addr){
document
.
body
.
removeChild
(
link
);
}
\ No newline at end of file
}
function
toggle_help
(){
$
(
"#help"
).
toggle
();
}
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