log_error("Invalid camera state:".$GLOBALS['camera_state_arr']['state'].", valid states are:\n".print_r(array_keys($GLOBALS['STOP_AFTER']),1));
respond_xml($GLOBALS['camera_state_arr']['state']," Invalid state, valid are: ".implode(',',array_keys($GLOBALS['STOP_AFTER'])));// will exit with error
}
log_msg("Processing camera state: ".$GLOBALS['camera_state_arr']['state']);
* #define AUTOCAMPARS_CMD_RESTORE 1 /// restore specified groups of parameters from the specified page
* #define AUTOCAMPARS_CMD_SAVE 2 /// save all current parameters to the specified group (page 0 is write-protected)
* #define AUTOCAMPARS_CMD_DFLT 3 /// make selected page the default one (used at startup), page 0 OK
* #define AUTOCAMPARS_CMD_SAVEDFLT 4 /// save all current parameters to the specified group (page 0 is write-protected) and make it default (used at startup)
* #define AUTOCAMPARS_CMD_INIT 5 /// reset sensor/sequencers, restore all parameters from the specified page
*/
// / Even as sync happens simultaneously, frame sync is not - it depends on exposure time.
// / So we need to disable autoexposure and set minimal exposure on this camera, restore on exit
$waitDaemons=5.0;// / Wait for daemons to stop (when disabled) before resetting frame number.
// / They should look at thei enable bit periodically and restart if the frame is
// / the frame is not what they were expecting to be
$sleepOnce=0.1;
// / Here trying full reset with zeroing the absolute frame number, setting all frame parameters to 0 and starting
$framepars_file=fopen($framepars_path,"r");
// /TODO: Improve sequence here so it will not depend on delays
fseek($framepars_file,ELPHEL_LSEEK_FRAMEPARS_INIT,SEEK_END);// / NOTE: resets all the senor parameters (tasklet control)
// / elphel_set_P_value($GLOBALS['sensor_port'],ELPHEL_SENSOR, 0x00, 0, ELPHEL_CONST_FRAMEPAIR_FORCE_NEWPROC);/// set sensor to 0 will start detection
echo"before reset - current frame=".elphel_get_frame($GLOBALS['sensor_port'])."\n";
// elphel_set_P_value($GLOBALS['sensor_port'],ELPHEL_SENSOR, 0x00, 0, ELPHEL_CONST_FRAMEPAIR_FORCE_NEWPROC);/// set sensor to 0 will start detection
elphel_set_P_value($GLOBALS['sensor_port'],ELPHEL_SENSOR,0x00,elphel_get_frame($GLOBALS['sensor_port']),ELPHEL_CONST_FRAMEPAIR_FORCE_NEWPROC);// / set sensor to 0 will start detection
fseek($framepars_file,ELPHEL_LSEEK_SENSORPROC,SEEK_END);// / In case the autoprocessing after parameter write will be disabled in the future
// / (normally parameters are processed at frame sync interrupts - not yet available)
fclose($framepars_file);
// / Sensor should be up and running. let's wait for up to $maxWait seconds
if(($mask&$parMask)&&array_key_exists($par,$GLOBALS['configs'][$port]['paramSets'][$page])&&(!$GLOBALS['configs'][$port]['parTypes'][$par]))// / not 'text'