}
+
+div.padded {
+ padding:10px;
+
+}
+
+div.settings_form{
+ padding:10px;
+ padding-right:250px;
+}
div.header {
font-size:13pt;
timer = $.timer(function() {
});
+ unfolds($("#show_main_controls"),$("#main_controls_container"));
unfolds($("#show_pmt_ro_settings"),$("#pmt_ro_settings_container"));
+ unfolds($("#show_table_control_settings"),$("#table_control_settings_container"));
});
use CGI ':standard';
-use settings_subs;
-# our @ISA = qw/has_settings/; # assimilate the methods of the has_settings class
+# use settings_subs;
+use has_settings;
+our @ISA = qw/has_settings/; # assimilate the methods of the has_settings class
use pmt_ro;
bless($self, $class);
$self->{pmt_ro} = pmt_ro->new();
- $self->{pmt_control} = table_control->new();
+ $self->{table_control} = table_control->new();
return $self;
}
]
);
-
+
print h2 "Coral Scanner";
print "<div id='main_body'>";
+ print "<p id='show_main_controls' class='quasibutton' >main controls</p>";
+ print "<div id='main_controls_container' class='stylishBox padded'>";
+ print "<svg width=480 height=260>";
+ $self->{table_control}->scan_pattern_to_svg();
+ print "</svg>";
+ print br;
+ print "some content!";
+ print "</div>";
+
+
print "<p id='show_pmt_ro_settings' class='quasibutton' >pmt_ro settings</p>";
- print "<div id='pmt_ro_settings_container' class='stylishBox hidden_by_default'>";
+ print "<div align=right id='pmt_ro_settings_container' class='stylishBox settings_form hidden_by_default'>";
$self->{pmt_ro}->settings_form();
print "</div>";
+ print "<p id='show_table_control_settings' class='quasibutton' >table_control settings</p>";
+ print "<div align=right id='table_control_settings_container' class='stylishBox settings_form hidden_by_default'>";
+ $self->{table_control}->settings_form();
+ print "</div>";
print "</div>";
-package settings_subs;
+package has_settings;
use Storable qw(lock_store lock_retrieve);
use misc_subs;
-BEGIN {
- require Exporter;
- # set the version for version checking
- our $VERSION = 1.00;
- # Inherit from Exporter to export functions and variables
- our @ISA = qw(Exporter);
- # Functions and variables which are exported by default
- our @EXPORT = qw(load_settings save_settings reset_settings settings_form);
- # Functions and variables which can be optionally exported
- #our @EXPORT_OK = qw($Var1 %Hashit func3);
-}
sub load_settings {
sub settings_form {
my $self=shift;
+ my %options=@_;
my $settings = $self->load_settings();
my $settings_desc = $self->{settings_desc};
+
+ my $header=$options{header};
- printHeader('text/html');
+ printHeader('text/html') if $header;
print '
<style>
.hidden {
- visibility:collapse
+ display:none;
}
span.dropt {border-bottom: thin dotted; background: #ffeedd;}
</style>
-<form action="'.ref($self).'.pl" method="get" target="_self">
+<form action="'.ref($self).'.pl" method="get" target="_blank">
<input type="text" name="sub" value="save_settings" class="hidden"><br>
<table>
';
use FileHandle;
use regio;
-use settings_subs;
use misc_subs;
+use has_settings;
+our @ISA = qw/has_settings/; # assimilate the methods of the has_settings class
## methods
# use has_settings;
# our @ISA = qw/has_settings/; # assimilate the methods of the has_settings class
-use settings_subs;
use misc_subs;
-
+use has_settings;
+our @ISA = qw/has_settings/; # assimilate the methods of the has_settings class
## methods
sample_step_size => 1,
sample_aperture_dia => 1,
- scan_pattern_svg_file => "./scan_pattern.svg",
scan_pattern_style => "meander"
sample_step_size => "The step size/width for the scan pattern in mm",
sample_aperture_dia => "Estimate of the radiation aperture in mm",
- scan_pattern_svg_file => "Filename for the visualization (svg image) of the scan pattern",
scan_pattern_style => "Defines the scan modus, available options are 'linebyline' and 'meander'"
};
$self->require_run("load_settings");
+ my $svg_file = $options{svg_file};
+
my $scan_pattern = $self->scan_pattern(style => $style);
my $mm2pix = 1; # pixels per mm
# create an SVG object with a size of 40x40 pixels
+
+ my $pic_width = 480;
+ my $pic_height = 260;
+
my $svg = SVG->new(
-printerror => 1,
-raiseerror => 0,
#-namespace => 'mysvg',
-inline => 1,
id => 'document_element',
- width => 800,
- height => 600,
+ width => $pic_width,
+ height => $pic_height,
);
- my $scale = 24;
+ my $scale = 12;
my $scaler = $svg->group(
transform => "scale($scale)"
height => ($sample_rect_y2 - $sample_rect_y1)+$aperture_dia,
style=>{
'stroke'=>'black',
- 'fill'=>'none',
+ 'fill'=>'white',
'stroke-width'=>5/$scale,
}
);
my $lastpoint;
my $counter=0;
for my $point (@$scan_pattern) {
- last if ($counter++ > 600);
+
+ last if (($point->{x} - $sample_rect_x1)*$scale > $pic_width);
if(1){
}
-
- my $svgfile = $self->{settings}->{scan_pattern_svg_file};
+ if (defined($svg_file)){
+ open(SVGFILE, ">".$svg_file) or die "could not open $svg_file for writing!\n";
+ # now render the SVG object, implicitly use svg namespace
+ print SVGFILE $svg->xmlify;
+ close(SVGFILE);
+ } else {
+ print $svg->xmlify;
+ }
- open(SVGFILE, ">".$svgfile);
- # now render the SVG object, implicitly use svg namespace
- print SVGFILE $svg->xmlify;
- close(SVGFILE);
+ return " ";
}