--- /dev/null
+
+
+
+#textarea {
+/* float:left; */
+ position:absolute;
+/* position:fixed; */
+/* width:320px; */
+ left:0px;
+ top:50px;
+ min-width: 60px;
+ min-height: 40px;
+ padding:10px;
+ margin-top:30px;
+ margin-left:30px;
+
+ }
+
\ No newline at end of file
--- /dev/null
+
+var timer;
+
+$(document).ready(function(){
+
+ activate_components();
+ load_file();
+ set_clear_timer();
+
+});
+
+
+function load_file(){
+
+ $.ajax({
+ url: "editor.pl",
+ cache: false,
+ async: false,
+ dataType: "text",
+ data: {
+ sub : "print_file",
+ file : shared["file"]
+ },
+ success: function(result) {
+ $("#text_field").val(result);
+ $("#report").html("file loaded");
+ }
+ });
+}
+
+
+function write_file(){
+ $.ajax({
+ url: "editor.pl",
+ cache: false,
+ async: false,
+ dataType: "text",
+ data: {
+ sub : "write_file",
+ file : shared["file"],
+ text : get_textarea_content()
+ },
+ success: function(result) {
+ $("#report").html(result);
+ }
+ });
+}
+
+
+function activate_components(){
+
+
+ $("#reloadbutton").click(function(){
+ load_file();
+ set_clear_timer();
+ });
+ $("#savebutton").click(function(){
+ write_file();
+ set_clear_timer();
+ });
+
+ timer = $.timer(function() {
+ clear_report();
+ timer.stop();
+ });
+
+}
+
+function get_textarea_content () {
+ return $("#text_field").val();
+}
+
+
+function set_clear_timer(){
+ timer.set({time:3000,autostart: true});
+}
+
+function clear_report (){
+ $("#report").html(" ... ");
+}
+
+
\ No newline at end of file
--- /dev/null
+#!/usr/bin/perl -w
+
+
+
+my $me = "editor.pl";
+
+use strict;
+use warnings;
+use POSIX;
+use CGI ':standard';
+use CGI::Carp qw(fatalsToBrowser);
+use Widgets;
+require Common;
+use FindBin;
+use lib "$FindBin::Bin/..";
+use Environment;
+use File::Basename;
+
+
+my $shared;
+
+##############
+## dispatch table (subs that are callable via CGI)
+##############
+my $dispatch = {
+ table_hash => \&table_hash,
+ print_file => \&print_file,
+ write_file => \&write_file
+};
+
+
+#recieve new CGI request
+my $q = CGI->new;
+
+
+print header;
+
+if ($q->param('sub')){
+ my $subname = $q->param('sub');
+ $dispatch->{$subname}->($q); # give the sub the query
+} else {
+ page_body($q);
+}
+exit;
+
+
+#################### SUBLAND ######################
+
+###############################
+## subs generating html output
+###############################
+
+
+sub page_body{
+
+ init_html();
+ my $q = shift;
+
+ $shared->{file}=$q->param('file');
+ my @stuff = split("/",$shared->{file});
+ my $filename=@stuff[-1];
+
+ print h2 "Text editor";
+
+ print '<div id="textarea" class="stylishBox">';
+ print "<div class='header' title='".$shared->{file}."'>"
+ .$filename."</div>";
+ print qq%
+ <TEXTAREA NAME="Address" id="text_field" ROWS=42 COLS=100 >
+ [Platzhalter]
+ </TEXTAREA>
+ <br>
+ <input id="savebutton" type="button" value="save">
+ <input id="reloadbutton" type="button" value="reload">
+ %;
+
+
+ print '<span id="report"> ... </span>';
+
+ print '</div>';
+
+ print '<div id="controls" class="stylishBox">';
+ print '</div>';
+
+ # print '<div id="debugStuff" class="debugFeature">';
+ # print_debugStuff($q);
+ # print '</div>';
+
+ passHashToJs($shared,'shared');
+}
+
+sub table_hash{
+ my $q = shift;
+
+ print '<table>';
+ for my $key ( $q->param()){
+ print '<tr>';
+ print '<td>'.$key.'</td><td>=></td><td>'.$q->param($key).'</td>';
+ print '</tr>';
+ }
+ print '</table>';
+}
+
+sub print_file {
+ my $q = shift;
+ my $file = $q->param('file');
+
+ open(READ,"$file")
+ or print "Error while opening : $file\n";
+ while(defined(my $i = <READ>)) {
+ print $i;
+ }
+}
+
+
+sub write_file {
+ my $q = shift;
+ my $file = $q->param('file');
+ my $text = $q->param('text');
+
+ open(WRITE,">$file")
+ or print "Error while opening : $file\n";
+ print WRITE $text;
+ close(WRITE);
+
+ print "saved!";
+}
+
+
+sub passHashToJs {
+
+ my $hashref = shift();
+ my $objname = shift();
+ $objname = 'fromPerl' unless (defined($objname));
+ print "<script language='javascript'>\n";
+ print "var $objname = new Object();\n";
+ for my $key (keys %$hashref){
+ print $objname.qq%["$key"]="%.$hashref->{$key}.qq%";\n%;
+ }
+ print "</script>";
+
+}
+
+
+sub init_html{
+ print start_html(
+ -title=>'Text editor',
+ -style=>[{'src'=>'../layout/styles.css'},
+ {'src'=>'../layout/jtageditor_blue.css'},
+ {'src'=>'../layout/editor.css'}
+ ],
+ -script=>[
+# { -type => 'text/javascript', -src => 'http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js'},
+ { -type => 'text/javascript', -src => '../scripts/jquery.min.js'},
+ { -type => 'text/javascript', -src => './editor.js'},
+ { -type => 'text/javascript', -src => '../scripts/jquery.timer.js'}
+ ]
+ );
+}
my $dummy;
-$dummy =qx"./startup.pl $setupFile";
+$dummy =qx|date|;
+$dummy .=qx"./startup.pl $setupFile";
+
unless($q->param('startupOnly') eq 'true'){
+ $dummy.=qx|date|;
$dummy.=qx"rm $dumpPath/te1*.hld 2>&1";
$dummy.=qx"./preview/exec_evtbuild_t.pl -t $runtime -p $dumpPath -s $systemName -d $ports 2>&1";
+ $dummy.=qx|date|;
$dummy.=qx"rm $dumpPath/temp.hld 2>&1";
$dummy.=qx"mv $dumpPath/te1* $dumpPath/temp.hld 2>&1";
+ $dummy.=qx|ls -lh $dumpPath/temp.hld|;
+ $dummy.=qx|date|;
$dummy.=qx"rm $picPath/$systemName*.png 2>&1"; # delete old pictures
- $dummy.=qx"./preview/unpack_hld.pl -r -f $dumpPath/temp.hld -p $picPath -s $systemName 2>&1";
+# $dummy.=qx"./preview/unpack_hld.pl -r -f $dumpPath/temp.hld -p $picPath -s $systemName 2>&1";
+ $dummy.=qx"./unpacker/run.sh $dumpPath/temp.hld $picPath $systemName 2>&1";
+ $dummy.=qx|date|;
}
my $escapedDummy = escapeHTML($dummy);
$escapedDummy =~ s/\n/<br>/g;
trb_write($ccu,0x00c3,0x00ff); #only slowcontrol for unused FPGA
}
if($system eq 'ELab') {
- trb_write($ccu,0x00c0,0x00ed);
- trb_write($ccu,0x00c1,0x00ed);
- trb_write($ccu,0x00c3,0x00fd); # only 0x00, 0x02, 0x03 active
+ trb_write($ccu,0x00c0,0x00ec);
+ trb_write($ccu,0x00c1,0x00ec);
+ trb_write($ccu,0x00c3,0x00fc); # only 0x00, 0x02, 0x03 active
}
#Send arbiter start signal
-}
\ No newline at end of file
+}
+
+
+$(document).ready(function(){
+
+// $("#editorlink").click( function() {
+// var setupFile_ = encodeURIComponent(setupFile);
+// var url='editor.pl?file='+setupFile_;
+// window.open(url, '_blank');
+// });
+
+ $("#setupeditorlink").attr("href","editor.pl?file="+encodeURIComponent(setupFile));
+ $("#systemeditorlink").attr("href","editor.pl?file="+encodeURIComponent(systemFile));
+
+});
{'src'=>'../layout/testgui.css'}
],
-script=>[
+ { -type => 'text/javascript', -src => '../scripts/jquery.min.js'},
{ -type => 'text/javascript', -src => './testgui.js'},
{ -type => 'text/javascript', -src => './hideAndShow.js'},
{ -type => 'text/javascript', -src => './getdata.js'},
print "chose setup: ";
print "</td><td>";
$setup_selector->print_html();
+ print "</td><td>";
+ print "<a href='#' id='setupeditorlink' >edit setup file</a>";
+ print "</td><td>";
+ print "<a href='#' id='systemeditorlink' >edit system file</a>";
print "</td></tr></table>";
print_setupStructure();
# so the javascript knows which placeholders to fill with actual plots
print "<script language='javascript'>\n";
print q%var setupFile = '%.$setupFile.q%';%."\n";
+ print q%var systemFile = '%.SYSTEMDIR."/".$systemName.".xml".q%';%."\n";
print "var previewAreaIdHash = new Object();\n";
for my $sensorId (keys %previewAreaIdHash){
print "previewAreaIdHash[\"$sensorId\"]=\"".$previewAreaIdHash{$sensorId}."\";\n";
export LD_LIBRARY_PATH=/d/jspc22/dabc/lib/:$LD_LIBRARY_PATH
-./unpacker $1 $2 $3
+time ./unpacker/unpacker $1 $2 $3