The chemical formula from the GUI (qt3) will be added to the _Seq_Results.dat file header and used by the root macro when plotting the fractions.

This commit is contained in:
salman 2015-09-03 12:32:46 +02:00
parent cf1611c6e5
commit a97c72f59d
2 changed files with 38 additions and 11 deletions

View File

@ -2475,6 +2475,17 @@ sub StartSequenceOne
}
# Create a subdirectory where all input/output files are saved
if (-d $All{"Path"}) {
# Directory exists, do nothing
} else {
$cmd="mkdir ".$All{"Path"};
system($cmd);
}
# Change work directory accordingly
chdir ($All{"Path"});
# Cleanup from old files
if (-e "ausgabe1.inp") {
system("rm -f ausgabe*");
@ -2594,8 +2605,25 @@ sub StartSequenceOne
# $cmd="mv -f $FILENAME.* ".$All{"Path"};
# system($cmd);
}
# An easy way to keep track of chemical formula is to replace impL_i by the corresponding chemical formula of layer i
open (INF,q{<}, "fort.33" );
my @lines = <INF>;
close(INF);
my $all_lines = join("",@lines);
for (my $i=1;$i<=$All{"NL"};$i++){
my $LComp = "L".$i."Comp";
my $chem_formula = $All{"$LComp"};
my $place_holder = "impL".$i;
$all_lines =~ s/$place_holder/$chem_formula/g;
}
my $seq_file = $All{"FNPre"}."_Seq_Results.dat";
open (SEQF,q{>}, "$seq_file" );
print SEQF $all_lines;
close(SEQF);
# Move the fort.33 file into the subdirectory and change its name
$cmd="rm -f eingabe1.inp; mv -f fort.33 ".$All{"Path"}."/".$All{"FNPre"}."_Seq_Results.dat";
$cmd="rm -f eingabe1.inp; rm -f fort.33";
system($cmd);
$Progress=100;
Progress->setProgress($Progress);
@ -2661,7 +2689,7 @@ sub PlotProfiles
# "Warning:\nClose the plot using the menu FILE -> Quit ROOT\nDO NOT CLOSE USING X.");
my $TrimPath = $ENV{'PERLLIB'};
# Now that we have the file list send it to root macro for plotting.
my $cmd='root -n -l "'.$TrimPath.'/plotRge.C(\"'.$filenames.'\")"&';
my $cmd='root -n -l "'.$TrimPath.'/../plotRge.C(\"'.$filenames.'\")"&';
# my $pid = open(FTO,"$cmd");
# my $pid = open(FTO,"$cmd 2>&1 |");
@ -2688,10 +2716,12 @@ sub PlotFraction
if ($file ne "" ) {
my $TrimPath = $ENV{'PERLLIB'};
# Now that we have the file name send it to root macro for plotting.
my $cmd='root -n -l "'.$TrimPath.'/plotFrc.C(\"'.$file.'\")"&';
my $cmd='root -n -l "'.$TrimPath.'/../plotFrc.C(\"'.$file.'\")"&';
my $pid=system($cmd);
}
my $pid=system($cmd);
}
}
@ -2702,8 +2732,6 @@ sub OpenAboutWindow
my $HelpText="TrimSPGUI is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
TrimSPGUI is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@ -2943,7 +2971,6 @@ sub GUIPath
return $FileBrowser ;
}
sub TrimBin

View File

@ -684,7 +684,7 @@ void TrimSPGUI::PlotProfiles()
# "Warning:\nClose the plot using the menu FILE -> Quit ROOT\nDO NOT CLOSE USING X.");
my $TrimPath = $ENV{'PERLLIB'};
# Now that we have the file list send it to root macro for plotting.
my $cmd='root -n -l "'.$TrimPath.'/plotRge.C(\"'.$filenames.'\")"&';
my $cmd='root -n -l "'.$TrimPath.'/../plotRge.C(\"'.$filenames.'\")"&';
# my $pid = open(FTO,"$cmd");
# my $pid = open(FTO,"$cmd 2>&1 |");
@ -710,7 +710,7 @@ void TrimSPGUI::PlotFraction()
if ($file ne "" ) {
my $TrimPath = $ENV{'PERLLIB'};
# Now that we have the file name send it to root macro for plotting.
my $cmd='root -n -l "'.$TrimPath.'/plotFrc.C(\"'.$file.'\")"&';
my $cmd='root -n -l "'.$TrimPath.'/../plotFrc.C(\"'.$file.'\")"&';
my $pid=system($cmd);
}