Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
elphel-apps-autocampars
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-autocampars
Commits
5d1287b5
Commit
5d1287b5
authored
Apr 04, 2018
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
restoring if saved with trig_condition
parent
b324c0bb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
32 deletions
+39
-32
autocampars.php
src/autocampars.php
+39
-32
No files found.
src/autocampars.php
View file @
5d1287b5
...
...
@@ -1120,10 +1120,11 @@ function init_cameras(){ // $page) { init can only be from default page as page
log_msg
(
"Started camera in free running mode"
,
3
);
log_msg
(
"Reached state "
.
$GLOBALS
[
'camera_state_arr'
][
'state'
]);
}
else
if
(
!
array_key_exists
(
'TRIG_CONDITION'
,
$GLOBALS
[
'trig_pars'
])
||
!
$GLOBALS
[
'trig_pars'
][
'TRIG_CONDITION'
]){
}
else
if
(
!
array_key_exists
(
'TRIG_CONDITION'
,
$GLOBALS
[
'trig_pars'
])
||
!
$GLOBALS
[
'trig_pars'
][
'TRIG_CONDITION'
]
||
!
isset
(
$curl_data
)
){
log_msg
(
"array_key_exists('TRIG_CONDITION', GLOBALS['trig_pars'] = "
.
array_key_exists
(
'TRIG_CONDITION'
,
$GLOBALS
[
'trig_pars'
]),
0
);
log_msg
(
'GLOBALS[trig_pars][TRIG_CONDITION] = '
.
$GLOBALS
[
'trig_pars'
][
'TRIG_CONDITION'
],
0
);
// self-triggered mode
$trig_condition
=
$GLOBALS
[
'trig_pars'
][
'TRIG_CONDITION'
];
unset
(
$GLOBALS
[
'trig_pars'
][
'TRIG_CONDITION'
]);
unset
(
$trig_period
);
if
(
array_key_exists
(
'TRIG_PERIOD'
,
$GLOBALS
[
'trig_pars'
])
&&
(
$GLOBALS
[
'trig_pars'
][
'TRIG_PERIOD'
]
>
255
)){
...
...
@@ -1136,10 +1137,12 @@ function init_cameras(){ // $page) { init can only be from default page as page
// The line below applies the parameter in a normal way - otherwise, if unlucky, TRIG_PERIOD can jump
// between 1 and $trig_period.
//elphel_set_P_value ( $GLOBALS['master_port'], ELPHEL_TRIG_PERIOD, $trig_period, 0);
elphel_set_P_value
(
$GLOBALS
[
'master_port'
],
ELPHEL_TRIG_PERIOD
,
$trig_period
);
//
elphel_set_P_value ( $GLOBALS['master_port'], ELPHEL_TRIG_PERIOD, $trig_period);
// Set parameter immediately
// log_msg("pre3.Trigger $i:\n".file_get_contents('/sys/devices/soc0/elphel393-framepars@0/all_frames'));
elphel_set_P_value
(
$GLOBALS
[
'master_port'
],
ELPHEL_TRIG_PERIOD
,
$trig_period
,
ELPHEL_CONST_FRAME_IMMED
,
ELPHEL_CONST_FRAMEPAIR_FORCE_NEWPROC
);
log_msg
(
"Started camera in periodic self-triggered mode, period = "
.
(
0.00000001
*
$trig_period
)
.
" s"
,
3
);
elphel_set_P_value
(
$GLOBALS
[
'master_port'
],
ELPHEL_TRIG_CONDITION
,
$trig_condition
);
log_msg
(
"Started camera in periodic self-triggered mode, period = "
.
(
0.00000001
*
$trig_period
)
.
" s, trig_condition = "
.
dechex
(
$trig_condition
));
}
else
{
// manually advance frames
if
(
!
$GLOBALS
[
'camera_state_arr'
][
'frames_skip_more'
]
>
ELPHEL_CONST_FRAME_DEAFAULT_AHEAD
){
$GLOBALS
[
'camera_state_arr'
][
'frames_skip_more'
]
=
ELPHEL_CONST_FRAME_DEAFAULT_AHEAD
+
1
;
...
...
@@ -1150,7 +1153,11 @@ function init_cameras(){ // $page) { init can only be from default page as page
usleep
(
$GLOBALS
[
'camera_state_arr'
][
'max_frame_time'
]);
log_msg
(
"3.Trigger
$i
:
\n
"
.
file_get_contents
(
'/sys/devices/soc0/elphel393-framepars@0/all_frames'
));
}
elphel_set_P_value
(
$GLOBALS
[
'master_port'
],
ELPHEL_TRIG_CONDITION
,
$trig_condition
,
ELPHEL_CONST_FRAME_IMMED
,
ELPHEL_CONST_FRAMEPAIR_FORCE_NEWPROC
);
}
log_msg
(
"trig_condition="
.
$trig_condition
);
log_msg
(
"last3 frames:
\n
"
.
file_get_contents
(
'/sys/devices/soc0/elphel393-framepars@0/all_frames'
));
log_msg
(
"GLOBALS['trig_pars']:
\n
"
.
print_r
(
$GLOBALS
[
'trig_pars'
],
1
));
log_msg
(
"Reached state "
.
$GLOBALS
[
'camera_state_arr'
][
'state'
]);
}
else
{
// Triggered input mode, not sure where input comes from
...
...
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