Finished implementing FUNCTIONS block in development branch. Next, add it to production branch and debug.
This commit is contained in:
parent
5d4683ff1f
commit
93f48a677d
48
src/external/MuSRFitGUI/devel/MSR.pm
vendored
48
src/external/MuSRFitGUI/devel/MSR.pm
vendored
@ -124,6 +124,21 @@ sub CreateMSR {
|
|||||||
my ($Full_T_Block,$Paramcomp_ref)=MSR::CreateTheory(@FitTypes);
|
my ($Full_T_Block,$Paramcomp_ref)=MSR::CreateTheory(@FitTypes);
|
||||||
my @Paramcomp = @$Paramcomp_ref;
|
my @Paramcomp = @$Paramcomp_ref;
|
||||||
|
|
||||||
|
|
||||||
|
# If we have a FUNCTIONS Block the Full_T_Block should be
|
||||||
|
# replaced by Func_T_Block
|
||||||
|
$FUNCTIONS_Block = $EMPTY;
|
||||||
|
if ($All{"FunctionsBlock"} ne $EMPTY) {
|
||||||
|
$FUNCTIONS_Block = "
|
||||||
|
###############################################################
|
||||||
|
FUNCTIONS
|
||||||
|
###############################################################
|
||||||
|
".$All{"FunctionsBlock"}."\n";
|
||||||
|
$Full_T_Block=$All{"Func_T_Block"};
|
||||||
|
# remove all _N to end (may fail with large number of parameters)
|
||||||
|
$Full_T_Block =~ s/_\d\b//g;
|
||||||
|
}
|
||||||
|
|
||||||
# Counter for RUNS
|
# Counter for RUNS
|
||||||
my $iRun = 1;
|
my $iRun = 1;
|
||||||
|
|
||||||
@ -344,7 +359,6 @@ FITPARAMETER
|
|||||||
$PCount $Param $value $error $error $minvalue $maxvalue";
|
$PCount $Param $value $error $error $minvalue $maxvalue";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$Full_T_Block = "
|
$Full_T_Block = "
|
||||||
###############################################################
|
###############################################################
|
||||||
THEORY
|
THEORY
|
||||||
@ -352,14 +366,6 @@ THEORY
|
|||||||
$Full_T_Block
|
$Full_T_Block
|
||||||
";
|
";
|
||||||
|
|
||||||
$FUNCTIONS_Block = $EMPTY;
|
|
||||||
if ($All{"FunctionsBlock"} ne $EMPTY) {
|
|
||||||
$FUNCTIONS_Block = "
|
|
||||||
###############################################################
|
|
||||||
FUNCTIONS
|
|
||||||
###############################################################".
|
|
||||||
$All{"FunctionsBlock"}."\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$RUN_Block =
|
$RUN_Block =
|
||||||
"###############################################################
|
"###############################################################
|
||||||
@ -481,6 +487,20 @@ sub CreateMSRSingleHist {
|
|||||||
my ($Full_T_Block,$Paramcomp_ref)=MSR::CreateTheory(@FitTypes);
|
my ($Full_T_Block,$Paramcomp_ref)=MSR::CreateTheory(@FitTypes);
|
||||||
my @Paramcomp = @$Paramcomp_ref;
|
my @Paramcomp = @$Paramcomp_ref;
|
||||||
|
|
||||||
|
# If we have a FUNCTIONS Block the Full_T_Block should be
|
||||||
|
# replaced by Func_T_Block
|
||||||
|
$FUNCTIONS_Block = $EMPTY;
|
||||||
|
if ($All{"FunctionsBlock"} ne $EMPTY) {
|
||||||
|
$FUNCTIONS_Block = "
|
||||||
|
###############################################################
|
||||||
|
FUNCTIONS
|
||||||
|
###############################################################
|
||||||
|
".$All{"FunctionsBlock"}."\n";
|
||||||
|
$Full_T_Block=$All{"Func_T_Block"};
|
||||||
|
# remove all _N to end
|
||||||
|
$Full_T_Block =~ s/_\d\b//g;
|
||||||
|
}
|
||||||
|
|
||||||
# Counter for RUNS
|
# Counter for RUNS
|
||||||
my $iRun = 1;
|
my $iRun = 1;
|
||||||
|
|
||||||
@ -725,16 +745,6 @@ THEORY
|
|||||||
$Full_T_Block
|
$Full_T_Block
|
||||||
";
|
";
|
||||||
|
|
||||||
$FUNCTIONS_Block = $EMPTY;
|
|
||||||
if ($All{"FunctionsBlock"} ne $EMPTY) {
|
|
||||||
$FUNCTIONS_Block = "
|
|
||||||
###############################################################
|
|
||||||
FUNCTIONS
|
|
||||||
###############################################################".
|
|
||||||
$All{"FunctionsBlock"}."\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$RUN_Block =
|
$RUN_Block =
|
||||||
"###############################################################
|
"###############################################################
|
||||||
$RUN_Block";
|
$RUN_Block";
|
||||||
|
76
src/external/MuSRFitGUI/devel/MuSRFit.pl
vendored
76
src/external/MuSRFitGUI/devel/MuSRFit.pl
vendored
@ -1,6 +1,6 @@
|
|||||||
# Form implementation generated from reading ui file 'MuSRFit.ui'
|
# Form implementation generated from reading ui file 'MuSRFit.ui'
|
||||||
#
|
#
|
||||||
# Created: Mon Jun 7 18:29:05 2010
|
# Created: Tue Jun 8 13:35:32 2010
|
||||||
# by: The PerlQt User Interface Compiler (puic)
|
# by: The PerlQt User Interface Compiler (puic)
|
||||||
#
|
#
|
||||||
# WARNING! All changes made in this file will be lost!
|
# WARNING! All changes made in this file will be lost!
|
||||||
@ -43,7 +43,7 @@ use Qt::slots
|
|||||||
RunSelectionToggle => [],
|
RunSelectionToggle => [],
|
||||||
fileBrowse => [],
|
fileBrowse => [],
|
||||||
AppendToFunctions => [],
|
AppendToFunctions => [],
|
||||||
ResetFunctions => [];
|
InitializeFunctions => [];
|
||||||
use Qt::attributes qw(
|
use Qt::attributes qw(
|
||||||
musrfit_tabs
|
musrfit_tabs
|
||||||
RUNSPage
|
RUNSPage
|
||||||
@ -1583,7 +1583,7 @@ sub NEW
|
|||||||
setName("MuSRFitform" );
|
setName("MuSRFitform" );
|
||||||
}
|
}
|
||||||
setSizePolicy(Qt::SizePolicy(3, 3, 1, 1, this->sizePolicy()->hasHeightForWidth()) );
|
setSizePolicy(Qt::SizePolicy(3, 3, 1, 1, this->sizePolicy()->hasHeightForWidth()) );
|
||||||
setMinimumSize(Qt::Size(21, 264) );
|
setMinimumSize(Qt::Size(21, 275) );
|
||||||
setIcon($image0 );
|
setIcon($image0 );
|
||||||
|
|
||||||
setCentralWidget(Qt::Widget(this, "qt_central_widget"));
|
setCentralWidget(Qt::Widget(this, "qt_central_widget"));
|
||||||
@ -1594,7 +1594,6 @@ sub NEW
|
|||||||
musrfit_tabs->setSizePolicy( Qt::SizePolicy(7, 7, 1, 1, musrfit_tabs->sizePolicy()->hasHeightForWidth()) );
|
musrfit_tabs->setSizePolicy( Qt::SizePolicy(7, 7, 1, 1, musrfit_tabs->sizePolicy()->hasHeightForWidth()) );
|
||||||
musrfit_tabs->setMinimumSize( Qt::Size(560, 400) );
|
musrfit_tabs->setMinimumSize( Qt::Size(560, 400) );
|
||||||
musrfit_tabs->setMaximumSize( Qt::Size(95, 32767) );
|
musrfit_tabs->setMaximumSize( Qt::Size(95, 32767) );
|
||||||
musrfit_tabs->setMouseTracking( 0 );
|
|
||||||
|
|
||||||
RUNSPage = Qt::Widget(musrfit_tabs, "RUNSPage");
|
RUNSPage = Qt::Widget(musrfit_tabs, "RUNSPage");
|
||||||
|
|
||||||
@ -2840,7 +2839,10 @@ sub NEW
|
|||||||
Qt::Object::connect(T0, SIGNAL "activated()", this, SLOT "ShowMuSRT0()");
|
Qt::Object::connect(T0, SIGNAL "activated()", this, SLOT "ShowMuSRT0()");
|
||||||
Qt::Object::connect(Plot, SIGNAL "activated()", this, SLOT "GoPlot()");
|
Qt::Object::connect(Plot, SIGNAL "activated()", this, SLOT "GoPlot()");
|
||||||
Qt::Object::connect(AddConstraint, SIGNAL "clicked()", this, SLOT "AppendToFunctions()");
|
Qt::Object::connect(AddConstraint, SIGNAL "clicked()", this, SLOT "AppendToFunctions()");
|
||||||
Qt::Object::connect(ResetFunc, SIGNAL "clicked()", this, SLOT "ActivateShComp()");
|
Qt::Object::connect(ResetFunc, SIGNAL "clicked()", this, SLOT "InitializeFunctions()");
|
||||||
|
Qt::Object::connect(FitType1, SIGNAL "activated(const QString&)", this, SLOT "InitializeFunctions()");
|
||||||
|
Qt::Object::connect(FitType2, SIGNAL "activated(int)", this, SLOT "InitializeFunctions()");
|
||||||
|
Qt::Object::connect(FitType3, SIGNAL "activated(int)", this, SLOT "InitializeFunctions()");
|
||||||
|
|
||||||
setTabOrder(musrfit_tabs, RunNumbers);
|
setTabOrder(musrfit_tabs, RunNumbers);
|
||||||
setTabOrder(RunNumbers, BeamLine);
|
setTabOrder(RunNumbers, BeamLine);
|
||||||
@ -3532,7 +3534,9 @@ sub CreateAllInput
|
|||||||
|
|
||||||
# Functions block
|
# Functions block
|
||||||
$All{"FunctionsBlock"}=FunctionsBlock->text;
|
$All{"FunctionsBlock"}=FunctionsBlock->text;
|
||||||
|
# and the associated theory block
|
||||||
|
$All{"Func_T_Block"}=TheoryBlock->text;
|
||||||
|
|
||||||
# Read initial values of paramets from tabel
|
# Read initial values of paramets from tabel
|
||||||
my $erradd = "d";
|
my $erradd = "d";
|
||||||
my $minadd = "_min";
|
my $minadd = "_min";
|
||||||
@ -3610,8 +3614,6 @@ sub CreateAllInput
|
|||||||
$All{"FILENAME"}="TMP";
|
$All{"FILENAME"}="TMP";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Return Hash with all important values
|
# Return Hash with all important values
|
||||||
return %All;
|
return %All;
|
||||||
|
|
||||||
@ -3801,7 +3803,7 @@ sub ActivateShComp
|
|||||||
my $ParamChkBx="ShParam_".$Component."_".$i;
|
my $ParamChkBx="ShParam_".$Component."_".$i;
|
||||||
my $ChkBx = child($ParamChkBx);
|
my $ChkBx = child($ParamChkBx);
|
||||||
# my $CParam = $Params[$i-1]."_".$Component;
|
# my $CParam = $Params[$i-1]."_".$Component;
|
||||||
if ($Params[$i-1] ne "" && $Params[$i-1] ne "Alpha" && $Params[$i-1] ne "N0" && $Params[$i-1] ne "NBg") {
|
if ($Params[$i-1] ne "" ) {
|
||||||
$ChkBx->setHidden(0);
|
$ChkBx->setHidden(0);
|
||||||
$ChkBx->setEnabled(1);
|
$ChkBx->setEnabled(1);
|
||||||
$ChkBx ->setText($Params[$i-1]);
|
$ChkBx ->setText($Params[$i-1]);
|
||||||
@ -3867,6 +3869,11 @@ sub TabChanged
|
|||||||
UpdateMSRFileInitTable();
|
UpdateMSRFileInitTable();
|
||||||
# And also setup T0 and Bg bins
|
# And also setup T0 and Bg bins
|
||||||
ActivateT0Hists();
|
ActivateT0Hists();
|
||||||
|
|
||||||
|
# Initialize FUNCTIONS block only if it has not been initialized yet
|
||||||
|
if ($All{"Func_T_Block"} eq "" ) {
|
||||||
|
InitializeFunctions();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4039,7 +4046,7 @@ sub AppendToFunctions
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub ResetFunctions
|
sub InitializeFunctions
|
||||||
{
|
{
|
||||||
|
|
||||||
my %All=CreateAllInput();
|
my %All=CreateAllInput();
|
||||||
@ -4054,38 +4061,51 @@ sub ResetFunctions
|
|||||||
|
|
||||||
# Get number of parameters to determine the size of the table
|
# Get number of parameters to determine the size of the table
|
||||||
my ($Full_T_Block,$Paramcomp_ref)= MSR::CreateTheory(@FitTypes);
|
my ($Full_T_Block,$Paramcomp_ref)= MSR::CreateTheory(@FitTypes);
|
||||||
# For now the line below does not work. Why?
|
|
||||||
# my $Paramcomp_ref=$All{"Paramcomp_ref"};
|
|
||||||
my @Paramcomp = @$Paramcomp_ref;
|
my @Paramcomp = @$Paramcomp_ref;
|
||||||
my $Full_T_Block= $All{"Full_T_Block"};
|
my $Full_T_Block= $All{"Full_T_Block"};
|
||||||
my $Param="";
|
|
||||||
|
|
||||||
# Initialize Parameters List in function block (constraints).
|
# Initialize Parameters List in function block (constraints).
|
||||||
my $ParametersList="";
|
my $ParametersList="";
|
||||||
ParametersList->setText("");
|
ParametersList->setText("");
|
||||||
|
|
||||||
# Counter for function block (with out Alpha etc.)
|
# Counter for function block (with out Alpha etc.)
|
||||||
my $ParCount=0;
|
my $ParCount=0;
|
||||||
CParamsCombo->clear();
|
CParamsCombo->clear();
|
||||||
|
|
||||||
# my $CParam = $Params[$i-1]."_".$Component;
|
my $Component=1;
|
||||||
# CParamsCombo->insertItem($CParam,-1);
|
foreach my $FitType (@FitTypes) {
|
||||||
# $Full_T_Block=~ s/\b$Params[$i-1]\b/$CParam/;
|
my $Parameters=$Paramcomp[$Component-1];
|
||||||
|
my @Params = split( /\s+/, $Parameters );
|
||||||
|
|
||||||
# Also update Parameters List for the Functions block
|
# Alpha, N0 and NBg are counted in the parameters
|
||||||
(my $Ptmp,my $tmp)=split(/_/,$Param);
|
if ( $Component == 1 && $All{"FitAsyType"} eq "Asymmetry" ) {
|
||||||
if ($Ptmp ne "" && $Ptmp ne "Alpha" && $Ptmp ne "N0" && $Ptmp ne "NBg") {
|
unshift( @Params, "Alpha" );
|
||||||
$ParCount++;
|
}
|
||||||
$ParametersList=$ParametersList."$Param is par$ParCount\n";
|
elsif ( $Component == 1 && $All{"FitAsyType"} eq "SingleHist" ) {
|
||||||
ParametersList->setText($ParametersList);
|
unshift( @Params, ( "N0", "NBg" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Add list to the constraints drop down menu
|
||||||
|
for (my $i=1; $i<=9;$i++) {
|
||||||
|
my $CParam = $Params[$i-1]."_".$Component;
|
||||||
|
if ($Params[$i-1] ne "" ) {
|
||||||
|
if ($Params[$i-1] ne "Alpha" && $Params[$i-1] ne "N0" && $Params[$i-1] ne "NBg") {
|
||||||
|
CParamsCombo->insertItem($CParam,-1);
|
||||||
|
$Full_T_Block=~ s/\b$Params[$i-1]\b/$CParam/;
|
||||||
|
}
|
||||||
|
# also enumerate the parameters as should be used in the FUNCTIONS Block
|
||||||
|
$ParCount++;
|
||||||
|
$ParametersList=$ParametersList."$CParam \t is \t par$ParCount\n";
|
||||||
|
ParametersList->setText($ParametersList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$Component++;
|
||||||
|
}
|
||||||
# Set theory block in Constraints
|
# Set theory block in Constraints
|
||||||
TheoryBlock->setText($Full_T_Block);
|
TheoryBlock->setText($Full_T_Block);
|
||||||
# Then clear the text
|
# Then clear the text
|
||||||
ConstraintLine->setText("");
|
ConstraintLine->setText("");
|
||||||
FunctionsBlock->setText("");
|
FunctionsBlock->setText("");
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
27
src/external/MuSRFitGUI/devel/MuSRFit.ui
vendored
27
src/external/MuSRFitGUI/devel/MuSRFit.ui
vendored
@ -22,8 +22,8 @@
|
|||||||
</property>
|
</property>
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>23</width>
|
<width>21</width>
|
||||||
<height>270</height>
|
<height>275</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="caption">
|
<property name="caption">
|
||||||
@ -5346,7 +5346,25 @@
|
|||||||
<sender>ResetFunc</sender>
|
<sender>ResetFunc</sender>
|
||||||
<signal>clicked()</signal>
|
<signal>clicked()</signal>
|
||||||
<receiver>MuSRFitform</receiver>
|
<receiver>MuSRFitform</receiver>
|
||||||
<slot>ActivateShComp()</slot>
|
<slot>InitializeFunctions()</slot>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>FitType1</sender>
|
||||||
|
<signal>activated(const QString&)</signal>
|
||||||
|
<receiver>MuSRFitform</receiver>
|
||||||
|
<slot>InitializeFunctions()</slot>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>FitType2</sender>
|
||||||
|
<signal>activated(int)</signal>
|
||||||
|
<receiver>MuSRFitform</receiver>
|
||||||
|
<slot>InitializeFunctions()</slot>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>FitType3</sender>
|
||||||
|
<signal>activated(int)</signal>
|
||||||
|
<receiver>MuSRFitform</receiver>
|
||||||
|
<slot>InitializeFunctions()</slot>
|
||||||
</connection>
|
</connection>
|
||||||
</connections>
|
</connections>
|
||||||
<tabstops>
|
<tabstops>
|
||||||
@ -5455,8 +5473,7 @@
|
|||||||
<slot>RunSelectionToggle()</slot>
|
<slot>RunSelectionToggle()</slot>
|
||||||
<slot>fileBrowse()</slot>
|
<slot>fileBrowse()</slot>
|
||||||
<slot>AppendToFunctions()</slot>
|
<slot>AppendToFunctions()</slot>
|
||||||
<slot>ResetFunctions()</slot>
|
<slot>InitializeFunctions()</slot>
|
||||||
<slot>InitializeFunction()</slot>
|
|
||||||
</slots>
|
</slots>
|
||||||
<layoutdefaults spacing="6" margin="11"/>
|
<layoutdefaults spacing="6" margin="11"/>
|
||||||
</UI>
|
</UI>
|
||||||
|
72
src/external/MuSRFitGUI/devel/MuSRFit.ui.h
vendored
72
src/external/MuSRFitGUI/devel/MuSRFit.ui.h
vendored
@ -341,9 +341,6 @@ void MuSRFitform::CreateAllInput()
|
|||||||
$All{"FunctionsBlock"}=FunctionsBlock->text;
|
$All{"FunctionsBlock"}=FunctionsBlock->text;
|
||||||
# and the associated theory block
|
# and the associated theory block
|
||||||
$All{"Func_T_Block"}=TheoryBlock->text;
|
$All{"Func_T_Block"}=TheoryBlock->text;
|
||||||
if ($All{"Func_T_Block"} eq "") {
|
|
||||||
InitializeFunction();
|
|
||||||
}
|
|
||||||
|
|
||||||
# Read initial values of paramets from tabel
|
# Read initial values of paramets from tabel
|
||||||
my $erradd = "d";
|
my $erradd = "d";
|
||||||
@ -665,6 +662,11 @@ void MuSRFitform::TabChanged()
|
|||||||
UpdateMSRFileInitTable();
|
UpdateMSRFileInitTable();
|
||||||
# And also setup T0 and Bg bins
|
# And also setup T0 and Bg bins
|
||||||
ActivateT0Hists();
|
ActivateT0Hists();
|
||||||
|
|
||||||
|
# Initialize FUNCTIONS block only if it has not been initialized yet
|
||||||
|
if ($All{"Func_T_Block"} eq "" ) {
|
||||||
|
InitializeFunctions();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -827,7 +829,7 @@ void MuSRFitform::AppendToFunctions()
|
|||||||
TheoryBlock->setText($Full_T_Block);
|
TheoryBlock->setText($Full_T_Block);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MuSRFitform::ResetFunctions()
|
void MuSRFitform::InitializeFunctions()
|
||||||
{
|
{
|
||||||
my %All=CreateAllInput();
|
my %All=CreateAllInput();
|
||||||
my @RUNS = split( /,/, $All{"RunNumbers"} );
|
my @RUNS = split( /,/, $All{"RunNumbers"} );
|
||||||
@ -841,67 +843,41 @@ void MuSRFitform::ResetFunctions()
|
|||||||
|
|
||||||
# Get number of parameters to determine the size of the table
|
# Get number of parameters to determine the size of the table
|
||||||
my ($Full_T_Block,$Paramcomp_ref)= MSR::CreateTheory(@FitTypes);
|
my ($Full_T_Block,$Paramcomp_ref)= MSR::CreateTheory(@FitTypes);
|
||||||
# For now the line below does not work. Why?
|
|
||||||
# my $Paramcomp_ref=$All{"Paramcomp_ref"};
|
|
||||||
my @Paramcomp = @$Paramcomp_ref;
|
my @Paramcomp = @$Paramcomp_ref;
|
||||||
my $Full_T_Block= $All{"Full_T_Block"};
|
my $Full_T_Block= $All{"Full_T_Block"};
|
||||||
my $Param="";
|
|
||||||
|
|
||||||
# Initialize Parameters List in function block (constraints).
|
# Initialize Parameters List in function block (constraints).
|
||||||
my $ParametersList="";
|
my $ParametersList="";
|
||||||
ParametersList->setText("");
|
ParametersList->setText("");
|
||||||
|
|
||||||
# Counter for function block (with out Alpha etc.)
|
# Counter for function block (with out Alpha etc.)
|
||||||
my $ParCount=0;
|
my $ParCount=0;
|
||||||
CParamsCombo->clear();
|
CParamsCombo->clear();
|
||||||
|
|
||||||
# my $CParam = $Params[$i-1]."_".$Component;
|
|
||||||
# CParamsCombo->insertItem($CParam,-1);
|
|
||||||
# $Full_T_Block=~ s/\b$Params[$i-1]\b/$CParam/;
|
|
||||||
|
|
||||||
# Also update Parameters List for the Functions block
|
|
||||||
(my $Ptmp,my $tmp)=split(/_/,$Param);
|
|
||||||
if ($Ptmp ne "" && $Ptmp ne "Alpha" && $Ptmp ne "N0" && $Ptmp ne "NBg") {
|
|
||||||
$ParCount++;
|
|
||||||
$ParametersList=$ParametersList."$Param is par$ParCount\n";
|
|
||||||
ParametersList->setText($ParametersList);
|
|
||||||
}
|
|
||||||
# Set theory block in Constraints
|
|
||||||
TheoryBlock->setText($Full_T_Block);
|
|
||||||
# Then clear the text
|
|
||||||
ConstraintLine->setText("");
|
|
||||||
FunctionsBlock->setText("");
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void MuSRFitform::InitializeFunction()
|
|
||||||
{
|
|
||||||
my %All=CreateAllInput();
|
|
||||||
my @RUNS = split( /,/, $All{"RunNumbers"} );
|
|
||||||
|
|
||||||
my @FitTypes =();
|
|
||||||
foreach my $FitType ($All{"FitType1"}, $All{"FitType2"}, $All{"FitType3"}) {
|
|
||||||
if ( $FitType ne "None" ) {
|
|
||||||
push( @FitTypes, $FitType );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Get number of parameters to determine the size of the table
|
|
||||||
my ($Full_T_Block,$Paramcomp_ref)= MSR::CreateTheory(@FitTypes);
|
|
||||||
my @Paramcomp = @$Paramcomp_ref;
|
|
||||||
my $Full_T_Block= $All{"Full_T_Block"};
|
|
||||||
|
|
||||||
my $Component=1;
|
my $Component=1;
|
||||||
foreach my $FitType (@FitTypes) {
|
foreach my $FitType (@FitTypes) {
|
||||||
my $Parameters=$Paramcomp[$Component-1];
|
my $Parameters=$Paramcomp[$Component-1];
|
||||||
my @Params = split( /\s+/, $Parameters );
|
my @Params = split( /\s+/, $Parameters );
|
||||||
|
|
||||||
|
# Alpha, N0 and NBg are counted in the parameters
|
||||||
|
if ( $Component == 1 && $All{"FitAsyType"} eq "Asymmetry" ) {
|
||||||
|
unshift( @Params, "Alpha" );
|
||||||
|
}
|
||||||
|
elsif ( $Component == 1 && $All{"FitAsyType"} eq "SingleHist" ) {
|
||||||
|
unshift( @Params, ( "N0", "NBg" ) );
|
||||||
|
}
|
||||||
|
|
||||||
# Add list to the constraints drop down menu
|
# Add list to the constraints drop down menu
|
||||||
for (my $i=1; $i<=9;$i++) {
|
for (my $i=1; $i<=9;$i++) {
|
||||||
my $CParam = $Params[$i-1]."_".$Component;
|
my $CParam = $Params[$i-1]."_".$Component;
|
||||||
if ($Params[$i-1] ne "" ) {
|
if ($Params[$i-1] ne "" ) {
|
||||||
CParamsCombo->insertItem($CParam,-1);
|
if ($Params[$i-1] ne "Alpha" && $Params[$i-1] ne "N0" && $Params[$i-1] ne "NBg") {
|
||||||
$Full_T_Block=~ s/\b$Params[$i-1]\b/$CParam/;
|
CParamsCombo->insertItem($CParam,-1);
|
||||||
|
$Full_T_Block=~ s/\b$Params[$i-1]\b/$CParam/;
|
||||||
|
}
|
||||||
|
# also enumerate the parameters as should be used in the FUNCTIONS Block
|
||||||
|
$ParCount++;
|
||||||
|
$ParametersList=$ParametersList."$CParam \t is \t par$ParCount\n";
|
||||||
|
ParametersList->setText($ParametersList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$Component++;
|
$Component++;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user