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
4678d928
Commit
4678d928
authored
Jun 29, 2023
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated camera state
parent
f00269cd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
lwir16.php
src/lwir16/lwir16.php
+15
-2
No files found.
src/lwir16/lwir16.php
View file @
4678d928
...
@@ -74,6 +74,7 @@
...
@@ -74,6 +74,7 @@
define
(
'DAEMON_CTRL'
,
'daemon'
);
define
(
'DAEMON_CTRL'
,
'daemon'
);
define
(
'DAEMON_CTRL_CMDS'
,
'cmd'
);
//comma-separated commands to be sent to the daemon
define
(
'DAEMON_CTRL_CMDS'
,
'cmd'
);
//comma-separated commands to be sent to the daemon
define
(
'OUTPUT_LOG'
,
'output_log'
);
// redirect daemon output
define
(
'OUTPUT_LOG'
,
'output_log'
);
// redirect daemon output
define
(
'CAMERA_STATE'
,
'/var/state/camera'
);
// print_r($_GET); // magic
// print_r($_GET); // magic
// exit(0); // magic
// exit(0); // magic
...
@@ -267,7 +268,7 @@
...
@@ -267,7 +268,7 @@
exit
(
0
);
// no time to close log
exit
(
0
);
// no time to close log
}
else
if
(
$cmd
==
'state'
){
}
else
if
(
$cmd
==
'state'
){
// TODO: read all subcameras
// TODO: read all subcameras
$state
=
file
(
'/var/state/camera'
);
$state
=
file
(
CAMERA_STATE
);
$xml
=
new
SimpleXMLElement
(
"<?xml version='1.0' standalone='yes'?><lwir16_state/>"
);
$xml
=
new
SimpleXMLElement
(
"<?xml version='1.0' standalone='yes'?><lwir16_state/>"
);
foreach
(
$state
as
$line
){
foreach
(
$state
as
$line
){
$kv
=
explode
(
'='
,
$line
);
$kv
=
explode
(
'='
,
$line
);
...
@@ -1086,5 +1087,17 @@ EOT;
...
@@ -1086,5 +1087,17 @@ EOT;
exit
(
0
);
exit
(
0
);
}
}
}
}
function
isCameraBooted
(){
return
(
getCameraState
(
CAMERA_STATE
)
==
'INITIALIZED'
);
}
function
getCameraState
(
$camera_state_file
){
if
(
!
file_exists
(
$camera_state_file
)){
return
NULL
;
}
$camera_state
=
parse_ini_file
(
$camera_state_file
);
return
$camera_state
[
'state'
];
}
?>
?>
\ No newline at end of file
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