Algorithm for FUNCTIONS block implemented in GUI. Not yet full in MSR module.
This commit is contained in:
parent
0543c97b81
commit
1240ab8b51
86
src/external/MuSRFitGUI/devel/MuSRFit.pl
vendored
86
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 17:42:34 2010
|
# Created: Mon Jun 7 18:29:05 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!
|
||||||
@ -42,7 +42,8 @@ use Qt::slots
|
|||||||
T0Update => [],
|
T0Update => [],
|
||||||
RunSelectionToggle => [],
|
RunSelectionToggle => [],
|
||||||
fileBrowse => [],
|
fileBrowse => [],
|
||||||
AppendToFunctions => [];
|
AppendToFunctions => [],
|
||||||
|
ResetFunctions => [];
|
||||||
use Qt::attributes qw(
|
use Qt::attributes qw(
|
||||||
musrfit_tabs
|
musrfit_tabs
|
||||||
RUNSPage
|
RUNSPage
|
||||||
@ -2525,7 +2526,7 @@ sub NEW
|
|||||||
$layout33_3->addWidget(TheoryBlock_Label, 0, 0);
|
$layout33_3->addWidget(TheoryBlock_Label, 0, 0);
|
||||||
|
|
||||||
TheoryBlock = Qt::TextEdit($LayoutWidget_16, "TheoryBlock");
|
TheoryBlock = Qt::TextEdit($LayoutWidget_16, "TheoryBlock");
|
||||||
TheoryBlock->setEnabled( 0 );
|
TheoryBlock->setEnabled( 1 );
|
||||||
|
|
||||||
$layout33_3->addWidget(TheoryBlock, 1, 0);
|
$layout33_3->addWidget(TheoryBlock, 1, 0);
|
||||||
|
|
||||||
@ -2586,7 +2587,7 @@ sub NEW
|
|||||||
$layout33_3->addWidget(ParametersList_Label, 0, 1);
|
$layout33_3->addWidget(ParametersList_Label, 0, 1);
|
||||||
|
|
||||||
ParametersList = Qt::TextEdit($LayoutWidget_16, "ParametersList");
|
ParametersList = Qt::TextEdit($LayoutWidget_16, "ParametersList");
|
||||||
ParametersList->setEnabled( 0 );
|
ParametersList->setEnabled( 1 );
|
||||||
|
|
||||||
$layout33_3->addWidget(ParametersList, 1, 1);
|
$layout33_3->addWidget(ParametersList, 1, 1);
|
||||||
$layout34_2->addLayout($layout33_3);
|
$layout34_2->addLayout($layout33_3);
|
||||||
@ -3770,7 +3771,6 @@ sub ActivateShComp
|
|||||||
my $Full_T_Block= $All{"Full_T_Block"};
|
my $Full_T_Block= $All{"Full_T_Block"};
|
||||||
|
|
||||||
my $Component=1;
|
my $Component=1;
|
||||||
CParamsCombo->clear();
|
|
||||||
|
|
||||||
foreach my $FitType (@FitTypes) {
|
foreach my $FitType (@FitTypes) {
|
||||||
my $Parameters=$Paramcomp[$Component-1];
|
my $Parameters=$Paramcomp[$Component-1];
|
||||||
@ -3800,24 +3800,19 @@ sub ActivateShComp
|
|||||||
for (my $i=1; $i<=9;$i++) {
|
for (my $i=1; $i<=9;$i++) {
|
||||||
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 "" && $Params[$i-1] ne "Alpha" && $Params[$i-1] ne "N0" && $Params[$i-1] ne "NBg") {
|
||||||
$ChkBx->setHidden(0);
|
$ChkBx->setHidden(0);
|
||||||
$ChkBx->setEnabled(1);
|
$ChkBx->setEnabled(1);
|
||||||
$ChkBx ->setText($Params[$i-1]);
|
$ChkBx ->setText($Params[$i-1]);
|
||||||
CParamsCombo->insertItem($CParam,-1);
|
# CParamsCombo->insertItem($CParam,-1);
|
||||||
$Full_T_Block=~ s/\b$Params[$i-1]\b/$CParam/;
|
# $Full_T_Block=~ s/\b$Params[$i-1]\b/$CParam/;
|
||||||
} else {
|
} else {
|
||||||
$ChkBx->setHidden(1);
|
$ChkBx->setHidden(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$Component++;
|
$Component++;
|
||||||
}
|
}
|
||||||
# Set theory block in Constraints
|
|
||||||
TheoryBlock->setText($Full_T_Block);
|
|
||||||
# Then clear the text
|
|
||||||
ConstraintLine->setText("");
|
|
||||||
FunctionsBlock->setText("");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3836,10 +3831,6 @@ sub InitializeTab
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Initialize Parameters List in function block (constraints).
|
|
||||||
my $ParametersList="";
|
|
||||||
ParametersList->setText("");
|
|
||||||
|
|
||||||
my %PTable=MSR::PrepParamTable(\%All);
|
my %PTable=MSR::PrepParamTable(\%All);
|
||||||
|
|
||||||
# Setup the table with the right size
|
# Setup the table with the right size
|
||||||
@ -3848,9 +3839,6 @@ sub InitializeTab
|
|||||||
InitParamTable->setNumRows($NParam);
|
InitParamTable->setNumRows($NParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
# Counter for function block (with out Alpha etc.)
|
|
||||||
my $ParCount=0;
|
|
||||||
|
|
||||||
# Fill the table with labels and values of parametr
|
# Fill the table with labels and values of parametr
|
||||||
for (my $PCount=0;$PCount<$NParam;$PCount++) {
|
for (my $PCount=0;$PCount<$NParam;$PCount++) {
|
||||||
my ($Param,$value,$error,$minvalue,$maxvalue,$RUN) = split(/,/,$PTable{$PCount});
|
my ($Param,$value,$error,$minvalue,$maxvalue,$RUN) = split(/,/,$PTable{$PCount});
|
||||||
@ -3863,15 +3851,6 @@ sub InitializeTab
|
|||||||
InitParamTable->setText($PCount,1,$error);
|
InitParamTable->setText($PCount,1,$error);
|
||||||
InitParamTable->setText($PCount,2,$minvalue);
|
InitParamTable->setText($PCount,2,$minvalue);
|
||||||
InitParamTable->setText($PCount,3,$maxvalue);
|
InitParamTable->setText($PCount,3,$maxvalue);
|
||||||
|
|
||||||
# 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);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -4060,6 +4039,55 @@ sub AppendToFunctions
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub ResetFunctions
|
||||||
|
{
|
||||||
|
|
||||||
|
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);
|
||||||
|
# For now the line below does not work. Why?
|
||||||
|
# my $Paramcomp_ref=$All{"Paramcomp_ref"};
|
||||||
|
my @Paramcomp = @$Paramcomp_ref;
|
||||||
|
my $Full_T_Block= $All{"Full_T_Block"};
|
||||||
|
my $Param="";
|
||||||
|
|
||||||
|
# Initialize Parameters List in function block (constraints).
|
||||||
|
my $ParametersList="";
|
||||||
|
ParametersList->setText("");
|
||||||
|
|
||||||
|
# Counter for function block (with out Alpha etc.)
|
||||||
|
my $ParCount=0;
|
||||||
|
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("");
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
||||||
|
|
||||||
|
28
src/external/MuSRFitGUI/devel/MuSRFit.ui.h
vendored
28
src/external/MuSRFitGUI/devel/MuSRFit.ui.h
vendored
@ -599,13 +599,13 @@ void MuSRFitform::ActivateShComp()
|
|||||||
for (my $i=1; $i<=9;$i++) {
|
for (my $i=1; $i<=9;$i++) {
|
||||||
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 "" && $Params[$i-1] ne "Alpha" && $Params[$i-1] ne "N0" && $Params[$i-1] ne "NBg") {
|
||||||
$ChkBx->setHidden(0);
|
$ChkBx->setHidden(0);
|
||||||
$ChkBx->setEnabled(1);
|
$ChkBx->setEnabled(1);
|
||||||
$ChkBx ->setText($Params[$i-1]);
|
$ChkBx ->setText($Params[$i-1]);
|
||||||
CParamsCombo->insertItem($CParam,-1);
|
# CParamsCombo->insertItem($CParam,-1);
|
||||||
$Full_T_Block=~ s/\b$Params[$i-1]\b/$CParam/;
|
# $Full_T_Block=~ s/\b$Params[$i-1]\b/$CParam/;
|
||||||
} else {
|
} else {
|
||||||
$ChkBx->setHidden(1);
|
$ChkBx->setHidden(1);
|
||||||
}
|
}
|
||||||
@ -826,6 +826,24 @@ void MuSRFitform::AppendToFunctions()
|
|||||||
|
|
||||||
void MuSRFitform::ResetFunctions()
|
void MuSRFitform::ResetFunctions()
|
||||||
{
|
{
|
||||||
|
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);
|
||||||
|
# For now the line below does not work. Why?
|
||||||
|
# my $Paramcomp_ref=$All{"Paramcomp_ref"};
|
||||||
|
my @Paramcomp = @$Paramcomp_ref;
|
||||||
|
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("");
|
||||||
@ -834,6 +852,10 @@ void MuSRFitform::ResetFunctions()
|
|||||||
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
|
# Also update Parameters List for the Functions block
|
||||||
(my $Ptmp,my $tmp)=split(/_/,$Param);
|
(my $Ptmp,my $tmp)=split(/_/,$Param);
|
||||||
if ($Ptmp ne "" && $Ptmp ne "Alpha" && $Ptmp ne "N0" && $Ptmp ne "NBg") {
|
if ($Ptmp ne "" && $Ptmp ne "Alpha" && $Ptmp ne "N0" && $Ptmp ne "NBg") {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user