Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
elphel-apps-camogm
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-apps-camogm
Commits
fa047c63
Commit
fa047c63
authored
Apr 07, 2017
by
Mikhail Karpenko
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://git.elphel.com/Elphel/elphel-apps-camogm
parents
ee9032de
cc03212a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
52 deletions
+28
-52
camogm_interface.php
src/camogmgui/camogm_interface.php
+28
-52
No files found.
src/camogmgui/camogm_interface.php
View file @
fa047c63
...
@@ -77,31 +77,33 @@ $default_state = "/home/root/camogm.disk";
...
@@ -77,31 +77,33 @@ $default_state = "/home/root/camogm.disk";
$state_file
=
"/mnt/sda1/camogm.disk"
;
$state_file
=
"/mnt/sda1/camogm.disk"
;
$start_str
=
"camogm -n "
.
$cmd_pipe
.
" -p "
.
$cmd_port
;
$start_str
=
"camogm -n "
.
$cmd_pipe
.
" -p "
.
$cmd_port
;
if
(
$cmd
==
"run_camogm"
)
function
check_camogm_running
(){
{
global
$start_str
;
$camogm_running
=
false
;
$camogm_running
=
false
;
exec
(
'ps | grep "camogm"'
,
$arr
);
exec
(
'ps | grep "camogm"'
,
$arr
);
function
low_daemon
(
$v
)
$check
=
implode
(
"<br/>"
,
$arr
);
{
return
(
substr
(
$v
,
-
1
)
!=
']'
);
if
(
strstr
(
$check
,
$start_str
)){
$camogm_running
=
true
;
}
}
$p
=
(
array_filter
(
$arr
,
"low_daemon"
))
;
return
$camogm_running
;
$check
=
implode
(
"<br />"
,
$p
);
}
//$state_file = get_state_path();
if
(
$cmd
==
"run_camogm"
)
{
if
(
isset
(
$_GET
[
'state_file'
])){
if
(
isset
(
$_GET
[
'state_file'
])){
$state_file
=
$_GET
[
'state_file'
];
$state_file
=
$_GET
[
'state_file'
];
}
}
$start_str
=
$start_str
.
" -s "
.
$state_file
;
if
(
!
check_camogm_running
())
{
if
(
strstr
(
$check
,
$start_str
))
echo
"camogm is not running, starting
\n
"
;
$camogm_running
=
true
;
else
$start_str
=
$start_str
.
" -s "
.
$state_file
;
$camogm_running
=
false
;
if
(
!
$camogm_running
)
{
// clean
exec
(
"rm "
.
$cmd_pipe
);
exec
(
"rm "
.
$cmd_pipe
);
exec
(
"rm "
.
$cmd_state
);
exec
(
"rm "
.
$cmd_state
);
...
@@ -130,28 +132,16 @@ if ($cmd == "run_camogm")
...
@@ -130,28 +132,16 @@ if ($cmd == "run_camogm")
$cmd_str
=
'format=mov;save_gp=1;'
;
$cmd_str
=
'format=mov;save_gp=1;'
;
write_cmd_pipe
(
$cmd_str
);
write_cmd_pipe
(
$cmd_str
);
}
}
}
else
{
echo
"camogm is running
\n
"
;
}
}
}
}
else
if
(
$cmd
==
"status"
)
else
if
(
$cmd
==
"status"
)
{
{
// is camogm running
if
(
check_camogm_running
())
$camogm_running
=
"on"
;
$camogm_running
=
"not running"
;
else
$camogm_running
=
"off"
;
exec
(
'ps | grep "camogm"'
,
$arr
);
function
low_daemon
(
$v
)
{
return
(
substr
(
$v
,
-
1
)
!=
']'
);
}
$p
=
(
array_filter
(
$arr
,
"low_daemon"
));
$check
=
implode
(
"<br />"
,
$p
);
if
(
strstr
(
$check
,
$start_str
))
$camogm_running
=
"on"
;
else
$camogm_running
=
"off"
;
if
(
$camogm_running
==
"on"
){
if
(
$camogm_running
){
$pipe
=
"/var/state/camogm.state"
;
$pipe
=
"/var/state/camogm.state"
;
$mode
=
0777
;
$mode
=
0777
;
if
(
!
file_exists
(
$pipe
))
{
if
(
!
file_exists
(
$pipe
))
{
...
@@ -174,23 +164,9 @@ else if ($cmd == "status")
...
@@ -174,23 +164,9 @@ else if ($cmd == "status")
}
}
else
if
(
$cmd
==
"run_status"
)
else
if
(
$cmd
==
"run_status"
)
{
{
// is camogm running
$camogm_running
=
"not running"
;
exec
(
'ps | grep "camogm"'
,
$arr
);
function
low_daemon
(
$v
)
{
return
(
substr
(
$v
,
-
1
)
!=
']'
);
}
$p
=
(
array_filter
(
$arr
,
"low_daemon"
));
$check
=
implode
(
"<br />"
,
$p
);
if
(
strstr
(
$check
,
$start_str
))
$camogm_running
=
"on"
;
else
$camogm_running
=
"off"
;
if
(
check_camogm_running
())
$camogm_running
=
"on"
;
else
$camogm_running
=
"off"
;
$status
=
"<?xml version='1.0'?><camogm_state>
\n
<state>"
.
$camogm_running
.
"</state>
\n
</camogm_state>"
;
$status
=
"<?xml version='1.0'?><camogm_state>
\n
<state>"
.
$camogm_running
.
"</state>
\n
</camogm_state>"
;
...
...
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