Fixed bug to change working directory when changing the path by typing or loading configuration file (issue MUSR-316).

This commit is contained in:
2015-08-27 16:06:10 +02:00
parent 1dff2798a1
commit 3e79a7e5f4
2 changed files with 22 additions and 2 deletions

View File

@ -472,6 +472,17 @@ void TrimSPGUI::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 # Cleanup from old files
if (-e "ausgabe1.inp") { if (-e "ausgabe1.inp") {
system("rm -f ausgabe*"); system("rm -f ausgabe*");

View File

@ -493,7 +493,7 @@ sub StartSequenceOne
my $cmd=""; my $cmd="";
my @called = caller; my @called = caller;
print "pck=".$called[0]." fln=".$called[1]." line=".$called[2]; # print "pck=".$called[0]." fln=".$called[1]." line=".$called[2];
if (!$ENV{'TRIMBIN'}) { if (!$ENV{'TRIMBIN'}) {
# If trim.sp binary is not defined give warning and return # If trim.sp binary is not defined give warning and return
my $Warning = Qt::MessageBox::information( this, "Warning!", my $Warning = Qt::MessageBox::information( this, "Warning!",
@ -502,6 +502,15 @@ sub StartSequenceOne
} }
# Create a subdirectory where all input/output files are saved
if (-d $All{"workPath"}) {
# Directory exists, do nothing
} else {
$cmd="mkdir ".$All{"workPath"};
system($cmd);
}
# Change work directory accordingly
chdir ($All{"workPath"});
# Cleanup from old files # Cleanup from old files
if (-e "ausgabe1.inp") { if (-e "ausgabe1.inp") {
@ -612,7 +621,7 @@ sub StartSequenceOne
} }
# Move the fort.33 file into the subdirectory and change its name # Move the fort.33 file into the subdirectory and change its name
$cmd="rm -f eingabe1.inp; mv -f fort.33 ".$All{"workPath"}."/".$All{"fileNamePrefix"}."_Seq_Results.dat"; $cmd="rm -f eingabe1.inp; mv -f fort.33 ".$All{"fileNamePrefix"}."_Seq_Results.dat";
system($cmd); system($cmd);
$Progress=100; $Progress=100;
this->{ui}->progress->setValue($Progress); this->{ui}->progress->setValue($Progress);