packages/web/353/php_top/parsedit.php File Reference

Go to the source code of this file.

Functions

 printDefaultPage ()
 Print the default page that has some demo links.
 showImgData ($meta, $skipped, $prev, $imgScale, $done)
 showLastImages ($numImg, $imagesPerRow, $imgScale)
 TODO:if $todo is provided in $_GET - try to find the correct images even if they are not the latest.
 encodeTodo ($todo, $frame_zero)
 Encode $todo to a string that can be passed in GET HTTP request.
 decodeTodo ($encoded_todo)
 Reverse endodeTodo() - create $todo array from the encoded string.
 showSequence ($todo, $frame_zero)
 applyPost ($todo)
 parsePost ()
 addGammas ($todo)
 Scan commands for possible changing gamma tables, calculate them in advance (driver can only scale gamma, not calculate prototypes).
 myval ($s)
 parseGetNames ()
 readCurrentParameterValues ()
 mainJavascript ($refreshSig)
 ============
 startPage ($page_title, $javascript)
 endPage ()
 showControlButtonsRow ($table_width, $readonly, $testMode, $showSeqMode, $encoded_todo, $imagesNumber, $imagesPerRow, $imgScale, $checkNotUncheck)
 Called twice from printPage($encoded_todo).
 printPage ($encoded_todo)
 getDescription ($compositeName, $descriptions)
 getParDescriptions ($autocampars)

Variables

 $autocampars = '/usr/html/autocampars.php'
 globals
 $descriptions = getParDescriptions($autocampars)
 $default_ahead = 3
 $maxahead = 6
 $minahead = 4
 maximal ahead of the current frame that tasks can currently be set to driver;
 $brief = true
 skip to frame $minahead from the soonest next task before programming
 $ahead_separator = '*'
 $refreshSig = "refresh"
 $testMode = -1
 $showSeqMode = -1
 don't even show
 $testBefore = 2
 don't even show
 $testAfter = 2
 Start compressor $testBefore frames before first task.
 $framesBeforeStart = 2
 Stop compressor $testAfter frames after the last task.
 $imgsrv = "http://".$_SERVER['SERVER_ADDR'].":8081"
 In test mode - compressor will be started theis frames after "now".
 $defaultImgScale = 0.2
 $defaultImagesPerRow = 3
 20% image size
 $defaultImagesNumber = 9
 $isPost = $_SERVER["REQUEST_METHOD"]=="POST"
 $ignoreVals = $isPost
 $imagesNumber = $defaultImagesNumber
 $imagesPerRow = $defaultImagesPerRow
 $imgScale = $defaultImgScale
 $embedImageScale = 0
 $defaultEmbedImageScale = 0.3
 $encoded_todo = ""
 $page_title = "Default control/test page for the NC353L camera"
 $elp_const = get_defined_constants(true)
 $elp_const = $elp_const["elphel"]


Function Documentation

addGammas ( todo  ) 

Scan commands for possible changing gamma tables, calculate them in advance (driver can only scale gamma, not calculate prototypes).

Parameters:
todo - array of arrays of parameter chnages

duplicates will be eliminated

Definition at line 693 of file parsedit.php.

References $black, $gamma, $pars, and $showSeqMode.

applyPost ( todo  ) 

Definition at line 596 of file parsedit.php.

References $i, $maxahead, $minahead, $pars, $showSeqMode, and $timeout.

decodeTodo ( encoded_todo  ) 

Reverse endodeTodo() - create $todo array from the encoded string.

Parameters:
$encoded_todo - string representation of todo array
Returns:
array representation of $encoded_todo

Definition at line 546 of file parsedit.php.

References $encoded_todo, $frame, and int.

Referenced by showLastImages().

encodeTodo ( todo,
frame_zero 
)

Encode $todo to a string that can be passed in GET HTTP request.

Parameters:
$todo - array of arrays of parameter chnages
$frame_zero - sequence start frame number that should be added to keys in $todo to get absolute frame numbers
Returns:
string representation of $todo

Definition at line 530 of file parsedit.php.

References $frame.

endPage (  ) 

Definition at line 961 of file parsedit.php.

getDescription ( compositeName,
descriptions 
)

Definition at line 1127 of file parsedit.php.

References $descriptions, $prefix, $width, and exit.

Referenced by printPage().

getParDescriptions ( autocampars  ) 

Definition at line 1169 of file parsedit.php.

References $autocampars, and $configPath.

mainJavascript ( refreshSig  ) 

============

remove &$refreshSig from the url (if any)

Preserve test_mode through GET

Preserve show sequence through GET

Definition at line 837 of file parsedit.php.

References $refreshSig, d, mode, and window.

myval ( s  ) 

Definition at line 711 of file parsedit.php.

References $s.

parseGetNames (  ) 

Definition at line 718 of file parsedit.php.

References $_GET, $address, $ahead, $ahead_separator, $brief, $default_ahead, $defaultEmbedImageScale, $defaultImagesNumber, $defaultImagesPerRow, $defaultImgScale, $elp_const, $embedImageScale, $ignoreVals, $imagesNumber, $imagesPerRow, $imgScale, $isPost, $maxahead, $page_title, $refreshSig, $rslt, $showSeqMode, $testMode, $xml, ahead, ERROR, exit, header, myval(), showLastImages(), and test.

parsePost (  ) 

Definition at line 650 of file parsedit.php.

References $delay, $framesBeforeStart, $showSeqMode, $testAfter, $testBefore, $testMode, int, and name.

printDefaultPage (  ) 

Print the default page that has some demo links.

at least ELPHEL_CONST_TASKLET_CTL_NOSAME bit should be 0 so initialization will not wait for the frame sync

When servicing interrupts, try programming up to 2 frames ahead of the due to program time)

Extra clock cycles needed to compress a frame (in addition to per macroblocs time)

When using async sensor mode use sync time instead of frame sync (start of readout) for the timestamp (eliminates autoexposure caused jitter)

8 bit data mode

80 percent JPEG image quality

regular color mode (not mono or JP4 flavors)

2.0 (200% blue/green color saturation (to compensate for effect of non-unity gamma)

2.0 (200% blue/green color saturation

No bayer shift

turn on sensor in continuous mode

run compressor in continuous mode

red component: black level=10, gamma=0.57, scale=1.0 (will force calculation gamma table)

same for green (main one, red row)

same for green (second, blue row)

same for blue

setting sensor to zero will initiate sensor detection attempt (should be frame 0)

run compressor in continuous mode

Daemons are controlled by bits in this register. Autoexposure bit is 0 (1<<0 == 1)

setting it to 0 will only disable autoexposure, but not HDR modes or white balancing

Fraction of all pixels that should be below P_AEXP_LEVEL (16.16 - 0x10000 - all pixels)

Target output level: [AEXP_FRACPIX]/0x10000 of all pixels should have value below it (0x10000 - full output scale)

Autoexposure period (will be increased if below the latency)

AE error (logariphmic exposures) is integrated between frame and corrections are scaled when error is below thershold (500)

Current frame

Next frame to be processed by autoexposure

Next frame to be processed by the white balance

exposure measured in sensor scanlines (autoexposure modifies number of exposure lines)

exposure in microseconds

Next frame to be processed by the white balance

Percentiles measured for colors 0 (lower 16 bits) and 1 (high 16 bits) for VEXPOS=1 (darkest)

Setting it to 0xffffffff will initiate dark levels re-calibration (making 2 dark drames)

Same for colors 2 and 3

bitmask - which colors to correct (1 - correct, 0 - ignore). Currently only works as ON/OFF

White balance period (will be increased if below the latency)

White balance level of white (16.16 - 0x10000 is full scale, 0xfae1 - 98%, default)

White balance fraction (16.16) of all pixels that have level above [P_WB_WHITELEV] for the brightest color locally [WB_WHITELEV] will be decreased if needed to satisfy [WB_WHITELEV]. default is 1% (0x028f)

additional correction for R from calulated by white balance (16.16)

additional correction for GB (second green) from calulated by white balance (16.16)

additional correction for B from calulated by white balance (16.16)

How many frames the white balance correction has to be the same sign before it will be applied (<128,for each color independently)

red component: black level=10, gamma=0.57, scale=1.0 (will force calculation gamma table)

same for green (main one, red row)

same for green (second, blue row)

same for blue

0 - HDR 0ff, >1 - duration of same exposure (currently 1 or 2 - for free running)

if less than 0x10000 - number of lines of exposure, >=10000 - relative to "normal" exposure

How many frames ahead of the current frame write exposure to the sensor

current integrated error in the AE loop

Relative histogram window width (0x10000 - 100%)

Relative histogram window height (0x10000 - 100%)

Relative histogram window left (0x10000 - 100%)

Relative histogram window top (0x10000 - 100%)

Absolute (as written to FPGA) histogram window width

Absolute (as written to FPGA) histogram window height

Absolute (as written to FPGA) histogram window left (counted from the left of WOI margin)

Absolute (as written to FPGA) histogram window top (counted from the top of WOI)

run compressor in continuous mode

Daemons are controlled by bits in this register. Autoexposure bit is 0 (1<<0 == 1)

setting it to 0 will only disable autoexposure, but not HDR modes or white balancing

Fraction of all pixels that should be below P_AEXP_LEVEL (16.16 - 0x10000 - all pixels)

Target output level: [AEXP_FRACPIX]/0x10000 of all pixels should have value below it (0x10000 - full output scale)

Autoexposure period (will be increased if below the latency)

AE error (logariphmic exposures) is integrated between frame and corrections are scaled when error is below thershold (500)

Current frame

Next frame to be processed by autoexposure

exposure measured in sensor scanlines (autoexposure modifies number of exposure lines)

exposure in microseconds

Percentiles measured for colors 0 (lower 16 bits) and 1 (high 16 bits) for VEXPOS=1 (darkest)

Setting it to 0xffffffff will initiate dark levels re-calibration (making 2 dark drames)

Same for colors 2 and 3

How many frames ahead of the current frame write exposure to the sensor

Relative histogram window width (0x10000 - 100%)

Relative histogram window height (0x10000 - 100%)

Relative histogram window left (0x10000 - 100%)

Relative histogram window top (0x10000 - 100%)

Absolute (as written to FPGA) histogram window width

Absolute (as written to FPGA) histogram window height

Absolute (as written to FPGA) histogram window left (counted from the left of WOI margin)

Absolute (as written to FPGA) histogram window top (counted from the top of WOI)

Current integrated error in the AE loop

run compressor in continuous mode

Daemons are controlled by bits in this register. Autoexposure bit is 0 (1<<0 == 1)

Current frame

Next frame to be processed by the white balance

Next frame to be processed by the white balance

bitmask - which colors to correct (1 - correct, 0 - ignore). Currently only works as ON/OFF

White balance period (will be increased if below the latency)

White balance level of white (16.16 - 0x10000 is full scale, 0xfae1 - 98%, default)

White balance fraction (16.16) of all pixels that have level above [P_WB_WHITELEV] for the brightest color locally [WB_WHITELEV] will be decreased if needed to satisfy [WB_WHITELEV]. default is 1% (0x028f)

additional correction for R from calulated by white balance (16.16)

additional correction for GB (second green) from calulated by white balance (16.16)

additional correction for B from calulated by white balance (16.16)

WB errors are integrated between frame and corrections are scaled when error is below thershold (500)

minimal sensor analog gain (0x100 - 1.0)

maximal sensor analog gain (0x100 - 1.0)

minimal correction to be applied to the analog gain (should be set larger that sensor actual gain step to prevent oscillations (0x100 - 1.0, 0x40 - 1/8)

Enable analog gain controls in white balancing

red component: black level=10, gamma=0.57, scale=1.0 (will force calculation gamma table)

same for green (main one, red row)

same for green (second, blue row)

same for blue

Analog gains

R channel gain (mono gain) 8.8 0x100 - 1.0

G channel gain (mono gain) 8.8 0x100 - 1.0

GB channel gain (mono gain) 8.8 0x100 - 1.0

B channel gain (mono gain) 8.8 0x100 - 1.0

Sensor register gain R

Sensor register gain G

Sensor register gain GB

Sensor register gain B

current integrated error in the WB loop

run compressor in continuous mode

Daemons are controlled by bits in this register. Autoexposure bit is 0 (1<<0 == 1)

setting it to 0 will only disable autoexposure, but not HDR modes or white balancing

exposure measured in sensor scanlines (autoexposure modifies number of exposure lines)

exposure in microseconds

0 - HDR 0ff, >1 - duration of same exposure (currently 1 or 2 - for free running)

if less than 0x10000 - number of lines of exposure, >=10000 - relative to "normal" exposure

Current frame

External trigger mode bit 0 - "old" external mode (0- internal, 1 - external ) bit 1 - enable(1) or disable(0) external trigger to stop clip bit 2 - async (snapshot, ext trigger) mode, 0 - continuous NOTE: Only this bit is used now ! bit 3 - no overlap, single frames: program - acquire/compress same frame

0.2 sec output sync period (32 bits, in pixel clocks) >=256 repetitive with specified period. NOTE: Currently there is no verification that period is longer than sensor/compressor can handle

trigger delay, 32 bits in pixel clocks (needed when multiple cameras are synchronized)

When using async sensor mode use sync time instead of frame sync (start of readout) for the timestamp (eliminates autoexposure caused jitter)

Current frame

Next parameters are non-zero only for external connections and should match particular I/O boards/connectors

trigger condition, 0 - internal, else dibits ((use<<1) | level) for each GPIO[11:0] pin

trigger output to GPIO, dibits ((use << 1) | level_when_active). Bit 24 - test mode, when GPIO[11:10] are controlled by other internal signals

Sensor register MODE1 (trigger bit)

Definition at line 157 of file parsedit.php.

References a, image, mode, printk, row, size, and test.

printPage ( encoded_todo  ) 

Definition at line 1001 of file parsedit.php.

References $brief, $descriptions, $embedImageScale, $encoded_todo, $imagesNumber, $imagesPerRow, $imgScale, $imgsrv, $meta, $page_title, $showSeqMode, $testMode, $width, ahead, getDescription(), height, name, SEEK_END, showControlButtonsRow(), value, and width.

readCurrentParameterValues (  ) 

Definition at line 809 of file parsedit.php.

References $ignoreVals, $page_title, $pars, name, and value.

showControlButtonsRow ( table_width,
readonly,
testMode,
showSeqMode,
encoded_todo,
imagesNumber,
imagesPerRow,
imgScale,
checkNotUncheck 
)

Called twice from printPage($encoded_todo).

Definition at line 966 of file parsedit.php.

References $encoded_todo, $imagesNumber, $imagesPerRow, $imgScale, $showSeqMode, and $testMode.

Referenced by printPage().

showImgData ( meta,
skipped,
prev,
imgScale,
done 
)

show table with last acquired images and meta data TODO: show chnaged parameters for those frames? ***

just seconds

Definition at line 358 of file parsedit.php.

References $frame, $imgScale, $imgsrv, $meta, $width, color, height, and width.

Referenced by showLastImages().

showLastImages ( numImg,
imagesPerRow,
imgScale 
)

TODO:if $todo is provided in $_GET - try to find the correct images even if they are not the latest.

failed to find the right frame in circbuf - probably overwritten

TODO: If all changes were later than the images shown - disregard $todo

$done per image

Definition at line 433 of file parsedit.php.

References $_GET, $circbuf_pointers, $frame, $i, $imagesPerRow, $imgScale, $meta, $page_title, decodeTodo(), endPage(), frame, min, showImgData(), and startPage().

Referenced by parseGetNames().

showSequence ( todo,
frame_zero 
)

Definition at line 564 of file parsedit.php.

References $frame.

startPage ( page_title,
javascript 
)

Definition at line 945 of file parsedit.php.

References $page_title, and type.


Variable Documentation

$ahead_separator = '*'

Definition at line 98 of file parsedit.php.

Referenced by parseGetNames().

$autocampars = '/usr/html/autocampars.php'

globals

! PHP script ! FILE NAME : parsedit.php ! DESCRIPTION: ! AUTHOR : Elphel, Inc. ! Copyright (C) 2008 Elphel, Inc ! -----------------------------------------------------------------------------** ! ! This program is free software: you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation, either version 3 of the License, or ! (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program. If not, see <http://www.gnu.org/licenses/>. ! -----------------------------------------------------------------------------** !

Log
parsedit.php,v
! Revision 1.1.1.1 2008/11/27 20:04:03 elphel ! ! ! Revision 1.20 2008/11/20 23:23:19 elphel ! Now shows descriptions for composite names - bit selections and indexed ! ! Revision 1.19 2008/11/20 07:04:15 elphel ! support for parameter descriptions ! ! Revision 1.18 2008/11/18 07:36:27 elphel ! Added "Select All" button ! ! Revision 1.17 2008/11/17 23:42:04 elphel ! changed myval() to accept numbers in "" ! ! Revision 1.16 2008/11/16 17:34:32 elphel ! default settings ! ! Revision 1.15 2008/11/16 00:24:21 elphel ! Added "Uncheck All" button ! ! Revision 1.14 2008/11/15 07:04:27 elphel ! new parameters to modify analog gains while white balancing ! ! Revision 1.13 2008/11/15 03:10:13 elphel ! Some parameters renamed, reassigned. ! ! Revision 1.12 2008/11/13 05:40:45 elphel ! 8.0.alpha16 - modified histogram storage, profiling ! ! Revision 1.11 2008/11/08 05:53:33 elphel ! removed commented out code ! ! Revision 1.10 2008/11/05 02:01:25 elphel ! Added bit field manipulation in parameters ! ! Revision 1.9 2008/11/03 19:21:03 elphel ! wrong value for TRIG_PERIOD (it is in pixel clocks, not usec) ! ! Revision 1.8 2008/11/02 00:55:10 elphel ! added analog gain control (in white balance page) ! ! Revision 1.7 2008/11/02 00:34:55 elphel ! added initialization of the camera, multiple demo links on default page ! ! Revision 1.6 2008/11/01 06:37:59 elphel ! minor bug fix ! ! Revision 1.5 2008/11/01 06:26:12 elphel ! added optional image to the control page ! ! Revision 1.4 2008/10/31 23:16:28 elphel ! Now generates last acquired images, annotating them with sequencer commands ! ! Revision 1.3 2008/10/31 18:26:32 elphel ! Adding support for constants like SENSOR_REGS32 (defined constant plus 32 to simplify referencing sensor registers from PHP ! ! Revision 1.2 2008/10/29 05:29:20 elphel ! snapshot ! ! Revision 1.1 2008/10/29 04:29:29 elphel ! started a new script to edit arbitrary camera parameters through web interface !

Definition at line 92 of file parsedit.php.

Referenced by getParDescriptions().

$brief = true

skip to frame $minahead from the soonest next task before programming

Definition at line 97 of file parsedit.php.

Referenced by parseGetNames(), and printPage().

$default_ahead = 3

Definition at line 94 of file parsedit.php.

Referenced by parseGetNames().

$defaultEmbedImageScale = 0.3

Definition at line 115 of file parsedit.php.

Referenced by parseGetNames().

$defaultImagesNumber = 9

Definition at line 108 of file parsedit.php.

Referenced by parseGetNames().

$defaultImagesPerRow = 3

20% image size

Definition at line 107 of file parsedit.php.

Referenced by parseGetNames().

$defaultImgScale = 0.2

Definition at line 106 of file parsedit.php.

Referenced by parseGetNames().

$descriptions = getParDescriptions($autocampars)

Definition at line 93 of file parsedit.php.

Referenced by getDescription(), and printPage().

$elp_const = $elp_const["elphel"]

Definition at line 129 of file parsedit.php.

$elp_const = get_defined_constants(true)

Definition at line 128 of file parsedit.php.

$embedImageScale = 0

Definition at line 114 of file parsedit.php.

$encoded_todo = ""

Definition at line 116 of file parsedit.php.

Referenced by decodeTodo(), printPage(), and showControlButtonsRow().

$framesBeforeStart = 2

Stop compressor $testAfter frames after the last task.

Definition at line 104 of file parsedit.php.

Referenced by parsePost().

$ignoreVals = $isPost

Definition at line 110 of file parsedit.php.

Referenced by parseGetNames(), and readCurrentParameterValues().

$imagesNumber = $defaultImagesNumber

Definition at line 111 of file parsedit.php.

Referenced by parseGetNames(), printPage(), and showControlButtonsRow().

$imagesPerRow = $defaultImagesPerRow

Definition at line 112 of file parsedit.php.

Referenced by parseGetNames(), printPage(), showControlButtonsRow(), and showLastImages().

$imgScale = $defaultImgScale

Definition at line 113 of file parsedit.php.

Referenced by parseGetNames(), printPage(), showControlButtonsRow(), showImgData(), and showLastImages().

$imgsrv = "http://".$_SERVER['SERVER_ADDR'].":8081"

In test mode - compressor will be started theis frames after "now".

Definition at line 105 of file parsedit.php.

$isPost = $_SERVER["REQUEST_METHOD"]=="POST"

Definition at line 109 of file parsedit.php.

Referenced by parseGetNames().

$maxahead = 6

Definition at line 95 of file parsedit.php.

Referenced by applyPost(), and parseGetNames().

$minahead = 4

maximal ahead of the current frame that tasks can currently be set to driver;

Definition at line 96 of file parsedit.php.

Referenced by applyPost().

$page_title = "Default control/test page for the NC353L camera"

Definition at line 121 of file parsedit.php.

Referenced by parseGetNames(), printPage(), processGet(), readCurrentParameterValues(), showLastImages(), and startPage().

$refreshSig = "refresh"

Definition at line 99 of file parsedit.php.

Referenced by mainJavascript(), and parseGetNames().

$showSeqMode = -1

don't even show

Definition at line 101 of file parsedit.php.

Referenced by addGammas(), applyPost(), parseGetNames(), parsePost(), printPage(), and showControlButtonsRow().

$testAfter = 2

Start compressor $testBefore frames before first task.

Definition at line 103 of file parsedit.php.

Referenced by parsePost().

$testBefore = 2

don't even show

Definition at line 102 of file parsedit.php.

Referenced by parsePost().

$testMode = -1

Definition at line 100 of file parsedit.php.

Referenced by parseGetNames(), parsePost(), printPage(), and showControlButtonsRow().


Generated on Fri Nov 28 00:08:38 2008 for elphel by  doxygen 1.5.1