Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
meta-elphel393
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
meta-elphel393
Commits
f98c8a4a
Commit
f98c8a4a
authored
Jun 03, 2016
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no init if not stopped
parent
eb8c4e6d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
2 deletions
+33
-2
camogm.js
recipes-core/apps-web/files/camogm.js
+33
-2
No files found.
recipes-core/apps-web/files/camogm.js
View file @
f98c8a4a
...
...
@@ -139,7 +139,9 @@ function init(){
});
init_sensor_type
();
//init_defaults();
for
(
var
i
=
0
;
i
<
4
;
i
++
)
get_camogm_state
(
i
);
init_path
();
init_files
();
init_images
();
...
...
@@ -159,6 +161,29 @@ function init_images(){
},
1000
);
}
function
get_camogm_state
(
index
){
$
.
ajax
({
url
:
"camogm.php?cmd=status&chn="
+
index
,
complete
:
function
(
data
){
var
xml
=
data
.
responseXML
;
var
tmp
=
$
(
xml
).
find
(
"state"
);
var
tmpstr
=
$
(
tmp
[
0
]).
text
();
//trim "
tmpstr
=
tmpstr
.
replace
(
/^"+|"+$/g
,
''
);
if
(
tmpstr
==
"stopped"
){
$
(
"#rec"
+
index
).
removeClass
(
"btn-danger"
);
$
(
"#rec"
+
index
).
addClass
(
"btn-success"
);
$
(
"#rec"
+
index
).
text
(
"start"
);
init_default
(
index
);
}
else
{
$
(
"#rec"
+
index
).
removeClass
(
"btn-success"
);
$
(
"#rec"
+
index
).
addClass
(
"btn-danger"
);
$
(
"#rec"
+
index
).
text
(
"stop"
);
}
}
});
}
function
get_files
(){
console
.
log
(
"get files"
);
$
.
ajax
({
...
...
@@ -194,7 +219,6 @@ function init_path(){
var
tmp
=
$
(
dirs
[
i
]).
text
();
if
(
tmp
==
"/mnt/sda1"
)
{
$
(
"#abspath"
).
val
(
tmp
);
init_defaults
();
res
=
true
;
}
}
...
...
@@ -205,6 +229,12 @@ function init_path(){
});
}
function
init_default
(
index
){
var
prefix
=
$
(
"#abspath"
).
val
()
+
"/"
;
$
.
ajax
({
url
:
"camogm.php?chn="
+
index
+
"&cmd=format=mov;exif=0;duration=600;length=1073741824;prefix="
+
prefix
+
$
(
"#prefix"
+
index
).
val
()});
}
/*
function init_defaults(){
var prefix = $("#abspath").val()+"/";
for(var i=0;i<4;i++){
...
...
@@ -212,6 +242,7 @@ function init_defaults(){
}
$.ajax({url:"camogm.php?cmd=create_symlink&path="+prefix});
}
*/
function
init_sensor_type
(){
$
.
ajax
({
...
...
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