Fix big in parameter initialization table when changed.
This commit is contained in:
parent
2a03bb7f61
commit
6428cf3e7b
6
src/external/MuSRFitGUI/MSR.pm
vendored
6
src/external/MuSRFitGUI/MSR.pm
vendored
@ -286,7 +286,6 @@ sub CreateMSR {
|
||||
|
||||
|
||||
if ($T0_Line ne "t0") {
|
||||
print "I am here\n";
|
||||
$Data_Line= $Data_Line."\n".$T0_Line;
|
||||
}
|
||||
|
||||
@ -507,6 +506,8 @@ sub CreateMSRSingleHist {
|
||||
foreach my $RUN (@RUNS) {
|
||||
#######################################################################
|
||||
# For a single histogram fit we basically need to repeat this for each hist
|
||||
# However, "physical" parameters such as Asymmetry, relaxation etc. should
|
||||
# be the same for all histograms
|
||||
foreach my $Hist (@Hists) {
|
||||
|
||||
# Prepare the Parameters and initial values block
|
||||
@ -1103,7 +1104,7 @@ sub PrepParamTable {
|
||||
"Del_min", "0", "Del_max", "0",
|
||||
"Sgm", "0.1", "dSgm", "0.01",
|
||||
"Sgm_min", "0", "Sgm_max", "0",
|
||||
"Aa", "0.1", "dAa", "0.01",
|
||||
"Aa", "60.", "dAa", "0.01",
|
||||
"Aa_min", "0", "Aa_max", "0",
|
||||
"q", "0.1", "dq", "0.01",
|
||||
"q_min", "0", "q_max", "0",
|
||||
@ -1466,7 +1467,6 @@ sub MSR2Dat {
|
||||
foreach (sort { $RUN{$a} <=> $RUN{$b}} keys %RUN ) {
|
||||
@RunParams=();
|
||||
$NP=0;
|
||||
# print $_."=".$MAP{$_}."\n";
|
||||
@tmp=split(/\s+/,$MAP{$_});
|
||||
# Remove first element (map)
|
||||
shift(@tmp);
|
||||
|
45
src/external/MuSRFitGUI/MuSRFit.pl
vendored
45
src/external/MuSRFitGUI/MuSRFit.pl
vendored
@ -1,6 +1,6 @@
|
||||
# Form implementation generated from reading ui file 'MuSRFit.ui'
|
||||
#
|
||||
# Created: Thu Oct 8 17:42:16 2009
|
||||
# Created: Fri Oct 30 14:58:36 2009
|
||||
# by: The PerlQt User Interface Compiler (puic)
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
@ -3283,24 +3283,6 @@ sub CreateAllInput
|
||||
$All{"Paramcomp_ref"}=$Paramcomp_ref;
|
||||
my @Paramcomp = @$Paramcomp_ref;
|
||||
|
||||
# Read initial values of paramets from tabel
|
||||
my $erradd = "d";
|
||||
my $minadd = "_min";
|
||||
my $maxadd = "_max";
|
||||
my $NRows = InitParamTable->numRows();
|
||||
my $Header=InitParamTable->verticalHeader();
|
||||
if ($NRows > 0) {
|
||||
for (my $i=0;$i<$NRows;$i++) {
|
||||
# Take label of row, i.e. name of parameter
|
||||
my $Param=$Header->label($i);
|
||||
# Then take the value, error, max and min (as numbers)
|
||||
$All{"$Param"}=1.0*InitParamTable->text($i,0);
|
||||
$All{"$erradd$Param"}=1.0*InitParamTable->text($i,1);
|
||||
$All{"$Param$minadd"}=1.0*InitParamTable->text($i,2);
|
||||
$All{"$Param$maxadd"}=1.0*InitParamTable->text($i,3);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Shared settings are detected here
|
||||
my $Shared = 0;
|
||||
@ -3361,6 +3343,30 @@ sub CreateAllInput
|
||||
}
|
||||
|
||||
|
||||
# This has to be at the end of CreateAll
|
||||
my %PTable=MSR::PrepParamTable(\%All);
|
||||
|
||||
# Setup the table with the right size
|
||||
my $NParam=scalar keys( %PTable );
|
||||
|
||||
# Read initial values of paramets from tabel
|
||||
my $erradd = "d";
|
||||
my $minadd = "_min";
|
||||
my $maxadd = "_max";
|
||||
my $Header=InitParamTable->verticalHeader();
|
||||
# TODO: Should not go over all rows, only on parameters.
|
||||
if ($NParam > 0) {
|
||||
for (my $i=0;$i<$NParam;$i++) {
|
||||
# Take label of row, i.e. name of parameter
|
||||
my $Param=$Header->label($i);
|
||||
# Then take the value, error, max and min (as numbers)
|
||||
$All{"$Param"}=1.0*InitParamTable->text($i,0);
|
||||
$All{"$erradd$Param"}=1.0*InitParamTable->text($i,1);
|
||||
$All{"$Param$minadd"}=1.0*InitParamTable->text($i,2);
|
||||
$All{"$Param$maxadd"}=1.0*InitParamTable->text($i,3);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Return Hash with all important values
|
||||
return %All;
|
||||
@ -3572,6 +3578,7 @@ sub InitializeTab
|
||||
for (my $i=0;$i<$NRows;$i++) {
|
||||
# TODO: Better remove the row rather than hide it.
|
||||
InitParamTable->hideRow($i);
|
||||
# InitParamTable->removeRow($i);
|
||||
}
|
||||
}
|
||||
|
||||
|
43
src/external/MuSRFitGUI/MuSRFit.ui.h
vendored
43
src/external/MuSRFitGUI/MuSRFit.ui.h
vendored
@ -337,24 +337,6 @@ void MuSRFitform::CreateAllInput()
|
||||
$All{"Paramcomp_ref"}=$Paramcomp_ref;
|
||||
my @Paramcomp = @$Paramcomp_ref;
|
||||
|
||||
# Read initial values of paramets from tabel
|
||||
my $erradd = "d";
|
||||
my $minadd = "_min";
|
||||
my $maxadd = "_max";
|
||||
my $NRows = InitParamTable->numRows();
|
||||
my $Header=InitParamTable->verticalHeader();
|
||||
if ($NRows > 0) {
|
||||
for (my $i=0;$i<$NRows;$i++) {
|
||||
# Take label of row, i.e. name of parameter
|
||||
my $Param=$Header->label($i);
|
||||
# Then take the value, error, max and min (as numbers)
|
||||
$All{"$Param"}=1.0*InitParamTable->text($i,0);
|
||||
$All{"$erradd$Param"}=1.0*InitParamTable->text($i,1);
|
||||
$All{"$Param$minadd"}=1.0*InitParamTable->text($i,2);
|
||||
$All{"$Param$maxadd"}=1.0*InitParamTable->text($i,3);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Shared settings are detected here
|
||||
my $Shared = 0;
|
||||
@ -415,6 +397,30 @@ void MuSRFitform::CreateAllInput()
|
||||
}
|
||||
|
||||
|
||||
# This has to be at the end of CreateAll
|
||||
my %PTable=MSR::PrepParamTable(\%All);
|
||||
|
||||
# Setup the table with the right size
|
||||
my $NParam=scalar keys( %PTable );
|
||||
|
||||
# Read initial values of paramets from tabel
|
||||
my $erradd = "d";
|
||||
my $minadd = "_min";
|
||||
my $maxadd = "_max";
|
||||
my $Header=InitParamTable->verticalHeader();
|
||||
# TODO: Should not go over all rows, only on parameters.
|
||||
if ($NParam > 0) {
|
||||
for (my $i=0;$i<$NParam;$i++) {
|
||||
# Take label of row, i.e. name of parameter
|
||||
my $Param=$Header->label($i);
|
||||
# Then take the value, error, max and min (as numbers)
|
||||
$All{"$Param"}=1.0*InitParamTable->text($i,0);
|
||||
$All{"$erradd$Param"}=1.0*InitParamTable->text($i,1);
|
||||
$All{"$Param$minadd"}=1.0*InitParamTable->text($i,2);
|
||||
$All{"$Param$maxadd"}=1.0*InitParamTable->text($i,3);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Return Hash with all important values
|
||||
return %All;
|
||||
@ -616,6 +622,7 @@ void MuSRFitform::InitializeTab()
|
||||
for (my $i=0;$i<$NRows;$i++) {
|
||||
# TODO: Better remove the row rather than hide it.
|
||||
InitParamTable->hideRow($i);
|
||||
# InitParamTable->removeRow($i);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user