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
f8ad5f0e
Commit
f8ad5f0e
authored
Sep 21, 2016
by
Mikhail Karpenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Organize status info in gui in table format
parent
19ab4811
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
113 additions
and
54 deletions
+113
-54
camogm.c
src/camogm.c
+1
-8
camogm_interface.php
src/camogmgui/camogm_interface.php
+2
-5
camogmgui.js
src/camogmgui/camogmgui.js
+2
-2
camogmgui.php
src/camogmgui/camogmgui.php
+108
-39
No files found.
src/camogm.c
View file @
f8ad5f0e
...
...
@@ -1053,7 +1053,7 @@ void camogm_status(camogm_state *state, char * fn, int xml)
" <ignore_fps>
\"
%s
\"
</ignore_fps>
\n
"
\
" <raw_device_path>
\"
%s
\"
</raw_device_path>
\n
"
\
" <raw_device_overruns>%d</raw_device_overruns>
\n
"
\
" <raw_device_pos_write>0x%llx</raw_dev_pos_write>
\n
"
\
" <raw_device_pos_write>0x%llx</raw_dev
ice
_pos_write>
\n
"
\
" <raw_device_pos_read>0x%llx (%d%% done)</raw_device_pos_read>
\n
"
,
_state
,
state
->
path
,
state
->
frameno
,
state
->
start_after_timestamp
,
_dur
,
_udur
,
_len
,
\
_frames_skip
,
_sec_skip
,
\
...
...
@@ -1226,11 +1226,9 @@ int parse_cmd(camogm_state *state, FILE* npipe)
if
(
!
cmd
)
return
0
;
// nothing in the pipe
D2
(
fprintf
(
debug_file
,
"Got command: '%s'
\n
"
,
cmd
));
#ifdef DISABLE_CODE
// Acknowledge received command by copying frame number to per-daemon parameter
// GLOBALPARS(state->port_num, G_DAEMON_ERR + lastDaemonBit[state->port_num]) = GLOBALPARS(state->port_num, G_THIS_FRAME);
setGValue
(
state
->
port_num
,
G_DAEMON_ERR
+
lastDaemonBit
[
state
->
port_num
],
getGPValue
(
state
->
port_num
,
G_THIS_FRAME
));
#endif
/* DISABLE_CODE */
args
=
strpbrk
(
cmd
,
"=
\t
"
);
// is it just a single word command or does it have parameters?
if
(
args
)
{
...
...
@@ -1831,7 +1829,6 @@ int open_files(camogm_state *state)
}
// now open/mmap file to read sensor/compressor parameters (currently - just free memory in circbuf and compressor state)
#ifdef DISABLE_CODE
state
->
fd_fparmsall
[
port
]
=
open
(
ctlFileNames
[
port
],
O_RDWR
);
if
(
state
->
fd_fparmsall
[
port
]
<
0
)
{
// check control OK
D0
(
fprintf
(
debug_file
,
"%s:%d:%s: Error opening %s
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
,
ctlFileNames
[
port
]));
...
...
@@ -1849,7 +1846,6 @@ int open_files(camogm_state *state)
}
framePars
[
port
]
=
frameParsAll
[
port
]
->
framePars
;
aglobalPars
[
port
]
=
frameParsAll
[
port
]
->
globalPars
;
#endif
/* DISABLE_CODE */
}
return
ret
;
...
...
@@ -1928,12 +1924,9 @@ int main(int argc, char *argv[])
*/
unsigned
long
getGPValue
(
unsigned
int
port
,
unsigned
long
GPNumber
)
{
#ifdef DISABLE_CODE
return
(
GPNumber
>=
FRAMEPAR_GLOBALS
)
?
GLOBALPARS
(
port
,
GPNumber
)
:
framePars
[
port
][
GLOBALPARS
(
port
,
G_THIS_FRAME
)
&
PARS_FRAMES_MASK
].
pars
[
GPNumber
];
#endif
/* DESABLE_CODE */
return
0
;
}
/**
...
...
src/camogmgui/camogm_interface.php
View file @
f8ad5f0e
...
...
@@ -103,7 +103,6 @@ if ($cmd == "run_camogm")
}
if
(
$debug
)
{
// $cmd_pipe = "/var/state/camogm_cmd";
$fcmd
=
fopen
(
$cmd_pipe
,
"w"
);
fprintf
(
$fcmd
,
"debuglev=
$debuglev
"
);
}
...
...
@@ -112,7 +111,6 @@ if ($cmd == "run_camogm")
else
if
(
$cmd
==
"status"
)
{
$pipe
=
"/var/state/camogm.state"
;
// $cmd_pipe="/var/state/camogm_cmd";
$mode
=
0777
;
if
(
!
file_exists
(
$pipe
))
{
umask
(
0
);
...
...
@@ -292,8 +290,6 @@ else if ($cmd=="list") {
}
else
{
// $cmd_pipe = "/var/state/camogm_cmd";
$fcmd
=
fopen
(
$cmd_pipe
,
"w"
);
xml_header
();
...
...
@@ -538,7 +534,8 @@ else
fprintf
(
$fcmd
,
"timelapse=%s;
\n
"
,
$timelapse_value
);
break
;
case
"init_compressor"
:
elphel_compressor_run
();
$sensor_port
=
$_GET
[
'sensor_port'
];
elphel_compressor_run
(
$sensor_port
);
break
;
case
"check_audio_hardware"
:
exec
(
'arecord -l'
,
$arr1
);
...
...
src/camogmgui/camogmgui.js
View file @
f8ad5f0e
...
...
@@ -221,8 +221,8 @@ function process_list_file(xmldoc) {
document
.
getElementById
(
'filelist'
).
innerHTML
=
response
;
}
}
function
start_compressor
(
parent
)
{
makeRequest
(
'camogm_interface.php'
,
'?cmd=init_compressor'
);
function
start_compressor
(
parent
,
port
)
{
makeRequest
(
'camogm_interface.php'
,
'?cmd=init_compressor'
,
'&sensor_port='
+
port
);
parent
.
style
.
display
=
'none'
;
}
function
update_audio_form
(
thisform
)
{
...
...
src/camogmgui/camogmgui.php
View file @
f8ad5f0e
...
...
@@ -56,7 +56,21 @@
$cmd_port
=
"3456"
;
$start_str
=
"camogm -n "
.
$cmd_pipe
.
" -p "
.
$cmd_port
;
$mode
=
0777
;
$sensor_ports
=
elphel_num_sensors
();
// check if any compressor is in running state
function
check_compressors
(
$states
)
{
global
$sensor_ports
;
$ret_val
=
0
;
for
(
$i
=
0
;
$i
<
$sensor_ports
;
$i
++
)
{
if
(
$states
[
$i
]
==
"running"
)
$ret_val
=
1
;
}
return
$ret_val
;
}
if
(
!
file_exists
(
$pipe
))
{
// create the pipe
umask
(
0
);
...
...
@@ -242,7 +256,6 @@
$xml_format
=
substr
(
$logdata
[
0
][
'format'
],
1
,
strlen
(
$logdata
[
0
][
'format'
])
-
2
);
$xml_state
=
substr
(
$logdata
[
0
][
'state'
],
1
,
strlen
(
$logdata
[
0
][
'state'
])
-
2
);
$xml_directory
=
substr
(
$logdata
[
0
][
'prefix'
],
1
,
strlen
(
$logdata
[
0
][
'prefix'
])
-
2
);
$xml_compressor_state
=
substr
(
$logdata
[
0
][
'compressor_state'
],
1
,
strlen
(
$logdata
[
0
][
'compressor_state'
])
-
2
);
$xml_file_length
=
substr
(
$logdata
[
0
][
'file_length'
],
0
,
strlen
(
$logdata
[
0
][
'file_length'
]));
// file size in bytes
$xml_file_duration
=
substr
(
$logdata
[
0
][
'file_duration'
],
0
,
strlen
(
$logdata
[
0
][
'file_duration'
]));
$xml_frame_number
=
substr
(
$logdata
[
0
][
'frame_number'
],
0
,
strlen
(
$logdata
[
0
][
'frame_number'
]));
...
...
@@ -280,7 +293,11 @@
$xml_audio_volume
=
substr
(
$logdata
[
0
][
'audio_volume'
],
1
,
strlen
(
$logdata
[
0
][
'audio_volume'
])
-
2
);
$xml_audio_syncmode
=
substr
(
$logdata
[
0
][
'allow_sync'
],
1
,
strlen
(
$logdata
[
0
][
'allow_sync'
])
-
2
);
// Get per sensor port parameters
$xml_compressor_state
=
array
();
for
(
$i
=
0
;
$i
<
$sensor_ports
;
$i
++
)
{
$xml_compressor_state
[
$i
]
=
substr
(
$logdata
[
$i
][
'compressor_state'
],
1
,
strlen
(
$logdata
[
$i
][
'compressor_state'
])
-
2
);
}
if
(
$camogm_running
)
{
if
((
$xml_directory
==
"
\"\"
"
)
||
(
$xml_directory
==
""
))
...
...
@@ -367,7 +384,7 @@
<div
id=
"TabbedPanels1"
class=
"TabbedPanels"
>
<ul
class=
"TabbedPanelsTabGroup"
>
<?
if
((
$xml_compressor_state
!=
"running"
)
||
(
!
$camogm_running
))
if
((
check_compressors
(
$xml_compressor_state
)
!=
1
)
||
(
!
$camogm_running
))
echo
"<li class=
\"
TabbedPanelsTabAlert
\"
tabindex=
\"
0
\"
>Status</li>"
;
else
echo
"<li class=
\"
TabbedPanelsTab
\"
tabindex=
\"
0
\"
>Status</li>"
;
...
...
@@ -382,45 +399,97 @@
<div
class=
"TabbedPanelsContentGroup"
>
<div
class=
"TabbedPanelsContent"
>
<!-- Status -->
<?
echo
"Sensor: "
;
if
(
elphel_get_state
()
==
0
)
{
echo
"<span class=
\"
alert
\"
>not initialized!</span>"
;
echo
" <a href=
\"
#
\"
onClick=
\"
help('sensor');
\"
><img src=
\"
images/help.png
\"
></a>"
;
}
else
echo
"<span class=
\"
green
\"
> working</span>"
;
echo
"<br />"
;
echo
"Compressor: "
;
if
(
$xml_compressor_state
!=
"running"
)
{
echo
"<span class=
\"
alert
\"
>not running!</span>"
;
echo
" <a href=
\"
#
\"
OnClick=
\"
start_compressor(this); window.location.reload();
\"
>start compressor</a>"
;
}
else
echo
"<span class=
\"
green
\"
> running</span>"
;
echo
"<br />"
;
echo
"Camogm: "
;
if
(
!
$camogm_running
)
{
echo
"<span class=
\"
alert
\"
>NOT running!</span>"
;
echo
" <input name=
\"
camogm_start
\"
type=
\"
button
\"
value=
\"
start camogm
\"
>"
;
}
else
echo
"<span class=
\"
green
\"
> running</span>"
;
?>
<table
class=
"state_table"
border=
"0px"
cellpadding=
"opx"
cellspacing=
"0px"
>
<!-- Table header -->
<tr><td
width=
"120px"
></td>
<?php
for
(
$i
=
0
;
$i
<
$sensor_ports
;
$i
++
)
{
echo
"<td>Port "
.
$i
.
"</td>"
;
}
?>
</tr>
<!-- Sensor port status -->
<tr><td>
Sensor
</td>
<?php
for
(
$i
=
0
;
$i
<
$sensor_ports
;
$i
++
)
{
echo
"<td>"
;
if
(
elphel_get_state
(
$i
)
==
0
)
{
echo
"<span class=
\"
alert
\"
>not initialized!</span>"
;
echo
" <a href=
\"
#
\"
onClick=
\"
help('sensor');
\"
><img src=
\"
images/help.png
\"
></a>"
;
}
else
echo
"<span class=
\"
green
\"
> working</span>"
;
echo
"</td>"
;
}
?>
</tr>
<!-- Compressor status -->
<tr><td>
Compressor
</td>
<?php
for
(
$i
=
0
;
$i
<
$sensor_ports
;
$i
++
)
{
echo
"<td>"
;
if
(
$xml_compressor_state
[
$i
]
!=
"running"
)
{
echo
"<span class=
\"
alert
\"
>not running!</span>"
;
echo
" <a href=
\"
#
\"
OnClick=
\"
start_compressor(this,
$i
); window.location.reload();
\"
>start compressor</a>"
;
}
else
echo
"<span class=
\"
green
\"
> running</span>"
;
echo
"</td>"
;
}
?>
</tr>
<!-- Image resolution on each port -->
<tr><td>
Image resolution
</td>
<?php
for
(
$i
=
0
;
$i
<
$sensor_ports
;
$i
++
)
{
echo
"<td id=
\"
ajax_res
\"
>"
;
echo
elphel_get_P_value
(
$i
,
ELPHEL_ACTUAL_WIDTH
)
.
" x "
.
elphel_get_P_value
(
$i
,
ELPHEL_ACTUAL_HEIGHT
);
echo
"</td>"
;
}
?>
</tr>
<!-- JPEG quality on each port -->
<tr><td>
JPEG quality
</td>
<?php
for
(
$i
=
0
;
$i
<
$sensor_ports
;
$i
++
)
{
echo
"<td id=
\"
ajax_qual
\"
>"
;
echo
elphel_get_P_value
(
$i
,
ELPHEL_QUALITY
)
.
" %"
;
echo
"</td>"
;
}
?>
</tr>
<!-- Frame rate on each port -->
<tr><td>
Framerate
</td>
<?php
for
(
$i
=
0
;
$i
<
$sensor_ports
;
$i
++
)
{
echo
"<td id=
\"
ajax_fps
\"
>"
;
echo
elphel_get_P_value
(
$i
,
ELPHEL_FP1000S
)
/
1000
.
" fps"
;
echo
"</td>"
;
}
?>
</tr>
</table>
<br
/>
<br
/>
Recording:
<span
id=
"ajax_state"
>
<?
echo
$xml_state
;
?>
</span><br
/>
Audio Recording:
<span
id=
"ajax_audio_recording"
>
loading...
</span><br
/>
Geo-Tagging:
<span
id=
"ajax_geotag_enabled"
>
<?
if
(
$xml_geotagging_enabled
==
"yes"
)
echo
"enabled"
;
else
echo
"disabled"
;
?>
</span><br
/>
<br
/>
<table
class=
"state_table"
border=
"0px"
cellpadding=
"0px"
cellspacing=
"0px"
>
<tr><td
width=
"120px"
>
Filename:
</td><td
id=
"ajax_file_name"
>
-
</td></tr>
<tr><td>
Image Resolution:
</td><td
id=
"ajax_res"
>
<?
echo
elphel_get_P_value
(
ELPHEL_ACTUAL_WIDTH
)
.
" x "
.
elphel_get_P_value
(
ELPHEL_ACTUAL_HEIGHT
);
?>
</td></tr>
<tr><td>
JPEG Quality
</td><td
id=
"ajax_qual"
>
<?
echo
elphel_get_P_value
(
ELPHEL_QUALITY
)
.
" %"
;
?>
</td></tr>
<tr><td>
Framerate:
</td><td
id=
"ajax_fps"
>
<?
echo
elphel_get_P_value
(
ELPHEL_FP1000S
)
/
1000
.
" fps"
;
?>
</td></tr>
<tr><td
width=
"120px"
>
Camogm:
</td>
<td>
<?php
if
(
!
$camogm_running
)
{
echo
"<span class=
\"
alert
\"
>NOT running!</span>"
;
echo
" <input name=
\"
camogm_start
\"
type=
\"
button
\"
value=
\"
start camogm
\"
>"
;
}
else
echo
"<span class=
\"
green
\"
> running</span>"
;
?>
</td>
</tr>
<tr><td>
Recording:
</td><td
id=
"ajax_state"
>
<?
echo
$xml_state
;
?>
</td></tr>
<tr><td>
Audio Recording:
</td><td
id=
"ajax_audio_recording"
>
loading...
</td></tr>
<tr><td>
Geo-Tagging:
</td><td
id=
"ajax_geotag_enabled"
>
<?
if
(
$xml_geotagging_enabled
==
"yes"
)
echo
"enabled"
;
else
echo
"disabled"
;
?>
</td></tr>
<tr><td>
Filename:
</td><td
id=
"ajax_file_name"
>
-
</td></tr>
<tr><td>
Record Time:
</td><td
id=
"ajax_file_duration"
>
-
</td></tr>
<tr><td>
File Size:
</td><td
id=
"ajax_file_length"
>
-
</td></tr>
<tr><td>
Data Rate:
</td><td
id=
"ajax_data_rate"
>
-
</td></tr>
...
...
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