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
047f4253
Commit
047f4253
authored
Jun 23, 2017
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. fixed trig bug 2. fixed restore period bug
parent
5b08f76f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
58 deletions
+44
-58
index.php
src/snapshot/index.php
+4
-3
snapshot.js
src/snapshot/snapshot.js
+40
-55
No files found.
src/snapshot/index.php
View file @
047f4253
...
@@ -47,7 +47,7 @@
...
@@ -47,7 +47,7 @@
$trig_master_port
=
$trig_master
+
$port0
;
$trig_master_port
=
$trig_master
+
$port0
;
}
}
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
...
@@ -57,7 +57,7 @@
...
@@ -57,7 +57,7 @@
$f
=
fopen
(
"http://
{
$_SERVER
[
'SERVER_ADDR'
]
}
:
$trig_master_port
/trig/pointers"
,
'r'
);
$f
=
fopen
(
"http://
{
$_SERVER
[
'SERVER_ADDR'
]
}
:
$trig_master_port
/trig/pointers"
,
'r'
);
fclose
(
$f
);
fclose
(
$f
);
die
();
die
(
"trigger ok: http://
{
$_SERVER
[
'SERVER_ADDR'
]
}
:
$trig_master_port
/trig/pointers"
);
}
}
}
}
...
@@ -131,6 +131,7 @@
...
@@ -131,6 +131,7 @@
<script>
<script>
var
ip
=
location
.
origin
;
var
ip
=
location
.
origin
;
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
;
?>
;
...
...
src/snapshot/snapshot.js
View file @
047f4253
...
@@ -6,46 +6,23 @@ function take_snapshot(){
...
@@ -6,46 +6,23 @@ function take_snapshot(){
$
(
"#snapshot"
).
attr
(
"disabled"
,
true
);
$
(
"#snapshot"
).
attr
(
"disabled"
,
true
);
if
(
ports
.
length
!=
0
){
if
(
ports
.
length
!=
0
){
if
(
$
(
"#synced"
).
prop
(
"checked"
)){
if
(
$
(
"#synced"
).
attr
(
"checked"
)){
read_trig_master
();
read_trig_master
();
}
else
{
}
else
{
download_all
(
false
);
download_all
(
false
);
}
}
}
else
{
}
else
{
console
.
log
(
"No ports detected"
);
console
.
log
(
"No ports detected"
);
}
}
}
}
function
read_trig_master
(){
function
read_trig_master
(){
var
param
=
"TRIG_MASTER"
;
var
param
=
"TRIG_MASTER"
;
$
.
ajax
({
$
.
ajax
({
url
:
ip
+
"/parsedit.php?immediate&"
+
param
,
url
:
ip
+
"/parsedit.php?immediate&"
+
param
,
success
:
function
(
data
){
success
:
function
(
data
){
trig_master
=
parseInt
(
$
(
data
).
find
(
param
));
trig_master
=
parseInt
(
$
(
data
).
find
(
param
).
text
());
read_tp
();
}
});
}
function
read_tp
(){
var
param
=
"TRIG_PERIOD"
;
$
.
ajax
({
url
:
ip
+
"/parsedit.php?immediate&"
+
param
,
success
:
function
(
data
){
tp_old
=
parseInt
(
$
(
data
).
find
(
param
));
trigger
();
}
});
}
// channel independent or lowest?
function
read_par
(
param
,
callback
){
$
.
ajax
({
url
:
ip
+
"/parsedit.php?immediate&"
+
param
,
success
:
function
(
data
){
tp_old
=
parseInt
(
$
(
data
).
find
(
"TRIG_MASTER"
));
trigger
();
trigger
();
}
}
});
});
...
@@ -53,36 +30,15 @@ function read_par(param,callback){
...
@@ -53,36 +30,15 @@ function read_par(param,callback){
function
trigger
(){
function
trigger
(){
$
.
ajax
({
$
.
ajax
({
url
:
ip
+
"?trig"
,
url
:
href
+
"?trig"
,
success
:
function
(){
success
:
function
(){
setTimeout
(
function
(){
setTimeout
(
function
(){
download_all
(
true
);
download_all
(
true
);
},
500
);
},
200
);
}
});
}
function
restore_trig_period
(){
$
.
ajax
({
url
:
ip
+
"/parsedit.php?immediate&TRIG_PERIOD="
+
(
tp_old
+
1
)
+
"*-2&sensor_port="
+
trig_master
,
success
:
function
(){
$
.
ajax
({
url
:
ip
+
"/parsedit.php?immediate&TRIG_PERIOD="
+
(
tp_old
)
+
"*-2&sensor_port="
+
trig_master
,
success
:
function
(){
console
.
log
(
"Done!"
);
$
(
"#snapshot"
).
attr
(
"disabled"
,
false
);
}
});
}
}
});
});
}
}
function
download_all
(
rtp
){
function
download_all
(
rtp
){
...
@@ -91,11 +47,12 @@ function download_all(rtp){
...
@@ -91,11 +47,12 @@ function download_all(rtp){
download_single
(
ip
+
":"
+
c
+
"/img"
);
download_single
(
ip
+
":"
+
c
+
"/img"
);
});
});
// give 500ms (?)
if
(
rtp
)
{
if
(
rtp
)
{
setTimeout
(
function
(){
setTimeout
(
function
(){
re
store_trig_period
();
re
ad_tp
();
},
200
);
},
200
);
}
else
{
$
(
"#snapshot"
).
attr
(
"disabled"
,
false
);
}
}
}
}
...
@@ -116,6 +73,34 @@ function download_single(addr){
...
@@ -116,6 +73,34 @@ function download_single(addr){
}
}
function
read_tp
(){
var
param
=
"TRIG_PERIOD"
;
$
.
ajax
({
url
:
ip
+
"/parsedit.php?immediate&"
+
param
,
success
:
function
(
data
){
tp_old
=
parseInt
(
$
(
data
).
find
(
param
).
text
());
restore_trig_period
();
}
});
}
function
restore_trig_period
(){
console
.
log
(
"restore period"
);
$
.
ajax
({
url
:
ip
+
"/parsedit.php?immediate&TRIG_PERIOD="
+
(
tp_old
)
+
"*-2&sensor_port="
+
trig_master
,
success
:
function
(){
console
.
log
(
"Done!"
);
$
(
"#snapshot"
).
attr
(
"disabled"
,
false
);
}
});
}
function
toggle_help
(){
function
toggle_help
(){
$
(
"#help"
).
toggle
();
$
(
"#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