Esempio n. 1
0
function convert($s)
{
    // clean up
    $s = trim($s, "\" ");
    // check if value is in HEX
    if (strtoupper(substr($s, 0, 2)) == "0X") {
        return intval(hexdec($s));
    } else {
        return intval($s);
    }
}
$param = array();
foreach ($_GET as $key => $val) {
    $param[$key] = convert($val);
}
// parameters are set X frames in the future
if (isset($_GET['framedelay'])) {
    $frame_delay = $_GET['framedelay'];
} else {
    $frame_delay = 1;
}
// default in 3 frames
// set parameters
$set_frame = elphel_set_P_arr($param, elphel_get_frame() + $frame_delay);
// debug
echo "current frame: " . elphel_get_frame() . "<br />\n";
echo "frame with new parameters: " . $set_frame . "<br />\n";
echo "Setting parameter ";
print_r($param);
echo "<br />\n";
include "getparams.php";
Esempio n. 2
0
    $set_frame = elphel_set_P_arr($params, elphel_get_frame());
    // TRIGGER
    $params = array();
    if ($val_trigger < 1) {
        $val_trigger = 1;
    }
    $trigger = 4;
    $trigger_period = 96000000 / (floatval($val_trigger) * 2);
    printf("trigger[ON]= %ld, ", $trigger_period);
    $params["TRIG_PERIOD"] = intval($trigger_period);
    $set_frame = elphel_set_P_arr($params, elphel_get_frame());
    $params = array();
    $params["TRIG"] = intval($trigger);
    $params["FP1000SLIM"] = $val_trigger;
    $set_frame = elphel_set_P_arr($params, elphel_get_frame() + 1);
    // VIRTUAL HEIGHT
    $params = array();
    if ($val_virtual > 11) {
        printf("virtual[ON]=%d", $val_virtual);
        $params["VIRT_HEIGHT"] = intval($val_virtual);
        $params["VIRT_KEEP"] = 1;
        $set_frame = elphel_set_P_arr($params, elphel_get_frame());
    } else {
        printf("virtual[OFF]");
        $params["VIRT_KEEP"] = 0;
        $set_frame = elphel_set_P_arr($params, elphel_get_frame());
    }
    printf(" ... updated frame #" . $set_frame . "\n");
    $content = "";
}
fclose($handle);