Commit 487095a2 authored by Andrey Filippov's avatar Andrey Filippov

added setting time from the host in multicam3.js and parsedit.php

parent f6d91c5d
...@@ -444,8 +444,8 @@ function startStopRefresh (){ ...@@ -444,8 +444,8 @@ function startStopRefresh (){
// wb_en // wb_en
// parsedit.php?immediate&sensor_port=0&WB_EN // parsedit.php?immediate&sensor_port=0&WB_EN
function init_port(cam_i,port_i){ function init_port(cam_i,port_i){
var date_time=new Date();
var url = "http://"+cams[cam_i].ip+"/parsedit.php?immediate&sensor_port="+cams[cam_i].ports[port_i].index+"&WB_EN"; var url = "http://"+cams[cam_i].ip+"/parsedit.php?immediate&sensor_port="+cams[cam_i].ports[port_i].index+"&WB_EN"+"&_time="+date_time.getTime();
$.ajax({ $.ajax({
url: url, url: url,
cam_i: cam_i, cam_i: cam_i,
......
...@@ -526,8 +526,8 @@ function startStopRefresh (){ ...@@ -526,8 +526,8 @@ function startStopRefresh (){
// wb_en // wb_en
// parsedit.php?immediate&sensor_port=0&WB_EN // parsedit.php?immediate&sensor_port=0&WB_EN
function init_port(cam_i,port_i){ function init_port(cam_i,port_i){
var date_time=new Date();
var url = "http://"+cams[cam_i].ip+"/parsedit.php?immediate&sensor_port="+cams[cam_i].ports[port_i].index+"&WB_EN"; var url = "http://"+cams[cam_i].ip+"/parsedit.php?immediate&sensor_port="+cams[cam_i].ports[port_i].index+"&WB_EN"+"&_time="+date_time.getTime();
$.ajax({ $.ajax({
url: url, url: url,
cam_i: cam_i, cam_i: cam_i,
......
...@@ -1109,7 +1109,13 @@ function parseGetNames() { ...@@ -1109,7 +1109,13 @@ function parseGetNames() {
} else if ($key=='embed') { } else if ($key=='embed') {
$embedImageScale= $value; $embedImageScale= $value;
if (!$embedImageScale) $embedImageScale=$defaultEmbedImageScale; if (!$embedImageScale) $embedImageScale=$defaultEmbedImageScale;
} else if ($key=='_time') { } else if (($key=='_time') || ($key=='_stime')) {
$time = ((float) $value)/1000;
if (($key=='_stime') || (abs(elphel_get_fpga_time()-$time) < 24*3600)){ // time is not already set or forced
elphel_set_fpga_time ($time); // set FPGA time
exec("date -s '".@date("Y-m-d H:i:s.u",(int)$time)."'",$out,$ret); // set system time
exec("hwclock --systohc");
}
} else if ($key=='sensor_port') { } else if ($key=='sensor_port') {
} else if ($key[0]=='*') { } else if ($key[0]=='*') {
...@@ -1310,6 +1316,9 @@ function refreshPage(mode) { ...@@ -1310,6 +1316,9 @@ function refreshPage(mode) {
refIndex+=showSeqName.length+1; refIndex+=showSeqName.length+1;
url=url.substr(0,refIndex)+"="+(document.getElementById("id_show_seq").checked?1:0)+url.substr(index1); url=url.substr(0,refIndex)+"="+(document.getElementById("id_show_seq").checked?1:0)+url.substr(index1);
} }
// alert ("url="+url);
var date_time=new Date();
url+="&_time="+date_time.getTime();
// alert ("url="+url); // alert ("url="+url);
window.location.href=url; window.location.href=url;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment