From: Michael Wiebusch Date: Thu, 1 Aug 2013 16:08:52 +0000 (+0200) Subject: added a nice error picture, testgui should now be able to actualize all sensors at... X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=3cafb23eca40ae88d0d2d4cc77762ce4673595ac;p=mvdsensorcontrol.git added a nice error picture, testgui should now be able to actualize all sensors at once --- diff --git a/tools/preview/error.jpg b/tools/preview/error.jpg new file mode 100644 index 0000000..333b554 Binary files /dev/null and b/tools/preview/error.jpg differ diff --git a/tools/testgui.js b/tools/testgui.js index a6d530d..55f0ba7 100644 --- a/tools/testgui.js +++ b/tools/testgui.js @@ -1,8 +1,9 @@ - - - - +// var sensorIdHash = new Object(); + + + + function reloadQuickEditArea(configFile,destId) { var configFile_ = encodeURIComponent(configFile); @@ -10,4 +11,18 @@ function reloadQuickEditArea(configFile,destId) { getdata("testgui.pl?action=print_quickEditArea&configFile="+configFile_+"&destId="+destId_,destId,"false"); } - \ No newline at end of file + + + +function run(time) { +// sensorIdHash["hugo"]="hugo"; +// sensorIdHash["hugo2"]="hugonaut"; + + getdata("run.pl","","false"); + var sensorId; + for( sensorId in previewAreaIdHash){ +// alert(laufid+" => "+previewAreaIdHash[laufid]); + var sensorId_ = encodeURIComponent(sensorId); + getdata("testgui.pl?action=showPlot&sensorId="+sensorId_,previewAreaIdHash[sensorId],"false"); + } +} \ No newline at end of file diff --git a/tools/testgui.pl b/tools/testgui.pl index ba2f248..f3c38e9 100755 --- a/tools/testgui.pl +++ b/tools/testgui.pl @@ -37,6 +37,8 @@ my $setupTree; my $sensorAreaId; my $quickEditAreaId; +my %previewAreaIdHash; + ####################### @@ -59,6 +61,15 @@ unless($q->param()) { my $destId = $q->param('destId'); $quickEditAreaId = $destId; print_quickEditArea($configFileName); + } elsif ($q->param('action') eq "showPlot") { + + my $sensorId = $q->param('sensorId'); + my $imgSrc = './preview/image_recalibrated_'.$sensorId.'.png'; + if (-e $imgSrc) { + print img{src=>$imgSrc."?".rand(),title=>$sensorId}; + } else { + print img{src=>"./preview/error.jpg",title=>$sensorId}; + } } else { print start_html( @@ -137,6 +148,19 @@ print h2("testgui"); # print_quickEditArea("0.xml"); # print ""; print_setupStructure(); +print q%%; + + + + +print ""; + print end_html; @@ -231,6 +255,7 @@ sub print_sensorArea { my $sensorPosition = $sensor->findnodes("./position")->shift(); my $sensorDescription = $sensor->findvalue("./description"); + $sensorAreaId = $sensorId; print "
"; print ""; @@ -239,22 +264,22 @@ sub print_sensorArea { print ""; print ""; my $previewAreaId = "preview_".$sensorId; - print ""; + print ""; $quickEditAreaId = "quickEdit_".$sensorId; print ""; print ""; - print ""; - print ""; - print ""; - print "
[not run yet!] [not run yet!] "; print_quickEditArea($sensorConfig); print "
"; - my $command = "./prevImg.pl"; - print q%%; - print "
"; +# print ""; +# print ""; +# print ""; + print "
"; +# my $command = "./prevImg.pl"; +# print q%%; +# print "
"; print "
"; - + $previewAreaIdHash{$sensorId}=$previewAreaId; } # description the block that is printed for each sensor, # containing the preview plot and the quick edit area