From 2e2f4554a95fa815c82b6613d308853c1d2c5fbf Mon Sep 17 00:00:00 2001 From: Zaher Salman Date: Mon, 29 Jan 2018 15:31:13 +0100 Subject: [PATCH 1/6] Implemented run list following msr2data notations with hyphens and colons. Started implementation of global fits using msr2data. --- src/external/MuSRFitGUI/MSR.pm | 1665 ++++++++++++------------ src/external/MuSRFitGUI/MuSRFit4.pm | 20 +- src/external/MuSRFitGUI/MuSRFit4.ui | 271 ++-- src/external/MuSRFitGUI/Ui_MuSRFit4.pm | 256 ++-- 4 files changed, 1121 insertions(+), 1091 deletions(-) mode change 100755 => 100644 src/external/MuSRFitGUI/MSR.pm diff --git a/src/external/MuSRFitGUI/MSR.pm b/src/external/MuSRFitGUI/MSR.pm old mode 100755 new mode 100644 index 713abcaf..51ff9913 --- a/src/external/MuSRFitGUI/MSR.pm +++ b/src/external/MuSRFitGUI/MSR.pm @@ -22,9 +22,9 @@ my %Def_Format = # Additional information to extract run properties from database # For LEM use summary files -$SUMM_DIR="/afs/psi.ch/project/nemu/data/summ/"; +my $SUMM_DIR="/afs/psi.ch/project/nemu/data/summ/"; # For Bulok use list files -%DBDIR=("LEM","/afs/psi.ch/project/nemu/data/log/", +my %DBDIR=("LEM","/afs/psi.ch/project/nemu/data/log/", "GPS","/afs/psi.ch/project/bulkmusr/olddata/list/", "Dolly","/afs/psi.ch/project/bulkmusr/olddata/list/", "GPD","/afs/psi.ch/project/bulkmusr/olddata/list/", @@ -33,7 +33,7 @@ $SUMM_DIR="/afs/psi.ch/project/nemu/data/summ/"; "LTF","/afs/psi.ch/project/bulkmusr/olddata/list/"); # Information available since -%MinYears=("LEM","2001", +my %MinYears=("LEM","2001", "GPS","1993", "Dolly","1998", "GPD","1993", @@ -42,7 +42,7 @@ $SUMM_DIR="/afs/psi.ch/project/nemu/data/summ/"; "LTF","1995"); # And to deal with old names of bulk muons -%AltArea=("GPS","PIM3","LTF","PIM3","ALC","PIE3","Dolly","PIE1","GPD","MUE1"); +my %AltArea=("GPS","PIM3","LTF","PIM3","ALC","PIE3","Dolly","PIE1","GPD","MUE1"); # Additions to paremeters' names @@ -52,6 +52,7 @@ my $maxadd = "_max"; +sub CreateMSR { ########################################################################## # CreateMSR # @@ -83,9 +84,8 @@ my $maxadd = "_max"; # FILENAME.msr - MSR file saved # ########################################################################## -sub CreateMSR { my %All = %{$_[0]}; - + my $DEBUG = ""; # Start with empty array my @FitTypes = (); @@ -114,16 +114,12 @@ sub CreateMSR { # Works for CGI script my $Step = $All{"go"}; - if ( $Step eq "PLOT" ) { - $FITMINTYPE = $EMPTY; - } - elsif ( $Step eq "MIGRAD" ) { + my $FITMINTYPE = $EMPTY; + if ( $Step eq "MIGRAD" ) { $FITMINTYPE = "MINIMIZE\nMIGRAD\nHESSE"; - } - elsif ( $Step eq "MINOS" ) { + } elsif ( $Step eq "MINOS" ) { $FITMINTYPE = "MIGRAD\nMINOS"; - } - elsif ( $Step eq "SIMPLEX" ) { + } elsif ( $Step eq "SIMPLEX" ) { $FITMINTYPE = "SCAN\nSIMPLEX"; } @@ -132,21 +128,15 @@ sub CreateMSR { $FITMINTYPE = $All{"Minimization"}."\n".$All{"ErrorCalc"}; } - # First create the THEORY Block my ($Full_T_Block,$Paramcomp_ref)=MSR::CreateTheory(@FitTypes); my @Paramcomp = @$Paramcomp_ref; - # If we have a FUNCTIONS Block the Full_T_Block should be # replaced by Func_T_Block - $FUNCTIONS_Block = $EMPTY; + my $FUNCTIONS_Block = $EMPTY; if ($All{"FunctionsBlock"} ne $EMPTY) { - $FUNCTIONS_Block = " -############################################################### -FUNCTIONS -############################################################### -".$All{"FunctionsBlock"}."\n"; + $FUNCTIONS_Block = "FUNCTIONS\n###############################################################\n".$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; @@ -158,14 +148,21 @@ FUNCTIONS # Counter of Params my $PCount = 1; + my $PLT = 2; + # For SingleHist fit + if ($All{"FitAsyType"} eq "SingleHist") { $PLT = 0;} + # Need to select here RUNSAuto or RUNSManual # $RUNSType = 0 (Auto) or 1 (Manual) my $RUNSType = 0; my @RUNS=(); if ($All{"RunNumbers"} ne $EMPTY) { # Remove spaces and other illegal characters - $All{"RunNumbers"} =~ s/ //g; + $All{"RunNumbers"} =~ s/[\ \.\~\/\&\*\[\;\>\<\^\$\(\)\`\|\]\'\@]/,/g; $All{"RunNumbers"} =~ s/[a-zA-Z]//g; + # Expand hyphens + $All{"RunNumbers"} = MSR::ExpandRunNumbers($All{"RunNumbers"}); + # Split commas @RUNS=split( /,/, $All{"RunNumbers"}); $RUNSType = 0; } @@ -219,13 +216,14 @@ FUNCTIONS unshift( @Params, "Alpha" ); } - foreach $Param (@Params) { - $Param_ORG = $Param; + foreach my $Param (@Params) { + my $Param_ORG = $Param; if ( ($#FitTypes != 0) && ($Param ne "Alpha") ) { $Param = join( $EMPTY, $Param, "_", "$component" ); } # If we have only one RUN then everything is shared + my $Shared = 0; if ( $#RUNS == 0 ) { $Shared = 1; } @@ -254,7 +252,6 @@ FUNCTIONS # Start preparing the parameters block if ($Shared) { - # Parameter is shared enough to keep order from first run if ( $iRun == 1 ) { $Full_T_Block =~ s/$Param_ORG/$PCount/; @@ -264,50 +261,41 @@ FUNCTIONS } else { # Parameter is not shared, use map unless it is a single RUN fit # Skip adding to map line in these cases - if ( $Param ne "Alpha" && $#RUNS != 0 ) - { + if ( ( $Param ne "Alpha" && $#RUNS != 0 ) || ( !( $Param_ORG =~ m/^(No|NBg)/ ) && $#RUNS != 0 )) { ++$nonsh; $Full_T_Block =~ s/$Param_ORG/map$nonsh/; $MAP_Line = join( ' ', $MAP_Line, $PCount ); } ++$PCount; } - $NtotPar = $PCount; + my $NtotPar = $PCount; } } # Finished preparing the FITPARAMETERS block ####################################################################### + # Start constructing RUN block here # For each defined range we need a block in the RUN-Block # Also for each histogram in Single Histograms fits - # Also for Imaginaryand and Real for RRF fits $RUN = $RUNS[ $iRun - 1 ]; - + my $RUN_Line = $EMPTY; if ($All{"RUNSType"}) { $RUN_Line = MSR::RUNFileNameAuto($RUN,"0000",$EMPTY); } else { $RUN_Line = MSR::RUNFileNameAuto($RUN,$YEAR,$BeamLine); } - $Type_Line = "fittype 2"; - $PLT = 2; - $Hist_Lines = + my $Type_Line = "fittype 2"; + my $Hist_Lines = "forward $Hists[0]\nbackward $Hists[1]"; - $Bg_Line = "background"; - $Data_Line = "data"; - $T0_Line = "t0"; - $NHist=1; - foreach $Hist (@Hists) { - foreach ("t0","Bg1","Bg2","Data1","Data2") { - $Name = "$_$NHist"; -# If empty fill with defaults -# if ($All{$Name} eq $EMPTY) { -# $All{$Name}=MSR::T0BgData($_,$Hist,$BeamLine); -# } - } + my $Bg_Line = "background"; + my $Data_Line = "data"; + my $T0_Line = "t0"; + my $NHist=1; + foreach my $Hist (@Hists) { # If empty skip lines if ($All{"Bg1$NHist"} ne $EMPTY && $All{"Bg2$NHist"} ne $EMPTY) { $Bg_Line = $Bg_Line." ".$All{"Bg1$NHist"}." ".$All{"Bg2$NHist"}; @@ -364,23 +352,15 @@ FUNCTIONS # The number of runs is $NRUNS = $iRun - 1; - -# Start constructing all blocks + # Start constructing all blocks my $TitleLine = $All{"TITLE"}."\n# Run Numbers: ".$All{"RunNumbers"}; -# if ($All{"RUNSType"}) { -# $TitleLine = $EMPTY; -# } -# $TitleLine =~ s/\n//g; # Get parameter block from MSR::PrepParamTable(\%All); - my $FitParaBlk = " -############################################################### -FITPARAMETER + my $FitParaBlk = "FITPARAMETER ############################################################### # No Name Value Err Min Max "; my %PTable=MSR::PrepParamTable(\%All); my $NParam=scalar keys( %PTable ); - # Fill the table with labels and values of parametr for (my $iP=0;$iP<$NParam;$iP++) { my ($Param,$value,$error,$minvalue,$maxvalue,$RUNtmp) = split(/,/,$PTable{$iP}); @@ -393,26 +373,14 @@ FITPARAMETER $PCount $Param $value $error $error $minvalue $maxvalue"; } - $Full_T_Block = " -############################################################### -THEORY -############################################################### -$Full_T_Block -"; + $Full_T_Block = "THEORY\n###############################################################\n$Full_T_Block\n"; - - $RUN_Block = - "############################################################### -$RUN_Block"; - - $COMMANDS_Block = - "############################################################### -COMMANDS -FITMINTYPE -SAVE -"; + # COMMAND Block + $COMMANDS_Block = "COMMANDS\nFITMINTYPE\nSAVE\n"; $COMMANDS_Block =~ s/FITMINTYPE/$FITMINTYPE/g; + # END- COMMAND Block + # PLOT Block # Check if log x and log y are selected my $logxy = $EMPTY; if ( $All{"logx"} eq "y" ) { $logxy = $logxy . "logx\n"; } @@ -431,63 +399,76 @@ SAVE $VIEWBIN_Line =""; if ( $All{"ViewBin"}!=0 ) { $VIEWBIN_Line = "view_packing ".$All{"ViewBin"};} - my $RRFBlock=MSR::CreateRRFBlock(\%All); - $PLOT_Block = - "############################################################### -PLOT $PLT -runs $RUNS_Line -$PRANGE_Line -$VIEWBIN_Line -$RRFBlock -$logxy"; + my $RRFBlock=MSR::CreateRRFBlk(\%All); + $PLOT_Block = "PLOT $PLT\nruns $RUNS_Line\n$PRANGE_Line\n$VIEWBIN_Line\n$RRFBlock\n$logxy"; + #END - PLOT Block - if ($All{"FUNITS"} eq $EMPTY) {$All{"FUNITS"}="MHz";} - if ($All{"FAPODIZATION"} eq $EMPTY) {$All{"FAPODIZATION"}="STRONG";} - if ($All{"FPLOT"} eq $EMPTY) {$All{"FPLOT"}="POWER";} - if ($All{"FPHASE"} eq $EMPTY) {$All{"FPHASE"}="8.5";} - my $FrqRange = "#range ".$All{"FRQMIN"}." ".$All{"FRQMAX"}; - if ($All{"FRQMAX"} ne $EMPTY && $All{"FRQMIN"} ne $EMPTY && $All{"FRQMAX"} ne $All{"FRQMIN"}) { - $FrqRange = "range ".$All{"FRQMIN"}." ".$All{"FRQMAX"}; - } - - $FOURIER_Block= - "############################################################### -FOURIER -units FUNITS # units either 'Gauss', 'MHz', or 'Mc/s' -fourier_power 12 -apodization FAPODIZATION # NONE, WEAK, MEDIUM, STRONG -plot FPLOT # REAL, IMAG, REAL_AND_IMAG, POWER, PHASE -phase FPHASE -FRQRANGE"; - - $FOURIER_Block=~ s/FUNITS/$All{"FUNITS"}/g; - $FOURIER_Block=~ s/FAPODIZATION/$All{"FAPODIZATION"}/g; - $FOURIER_Block=~ s/FPLOT/$All{"FPLOT"}/g; - $FOURIER_Block=~ s/FPHASE/$All{"FPHASE"}/g; - $FOURIER_Block=~ s/FRQRANGE/$FrqRange/g; + # FFT Block + my $FOURIER_Block = MSR::CreateFFTBlk(\%All); + # END - FFT Block + # STATS Block # Don't know why but it is needed initially - $STAT_Block = - "############################################################### -STATISTIC --- 0000-00-00 00:00:00 -*** FIT DID NOT CONVERGE ***"; - + my $STAT_Block = "STATISTIC --- 0000-00-00 00:00:00\n*** FIT DID NOT CONVERGE ***"; + # END - STATS Block # Empty line at the end of each block - my $FullMSRFile = "$TitleLine$FitParaBlk\n$Full_T_Block\n$FUNCTIONS_Block\n$RUN_Block\n$COMMANDS_Block\n$PLOT_Block\n$FOURIER_Block\n$STAT_Block\n"; + my $FullMSRFile = "$TitleLine +############################################################### +$FitParaBlk +############################################################### +$Full_T_Block +############################################################### +$FUNCTIONS_Block +############################################################### +$RUN_Block +############################################################### +$COMMANDS_Block +############################################################### +$PLOT_Block +############################################################### +$FOURIER_Block +############################################################### +$STAT_Block\n"; # Return information and file return($Full_T_Block,\@Paramcomp,$FullMSRFile); } - - +sub CreateMSRSingleHist { ########################################################################## # CreateMSRSingleHist +# +# Input in %All +# Required: +# $All{"FitType1/2/3"} - Function types, 3 components +# $All{"LRBF"} - Histograms, comma separated +# $All{"Tis"} +# $All{"Tfs"} +# $All{"BINS"} +# $All{"FILENAME"} +# $All{"go"} +# $All{"TITLE"} +# $All{"RunNumbers"} +# $All{"FitAsyType"} +# $All{"BeamLine"} +# $All{"YEAR"} +# +# Optional: +# $All{"Sh_$Param"} +# $All{"ltc"} +# $All{"$Param"} value, error, min, and max +# $All{"logx/y"} +# $All{"Xi/f"} +# +# Output +# $Full_T_Block - Full theory block +# @Paramcomp - Space separated list of parameters for each component +# FILENAME.msr - MSR file saved +# ########################################################################## -sub CreateMSRSingleHist { my %All = %{$_[0]}; - + my $DEBUG = ""; # Start with empty array my @FitTypes = (); @@ -507,9 +488,8 @@ sub CreateMSRSingleHist { # Works for CGI script my $Step = $All{"go"}; - if ( $Step eq "PLOT" ) { - $FITMINTYPE = $EMPTY; - } elsif ( $Step eq "MIGRAD" ) { + my $FITMINTYPE = $EMPTY; + if ( $Step eq "MIGRAD" ) { $FITMINTYPE = "MINIMIZE\nMIGRAD\nHESSE"; } elsif ( $Step eq "MINOS" ) { $FITMINTYPE = "MIGRAD\nMINOS"; @@ -522,20 +502,15 @@ sub CreateMSRSingleHist { $FITMINTYPE = $All{"Minimization"}."\n".$All{"ErrorCalc"}; } - # First create the THEORY Block my ($Full_T_Block,$Paramcomp_ref)=MSR::CreateTheory(@FitTypes); my @Paramcomp = @$Paramcomp_ref; # If we have a FUNCTIONS Block the Full_T_Block should be # replaced by Func_T_Block - $FUNCTIONS_Block = $EMPTY; + my $FUNCTIONS_Block = $EMPTY; if ($All{"FunctionsBlock"} ne $EMPTY) { - $FUNCTIONS_Block = " -############################################################### -FUNCTIONS -############################################################### -".$All{"FunctionsBlock"}."\n"; + $FUNCTIONS_Block = "FUNCTIONS\n###############################################################\n".$All{"FunctionsBlock"}."\n"; $Full_T_Block=$All{"Func_T_Block"}; # remove all _N to end $Full_T_Block =~ s/_\d\b//g; @@ -547,11 +522,21 @@ FUNCTIONS # Counter of Params my $PCount = 1; + my $PLT = 2; + # For SingleHist fit + if ($All{"FitAsyType"} eq "SingleHist") { $PLT = 0;} + # Need to select here RUNSAuto or RUNSManual # $RUNSType = 0 (Auto) or 1 (Manual) my $RUNSType = 0; my @RUNS=(); if ($All{"RunNumbers"} ne $EMPTY) { + # Remove spaces and other illegal characters + $All{"RunNumbers"} =~ s/[\ \.\~\/\&\*\[\;\>\<\^\$\(\)\`\|\]\'\@]/,/g; + $All{"RunNumbers"} =~ s/[a-zA-Z]//g; + # Expand hyphens + $All{"RunNumbers"} = MSR::ExpandRunNumbers($All{"RunNumbers"}); + # Split commas @RUNS=split( /,/, $All{"RunNumbers"}); $RUNSType = 0; } @@ -584,16 +569,15 @@ FUNCTIONS foreach my $RUN (@RUNS) { # Until here identical to sub CreateMSR -####################################################################### -# 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 -# We distinguich between sharing among different runs to common parameters -# for different histograms. The first is done in the usual "Sharing" schame, -# while the second has to be done in the functions block. This can be done -# in a consistent, non-confusing algorithm + ####################################################################### + # 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! + # We distinguich between sharing among different runs to common parameters + # for different histograms. The first is done in the usual "Sharing" schame, + # while the second has to be done in the functions block. This can be done + # in a consistent, non-confusing algorithm foreach my $Hist (@Hists) { - # Prepare the Parameters and initial values block my $component = 0; my $Single_RUN = $EMPTY; @@ -614,27 +598,21 @@ FUNCTIONS my @Params = split( /\s+/, $Parameters ); # Only the first histiograms has new physical parameters # the others keep only Phi if they have it - if ($iHist != 0) { - # look for Phi -# if ( grep( /^Phi$/, @Params ) ) { - # if it is there keep only that -# @Params=("Phi"); -# } - } # For the first component we need No and NBg for SingleHist fits if ( $component == 1 ) { unshift( @Params, ( "No", "NBg" ) ); } - foreach $Param (@Params) { - $Param_ORG = $Param; + foreach my $Param (@Params) { + my $Param_ORG = $Param; $Param=$Param.$Hist; if ( ($#FitTypes != 0) && !( $Param_ORG =~ m/^(No|NBg)/ ) ) { $Param = join( $EMPTY, $Param, "_", "$component" ); } # If we have only one RUN with one Histogram then everything is shared + my $Shared = 0; if ( $#RUNS == 0 && $#Hists == 0 ) { $Shared = 1; } @@ -677,8 +655,6 @@ FUNCTIONS } #################################################################################################### - print $Full_T_Block."\n"; - # Start preparing the parameters block if ($Shared) { @@ -705,12 +681,14 @@ FUNCTIONS # Finished preparing the FITPARAMETERS block ####################################################################### + # Start constructing RUN block here # For each defined range we need a block in the RUN-Block # Also for each histogram in Single Histograms fits - # Also for Imaginary and and Real for RRF fits - + $RUN = $RUNS[ $iRun - 1 ]; + $DEBUG = $DEBUG.MSR::CreateRUNBlk($RUN, $YEAR, $BeamLine, $All{"FitAsyType"}, $All{"LRBF"}, $All{"Tis"}, $All{"Tfs"}, $All{"BINS"}); + if ($All{"RUNSType"}) { $RUN_Line = MSR::RUNFileNameAuto($RUN,"0000",$EMPTY); } else { @@ -725,7 +703,7 @@ FUNCTIONS foreach ("t0","Bg1","Bg2","Data1","Data2") { $Name = "$_$Hist"; -# If empty fill with defaults + # If empty fill with defaults if ($All{$Name} eq $EMPTY) { $All{$Name}=MSR::T0BgData($_,$Hist,$BeamLine); } @@ -746,6 +724,11 @@ FUNCTIONS $Single_RUN = $Single_RUN . "$RUN_Line\n$Type_Line\n$NoBg_Line$Tmp_Hist_Line\n$Data_Line\n$MAP_Line\n$FRANGE_Line\n$PAC_Line\n\n"; + # This is from CreateRUNBlk + $DEBUG =~s /T0LINE/$T0_Line/; + $DEBUG =~s /BGLINE/$Bg_Line/; + $DEBUG =~s /DATALINE/$Data_Line/; + # Now add the appropriate values of fit range and packing my $Range_Min = 8; my $Range_Max = 0; @@ -770,17 +753,14 @@ FUNCTIONS ++$iRun; } + # From here again identical to sub CreateMSR # The number of runs is $NRUNS = $iRun - 1; - -# Start constructing all block + # Start constructing all block my $TitleLine = $All{"TITLE"}."\n# Run Numbers: ".$All{"RunNumbers"}; -# $TitleLine =~ s/\n//g; # Get parameter block from MSR::PrepParamTable(\%All); - my $FitParaBlk = " -############################################################### -FITPARAMETER + my $FitParaBlk = "FITPARAMETER ############################################################### # No Name Value Err Min Max "; my %PTable=MSR::PrepParamTable(\%All); @@ -797,25 +777,14 @@ FITPARAMETER $PCount $Param $value $error $error $minvalue $maxvalue"; } - $Full_T_Block = " -############################################################### -THEORY -############################################################### -$Full_T_Block -"; + $Full_T_Block = "THEORY\n###############################################################\n$Full_T_Block\n"; - $RUN_Block = - "############################################################### -$RUN_Block"; - - $COMMANDS_Block = - "############################################################### -COMMANDS -FITMINTYPE -SAVE -"; + # COMMAND Block + $COMMANDS_Block = "COMMANDS\nFITMINTYPE\nSAVE\n"; $COMMANDS_Block =~ s/FITMINTYPE/$FITMINTYPE/g; + # END- COMMAND Block + # PLOT Block # Check if log x and log y are selected my $logxy = $EMPTY; if ( $All{"logx"} eq "y" ) { $logxy = $logxy . "logx\n"; } @@ -831,50 +800,600 @@ SAVE } } - my $RRFBlock=MSR::CreateRRFBlock(\%All); - $PLOT_Block = - "############################################################### -PLOT $PLT -runs $RUNS_Line -$PRANGE_Line -$RRFBlock -$logxy"; + $VIEWBIN_Line =""; + if ( $All{"ViewBin"}!=0 ) { $VIEWBIN_Line = "view_packing ".$All{"ViewBin"};} - if ($All{"FUNITS"} eq $EMPTY) {$All{"FUNITS"}="MHz";} - if ($All{"FAPODIZATION"} eq $EMPTY) {$All{"FAPODIZATION"}="STRONG";} - if ($All{"FPLOT"} eq $EMPTY) {$All{"FPLOT"}="POWER";} - if ($All{"FPHASE"} eq $EMPTY) {$All{"FPHASE"}="8.5";} + my $RRFBlock=MSR::CreateRRFBlk(\%All); + $PLOT_Block = "PLOT $PLT\nruns $RUNS_Line\n$PRANGE_Line\n$VIEWBIN_Line\n$RRFBlock\n$logxy"; + #END - PLOT Block + # FFT Block + my $FOURIER_Block = MSR::CreateFFTBlk(\%All); + # END - FFT Block - $FOURIER_Block= - "############################################################### -FOURIER -units FUNITS # units either 'Gauss', 'MHz', or 'Mc/s' -fourier_power 12 -apodization FAPODIZATION # NONE, WEAK, MEDIUM, STRONG -plot FPLOT # REAL, IMAG, REAL_AND_IMAG, POWER, PHASE -phase FPHASE -#range FRQMIN FRQMAX"; - - $FOURIER_Block=~ s/FUNITS/$All{"FUNITS"}/g; - $FOURIER_Block=~ s/FAPODIZATION/$All{"FAPODIZATION"}/g; - $FOURIER_Block=~ s/FPLOT/$All{"FPLOT"}/g; - $FOURIER_Block=~ s/FPHASE/$All{"FPHASE"}/g; - + # STATS Block # Don't know why but it is needed initially - $STAT_Block = - "############################################################### -STATISTIC --- 0000-00-00 00:00:00 -*** FIT DID NOT CONVERGE ***"; + my $STAT_Block = "STATISTIC --- 0000-00-00 00:00:00\n*** FIT DID NOT CONVERGE ***"; + # END - STATS Block + # Empty line at the end of each blocks + my $FullMSRFile = "$TitleLine +############################################################### +$FitParaBlk +############################################################### +$Full_T_Block +############################################################### +$FUNCTIONS_Block +############################################################### +$RUN_Block +############################################################### +$COMMANDS_Block +############################################################### +$PLOT_Block +############################################################### +$FOURIER_Block +############################################################### +$STAT_Block\n"; + +# Return information and file +# return($Full_T_Block,\@Paramcomp,$FullMSRFile."\n\n#DEBUG MSG\n$DEBUG\n"); + return($Full_T_Block,\@Paramcomp,$FullMSRFile); +} + +sub CreateMSRUni { +########################################################################## +# CreateMSRUni +# +# Input in %All +# Required: +# $All{"FitType1/2/3"} - Function types, 3 components +# $All{"LRBF"} - Histograms, comma separated +# $All{"Tis"} +# $All{"Tfs"} +# $All{"BINS"} +# $All{"FILENAME"} +# $All{"go"} +# $All{"TITLE"} +# $All{"RunNumbers"} +# $All{"FitAsyType"} +# $All{"BeamLine"} +# $All{"YEAR"} +# +# Optional: +# $All{"Sh_$Param"} +# $All{"ltc"} +# $All{"$Param"} value, error, min, and max +# $All{"logx/y"} +# $All{"Xi/f"} +# +# Output +# $Full_T_Block - Full theory block +# @Paramcomp - Space separated list of parameters for each component +# FILENAME.msr - MSR file saved +# +########################################################################## + my %All = %{$_[0]}; + my $DEBUG = ""; + # Start with empty array + my @FitTypes = (); + + foreach ($All{"FitType1"},$All{"FitType2"},$All{"FitType3"}) { + if ($_ ne "None") { + @FitTypes=(@FitTypes,$_); + } + } + + my @Hists = split( /,/, $All{"LRBF"} ); + # TODO + # : to separate two sets of asymmetries with same parameters + # Check the number of histograms + # should be 2 or 4 histograms + # should be checked in GUI + # for 2 simple asymmetry fit + # for 4 two run blocks with different geometric parameters: + # Alpha, No, NBg, Phi, Asy + + my @TiVals = split( /,/, $All{"Tis"} ); + my @TfVals = split( /,/, $All{"Tfs"} ); + my @BINVals = split( /,/, $All{"BINS"} ); + my $FILENAME = $All{"FILENAME"}; + my $BeamLine = $All{"BeamLine"}; + my $YEAR = $All{"YEAR"}; + + # Works for CGI script + my $Step = $All{"go"}; + my $FITMINTYPE = $EMPTY; + if ( $Step eq "MIGRAD" ) { + $FITMINTYPE = "MINIMIZE\nMIGRAD\nHESSE"; + } elsif ( $Step eq "MINOS" ) { + $FITMINTYPE = "MIGRAD\nMINOS"; + } elsif ( $Step eq "SIMPLEX" ) { + $FITMINTYPE = "SCAN\nSIMPLEX"; + } + + # Proper way + if ( $All{"Minimization"} ne $EMPTY && $All{"ErrorCalc"} ne $EMPTY && $Step ne "PLOT" ) { + $FITMINTYPE = $All{"Minimization"}."\n".$All{"ErrorCalc"}; + } + + # First create the THEORY Block + my ($Full_T_Block,$Paramcomp_ref)=MSR::CreateTheory(@FitTypes); + my @Paramcomp = @$Paramcomp_ref; + + # If we have a FUNCTIONS Block the Full_T_Block should be + # replaced by Func_T_Block + my $FUNCTIONS_Block = $EMPTY; + if ($All{"FunctionsBlock"} ne $EMPTY) { + $FUNCTIONS_Block = "FUNCTIONS\n###############################################################\n".$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 + my $iRun = 1; + + # Counter of Params + my $PCount = 1; + + my $PLT = 2; + # For SingleHist fit + if ($All{"FitAsyType"} eq "SingleHist") { $PLT = 0;} + + # Need to select here RUNSAuto or RUNSManual + # $RUNSType = 0 (Auto) or 1 (Manual) + my $RUNSType = 0; + my @RUNS=(); + if ($All{"RunNumbers"} ne $EMPTY) { + # Remove spaces and other illegal characters + $All{"RunNumbers"} =~ s/[\ \.\~\/\&\*\[\;\>\<\^\$\(\)\`\|\]\'\@]/,/g; + $All{"RunNumbers"} =~ s/[a-zA-Z]//g; + # Expand hyphens + $All{"RunNumbers"} = MSR::ExpandRunNumbers($All{"RunNumbers"}); + # Split commas + @RUNS=split( /,/, $All{"RunNumbers"}); + $RUNSType = 0; + } + elsif ($All{"RunFiles"} ne $EMPTY) { + @RUNS=split( /,/, $All{"RunFiles"}); + $RUNSType = 1; + } + + # Initialise $shcount, a counter for shared parameters + my $shcount = 1; + my $RUN_Block = $EMPTY; + my $RUNS_Line = $EMPTY; + + # range order + my $Range_Order = 1; + my $iHist = 0; + foreach my $RUN (@RUNS) { + if ($All{"FitAsyType"} eq "Asymmetry" || $All{"FitAsyType"} eq "AsyGLB") { + # Prepare the Parameters and initial values block + my $component = 0; + my $Single_RUN = $EMPTY; + + # Prepare map line for each run + my $MAP_Line = "map "; + + # How many non-shared parameter for this RUN? + my $nonsh = 0; + + # Prepeare Alpha line for the RUN block. Empty initially. + my $Alpha_Line = $EMPTY; + + # Loop over all components in the fit + foreach my $FitType (@FitTypes) { + ++$component; + my $Parameters = $Paramcomp[ $component - 1 ]; + my @Params = split( /\s+/, $Parameters ); + + # For the first component we need Alpha for Asymmetry fits + if ($component == 1) { + unshift( @Params, "Alpha" ); + } + + foreach my $Param (@Params) { + my $Param_ORG = $Param; + if ( ($#FitTypes != 0) && ($Param ne "Alpha") ) { + $Param = join( $EMPTY, $Param, "_", "$component" ); + } + + # If we have only one RUN then everything is shared + my $Shared = 0; + if ( $#RUNS == 0 ) { + $Shared = 1; + } + # Otherwise check input if it was marked as shared + else { + $Shared = $All{"Sh_$Param"}; + } + + # Alpha Line + # + # If you encounter alpha in the parameters list make sure + # to fill this line for the RUN block. + if ( $Param_ORG eq "Alpha" ) { + if ($Shared) { + # If alpha is shared use always the same line + $Alpha_Line = "alpha 1\n"; + } + else { + # Otherwise modify alpha line accordingly + $Alpha_Line = "alpha $PCount\n"; + } + } + + # End of Alpha Line + + # Start preparing the parameters block + if ($Shared) { + # Parameter is shared enough to keep order from first run + if ( $iRun == 1 ) { + $Full_T_Block =~ s/$Param_ORG/$PCount/; + ++$shcount; + ++$PCount; + } + } else { + # Parameter is not shared, use map unless it is a single RUN fit + # Skip adding to map line in these cases + if ( ( $Param ne "Alpha" && $#RUNS != 0 ) || ( !( $Param_ORG =~ m/^(No|NBg)/ ) && $#RUNS != 0 )) { + ++$nonsh; + $Full_T_Block =~ s/$Param_ORG/map$nonsh/; + $MAP_Line = join( ' ', $MAP_Line, $PCount ); + } + ++$PCount; + } + my $NtotPar = $PCount; + } + } + + # Finished preparing the FITPARAMETERS block + + # Start constructing RUN block here + # For each defined range we need a block in the RUN-Block + # Also for each histogram in Single Histograms fits + + $RUN = $RUNS[ $iRun - 1 ]; + + $DEBUG = $DEBUG.MSR::CreateRUNBlk($RUN, $YEAR, $BeamLine, $All{"FitAsyType"}, $All{"LRBF"}, $All{"Tis"}, $All{"Tfs"}, $All{"BINS"}); + + my $RUN_Line = $EMPTY; + if ($All{"RUNSType"}) { + $RUN_Line = MSR::RUNFileNameAuto($RUN,"0000",$EMPTY); + } else { + $RUN_Line = MSR::RUNFileNameAuto($RUN,$YEAR,$BeamLine); + } + + my $Type_Line = "fittype 2"; + my $Hist_Lines = + "forward $Hists[0]\nbackward $Hists[1]"; + + my $Bg_Line = "background"; + my $Data_Line = "data"; + my $T0_Line = "t0"; + my $NHist=1; + foreach my $Hist (@Hists) { + # If empty skip lines + if ($All{"Bg1$NHist"} ne $EMPTY && $All{"Bg2$NHist"} ne $EMPTY) { + $Bg_Line = $Bg_Line." ".$All{"Bg1$NHist"}." ".$All{"Bg2$NHist"}; + } + if ($All{"Data1$NHist"} ne $EMPTY && $All{"Data2$NHist"} ne $EMPTY) { + $Data_Line =$Data_Line." ".$All{"Data1$NHist"}." ".$All{"Data2$NHist"}; + } + if ($All{"t0$NHist"} ne $EMPTY) { + $T0_Line=$T0_Line." ".$All{"t0$NHist"}; + } + $NHist++; + } + + # Put T0_Line Bg_Line and Data_Line together if not empty + my $T0DataBg=$EMPTY; + if ($T0_Line ne "t0") { + $T0DataBg = $T0DataBg.$T0_Line."\n"; + } + if ($Bg_Line ne "background") { + $T0DataBg = $T0DataBg.$Bg_Line."\n"; + } + if ($Data_Line ne "data") { + $T0DataBg = $T0DataBg.$Data_Line."\n"; + } + + $FRANGE_Line = "fit TINI TFIN"; + $PAC_Line = "packing BINNING"; + + $Single_RUN = + "$RUN_Line\n$Type_Line\n$Alpha_Line$Hist_Lines\n$T0DataBg$MAP_Line\n$FRANGE_Line\n$PAC_Line\n\n"; + + # This is from CreateRUNBlk + $DEBUG =~s /T0LINE/$T0_Line/; + $DEBUG =~s /BGLINE/$Bg_Line/; + $DEBUG =~s /DATALINE/$Data_Line/; + + # Now add the appropriate values of fit range and packing + my $Range_Min = 8; + my $Range_Max = 0; + my $k = 0; + foreach my $Ti (@TiVals) { + my $Tf = $TfVals[$k]; + my $BIN = $BINVals[$k]; + $RUN_Block = $RUN_Block . $Single_RUN; + $RUN_Block =~ s/TINI/$Ti/g; + $RUN_Block =~ s/TFIN/$Tf/g; + $RUN_Block =~ s/BINNING/$BIN/g; + + # For multiple ranges use this + if ( $Ti < $Range_Min ) { $Range_Min = $Ti; } + if ( $Tf > $Range_Max ) { $Range_Max = $Tf; } + + $RUNS_Line = "$RUNS_Line " . $Range_Order; + ++$k; + ++$Range_Order; + } + } else { + ####################################################################### + # 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! + # We distinguich between sharing among different runs to common parameters + # for different histograms. The first is done in the usual "Sharing" schame, + # while the second has to be done in the functions block. This can be done + # in a consistent, non-confusing algorithm + foreach my $Hist (@Hists) { + # Prepare the Parameters and initial values block + my $component = 0; + my $Single_RUN = $EMPTY; + + # Prepare map line for each run + my $MAP_Line = "map "; + + # How many non-shared parameter for this RUN? + my $nonsh = 0; + + # Prepeare No/NBg line for the RUN block. Empty initially. + my $NoBg_Line = $EMPTY; + + # Loop over all components in the fit + foreach my $FitType (@FitTypes) { + ++$component; + my $Parameters = $Paramcomp[ $component - 1 ]; + my @Params = split( /\s+/, $Parameters ); + # Only the first histiograms has new physical parameters + # the others keep only Phi if they have it + + # For the first component we need No and NBg for SingleHist fits + if ( $component == 1 ) { + unshift( @Params, ( "No", "NBg" ) ); + } + + foreach my $Param (@Params) { + my $Param_ORG = $Param; + $Param=$Param.$Hist; + if ( ($#FitTypes != 0) && !( $Param_ORG =~ m/^(No|NBg)/ ) ) { + $Param = join( $EMPTY, $Param, "_", "$component" ); + } + + # If we have only one RUN with one Histogram then everything is shared + my $Shared = 0; + if ( $#RUNS == 0 && $#Hists == 0 ) { + $Shared = 1; + } else { + # Otherwise check input if it was marked as shared + $Shared = $All{"Sh_$Param"}; + } + + # No and NBg Lines + # + # If you encounter No in the parameters list make sure + # to fill this line for the RUN block. + if ( $Param_ORG eq "No" ) { + if ($Shared) { + $NoBg_Line = "norm 1\n"; + } + else { + $NoBg_Line = "norm $PCount\n"; + } + + # Optional - add lifetime correction for SingleHist fits + if ( $All{"ltc"} eq "y" ) { + $NoBg_Line = $NoBg_Line . "lifetimecorrection\n"; + } + } + # If you encounter NBg in the parameters list make sure + # to fill this line for the RUN block. + elsif ( $Param_ORG eq "NBg" ) { + if ($Shared) { + $NoBg_Line = $NoBg_Line . "backgr.fit 2\n"; + } else { + $NoBg_Line = $NoBg_Line . "backgr.fit $PCount\n"; + } + } + + # End of No and NBg Lines + + # Start preparing the parameters block + if ($Shared) { + # Parameter is shared enough to keep order from first run + if ( $iRun == 1 ) { + $Full_T_Block =~ s/$Param_ORG/$PCount/; + ++$shcount; + ++$PCount; + } + } else { + # Parameter is not shared, use map unless it is a single RUN fit + # Skip adding to map line in these cases + if ( !( $Param_ORG =~ m/^(No|NBg)/ ) && ($#RUNS != 0 || $#Hist != 0)) { + ++$nonsh; + $Full_T_Block =~ s/$Param_ORG/map$nonsh/; + $MAP_Line = join( ' ', $MAP_Line, $PCount ); + } + ++$PCount; + } + $NtotPar = $PCount; + } + } + + # Finished preparing the FITPARAMETERS block + + # Start constructing RUN block here + # For each defined range we need a block in the RUN-Block + # Also for each histogram in Single Histograms fits + + $RUN = $RUNS[ $iRun - 1 ]; + + $DEBUG = $DEBUG.MSR::CreateRUNBlk($RUN, $YEAR, $BeamLine, $All{"FitAsyType"}, $All{"LRBF"}, $All{"Tis"}, $All{"Tfs"}, $All{"BINS"}); + + if ($All{"RUNSType"}) { + $RUN_Line = MSR::RUNFileNameAuto($RUN,"0000",$EMPTY); + } else { + $RUN_Line = MSR::RUNFileNameAuto($RUN,$YEAR,$BeamLine); + } + + $Type_Line = "fittype 0"; + $PLT = 0; + $Hist_Lines = "forward HIST"; + $Bg_Line = $EMPTY; + $Data_Line = "data"; + + foreach ("t0","Bg1","Bg2","Data1","Data2") { + $Name = "$_$Hist"; + # If empty fill with defaults + if ($All{$Name} eq $EMPTY) { + $All{$Name}=MSR::T0BgData($_,$Hist,$BeamLine); + } + } + $Bg_Line = $Bg_Line." ".$All{"Bg1$Hist"}." ".$All{"Bg2$Hist"}; + $Data_Line =$Data_Line." ".$All{"Data1$Hist"}." ".$All{"Data2$Hist"}; + if ($All{"t0$Hist"} ne $EMPTY) { + $Data_Line=$Data_Line."\nt0 ".$All{"t0$Hist"}; + } + + $FRANGE_Line = "fit TINI TFIN"; + $PAC_Line = "packing BINNING"; + + $Single_RUN = $EMPTY; + $Tmp_Hist_Line = $Hist_Lines; + $Tmp_Hist_Line =~ s/HIST/$Hist/g; + $Single_RUN = $Single_RUN + . "$RUN_Line\n$Type_Line\n$NoBg_Line$Tmp_Hist_Line\n$Data_Line\n$MAP_Line\n$FRANGE_Line\n$PAC_Line\n\n"; + + # This is from CreateRUNBlk + $DEBUG =~s /T0LINE/$T0_Line/; + $DEBUG =~s /BGLINE/$Bg_Line/; + $DEBUG =~s /DATALINE/$Data_Line/; + + # Now add the appropriate values of fit range and packing + my $Range_Min = 8; + my $Range_Max = 0; + my $k = 0; + foreach my $Ti (@TiVals) { + my $Tf = $TfVals[$k]; + my $BIN = $BINVals[$k]; + $RUN_Block = $RUN_Block . $Single_RUN; + $RUN_Block =~ s/TINI/$Ti/g; + $RUN_Block =~ s/TFIN/$Tf/g; + $RUN_Block =~ s/BINNING/$BIN/g; + + # For multiple ranges use this + if ( $Ti < $Range_Min ) { $Range_Min = $Ti; } + if ( $Tf > $Range_Max ) { $Range_Max = $Tf; } + $RUNS_Line = "$RUNS_Line " . $Range_Order; + ++$k; + ++$Range_Order; + } + ++$iHist; + } + } + ++$iRun; + } + + # The number of runs is + $NRUNS = $iRun - 1; + # Start constructing all blocks + my $TitleLine = $All{"TITLE"}."\n# Run Numbers: ".$All{"RunNumbers"}; + + # Get parameter block from MSR::PrepParamTable(\%All); + my $FitParaBlk = "FITPARAMETER +############################################################### +# No Name Value Err Min Max "; + my %PTable=MSR::PrepParamTable(\%All); + my $NParam=scalar keys( %PTable ); +# Fill the table with labels and values of parametr + for (my $iP=0;$iP<$NParam;$iP++) { + my ($Param,$value,$error,$minvalue,$maxvalue,$RUNtmp) = split(/,/,$PTable{$iP}); + if ( $minvalue == $maxvalue ) { + $minvalue = $EMPTY; + $maxvalue = $EMPTY; + } + $PCount=$iP+1; + $FitParaBlk = $FitParaBlk." + $PCount $Param $value $error $error $minvalue $maxvalue"; + } + + $Full_T_Block = "THEORY\n###############################################################\n$Full_T_Block\n"; + + # COMMAND Block + $COMMANDS_Block = "COMMANDS\nFITMINTYPE\nSAVE\n"; + $COMMANDS_Block =~ s/FITMINTYPE/$FITMINTYPE/g; + # END- COMMAND Block + + # PLOT Block + # Check if log x and log y are selected + my $logxy = $EMPTY; + if ( $All{"logx"} eq "y" ) { $logxy = $logxy . "logx\n"; } + if ( $All{"logy"} eq "y" ) { $logxy = $logxy . "logy\n"; } + + # Check if a plot range is defined (i.e. different from fit) + $PRANGE_Line = "use_fit_ranges"; + if ( $All{"Xi"} != $All{"Xf"} ) { + if ($All{"Yi"} != $All{"Yf"}) { + $PRANGE_Line = "range ".$All{"Xi"}." ".$All{"Xf"}." ".$All{"Yi"}." ".$All{"Yf"}; + } else { + $PRANGE_Line = "range ".$All{"Xi"}." ".$All{"Xf"}; + } + } + + $VIEWBIN_Line =""; + if ( $All{"ViewBin"}!=0 ) { $VIEWBIN_Line = "view_packing ".$All{"ViewBin"};} + + my $RRFBlock=MSR::CreateRRFBlk(\%All); + $PLOT_Block = "PLOT $PLT\nruns $RUNS_Line\n$PRANGE_Line\n$VIEWBIN_Line\n$RRFBlock\n$logxy"; + #END - PLOT Block + + # FFT Block + my $FOURIER_Block = MSR::CreateFFTBlk(\%All); + # END - FFT Block + + # STATS Block + # Don't know why but it is needed initially + my $STAT_Block = "STATISTIC --- 0000-00-00 00:00:00\n*** FIT DID NOT CONVERGE ***"; + # END - STATS Block # Empty line at the end of each block - my $FullMSRFile = "$TitleLine$FitParaBlk\n$Full_T_Block\n$FUNCTIONS_Block\n$RUN_Block\n$COMMANDS_Block\n$PLOT_Block\n$FOURIER_Block\n$STAT_Block\n"; + my $FullMSRFile = "$TitleLine +############################################################### +$FitParaBlk +############################################################### +$Full_T_Block +############################################################### +$FUNCTIONS_Block +############################################################### +$RUN_Block +############################################################### +$COMMANDS_Block +############################################################### +$PLOT_Block +############################################################### +$FOURIER_Block +############################################################### +$STAT_Block\n"; # Return information and file return($Full_T_Block,\@Paramcomp,$FullMSRFile); } + +sub CreateMSRGLB { ########################################################################## # CreateMSRGLB # @@ -888,33 +1407,32 @@ STATISTIC --- 0000-00-00 00:00:00 # FILENAME.msr - MSR file saved # ########################################################################## -sub CreateMSRGLB { my %All = %{$_[0]}; my @RUNS = (); if ($All{"RUNSType"}) { # Make sure this globalization is disabled if RunFiles are used @RUNS = split( /,/, $All{"RunFiles"} ); +# Make example from first run + $All{"RunFiles"}=$RUNS[0]; } else { - @RUNS = split( /,/, $All{"RunNumbers"} ); + @RUNS = split( /,/, MSR::ExpandRunNumbers($All{"RunNumbers"}) ); +# Make example from first run + $All{"RunNumbers"}=$RUNS[0]; } -# Make example from first run - $All{"RunNumbers"}=$RUNS[0]; - my ($Full_T_Block,$Paramcomp_ref)= MSR::CreateMSR(\%All); - -# TODO: create global file from example file - + my ($Full_T_Block,$Paramcomp_ref,$MSRTemplate)= MSR::CreateMSRUni(\%All); # Return as usual my @Paramcomp = @$Paramcomp_ref; - return($Full_T_Block,\@Paramcomp); + + return($Full_T_Block,\@Paramcomp,$MSRTemplate); } -######################## -# Createheory -######################## sub CreateTheory { +######################## +# CreateTheory +######################## # This subroutine requires: # @FitTypes - the array of the types of components (summed) @@ -1178,12 +1696,12 @@ sub CreateTheory { ####################################################################### } return($Full_T_Block,\@Paramcomp); -} # End CreateTheory +} +sub ExtractBlks { ######################## # ExtractBlks ######################## -sub ExtractBlks { # This subroutine takes the MSR file as input and extracts the parameters # with the corresponding values, errors etc... @@ -1221,6 +1739,7 @@ sub ExtractBlks { } +sub T0BgData { ######################## # T0BgData # Function return the defaul value of t0, Bg and Data bin @@ -1229,7 +1748,6 @@ sub ExtractBlks { # $Hist is the histogram number # $BeamLine in the name of beamline ######################## -sub T0BgData { # Take this information as input arguments (my $Name, my $Hist, my $BeamLine) = @_; @@ -1239,7 +1757,13 @@ sub T0BgData { my %LEM=("1",",66000,66500,3419,63000", "2",",66000,66500,3419,63000", "3",",66000,66500,3419,63000", - "4",",66000,66500,3419,63000"); + "4",",66000,66500,3419,63000", + "5",",66000,66500,3419,63000", + "6",",66000,66500,3419,63000", + "7",",66000,66500,3419,63000", + "8",",66000,66500,3419,63000", + "9",",66000,66500,3419,63000", + "10",",66000,66500,3419,63000"); # my %GPS=("1",",40,120,135,8000", # "2",",40,120,135,8000", @@ -1272,17 +1796,17 @@ sub T0BgData { } +sub PrepParamTable { ######################## # PrepParamTable # Function return a Hash with a table of parameters for the fit # input should be # %All ######################## -sub PrepParamTable { # Take this information as input arguments # "Smart" default value of the fit parameters. my %Defaults = ( - "Asy", "0.15", "dAsy", "0.01", + "Asy", "0.20", "dAsy", "0.01", "Asy_min", "0", "Asy_max", "0", "Alpha", "1.0", "dAlpha", "0.01", "Alpha_min", "0", "Alpha_max", "0", @@ -1368,7 +1892,7 @@ sub PrepParamTable { foreach my $RUN (@RUNS) { $iRun++; $Component=1; - if ($All{"FitAsyType"} eq "Asymmetry") { + if ($All{"FitAsyType"} eq "Asymmetry" || $All{"FitAsyType"} eq "AsyGLB") { foreach my $FitType (@FitTypes) { my $Parameters=$Paramcomp[$Component-1]; my @Params = split( /\s+/, $Parameters ); @@ -1423,7 +1947,7 @@ sub PrepParamTable { $Component++; } } - elsif ($All{"FitAsyType"} eq "SingleHist") { + elsif ($All{"FitAsyType"} eq "SingleHist" || $All{"FitAsyType"} eq "SingHistGLB") { # For a single histogram fit we basically need to repeat this for each hist foreach my $Hist (@Hists) { $Component=1; @@ -1482,14 +2006,13 @@ sub PrepParamTable { return %ParTable; } - +sub ExportParams { ######################## # ExportParams # Function return a tab separated table of parameters for the fit # input should be # %All ######################## -sub ExportParams { my $erradd = "d"; my $minadd = "_min"; my $maxadd = "_max"; @@ -1521,14 +2044,6 @@ sub ExportParams { my @Paramcomp = @$Paramcomp_ref; my $Full_T_Block= $All{"Full_T_Block"}; -# Extract parameter block form the MSR file -# my $FILENAME=$All{"FILENAME"}; -# open (MSRF,q{<},"$FILENAME.msr" ); -# my @lines = ; -# close(IFILE); -# my $FPBlock_ref=MSR::ExtractBlks(@lines); -# my @FPBloc = @$FPBlock_ref; - # Then loop over expected parameters and extract their values and error bar my $PCount =0; my $iRun =0; @@ -1588,7 +2103,7 @@ sub ExportParams { $Component++; } } - elsif ($All{"FitAsyType"} eq "SingleHist") { + elsif ($All{"FitAsyType"} eq "SingleHist" ) { # For a single histogram fit we basically need to repeat this for each hist foreach my $Hist (@Hists) { $Component=1; @@ -1640,13 +2155,13 @@ sub ExportParams { return $TABLE; } +sub MSR2Dat { ######################## # MSR2Dat # Function return a tab separated table of parameters from an MSR file # input should be # @msrfile ######################## -sub MSR2Dat { # Take the msr file as input array of lines my @file=@_; @@ -1731,7 +2246,7 @@ sub MSR2Dat { return $DatFile; } - +sub RUNFileNameAuto { ######################## # RUNFileNameAuto # Function return the RUN_Line for a given RUN @@ -1740,7 +2255,6 @@ sub MSR2Dat { # $YEAR is the year # $BeamLine in the name of beamline ######################## -sub RUNFileNameAuto { # Take this information as input arguments (my $RUN, my $YEAR, my $BeamLine) = @_; @@ -1827,11 +2341,11 @@ sub RUNFileNameAuto { return $RUN_Line; } +sub CreateRRFBlk { ######################## -# CreateRRFBlock +# CreateRRFBlk ######################## # This creates the RRF related lines, these are the same always -sub CreateRRFBlock { my %All = %{$_[0]}; @@ -1846,13 +2360,12 @@ sub CreateRRFBlock { return $RRFBlock; } - +sub ExtractInfo { ######################## # ExtractInfo ######################## # Used to extract information from data file header. The header (using # "dump_header" is sent to this function from musrfit.cgi or MuSRFit -sub ExtractInfo { my ($header,$Arg) = @_; my @lines = split(/\n/,$header); @@ -1863,7 +2376,7 @@ sub ExtractInfo { } elsif ( $Arg eq "Temp" ) { foreach my $line (@lines) { - if ( $line =~ /Mean Sample_CF1/ ) { + if ( $line =~ /Temp/ ) { ( my $tmp, my $T ) = split( /=/, $line ); ( $T, $tmp ) = split( /\(/, $T ); $RTRN_Val = $T; @@ -1894,12 +2407,11 @@ sub ExtractInfo { return $RTRN_Val; } - +sub ExtractInfoLEM { ######################## # ExtractInfoLEM ######################## # Uset to extract information from summary files -sub ExtractInfoLEM { my ($RUN,$YEAR,$Arg) = @_; # Use file header my $Summ_File_Name = "lem" . substr( $YEAR, 2 ) . "_" . $RUN . ".summ"; @@ -1946,8 +2458,8 @@ sub ExtractInfoLEM { return $RTRN_Val; } -# Uset to extract information from log files sub ExtractInfoBulk { +# Uset to extract information from log files my ($RUN,$AREA,$YEAR,$Arg) = @_; my $RUNtmp=sprintf("%04d",$RUN); $RUN=$RUNtmp; @@ -1978,638 +2490,113 @@ sub ExtractInfoBulk { return $RTRN_Val; } -# Subroutine to create a clean run block (Not finished yet) sub CreateRUNBlk { +# Subroutine to create a clean run block (Not finished or used yet) # Take this information as input arguments - (my $RUN, my $YEAR, my $BeamLine, my $Fit_Type, my $LRBF, my $Ti, my $Tf, my $BIN) = @_; + my ($RUN,$YEAR,$BeamLine,$FitAsyType,$LRBF,$Ti,$Tf,$BIN) = @_; +# $RUN is the run number +# $YEAR is the corresponding year +# $BeamLine is the corresponding beam line +# $FitAsyType is SH or Asy +# $LRBF are the histogram numbers +# $Ti, $Tf and $BIN are the corresponding initial/final time range and binning factor respectively my $RUN_Block = -"RUN_LINE -fittype FIT_TYPE -ALPHA_LINE -forward FHIST -backward BHIST -MAP_LINE -fit TIVAL TFVAL -packing BINNING +"#RUN_LINE +#fittype FIT_TYPE +#ALPHA_LINE +#HISTOLINES +#MAP_LINE +#T0LINE +#BGLINE +#DATALINE +#fit TIVAL TFVAL +#packing BINNING "; + # HISTOLINES is the only thing that significantly changes between SH and Asy + + # Prepare the RUN_LINE my $RUN_Line = MSR::RUNFileNameAuto($RUN,$YEAR,$BeamLine); + # Split the histograms my @Hists = split( /,/, $LRBF ); + $Fit_Type = 0; + if ($FitAsyType eq "Asymmetry" || $FitAsyType eq "AsyGLB") { + $Fit_Type = 2; + } $RUN_Block =~ s/RUN_LINE/$RUN_Line/; $RUN_Block =~ s/FIT_TYPE/$Fit_Type/; - $RUN_Block =~ s/FHIST/$Hists[0]/; - $RUN_Block =~ s/BHIST/$Hists[1]/; $RUN_Block =~ s/TIVAL TFVAL/$Ti $Tf/; $RUN_Block =~ s/BINNING/$BIN/; + my $HistLines = $EMPTY; + my $Run_Block_ORG = $RUN_Block; + $RUN_Block = $EMPTY; + if ($Fit_Type == 2) { + # Asymmetry fit + $HistLines = "forward $Hists[0]\n#backward $Hists[1]"; + $RUN_Block = $RUN_Block.$Run_Block_ORG."\n\n"; + $RUN_Block =~ s/HISTOLINES/$HistLines/; + } else { + # Single histogram fit + foreach my $Hist (@Hists) { + $HistLines = "forward $Hist"; + # Create multiple blocks with the same lines except for the histogram line + $RUN_Block = $RUN_Block.$Run_Block_ORG."\n\n"; + $RUN_Block =~ s/HISTOLINES/$HistLines/; + } + } + return $RUN_Block; } - -########################################################################## -# CreateMSRSh - to generate template file for msr2data global fit -# -# Input in %All -# Required: -# $All{"FitType1/2/3"} - Function types, 3 components -# $All{"LRBF"} - Histograms, comma separated -# $All{"Tis"} -# $All{"Tfs"} -# $All{"BINS"} -# $All{"FILENAME"} -# $All{"go"} -# $All{"TITLE"} -# $All{"RunNumbers"} -# $All{"FitAsyType"} -# $All{"BeamLine"} -# $All{"YEAR"} -# -# Optional: -# $All{"Sh_$Param"} -# $All{"ltc"} -# $All{"$Param"} value, error, min, and max -# $All{"logx/y"} -# $All{"Xi/f"} -# -# Output -# $Full_T_Block - Full theory block -# @Paramcomp - Space separated list of parameters for each component -# FILENAME.msr - MSR file saved -# -########################################################################## -sub CreateMSRSh { +sub CreateFFTBlk { my %All = %{$_[0]}; - - # Start with empty array - my @FitTypes = (); - - foreach ($All{"FitType1"},$All{"FitType2"},$All{"FitType3"}) { - if ($_ ne "None") { - @FitTypes=(@FitTypes,$_); - } - } - - my @Hists = split( /,/, $All{"LRBF"} ); - # TODO - # : to separate two sets of asymmetries with same parameters - # Check the number of histograms - # should be 2 or 4 histograms - # should be checked in GUI - # for 2 simple asymmetry fit - # for 4 two run blocks with different geometric parameters: - # Alpha, No, NBg, Phi, Asy - - my @TiVals = split( /,/, $All{"Tis"} ); - my @TfVals = split( /,/, $All{"Tfs"} ); - my @BINVals = split( /,/, $All{"BINS"} ); - my $FILENAME = $All{"FILENAME"}; - my $BeamLine = $All{"BeamLine"}; - my $YEAR = $All{"YEAR"}; - - my $Step = $All{"go"}; - if ( $Step eq "PLOT" ) { - $FITMINTYPE = $EMPTY; - } - elsif ( $Step eq "MIGRAD" ) { - $FITMINTYPE = "MINIMIZE\nMIGRAD\nHESSE"; - } - elsif ( $Step eq "MINOS" ) { - $FITMINTYPE = "MIGRAD\nMINOS"; - } - elsif ( $Step eq "SIMPLEX" ) { - $FITMINTYPE = "SCAN\nSIMPLEX"; - } - - # Proper way - if ( $All{"Minimization"} ne $EMPTY && $All{"ErrorCalc"} ne $EMPTY && $Step ne "PLOT" ) { - $FITMINTYPE = $All{"Minimization"}."\n".$All{"ErrorCalc"}; - } - - - # First create the THEORY Block - my ($Full_T_Block,$Paramcomp_ref)=MSR::CreateTheory(@FitTypes); - 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 of Params - my $PCount = 1; - - # Need to select here RUNSAuto or RUNSManual - # $RUNSType = 0 (Auto) or 1 (Manual) - my $RUNSType = 0; - my @RUNS=(); - if ($All{"RunNumbers"} ne $EMPTY) { - @RUNS=split( /,/, $All{"RunNumbers"}); - $RUNSType = 0; - } - elsif ($All{"RunFiles"} ne $EMPTY) { - @RUNS=split( /,/, $All{"RunFiles"}); - $RUNSType = 1; - } - - # $shcount is a counter for shared parameters - # msr2data \[1363 1365 1366\] _Dolly_2010 msr-1363 global - if ( $#RUNS == 0 ) { - my $shcount = 1; - } else { - if ( $All{"Sh_Alpha"} == 1 ) { - my $shcount = 1; - } else { - my $shcount = 0; - } - } - - $shcount = 1; - my $RUN_Block = $EMPTY; - my $RUNS_Line = $EMPTY; - - # range order - my $Range_Order = 1; - - # Create template from the first run - # Prepare the Parameters and initial values block - my $component = 0; - my $Single_RUN = $EMPTY; - - # Prepare map line for each run - my $MAP_Line = "map "; - - # How many non-shared parameter for this RUN? - my $nonsh = 0; - - # Prepeare Alpha line for the RUN block. Empty initially. - my $Alpha_Line = $EMPTY; - - # Loop over all components in the fit - foreach my $FitType (@FitTypes) { - ++$component; - my $Parameters = $Paramcomp[ $component - 1 ]; - my @Params = split( /\s+/, $Parameters ); - - # For the first component we need Alpha for Asymmetry fits - if ($component == 1) { - unshift( @Params, "Alpha" ); - } - - foreach $Param (@Params) { - $Param_ORG = $Param; - if ( ($#FitTypes != 0) && ($Param ne "Alpha") ) { - $Param = join( $EMPTY, $Param, "_", "$component" ); - } - - # If we have only one RUN then everything is shared - if ( $#RUNS == 0 ) { - $Shared = 1; - } - # Otherwise check input if it was marked as shared - else { - $Shared = $All{"Sh_$Param"}; - } - - # Alpha Line - # - # If you encounter alpha in the parameters list make sure - # to fill this line for the RUN block. - if ( $Param_ORG eq "Alpha" ) { - if ($Shared) { - # If alpha is shared use always the same line - $Alpha_Line = "alpha 1\n"; - } - else { - # Otherwise modify alpha line accordingly - $Alpha_Line = "alpha $PCount\n"; - } - } - - # End of Alpha Line -#################################################################################################### - - # Start preparing the parameters block - if ($Shared) { - - # Parameter is shared enough to keep order from first run - $Full_T_Block =~ s/$Param_ORG/$PCount/; - ++$shcount; - ++$PCount; - } else { - # Parameter is not shared, use map unless it is a single RUN fit - # Skip adding to map line in these cases - if ( $Param ne "Alpha" && $#RUNS != 0 ) - { - ++$nonsh; - $Full_T_Block =~ s/$Param_ORG/map$nonsh/; - $MAP_Line = join( ' ', $MAP_Line, $PCount ); - } - ++$PCount; - } - $NtotPar = $PCount; - } - } - - # Finished preparing the FITPARAMETERS block -####################################################################### - - # For each defined range we need a block in the RUN-Block - # Also for each histogram in Single Histograms fits - # Also for Imaginaryand and Real for RRF fits - - $RUN = $RUNS[0]; - - if ($All{"RUNSType"}) { - $RUN_Line = MSR::RUNFileNameAuto($RUN,"0000",$EMPTY); - } else { - $RUN_Line = MSR::RUNFileNameAuto($RUN,$YEAR,$BeamLine); - } - - $Type_Line = "fittype 2"; - $PLT = 2; - $Hist_Lines = - "forward $Hists[0]\nbackward $Hists[1]"; - - $Bg_Line = "background"; - $Data_Line = "data"; - $T0_Line = "t0"; - $NHist=1; - foreach $Hist (@Hists) { - foreach ("t0","Bg1","Bg2","Data1","Data2") { - $Name = "$_$NHist"; -# If empty fill with defaults -# if ($All{$Name} eq $EMPTY) { -# $All{$Name}=MSR::T0BgData($_,$Hist,$BeamLine); -# } - } -# If empty skip lines - if ($All{"Bg1$NHist"} ne $EMPTY && $All{"Bg2$NHist"} ne $EMPTY) { - $Bg_Line = $Bg_Line." ".$All{"Bg1$NHist"}." ".$All{"Bg2$NHist"}; - } - if ($All{"Data1$NHist"} ne $EMPTY && $All{"Data2$NHist"} ne $EMPTY) { - $Data_Line =$Data_Line." ".$All{"Data1$NHist"}." ".$All{"Data2$NHist"}; - } - if ($All{"t0$NHist"} ne $EMPTY) { - $T0_Line=$T0_Line." ".$All{"t0$NHist"}; - } - $NHist++; - } - -# Put T0_Line Bg_Line and Data_Line together if not empty - my $T0DataBg=$EMPTY; - if ($T0_Line ne "t0") { - $T0DataBg = $T0DataBg.$T0_Line."\n"; - } - if ($Bg_Line ne "background") { - $T0DataBg = $T0DataBg.$Bg_Line."\n"; - } - if ($Data_Line ne "data") { - $T0DataBg = $T0DataBg.$Data_Line."\n"; - } - - $FRANGE_Line = "fit TINI TFIN"; - $PAC_Line = "packing BINNING"; - - $Single_RUN = - "$RUN_Line\n$Type_Line\n$Alpha_Line$Hist_Lines\n$T0DataBg$MAP_Line\n$FRANGE_Line\n$PAC_Line\n\n"; - - # Now add the appropriate values of fit range and packing - my $Range_Min = 8; - my $Range_Max = 0; - my $k = 0; - foreach my $Ti (@TiVals) { - my $Tf = $TfVals[$k]; - my $BIN = $BINVals[$k]; - $RUN_Block = $RUN_Block . $Single_RUN; - $RUN_Block =~ s/TINI/$Ti/g; - $RUN_Block =~ s/TFIN/$Tf/g; - $RUN_Block =~ s/BINNING/$BIN/g; - - # For multiple ranges use this - if ( $Ti < $Range_Min ) { $Range_Min = $Ti; } - if ( $Tf > $Range_Max ) { $Range_Max = $Tf; } - - $RUNS_Line = "$RUNS_Line " . $Range_Order; - ++$k; - ++$Range_Order; - } - -# For the plotting command of multiple runs - foreach $RUN (@RUNS) { - foreach $Ti (@TiVals) { - $RUNS_Line = "$RUNS_Line " . $Range_Order; - ++$Range_Order; - } - } - -# Start constructing all blocks - my $TitleLine = $All{"TITLE"}."\n# Run Numbers: ".$All{"RunNumbers"}; -# $TitleLine =~ s/\n//g; - - # Get parameter block from MSR::PrepParamTable(\%All); - my $FitParaBlk = -"############################################################### -FITPARAMETER -############################################################### -# No Name Value Err Min Max "; - my %PTable=MSR::PrepParamTable(\%All); - my $NParam=scalar keys( %PTable ); -# Fill the table with labels and values of parametr - for (my $iP=0;$iP<$NParam;$iP++) { - my ($Param,$value,$error,$minvalue,$maxvalue,$RUNtmp) = split(/,/,$PTable{$iP}); - if ( $minvalue == $maxvalue ) { - $minvalue = $EMPTY; - $maxvalue = $EMPTY; - } - $PCount=$iP+1; - $FitParaBlk = $FitParaBlk." - $PCount $Param $value $error $error $minvalue $maxvalue"; - } - - $Full_T_Block = " -############################################################### -THEORY -############################################################### -$Full_T_Block -"; - - - $RUN_Block = - "############################################################### -$RUN_Block"; - - $COMMANDS_Block = - "############################################################### -COMMANDS -FITMINTYPE -SAVE -"; - $COMMANDS_Block =~ s/FITMINTYPE/$FITMINTYPE/g; - - # Check if log x and log y are selected - my $logxy = $EMPTY; - if ( $All{"logx"} eq "y" ) { $logxy = $logxy . "logx\n"; } - if ( $All{"logy"} eq "y" ) { $logxy = $logxy . "logy\n"; } - - # Check if a plot range is defined (i.e. different from fit) - $PRANGE_Line = "use_fit_ranges"; - if ( $All{"Xi"} != $All{"Xf"} ) { - if ($All{"Yi"} != $All{"Yf"}) { - $PRANGE_Line = "range ".$All{"Xi"}." ".$All{"Xf"}." ".$All{"Yi"}." ".$All{"Yf"}; - } else { - $PRANGE_Line = "range ".$All{"Xi"}." ".$All{"Xf"}; - } - } - - $VIEWBIN_Line =""; - if ( $All{"ViewBin"}!=0 ) { $VIEWBIN_Line = "view_packing ".$All{"ViewBin"};} - - my $RRFBlock=MSR::CreateRRFBlock(\%All); - $PLOT_Block = - "############################################################### -PLOT $PLT -runs $RUNS_Line -$PRANGE_Line -$VIEWBIN_Line -$RRFBlock -$logxy"; - if ($All{"FUNITS"} eq $EMPTY) {$All{"FUNITS"}="MHz";} if ($All{"FAPODIZATION"} eq $EMPTY) {$All{"FAPODIZATION"}="STRONG";} if ($All{"FPLOT"} eq $EMPTY) {$All{"FPLOT"}="POWER";} if ($All{"FPHASE"} eq $EMPTY) {$All{"FPHASE"}="8.5";} + my $FrqRange = $EMPTY; + if ($All{"FRQMAX"} ne $EMPTY && $All{"FRQMIN"} ne $EMPTY && $All{"FRQMAX"} ne $All{"FRQMIN"}) { + $FrqRange = "range ".$All{"FRQMIN"}." ".$All{"FRQMAX"}; + } - - $FOURIER_Block= - "############################################################### -FOURIER + my $FOURIER_Block="FOURIER units FUNITS # units either 'Gauss', 'MHz', or 'Mc/s' fourier_power 12 apodization FAPODIZATION # NONE, WEAK, MEDIUM, STRONG plot FPLOT # REAL, IMAG, REAL_AND_IMAG, POWER, PHASE phase FPHASE -#range FRQMIN FRQMAX"; +FRQRANGE"; $FOURIER_Block=~ s/FUNITS/$All{"FUNITS"}/g; $FOURIER_Block=~ s/FAPODIZATION/$All{"FAPODIZATION"}/g; $FOURIER_Block=~ s/FPLOT/$All{"FPLOT"}/g; $FOURIER_Block=~ s/FPHASE/$All{"FPHASE"}/g; + $FOURIER_Block=~ s/FRQRANGE/$FrqRange/g; - # Don't know why but it is needed initially - $STAT_Block = - "############################################################### -STATISTIC --- 0000-00-00 00:00:00 -*** FIT DID NOT CONVERGE ***"; - - - # Empty line at the end of each block - my $FullMSRFile = "$TitleLine$FitParaBlk\n$Full_T_Block\n$FUNCTIONS_Block\n$RUN_Block\n$COMMANDS_Block\n$PLOT_Block\n$FOURIER_Block\n$STAT_Block\n"; - -# Return information and file - return($Full_T_Block,\@Paramcomp,$FullMSRFile); + return $FOURIER_Block; } -######################## -# PrepParamTableSh - Prepare fir parameters block for global fit using msr2data -# Function return a Hash with a table of parameters for the fit -# input should be -# %All -######################## -sub PrepParamTableSh { -# Take this information as input arguments -# "Smart" default value of the fit parameters. - my %Defaults = ( - "Asy", "0.15", "dAsy", "0.01", - "Asy_min", "0", "Asy_max", "0", - "Alpha", "1.0", "dAlpha", "0.01", - "Alpha_min", "0", "Alpha_max", "0", - "No", "300.0", "dNo", "0.01", - "No_min", "0", "No_max", "0", - "NBg", "30.0", "dNBg", "0.01", - "NBg_min", "0", "NBg_max", "0", - "Lam", "1.0", "dLam", "0.01", - "Lam_min", "0", "Lam_max", "0", - "Gam", "1.0", "dGam", "0.01", - "Gam_min", "0", "Gam_max", "0", - "Bet", "0.5", "dBet", "0.01", - "Bet_min", "0", "Bet_max", "0", - "Two", "2.0", "dTwo", "0.0", - "Two_min", "0", "Two_max", "0", - "Del", "0.1", "dDel", "0.01", - "Del_min", "0", "Del_max", "0", - "Sgm", "0.1", "dSgm", "0.01", - "Sgm_min", "0", "Sgm_max", "0", - "Aa", "60.", "dAa", "0.01", - "Aa_min", "0", "Aa_max", "0", - "q", "0.1", "dq", "0.01", - "q_min", "0", "q_max", "0", - "Bg", "0.036", "dBg", "0.01", - "Bg_min", "0", "Bg_max", "0", - "bgrlx", "0.", "dbgrlx", "0.0", - "bgrlx_min", "0", "bgrlx_max", "0", - "Frq", "1.0", "dFrq", "1.", - "Frq_min", "0", "Frq_max", "0", - "Field", "100.0", "dField", "1.", - "Field_min", "0", "Field_max", "0", - "Energy", "14.1", "dEnergy", "0.", - "Energy_min", "0", "Energy_max", "0", - "DeadLayer", "10.", "dDeadLayer", "0.1", - "DeadLayer_min", "0", "DeadLayer_max", "0", - "Lambda", "128.1", "dLambda", "0.1", - "Lambda_min", "0", "Lambda_max", "0", - "Phi", "1.", "dPhi", "0.01", - "Phi_min", "0", "Phi_max", "0" - ); - - my $erradd = "d"; - my $minadd = "_min"; - my $maxadd = "_max"; - -# First assume nothing is shared - my $Shared = 0; - -# Reset output Hash - %ParTable = (); - - my %All = %{$_[0]}; - my @RUNS = (); - if ($All{"RUNSType"}) { - @RUNS = split( /,/, $All{"RunFiles"} ); - } else { - @RUNS = split( /,/, $All{"RunNumbers"} ); +sub ExpandRunNumbers { +# Subroutine to conver hyphens in the RunNumbers into a series of comma separated runs + my ($RunNumbers) = @_; + # Split by commas + @RUNS=split( /,/, $RunNumbers); + # Find array members that include a hyphen (-) + my @RUNseries = grep { /\-/ } @RUNS; + foreach my $tmp (@RUNseries) { + # Each item that includes a hyphen is expanded as from-to array + my ($Begin,$End)=split('-',$tmp); + my @Series = ($Begin..$End); + # Join the expanded series using commas + my $RunJoined = join(',',@Series); + # Replace the original hyphens by the expanded series + $RunNumbers =~ s/$tmp/$RunJoined/; } - my @Hists = split( /,/, $All{"LRBF"} ); - - my @FitTypes =(); - foreach my $FitType ($All{"FitType1"}, $All{"FitType2"}, $All{"FitType3"}) { - if ( $FitType ne "None" ) { push( @FitTypes, $FitType ); } - } -# Get theory block 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 $PCount =0; - my $value =0; - my $error = 0; - my $minvalue = 0; - my $maxvalue = 0; - my $Component=1; - - $Component=1; - if ($All{"FitAsyType"} eq "Asymmetry") { - foreach my $FitType (@FitTypes) { - my $Parameters=$Paramcomp[$Component-1]; - my @Params = split( /\s+/, $Parameters ); - if ( $Component == 1 ) { - unshift( @Params, "Alpha" ); - } - -# This is the counter for parameters of this component - my $NP=1; - $Shared = 0; -# Change state/label of parameters - foreach my $Param (@Params) { - my $Param_ORG = $Param; - if ( $#FitTypes != 0 && ( $Param ne "Alpha" ) ){ - $Param = join( $EMPTY, $Param, "_", "$Component" ); - } - - $Shared = $All{"Sh_$Param"}; -# It there are multiple runs index the parameters accordingly - my $RUNtmp=sprintf("%04d",$RUN); - if ($Shared!=1) { - $Param=$Param."_".$RUNtmp; - } -# Check if this parameter has been initialized befor. If not take from defaults - $value = $All{"$Param"}; - if ( $value ne $EMPTY ) { - $error = $All{"$erradd$Param"}; - $minvalue = $All{"$Param$minadd"}; - $maxvalue = $All{"$Param$maxadd"}; - } else { -# We have two options here, either take default values or take values of previous -# run if available - $value = $Defaults{$Param_ORG}; - $error = $Defaults{ join( $EMPTY, $erradd, $Param_ORG ) }; - $minvalue = $Defaults{ join($EMPTY, $Param_ORG, $minadd ) }; - $maxvalue = $Defaults{ join($EMPTY, $Param_ORG, $maxadd ) }; - } - $values=join(",",$Param,$value,$error,$minvalue,$maxvalue,$RUN); - $ParTable{$PCount}=$values; - $PCount++; - } - $NP++; - } - $Component++; - } - elsif ($All{"FitAsyType"} eq "SingleHist") { -# For a single histogram fit we basically need to repeat this for each hist - foreach my $Hist (@Hists) { - $Component=1; - foreach my $FitType (@FitTypes) { - my $Parameters=$Paramcomp[$Component-1]; - my @Params = split( /\s+/, $Parameters ); - if ( $Component == 1 ) { - unshift( @Params, ( "No", "NBg" ) ); - } - -# This is the counter for parameters of this component - my $NP=1; - $Shared = 0; -# Change state/label of parameters - foreach my $Param (@Params) { - my $Param_ORG = $Param; - # If multiple histograms (sum or difference) take the first histogram only - ($Hist,$tmp) = split(/ /,$Hist); - $Param=$Param.$Hist; - if ( $#FitTypes != 0 && ( $Param_ORG ne "No" && $Param_ORG ne "NBg" ) ){ - $Param = join( $EMPTY, $Param, "_", "$Component" ); - } - - $Shared = $All{"Sh_$Param"}; -# It there are multiple runs index the parameters accordingly - my $RUNtmp=sprintf("%04d",$RUN); - if ($Shared!=1) {$Param=$Param."_".$RUNtmp;} -# Check if this parameter has been initialized befor. If not take from defaults - $value = $All{"$Param"}; - if ( $value ne $EMPTY ) { - $error = $All{"$erradd$Param"}; - $minvalue = $All{"$Param$minadd"}; - $maxvalue = $All{"$Param$maxadd"}; - } else { -# I need this although it is already in the MSR.pm module, just for this table -# We can remove it from the MSR module later... -# Or keep in the MSR as function ?? - $value = $Defaults{$Param_ORG}; - $error = $Defaults{ join( $EMPTY, $erradd, $Param_ORG ) }; - $minvalue = $Defaults{ join($EMPTY, $Param_ORG, $minadd ) }; - $maxvalue = $Defaults{ join($EMPTY, $Param_ORG, $maxadd ) }; - } - $values=join(",",$Param,$value,$error,$minvalue,$maxvalue,$RUN); - $ParTable{$PCount}=$values; - $PCount++; - } - $NP++; - } - $Component++; - } - } - return %ParTable; + return $RunNumbers; } 1; diff --git a/src/external/MuSRFitGUI/MuSRFit4.pm b/src/external/MuSRFitGUI/MuSRFit4.pm index 2bb46742..a589f149 100644 --- a/src/external/MuSRFitGUI/MuSRFit4.pm +++ b/src/external/MuSRFitGUI/MuSRFit4.pm @@ -278,14 +278,17 @@ sub CreateAllInput() $All{"Tfs"} = this->{ui}->tfs->text; $All{"BINS"} = this->{ui}->bins->text; $All{"FitAsyType"} = this->{ui}->fitAsyType->currentText; + $All{"FitAsyType"} =~ s/ //g; $All{"LRBF"} = this->{ui}->histsLRBF->text; my @Hists = split(/,/, $All{"LRBF"} ); # Lifetime corrections in enabled/visible only for SingleHis fits if ( $All{"FitAsyType"} eq "Asymmetry" ) { this->{ui}->ltc->setHidden(1); + $All{"fittype"}=2; } elsif ( $All{"FitAsyType"} eq "SingleHist" ) { this->{ui}->ltc->setHidden(0); + $All{"fittype"}=0; } # From Fitting Tab @@ -313,13 +316,16 @@ sub CreateAllInput() $All{"ErrorCalc"} = this->{ui}->errorCalc->currentText(); $All{"go"}=$All{"ErrorCalc"}; +# Commands block + $All{"CommandsBlock"}= $All{"Minimization"}."\n".$All{"ErrorCalc"}; + RunSelectionToggle(); my @RUNS = (); if ($All{"RUNSType"} ) { @RUNS = split( /,/, $All{"RunFiles"}); } else { $All{"RunNumbers"} =~ s/[\ \.\~\/\&\*\[\;\>\<\^\$\(\)\`\|\]\'\@]/,/g; - @RUNS = split( /,/, $All{"RunNumbers"} ); + @RUNS = split( /,/, MSR::ExpandRunNumbers($All{"RunNumbers"}) ); } # From MSR File Tab @@ -534,13 +540,11 @@ sub CallMSRCreate() print OUTF ("$FullMSRFile"); close(OUTF); } else { -# my ($Full_T_Block,$Paramcomp_ref,$FullMSRFile)= MSR::CreateMSRSh(\%All); my ($Full_T_Block,$Paramcomp_ref,$FullMSRFile)= MSR::CreateMSR(\%All); # Open output file FILENAME.msr open( OUTF,q{>},"$FILENAME" ); print OUTF ("$FullMSRFile"); close(OUTF); - # if it is multiple runs then the produced file is a template my $FILENAME=$All{"FILENAME"}.".msr"; my $Extension = "_".$All{"BeamLine"}."_".$All{"YEAR"}; @@ -674,7 +678,7 @@ sub ActivateT0Hists() sub ActivateShComp() { my %All=CreateAllInput(); - my @RUNS = split( /,/, $All{"RunNumbers"} ); + my @RUNS = split( /,/, MSR::ExpandRunNumbers($All{"RunNumbers"}) ); # Hide all sharing components this->{ui}->sharingComp1->setHidden(1); @@ -906,9 +910,9 @@ sub t0Update() foreach ("t0","Bg1","Bg2","Data1","Data2") { my $Name = "$_$NHist"; my $tmp=MSR::T0BgData($_,$Hist,$All{"BeamLine"}); - if (defined(child("Qt::Widget",$Name))) { - child("Qt::Widget",$Name)->setText($tmp); - } +# if (defined(child("Qt::Widget",$Name))) { +# child("Qt::Widget",$Name)->setText($tmp); +# } } $NHist++ } @@ -986,7 +990,7 @@ sub AppendToFunctions() sub InitializeFunctions() { my %All=CreateAllInput(); - my @RUNS = split( /,/, $All{"RunNumbers"} ); + my @RUNS = split( /,/, MSR::ExpandRunNumbers($All{"RunNumbers"}) ); my @FitTypes =(); foreach my $FitType ($All{"FitType1"}, $All{"FitType2"}, $All{"FitType3"}) { diff --git a/src/external/MuSRFitGUI/MuSRFit4.ui b/src/external/MuSRFitGUI/MuSRFit4.ui index d6b8805e..a8ce1a1e 100644 --- a/src/external/MuSRFitGUI/MuSRFit4.ui +++ b/src/external/MuSRFitGUI/MuSRFit4.ui @@ -6,8 +6,8 @@ 0 0 - 600 - 505 + 674 + 541 @@ -236,7 +236,17 @@ - SingleHist + Single Hist + + + + + Asymmetry GLB + + + + + Single Hist GLB @@ -303,7 +313,7 @@ - + 1 1 @@ -311,7 +321,7 @@ 0 - 80 + 100 @@ -323,6 +333,15 @@ + + QLayout::SetDefaultConstraint + + + 0 + + + 0 + 0 @@ -360,119 +379,6 @@ - - - - - 0 - 0 - - - - - 0 - 20 - - - - Year - - - false - - - - - - - - 0 - 0 - - - - - 0 - 20 - - - - - 16777215 - 30 - - - - On beam line - - - false - - - - - - - - 0 - 0 - - - - - 0 - 20 - - - - - 16777215 - 25 - - - - - LEM - - - - - GPS - - - - - Dolly - - - - - LTF - - - - - LEM (PPC) - - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 181 - 21 - - - - @@ -507,6 +413,129 @@ + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 181 + 21 + + + + + + + + + 0 + 0 + + + + + 0 + 20 + + + + + 16777215 + 25 + + + + + LEM + + + + + GPD + + + + + HAL + + + + + GPS + + + + + Dolly + + + + + LTF + + + + + LEM (PPC) + + + + + + + + + 0 + 0 + + + + + 0 + 20 + + + + Year + + + false + + + + + + + + 0 + 0 + + + + + 0 + 30 + + + + + 16777215 + 30 + + + + On beam line + + + false + + + @@ -3488,7 +3517,7 @@ 10 18 265 - 100 + 107 @@ -5412,8 +5441,8 @@ 0 0 - 600 - 20 + 674 + 27 diff --git a/src/external/MuSRFitGUI/Ui_MuSRFit4.pm b/src/external/MuSRFitGUI/Ui_MuSRFit4.pm index 8a0fe95f..4ac83c51 100644 --- a/src/external/MuSRFitGUI/Ui_MuSRFit4.pm +++ b/src/external/MuSRFitGUI/Ui_MuSRFit4.pm @@ -5,8 +5,8 @@ ################################################################################# ## Form generated from reading UI file 'MuSRFit4.ui' ## -## Created: Thu Mar 23 16:58:52 2017 -## by: Qt User Interface Compiler version 4.8.6 +## Created: Mon Jan 29 14:11:03 2018 +## by: Qt User Interface Compiler version 4.8.7 ## ## WARNING! All changes made in this file will be lost when recompiling UI file! ################################################################################ @@ -162,24 +162,24 @@ sub year { return shift->{year}; } -sub yearLabel { - return shift->{yearLabel}; -} - -sub beamLineLabel { - return shift->{beamLineLabel}; -} - -sub beamLine { - return shift->{beamLine}; +sub runNumbers { + return shift->{runNumbers}; } sub spacer2 { return shift->{spacer2}; } -sub runNumbers { - return shift->{runNumbers}; +sub beamLine { + return shift->{beamLine}; +} + +sub yearLabel { + return shift->{yearLabel}; +} + +sub beamLineLabel { + return shift->{beamLineLabel}; } sub groupBox { @@ -993,7 +993,7 @@ sub setupUi { if ( !defined $muSRFit4->objectName() ) { $muSRFit4->setObjectName( "muSRFit4" ); } - $muSRFit4->resize( 600, 505 ); + $muSRFit4->resize( 674, 541 ); my $sizePolicy = Qt::SizePolicy( Qt::SizePolicy::Expanding(), Qt::SizePolicy::Expanding() ); $self->{$sizePolicy} = $sizePolicy; $sizePolicy->setHorizontalStretch( 1 ); @@ -1219,9 +1219,13 @@ sub setupUi { my $runsAuto = Qt::GroupBox( $runsPage ); $self->{runsAuto} = $runsAuto; $runsAuto->setObjectName( "runsAuto" ); - $sizePolicy->setHeightForWidth( $runsAuto->sizePolicy()->hasHeightForWidth() ); - $runsAuto->setSizePolicy( $sizePolicy ); - $runsAuto->setMinimumSize( Qt::Size(0, 80) ); + my $sizePolicy4 = Qt::SizePolicy( Qt::SizePolicy::Expanding(), Qt::SizePolicy::Maximum() ); + $self->{$sizePolicy4} = $sizePolicy4; + $sizePolicy4->setHorizontalStretch( 1 ); + $sizePolicy4->setVerticalStretch( 1 ); + $sizePolicy4->setHeightForWidth( $runsAuto->sizePolicy()->hasHeightForWidth() ); + $runsAuto->setSizePolicy( $sizePolicy4 ); + $runsAuto->setMinimumSize( Qt::Size(0, 100) ); $runsAuto->setAlignment( Qt::AlignHCenter()|Qt::AlignTop() ); my $gridLayout_3 = Qt::GridLayout( $runsAuto ); $self->{gridLayout_3} = $gridLayout_3; @@ -1232,6 +1236,8 @@ sub setupUi { $self->{runNumbers_2} = $runNumbers_2; $runNumbers_2->setSpacing( 0 ); $runNumbers_2->setObjectName( "runNumbers_2" ); + $runNumbers_2->setSizeConstraint( Qt::Layout::SetDefaultConstraint() ); + $runNumbers_2->setContentsMargins(-1, 0, -1, 0 ); my $year = Qt::ComboBox( $runsAuto ); $self->{year} = $year; $year->setObjectName( "year" ); @@ -1246,45 +1252,6 @@ sub setupUi { $runNumbers_2->addWidget( $year, 1, 4, 1, 1 ); - my $yearLabel = Qt::Label( $runsAuto ); - $self->{yearLabel} = $yearLabel; - $yearLabel->setObjectName( "yearLabel" ); - my $sizePolicy4 = Qt::SizePolicy( Qt::SizePolicy::Preferred(), Qt::SizePolicy::Preferred() ); - $self->{$sizePolicy4} = $sizePolicy4; - $sizePolicy4->setHorizontalStretch( 0 ); - $sizePolicy4->setVerticalStretch( 0 ); - $sizePolicy4->setHeightForWidth( $yearLabel->sizePolicy()->hasHeightForWidth() ); - $yearLabel->setSizePolicy( $sizePolicy4 ); - $yearLabel->setMinimumSize( Qt::Size(0, 20) ); - $yearLabel->setWordWrap( 0 ); - - $runNumbers_2->addWidget( $yearLabel, 1, 3, 1, 1 ); - - my $beamLineLabel = Qt::Label( $runsAuto ); - $self->{beamLineLabel} = $beamLineLabel; - $beamLineLabel->setObjectName( "beamLineLabel" ); - $sizePolicy4->setHeightForWidth( $beamLineLabel->sizePolicy()->hasHeightForWidth() ); - $beamLineLabel->setSizePolicy( $sizePolicy4 ); - $beamLineLabel->setMinimumSize( Qt::Size(0, 20) ); - $beamLineLabel->setMaximumSize( Qt::Size(16777215, 30) ); - $beamLineLabel->setWordWrap( 0 ); - - $runNumbers_2->addWidget( $beamLineLabel, 1, 1, 1, 1 ); - - my $beamLine = Qt::ComboBox( $runsAuto ); - $self->{beamLine} = $beamLine; - $beamLine->setObjectName( "beamLine" ); - $sizePolicy2->setHeightForWidth( $beamLine->sizePolicy()->hasHeightForWidth() ); - $beamLine->setSizePolicy( $sizePolicy2 ); - $beamLine->setMinimumSize( Qt::Size(0, 20) ); - $beamLine->setMaximumSize( Qt::Size(16777215, 25) ); - - $runNumbers_2->addWidget( $beamLine, 1, 2, 1, 1 ); - - my $spacer2 = Qt::SpacerItem( 181, 21, Qt::SizePolicy::Expanding(), Qt::SizePolicy::Minimum() ); - - $runNumbers_2->addItem( $spacer2, 1, 0, 1, 1 ); - my $runNumbers = Qt::LineEdit( $runsAuto ); $self->{runNumbers} = $runNumbers; $runNumbers->setObjectName( "runNumbers" ); @@ -1296,6 +1263,45 @@ sub setupUi { $runNumbers_2->addWidget( $runNumbers, 0, 0, 1, 5 ); + my $spacer2 = Qt::SpacerItem( 181, 21, Qt::SizePolicy::Expanding(), Qt::SizePolicy::Minimum() ); + + $runNumbers_2->addItem( $spacer2, 1, 0, 1, 1 ); + + my $beamLine = Qt::ComboBox( $runsAuto ); + $self->{beamLine} = $beamLine; + $beamLine->setObjectName( "beamLine" ); + $sizePolicy2->setHeightForWidth( $beamLine->sizePolicy()->hasHeightForWidth() ); + $beamLine->setSizePolicy( $sizePolicy2 ); + $beamLine->setMinimumSize( Qt::Size(0, 20) ); + $beamLine->setMaximumSize( Qt::Size(16777215, 25) ); + + $runNumbers_2->addWidget( $beamLine, 1, 2, 1, 1 ); + + my $yearLabel = Qt::Label( $runsAuto ); + $self->{yearLabel} = $yearLabel; + $yearLabel->setObjectName( "yearLabel" ); + my $sizePolicy5 = Qt::SizePolicy( Qt::SizePolicy::Preferred(), Qt::SizePolicy::Preferred() ); + $self->{$sizePolicy5} = $sizePolicy5; + $sizePolicy5->setHorizontalStretch( 0 ); + $sizePolicy5->setVerticalStretch( 0 ); + $sizePolicy5->setHeightForWidth( $yearLabel->sizePolicy()->hasHeightForWidth() ); + $yearLabel->setSizePolicy( $sizePolicy5 ); + $yearLabel->setMinimumSize( Qt::Size(0, 20) ); + $yearLabel->setWordWrap( 0 ); + + $runNumbers_2->addWidget( $yearLabel, 1, 3, 1, 1 ); + + my $beamLineLabel = Qt::Label( $runsAuto ); + $self->{beamLineLabel} = $beamLineLabel; + $beamLineLabel->setObjectName( "beamLineLabel" ); + $sizePolicy5->setHeightForWidth( $beamLineLabel->sizePolicy()->hasHeightForWidth() ); + $beamLineLabel->setSizePolicy( $sizePolicy5 ); + $beamLineLabel->setMinimumSize( Qt::Size(0, 30) ); + $beamLineLabel->setMaximumSize( Qt::Size(16777215, 30) ); + $beamLineLabel->setWordWrap( 0 ); + + $runNumbers_2->addWidget( $beamLineLabel, 1, 1, 1, 1 ); + $gridLayout_3->addLayout( $runNumbers_2, 0, 0, 1, 1 ); @@ -1305,12 +1311,12 @@ sub setupUi { my $groupBox = Qt::GroupBox( $runsPage ); $self->{groupBox} = $groupBox; $groupBox->setObjectName( "groupBox" ); - my $sizePolicy5 = Qt::SizePolicy( Qt::SizePolicy::Expanding(), Qt::SizePolicy::Expanding() ); - $self->{$sizePolicy5} = $sizePolicy5; - $sizePolicy5->setHorizontalStretch( 0 ); - $sizePolicy5->setVerticalStretch( 0 ); - $sizePolicy5->setHeightForWidth( $groupBox->sizePolicy()->hasHeightForWidth() ); - $groupBox->setSizePolicy( $sizePolicy5 ); + my $sizePolicy6 = Qt::SizePolicy( Qt::SizePolicy::Expanding(), Qt::SizePolicy::Expanding() ); + $self->{$sizePolicy6} = $sizePolicy6; + $sizePolicy6->setHorizontalStretch( 0 ); + $sizePolicy6->setVerticalStretch( 0 ); + $sizePolicy6->setHeightForWidth( $groupBox->sizePolicy()->hasHeightForWidth() ); + $groupBox->setSizePolicy( $sizePolicy6 ); $groupBox->setMinimumSize( Qt::Size(0, 220) ); $groupBox->setBaseSize( Qt::Size(0, 0) ); my $gridLayout_8 = Qt::GridLayout( $groupBox ); @@ -1761,8 +1767,8 @@ sub setupUi { my $buttonGroupSharing = Qt::GroupBox( $sharingPage ); $self->{buttonGroupSharing} = $buttonGroupSharing; $buttonGroupSharing->setObjectName( "buttonGroupSharing" ); - $sizePolicy5->setHeightForWidth( $buttonGroupSharing->sizePolicy()->hasHeightForWidth() ); - $buttonGroupSharing->setSizePolicy( $sizePolicy5 ); + $sizePolicy6->setHeightForWidth( $buttonGroupSharing->sizePolicy()->hasHeightForWidth() ); + $buttonGroupSharing->setSizePolicy( $sizePolicy6 ); $buttonGroupSharing->setAlignment( Qt::AlignLeading() ); $buttonGroupSharing->setCheckable( 1 ); $buttonGroupSharing->setChecked( 0 ); @@ -1779,12 +1785,12 @@ sub setupUi { $self->{sharingComp1} = $sharingComp1; $sharingComp1->setObjectName( "sharingComp1" ); $sharingComp1->setEnabled( 0 ); - my $sizePolicy6 = Qt::SizePolicy( Qt::SizePolicy::Expanding(), Qt::SizePolicy::MinimumExpanding() ); - $self->{$sizePolicy6} = $sizePolicy6; - $sizePolicy6->setHorizontalStretch( 0 ); - $sizePolicy6->setVerticalStretch( 0 ); - $sizePolicy6->setHeightForWidth( $sharingComp1->sizePolicy()->hasHeightForWidth() ); - $sharingComp1->setSizePolicy( $sizePolicy6 ); + my $sizePolicy7 = Qt::SizePolicy( Qt::SizePolicy::Expanding(), Qt::SizePolicy::MinimumExpanding() ); + $self->{$sizePolicy7} = $sizePolicy7; + $sizePolicy7->setHorizontalStretch( 0 ); + $sizePolicy7->setVerticalStretch( 0 ); + $sizePolicy7->setHeightForWidth( $sharingComp1->sizePolicy()->hasHeightForWidth() ); + $sharingComp1->setSizePolicy( $sizePolicy7 ); $sharingComp1->setAlignment( Qt::AlignLeading() ); my $layout14 = Qt::Widget( $sharingComp1 ); $self->{layout14} = $layout14; @@ -1872,8 +1878,8 @@ sub setupUi { $self->{sharingComp2} = $sharingComp2; $sharingComp2->setObjectName( "sharingComp2" ); $sharingComp2->setEnabled( 0 ); - $sizePolicy6->setHeightForWidth( $sharingComp2->sizePolicy()->hasHeightForWidth() ); - $sharingComp2->setSizePolicy( $sizePolicy6 ); + $sizePolicy7->setHeightForWidth( $sharingComp2->sizePolicy()->hasHeightForWidth() ); + $sharingComp2->setSizePolicy( $sizePolicy7 ); my $comp2ShLabel = Qt::Label( $sharingComp2 ); $self->{comp2ShLabel} = $comp2ShLabel; $comp2ShLabel->setObjectName( "comp2ShLabel" ); @@ -1958,8 +1964,8 @@ sub setupUi { $self->{sharingComp3} = $sharingComp3; $sharingComp3->setObjectName( "sharingComp3" ); $sharingComp3->setEnabled( 0 ); - $sizePolicy6->setHeightForWidth( $sharingComp3->sizePolicy()->hasHeightForWidth() ); - $sharingComp3->setSizePolicy( $sizePolicy6 ); + $sizePolicy7->setHeightForWidth( $sharingComp3->sizePolicy()->hasHeightForWidth() ); + $sharingComp3->setSizePolicy( $sizePolicy7 ); $sharingComp3->setAlignment( Qt::AlignJustify()|Qt::AlignVCenter() ); my $comp3ShLabel = Qt::Label( $sharingComp3 ); $self->{comp3ShLabel} = $comp3ShLabel; @@ -2095,8 +2101,8 @@ sub setupUi { my $titleLabel = Qt::Label( $groupTitle ); $self->{titleLabel} = $titleLabel; $titleLabel->setObjectName( "titleLabel" ); - $sizePolicy4->setHeightForWidth( $titleLabel->sizePolicy()->hasHeightForWidth() ); - $titleLabel->setSizePolicy( $sizePolicy4 ); + $sizePolicy5->setHeightForWidth( $titleLabel->sizePolicy()->hasHeightForWidth() ); + $titleLabel->setSizePolicy( $sizePolicy5 ); $titleLabel->setWordWrap( 0 ); $vboxLayout1->addWidget( $titleLabel ); @@ -2104,12 +2110,12 @@ sub setupUi { my $title = Qt::LineEdit( $groupTitle ); $self->{title} = $title; $title->setObjectName( "title" ); - my $sizePolicy7 = Qt::SizePolicy( Qt::SizePolicy::Expanding(), Qt::SizePolicy::Fixed() ); - $self->{$sizePolicy7} = $sizePolicy7; - $sizePolicy7->setHorizontalStretch( 1 ); - $sizePolicy7->setVerticalStretch( 1 ); - $sizePolicy7->setHeightForWidth( $title->sizePolicy()->hasHeightForWidth() ); - $title->setSizePolicy( $sizePolicy7 ); + my $sizePolicy8 = Qt::SizePolicy( Qt::SizePolicy::Expanding(), Qt::SizePolicy::Fixed() ); + $self->{$sizePolicy8} = $sizePolicy8; + $sizePolicy8->setHorizontalStretch( 1 ); + $sizePolicy8->setVerticalStretch( 1 ); + $sizePolicy8->setHeightForWidth( $title->sizePolicy()->hasHeightForWidth() ); + $title->setSizePolicy( $sizePolicy8 ); $vboxLayout1->addWidget( $title ); @@ -2163,8 +2169,8 @@ sub setupUi { my $fourierBox = Qt::GroupBox( $fourierPage ); $self->{fourierBox} = $fourierBox; $fourierBox->setObjectName( "fourierBox" ); - $sizePolicy5->setHeightForWidth( $fourierBox->sizePolicy()->hasHeightForWidth() ); - $fourierBox->setSizePolicy( $sizePolicy5 ); + $sizePolicy6->setHeightForWidth( $fourierBox->sizePolicy()->hasHeightForWidth() ); + $fourierBox->setSizePolicy( $sizePolicy6 ); my $layout34 = Qt::Widget( $fourierBox ); $self->{layout34} = $layout34; $layout34->setObjectName( "layout34" ); @@ -2178,28 +2184,28 @@ sub setupUi { my $frqMax = Qt::LineEdit( $layout34 ); $self->{frqMax} = $frqMax; $frqMax->setObjectName( "frqMax" ); - $sizePolicy4->setHeightForWidth( $frqMax->sizePolicy()->hasHeightForWidth() ); - $frqMax->setSizePolicy( $sizePolicy4 ); + $sizePolicy5->setHeightForWidth( $frqMax->sizePolicy()->hasHeightForWidth() ); + $frqMax->setSizePolicy( $sizePolicy5 ); $gridLayout7->addWidget( $frqMax, 0, 6, 1, 1 ); my $funits = Qt::ComboBox( $layout34 ); $self->{funits} = $funits; $funits->setObjectName( "funits" ); - my $sizePolicy8 = Qt::SizePolicy( Qt::SizePolicy::Ignored(), Qt::SizePolicy::Preferred() ); - $self->{$sizePolicy8} = $sizePolicy8; - $sizePolicy8->setHorizontalStretch( 0 ); - $sizePolicy8->setVerticalStretch( 0 ); - $sizePolicy8->setHeightForWidth( $funits->sizePolicy()->hasHeightForWidth() ); - $funits->setSizePolicy( $sizePolicy8 ); + my $sizePolicy9 = Qt::SizePolicy( Qt::SizePolicy::Ignored(), Qt::SizePolicy::Preferred() ); + $self->{$sizePolicy9} = $sizePolicy9; + $sizePolicy9->setHorizontalStretch( 0 ); + $sizePolicy9->setVerticalStretch( 0 ); + $sizePolicy9->setHeightForWidth( $funits->sizePolicy()->hasHeightForWidth() ); + $funits->setSizePolicy( $sizePolicy9 ); $gridLayout7->addWidget( $funits, 0, 2, 1, 1 ); my $fplot = Qt::ComboBox( $layout34 ); $self->{fplot} = $fplot; $fplot->setObjectName( "fplot" ); - $sizePolicy4->setHeightForWidth( $fplot->sizePolicy()->hasHeightForWidth() ); - $fplot->setSizePolicy( $sizePolicy4 ); + $sizePolicy5->setHeightForWidth( $fplot->sizePolicy()->hasHeightForWidth() ); + $fplot->setSizePolicy( $sizePolicy5 ); $gridLayout7->addWidget( $fplot, 2, 2, 1, 1 ); @@ -2234,8 +2240,8 @@ sub setupUi { my $fapodization = Qt::ComboBox( $layout34 ); $self->{fapodization} = $fapodization; $fapodization->setObjectName( "fapodization" ); - $sizePolicy4->setHeightForWidth( $fapodization->sizePolicy()->hasHeightForWidth() ); - $fapodization->setSizePolicy( $sizePolicy4 ); + $sizePolicy5->setHeightForWidth( $fapodization->sizePolicy()->hasHeightForWidth() ); + $fapodization->setSizePolicy( $sizePolicy5 ); $gridLayout7->addWidget( $fapodization, 1, 2, 1, 1 ); @@ -2270,8 +2276,8 @@ sub setupUi { my $fphase = Qt::LineEdit( $layout34 ); $self->{fphase} = $fphase; $fphase->setObjectName( "fphase" ); - $sizePolicy4->setHeightForWidth( $fphase->sizePolicy()->hasHeightForWidth() ); - $fphase->setSizePolicy( $sizePolicy4 ); + $sizePolicy5->setHeightForWidth( $fphase->sizePolicy()->hasHeightForWidth() ); + $fphase->setSizePolicy( $sizePolicy5 ); $gridLayout7->addWidget( $fphase, 1, 4, 1, 1 ); @@ -2292,8 +2298,8 @@ sub setupUi { my $frqMin = Qt::LineEdit( $layout34 ); $self->{frqMin} = $frqMin; $frqMin->setObjectName( "frqMin" ); - $sizePolicy4->setHeightForWidth( $frqMin->sizePolicy()->hasHeightForWidth() ); - $frqMin->setSizePolicy( $sizePolicy4 ); + $sizePolicy5->setHeightForWidth( $frqMin->sizePolicy()->hasHeightForWidth() ); + $frqMin->setSizePolicy( $sizePolicy5 ); $gridLayout7->addWidget( $frqMin, 0, 4, 1, 1 ); @@ -2316,12 +2322,12 @@ sub setupUi { my $rrfBox = Qt::GroupBox( $fourierPage ); $self->{rrfBox} = $rrfBox; $rrfBox->setObjectName( "rrfBox" ); - $sizePolicy5->setHeightForWidth( $rrfBox->sizePolicy()->hasHeightForWidth() ); - $rrfBox->setSizePolicy( $sizePolicy5 ); + $sizePolicy6->setHeightForWidth( $rrfBox->sizePolicy()->hasHeightForWidth() ); + $rrfBox->setSizePolicy( $sizePolicy6 ); my $layout35 = Qt::Widget( $rrfBox ); $self->{layout35} = $layout35; $layout35->setObjectName( "layout35" ); - $layout35->setGeometry( Qt::Rect(10, 18, 265, 100) ); + $layout35->setGeometry( Qt::Rect(10, 18, 265, 107) ); my $gridLayout8 = Qt::GridLayout( $layout35 ); $self->{gridLayout8} = $gridLayout8; $gridLayout8->setSpacing( 5 ); @@ -2668,12 +2674,12 @@ sub setupUi { $self->{t0Update} = $t0Update; $t0Update->setObjectName( "t0Update" ); $t0Update->setEnabled( 0 ); - my $sizePolicy9 = Qt::SizePolicy( Qt::SizePolicy::Fixed(), Qt::SizePolicy::Fixed() ); - $self->{$sizePolicy9} = $sizePolicy9; - $sizePolicy9->setHorizontalStretch( 0 ); - $sizePolicy9->setVerticalStretch( 0 ); - $sizePolicy9->setHeightForWidth( $t0Update->sizePolicy()->hasHeightForWidth() ); - $t0Update->setSizePolicy( $sizePolicy9 ); + my $sizePolicy10 = Qt::SizePolicy( Qt::SizePolicy::Fixed(), Qt::SizePolicy::Fixed() ); + $self->{$sizePolicy10} = $sizePolicy10; + $sizePolicy10->setHorizontalStretch( 0 ); + $sizePolicy10->setVerticalStretch( 0 ); + $sizePolicy10->setHeightForWidth( $t0Update->sizePolicy()->hasHeightForWidth() ); + $t0Update->setSizePolicy( $sizePolicy10 ); $hboxLayout2->addWidget( $t0Update ); @@ -2835,16 +2841,16 @@ sub setupUi { my $cParamsCombo = Qt::ComboBox( $tabPage ); $self->{cParamsCombo} = $cParamsCombo; $cParamsCombo->setObjectName( "cParamsCombo" ); - $sizePolicy9->setHeightForWidth( $cParamsCombo->sizePolicy()->hasHeightForWidth() ); - $cParamsCombo->setSizePolicy( $sizePolicy9 ); + $sizePolicy10->setHeightForWidth( $cParamsCombo->sizePolicy()->hasHeightForWidth() ); + $cParamsCombo->setSizePolicy( $sizePolicy10 ); $hboxLayout3->addWidget( $cParamsCombo ); my $textLabel1_4_6 = Qt::Label( $tabPage ); $self->{textLabel1_4_6} = $textLabel1_4_6; $textLabel1_4_6->setObjectName( "textLabel1_4_6" ); - $sizePolicy9->setHeightForWidth( $textLabel1_4_6->sizePolicy()->hasHeightForWidth() ); - $textLabel1_4_6->setSizePolicy( $sizePolicy9 ); + $sizePolicy10->setHeightForWidth( $textLabel1_4_6->sizePolicy()->hasHeightForWidth() ); + $textLabel1_4_6->setSizePolicy( $sizePolicy10 ); $textLabel1_4_6->setWordWrap( 0 ); $hboxLayout3->addWidget( $textLabel1_4_6 ); @@ -2861,8 +2867,8 @@ sub setupUi { my $addConstraint = Qt::PushButton( $tabPage ); $self->{addConstraint} = $addConstraint; $addConstraint->setObjectName( "addConstraint" ); - $sizePolicy9->setHeightForWidth( $addConstraint->sizePolicy()->hasHeightForWidth() ); - $addConstraint->setSizePolicy( $sizePolicy9 ); + $sizePolicy10->setHeightForWidth( $addConstraint->sizePolicy()->hasHeightForWidth() ); + $addConstraint->setSizePolicy( $sizePolicy10 ); $hboxLayout3->addWidget( $addConstraint ); @@ -2965,7 +2971,7 @@ sub setupUi { $self->{menuBar} = $menuBar; $menuBar->setObjectName( "menuBar" ); $menuBar->setEnabled( 1 ); - $menuBar->setGeometry( Qt::Rect(0, 0, 600, 20) ); + $menuBar->setGeometry( Qt::Rect(0, 0, 674, 27) ); my $fileMenu = Qt::Menu( $menuBar ); $self->{fileMenu} = $fileMenu; $fileMenu->setObjectName( "fileMenu" ); @@ -3194,20 +3200,24 @@ sub retranslateUi { $self->{browse}->setText( Qt::Application::translate( 'MuSRFit4', "Browse", undef, Qt::Application::UnicodeUTF8() ) ); $self->{fitAsyTypeLabel}->setText( Qt::Application::translate( 'MuSRFit4', "Fit type", undef, Qt::Application::UnicodeUTF8() ) ); $self->{fitAsyType}->insertItems(0, [Qt::Application::translate( 'MuSRFit4', "Asymmetry", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "SingleHist", undef, Qt::Application::UnicodeUTF8() )]); + Qt::Application::translate( 'MuSRFit4', "Single Hist", undef, Qt::Application::UnicodeUTF8() ), + Qt::Application::translate( 'MuSRFit4', "Asymmetry GLB", undef, Qt::Application::UnicodeUTF8() ), + Qt::Application::translate( 'MuSRFit4', "Single Hist GLB", undef, Qt::Application::UnicodeUTF8() )]); $self->{histsLRBFLabel}->setText( Qt::Application::translate( 'MuSRFit4', "Histograms list", undef, Qt::Application::UnicodeUTF8() ) ); $self->{histsLRBF}->setText( Qt::Application::translate( 'MuSRFit4', "1 5,3 7", undef, Qt::Application::UnicodeUTF8() ) ); $self->{runsAuto}->setTitle( Qt::Application::translate( 'MuSRFit4', "RUN Numbers", undef, Qt::Application::UnicodeUTF8() ) ); - $self->{yearLabel}->setText( Qt::Application::translate( 'MuSRFit4', "Year", undef, Qt::Application::UnicodeUTF8() ) ); - $self->{beamLineLabel}->setText( Qt::Application::translate( 'MuSRFit4', "On beam line", undef, Qt::Application::UnicodeUTF8() ) ); + $self->{runNumbers}->setToolTip( Qt::Application::translate( 'MuSRFit4', "Numbers of RUNs to fit. Multiple runs are comma separated.", undef, Qt::Application::UnicodeUTF8() ) ); + $self->{runNumbers}->setWhatsThis( Qt::Application::translate( 'MuSRFit4', "Numbers of RUNs to fit. Multiple runs are comma separated.", undef, Qt::Application::UnicodeUTF8() ) ); + $self->{runNumbers}->setText( '' ); $self->{beamLine}->insertItems(0, [Qt::Application::translate( 'MuSRFit4', "LEM", undef, Qt::Application::UnicodeUTF8() ), + Qt::Application::translate( 'MuSRFit4', "GPD", undef, Qt::Application::UnicodeUTF8() ), + Qt::Application::translate( 'MuSRFit4', "HAL", undef, Qt::Application::UnicodeUTF8() ), Qt::Application::translate( 'MuSRFit4', "GPS", undef, Qt::Application::UnicodeUTF8() ), Qt::Application::translate( 'MuSRFit4', "Dolly", undef, Qt::Application::UnicodeUTF8() ), Qt::Application::translate( 'MuSRFit4', "LTF", undef, Qt::Application::UnicodeUTF8() ), Qt::Application::translate( 'MuSRFit4', "LEM (PPC)", undef, Qt::Application::UnicodeUTF8() )]); - $self->{runNumbers}->setToolTip( Qt::Application::translate( 'MuSRFit4', "Numbers of RUNs to fit. Multiple runs are comma separated.", undef, Qt::Application::UnicodeUTF8() ) ); - $self->{runNumbers}->setWhatsThis( Qt::Application::translate( 'MuSRFit4', "Numbers of RUNs to fit. Multiple runs are comma separated.", undef, Qt::Application::UnicodeUTF8() ) ); - $self->{runNumbers}->setText( '' ); + $self->{yearLabel}->setText( Qt::Application::translate( 'MuSRFit4', " Year ", undef, Qt::Application::UnicodeUTF8() ) ); + $self->{beamLineLabel}->setText( Qt::Application::translate( 'MuSRFit4', "On beam line ", undef, Qt::Application::UnicodeUTF8() ) ); $self->{groupBox}->setTitle( Qt::Application::translate( 'MuSRFit4', "Theory Function", undef, Qt::Application::UnicodeUTF8() ) ); $self->{comp1Label}->setText( Qt::Application::translate( 'MuSRFit4', "First Component", undef, Qt::Application::UnicodeUTF8() ) ); $self->{comp2Label}->setText( Qt::Application::translate( 'MuSRFit4', "Second Component", undef, Qt::Application::UnicodeUTF8() ) ); From 924edcf70fc0fbacf8732edbcbba776f78d05511 Mon Sep 17 00:00:00 2001 From: Zaher Salman Date: Tue, 6 Feb 2018 08:53:29 +0100 Subject: [PATCH 2/6] Partial implementation of global fit option using msr2data. --- src/external/MuSRFitGUI/MSR.pm | 1198 +++++------------------- src/external/MuSRFitGUI/MuSRFit4.pm | 94 +- src/external/MuSRFitGUI/MuSRFit4.ui | 9 +- src/external/MuSRFitGUI/Ui_MuSRFit4.pm | 7 +- 4 files changed, 304 insertions(+), 1004 deletions(-) diff --git a/src/external/MuSRFitGUI/MSR.pm b/src/external/MuSRFitGUI/MSR.pm index 51ff9913..c006d29d 100644 --- a/src/external/MuSRFitGUI/MSR.pm +++ b/src/external/MuSRFitGUI/MSR.pm @@ -50,796 +50,6 @@ my $erradd = "d"; my $minadd = "_min"; my $maxadd = "_max"; - - -sub CreateMSR { -########################################################################## -# CreateMSR -# -# Input in %All -# Required: -# $All{"FitType1/2/3"} - Function types, 3 components -# $All{"LRBF"} - Histograms, comma separated -# $All{"Tis"} -# $All{"Tfs"} -# $All{"BINS"} -# $All{"FILENAME"} -# $All{"go"} -# $All{"TITLE"} -# $All{"RunNumbers"} -# $All{"FitAsyType"} -# $All{"BeamLine"} -# $All{"YEAR"} -# -# Optional: -# $All{"Sh_$Param"} -# $All{"ltc"} -# $All{"$Param"} value, error, min, and max -# $All{"logx/y"} -# $All{"Xi/f"} -# -# Output -# $Full_T_Block - Full theory block -# @Paramcomp - Space separated list of parameters for each component -# FILENAME.msr - MSR file saved -# -########################################################################## - my %All = %{$_[0]}; - my $DEBUG = ""; - # Start with empty array - my @FitTypes = (); - - foreach ($All{"FitType1"},$All{"FitType2"},$All{"FitType3"}) { - if ($_ ne "None") { - @FitTypes=(@FitTypes,$_); - } - } - - my @Hists = split( /,/, $All{"LRBF"} ); - # TODO - # : to separate two sets of asymmetries with same parameters - # Check the number of histograms - # should be 2 or 4 histograms - # should be checked in GUI - # for 2 simple asymmetry fit - # for 4 two run blocks with different geometric parameters: - # Alpha, No, NBg, Phi, Asy - - my @TiVals = split( /,/, $All{"Tis"} ); - my @TfVals = split( /,/, $All{"Tfs"} ); - my @BINVals = split( /,/, $All{"BINS"} ); - my $FILENAME = $All{"FILENAME"}; - my $BeamLine = $All{"BeamLine"}; - my $YEAR = $All{"YEAR"}; - - # Works for CGI script - my $Step = $All{"go"}; - my $FITMINTYPE = $EMPTY; - if ( $Step eq "MIGRAD" ) { - $FITMINTYPE = "MINIMIZE\nMIGRAD\nHESSE"; - } elsif ( $Step eq "MINOS" ) { - $FITMINTYPE = "MIGRAD\nMINOS"; - } elsif ( $Step eq "SIMPLEX" ) { - $FITMINTYPE = "SCAN\nSIMPLEX"; - } - - # Proper way - if ( $All{"Minimization"} ne $EMPTY && $All{"ErrorCalc"} ne $EMPTY && $Step ne "PLOT" ) { - $FITMINTYPE = $All{"Minimization"}."\n".$All{"ErrorCalc"}; - } - - # First create the THEORY Block - my ($Full_T_Block,$Paramcomp_ref)=MSR::CreateTheory(@FitTypes); - my @Paramcomp = @$Paramcomp_ref; - - # If we have a FUNCTIONS Block the Full_T_Block should be - # replaced by Func_T_Block - my $FUNCTIONS_Block = $EMPTY; - if ($All{"FunctionsBlock"} ne $EMPTY) { - $FUNCTIONS_Block = "FUNCTIONS\n###############################################################\n".$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 - my $iRun = 1; - - # Counter of Params - my $PCount = 1; - - my $PLT = 2; - # For SingleHist fit - if ($All{"FitAsyType"} eq "SingleHist") { $PLT = 0;} - - # Need to select here RUNSAuto or RUNSManual - # $RUNSType = 0 (Auto) or 1 (Manual) - my $RUNSType = 0; - my @RUNS=(); - if ($All{"RunNumbers"} ne $EMPTY) { - # Remove spaces and other illegal characters - $All{"RunNumbers"} =~ s/[\ \.\~\/\&\*\[\;\>\<\^\$\(\)\`\|\]\'\@]/,/g; - $All{"RunNumbers"} =~ s/[a-zA-Z]//g; - # Expand hyphens - $All{"RunNumbers"} = MSR::ExpandRunNumbers($All{"RunNumbers"}); - # Split commas - @RUNS=split( /,/, $All{"RunNumbers"}); - $RUNSType = 0; - } - elsif ($All{"RunFiles"} ne $EMPTY) { - @RUNS=split( /,/, $All{"RunFiles"}); - $RUNSType = 1; - } - - # $shcount is a counter for shared parameters - # msr2data \[1363 1365 1366\] _Dolly_2010 msr-1363 global - if ( $#RUNS == 0 ) { - my $shcount = 1; - } else { - if ( $All{"Sh_Alpha"} == 1 ) { - my $shcount = 1; - } else { - my $shcount = 0; - } - } - - # Initialise $shcount, a counter for shared parameters - my $shcount = 1; - my $RUN_Block = $EMPTY; - my $RUNS_Line = $EMPTY; - - # range order - my $Range_Order = 1; - foreach my $RUN (@RUNS) { -####################################################################### - # Prepare the Parameters and initial values block - my $component = 0; - my $Single_RUN = $EMPTY; - - # Prepare map line for each run - my $MAP_Line = "map "; - - # How many non-shared parameter for this RUN? - my $nonsh = 0; - - # Prepeare Alpha line for the RUN block. Empty initially. - my $Alpha_Line = $EMPTY; - - # Loop over all components in the fit - foreach my $FitType (@FitTypes) { - ++$component; - my $Parameters = $Paramcomp[ $component - 1 ]; - my @Params = split( /\s+/, $Parameters ); - - # For the first component we need Alpha for Asymmetry fits - if ($component == 1) { - unshift( @Params, "Alpha" ); - } - - foreach my $Param (@Params) { - my $Param_ORG = $Param; - if ( ($#FitTypes != 0) && ($Param ne "Alpha") ) { - $Param = join( $EMPTY, $Param, "_", "$component" ); - } - - # If we have only one RUN then everything is shared - my $Shared = 0; - if ( $#RUNS == 0 ) { - $Shared = 1; - } - # Otherwise check input if it was marked as shared - else { - $Shared = $All{"Sh_$Param"}; - } - - # Alpha Line - # - # If you encounter alpha in the parameters list make sure - # to fill this line for the RUN block. - if ( $Param_ORG eq "Alpha" ) { - if ($Shared) { - # If alpha is shared use always the same line - $Alpha_Line = "alpha 1\n"; - } - else { - # Otherwise modify alpha line accordingly - $Alpha_Line = "alpha $PCount\n"; - } - } - - # End of Alpha Line -#################################################################################################### - - # Start preparing the parameters block - if ($Shared) { - # Parameter is shared enough to keep order from first run - if ( $iRun == 1 ) { - $Full_T_Block =~ s/$Param_ORG/$PCount/; - ++$shcount; - ++$PCount; - } - } else { - # Parameter is not shared, use map unless it is a single RUN fit - # Skip adding to map line in these cases - if ( ( $Param ne "Alpha" && $#RUNS != 0 ) || ( !( $Param_ORG =~ m/^(No|NBg)/ ) && $#RUNS != 0 )) { - ++$nonsh; - $Full_T_Block =~ s/$Param_ORG/map$nonsh/; - $MAP_Line = join( ' ', $MAP_Line, $PCount ); - } - ++$PCount; - } - my $NtotPar = $PCount; - } - } - - # Finished preparing the FITPARAMETERS block -####################################################################### - - # Start constructing RUN block here - # For each defined range we need a block in the RUN-Block - # Also for each histogram in Single Histograms fits - - $RUN = $RUNS[ $iRun - 1 ]; - my $RUN_Line = $EMPTY; - if ($All{"RUNSType"}) { - $RUN_Line = MSR::RUNFileNameAuto($RUN,"0000",$EMPTY); - } else { - $RUN_Line = MSR::RUNFileNameAuto($RUN,$YEAR,$BeamLine); - } - - my $Type_Line = "fittype 2"; - my $Hist_Lines = - "forward $Hists[0]\nbackward $Hists[1]"; - - my $Bg_Line = "background"; - my $Data_Line = "data"; - my $T0_Line = "t0"; - my $NHist=1; - foreach my $Hist (@Hists) { -# If empty skip lines - if ($All{"Bg1$NHist"} ne $EMPTY && $All{"Bg2$NHist"} ne $EMPTY) { - $Bg_Line = $Bg_Line." ".$All{"Bg1$NHist"}." ".$All{"Bg2$NHist"}; - } - if ($All{"Data1$NHist"} ne $EMPTY && $All{"Data2$NHist"} ne $EMPTY) { - $Data_Line =$Data_Line." ".$All{"Data1$NHist"}." ".$All{"Data2$NHist"}; - } - if ($All{"t0$NHist"} ne $EMPTY) { - $T0_Line=$T0_Line." ".$All{"t0$NHist"}; - } - $NHist++; - } - -# Put T0_Line Bg_Line and Data_Line together if not empty - my $T0DataBg=$EMPTY; - if ($T0_Line ne "t0") { - $T0DataBg = $T0DataBg.$T0_Line."\n"; - } - if ($Bg_Line ne "background") { - $T0DataBg = $T0DataBg.$Bg_Line."\n"; - } - if ($Data_Line ne "data") { - $T0DataBg = $T0DataBg.$Data_Line."\n"; - } - - $FRANGE_Line = "fit TINI TFIN"; - $PAC_Line = "packing BINNING"; - - $Single_RUN = -"$RUN_Line\n$Type_Line\n$Alpha_Line$Hist_Lines\n$T0DataBg$MAP_Line\n$FRANGE_Line\n$PAC_Line\n\n"; - - # Now add the appropriate values of fit range and packing - my $Range_Min = 8; - my $Range_Max = 0; - my $k = 0; - foreach my $Ti (@TiVals) { - my $Tf = $TfVals[$k]; - my $BIN = $BINVals[$k]; - $RUN_Block = $RUN_Block . $Single_RUN; - $RUN_Block =~ s/TINI/$Ti/g; - $RUN_Block =~ s/TFIN/$Tf/g; - $RUN_Block =~ s/BINNING/$BIN/g; - - # For multiple ranges use this - if ( $Ti < $Range_Min ) { $Range_Min = $Ti; } - if ( $Tf > $Range_Max ) { $Range_Max = $Tf; } - - $RUNS_Line = "$RUNS_Line " . $Range_Order; - ++$k; - ++$Range_Order; - } - ++$iRun; - } - - # The number of runs is - $NRUNS = $iRun - 1; - # Start constructing all blocks - my $TitleLine = $All{"TITLE"}."\n# Run Numbers: ".$All{"RunNumbers"}; - - # Get parameter block from MSR::PrepParamTable(\%All); - my $FitParaBlk = "FITPARAMETER -############################################################### -# No Name Value Err Min Max "; - my %PTable=MSR::PrepParamTable(\%All); - my $NParam=scalar keys( %PTable ); -# Fill the table with labels and values of parametr - for (my $iP=0;$iP<$NParam;$iP++) { - my ($Param,$value,$error,$minvalue,$maxvalue,$RUNtmp) = split(/,/,$PTable{$iP}); - if ( $minvalue == $maxvalue ) { - $minvalue = $EMPTY; - $maxvalue = $EMPTY; - } - $PCount=$iP+1; - $FitParaBlk = $FitParaBlk." - $PCount $Param $value $error $error $minvalue $maxvalue"; - } - - $Full_T_Block = "THEORY\n###############################################################\n$Full_T_Block\n"; - - # COMMAND Block - $COMMANDS_Block = "COMMANDS\nFITMINTYPE\nSAVE\n"; - $COMMANDS_Block =~ s/FITMINTYPE/$FITMINTYPE/g; - # END- COMMAND Block - - # PLOT Block - # Check if log x and log y are selected - my $logxy = $EMPTY; - if ( $All{"logx"} eq "y" ) { $logxy = $logxy . "logx\n"; } - if ( $All{"logy"} eq "y" ) { $logxy = $logxy . "logy\n"; } - - # Check if a plot range is defined (i.e. different from fit) - $PRANGE_Line = "use_fit_ranges"; - if ( $All{"Xi"} != $All{"Xf"} ) { - if ($All{"Yi"} != $All{"Yf"}) { - $PRANGE_Line = "range ".$All{"Xi"}." ".$All{"Xf"}." ".$All{"Yi"}." ".$All{"Yf"}; - } else { - $PRANGE_Line = "range ".$All{"Xi"}." ".$All{"Xf"}; - } - } - - $VIEWBIN_Line =""; - if ( $All{"ViewBin"}!=0 ) { $VIEWBIN_Line = "view_packing ".$All{"ViewBin"};} - - my $RRFBlock=MSR::CreateRRFBlk(\%All); - $PLOT_Block = "PLOT $PLT\nruns $RUNS_Line\n$PRANGE_Line\n$VIEWBIN_Line\n$RRFBlock\n$logxy"; - #END - PLOT Block - - # FFT Block - my $FOURIER_Block = MSR::CreateFFTBlk(\%All); - # END - FFT Block - - # STATS Block - # Don't know why but it is needed initially - my $STAT_Block = "STATISTIC --- 0000-00-00 00:00:00\n*** FIT DID NOT CONVERGE ***"; - # END - STATS Block - - # Empty line at the end of each block - my $FullMSRFile = "$TitleLine -############################################################### -$FitParaBlk -############################################################### -$Full_T_Block -############################################################### -$FUNCTIONS_Block -############################################################### -$RUN_Block -############################################################### -$COMMANDS_Block -############################################################### -$PLOT_Block -############################################################### -$FOURIER_Block -############################################################### -$STAT_Block\n"; - -# Return information and file - return($Full_T_Block,\@Paramcomp,$FullMSRFile); -} - -sub CreateMSRSingleHist { -########################################################################## -# CreateMSRSingleHist -# -# Input in %All -# Required: -# $All{"FitType1/2/3"} - Function types, 3 components -# $All{"LRBF"} - Histograms, comma separated -# $All{"Tis"} -# $All{"Tfs"} -# $All{"BINS"} -# $All{"FILENAME"} -# $All{"go"} -# $All{"TITLE"} -# $All{"RunNumbers"} -# $All{"FitAsyType"} -# $All{"BeamLine"} -# $All{"YEAR"} -# -# Optional: -# $All{"Sh_$Param"} -# $All{"ltc"} -# $All{"$Param"} value, error, min, and max -# $All{"logx/y"} -# $All{"Xi/f"} -# -# Output -# $Full_T_Block - Full theory block -# @Paramcomp - Space separated list of parameters for each component -# FILENAME.msr - MSR file saved -# -########################################################################## - my %All = %{$_[0]}; - my $DEBUG = ""; - # Start with empty array - my @FitTypes = (); - - foreach ($All{"FitType1"},$All{"FitType2"},$All{"FitType3"}) { - if ($_ ne "None") { - @FitTypes=(@FitTypes,$_); - } - } - - my @Hists = split( /,/, $All{"LRBF"} ); - my @TiVals = split( /,/, $All{"Tis"} ); - my @TfVals = split( /,/, $All{"Tfs"} ); - my @BINVals = split( /,/, $All{"BINS"} ); - my $FILENAME = $All{"FILENAME"}; - my $BeamLine = $All{"BeamLine"}; - my $YEAR = $All{"YEAR"}; - - # Works for CGI script - my $Step = $All{"go"}; - my $FITMINTYPE = $EMPTY; - if ( $Step eq "MIGRAD" ) { - $FITMINTYPE = "MINIMIZE\nMIGRAD\nHESSE"; - } elsif ( $Step eq "MINOS" ) { - $FITMINTYPE = "MIGRAD\nMINOS"; - } elsif ( $Step eq "SIMPLEX" ) { - $FITMINTYPE = "SCAN\nSIMPLEX"; - } - - # Proper way - if ( $All{"Minimization"} ne $EMPTY && $All{"ErrorCalc"} ne $EMPTY && $Step ne "PLOT" ) { - $FITMINTYPE = $All{"Minimization"}."\n".$All{"ErrorCalc"}; - } - - # First create the THEORY Block - my ($Full_T_Block,$Paramcomp_ref)=MSR::CreateTheory(@FitTypes); - my @Paramcomp = @$Paramcomp_ref; - - # If we have a FUNCTIONS Block the Full_T_Block should be - # replaced by Func_T_Block - my $FUNCTIONS_Block = $EMPTY; - if ($All{"FunctionsBlock"} ne $EMPTY) { - $FUNCTIONS_Block = "FUNCTIONS\n###############################################################\n".$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 - my $iRun = 1; - - # Counter of Params - my $PCount = 1; - - my $PLT = 2; - # For SingleHist fit - if ($All{"FitAsyType"} eq "SingleHist") { $PLT = 0;} - - # Need to select here RUNSAuto or RUNSManual - # $RUNSType = 0 (Auto) or 1 (Manual) - my $RUNSType = 0; - my @RUNS=(); - if ($All{"RunNumbers"} ne $EMPTY) { - # Remove spaces and other illegal characters - $All{"RunNumbers"} =~ s/[\ \.\~\/\&\*\[\;\>\<\^\$\(\)\`\|\]\'\@]/,/g; - $All{"RunNumbers"} =~ s/[a-zA-Z]//g; - # Expand hyphens - $All{"RunNumbers"} = MSR::ExpandRunNumbers($All{"RunNumbers"}); - # Split commas - @RUNS=split( /,/, $All{"RunNumbers"}); - $RUNSType = 0; - } - elsif ($All{"RunFiles"} ne $EMPTY) { - @RUNS=split( /,/, $All{"RunFiles"}); - $RUNSType = 1; - } - - # Until here identical to sub CreateMSR - # $shcount is a counter for shared parameters - if ( $#RUNS == 0 && $#Hists == 0) { - my $shcount = 1; - } else { - if ( $All{"Sh_No"} == 1 ) { - my $shcount = 1; - } elsif ( $All{"Sh_NBg"} == 1 ) { - my $shcount = 1; - } else { - my $shcount = 0; - } - } - - $shcount = 1; - my $RUN_Block = $EMPTY; - my $RUNS_Line = $EMPTY; - - # range order - my $Range_Order = 1; - my $iHist = 0; - foreach my $RUN (@RUNS) { - # Until here identical to sub CreateMSR - - ####################################################################### - # 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! - # We distinguich between sharing among different runs to common parameters - # for different histograms. The first is done in the usual "Sharing" schame, - # while the second has to be done in the functions block. This can be done - # in a consistent, non-confusing algorithm - foreach my $Hist (@Hists) { - # Prepare the Parameters and initial values block - my $component = 0; - my $Single_RUN = $EMPTY; - - # Prepare map line for each run - my $MAP_Line = "map "; - - # How many non-shared parameter for this RUN? - my $nonsh = 0; - - # Prepeare No/NBg line for the RUN block. Empty initially. - my $NoBg_Line = $EMPTY; - - # Loop over all components in the fit - foreach my $FitType (@FitTypes) { - ++$component; - my $Parameters = $Paramcomp[ $component - 1 ]; - my @Params = split( /\s+/, $Parameters ); - # Only the first histiograms has new physical parameters - # the others keep only Phi if they have it - - # For the first component we need No and NBg for SingleHist fits - if ( $component == 1 ) { - unshift( @Params, ( "No", "NBg" ) ); - } - - foreach my $Param (@Params) { - my $Param_ORG = $Param; - $Param=$Param.$Hist; - if ( ($#FitTypes != 0) && !( $Param_ORG =~ m/^(No|NBg)/ ) ) { - $Param = join( $EMPTY, $Param, "_", "$component" ); - } - - # If we have only one RUN with one Histogram then everything is shared - my $Shared = 0; - if ( $#RUNS == 0 && $#Hists == 0 ) { - $Shared = 1; - } - # Otherwise check input if it was marked as shared - else { - $Shared = $All{"Sh_$Param"}; - } - - # No and NBg Lines - # - # If you encounter No in the parameters list make sure - # to fill this line for the RUN block. - if ( $Param_ORG eq "No" ) { - if ($Shared) { - $NoBg_Line = "norm 1\n"; - } - else { - $NoBg_Line = "norm $PCount\n"; - } - - # Optional - add lifetime correction for SingleHist fits - if ( $All{"ltc"} eq "y" ) { - $NoBg_Line = $NoBg_Line . "lifetimecorrection\n"; - } - } - # If you encounter NBg in the parameters list make sure - # to fill this line for the RUN block. - elsif ( $Param_ORG eq "NBg" ) { - if ($Shared) { - $NoBg_Line = $NoBg_Line . "backgr.fit 2\n"; - } - else { - $NoBg_Line = $NoBg_Line . "backgr.fit $PCount\n"; - } - } - - # End of No and NBg Lines - # Now deal with physical parameters and phases - elsif ( $Param_ORG ne "Phi" && $Param_ORG ne "No" && $Param_ORG ne "NBg") { - - } -#################################################################################################### - - # Start preparing the parameters block - if ($Shared) { - # Parameter is shared enough to keep order from first run - if ( $iRun == 1 ) { - $Full_T_Block =~ s/$Param_ORG/$PCount/; - ++$shcount; - ++$PCount; - } - } else { - # Parameter is not shared, use map unless it is a single RUN fit - # Skip adding to map line in these cases - if ( !( $Param_ORG =~ m/^(No|NBg)/ ) && ($#RUNS != 0 || $#Hist != 0)) { - ++$nonsh; - $Full_T_Block =~ s/$Param_ORG/map$nonsh/; - $MAP_Line = join( ' ', $MAP_Line, $PCount ); - } - ++$PCount; - } - $NtotPar = $PCount; - } - } - - # Finished preparing the FITPARAMETERS block -####################################################################### - - # Start constructing RUN block here - # For each defined range we need a block in the RUN-Block - # Also for each histogram in Single Histograms fits - - $RUN = $RUNS[ $iRun - 1 ]; - - $DEBUG = $DEBUG.MSR::CreateRUNBlk($RUN, $YEAR, $BeamLine, $All{"FitAsyType"}, $All{"LRBF"}, $All{"Tis"}, $All{"Tfs"}, $All{"BINS"}); - - if ($All{"RUNSType"}) { - $RUN_Line = MSR::RUNFileNameAuto($RUN,"0000",$EMPTY); - } else { - $RUN_Line = MSR::RUNFileNameAuto($RUN,$YEAR,$BeamLine); - } - - $Type_Line = "fittype 0"; - $PLT = 0; - $Hist_Lines = "forward HIST"; - $Bg_Line = $EMPTY; - $Data_Line = "data"; - - foreach ("t0","Bg1","Bg2","Data1","Data2") { - $Name = "$_$Hist"; - # If empty fill with defaults - if ($All{$Name} eq $EMPTY) { - $All{$Name}=MSR::T0BgData($_,$Hist,$BeamLine); - } - } - $Bg_Line = $Bg_Line." ".$All{"Bg1$Hist"}." ".$All{"Bg2$Hist"}; - $Data_Line =$Data_Line." ".$All{"Data1$Hist"}." ".$All{"Data2$Hist"}; - if ($All{"t0$Hist"} ne $EMPTY) { - $Data_Line=$Data_Line."\nt0 ".$All{"t0$Hist"}; - } - - # $MAP_Line = "map 0 0 0 0 0 0 0 0 0 0"; - $FRANGE_Line = "fit TINI TFIN"; - $PAC_Line = "packing BINNING"; - - $Single_RUN = $EMPTY; - $Tmp_Hist_Line = $Hist_Lines; - $Tmp_Hist_Line =~ s/HIST/$Hist/g; - $Single_RUN = $Single_RUN - . "$RUN_Line\n$Type_Line\n$NoBg_Line$Tmp_Hist_Line\n$Data_Line\n$MAP_Line\n$FRANGE_Line\n$PAC_Line\n\n"; - - # This is from CreateRUNBlk - $DEBUG =~s /T0LINE/$T0_Line/; - $DEBUG =~s /BGLINE/$Bg_Line/; - $DEBUG =~s /DATALINE/$Data_Line/; - - # Now add the appropriate values of fit range and packing - my $Range_Min = 8; - my $Range_Max = 0; - my $k = 0; - foreach my $Ti (@TiVals) { - my $Tf = $TfVals[$k]; - my $BIN = $BINVals[$k]; - $RUN_Block = $RUN_Block . $Single_RUN; - $RUN_Block =~ s/TINI/$Ti/g; - $RUN_Block =~ s/TFIN/$Tf/g; - $RUN_Block =~ s/BINNING/$BIN/g; - - # For multiple ranges use this - if ( $Ti < $Range_Min ) { $Range_Min = $Ti; } - if ( $Tf > $Range_Max ) { $Range_Max = $Tf; } - $RUNS_Line = "$RUNS_Line " . $Range_Order; - ++$k; - ++$Range_Order; - } - ++$iHist; - } - ++$iRun; - } - - # From here again identical to sub CreateMSR - # The number of runs is - $NRUNS = $iRun - 1; - # Start constructing all block - my $TitleLine = $All{"TITLE"}."\n# Run Numbers: ".$All{"RunNumbers"}; - - # Get parameter block from MSR::PrepParamTable(\%All); - my $FitParaBlk = "FITPARAMETER -############################################################### -# No Name Value Err Min Max "; - my %PTable=MSR::PrepParamTable(\%All); - my $NParam=scalar keys( %PTable ); -# Fill the table with labels and values of parametr - for (my $iP=0;$iP<$NParam;$iP++) { - my ($Param,$value,$error,$minvalue,$maxvalue,$RUNtmp) = split(/,/,$PTable{$iP}); - if ( $minvalue == $maxvalue ) { - $minvalue = $EMPTY; - $maxvalue = $EMPTY; - } - $PCount=$iP+1; - $FitParaBlk = $FitParaBlk." - $PCount $Param $value $error $error $minvalue $maxvalue"; - } - - $Full_T_Block = "THEORY\n###############################################################\n$Full_T_Block\n"; - - # COMMAND Block - $COMMANDS_Block = "COMMANDS\nFITMINTYPE\nSAVE\n"; - $COMMANDS_Block =~ s/FITMINTYPE/$FITMINTYPE/g; - # END- COMMAND Block - - # PLOT Block - # Check if log x and log y are selected - my $logxy = $EMPTY; - if ( $All{"logx"} eq "y" ) { $logxy = $logxy . "logx\n"; } - if ( $All{"logy"} eq "y" ) { $logxy = $logxy . "logy\n"; } - - # Check if a plot range is defined (i.e. different from fit) - $PRANGE_Line = "use_fit_ranges"; - if ( $All{"Xi"} != $All{"Xf"} ) { - if ($All{"Yi"} != $All{"Yf"}) { - $PRANGE_Line = "range ".$All{"Xi"}." ".$All{"Xf"}." ".$All{"Yi"}." ".$All{"Yf"}; - } else { - $PRANGE_Line = "range ".$All{"Xi"}." ".$All{"Xf"}; - } - } - - $VIEWBIN_Line =""; - if ( $All{"ViewBin"}!=0 ) { $VIEWBIN_Line = "view_packing ".$All{"ViewBin"};} - - my $RRFBlock=MSR::CreateRRFBlk(\%All); - $PLOT_Block = "PLOT $PLT\nruns $RUNS_Line\n$PRANGE_Line\n$VIEWBIN_Line\n$RRFBlock\n$logxy"; - #END - PLOT Block - - # FFT Block - my $FOURIER_Block = MSR::CreateFFTBlk(\%All); - # END - FFT Block - - # STATS Block - # Don't know why but it is needed initially - my $STAT_Block = "STATISTIC --- 0000-00-00 00:00:00\n*** FIT DID NOT CONVERGE ***"; - # END - STATS Block - - # Empty line at the end of each blocks - my $FullMSRFile = "$TitleLine -############################################################### -$FitParaBlk -############################################################### -$Full_T_Block -############################################################### -$FUNCTIONS_Block -############################################################### -$RUN_Block -############################################################### -$COMMANDS_Block -############################################################### -$PLOT_Block -############################################################### -$FOURIER_Block -############################################################### -$STAT_Block\n"; - -# Return information and file -# return($Full_T_Block,\@Paramcomp,$FullMSRFile."\n\n#DEBUG MSG\n$DEBUG\n"); - return($Full_T_Block,\@Paramcomp,$FullMSRFile); -} - sub CreateMSRUni { ########################################################################## # CreateMSRUni @@ -900,18 +110,7 @@ sub CreateMSRUni { my $BeamLine = $All{"BeamLine"}; my $YEAR = $All{"YEAR"}; - # Works for CGI script - my $Step = $All{"go"}; my $FITMINTYPE = $EMPTY; - if ( $Step eq "MIGRAD" ) { - $FITMINTYPE = "MINIMIZE\nMIGRAD\nHESSE"; - } elsif ( $Step eq "MINOS" ) { - $FITMINTYPE = "MIGRAD\nMINOS"; - } elsif ( $Step eq "SIMPLEX" ) { - $FITMINTYPE = "SCAN\nSIMPLEX"; - } - - # Proper way if ( $All{"Minimization"} ne $EMPTY && $All{"ErrorCalc"} ne $EMPTY && $Step ne "PLOT" ) { $FITMINTYPE = $All{"Minimization"}."\n".$All{"ErrorCalc"}; } @@ -938,7 +137,7 @@ sub CreateMSRUni { my $PLT = 2; # For SingleHist fit - if ($All{"FitAsyType"} eq "SingleHist") { $PLT = 0;} + if ($All{"FitAsyType"} eq "SingleHist" ) { $PLT = 0;} # Need to select here RUNSAuto or RUNSManual # $RUNSType = 0 (Auto) or 1 (Manual) @@ -948,13 +147,12 @@ sub CreateMSRUni { # Remove spaces and other illegal characters $All{"RunNumbers"} =~ s/[\ \.\~\/\&\*\[\;\>\<\^\$\(\)\`\|\]\'\@]/,/g; $All{"RunNumbers"} =~ s/[a-zA-Z]//g; - # Expand hyphens + # Expand hyphens and colons $All{"RunNumbers"} = MSR::ExpandRunNumbers($All{"RunNumbers"}); # Split commas @RUNS=split( /,/, $All{"RunNumbers"}); $RUNSType = 0; - } - elsif ($All{"RunFiles"} ne $EMPTY) { + } elsif ($All{"RunFiles"} ne $EMPTY) { @RUNS=split( /,/, $All{"RunFiles"}); $RUNSType = 1; } @@ -966,9 +164,8 @@ sub CreateMSRUni { # range order my $Range_Order = 1; - my $iHist = 0; foreach my $RUN (@RUNS) { - if ($All{"FitAsyType"} eq "Asymmetry" || $All{"FitAsyType"} eq "AsyGLB") { + if ($All{"FitAsyType"} eq "Asymmetry" || $All{"FitAsyType"} eq "AsymmetryGLB") { # Prepare the Parameters and initial values block my $component = 0; my $Single_RUN = $EMPTY; @@ -1056,7 +253,7 @@ sub CreateMSRUni { $RUN = $RUNS[ $iRun - 1 ]; - $DEBUG = $DEBUG.MSR::CreateRUNBlk($RUN, $YEAR, $BeamLine, $All{"FitAsyType"}, $All{"LRBF"}, $All{"Tis"}, $All{"Tfs"}, $All{"BINS"}); + #$DEBUG = $DEBUG.MSR::CreateRUNBlk($RUN, $YEAR, $BeamLine, $All{"FitAsyType"}, $All{"LRBF"}, $All{"Tis"}, $All{"Tfs"}, $All{"BINS"}); my $RUN_Line = $EMPTY; if ($All{"RUNSType"}) { @@ -1106,9 +303,9 @@ sub CreateMSRUni { "$RUN_Line\n$Type_Line\n$Alpha_Line$Hist_Lines\n$T0DataBg$MAP_Line\n$FRANGE_Line\n$PAC_Line\n\n"; # This is from CreateRUNBlk - $DEBUG =~s /T0LINE/$T0_Line/; - $DEBUG =~s /BGLINE/$Bg_Line/; - $DEBUG =~s /DATALINE/$Data_Line/; + #$DEBUG =~s /T0LINE/$T0_Line/; + #$DEBUG =~s /BGLINE/$Bg_Line/; + #$DEBUG =~s /DATALINE/$Data_Line/; # Now add the appropriate values of fit range and packing my $Range_Min = 8; @@ -1132,13 +329,19 @@ sub CreateMSRUni { } } else { ####################################################################### - # 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! - # We distinguich between sharing among different runs to common parameters - # for different histograms. The first is done in the usual "Sharing" schame, - # while the second has to be done in the functions block. This can be done - # in a consistent, non-confusing algorithm + # 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! + + # We distinguich between sharing among different runs to + # common parameters for different histograms. The first is + # done in the usual "Sharing" schame, while the second has + # to be done in the functions block. This can be done in a + # consistent, non-confusing algorithm + + # iHist is the histogram counter, used to catch Phi + my $iHist = 1; foreach my $Hist (@Hists) { # Prepare the Parameters and initial values block my $component = 0; @@ -1160,7 +363,15 @@ sub CreateMSRUni { my @Params = split( /\s+/, $Parameters ); # Only the first histiograms has new physical parameters # the others keep only Phi if they have it - + if ($iHist != 1 ) { + # @Param contains only Phi + if (grep(/Phi/,@Params)) { + @Params=("Phi"); + } else { + @Params=(); + } + } + # For the first component we need No and NBg for SingleHist fits if ( $component == 1 ) { unshift( @Params, ( "No", "NBg" ) ); @@ -1168,7 +379,8 @@ sub CreateMSRUni { foreach my $Param (@Params) { my $Param_ORG = $Param; - $Param=$Param.$Hist; + # Tag with histogram number only No, NBg and Phi + if ($Param_ORG =~ m/^(No|NBg|Phi)/ ) {$Param=$Param.$Hist;} if ( ($#FitTypes != 0) && !( $Param_ORG =~ m/^(No|NBg)/ ) ) { $Param = join( $EMPTY, $Param, "_", "$component" ); } @@ -1208,21 +420,23 @@ sub CreateMSRUni { $NoBg_Line = $NoBg_Line . "backgr.fit $PCount\n"; } } - # End of No and NBg Lines # Start preparing the parameters block - if ($Shared) { - # Parameter is shared enough to keep order from first run - if ( $iRun == 1 ) { - $Full_T_Block =~ s/$Param_ORG/$PCount/; - ++$shcount; - ++$PCount; - } + if ((($Shared && $iRun == 1) || $#RUNS == 0) && $Param_ORG ne "Phi" ) { + # Do not map a parameter if + # - it is shared and this is the first run + # - this is a single run fit + # it is enough to keep order from first run + $Full_T_Block =~ s/$Param_ORG/$PCount/; + if ($Shared) {++$shcount;} + ++$PCount; } else { # Parameter is not shared, use map unless it is a single RUN fit # Skip adding to map line in these cases - if ( !( $Param_ORG =~ m/^(No|NBg)/ ) && ($#RUNS != 0 || $#Hist != 0)) { +# if ( !( $Param_ORG =~ m/^(No|NBg)/ ) && ($#RUNS != 0 || $#Hist != 0)) { + if ( !( $Param_ORG =~ m/^(No|NBg)/ ) ) { + $DEBUG = $DEBUG."# I am here: $Param_ORG\n"; ++$nonsh; $Full_T_Block =~ s/$Param_ORG/map$nonsh/; $MAP_Line = join( ' ', $MAP_Line, $PCount ); @@ -1241,7 +455,7 @@ sub CreateMSRUni { $RUN = $RUNS[ $iRun - 1 ]; - $DEBUG = $DEBUG.MSR::CreateRUNBlk($RUN, $YEAR, $BeamLine, $All{"FitAsyType"}, $All{"LRBF"}, $All{"Tis"}, $All{"Tfs"}, $All{"BINS"}); + #$DEBUG = $DEBUG.MSR::CreateRUNBlk($RUN, $YEAR, $BeamLine, $All{"FitAsyType"}, $All{"LRBF"}, $All{"Tis"}, $All{"Tfs"}, $All{"BINS"}); if ($All{"RUNSType"}) { $RUN_Line = MSR::RUNFileNameAuto($RUN,"0000",$EMPTY); @@ -1278,9 +492,9 @@ sub CreateMSRUni { . "$RUN_Line\n$Type_Line\n$NoBg_Line$Tmp_Hist_Line\n$Data_Line\n$MAP_Line\n$FRANGE_Line\n$PAC_Line\n\n"; # This is from CreateRUNBlk - $DEBUG =~s /T0LINE/$T0_Line/; - $DEBUG =~s /BGLINE/$Bg_Line/; - $DEBUG =~s /DATALINE/$Data_Line/; + #$DEBUG =~s /T0LINE/$T0_Line/; + #$DEBUG =~s /BGLINE/$Bg_Line/; + #$DEBUG =~s /DATALINE/$Data_Line/; # Now add the appropriate values of fit range and packing my $Range_Min = 8; @@ -1418,11 +632,13 @@ sub CreateMSRGLB { } else { @RUNS = split( /,/, MSR::ExpandRunNumbers($All{"RunNumbers"}) ); # Make example from first run - $All{"RunNumbers"}=$RUNS[0]; + $All{"RunNumbers"}=$RUNS[0]; } my ($Full_T_Block,$Paramcomp_ref,$MSRTemplate)= MSR::CreateMSRUni(\%All); +# It is better to call msr2data here, but can we do that without writing to the disk? Not yet. + # Return as usual my @Paramcomp = @$Paramcomp_ref; @@ -1802,56 +1018,10 @@ sub PrepParamTable { # Function return a Hash with a table of parameters for the fit # input should be # %All +# output is +# hash of parameter table +# %ParTable = PCount / $Param,$value,$error,$minvalue,$maxvalue,$RUN ######################## -# Take this information as input arguments -# "Smart" default value of the fit parameters. - my %Defaults = ( - "Asy", "0.20", "dAsy", "0.01", - "Asy_min", "0", "Asy_max", "0", - "Alpha", "1.0", "dAlpha", "0.01", - "Alpha_min", "0", "Alpha_max", "0", - "No", "300.0", "dNo", "0.01", - "No_min", "0", "No_max", "0", - "NBg", "30.0", "dNBg", "0.01", - "NBg_min", "0", "NBg_max", "0", - "Lam", "1.0", "dLam", "0.01", - "Lam_min", "0", "Lam_max", "0", - "Gam", "1.0", "dGam", "0.01", - "Gam_min", "0", "Gam_max", "0", - "Bet", "0.5", "dBet", "0.01", - "Bet_min", "0", "Bet_max", "0", - "Two", "2.0", "dTwo", "0.0", - "Two_min", "0", "Two_max", "0", - "Del", "0.1", "dDel", "0.01", - "Del_min", "0", "Del_max", "0", - "Sgm", "0.1", "dSgm", "0.01", - "Sgm_min", "0", "Sgm_max", "0", - "Aa", "60.", "dAa", "0.01", - "Aa_min", "0", "Aa_max", "0", - "q", "0.1", "dq", "0.01", - "q_min", "0", "q_max", "0", - "Bg", "0.036", "dBg", "0.01", - "Bg_min", "0", "Bg_max", "0", - "bgrlx", "0.", "dbgrlx", "0.0", - "bgrlx_min", "0", "bgrlx_max", "0", - "Frq", "1.0", "dFrq", "1.", - "Frq_min", "0", "Frq_max", "0", - "Frql", "1.0", "dFrql", "1.", - "Frql_min", "0", "Frql_max", "0", - "Frqg", "1.0", "dFrqg", "1.", - "Frqg_min", "0", "Frqg_max", "0", - "Field", "100.0", "dField", "1.", - "Field_min", "0", "Field_max", "0", - "Energy", "14.1", "dEnergy", "0.", - "Energy_min", "0", "Energy_max", "0", - "DeadLayer", "10.", "dDeadLayer", "0.1", - "DeadLayer_min", "0", "DeadLayer_max", "0", - "Lambda", "128.1", "dLambda", "0.1", - "Lambda_min", "0", "Lambda_max", "0", - "Phi", "1.", "dPhi", "0.01", - "Phi_min", "0", "Phi_max", "0" - ); - my $erradd = "d"; my $minadd = "_min"; my $maxadd = "_max"; @@ -1867,7 +1037,13 @@ sub PrepParamTable { if ($All{"RUNSType"}) { @RUNS = split( /,/, $All{"RunFiles"} ); } else { - @RUNS = split( /,/, $All{"RunNumbers"} ); + # Remove spaces and other illegal characters + $All{"RunNumbers"} =~ s/[\ \.\~\/\&\*\[\;\>\<\^\$\(\)\`\|\]\'\@]/,/g; + $All{"RunNumbers"} =~ s/[a-zA-Z]//g; + # Expand hyphens and colons + $All{"RunNumbers"} = MSR::ExpandRunNumbers($All{"RunNumbers"}); + # Split commas + @RUNS=split( /,/, $All{"RunNumbers"}); } my @Hists = split( /,/, $All{"LRBF"} ); @@ -1890,20 +1066,20 @@ sub PrepParamTable { my $Component=1; foreach my $RUN (@RUNS) { - $iRun++; - $Component=1; - if ($All{"FitAsyType"} eq "Asymmetry" || $All{"FitAsyType"} eq "AsyGLB") { - foreach my $FitType (@FitTypes) { - my $Parameters=$Paramcomp[$Component-1]; - my @Params = split( /\s+/, $Parameters ); + $iRun++; + $Component=1; + if ($All{"FitAsyType"} eq "Asymmetry" || $All{"FitAsyType"} eq "AsymmetryGLB") { + foreach my $FitType (@FitTypes) { + my $Parameters=$Paramcomp[$Component-1]; + my @Params = split( /\s+/, $Parameters ); if ( $Component == 1 ) { unshift( @Params, "Alpha" ); } -# This is the counter for parameters of this component + # This is the counter for parameters of this component my $NP=1; $Shared = 0; -# Change state/label of parameters + # Change state/label of parameters foreach my $Param (@Params) { my $Param_ORG = $Param; if ( $#FitTypes != 0 && ( $Param ne "Alpha" ) ){ @@ -1912,31 +1088,36 @@ sub PrepParamTable { $Shared = $All{"Sh_$Param"}; if ( $Shared!=1 || $iRun == 1 ) { -# It there are multiple runs index the parameters accordingly + # It there are multiple runs index the + # parameters accordingly my $RUNtmp = sprintf("%04d",$RUN); if ($All{"RUNSType"}) { $RUNtmp = $iRun; } if ($Shared!=1) {$Param=$Param."_".$RUNtmp;} -# Check if this parameter has been initialized befor. If not take from defaults + # Check if this parameter has been initialized + # befor. If not take from defaults $value = $All{"$Param"}; if ( $value ne $EMPTY ) { $error = $All{"$erradd$Param"}; $minvalue = $All{"$Param$minadd"}; $maxvalue = $All{"$Param$maxadd"}; } else { -# I need this although it is already in the MSR.pm module, just for this table -# We can remove it from the MSR module later... -# Or keep in the MSR as function ?? + # I need this although it is already in + # the MSR.pm module, just for this table + # We can remove it from the MSR module + # later... Or keep in the MSR as function + # ?? - -# We have two options here, either take default values or take values of previous -# run if available -# $ParamPrev =~ s/$iRun-1/$iRun/g; - $value = $Defaults{$Param_ORG}; - $error = $Defaults{ join( $EMPTY, $erradd, $Param_ORG ) }; - $minvalue = $Defaults{ join($EMPTY, $Param_ORG, $minadd ) }; - $maxvalue = $Defaults{ join($EMPTY, $Param_ORG, $maxadd ) }; + # We have two options here, either take + # default values or take values of + # previous run if available + + # $ParamPrev =~ s/$iRun-1/$iRun/g; + $value = MSR::Defaults{$Param_ORG}; + $error = MSR::Defaults{ join( $EMPTY, $erradd, $Param_ORG ) }; + $minvalue = MSR::Defaults{ join($EMPTY, $Param_ORG, $minadd ) }; + $maxvalue = MSR::Defaults{ join($EMPTY, $Param_ORG, $maxadd ) }; } $values=join(",",$Param,$value,$error,$minvalue,$maxvalue,$RUN); $ParTable{$PCount}=$values; @@ -1944,52 +1125,69 @@ sub PrepParamTable { } $NP++; } - $Component++; - } - } - elsif ($All{"FitAsyType"} eq "SingleHist" || $All{"FitAsyType"} eq "SingHistGLB") { -# For a single histogram fit we basically need to repeat this for each hist - foreach my $Hist (@Hists) { - $Component=1; + $Component++; + } + } else { + # For a single histogram fit we basically need to repeat + # this for each hist + my $iHist = 1; + foreach my $Hist (@Hists) { + $Component=1; foreach my $FitType (@FitTypes) { my $Parameters=$Paramcomp[$Component-1]; - my @Params = split( /\s+/, $Parameters ); + my @Params = split( /\s+/, $Parameters ); + # Only the first Hist gets new physical + # parameters, the rest only Phi if present + if ($iHist != 1 ) { + # does @Param contains only Phi + if (grep(/Phi/,@Params)) { + @Params=("Phi"); + } else { + @Params=(); + } + } if ( $Component == 1 ) { unshift( @Params, ( "No", "NBg" ) ); } -# This is the counter for parameters of this component + # This is the counter for parameters of this component my $NP=1; $Shared = 0; -# Change state/label of parameters + # Change state/label of parameters foreach my $Param (@Params) { my $Param_ORG = $Param; - # If multiple histograms (sum or difference) take the first histogram only + # If multiple histograms (sum or difference) + # take the first histogram only ($Hist,$tmp) = split(/ /,$Hist); - $Param=$Param.$Hist; + # Tag with histogram number only No, NBg and Phi + if ($Param_ORG =~ m/^(No|NBg|Phi)/ ) {$Param=$Param.$Hist;} if ( $#FitTypes != 0 && ( $Param_ORG ne "No" && $Param_ORG ne "NBg" ) ){ $Param = join( $EMPTY, $Param, "_", "$Component" ); } $Shared = $All{"Sh_$Param"}; if ( $Shared!=1 || $iRun == 1 ) { -# It there are multiple runs index the parameters accordingly + # It there are multiple runs index the parameters accordingly my $RUNtmp=sprintf("%04d",$RUN); if ($Shared!=1) {$Param=$Param."_".$RUNtmp;} -# Check if this parameter has been initialized befor. If not take from defaults + # Check if this parameter has been + # initialized befor. If not take from + # defaults $value = $All{"$Param"}; if ( $value ne $EMPTY ) { $error = $All{"$erradd$Param"}; $minvalue = $All{"$Param$minadd"}; $maxvalue = $All{"$Param$maxadd"}; } else { -# I need this although it is already in the MSR.pm module, just for this table -# We can remove it from the MSR module later... -# Or keep in the MSR as function ?? - $value = $Defaults{$Param_ORG}; - $error = $Defaults{ join( $EMPTY, $erradd, $Param_ORG ) }; - $minvalue = $Defaults{ join($EMPTY, $Param_ORG, $minadd ) }; - $maxvalue = $Defaults{ join($EMPTY, $Param_ORG, $maxadd ) }; + # I need this although it is already + # in the MSR.pm module, just for this + # table We can remove it from the MSR + # module later... Or keep in the MSR + # as function ?? + $value = MSR::Defaults{$Param_ORG}; + $error = MSR::Defaults{ join( $EMPTY, $erradd, $Param_ORG ) }; + $minvalue = MSR::Defaults{ join($EMPTY, $Param_ORG, $minadd ) }; + $maxvalue = MSR::Defaults{ join($EMPTY, $Param_ORG, $maxadd ) }; } $values=join(",",$Param,$value,$error,$minvalue,$maxvalue,$RUN); $ParTable{$PCount}=$values; @@ -1999,9 +1197,9 @@ sub PrepParamTable { } $Component++; } + ++$iHist; } } - } return %ParTable; } @@ -2012,12 +1210,14 @@ sub ExportParams { # Function return a tab separated table of parameters for the fit # input should be # %All +# output is +# $TABLE containing an ascii table of fit parameters ######################## my $erradd = "d"; my $minadd = "_min"; my $maxadd = "_max"; -# First assume nothing is shared + # First assume nothing is shared my $Shared = 0; my $TABLE=$EMPTY; @@ -2029,7 +1229,13 @@ sub ExportParams { if ($All{"RUNSType"}) { @RUNS = split( /,/, $All{"RunFiles"} ); } else { - @RUNS = split( /,/, $All{"RunNumbers"} ); + # Remove spaces and other illegal characters + $All{"RunNumbers"} =~ s/[\ \.\~\/\&\*\[\;\>\<\^\$\(\)\`\|\]\'\@]/,/g; + $All{"RunNumbers"} =~ s/[a-zA-Z]//g; + # Expand hyphens and colons + $All{"RunNumbers"} = MSR::ExpandRunNumbers($All{"RunNumbers"}); + # Split commas + @RUNS=split( /,/, $All{"RunNumbers"}); } my @Hists = split( /,/, $All{"LRBF"} ); @@ -2037,14 +1243,15 @@ sub ExportParams { foreach my $FitType ($All{"FitType1"}, $All{"FitType2"}, $All{"FitType3"}) { if ( $FitType ne "None" ) { push( @FitTypes, $FitType ); } } -# Get theory block to determine the size of the table + # Get theory block 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"}; + # 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"}; -# Then loop over expected parameters and extract their values and error bar + # Then loop over expected parameters and extract their values and + # error bar my $PCount =0; my $iRun =0; my $value =0; @@ -2065,10 +1272,10 @@ sub ExportParams { unshift( @Params, "Alpha" ); } -# This is the counter for parameters of this component + # This is the counter for parameters of this component my $NP=1; $Shared = 0; -# Change state/label of parameters + # Change state/label of parameters foreach my $Param (@Params) { my $Param_ORG = $Param; if ( $#FitTypes != 0 && ( $Param ne "Alpha" ) ){ @@ -2081,10 +1288,12 @@ sub ExportParams { $Shared = $All{"Sh_$Param"}; if ( $Shared!=1 || $iRun == 1 ) { -# If there are multiple runs index the parameters accordingly + # If there are multiple runs index the + # parameters accordingly my $RUNtmp=sprintf("%04d",$RUN); if ($Shared!=1) {$Param=$Param."_".$RUNtmp;} -# Check if this parameter has been initialized befor. (should be) + # Check if this parameter has been initialized + # befor. (should be) $value = $All{"$Param"}; $error = $All{"$erradd$Param"}; @@ -2092,7 +1301,8 @@ sub ExportParams { $PCount++; } elsif ($Shared==1) { -# The parameter is shared, take the value from the first run + # The parameter is shared, take the value from + # the first run $Param=$Param; $value = $All{"$Param"}; $error = $All{"$erradd$Param"}; @@ -2104,7 +1314,8 @@ sub ExportParams { } } elsif ($All{"FitAsyType"} eq "SingleHist" ) { -# For a single histogram fit we basically need to repeat this for each hist + # For a single histogram fit we basically need to repeat + # this for each hist foreach my $Hist (@Hists) { $Component=1; foreach my $FitType (@FitTypes) { @@ -2114,23 +1325,27 @@ sub ExportParams { unshift( @Params, ( "No", "NBg" ) ); } -# This is the counter for parameters of this component + # This is the counter for parameters of this + # component my $NP=1; $Shared = 0; -# Change state/label of parameters + # Change state/label of parameters foreach my $Param (@Params) { my $Param_ORG = $Param; - $Param=$Param.$Hist; + # Tag with histogram number only No, NBg and Phi + if ($Param_ORG =~ m/^(No|NBg|Phi)/ ) {$Param=$Param.$Hist;} if ( $#FitTypes != 0 && ( $Param_ORG ne "No" && $Param_ORG ne "NBg" ) ){ $Param = join( $EMPTY, $Param, "_", "$Component" ); } $Shared = $All{"Sh_$Param"}; if ( $Shared!=1 || $iRun == 1 ) { -# If there are multiple runs index the parameters accordingly + # If there are multiple runs index the + # parameters accordingly my $RUNtmp=sprintf("%04d",$RUN); if ($Shared!=1) {$Param=$Param."_".$RUNtmp;} -# Check if this parameter has been initialized befor. (should be) + # Check if this parameter has been + # initialized befor. (should be) $value = $All{"$Param"}; $error = $All{"$erradd$Param"}; $minvalue = $All{"$Param$minadd"}; @@ -2521,8 +1736,8 @@ sub CreateRUNBlk { # Split the histograms my @Hists = split( /,/, $LRBF ); $Fit_Type = 0; - if ($FitAsyType eq "Asymmetry" || $FitAsyType eq "AsyGLB") { - $Fit_Type = 2; + if ($FitAsyType eq "Asymmetry" || $FitAsyType eq "AsymmetryGLB") { + $Fit_Type = 2; } $RUN_Block =~ s/RUN_LINE/$RUN_Line/; @@ -2581,7 +1796,9 @@ FRQRANGE"; } sub ExpandRunNumbers { -# Subroutine to conver hyphens in the RunNumbers into a series of comma separated runs +# Subroutine to conver RunNumbers string into comma separated array +# following the msr2data notations; hyphens denote from-to and a colon +# denotes a loop with steps from:to:step my ($RunNumbers) = @_; # Split by commas @RUNS=split( /,/, $RunNumbers); @@ -2593,10 +1810,93 @@ sub ExpandRunNumbers { my @Series = ($Begin..$End); # Join the expanded series using commas my $RunJoined = join(',',@Series); - # Replace the original hyphens by the expanded series - $RunNumbers =~ s/$tmp/$RunJoined/; + # Replace the original hyphens by the expanded series + $RunNumbers =~ s/$tmp/$RunJoined/; + } + # Find array members that include a colon (:) + my @RUNLoops = grep { /\:/ } @RUNS; + foreach my $tmp (@RUNLoops) { + # Each item that includes a colon is expanded as from:to:step array + my ($Begin,$End,$Step)=split(':',$tmp); + if ($Begin>$End) { + # Swap $Begin and $End + my $tmpBegin = $Begin; + $Begin = $End; + $End = $tmpBegin; + } + my @Series = (); + for (my $i = $Begin; $i<=$End; $i += $Step) { + push(@Series,$i); + } + # Join the expanded series using commas + my $RunJoined = join(',',@Series); + # Replace the original hyphens by the expanded series + $RunNumbers =~ s/$tmp/$RunJoined/; } return $RunNumbers; } +sub Defaults { +######################## +# Defaults +# Function return a default value of parameter +# input should be +# $Parameter +# output is +# $value +######################## +# Take this information as input arguments +# "Smart" default value of the fit parameters. + my ($Param)=@_; + + my %Defaults = ( + "Asy", "0.20", "dAsy", "0.01", + "Asy_min", "0", "Asy_max", "0", + "Alpha", "1.0", "dAlpha", "0.01", + "Alpha_min", "0", "Alpha_max", "0", + "No", "300.0", "dNo", "0.01", + "No_min", "0", "No_max", "0", + "NBg", "30.0", "dNBg", "0.01", + "NBg_min", "0", "NBg_max", "0", + "Lam", "1.0", "dLam", "0.01", + "Lam_min", "0", "Lam_max", "0", + "Gam", "1.0", "dGam", "0.01", + "Gam_min", "0", "Gam_max", "0", + "Bet", "0.5", "dBet", "0.01", + "Bet_min", "0", "Bet_max", "0", + "Two", "2.0", "dTwo", "0.0", + "Two_min", "0", "Two_max", "0", + "Del", "0.1", "dDel", "0.01", + "Del_min", "0", "Del_max", "0", + "Sgm", "0.1", "dSgm", "0.01", + "Sgm_min", "0", "Sgm_max", "0", + "Aa", "60.", "dAa", "0.01", + "Aa_min", "0", "Aa_max", "0", + "q", "0.1", "dq", "0.01", + "q_min", "0", "q_max", "0", + "Bg", "0.036", "dBg", "0.01", + "Bg_min", "0", "Bg_max", "0", + "bgrlx", "0.", "dbgrlx", "0.0", + "bgrlx_min", "0", "bgrlx_max", "0", + "Frq", "1.0", "dFrq", "1.", + "Frq_min", "0", "Frq_max", "0", + "Frql", "1.0", "dFrql", "1.", + "Frql_min", "0", "Frql_max", "0", + "Frqg", "1.0", "dFrqg", "1.", + "Frqg_min", "0", "Frqg_max", "0", + "Field", "100.0", "dField", "1.", + "Field_min", "0", "Field_max", "0", + "Energy", "14.1", "dEnergy", "0.", + "Energy_min", "0", "Energy_max", "0", + "DeadLayer", "10.", "dDeadLayer", "0.1", + "DeadLayer_min", "0", "DeadLayer_max", "0", + "Lambda", "128.1", "dLambda", "0.1", + "Lambda_min", "0", "Lambda_max", "0", + "Phi", "1.", "dPhi", "0.01", + "Phi_min", "0", "Phi_max", "0" + ); + + return $Defaults{$Param}; +} + 1; diff --git a/src/external/MuSRFitGUI/MuSRFit4.pm b/src/external/MuSRFitGUI/MuSRFit4.pm index a589f149..8fba7235 100644 --- a/src/external/MuSRFitGUI/MuSRFit4.pm +++ b/src/external/MuSRFitGUI/MuSRFit4.pm @@ -282,13 +282,12 @@ sub CreateAllInput() $All{"LRBF"} = this->{ui}->histsLRBF->text; my @Hists = split(/,/, $All{"LRBF"} ); # Lifetime corrections in enabled/visible only for SingleHis fits - if ( $All{"FitAsyType"} eq "Asymmetry" ) { - this->{ui}->ltc->setHidden(1); - $All{"fittype"}=2; - } - elsif ( $All{"FitAsyType"} eq "SingleHist" ) { + if ( $All{"FitAsyType"} eq "SingleHist" ) { this->{ui}->ltc->setHidden(0); $All{"fittype"}=0; + } else { + this->{ui}->ltc->setHidden(1); + $All{"fittype"}=2; } # From Fitting Tab @@ -419,10 +418,9 @@ sub CreateAllInput() my $Parameters=$Paramcomp[$Component-1]; my @Params = split( /\s+/, $Parameters ); - if ( $Component == 1 && $All{"FitAsyType"} eq "Asymmetry" ) { + if ( $Component == 1 && ($All{"FitAsyType"} eq "Asymmetry" || $All{"FitAsyType"} eq "AsymmetryGLB" )) { unshift( @Params, "Alpha" ); - } - elsif ( $Component == 1 && $All{"FitAsyType"} eq "SingleHist" ) { + } elsif ( $Component == 1 && $All{"FitAsyType"} eq "SingleHist" ) { unshift( @Params, ( "No", "NBg" ) ); } @@ -441,7 +439,7 @@ sub CreateAllInput() } # Is there any point of sharing, multiple runs? - if ( $#RUNS == 0 && $All{"FitAsyType"} eq "Asymmetry") { + if ( $#RUNS == 0 && ($All{"FitAsyType"} eq "Asymmetry" || $All{"FitAsyType"} eq "AsymmetryGLB")) { $Shared = 1; } elsif ( $#RUNS == 0 && $#Hists == 0 && $All{"FitAsyType"} eq "SingleHist" ) { @@ -532,49 +530,54 @@ sub CallMSRCreate() } if ($Answer) { - if ( $All{"FitAsyType"} eq "Asymmetry" ) { + if ( $All{"FitAsyType"} eq "Asymmetry") { if ($All{"RUNSType"}) { - my ($Full_T_Block,$Paramcomp_ref,$FullMSRFile)= MSR::CreateMSR(\%All); + my ($Full_T_Block,$Paramcomp_ref,$FullMSRFile)= MSR::CreateMSRUni(\%All); # Open output file FILENAME.msr open( OUTF,q{>},"$FILENAME" ); print OUTF ("$FullMSRFile"); close(OUTF); } else { - my ($Full_T_Block,$Paramcomp_ref,$FullMSRFile)= MSR::CreateMSR(\%All); + my ($Full_T_Block,$Paramcomp_ref,$FullMSRFile)= MSR::CreateMSRUni(\%All); # Open output file FILENAME.msr open( OUTF,q{>},"$FILENAME" ); print OUTF ("$FullMSRFile"); close(OUTF); -# if it is multiple runs then the produced file is a template - my $FILENAME=$All{"FILENAME"}.".msr"; - my $Extension = "_".$All{"BeamLine"}."_".$All{"YEAR"}; - if ($All{"BeamLine"} eq "LEM (PPC)") { - $Extension = "_LEM_".$All{"YEAR"}; - } - - if (-e $FILENAME) { - my $RUN0 = $FILENAME; - $RUN0 =~ s/$Extension//g; - $RUN0 =~ s/.msr//g; - my $cmd = $All{"RunNumbers"}; - $cmd =~ s/,/ /g; - $cmd = "msr2data \[".$cmd."\] ".$Extension." msr-".$RUN0." global"; - $cmd = $cmd."; mv $RUN0+global$Extension.msr ".$FILENAME; - print $cmd."\n"; - my $pid = open(FTO,"$cmd 2>&1 |"); - while () { - this->{ui}->fitTextOutput->append("$_"); - } - close(FTO); - } } - } - elsif ( $All{"FitAsyType"} eq "SingleHist" ) { - my ($Full_T_Block,$Paramcomp_ref,$FullMSRFile)= MSR::CreateMSRSingleHist(\%All); -# Open output file FILENAME.msr - open( OUTF,q{>},"$FILENAME" ); + } else { + my ($Full_T_Block,$Paramcomp_ref,$FullMSRFile)= MSR::CreateMSRGLB(\%All); + my @RUNS = split( /,/,MSR::ExpandRunNumbers($All{"RunNumbers"})); + my @Hists = split( /,/, $All{"LRBF"} ); + # Write to template file + open( OUTF,q{>},"$RUNS[0]_tmpl.msr" ); print OUTF ("$FullMSRFile"); close(OUTF); + + # Change runs line in the final global fit + my $NSpectra = ($#RUNS+1)*($#Hists+1); + my $NewRunLine = "runs ".join(" ",(1...$NSpectra)); + # Use msr2data to generate global fit MSR file + my $RunList = join(" ",@RUNS); + my $cmd = "msr2data \[".$RunList."\] "." _tmpl msr-".$RUNS[0]." global"; + # create the global file + print $cmd."\n"; + my $pid = open(FTO,"$cmd 2>&1 |"); + while () { + this->{ui}->fitTextOutput->append("$_"); + } + close(FTO); + # change the stupid name + my $StupidName = $RUNS[0]."+global_tmpl.msr"; + # change stupid default runs line + $cmd = "cp $StupidName $FILENAME; perl -pi -e 's/runs.*?(?=\n)/$NewRunLine/s' $FILENAME"; + $pid = open(FTO,"$cmd 2>&1 |"); + print $cmd."\n"; + while () { + this->{ui}->fitTextOutput->append("$_"); + } + close(FTO); + # feed in values of parameters if they exist + } UpdateMSRFileInitTable(); } @@ -614,7 +617,8 @@ sub UpdateMSRFileInitTable() # if it is last element or there are two more = positive error, check $#Param=5/7 # if there is only one more = minimum, check $#Param=6 -# To summarize, check the value of $#Param + # To summarize, check the value of $#Param + my $name=$Param[2]; my $value=1.0*$Param[3]; my $error = 1.0*$Param[4]; my $minvalue=0.0; @@ -640,6 +644,8 @@ sub UpdateMSRFileInitTable() $QTable->setItem($PCount,1,Qt::TableWidgetItem()); $QTable->setItem($PCount,2,Qt::TableWidgetItem()); $QTable->setItem($PCount,3,Qt::TableWidgetItem()); + # Set also label or row + $QTable->verticalHeaderItem($PCount)->setText($name); $QTable->item($PCount,0)->setText($value); $QTable->item($PCount,1)->setText($error); $QTable->item($PCount,2)->setText($minvalue); @@ -710,7 +716,7 @@ sub ActivateShComp() my $Parameters=$Paramcomp[$Component-1]; my @Params = split( /\s+/, $Parameters ); - if ( $Component == 1 && $All{"FitAsyType"} eq "Asymmetry" ) { + if ( $Component == 1 && ($All{"FitAsyType"} eq "Asymmetry" || $All{"FitAsyType"} eq "AsymmetryGLB")) { unshift( @Params, "Alpha" ); } elsif ( $Component == 1 && $All{"FitAsyType"} eq "SingleHist" ) { @@ -821,7 +827,7 @@ sub GoFit() # Check here is the number of histograms makes sense # other wise give error. my @Hists = split( /,/, $All{"LRBF"} ); - if ($All{"FitAsyType"} eq "Asymmetry" && $#Hists != 1) { + if (($All{"FitAsyType"} eq "Asymmetry" || $All{"FitAsyType"} eq "AsymmetryGLB") && $#Hists != 1) { # we have a problem here send error message my $Warning = "Error: The number of histograms should be 2 for an asymmetry fit!"; my $WarningWindow = Qt::MessageBox::information( this, "Error",$Warning); @@ -856,7 +862,7 @@ sub GoPlot() # Check here is the number of histograms makes sense # other wise give error. my @Hists = split( /,/, $All{"LRBF"} ); - if ($All{"FitAsyType"} eq "Asymmetry" && $#Hists != 1) { + if (($All{"FitAsyType"} eq "Asymmetry" || $All{"FitAsyType"} eq "AsymmetryGLB") && $#Hists != 1) { # we have a problem here send error message my $Warning = "Error: The number of histograms should be 2 for an asymmetry fit!"; my $WarningWindow = Qt::MessageBox::information( this, "Error",$Warning); @@ -1019,7 +1025,7 @@ sub InitializeFunctions() my @Params = split( /\s+/, $Parameters ); # Alpha, No and NBg are counted in the parameters - if ( $Component == 1 && $All{"FitAsyType"} eq "Asymmetry" ) { + if ( $Component == 1 && ($All{"FitAsyType"} eq "Asymmetry" || $All{"FitAsyType"} eq "AsymmetryGLB" )) { unshift( @Params, "Alpha" ); } elsif ( $Component == 1 && $All{"FitAsyType"} eq "SingleHist" ) { diff --git a/src/external/MuSRFitGUI/MuSRFit4.ui b/src/external/MuSRFitGUI/MuSRFit4.ui index a8ce1a1e..0c452720 100644 --- a/src/external/MuSRFitGUI/MuSRFit4.ui +++ b/src/external/MuSRFitGUI/MuSRFit4.ui @@ -231,7 +231,7 @@ - Asymmetry + Asymmetry GLB @@ -241,12 +241,7 @@ - Asymmetry GLB - - - - - Single Hist GLB + Asymmetry diff --git a/src/external/MuSRFitGUI/Ui_MuSRFit4.pm b/src/external/MuSRFitGUI/Ui_MuSRFit4.pm index 4ac83c51..d3b05fb9 100644 --- a/src/external/MuSRFitGUI/Ui_MuSRFit4.pm +++ b/src/external/MuSRFitGUI/Ui_MuSRFit4.pm @@ -5,7 +5,7 @@ ################################################################################# ## Form generated from reading UI file 'MuSRFit4.ui' ## -## Created: Mon Jan 29 14:11:03 2018 +## Created: Mon Feb 5 15:38:20 2018 ## by: Qt User Interface Compiler version 4.8.7 ## ## WARNING! All changes made in this file will be lost when recompiling UI file! @@ -3199,10 +3199,9 @@ sub retranslateUi { $self->{browse}->setWhatsThis( Qt::Application::translate( 'MuSRFit4', "Browse to select data files for fitting.", undef, Qt::Application::UnicodeUTF8() ) ); $self->{browse}->setText( Qt::Application::translate( 'MuSRFit4', "Browse", undef, Qt::Application::UnicodeUTF8() ) ); $self->{fitAsyTypeLabel}->setText( Qt::Application::translate( 'MuSRFit4', "Fit type", undef, Qt::Application::UnicodeUTF8() ) ); - $self->{fitAsyType}->insertItems(0, [Qt::Application::translate( 'MuSRFit4', "Asymmetry", undef, Qt::Application::UnicodeUTF8() ), + $self->{fitAsyType}->insertItems(0, [Qt::Application::translate( 'MuSRFit4', "Asymmetry GLB", undef, Qt::Application::UnicodeUTF8() ), Qt::Application::translate( 'MuSRFit4', "Single Hist", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Asymmetry GLB", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Single Hist GLB", undef, Qt::Application::UnicodeUTF8() )]); + Qt::Application::translate( 'MuSRFit4', "Asymmetry", undef, Qt::Application::UnicodeUTF8() )]); $self->{histsLRBFLabel}->setText( Qt::Application::translate( 'MuSRFit4', "Histograms list", undef, Qt::Application::UnicodeUTF8() ) ); $self->{histsLRBF}->setText( Qt::Application::translate( 'MuSRFit4', "1 5,3 7", undef, Qt::Application::UnicodeUTF8() ) ); $self->{runsAuto}->setTitle( Qt::Application::translate( 'MuSRFit4', "RUN Numbers", undef, Qt::Application::UnicodeUTF8() ) ); From cf584ae117ee0c36131dec8e3965a35ac7d6317d Mon Sep 17 00:00:00 2001 From: Zaher Salman Date: Tue, 6 Feb 2018 17:43:25 +0100 Subject: [PATCH 3/6] Use msr2data for single histogram fits --- src/external/MuSRFitGUI/MuSRFit4.pm | 125 ++++++++++++++++++++-------- 1 file changed, 91 insertions(+), 34 deletions(-) diff --git a/src/external/MuSRFitGUI/MuSRFit4.pm b/src/external/MuSRFitGUI/MuSRFit4.pm index 8fba7235..b22fdc55 100644 --- a/src/external/MuSRFitGUI/MuSRFit4.pm +++ b/src/external/MuSRFitGUI/MuSRFit4.pm @@ -421,7 +421,18 @@ sub CreateAllInput() if ( $Component == 1 && ($All{"FitAsyType"} eq "Asymmetry" || $All{"FitAsyType"} eq "AsymmetryGLB" )) { unshift( @Params, "Alpha" ); } elsif ( $Component == 1 && $All{"FitAsyType"} eq "SingleHist" ) { - unshift( @Params, ( "No", "NBg" ) ); + if (grep(/Phi/,@Params)) { + # remove the Phi and put it back for each histogram + @Params = grep ! /Phi/,@Params; + # for each histogram + foreach my $Hist (@Hists) { + # take only first histogram from sum + ($Hist,my $tmp) = split(/ /,$Hist); + # Doesn't make sense to share No or NBg! + # unshift( @Params, ( "N0$Hist", "NBg$Hist", "Phi$Hist" ) ); + push(@Params,"Phi$Hist"); + } + } } # This is the counter for parameters of this component @@ -431,27 +442,25 @@ sub CreateAllInput() foreach my $Param (@Params) { my $Param_ORG = $Param; # TODO: I need to take care of single hist fits here - if ( $All{"FitAsyType"} eq "SingleHist" ) { - $Param=$Param.$Hists[0]; - } +# if ( $All{"FitAsyType"} eq "SingleHist" ) { +# $Param=$Param.$Hists[0]; +# } if ( $#FitTypes != 0 && ( $Param ne "Alpha" && $Param ne "No" && $Param ne "NBg" ) ){ $Param = join( "", $Param, "_", $Component); } # Is there any point of sharing, multiple runs? - if ( $#RUNS == 0 && ($All{"FitAsyType"} eq "Asymmetry" || $All{"FitAsyType"} eq "AsymmetryGLB")) { - $Shared = 1; - } - elsif ( $#RUNS == 0 && $#Hists == 0 && $All{"FitAsyType"} eq "SingleHist" ) { + if ( $#RUNS == 0 ) { $Shared = 1; } else { # Check if shared or not, construct name of checkbox, find its handle and then -# check if it is checked +# check if it is checked my $ChkName="shParam_".$Component."_".$NP; my $ChkBx = child("Qt::Widget",$ChkName); $Shared = $ChkBx->isChecked(); } $All{"Sh_$Param"}=$Shared; + print "Param $Param is $Shared\n"; $NP++; } #Loop on parameters @@ -577,7 +586,30 @@ sub CallMSRCreate() } close(FTO); # feed in values of parameters if they exist - + my $wholefile = ""; + my $newline = ""; + {open (MSRF,q{<},"$FILENAME" ); + local $/ = undef; + $wholefile = ; + close(MSRF);} + my %PTable=MSR::PrepParamTable(\%All); + my $NParam=keys( %PTable ); + for (my $iP=0;$iP<$NParam;$iP++) { + my ($Param,$value,$error,$minvalue,$maxvalue,$RUNtmp) = split(/,/,$PTable{$iP}); + if (defined($All{"$Param"})) { + # replace the corresponding $Param line + if ( $All{"$Param\_min"} == $All{"$Param\_max"} ) { + $All{"$Param\_min"} = ""; + $All{"$Param\_max"} = ""; + } + $newline = join(" ",($Param,$All{"$Param"},$All{"d$Param"},$All{"d$Param"},$All{"$Param\_min"},$All{"$Param\_max"})); + $wholefile =~ s/$Param.*/$newline/; + } + } + # Now rewrite the msr file + open (MSRF,q{>},"$FILENAME" ); + print MSRF $wholefile; + close(MSRF); } UpdateMSRFileInitTable(); } @@ -593,7 +625,7 @@ sub UpdateMSRFileInitTable() if (-e "$FILENAME.msr") { open (MSRF,q{<},"$FILENAME.msr" ); @lines = ; - close(IFILE); + close(MSRF); } this->{ui}->textMSROutput->setText(""); foreach my $line (@lines) { @@ -685,6 +717,7 @@ sub ActivateShComp() { my %All=CreateAllInput(); my @RUNS = split( /,/, MSR::ExpandRunNumbers($All{"RunNumbers"}) ); + my @Hists = split( /,/, $All{"LRBF"} ); # Hide all sharing components this->{ui}->sharingComp1->setHidden(1); @@ -718,9 +751,20 @@ sub ActivateShComp() if ( $Component == 1 && ($All{"FitAsyType"} eq "Asymmetry" || $All{"FitAsyType"} eq "AsymmetryGLB")) { unshift( @Params, "Alpha" ); - } - elsif ( $Component == 1 && $All{"FitAsyType"} eq "SingleHist" ) { - unshift( @Params, ( "No", "NBg" ) ); + } elsif ( $Component == 1 && $All{"FitAsyType"} eq "SingleHist" ) { + if (grep(/Phi/,@Params)) { + # remove the Phi and put it back for each histogram + @Params = grep ! /Phi/,@Params; + # for each histogram + foreach my $Hist (@Hists) { + # take only first histogram from sum + ($Hist,my $tmp) = split(/ /,$Hist); + # Doesn't make sense to share No or NBg! + # unshift( @Params, ( "N0$Hist", "NBg$Hist", "Phi$Hist" ) ); + push(@Params,"Phi$Hist"); + } + } + # unshift( @Params, ( "No", "NBg" ) ); } @@ -776,12 +820,10 @@ sub InitializeTab() $QTable->setNumRows($NParam); } -# for (my $i=0;$i<$NParam;$i++) {print "Line=$PTable{$i}\n";} - - # Fill the table with labels and values of parameter for (my $PCount=0;$PCount<$NParam;$PCount++) { my ($Param,$value,$error,$minvalue,$maxvalue,$RUN) = split(/,/,$PTable{$PCount}); +# print $PTable{$PCount}."\n"; # Now make sure we have no nans if ($error eq "nan") { $error=0.1;} # Make sure items exist before addressing them @@ -805,14 +847,17 @@ sub TabChanged() { # TODO: First check if there are some runs given, otherwise disbale my %All=CreateAllInput(); - -# First make sure we have sharing initialized - ActivateShComp(); -# Here we need to apply sharing if selected... - InitializeTab(); - UpdateMSRFileInitTable(); -# And also setup T0 and Bg bins - ActivateT0Hists(); + my $curTab = this->{ui}->musrfit_tabs->currentIndex(); + if ($curTab >= 2 && $curTab <= 4) { + # First make sure we have sharing initialized + ActivateShComp(); + # Here we need to apply sharing if selected... + InitializeTab(); + UpdateMSRFileInitTable(); + } elsif ($curTab == 7) { + # And also setup T0 and Bg bins + ActivateT0Hists(); + } # Initialize FUNCTIONS block only if it has not been initialized yet if ($All{"Func_T_Block"} eq "" ) { @@ -823,6 +868,7 @@ sub TabChanged() sub GoFit() { + # This function should be able to do both plot and fit, check who called you. my %All=CreateAllInput(); # Check here is the number of histograms makes sense # other wise give error. @@ -834,17 +880,15 @@ sub GoFit() } else { this->{ui}->musrfit_tabs->setCurrentIndex(1); my $Answer=CallMSRCreate(); + my $FILENAME=$All{"FILENAME"}.".msr"; if ($Answer) { - my $FILENAME=$All{"FILENAME"}.".msr"; if (-e $FILENAME) { - my $cmd="musrfit -t $FILENAME"; + my $cmd="musrfit -t $FILENAME; musrview $FILENAME &"; my $pid = open(FTO,"$cmd 2>&1 |"); while () { this->{ui}->fitTextOutput->insertPlainText("$_"); } close(FTO); - $cmd="musrview $FILENAME &"; - $pid = system($cmd); } else { this->{ui}->fitTextOutput->insertPlainText("Cannot find MSR file!"); } @@ -858,6 +902,7 @@ sub GoFit() sub GoPlot() { + # This function should be able to do both plot and fit, check who called you. my %All=CreateAllInput(); # Check here is the number of histograms makes sense # other wise give error. @@ -997,7 +1042,8 @@ sub InitializeFunctions() { my %All=CreateAllInput(); my @RUNS = split( /,/, MSR::ExpandRunNumbers($All{"RunNumbers"}) ); - + my @Hists = split( /,/, $All{"LRBF"} ); + my @FitTypes =(); foreach my $FitType ($All{"FitType1"}, $All{"FitType2"}, $All{"FitType3"}) { if ( $FitType ne "None" ) { @@ -1027,9 +1073,20 @@ sub InitializeFunctions() # Alpha, No and NBg are counted in the parameters if ( $Component == 1 && ($All{"FitAsyType"} eq "Asymmetry" || $All{"FitAsyType"} eq "AsymmetryGLB" )) { unshift( @Params, "Alpha" ); - } - elsif ( $Component == 1 && $All{"FitAsyType"} eq "SingleHist" ) { - unshift( @Params, ( "No", "NBg" ) ); + } elsif ( $Component == 1 && $All{"FitAsyType"} eq "SingleHist" ) { + if (grep(/Phi/,@Params)) { + # remove the Phi and put it back for each histogram + @Params = grep ! /Phi/,@Params; + # for each histogram + foreach my $Hist (@Hists) { + # take only first histogram from sum + ($Hist,my $tmp) = split(/ /,$Hist); + # Doesn't make sense to share No or NBg! + # unshift( @Params, ( "N0$Hist", "NBg$Hist", "Phi$Hist" ) ); + push(@Params,"Phi$Hist"); + } + } + # unshift( @Params, ( "No", "NBg" ) ); } # Add list to the constraints drop down menu @@ -1065,7 +1122,7 @@ sub t0UpdateClicked() my $FILENAME=$All{"FILENAME"}; open (MSRF,q{<},"$FILENAME.msr" ); my @lines = ; - close(IFILE); + close(MSRF); my @T0s = grep {/t0 /} @lines; my @Bgs = grep {/background /} @lines; From ae5f95b83aa0e66613171db44d665e3d9937ad59 Mon Sep 17 00:00:00 2001 From: Zaher Salman Date: Thu, 15 Feb 2018 10:00:05 +0100 Subject: [PATCH 4/6] Implemented dynamic number of components and sharing and export using msr2data when appropriate. --- src/external/MuSRFitGUI/MuSRFit4.pm | 549 +-- src/external/MuSRFitGUI/MuSRFit4.ui | 4238 +++++++++--------------- src/external/MuSRFitGUI/Ui_MuSRFit4.pm | 1693 ++++------ 3 files changed, 2509 insertions(+), 3971 deletions(-) diff --git a/src/external/MuSRFitGUI/MuSRFit4.pm b/src/external/MuSRFitGUI/MuSRFit4.pm index b22fdc55..451f92b0 100644 --- a/src/external/MuSRFitGUI/MuSRFit4.pm +++ b/src/external/MuSRFitGUI/MuSRFit4.pm @@ -9,44 +9,50 @@ use QtCore4::isa qw( Qt::MainWindow ); #use QtCore4::isa qw( Qt::Widget ); use QtCore4::debug qw(ambiguous); use QtCore4::slots - fileOpen => [], +# fileOpen => [], fileSave => [], fileChangeDir => [], - filePrint => [], +# filePrint => [], fileExit => [], parametersExport => [], parametersAppend => [], - editUndo => [], - editRedo => [], - editCut => [], - editCopy => [], - editPaste => [], - helpIndex => [], - helpContents => [], +# editUndo => [], +# editRedo => [], +# editCut => [], +# editCopy => [], +# editPaste => [], +# helpIndex => [], +# helpContents => [], helpAbout => [], - CreateAllInput => [], - CallMSRCreate => [], - UpdateMSRFileInitTable => [], - ActivateT0Hists => [], +# CreateAllInput => [], +# UpdateMSRFileInitTable => [], +# ActivateT0Hists => [], ActivateShComp => [], - InitializeTab => [], +# InitializeTab => [], TabChanged => [], GoFit => [], GoPlot => [], ShowMuSRT0 => [], t0Update => [], RunSelectionToggle => [], - fileBrowse => [], +# fileBrowse => [], AppendToFunctions => [], InitializeFunctions => [], + addFitType => [], + addSharingComp => [], + runsLineNotEmpy => [], t0UpdateClicked => []; use Ui_MuSRFit4; +use MSR; + +our $self = ""; +our %All = (); sub NEW { my ( $class, $parent ) = @_; $class->SUPER::NEW($parent); - this->{ui} = Ui_MuSRFit4->setupUi(this); - my %All=CreateAllInput(); + $self = Ui_MuSRFit4->setupUi(this); + %All=CreateAllInput(); } # This file is part of MuSRFitGUI. @@ -86,7 +92,6 @@ sub fileOpen() sub fileSave() { - my %All=CreateAllInput(); my $FILENAME=$All{"FILENAME"}.".msr"; my $file=Qt::FileDialog::getSaveFileName( this, @@ -139,10 +144,18 @@ sub parametersExport() { # Exports the fit parameters for a table format file # This works only after a fit call, i.e. a plot call is not sufficient! - my %All=CreateAllInput(); + my @RUNS = (); + if ($All{"RUNSType"} ) { + @RUNS = split( /,/, $All{"RunFiles"}); + } else { + $All{"RunNumbers"} =~ s/[\ \.\~\/\&\*\[\;\>\<\^\$\(\)\`\|\]\'\@]/,/g; + @RUNS = split( /,/, MSR::ExpandRunNumbers($All{"RunNumbers"}) ); + } # Add also a flag for header $All{"Header"}=1; + my $StupidName = $RUNS[0]."+global_tmpl.msr"; my $FILENAME=$All{"FILENAME"}.".dat"; + my $MSR = $All{"FILENAME"}.".msr"; my $file=Qt::FileDialog::getSaveFileName( this, "Export parameters to file", @@ -151,10 +164,23 @@ sub parametersExport() # If the user gave a filename the copy to it if ($file ne "") { - my $Text = MSR::ExportParams(\%All); - open( DATF,q{>},"$file" ); - print DATF $Text; - close(DATF); + if ($All{"FitAsyType"} eq "Asymmetry") { + # Update All from GUI + %All=CreateAllInput(); + # my style + my $Text = MSR::ExportParams(\%All); + open( DATF,q{>},"$file" ); + print DATF $Text; + close(DATF); + } else { + # msr2data style + my $RunList = join(" ",@RUNS); + my $cmd = "cp $MSR $StupidName; msr2data \[".$RunList."\] "." _tmpl new global data -o $file"; + my $pid = open(FTO,"$cmd 2>&1 |"); + while () { + $self->fitTextOutput->append("$_"); + } + } } } @@ -163,10 +189,18 @@ sub parametersAppend() { # Appends the fit parameters for a table format file # This works only after a fit call, i.e. a plot call is not sufficient! - my %All=CreateAllInput(); + my @RUNS = (); + if ($All{"RUNSType"} ) { + @RUNS = split( /,/, $All{"RunFiles"}); + } else { + $All{"RunNumbers"} =~ s/[\ \.\~\/\&\*\[\;\>\<\^\$\(\)\`\|\]\'\@]/,/g; + @RUNS = split( /,/, MSR::ExpandRunNumbers($All{"RunNumbers"}) ); + } # Add also a flag for header $All{"Header"}=0; + my $StupidName = $RUNS[0]."+global_tmpl.msr"; my $FILENAME=$All{"FILENAME"}.".dat"; + my $MSR = $All{"FILENAME"}.".msr"; my $file=Qt::FileDialog::getOpenFileName( this, "Append parameters to file", @@ -175,10 +209,23 @@ sub parametersAppend() # If the user gave a filename the copy to it if ($file ne "") { - my $Text = MSR::ExportParams(\%All); - open( DATF,q{>>},"$file" ); - print DATF $Text; - close(DATF); + if ($All{"FitAsyType"} eq "Asymmetry") { + # Update All values from GUI + %All=CreateAllInput(); + my $Text = MSR::ExportParams(\%All); + open( DATF,q{>>},"$file" ); + print DATF $Text; + close(DATF); + } else { + # msr2data style + my $RunList = join(" ",@RUNS); + my $cmd = "cp $MSR $StupidName; msr2data \[".$RunList."\] "." _tmpl global data -o $file"; + my $pid = open(FTO,"$cmd 2>&1 |"); + while () { + $self->fitTextOutput->append("$_"); + } + close(FTO); + } } } @@ -254,51 +301,49 @@ Copyright 2009-2017 by Zaher Salman sub CreateAllInput() { - my %All=(); - -# From RUNS Tab -# Run data file - $All{"RunNumbers"} = this->{ui}->runNumbers->text(); - $All{"RunFiles"} = this->{ui}->runFiles->text(); - $All{"BeamLine"} = this->{ui}->beamLine->currentText; - $All{"RUNSType"} = this->{ui}->manualFile->isChecked(); - $All{"YEAR"} = this->{ui}->year->currentText; + # From RUNS Tab + # Run data file + $All{"RunNumbers"} = $self->runNumbers->text(); + $All{"RunFiles"} = $self->runFiles->text(); + $All{"BeamLine"} = $self->beamLine->currentText; + $All{"RUNSType"} = $self->manualFile->isChecked(); + $All{"YEAR"} = $self->year->currentText; if (!defined($All{"YEAR"}) || $All{"YEAR"} eq "") { # If year combobox is empty fill it up from 2004 up to current year my ($second, $minute, $hour, $dayOfMonth, $month, $yearOffset, $dayOfWeek, $dayOfYear, $daylightSavings) = localtime(); my $current_year = 1900 + $yearOffset; # my @years = ($current_year..2004); -# this->{ui}->year->addItems(@years); +# $self->year->addItems(@years); for (my $i=$current_year;$i>=2004;$i--) { - this->{ui}->year->addItem($i); + $self->year->addItem($i); } } # Time range and BINS - $All{"Tis"} = this->{ui}->tis->text; - $All{"Tfs"} = this->{ui}->tfs->text; - $All{"BINS"} = this->{ui}->bins->text; - $All{"FitAsyType"} = this->{ui}->fitAsyType->currentText; + $All{"Tis"} = $self->tis->text; + $All{"Tfs"} = $self->tfs->text; + $All{"BINS"} = $self->bins->text; + $All{"FitAsyType"} = $self->fitAsyType->currentText; $All{"FitAsyType"} =~ s/ //g; - $All{"LRBF"} = this->{ui}->histsLRBF->text; + $All{"LRBF"} = $self->histsLRBF->text; my @Hists = split(/,/, $All{"LRBF"} ); # Lifetime corrections in enabled/visible only for SingleHis fits if ( $All{"FitAsyType"} eq "SingleHist" ) { - this->{ui}->ltc->setHidden(0); + $self->ltc->setHidden(0); $All{"fittype"}=0; } else { - this->{ui}->ltc->setHidden(1); + $self->ltc->setHidden(1); $All{"fittype"}=2; } # From Fitting Tab # Plot range - $All{"Xi"}=this->{ui}->xi->text; - $All{"Xf"}=this->{ui}->xf->text; - $All{"Yi"}=this->{ui}->yi->text; - $All{"Yf"}=this->{ui}->yf->text; - $All{"ViewBin"}=this->{ui}->viewBin->text; + $All{"Xi"}=$self->xi->text; + $All{"Xf"}=$self->xf->text; + $All{"Yi"}=$self->yi->text; + $All{"Yf"}=$self->yf->text; + $All{"ViewBin"}=$self->viewBin->text; # Life time correction - if (this->{ui}->ltc->isChecked()) { + if ($self->ltc->isChecked()) { $All{"ltc"}="y"; } else { $All{"ltc"}="n"; @@ -308,11 +353,11 @@ sub CreateAllInput() $All{"go"}="PLOT"; } # Get minimization process - $All{"Minimization"} = this->{ui}->minimization->currentText(); + $All{"Minimization"} = $self->minimization->currentText(); $All{"go"}=$All{"Minimization"}; # Get Error calculation process - $All{"ErrorCalc"} = this->{ui}->errorCalc->currentText(); + $All{"ErrorCalc"} = $self->errorCalc->currentText(); $All{"go"}=$All{"ErrorCalc"}; # Commands block @@ -328,23 +373,23 @@ sub CreateAllInput() } # From MSR File Tab - $All{"TITLE"}= this->{ui}->title->text; - $All{"FILENAME"}= this->{ui}->fileName->text; + $All{"TITLE"}= $self->title->text; + $All{"FILENAME"}= $self->fileName->text; # From Fourier Tab - $All{"FUNITS"}= this->{ui}->funits->currentText; - $All{"FAPODIZATION"}= this->{ui}->fapodization->currentText; - $All{"FPLOT"}= this->{ui}->fplot->currentText; - $All{"FPHASE"}=this->{ui}->fphase->text; + $All{"FUNITS"}= $self->funits->currentText; + $All{"FAPODIZATION"}= $self->fapodization->currentText; + $All{"FPLOT"}= $self->fplot->currentText; + $All{"FPHASE"}=$self->fphase->text; # Fourier range - $All{"FrqMin"}=this->{ui}->frqMin->text; - $All{"FrqMax"}=this->{ui}->frqMax->text; + $All{"FrqMin"}=$self->frqMin->text; + $All{"FrqMax"}=$self->frqMax->text; # Rotating reference frame parameters - $All{"RRFFrq"}=this->{ui}->rrfFrq->text; - $All{"RRFPack"}=this->{ui}->rrfPack->text; - $All{"RRFPhase"}=this->{ui}->rrfPhase->text; - $All{"RRFUnits"}=this->{ui}->rrfUnits->currentText; + $All{"RRFFrq"}=$self->rrfFrq->text; + $All{"RRFPack"}=$self->rrfPack->text; + $All{"RRFPhase"}=$self->rrfPhase->text; + $All{"RRFUnits"}=$self->rrfUnits->currentText; # Get values of t0 and Bg/Data bins if given my $NHist = 1; @@ -382,18 +427,36 @@ sub CreateAllInput() 17,"LGKTSExp", 18,"None" ); - - my $FT1=this->{ui}->fitType1->currentIndex; - my $FT2=this->{ui}->fitType2->currentIndex; - my $FT3=this->{ui}->fitType3->currentIndex; - $All{"FitType1"} = $FTs{$FT1}; - $All{"FitType2"} = $FTs{$FT2}; - $All{"FitType3"} = $FTs{$FT3}; + + # Check the number of components + my $numComps = 0; + my $FT1=0; + my $FT2=0; + my $FT3=0; my @FitTypes =(); - my $FitType=""; - foreach $FitType ($All{"FitType1"}, $All{"FitType2"}, $All{"FitType3"}) { - if ( $FitType ne "None" ) { - push( @FitTypes, $FitType ); + my $FT=0; + if (defined($self->numComps)) { + # new style, check the number of components + $numComps = $self->numComps->value; + if ($numComps != $self->columnView->count() ) { + addFitType(); + } + } else { + # old style, only 3 componenets + $numComps = 3; + } + $All{"numComps"}=$numComps; + + # loop over fitTypes + for (my $i=1;$i<=$numComps;$i++) { + my $FTi=child("Qt::ComboBox","fitType$i"); + if ($FTi == 0) { + $All{"FitType$i"} = "None"; + } else { + $All{"FitType$i"} = $FTs{$FTi->currentIndex}; + } + if ( $All{"FitType$i"} ne "None" ) { + push( @FitTypes, $All{"FitType$i"} ); } } @@ -404,17 +467,20 @@ sub CreateAllInput() my @Paramcomp = @$Paramcomp_ref; # Functions block - $All{"FunctionsBlock"}=this->{ui}->functionsBlock->toPlainText; + $All{"FunctionsBlock"}=$self->functionsBlock->toPlainText; # and the associated theory block - $All{"Func_T_Block"}=this->{ui}->theoryBlock->toPlainText; + $All{"Func_T_Block"}=$self->theoryBlock->toPlainText; # Shared settings are detected here - $All{"EnableSharing"} = this->{ui}->buttonGroupSharing->isChecked(); + $All{"EnableSharing"} = $self->buttonGroupSharing->isChecked(); + # Make sure all sharing boxes exist + #addSharingComp(); + my $Shared = 0; my $PCount =0; my $Component=1; - foreach $FitType (@FitTypes) { + foreach my $FitType (@FitTypes) { my $Parameters=$Paramcomp[$Component-1]; my @Params = split( /\s+/, $Parameters ); @@ -457,10 +523,9 @@ sub CreateAllInput() # check if it is checked my $ChkName="shParam_".$Component."_".$NP; my $ChkBx = child("Qt::Widget",$ChkName); - $Shared = $ChkBx->isChecked(); + if ($ChkBx != 0) {$Shared = $ChkBx->isChecked();} } $All{"Sh_$Param"}=$Shared; - print "Param $Param is $Shared\n"; $NP++; } #Loop on parameters @@ -492,7 +557,7 @@ sub CreateAllInput() my $erradd = "d"; my $minadd = "_min"; my $maxadd = "_max"; - my $QTable=this->{ui}->initParamTable; + my $QTable=$self->initParamTable; # TODO: Should not go over all rows, only on parameters. if ($NParam > 0) { # Set appropriate number of rows @@ -516,25 +581,20 @@ sub CreateAllInput() sub CallMSRCreate() { - use MSR; - my %All=CreateAllInput(); - -# Check if the option for checking for existing files is selected - my $FileExistCheck= this->{ui}->fileExistCheck->isChecked(); + # Check if the option for checking for existing files is selected + my $FileExistCheck= $self->fileExistCheck->isChecked(); my $FILENAME=$All{"FILENAME"}.".msr"; my $Answer=0; if ($All{"RunNumbers"} ne "" || $All{"RunFiles"} ne "") { if ( $FileExistCheck==1 ) { if (-e $FILENAME) { -# Warning: MSR file exists -# my $Warning = "Warning: MSR file $FILENAME Already exists!\nIf you continue it will overwriten."; + # Warning: MSR file exists my $Warning = "Warning: MSR file $FILENAME Already exists!\nDo you want to overwrite it?"; -# my $WarningWindow = Qt::MessageBox::information( this, "Warning",$Warning); -# $Answer =1,0 for yes and no + # $Answer =1,0 for yes and no $Answer= Qt::MessageBox::warning( this, "Warning",$Warning, "&No", "&Yes", undef, 1,1); } } else { -# Just overwrite file + # Just overwrite file $Answer=1; } @@ -542,13 +602,13 @@ sub CallMSRCreate() if ( $All{"FitAsyType"} eq "Asymmetry") { if ($All{"RUNSType"}) { my ($Full_T_Block,$Paramcomp_ref,$FullMSRFile)= MSR::CreateMSRUni(\%All); -# Open output file FILENAME.msr + # Open output file FILENAME.msr open( OUTF,q{>},"$FILENAME" ); print OUTF ("$FullMSRFile"); close(OUTF); } else { my ($Full_T_Block,$Paramcomp_ref,$FullMSRFile)= MSR::CreateMSRUni(\%All); -# Open output file FILENAME.msr + # Open output file FILENAME.msr open( OUTF,q{>},"$FILENAME" ); print OUTF ("$FullMSRFile"); close(OUTF); @@ -567,22 +627,24 @@ sub CallMSRCreate() my $NewRunLine = "runs ".join(" ",(1...$NSpectra)); # Use msr2data to generate global fit MSR file my $RunList = join(" ",@RUNS); - my $cmd = "msr2data \[".$RunList."\] "." _tmpl msr-".$RUNS[0]." global"; - # create the global file + my $StupidName = $RUNS[0]."+global_tmpl.msr"; + my $cmd = "cp $RUNS[0]_tmpl.msr $StupidName"; + #if ($#RUNS != 0) { + # For multiple runs create global file + $cmd = "msr2data \[".$RunList."\] "." _tmpl msr-".$RUNS[0]." global"; + #} print $cmd."\n"; my $pid = open(FTO,"$cmd 2>&1 |"); while () { - this->{ui}->fitTextOutput->append("$_"); + $self->fitTextOutput->append("$_"); } close(FTO); # change the stupid name - my $StupidName = $RUNS[0]."+global_tmpl.msr"; # change stupid default runs line $cmd = "cp $StupidName $FILENAME; perl -pi -e 's/runs.*?(?=\n)/$NewRunLine/s' $FILENAME"; $pid = open(FTO,"$cmd 2>&1 |"); - print $cmd."\n"; while () { - this->{ui}->fitTextOutput->append("$_"); + $self->fitTextOutput->append("$_"); } close(FTO); # feed in values of parameters if they exist @@ -619,7 +681,6 @@ sub CallMSRCreate() sub UpdateMSRFileInitTable() { - my %All=CreateAllInput(); my $FILENAME=$All{"FILENAME"}; my @lines=(); if (-e "$FILENAME.msr") { @@ -627,9 +688,9 @@ sub UpdateMSRFileInitTable() @lines = ; close(MSRF); } - this->{ui}->textMSROutput->setText(""); + $self->textMSROutput->setText(""); foreach my $line (@lines) { - this->{ui}->textMSROutput->insertPlainText("$line"); + $self->textMSROutput->insertPlainText("$line"); } (my $TBlock_ref, my $FPBlock_ref)=MSR::ExtractBlks(@lines); @@ -669,7 +730,7 @@ sub UpdateMSRFileInitTable() $maxvalue=1.0*$Param[7]; } # Now update the initialization tabel - my $QTable = this->{ui}->initParamTable; + my $QTable = $self->initParamTable; # print "PCount=$PCount and value=$value\n"; if (defined($QTable->item($PCount,0)) & defined($QTable->item($PCount,1)) & defined($QTable->item($PCount,2)) & defined($QTable->item($PCount,3))) { $QTable->setItem($PCount,0,Qt::TableWidgetItem()); @@ -691,7 +752,7 @@ sub UpdateMSRFileInitTable() sub ActivateT0Hists() { - my %All=CreateAllInput(); + $All{"LRBF"}=$self->histsLRBF->text; my @Hists = split(/,/, $All{"LRBF"} ); my $HistBox = ""; for (my $iHist=1; $iHist<=4; $iHist++) { @@ -715,22 +776,28 @@ sub ActivateT0Hists() sub ActivateShComp() { - my %All=CreateAllInput(); + # Update All from GUI + %All=CreateAllInput(); my @RUNS = split( /,/, MSR::ExpandRunNumbers($All{"RunNumbers"}) ); my @Hists = split( /,/, $All{"LRBF"} ); -# Hide all sharing components - this->{ui}->sharingComp1->setHidden(1); - this->{ui}->sharingComp2->setHidden(1); - this->{ui}->sharingComp3->setHidden(1); - this->{ui}->sharingComp1->setEnabled(0); - this->{ui}->sharingComp2->setEnabled(0); - this->{ui}->sharingComp3->setEnabled(0); + # Make sure all sharing boxes exist + addSharingComp(); + + my $NShComps = $self->horizontalLayout->count(); + my $sharingComp = ""; + my $i = 1; + # Hide all sharing components + for ($i = 1; $i<=$NShComps;$i++) { + $sharingComp = child("Qt::GroupBox","sharingComp$i"); + $sharingComp->setHidden(1); + $sharingComp->setEnabled(0); + } my @FitTypes =(); - foreach my $FitType ($All{"FitType1"}, $All{"FitType2"}, $All{"FitType3"}) { - if ( $FitType ne "None" ) { - push( @FitTypes, $FitType ); + for ($i=1;$i<=$All{"numComps"};$i++) { + if ( $All{"FitType$i"} ne "None" ) { + push( @FitTypes, $All{"FitType$i"} ); } } @@ -780,7 +847,7 @@ sub ActivateShComp() $CompShL->setText($All{"FitType$Component"}); # Change state/label of parameters - for (my $i=1; $i<=9;$i++) { + for ($i=1; $i<=9;$i++) { my $ParamChkBx="shParam_".$Component."_".$i; my $ChkBx = child("Qt::Widget",$ParamChkBx); if (defined($Params[$i-1])) { @@ -798,8 +865,9 @@ sub ActivateShComp() sub InitializeTab() { - my %All=CreateAllInput(); - my $QTable = this->{ui}->initParamTable; + # Update All values from GUI + %All=CreateAllInput(); + my $QTable = $self->initParamTable; my $NRows = $QTable->rowCount(); # Remove any rows in table @@ -845,31 +913,30 @@ sub InitializeTab() sub TabChanged() { -# TODO: First check if there are some runs given, otherwise disbale - my %All=CreateAllInput(); - my $curTab = this->{ui}->musrfit_tabs->currentIndex(); + # TODO: First check if there are some runs given, otherwise disbale + my $curTab = $self->musrfit_tabs->currentIndex(); if ($curTab >= 2 && $curTab <= 4) { # First make sure we have sharing initialized ActivateShComp(); # Here we need to apply sharing if selected... InitializeTab(); UpdateMSRFileInitTable(); - } elsif ($curTab == 7) { + } elsif ($curTab == 6) { # And also setup T0 and Bg bins ActivateT0Hists(); + } elsif ($curTab == 7) { + # Initialize FUNCTIONS block only if it has not been initialized yet + if ($All{"FunctionsBlock"} eq "" ) { + InitializeFunctions(); + } } - -# Initialize FUNCTIONS block only if it has not been initialized yet - if ($All{"Func_T_Block"} eq "" ) { - InitializeFunctions(); - } } sub GoFit() { # This function should be able to do both plot and fit, check who called you. - my %All=CreateAllInput(); + %All=CreateAllInput(); # Check here is the number of histograms makes sense # other wise give error. my @Hists = split( /,/, $All{"LRBF"} ); @@ -878,7 +945,7 @@ sub GoFit() my $Warning = "Error: The number of histograms should be 2 for an asymmetry fit!"; my $WarningWindow = Qt::MessageBox::information( this, "Error",$Warning); } else { - this->{ui}->musrfit_tabs->setCurrentIndex(1); + $self->musrfit_tabs->setCurrentIndex(1); my $Answer=CallMSRCreate(); my $FILENAME=$All{"FILENAME"}.".msr"; if ($Answer) { @@ -886,13 +953,13 @@ sub GoFit() my $cmd="musrfit -t $FILENAME; musrview $FILENAME &"; my $pid = open(FTO,"$cmd 2>&1 |"); while () { - this->{ui}->fitTextOutput->insertPlainText("$_"); + $self->fitTextOutput->insertPlainText("$_"); } close(FTO); } else { - this->{ui}->fitTextOutput->insertPlainText("Cannot find MSR file!"); + $self->fitTextOutput->insertPlainText("Cannot find MSR file!"); } - this->{ui}->fitTextOutput->insertPlainText("-----------------------------------------------------------------------------------------------------------------------------"); + $self->fitTextOutput->insertPlainText("-----------------------------------------------------------------------------------------------------------------------------"); # update MSR File tab and initialization table UpdateMSRFileInitTable(); } @@ -903,7 +970,7 @@ sub GoFit() sub GoPlot() { # This function should be able to do both plot and fit, check who called you. - my %All=CreateAllInput(); + %All=CreateAllInput(); # Check here is the number of histograms makes sense # other wise give error. my @Hists = split( /,/, $All{"LRBF"} ); @@ -919,8 +986,8 @@ sub GoPlot() my $cmd="musrview $FILENAME &"; my $pid = system($cmd); } else { - this->{ui}->fitTextOutput->insertPlainText("Cannot find MSR file!"); - this->{ui}->fitTextOutput->insertPlainText("-----------------------------------------------------------------------------------------------------------------------------"); + $self->fitTextOutput->insertPlainText("Cannot find MSR file!"); + $self->fitTextOutput->insertPlainText("-----------------------------------------------------------------------------------------------------------------------------"); } } } @@ -930,10 +997,9 @@ sub GoPlot() sub ShowMuSRT0() { -# Open musrt0 to check and adjust t0 , Bg and Data bins - my %All=CreateAllInput(); - this->{ui}->musrfit_tabs->setCurrentIndex(6); -# Create MSR file and then run musrt0 + # Open musrt0 to check and adjust t0 , Bg and Data bins + $self->musrfit_tabs->setCurrentIndex(6); + # Create MSR file and then run musrt0 my $Answer=CallMSRCreate(); if ($Answer) { @@ -941,7 +1007,7 @@ sub ShowMuSRT0() if (-e $FILENAME) { my $cmd="musrt0 $FILENAME &"; my $pid = system($cmd); - this->{ui}->t0Update->setEnabled(1) + $self->t0Update->setEnabled(1) } else { print STDERR "Cannot find MSR file!\n"; } @@ -952,7 +1018,7 @@ sub ShowMuSRT0() sub t0Update() { - my %All = CreateAllInput(); + $All{"LRBF"}=$self->histsLRBF->text; my @Hists = split(/,/, $All{"LRBF"} ); # Get values of t0 and Bg/Data bins if given @@ -961,9 +1027,6 @@ sub t0Update() foreach ("t0","Bg1","Bg2","Data1","Data2") { my $Name = "$_$NHist"; my $tmp=MSR::T0BgData($_,$Hist,$All{"BeamLine"}); -# if (defined(child("Qt::Widget",$Name))) { -# child("Qt::Widget",$Name)->setText($tmp); -# } } $NHist++ } @@ -972,29 +1035,28 @@ sub t0Update() sub RunSelectionToggle() { - my $ManualFile= this->{ui}->manualFile->isChecked(); + my $ManualFile= $self->manualFile->isChecked(); if ($ManualFile) { # Manual RUN selection - this->{ui}->runsMan->setEnabled(1); - this->{ui}->runsMan->setHidden(0); - this->{ui}->runNumbers->setText(""); - this->{ui}->runsAuto->setEnabled(0); - this->{ui}->runsAuto->setHidden(1); + $self->runsMan->setEnabled(1); + $self->runsMan->setHidden(0); + $self->runNumbers->setText(""); + $self->runsAuto->setEnabled(0); + $self->runsAuto->setHidden(1); } else { # Auto RUN selection - this->{ui}->runsMan->setEnabled(0); - this->{ui}->runsMan->setHidden(1); - this->{ui}->runFiles->setText(""); - this->{ui}->runsAuto->setEnabled(1); - this->{ui}->runsAuto->setHidden(0); + $self->runsMan->setEnabled(0); + $self->runsMan->setHidden(1); + $self->runFiles->setText(""); + $self->runsAuto->setEnabled(1); + $self->runsAuto->setHidden(0); } } sub fileBrowse() { - my $RunFiles=this->{ui}->runFiles->text(); - print "Runs:$RunFiles\n"; + my $RunFiles=$self->runFiles->text(); my $files_ref=Qt::FileDialog::getOpenFileNames( "Data files (*.root *.bin)", "./", @@ -1009,45 +1071,45 @@ sub fileBrowse() # Add files to existing list $RunFiles=join(",",$RunFiles,@files); } - this->{ui}->runFiles->setText($RunFiles); + $self->runFiles->setText($RunFiles); } sub AppendToFunctions() { - my $ParName=this->{ui}->cParamsCombo->currentText(); + my $ParName=$self->cParamsCombo->currentText(); my $Full_T_Block=""; my $Constraint=""; - if (defined(this->{ui}->theoryBlock->toPlainText)) { - $Full_T_Block=this->{ui}->theoryBlock->toPlainText; + if (defined($self->theoryBlock->toPlainText)) { + $Full_T_Block=$self->theoryBlock->toPlainText; } - if (defined(this->{ui}->constraintLine->text)) { - $Constraint=this->{ui}->constraintLine->text; + if (defined($self->constraintLine->text)) { + $Constraint=$self->constraintLine->text; } # Then clear the text - this->{ui}->constraintLine->setText(""); + $self->constraintLine->setText(""); # Check how many constraints (lines) in FUNCTIONS Block -# my $i=this->{ui}->functionsBlock->blockCount(); - my $fun_lines=this->{ui}->functionsBlock->toPlainText(); +# my $i=$self->functionsBlock->blockCount(); + my $fun_lines=$self->functionsBlock->toPlainText(); my $i= ($fun_lines =~ tr/\n//)+1; my $ConstLine="fun$i = $Constraint\n"; - this->{ui}->functionsBlock->insertPlainText($ConstLine); + $self->functionsBlock->insertPlainText($ConstLine); # Replace parameter in theory block with fun$i $Full_T_Block=~ s/$ParName/fun$i/; - this->{ui}->theoryBlock->setText($Full_T_Block); + $self->theoryBlock->setText($Full_T_Block); } sub InitializeFunctions() { - my %All=CreateAllInput(); + # Update All values from GUI + %All=CreateAllInput(); my @RUNS = split( /,/, MSR::ExpandRunNumbers($All{"RunNumbers"}) ); my @Hists = split( /,/, $All{"LRBF"} ); - my @FitTypes =(); - foreach my $FitType ($All{"FitType1"}, $All{"FitType2"}, $All{"FitType3"}) { - if ( $FitType ne "None" ) { - push( @FitTypes, $FitType ); + for (my $i=1;$i<=$All{"numComps"};$i++) { + if ( $All{"FitType$i"} ne "None" ) { + push( @FitTypes, $All{"FitType$i"} ); } } @@ -1058,10 +1120,10 @@ sub InitializeFunctions() # Initialize Parameters List in function block (constraints). my $ParametersList=""; - this->{ui}->parametersList->setText(""); + $self->parametersList->setText(""); # Counter for function block (with out Alpha etc.) my $ParCount=0; - this->{ui}->cParamsCombo->clear(); + $self->cParamsCombo->clear(); # Possibly use the parameters block to axtract names for the dropdown menu # this makes sense if we can use fun in map line. Check! @@ -1094,22 +1156,22 @@ sub InitializeFunctions() if (defined($Params[$i-1])) { my $CParam = $Params[$i-1]."_".$Component; if ($Params[$i-1] ne "Alpha" && $Params[$i-1] ne "No" && $Params[$i-1] ne "NBg") { - this->{ui}->cParamsCombo->addItem($CParam); + $self->cParamsCombo->addItem($CParam); $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"; - this->{ui}->parametersList->setText($ParametersList); + $self->parametersList->setText($ParametersList); } } $Component++; } # Set theory block in Constraints - this->{ui}->theoryBlock->setText($Full_T_Block); + $self->theoryBlock->setText($Full_T_Block); # Then clear the text - this->{ui}->constraintLine->setText(""); - this->{ui}->functionsBlock->setText(""); + $self->constraintLine->setText(""); + $self->functionsBlock->setText(""); } @@ -1117,8 +1179,8 @@ sub InitializeFunctions() sub t0UpdateClicked() { -# Read MSR file and get new values of t0,Bg and Data - my %All=CreateAllInput(); + # Read MSR file and get new values of t0,Bg and Data + #%All=CreateAllInput(); my $FILENAME=$All{"FILENAME"}; open (MSRF,q{<},"$FILENAME.msr" ); my @lines = ; @@ -1130,7 +1192,6 @@ sub t0UpdateClicked() my @Hists = split(/,/, $All{"LRBF"} ); my $NHist = $#Hists+1; - print "Histograms: $NHist\n"; my $FinHist = 1; # First T0s @@ -1149,7 +1210,7 @@ sub t0UpdateClicked() } # Finally, disable the update button - this->{ui}->t0Update->setEnabled(0); + $self->t0Update->setEnabled(0); # t0Update->setText("musrt0") } @@ -1164,11 +1225,123 @@ sub child { } else { $Attrib = 0; } -# print "name = $name and attrib = $Attrib\n"; # Return handle on widget return($Attrib); } +sub addFitType { + # Input number of components + my $numComps = $self->numComps->value; + # count number of exisitng components + my $NButtons = $self->columnView->count(); + # create ComboBox in theoryFunction parent + my $fitType = Qt::ComboBox( $self->theoryFunction ); + + # do we have less components that we need + if ($numComps > $NButtons) { + # add as needed + for (my $i=$NButtons+1;$i<=$numComps;$i++) { + my $nameComp = "fitType$i"; + $self->columnView->addWidget( $fitType ); + $fitType->setObjectName( $nameComp ); + $fitType->setMinimumSize( Qt::Size(0, 25) ); + $fitType->setMaximumSize( Qt::Size(255, 25) ); + $fitType->insertItems(0, + ["Exponential", + "Gaussian", + "Stretch Exp.", + "Exponential Cos", + "Gaussian Cos", + "Stretch Cos", + "Lorentzian Dynamic KT", + "Gaussian Dynamic KT", + "Background", + "Lorentzian Kubo-Toyabe LF x Exp", + "Gaussian Kubo-Toyabe LF x Exp", + "Lorentzian Kubo-Toyabe LF x Str Exp", + "Gaussian Kubo-Toyabe LF x Str Exp", + "MolMag", + "Meissner State Model", + "Lor-Gss combi KT", + "Lor-Gss combi KT x Exp", + "Lor-Gss combi KT x SExp", + "None",]); + if ($i==1) { + $fitType->setCurrentIndex(0); + # remove the "None" option for the 1st component + $fitType->removeItem(18); + } else { + $fitType->setCurrentIndex( 18 ); + } + } + } else { + for (my $i=$NButtons;$i > $numComps ;$i--) { + # component is there, delete it + my $widget = $self->columnView->itemAt($i-1)->widget(); + $widget -> hide(); + $self->columnView->removeWidget($widget); + undef $widget; + } + } +} + +sub addSharingComp { + # Input number of components + my $numComps = $self->numComps->value; + # count number of exisitng components + my $NShComps = $self->horizontalLayout->count(); + my @sharingComps = (); + for (my $i=$NShComps+1;$i<=$numComps;$i++) { + $sharingComps[$i] = Qt::GroupBox( $self->buttonGroupSharing ); + my $sizePolicy = Qt::SizePolicy( Qt::SizePolicy::Expanding(), Qt::SizePolicy::MinimumExpanding() ); + $self->{$sizePolicy} = $sizePolicy; + $sizePolicy->setHorizontalStretch( 0 ); + $sizePolicy->setVerticalStretch( 0 ); + $sizePolicy->setHeightForWidth( $sharingComps[$i]->sizePolicy()->hasHeightForWidth() ); + # check is this component exists + if (child("Qt::GroupBox","sharingComp$i") == 0) { + $sharingComps[$i]->setObjectName( "sharingComp$i" ); + $sharingComps[$i]->setEnabled( 0 ); + $sharingComps[$i]->setSizePolicy( $sizePolicy ); + $sharingComps[$i]->setAlignment( Qt::AlignLeading() ); + $sharingComps[$i]->setTitle("Component $i"); + my $layout = Qt::Widget( $sharingComps[$i] ); + $layout->setObjectName( "layoutSh$i" ); + $layout->setGeometry( Qt::Rect(40, 60, 81, 266) ); + my $shBoxLayout = Qt::VBoxLayout( $layout ); + $self->{shBoxLayout} = $shBoxLayout; + $shBoxLayout->setSpacing( 0 ); + $shBoxLayout->setMargin( 0 ); + $shBoxLayout->setObjectName( "shBoxLayout$i" ); + $shBoxLayout->setContentsMargins(0, 0, 0, 0 ); + my @shParam = (); + for (my $j=1;$j<=9;$j++) { + $shParam[$j] = Qt::CheckBox( $layout ); + $self->{shParam} = $shParam[$j]; + $shParam[$j]->setObjectName( "shParam_".$i."_$j" ); + $shParam[$j]->setText("Param$j"); + $shBoxLayout->addWidget( $shParam[$j] ); + } + + my $compShLabel = Qt::Label( $sharingComps[$i] ); + $self->{compShLabel} = $compShLabel; + $compShLabel->setObjectName( "comp".$i."ShLabel" ); + $compShLabel->setGeometry( Qt::Rect(2, 30, 141, 20) ); + $compShLabel->setWordWrap( 0 ); + + $self->horizontalLayout->addWidget( $sharingComps[$i] ); + # Connect slot + Qt::Object::connect($sharingComps[$i], SIGNAL 'currentIndexChanged()' , $self, SLOT 'InitializeFunctions()' ); + $compShLabel->setText("FitType$i"); + } else { + print "Exists, skip component $i\n"; + } + } +} + +sub runsLineNotEmpy() +{ +} 1; diff --git a/src/external/MuSRFitGUI/MuSRFit4.ui b/src/external/MuSRFitGUI/MuSRFit4.ui index 0c452720..562ef4a9 100644 --- a/src/external/MuSRFitGUI/MuSRFit4.ui +++ b/src/external/MuSRFitGUI/MuSRFit4.ui @@ -6,8 +6,8 @@ 0 0 - 674 - 541 + 706 + 516 @@ -33,6 +33,12 @@ MuSRFitGUI + + + 0 + 0 + + @@ -57,2458 +63,1402 @@ 32767 + + + + + + + + + 0 - RUNS + RUNS - - - - - QLayout::SetMinimumSize - - - 0 - - - - - - 1 - 1 - - - - - 0 - 80 - - - - - 1 - 1 - - - - RUN Files - - - Qt::AlignHCenter|Qt::AlignTop - - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 411 - 21 - - - - - - - - true - - - - 0 - 0 - - - - - 0 - 23 - - - - - 16777215 - 25 - - - - Names of data files to be fit. Multiple data files are comma separated. - - - Names of data files to be fit. Multiple data files are comma separated. - - - - - - - true - - - - 0 - 0 - - - - - 0 - 20 - - - - - 16777215 - 25 - - - - Browse to select data files for fitting. - - - Browse to select data files for fitting. - - - Browse - - - - - - - - - - - - QLayout::SetMinimumSize - + + + + 1 + 1 + 676 + 375 + + + + + + + + 0 + 0 + + + + RUN Numbers + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + - - - - 0 - 0 - + + + QLayout::SetMinimumSize - - Fit type + + 0 - - false + + 0 - - - - - - - 0 - 0 - + + 5 - - - 0 - 25 - - - - - 16777215 - 25 - - - - - Asymmetry GLB - + + + + + 0 + 0 + + + + + 0 + 20 + + + + + 16777215 + 29 + + + + false + + + QComboBox::InsertAtTop + + + true + + + false + + - - - Single Hist - + + + + + 0 + 0 + + + + + 0 + 23 + + + + + 16777215 + 29 + + + + Numbers of RUNs to fit. Multiple runs are comma separated. + + + Numbers of RUNs to fit. Multiple runs are comma separated. + + + + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + - - - Asymmetry - + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 181 + 21 + + + - - - - - - - 0 - 0 - - - - Histograms list - - - false - - - - - - - - 0 - 0 - - - - - 0 - 25 - - - - - 16777215 - 25 - - - - 1 5,3 7 - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 81 - 21 - - - + + + + + 0 + 0 + + + + + 0 + 20 + + + + + 16777215 + 29 + + + + + LEM + + + + + GPD + + + + + HAL + + + + + GPS + + + + + Dolly + + + + + LTF + + + + + LEM (PPC) + + + + + + + + + 0 + 0 + + + + + 0 + 20 + + + + Year + + + false + + + + + + + + 0 + 0 + + + + + 0 + 30 + + + + + 16777215 + 30 + + + + On beam line + + + false + + + + - - - - - - 1 - 1 - - - - - 0 - 100 - - - - RUN Numbers - - - Qt::AlignHCenter|Qt::AlignTop - - - - - - QLayout::SetDefaultConstraint - - - 0 - - - 0 - - - 0 - - - - - - 0 - 0 - - + + + + + + + 1 + 1 + + + + + 0 + 80 + + + + + 1 + 1 + + + + RUN Files + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + 5 + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 411 + 21 + + + + + + + + true + + + + 0 + 0 + + + + + 0 + 23 + + + + + 16777215 + 29 + + + + Names of data files to be fit. Multiple data files are comma separated. + + + Names of data files to be fit. Multiple data files are comma separated. + + + + + + + true + + + + 0 + 0 + + + + + 0 + 20 + + + + + 16777215 + 29 + + + + Browse to select data files for fitting. + + + Browse to select data files for fitting. + + + Browse + + + + + + + + + + + + + + + + 0 - 20 + 29 16777215 - 25 + 29 - - false - - - QComboBox::InsertAtTop - - - true - - - false - - - - - - - - 0 - 0 - - - - - 0 - 23 - - - - - 16777215 - 25 - - - - Numbers of RUNs to fit. Multiple runs are comma separated. - - - Numbers of RUNs to fit. Multiple runs are comma separated. + + + + + + + 0 + 0 + 0 + + + + + + + 230 + 240 + 249 + + + + + + + 255 + 255 + 255 + + + + + + + 242 + 247 + 252 + + + + + + + 115 + 120 + 124 + + + + + + + 154 + 160 + 166 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 127 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 128 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + + + 0 + 0 + 0 + + + + + + + 230 + 240 + 249 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 115 + 120 + 124 + + + + + + + 154 + 160 + 166 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 127 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 128 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 238 + + + + + + + 82 + 24 + 139 + + + + + + + + + 128 + 128 + 128 + + + + + + + 230 + 240 + 249 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 115 + 120 + 124 + + + + + + + 154 + 160 + 166 + + + + + + + 128 + 128 + 128 + + + + + + + 255 + 255 + 255 + + + + + + + 128 + 128 + 128 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 127 + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 128 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 238 + + + + + + + 82 + 24 + 139 + + + + + - + Number of components - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 181 - 21 - - - - - - - - - 0 - 0 - - - - - 0 - 20 - - - - - 16777215 - 25 - - - - - LEM - - - - - GPD - - - - - HAL - - - - - GPS - - - - - Dolly - - - - - LTF - - - - - LEM (PPC) - - - - - - - - - 0 - 0 - - - - - 0 - 20 - - - - Year + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter false - - - - - 0 - 0 - - + + 0 - 30 + 29 16777215 - 30 + 29 - - On beam line - - - false + + 1 - - - - - - - - 0 - 0 - - - - - 0 - 220 - - - - - 0 - 0 - - - - Theory Function - - - - - - - - - - - 0 - 0 - 0 - - - - - - - 230 - 240 - 249 - - - - - - - 255 - 255 - 255 - - - - - - - 242 - 247 - 252 - - - - - - - 115 - 120 - 124 - - - - - - - 154 - 160 - 166 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 127 - - - - - - - 0 - 0 - 0 - - - - - - - 0 - 0 - 128 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - 0 - 0 - 0 - - - - - - - - - 0 - 0 - 0 - - - - - - - 230 - 240 - 249 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - 115 - 120 - 124 - - - - - - - 154 - 160 - 166 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 127 - - - - - - - 0 - 0 - 0 - - - - - - - 0 - 0 - 128 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 238 - - - - - - - 82 - 24 - 139 - - - - - - - - - 128 - 128 - 128 - - - - - - - 230 - 240 - 249 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - 115 - 120 - 124 - - - - - - - 154 - 160 - 166 - - - - - - - 128 - 128 - 128 - - - - - - - 255 - 255 - 255 - - - - - - - 128 - 128 - 128 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 127 - - - - - - - 0 - 0 - 0 - - - - - - - 0 - 0 - 128 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 238 - - - - - - - 82 - 24 - 139 - - - - - - - - First Component - - - false - - - - - - - - - - - - 0 - 0 - 0 - - - - - - - 230 - 240 - 249 - - - - - - - 255 - 255 - 255 - - - - - - - 242 - 247 - 252 - - - - - - - 115 - 120 - 124 - - - - - - - 154 - 160 - 166 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 127 - - - - - - - 0 - 0 - 0 - - - - - - - 0 - 0 - 128 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - 0 - 0 - 0 - - - - - - - - - 0 - 0 - 0 - - - - - - - 230 - 240 - 249 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - 115 - 120 - 124 - - - - - - - 154 - 160 - 166 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 127 - - - - - - - 0 - 0 - 0 - - - - - - - 0 - 0 - 128 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 238 - - - - - - - 82 - 24 - 139 - - - - - - - - - 128 - 128 - 128 - - - - - - - 230 - 240 - 249 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - 115 - 120 - 124 - - - - - - - 154 - 160 - 166 - - - - - - - 128 - 128 - 128 - - - - - - - 255 - 255 - 255 - - - - - - - 128 - 128 - 128 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 127 - - - - - - - 0 - 0 - 0 - - - - - - - 0 - 0 - 128 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 238 - - - - - - - 82 - 24 - 139 - - - - - - - - Second Component - - - false - - - - - - - - - - - - 0 - 0 - 0 - - - - - - - 230 - 240 - 249 - - - - - - - 255 - 255 - 255 - - - - - - - 242 - 247 - 252 - - - - - - - 115 - 120 - 124 - - - - - - - 154 - 160 - 166 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 127 - - - - - - - 0 - 0 - 0 - - - - - - - 0 - 0 - 128 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - 0 - 0 - 0 - - - - - - - - - 0 - 0 - 0 - - - - - - - 230 - 240 - 249 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - 115 - 120 - 124 - - - - - - - 154 - 160 - 166 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 127 - - - - - - - 0 - 0 - 0 - - - - - - - 0 - 0 - 128 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 238 - - - - - - - 82 - 24 - 139 - - - - - - - - - 128 - 128 - 128 - - - - - - - 230 - 240 - 249 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - 115 - 120 - 124 - - - - - - - 154 - 160 - 166 - - - - - - - 128 - 128 - 128 - - - - - - - 255 - 255 - 255 - - - - - - - 128 - 128 - 128 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 127 - - - - - - - 0 - 0 - 0 - - - - - - - 0 - 0 - 128 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 238 - - - - - - - 82 - 24 - 139 - - - - - - - - Third Component - - - false - - - - - + + - + 0 0 - 0 - 25 + 280 + 0 - - - 16777215 - 25 - + + Qt::ScrollBarAsNeeded - - false - - - false - - - - Exponential - - - - - Gaussian - - - - - Stretch Exp. - - - - - Exponential Cos - - - - - Gaussian Cos - - - - - Stretch Cos - - - - - Lorentzian Dynamic KT - - - - - Gaussian Dynamic KT - - - - - Background - - - - - Lorentzian Kubo-Toyabe LF x Exp - - - - - Gaussian Kubo-Toyabe LF x Exp - - - - - Lorentzian Kubo-Toyabe LF x Str Exp - - - - - Gaussian Kubo-Toyabe LF x Str Exp - - - - - MolMag - - - - - Meissner State Model - - - - - Lor-Gss combi KT - - - - - Lor-Gss combi KT x Exp - - - - - Lor-Gss combi KT x SExp - - - - - - - - - 0 - 0 - - - - - 0 - 25 - - - - - 16777215 - 25 - - - - 18 - - - - Exponential - - - - - Gaussian - - - - - Stretch Exp. - - - - - Exponential Cos - - - - - Gaussian Cos - - - - - Stretch Cos - - - - - Lorentzian Dynamic KT - - - - - Gaussian Dynamic KT - - - - - Background - - - - - Lorentzian Kubo-Toyabe LF x Exp - - - - - Gaussian Kubo-Toyabe LF x Exp - - - - - Lorentzian Kubo-Toyabe LF x Str Exp - - - - - Gaussian Kubo-Toyabe LF x Str Exp - - - - - MolMag - - - - - Meissner State Model - - - - - Lor-Gss combi KT - - - - - Lor-Gss combi KT x Exp - - - - - Lor-Gss combi KT x SExp - - - - - None - - - - - - - - - 0 - 0 - - - - - 0 - 25 - - - - - 16777215 - 25 - - - - 18 - - - - Exponential - - - - - Gaussian - - - - - Stretch Exp. - - - - - Exponential Cos - - - - - Gaussian Cos - - - - - Stretch Cos - - - - - Lorentzian Dynamic KT - - - - - Gaussian Dynamic KT - - - - - Background - - - - - Lorentzian Kubo-Toyabe LF x Exp - - - - - Gaussian Kubo-Toyabe LF x Exp - - - - - Lorentzian Kubo-Toyabe LF x Str Exp - - - - - Gaussian Kubo-Toyabe LF x Str Exp - - - - - MolMag - - - - - Meissner State Model - - - - - Lor-Gss combi KT - - - - - Lor-Gss combi KT x Exp - - - - - Lor-Gss combi KT x SExp - - - - - None - - - - - - - - - 0 - 0 - - - - Initial Fit Time - - - false - - - - - - - - 0 - 0 - - - - Final Fit Time - - - false - - - - - - - - 0 - 0 - - - - Fit Binning Factor - - - false - - - - - - - - 0 - 0 - - - - - 0 - 25 - - - - - 16777215 - 25 - - - - 0 - - - - - - - - 0 - 0 - - - - - 0 - 25 - - - - - 16777215 - 25 - - - - 8 - - - - - - - - 0 - 0 - - - - - 0 - 25 - - - - - 16777215 - 25 - - - - 100 - - - - - - - Min X - - - false - - - - - - - Max X - - - false - - - - - - - View Binning Factor - - - false - - - - - - - - 0 - 25 - - - - - - - - - 0 - 25 - - - - - - - - - 0 - 25 - - - - - - - - Min Y - - - false - - - - - - - Max Y - - - false - - - - - - - - - - false - - - - - - - - - - - - - Life time correction - - + true + + + + 0 + 0 + 276 + 70 + + + + + + 10 + 10 + 261 + 151 + + + + - - - - - + + + + + + 0 + 0 + + + + + 384 + 0 + + + + true + + + + + 0 + 0 + 380 + 109 + + + + + + 10 + 10 + 355 + 192 + + + + + 5 + + + 5 + + + 5 + + + + + + 0 + 0 + + + + Initial Fit Time + + + false + + + + + + + + 0 + 0 + + + + Final Fit Time + + + false + + + + + + + + 0 + 0 + + + + Fit Binning Factor + + + false + + + + + + + + 0 + 0 + + + + + 0 + 29 + + + + + 16777215 + 29 + + + + 0 + + + + + + + + 0 + 0 + + + + + 0 + 29 + + + + + 16777215 + 29 + + + + 8 + + + + + + + + 0 + 0 + + + + + 0 + 29 + + + + + 16777215 + 29 + + + + 100 + + + + + + + + 0 + 0 + + + + + 0 + 29 + + + + Min X + + + false + + + + + + + + 0 + 0 + + + + + 0 + 29 + + + + Max X + + + false + + + + + + + + 0 + 0 + + + + + 0 + 29 + + + + View Binning Factor + + + false + + + + + + + + 0 + 29 + + + + + + + + + 0 + 29 + + + + + + + + + 0 + 29 + + + + + + + + + 0 + 29 + + + + Min Y + + + false + + + + + + + + 0 + 29 + + + + Max Y + + + false + + + + + + + + 0 + 0 + + + + + 0 + 29 + + + + + + + false + + + + + + + + 0 + 29 + + + + + + + + + 0 + 29 + + + + + + + + + 0 + 0 + + + + + 0 + 29 + + + + Life time correction + + + true + + + + + + + + + + + + + + QLayout::SetDefaultConstraint + + + 5 + + + + + + 0 + 0 + + + + Fit type + + + false + + + + + + + + 0 + 0 + + + + + 0 + 29 + + + + + 16777215 + 29 + + + + + Asymmetry GLB + + + + + Single Hist + + + + + Asymmetry + + + + + + + + + 0 + 0 + + + + Histograms list + + + false + + + + + + + + 0 + 0 + + + + + 0 + 29 + + + + + 16777215 + 29 + + + + 1 5,3 7 + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 81 + 21 + + + + + + + + @@ -2519,12 +1469,15 @@ + + 5 + 0 - 25 + 29 @@ -2550,7 +1503,7 @@ 0 - 25 + 29 @@ -2651,7 +1604,7 @@ - 1st Component + Component 1 Qt::AlignLeading @@ -2785,277 +1738,6 @@ - - - - false - - - - 0 - 0 - - - - 2nd Component - - - - - 2 - 30 - 141 - 20 - - - - FitType2 - - - false - - - - - - 40 - 60 - 81 - 266 - - - - - 0 - - - 0 - - - - - Param1 - - - - - - - Param2 - - - - - - - Param3 - - - - - - - Param4 - - - - - - - Param5 - - - - - - - false - - - Param6 - - - false - - - - - - - false - - - Param7 - - - false - - - - - - - false - - - Param8 - - - false - - - - - - - false - - - Param9 - - - false - - - - - - - - - - - false - - - - 0 - 0 - - - - 3rd Component - - - Qt::AlignJustify|Qt::AlignVCenter - - - - - 2 - 30 - 141 - 20 - - - - FitType3 - - - false - - - - - - 41 - 58 - 81 - 266 - - - - - - - Param1 - - - - - - - Param2 - - - - - - - Param3 - - - - - - - Param4 - - - - - - - Param5 - - - - - - - false - - - Param6 - - - false - - - - - - - false - - - Param7 - - - false - - - - - - - false - - - Param8 - - - false - - - - - - - false - - - Param9 - - - false - - - - - - - @@ -3141,6 +1823,9 @@ + + 5 + @@ -3650,12 +2335,27 @@ 5 18 100 - 150 + 171 + + 5 + + + + 0 + 0 + + + + + 0 + 29 + + t0 @@ -3666,6 +2366,18 @@ + + + 0 + 0 + + + + + 0 + 29 + + Bg1 @@ -3676,6 +2388,18 @@ + + + 0 + 0 + + + + + 0 + 29 + + Bg2 @@ -3686,6 +2410,18 @@ + + + 0 + 0 + + + + + 0 + 29 + + Data 1 @@ -3696,6 +2432,18 @@ + + + 0 + 0 + + + + + 0 + 29 + + Data 2 @@ -3731,12 +2479,12 @@ 8 17 75 - 150 + 167 - 0 + 5 0 @@ -3780,12 +2528,12 @@ 8 17 75 - 150 + 167 - 0 + 5 0 @@ -3829,12 +2577,12 @@ 8 17 75 - 150 + 167 - 0 + 5 0 @@ -3878,12 +2626,12 @@ 8 17 75 - 150 + 167 - 0 + 5 0 @@ -4918,7 +3666,7 @@ 0 - 25 + 29 @@ -5436,7 +4184,7 @@ 0 0 - 674 + 706 27 @@ -5711,6 +4459,13 @@ + + + QVBoxLayout + QWidget +
qvboxlayout.h
+
+
musrfit_tabs runNumbers @@ -5718,18 +4473,6 @@ year runFiles browse - fitType1 - fitType2 - fitType3 - tis - tfs - bins - xi - xf - viewBin - yi - yf - ltc fitAsyType histsLRBF minimization @@ -5745,24 +4488,6 @@ shParam_1_7 shParam_1_8 shParam_1_9 - shParam_2_1 - shParam_2_2 - shParam_2_3 - shParam_2_4 - shParam_2_5 - shParam_2_6 - shParam_2_7 - shParam_2_8 - shParam_2_9 - shParam_3_1 - shParam_3_2 - shParam_3_3 - shParam_3_4 - shParam_3_5 - shParam_3_6 - shParam_3_7 - shParam_3_8 - shParam_3_9 initParamTable title fileName @@ -5959,8 +4684,8 @@ InitializeFunctions() - 593 - 489 + 687 + 496 20 @@ -5975,8 +4700,8 @@ AppendToFunctions() - 593 - 284 + 687 + 299 20 @@ -5991,8 +4716,8 @@ ActivateShComp() - 28 - 98 + 48 + 125 20 @@ -6023,8 +4748,8 @@ t0UpdateClicked() - 594 - 490 + 688 + 497 20 @@ -6039,8 +4764,8 @@ ActivateShComp() - 28 - 98 + 48 + 125 20 @@ -6064,22 +4789,6 @@ - - fitType1 - currentIndexChanged(int) - MuSRFit4 - InitializeFunctions() - - - 79 - 304 - - - 601 - 323 - - - beamLine currentIndexChanged(int) @@ -6087,8 +4796,8 @@ t0Update() - 416 - 144 + 532 + 198 603 @@ -6096,6 +4805,70 @@ + + numComps + valueChanged(int) + MuSRFit4 + addFitType() + + + 292 + 340 + + + 703 + 397 + + + + + numComps + valueChanged(int) + MuSRFit4 + addSharingComp() + + + 251 + 343 + + + 711 + 372 + + + + + runNumbers + textEdited(QString) + MuSRFit4 + runsLineNotEmpy() + + + 228 + 150 + + + 709 + 181 + + + + + constraintLine + editingFinished() + MuSRFit4 + AppendToFunctions() + + + 461 + 294 + + + 712 + 217 + + + t0UpdateClicked() @@ -6116,5 +4889,8 @@ ActivateShComp() TabChanged() t0Update() + addFitType() + addSharingComp() + runsLineNotEmpy() diff --git a/src/external/MuSRFitGUI/Ui_MuSRFit4.pm b/src/external/MuSRFitGUI/Ui_MuSRFit4.pm index d3b05fb9..99b590d9 100644 --- a/src/external/MuSRFitGUI/Ui_MuSRFit4.pm +++ b/src/external/MuSRFitGUI/Ui_MuSRFit4.pm @@ -5,7 +5,7 @@ ################################################################################# ## Form generated from reading UI file 'MuSRFit4.ui' ## -## Created: Mon Feb 5 15:38:20 2018 +## Created: Wed Feb 14 22:53:49 2018 ## by: Qt User Interface Compiler version 4.8.7 ## ## WARNING! All changes made in this file will be lost when recompiling UI file! @@ -90,60 +90,12 @@ sub runsPage { return shift->{runsPage}; } -sub gridLayout_1 { - return shift->{gridLayout_1}; +sub layoutWidget { + return shift->{layoutWidget}; } -sub gridLayout_2 { - return shift->{gridLayout_2}; -} - -sub runsMan { - return shift->{runsMan}; -} - -sub gridLayout_4 { - return shift->{gridLayout_4}; -} - -sub runFiles_2 { - return shift->{runFiles_2}; -} - -sub spacer3 { - return shift->{spacer3}; -} - -sub runFiles { - return shift->{runFiles}; -} - -sub browse { - return shift->{browse}; -} - -sub gridLayout_6 { - return shift->{gridLayout_6}; -} - -sub fitAsyTypeLabel { - return shift->{fitAsyTypeLabel}; -} - -sub fitAsyType { - return shift->{fitAsyType}; -} - -sub histsLRBFLabel { - return shift->{histsLRBFLabel}; -} - -sub histsLRBF { - return shift->{histsLRBF}; -} - -sub spacer4 { - return shift->{spacer4}; +sub verticalLayout_2 { + return shift->{verticalLayout_2}; } sub runsAuto { @@ -182,36 +134,76 @@ sub beamLineLabel { return shift->{beamLineLabel}; } -sub groupBox { - return shift->{groupBox}; +sub runsMan { + return shift->{runsMan}; } -sub gridLayout_8 { - return shift->{gridLayout_8}; +sub gridLayout_4 { + return shift->{gridLayout_4}; +} + +sub runFiles_2 { + return shift->{runFiles_2}; +} + +sub spacer3 { + return shift->{spacer3}; +} + +sub runFiles { + return shift->{runFiles}; +} + +sub browse { + return shift->{browse}; +} + +sub horizontalLayout_3 { + return shift->{horizontalLayout_3}; +} + +sub verticalLayout { + return shift->{verticalLayout}; +} + +sub horizontalLayout_2 { + return shift->{horizontalLayout_2}; } sub comp1Label { return shift->{comp1Label}; } -sub comp2Label { - return shift->{comp2Label}; +sub numComps { + return shift->{numComps}; } -sub comp3Label { - return shift->{comp3Label}; +sub theoryFunction { + return shift->{theoryFunction}; } -sub fitType1 { - return shift->{fitType1}; +sub scrollAreaWidgetContents { + return shift->{scrollAreaWidgetContents}; } -sub fitType2 { - return shift->{fitType2}; +sub columnView { + return shift->{columnView}; } -sub fitType3 { - return shift->{fitType3}; +sub scrollArea { + return shift->{scrollArea}; +} + +sub scrollAreaWidgetContents_2 { + return shift->{scrollAreaWidgetContents_2}; +} + +sub layoutWidget2 { + return shift->{layoutWidget2}; +} + +sub gridLayout_1 { + return shift->{gridLayout_1}; } sub tisLabel { @@ -286,6 +278,30 @@ sub ltc { return shift->{ltc}; } +sub gridLayout_6 { + return shift->{gridLayout_6}; +} + +sub fitAsyTypeLabel { + return shift->{fitAsyTypeLabel}; +} + +sub fitAsyType { + return shift->{fitAsyType}; +} + +sub histsLRBFLabel { + return shift->{histsLRBFLabel}; +} + +sub histsLRBF { + return shift->{histsLRBF}; +} + +sub spacer4 { + return shift->{spacer4}; +} + sub fittingPage { return shift->{fittingPage}; } @@ -394,110 +410,6 @@ sub comp1ShLabel { return shift->{comp1ShLabel}; } -sub sharingComp2 { - return shift->{sharingComp2}; -} - -sub comp2ShLabel { - return shift->{comp2ShLabel}; -} - -sub layout13 { - return shift->{layout13}; -} - -sub _1 { - return shift->{_1}; -} - -sub shParam_2_1 { - return shift->{shParam_2_1}; -} - -sub shParam_2_2 { - return shift->{shParam_2_2}; -} - -sub shParam_2_3 { - return shift->{shParam_2_3}; -} - -sub shParam_2_4 { - return shift->{shParam_2_4}; -} - -sub shParam_2_5 { - return shift->{shParam_2_5}; -} - -sub shParam_2_6 { - return shift->{shParam_2_6}; -} - -sub shParam_2_7 { - return shift->{shParam_2_7}; -} - -sub shParam_2_8 { - return shift->{shParam_2_8}; -} - -sub shParam_2_9 { - return shift->{shParam_2_9}; -} - -sub sharingComp3 { - return shift->{sharingComp3}; -} - -sub comp3ShLabel { - return shift->{comp3ShLabel}; -} - -sub layout15 { - return shift->{layout15}; -} - -sub _3 { - return shift->{_3}; -} - -sub shParam_3_1 { - return shift->{shParam_3_1}; -} - -sub shParam_3_2 { - return shift->{shParam_3_2}; -} - -sub shParam_3_3 { - return shift->{shParam_3_3}; -} - -sub shParam_3_4 { - return shift->{shParam_3_4}; -} - -sub shParam_3_5 { - return shift->{shParam_3_5}; -} - -sub shParam_3_6 { - return shift->{shParam_3_6}; -} - -sub shParam_3_7 { - return shift->{shParam_3_7}; -} - -sub shParam_3_8 { - return shift->{shParam_3_8}; -} - -sub shParam_3_9 { - return shift->{shParam_3_9}; -} - sub initializationPage { return shift->{initializationPage}; } @@ -993,7 +905,7 @@ sub setupUi { if ( !defined $muSRFit4->objectName() ) { $muSRFit4->setObjectName( "muSRFit4" ); } - $muSRFit4->resize( 674, 541 ); + $muSRFit4->resize( 706, 516 ); my $sizePolicy = Qt::SizePolicy( Qt::SizePolicy::Expanding(), Qt::SizePolicy::Expanding() ); $self->{$sizePolicy} = $sizePolicy; $sizePolicy->setHorizontalStretch( 1 ); @@ -1079,6 +991,12 @@ sub setupUi { my $widget = Qt::Widget( $muSRFit4 ); $self->{widget} = $widget; $widget->setObjectName( "widget" ); + my $sizePolicy1 = Qt::SizePolicy( Qt::SizePolicy::Expanding(), Qt::SizePolicy::Expanding() ); + $self->{$sizePolicy1} = $sizePolicy1; + $sizePolicy1->setHorizontalStretch( 0 ); + $sizePolicy1->setVerticalStretch( 0 ); + $sizePolicy1->setHeightForWidth( $widget->sizePolicy()->hasHeightForWidth() ); + $widget->setSizePolicy( $sizePolicy1 ); my $gridLayout = Qt::GridLayout( $widget ); $self->{gridLayout} = $gridLayout; $gridLayout->setSpacing( 6 ); @@ -1092,141 +1010,32 @@ sub setupUi { $musrfit_tabs->setSizePolicy( $sizePolicy ); $musrfit_tabs->setMinimumSize( Qt::Size(600, 400) ); $musrfit_tabs->setMaximumSize( Qt::Size(32767, 32767) ); + $musrfit_tabs->setToolTip( "" ); + $musrfit_tabs->setAccessibleName( "" ); + $musrfit_tabs->setAccessibleDescription( "" ); my $runsPage = Qt::Widget( ); $self->{runsPage} = $runsPage; $runsPage->setObjectName( "runsPage" ); - my $gridLayout_1 = Qt::GridLayout( $runsPage ); - $self->{gridLayout_1} = $gridLayout_1; - $gridLayout_1->setSpacing( 6 ); - $gridLayout_1->setMargin( 11 ); - $gridLayout_1->setObjectName( "gridLayout_1" ); - my $gridLayout_2 = Qt::GridLayout( ); - $self->{gridLayout_2} = $gridLayout_2; - $gridLayout_2->setSpacing( 0 ); - $gridLayout_2->setObjectName( "gridLayout_2" ); - $gridLayout_2->setSizeConstraint( Qt::Layout::SetMinimumSize() ); - my $runsMan = Qt::GroupBox( $runsPage ); - $self->{runsMan} = $runsMan; - $runsMan->setObjectName( "runsMan" ); - $sizePolicy->setHeightForWidth( $runsMan->sizePolicy()->hasHeightForWidth() ); - $runsMan->setSizePolicy( $sizePolicy ); - $runsMan->setMinimumSize( Qt::Size(0, 80) ); - $runsMan->setBaseSize( Qt::Size(1, 1) ); - $runsMan->setAlignment( Qt::AlignHCenter()|Qt::AlignTop() ); - my $gridLayout_4 = Qt::GridLayout( $runsMan ); - $self->{gridLayout_4} = $gridLayout_4; - $gridLayout_4->setSpacing( 6 ); - $gridLayout_4->setMargin( 11 ); - $gridLayout_4->setObjectName( "gridLayout_4" ); - my $runFiles_2 = Qt::GridLayout( ); - $self->{runFiles_2} = $runFiles_2; - $runFiles_2->setSpacing( 6 ); - $runFiles_2->setObjectName( "runFiles_2" ); - my $spacer3 = Qt::SpacerItem( 411, 21, Qt::SizePolicy::Expanding(), Qt::SizePolicy::Minimum() ); - - $runFiles_2->addItem( $spacer3, 1, 0, 1, 1 ); - - my $runFiles = Qt::LineEdit( $runsMan ); - $self->{runFiles} = $runFiles; - $runFiles->setObjectName( "runFiles" ); - $runFiles->setEnabled( 1 ); - my $sizePolicy1 = Qt::SizePolicy( Qt::SizePolicy::Expanding(), Qt::SizePolicy::Fixed() ); - $self->{$sizePolicy1} = $sizePolicy1; - $sizePolicy1->setHorizontalStretch( 0 ); - $sizePolicy1->setVerticalStretch( 0 ); - $sizePolicy1->setHeightForWidth( $runFiles->sizePolicy()->hasHeightForWidth() ); - $runFiles->setSizePolicy( $sizePolicy1 ); - $runFiles->setMinimumSize( Qt::Size(0, 23) ); - $runFiles->setMaximumSize( Qt::Size(16777215, 25) ); - - $runFiles_2->addWidget( $runFiles, 0, 0, 1, 2 ); - - my $browse = Qt::PushButton( $runsMan ); - $self->{browse} = $browse; - $browse->setObjectName( "browse" ); - $browse->setEnabled( 1 ); - my $sizePolicy2 = Qt::SizePolicy( Qt::SizePolicy::Fixed(), Qt::SizePolicy::Preferred() ); + my $layoutWidget = Qt::Widget( $runsPage ); + $self->{layoutWidget} = $layoutWidget; + $layoutWidget->setObjectName( "layoutWidget" ); + $layoutWidget->setGeometry( Qt::Rect(1, 1, 676, 375) ); + my $verticalLayout_2 = Qt::VBoxLayout( $layoutWidget ); + $self->{verticalLayout_2} = $verticalLayout_2; + $verticalLayout_2->setSpacing( 6 ); + $verticalLayout_2->setMargin( 11 ); + $verticalLayout_2->setObjectName( "verticalLayout_2" ); + $verticalLayout_2->setContentsMargins(0, 0, 0, 0 ); + my $runsAuto = Qt::GroupBox( $layoutWidget ); + $self->{runsAuto} = $runsAuto; + $runsAuto->setObjectName( "runsAuto" ); + my $sizePolicy2 = Qt::SizePolicy( Qt::SizePolicy::Expanding(), Qt::SizePolicy::Preferred() ); $self->{$sizePolicy2} = $sizePolicy2; $sizePolicy2->setHorizontalStretch( 0 ); $sizePolicy2->setVerticalStretch( 0 ); - $sizePolicy2->setHeightForWidth( $browse->sizePolicy()->hasHeightForWidth() ); - $browse->setSizePolicy( $sizePolicy2 ); - $browse->setMinimumSize( Qt::Size(0, 20) ); - $browse->setMaximumSize( Qt::Size(16777215, 25) ); - - $runFiles_2->addWidget( $browse, 1, 1, 1, 1 ); - - - $gridLayout_4->addLayout( $runFiles_2, 0, 0, 1, 1 ); - - - $gridLayout_2->addWidget( $runsMan, 1, 0, 1, 1 ); - - my $gridLayout_6 = Qt::GridLayout( ); - $self->{gridLayout_6} = $gridLayout_6; - $gridLayout_6->setSpacing( 6 ); - $gridLayout_6->setObjectName( "gridLayout_6" ); - $gridLayout_6->setSizeConstraint( Qt::Layout::SetMinimumSize() ); - my $fitAsyTypeLabel = Qt::Label( $runsPage ); - $self->{fitAsyTypeLabel} = $fitAsyTypeLabel; - $fitAsyTypeLabel->setObjectName( "fitAsyTypeLabel" ); - my $sizePolicy3 = Qt::SizePolicy( Qt::SizePolicy::Preferred(), Qt::SizePolicy::Fixed() ); - $self->{$sizePolicy3} = $sizePolicy3; - $sizePolicy3->setHorizontalStretch( 0 ); - $sizePolicy3->setVerticalStretch( 0 ); - $sizePolicy3->setHeightForWidth( $fitAsyTypeLabel->sizePolicy()->hasHeightForWidth() ); - $fitAsyTypeLabel->setSizePolicy( $sizePolicy3 ); - $fitAsyTypeLabel->setWordWrap( 0 ); - - $gridLayout_6->addWidget( $fitAsyTypeLabel, 0, 0, 1, 1 ); - - my $fitAsyType = Qt::ComboBox( $runsPage ); - $self->{fitAsyType} = $fitAsyType; - $fitAsyType->setObjectName( "fitAsyType" ); - $sizePolicy3->setHeightForWidth( $fitAsyType->sizePolicy()->hasHeightForWidth() ); - $fitAsyType->setSizePolicy( $sizePolicy3 ); - $fitAsyType->setMinimumSize( Qt::Size(0, 25) ); - $fitAsyType->setMaximumSize( Qt::Size(16777215, 25) ); - - $gridLayout_6->addWidget( $fitAsyType, 0, 1, 1, 1 ); - - my $histsLRBFLabel = Qt::Label( $runsPage ); - $self->{histsLRBFLabel} = $histsLRBFLabel; - $histsLRBFLabel->setObjectName( "histsLRBFLabel" ); - $sizePolicy3->setHeightForWidth( $histsLRBFLabel->sizePolicy()->hasHeightForWidth() ); - $histsLRBFLabel->setSizePolicy( $sizePolicy3 ); - $histsLRBFLabel->setWordWrap( 0 ); - - $gridLayout_6->addWidget( $histsLRBFLabel, 0, 2, 1, 1 ); - - my $histsLRBF = Qt::LineEdit( $runsPage ); - $self->{histsLRBF} = $histsLRBF; - $histsLRBF->setObjectName( "histsLRBF" ); - $sizePolicy3->setHeightForWidth( $histsLRBF->sizePolicy()->hasHeightForWidth() ); - $histsLRBF->setSizePolicy( $sizePolicy3 ); - $histsLRBF->setMinimumSize( Qt::Size(0, 25) ); - $histsLRBF->setMaximumSize( Qt::Size(16777215, 25) ); - - $gridLayout_6->addWidget( $histsLRBF, 0, 3, 1, 1 ); - - my $spacer4 = Qt::SpacerItem( 81, 21, Qt::SizePolicy::Expanding(), Qt::SizePolicy::Minimum() ); - - $gridLayout_6->addItem( $spacer4, 0, 4, 1, 1 ); - - - $gridLayout_2->addLayout( $gridLayout_6, 3, 0, 1, 1 ); - - my $runsAuto = Qt::GroupBox( $runsPage ); - $self->{runsAuto} = $runsAuto; - $runsAuto->setObjectName( "runsAuto" ); - my $sizePolicy4 = Qt::SizePolicy( Qt::SizePolicy::Expanding(), Qt::SizePolicy::Maximum() ); - $self->{$sizePolicy4} = $sizePolicy4; - $sizePolicy4->setHorizontalStretch( 1 ); - $sizePolicy4->setVerticalStretch( 1 ); - $sizePolicy4->setHeightForWidth( $runsAuto->sizePolicy()->hasHeightForWidth() ); - $runsAuto->setSizePolicy( $sizePolicy4 ); - $runsAuto->setMinimumSize( Qt::Size(0, 100) ); - $runsAuto->setAlignment( Qt::AlignHCenter()|Qt::AlignTop() ); + $sizePolicy2->setHeightForWidth( $runsAuto->sizePolicy()->hasHeightForWidth() ); + $runsAuto->setSizePolicy( $sizePolicy2 ); + $runsAuto->setAlignment( Qt::AlignLeading()|Qt::AlignLeft()|Qt::AlignTop() ); my $gridLayout_3 = Qt::GridLayout( $runsAuto ); $self->{gridLayout_3} = $gridLayout_3; $gridLayout_3->setSpacing( 6 ); @@ -1234,17 +1043,21 @@ sub setupUi { $gridLayout_3->setObjectName( "gridLayout_3" ); my $runNumbers_2 = Qt::GridLayout( ); $self->{runNumbers_2} = $runNumbers_2; - $runNumbers_2->setSpacing( 0 ); + $runNumbers_2->setSpacing( 5 ); $runNumbers_2->setObjectName( "runNumbers_2" ); - $runNumbers_2->setSizeConstraint( Qt::Layout::SetDefaultConstraint() ); + $runNumbers_2->setSizeConstraint( Qt::Layout::SetMinimumSize() ); $runNumbers_2->setContentsMargins(-1, 0, -1, 0 ); my $year = Qt::ComboBox( $runsAuto ); $self->{year} = $year; $year->setObjectName( "year" ); - $sizePolicy2->setHeightForWidth( $year->sizePolicy()->hasHeightForWidth() ); - $year->setSizePolicy( $sizePolicy2 ); + my $sizePolicy3 = Qt::SizePolicy( Qt::SizePolicy::Fixed(), Qt::SizePolicy::Preferred() ); + $self->{$sizePolicy3} = $sizePolicy3; + $sizePolicy3->setHorizontalStretch( 0 ); + $sizePolicy3->setVerticalStretch( 0 ); + $sizePolicy3->setHeightForWidth( $year->sizePolicy()->hasHeightForWidth() ); + $year->setSizePolicy( $sizePolicy3 ); $year->setMinimumSize( Qt::Size(0, 20) ); - $year->setMaximumSize( Qt::Size(16777215, 25) ); + $year->setMaximumSize( Qt::Size(16777215, 29) ); $year->setEditable( 0 ); $year->setInsertPolicy( Qt::ComboBox::InsertAtTop() ); $year->setAutoCompletion( 1 ); @@ -1255,10 +1068,14 @@ sub setupUi { my $runNumbers = Qt::LineEdit( $runsAuto ); $self->{runNumbers} = $runNumbers; $runNumbers->setObjectName( "runNumbers" ); - $sizePolicy1->setHeightForWidth( $runNumbers->sizePolicy()->hasHeightForWidth() ); - $runNumbers->setSizePolicy( $sizePolicy1 ); + my $sizePolicy4 = Qt::SizePolicy( Qt::SizePolicy::Expanding(), Qt::SizePolicy::Fixed() ); + $self->{$sizePolicy4} = $sizePolicy4; + $sizePolicy4->setHorizontalStretch( 0 ); + $sizePolicy4->setVerticalStretch( 0 ); + $sizePolicy4->setHeightForWidth( $runNumbers->sizePolicy()->hasHeightForWidth() ); + $runNumbers->setSizePolicy( $sizePolicy4 ); $runNumbers->setMinimumSize( Qt::Size(0, 23) ); - $runNumbers->setMaximumSize( Qt::Size(16777215, 25) ); + $runNumbers->setMaximumSize( Qt::Size(16777215, 29) ); $runNumbers->setAlignment( Qt::AlignLeading()|Qt::AlignLeft()|Qt::AlignTop() ); $runNumbers_2->addWidget( $runNumbers, 0, 0, 1, 5 ); @@ -1270,10 +1087,10 @@ sub setupUi { my $beamLine = Qt::ComboBox( $runsAuto ); $self->{beamLine} = $beamLine; $beamLine->setObjectName( "beamLine" ); - $sizePolicy2->setHeightForWidth( $beamLine->sizePolicy()->hasHeightForWidth() ); - $beamLine->setSizePolicy( $sizePolicy2 ); + $sizePolicy3->setHeightForWidth( $beamLine->sizePolicy()->hasHeightForWidth() ); + $beamLine->setSizePolicy( $sizePolicy3 ); $beamLine->setMinimumSize( Qt::Size(0, 20) ); - $beamLine->setMaximumSize( Qt::Size(16777215, 25) ); + $beamLine->setMaximumSize( Qt::Size(16777215, 29) ); $runNumbers_2->addWidget( $beamLine, 1, 2, 1, 1 ); @@ -1306,27 +1123,78 @@ sub setupUi { $gridLayout_3->addLayout( $runNumbers_2, 0, 0, 1, 1 ); - $gridLayout_2->addWidget( $runsAuto, 0, 0, 1, 1 ); + $verticalLayout_2->addWidget( $runsAuto ); - my $groupBox = Qt::GroupBox( $runsPage ); - $self->{groupBox} = $groupBox; - $groupBox->setObjectName( "groupBox" ); - my $sizePolicy6 = Qt::SizePolicy( Qt::SizePolicy::Expanding(), Qt::SizePolicy::Expanding() ); + my $runsMan = Qt::GroupBox( $layoutWidget ); + $self->{runsMan} = $runsMan; + $runsMan->setObjectName( "runsMan" ); + my $sizePolicy6 = Qt::SizePolicy( Qt::SizePolicy::Expanding(), Qt::SizePolicy::Maximum() ); $self->{$sizePolicy6} = $sizePolicy6; - $sizePolicy6->setHorizontalStretch( 0 ); - $sizePolicy6->setVerticalStretch( 0 ); - $sizePolicy6->setHeightForWidth( $groupBox->sizePolicy()->hasHeightForWidth() ); - $groupBox->setSizePolicy( $sizePolicy6 ); - $groupBox->setMinimumSize( Qt::Size(0, 220) ); - $groupBox->setBaseSize( Qt::Size(0, 0) ); - my $gridLayout_8 = Qt::GridLayout( $groupBox ); - $self->{gridLayout_8} = $gridLayout_8; - $gridLayout_8->setSpacing( 6 ); - $gridLayout_8->setMargin( 11 ); - $gridLayout_8->setObjectName( "gridLayout_8" ); - my $comp1Label = Qt::Label( $groupBox ); + $sizePolicy6->setHorizontalStretch( 1 ); + $sizePolicy6->setVerticalStretch( 1 ); + $sizePolicy6->setHeightForWidth( $runsMan->sizePolicy()->hasHeightForWidth() ); + $runsMan->setSizePolicy( $sizePolicy6 ); + $runsMan->setMinimumSize( Qt::Size(0, 80) ); + $runsMan->setBaseSize( Qt::Size(1, 1) ); + $runsMan->setAlignment( Qt::AlignLeading()|Qt::AlignLeft()|Qt::AlignTop() ); + my $gridLayout_4 = Qt::GridLayout( $runsMan ); + $self->{gridLayout_4} = $gridLayout_4; + $gridLayout_4->setSpacing( 6 ); + $gridLayout_4->setMargin( 11 ); + $gridLayout_4->setObjectName( "gridLayout_4" ); + my $runFiles_2 = Qt::GridLayout( ); + $self->{runFiles_2} = $runFiles_2; + $runFiles_2->setSpacing( 5 ); + $runFiles_2->setObjectName( "runFiles_2" ); + my $spacer3 = Qt::SpacerItem( 411, 21, Qt::SizePolicy::Expanding(), Qt::SizePolicy::Minimum() ); + + $runFiles_2->addItem( $spacer3, 1, 0, 1, 1 ); + + my $runFiles = Qt::LineEdit( $runsMan ); + $self->{runFiles} = $runFiles; + $runFiles->setObjectName( "runFiles" ); + $runFiles->setEnabled( 1 ); + $sizePolicy4->setHeightForWidth( $runFiles->sizePolicy()->hasHeightForWidth() ); + $runFiles->setSizePolicy( $sizePolicy4 ); + $runFiles->setMinimumSize( Qt::Size(0, 23) ); + $runFiles->setMaximumSize( Qt::Size(16777215, 29) ); + + $runFiles_2->addWidget( $runFiles, 0, 0, 1, 2 ); + + my $browse = Qt::PushButton( $runsMan ); + $self->{browse} = $browse; + $browse->setObjectName( "browse" ); + $browse->setEnabled( 1 ); + $sizePolicy3->setHeightForWidth( $browse->sizePolicy()->hasHeightForWidth() ); + $browse->setSizePolicy( $sizePolicy3 ); + $browse->setMinimumSize( Qt::Size(0, 20) ); + $browse->setMaximumSize( Qt::Size(16777215, 29) ); + + $runFiles_2->addWidget( $browse, 1, 1, 1, 1 ); + + + $gridLayout_4->addLayout( $runFiles_2, 0, 0, 1, 1 ); + + + $verticalLayout_2->addWidget( $runsMan ); + + my $horizontalLayout_3 = Qt::HBoxLayout( ); + $self->{horizontalLayout_3} = $horizontalLayout_3; + $horizontalLayout_3->setSpacing( 6 ); + $horizontalLayout_3->setObjectName( "horizontalLayout_3" ); + my $verticalLayout = Qt::VBoxLayout( ); + $self->{verticalLayout} = $verticalLayout; + $verticalLayout->setSpacing( 6 ); + $verticalLayout->setObjectName( "verticalLayout" ); + my $horizontalLayout_2 = Qt::HBoxLayout( ); + $self->{horizontalLayout_2} = $horizontalLayout_2; + $horizontalLayout_2->setSpacing( 6 ); + $horizontalLayout_2->setObjectName( "horizontalLayout_2" ); + my $comp1Label = Qt::Label( $layoutWidget ); $self->{comp1Label} = $comp1Label; $comp1Label->setObjectName( "comp1Label" ); + $comp1Label->setMinimumSize( Qt::Size(0, 29) ); + $comp1Label->setMaximumSize( Qt::Size(16777215, 29) ); my $palette = Qt::Palette(); my $brush = Qt::Brush(Qt::Color(0, 0, 0, 255)); $brush->setStyle( Qt::SolidPattern() ); @@ -1399,300 +1267,289 @@ sub setupUi { $palette->setBrush(Qt::Palette::Disabled(), Qt::Palette::Link(), $brush8); $palette->setBrush(Qt::Palette::Disabled(), Qt::Palette::LinkVisited(), $brush9); $comp1Label->setPalette( $palette ); + $comp1Label->setAlignment( Qt::AlignLeading()|Qt::AlignLeft()|Qt::AlignVCenter() ); $comp1Label->setWordWrap( 0 ); - $gridLayout_8->addWidget( $comp1Label, 0, 0, 1, 1 ); + $horizontalLayout_2->addWidget( $comp1Label ); - my $comp2Label = Qt::Label( $groupBox ); - $self->{comp2Label} = $comp2Label; - $comp2Label->setObjectName( "comp2Label" ); - my $palette1 = Qt::Palette(); - $palette1->setBrush(Qt::Palette::Active(), Qt::Palette::WindowText(), $brush); - $palette1->setBrush(Qt::Palette::Active(), Qt::Palette::Button(), $brush1); - $palette1->setBrush(Qt::Palette::Active(), Qt::Palette::Light(), $brush2); - $palette1->setBrush(Qt::Palette::Active(), Qt::Palette::Midlight(), $brush3); - $palette1->setBrush(Qt::Palette::Active(), Qt::Palette::Dark(), $brush4); - $palette1->setBrush(Qt::Palette::Active(), Qt::Palette::Mid(), $brush5); - $palette1->setBrush(Qt::Palette::Active(), Qt::Palette::Text(), $brush); - $palette1->setBrush(Qt::Palette::Active(), Qt::Palette::BrightText(), $brush2); - $palette1->setBrush(Qt::Palette::Active(), Qt::Palette::ButtonText(), $brush); - $palette1->setBrush(Qt::Palette::Active(), Qt::Palette::Base(), $brush2); - $palette1->setBrush(Qt::Palette::Active(), Qt::Palette::Window(), $brush6); - $palette1->setBrush(Qt::Palette::Active(), Qt::Palette::Shadow(), $brush); - $palette1->setBrush(Qt::Palette::Active(), Qt::Palette::Highlight(), $brush7); - $palette1->setBrush(Qt::Palette::Active(), Qt::Palette::HighlightedText(), $brush2); - $palette1->setBrush(Qt::Palette::Active(), Qt::Palette::Link(), $brush); - $palette1->setBrush(Qt::Palette::Active(), Qt::Palette::LinkVisited(), $brush); - $palette1->setBrush(Qt::Palette::Inactive(), Qt::Palette::WindowText(), $brush); - $palette1->setBrush(Qt::Palette::Inactive(), Qt::Palette::Button(), $brush1); - $palette1->setBrush(Qt::Palette::Inactive(), Qt::Palette::Light(), $brush2); - $palette1->setBrush(Qt::Palette::Inactive(), Qt::Palette::Midlight(), $brush2); - $palette1->setBrush(Qt::Palette::Inactive(), Qt::Palette::Dark(), $brush4); - $palette1->setBrush(Qt::Palette::Inactive(), Qt::Palette::Mid(), $brush5); - $palette1->setBrush(Qt::Palette::Inactive(), Qt::Palette::Text(), $brush); - $palette1->setBrush(Qt::Palette::Inactive(), Qt::Palette::BrightText(), $brush2); - $palette1->setBrush(Qt::Palette::Inactive(), Qt::Palette::ButtonText(), $brush); - $palette1->setBrush(Qt::Palette::Inactive(), Qt::Palette::Base(), $brush2); - $palette1->setBrush(Qt::Palette::Inactive(), Qt::Palette::Window(), $brush6); - $palette1->setBrush(Qt::Palette::Inactive(), Qt::Palette::Shadow(), $brush); - $palette1->setBrush(Qt::Palette::Inactive(), Qt::Palette::Highlight(), $brush7); - $palette1->setBrush(Qt::Palette::Inactive(), Qt::Palette::HighlightedText(), $brush2); - $palette1->setBrush(Qt::Palette::Inactive(), Qt::Palette::Link(), $brush8); - $palette1->setBrush(Qt::Palette::Inactive(), Qt::Palette::LinkVisited(), $brush9); - $palette1->setBrush(Qt::Palette::Disabled(), Qt::Palette::WindowText(), $brush10); - $palette1->setBrush(Qt::Palette::Disabled(), Qt::Palette::Button(), $brush1); - $palette1->setBrush(Qt::Palette::Disabled(), Qt::Palette::Light(), $brush2); - $palette1->setBrush(Qt::Palette::Disabled(), Qt::Palette::Midlight(), $brush2); - $palette1->setBrush(Qt::Palette::Disabled(), Qt::Palette::Dark(), $brush4); - $palette1->setBrush(Qt::Palette::Disabled(), Qt::Palette::Mid(), $brush5); - $palette1->setBrush(Qt::Palette::Disabled(), Qt::Palette::Text(), $brush10); - $palette1->setBrush(Qt::Palette::Disabled(), Qt::Palette::BrightText(), $brush2); - $palette1->setBrush(Qt::Palette::Disabled(), Qt::Palette::ButtonText(), $brush10); - $palette1->setBrush(Qt::Palette::Disabled(), Qt::Palette::Base(), $brush2); - $palette1->setBrush(Qt::Palette::Disabled(), Qt::Palette::Window(), $brush6); - $palette1->setBrush(Qt::Palette::Disabled(), Qt::Palette::Shadow(), $brush); - $palette1->setBrush(Qt::Palette::Disabled(), Qt::Palette::Highlight(), $brush7); - $palette1->setBrush(Qt::Palette::Disabled(), Qt::Palette::HighlightedText(), $brush2); - $palette1->setBrush(Qt::Palette::Disabled(), Qt::Palette::Link(), $brush8); - $palette1->setBrush(Qt::Palette::Disabled(), Qt::Palette::LinkVisited(), $brush9); - $comp2Label->setPalette( $palette1 ); - $comp2Label->setWordWrap( 0 ); + my $numComps = Qt::SpinBox( $layoutWidget ); + $self->{numComps} = $numComps; + $numComps->setObjectName( "numComps" ); + $numComps->setMinimumSize( Qt::Size(0, 29) ); + $numComps->setMaximumSize( Qt::Size(16777215, 29) ); + $numComps->setMinimum( 1 ); - $gridLayout_8->addWidget( $comp2Label, 0, 2, 1, 1 ); + $horizontalLayout_2->addWidget( $numComps ); - my $comp3Label = Qt::Label( $groupBox ); - $self->{comp3Label} = $comp3Label; - $comp3Label->setObjectName( "comp3Label" ); - my $palette2 = Qt::Palette(); - $palette2->setBrush(Qt::Palette::Active(), Qt::Palette::WindowText(), $brush); - $palette2->setBrush(Qt::Palette::Active(), Qt::Palette::Button(), $brush1); - $palette2->setBrush(Qt::Palette::Active(), Qt::Palette::Light(), $brush2); - $palette2->setBrush(Qt::Palette::Active(), Qt::Palette::Midlight(), $brush3); - $palette2->setBrush(Qt::Palette::Active(), Qt::Palette::Dark(), $brush4); - $palette2->setBrush(Qt::Palette::Active(), Qt::Palette::Mid(), $brush5); - $palette2->setBrush(Qt::Palette::Active(), Qt::Palette::Text(), $brush); - $palette2->setBrush(Qt::Palette::Active(), Qt::Palette::BrightText(), $brush2); - $palette2->setBrush(Qt::Palette::Active(), Qt::Palette::ButtonText(), $brush); - $palette2->setBrush(Qt::Palette::Active(), Qt::Palette::Base(), $brush2); - $palette2->setBrush(Qt::Palette::Active(), Qt::Palette::Window(), $brush6); - $palette2->setBrush(Qt::Palette::Active(), Qt::Palette::Shadow(), $brush); - $palette2->setBrush(Qt::Palette::Active(), Qt::Palette::Highlight(), $brush7); - $palette2->setBrush(Qt::Palette::Active(), Qt::Palette::HighlightedText(), $brush2); - $palette2->setBrush(Qt::Palette::Active(), Qt::Palette::Link(), $brush); - $palette2->setBrush(Qt::Palette::Active(), Qt::Palette::LinkVisited(), $brush); - $palette2->setBrush(Qt::Palette::Inactive(), Qt::Palette::WindowText(), $brush); - $palette2->setBrush(Qt::Palette::Inactive(), Qt::Palette::Button(), $brush1); - $palette2->setBrush(Qt::Palette::Inactive(), Qt::Palette::Light(), $brush2); - $palette2->setBrush(Qt::Palette::Inactive(), Qt::Palette::Midlight(), $brush2); - $palette2->setBrush(Qt::Palette::Inactive(), Qt::Palette::Dark(), $brush4); - $palette2->setBrush(Qt::Palette::Inactive(), Qt::Palette::Mid(), $brush5); - $palette2->setBrush(Qt::Palette::Inactive(), Qt::Palette::Text(), $brush); - $palette2->setBrush(Qt::Palette::Inactive(), Qt::Palette::BrightText(), $brush2); - $palette2->setBrush(Qt::Palette::Inactive(), Qt::Palette::ButtonText(), $brush); - $palette2->setBrush(Qt::Palette::Inactive(), Qt::Palette::Base(), $brush2); - $palette2->setBrush(Qt::Palette::Inactive(), Qt::Palette::Window(), $brush6); - $palette2->setBrush(Qt::Palette::Inactive(), Qt::Palette::Shadow(), $brush); - $palette2->setBrush(Qt::Palette::Inactive(), Qt::Palette::Highlight(), $brush7); - $palette2->setBrush(Qt::Palette::Inactive(), Qt::Palette::HighlightedText(), $brush2); - $palette2->setBrush(Qt::Palette::Inactive(), Qt::Palette::Link(), $brush8); - $palette2->setBrush(Qt::Palette::Inactive(), Qt::Palette::LinkVisited(), $brush9); - $palette2->setBrush(Qt::Palette::Disabled(), Qt::Palette::WindowText(), $brush10); - $palette2->setBrush(Qt::Palette::Disabled(), Qt::Palette::Button(), $brush1); - $palette2->setBrush(Qt::Palette::Disabled(), Qt::Palette::Light(), $brush2); - $palette2->setBrush(Qt::Palette::Disabled(), Qt::Palette::Midlight(), $brush2); - $palette2->setBrush(Qt::Palette::Disabled(), Qt::Palette::Dark(), $brush4); - $palette2->setBrush(Qt::Palette::Disabled(), Qt::Palette::Mid(), $brush5); - $palette2->setBrush(Qt::Palette::Disabled(), Qt::Palette::Text(), $brush10); - $palette2->setBrush(Qt::Palette::Disabled(), Qt::Palette::BrightText(), $brush2); - $palette2->setBrush(Qt::Palette::Disabled(), Qt::Palette::ButtonText(), $brush10); - $palette2->setBrush(Qt::Palette::Disabled(), Qt::Palette::Base(), $brush2); - $palette2->setBrush(Qt::Palette::Disabled(), Qt::Palette::Window(), $brush6); - $palette2->setBrush(Qt::Palette::Disabled(), Qt::Palette::Shadow(), $brush); - $palette2->setBrush(Qt::Palette::Disabled(), Qt::Palette::Highlight(), $brush7); - $palette2->setBrush(Qt::Palette::Disabled(), Qt::Palette::HighlightedText(), $brush2); - $palette2->setBrush(Qt::Palette::Disabled(), Qt::Palette::Link(), $brush8); - $palette2->setBrush(Qt::Palette::Disabled(), Qt::Palette::LinkVisited(), $brush9); - $comp3Label->setPalette( $palette2 ); - $comp3Label->setWordWrap( 0 ); - $gridLayout_8->addWidget( $comp3Label, 0, 4, 1, 1 ); + $verticalLayout->addLayout( $horizontalLayout_2 ); - my $fitType1 = Qt::ComboBox( $groupBox ); - $self->{fitType1} = $fitType1; - $fitType1->setObjectName( "fitType1" ); - $sizePolicy3->setHeightForWidth( $fitType1->sizePolicy()->hasHeightForWidth() ); - $fitType1->setSizePolicy( $sizePolicy3 ); - $fitType1->setMinimumSize( Qt::Size(0, 25) ); - $fitType1->setMaximumSize( Qt::Size(16777215, 25) ); - $fitType1->setAutoCompletion( 0 ); - $fitType1->setDuplicatesEnabled( 0 ); + my $theoryFunction = Qt::ScrollArea( $layoutWidget ); + $self->{theoryFunction} = $theoryFunction; + $theoryFunction->setObjectName( "theoryFunction" ); + $sizePolicy1->setHeightForWidth( $theoryFunction->sizePolicy()->hasHeightForWidth() ); + $theoryFunction->setSizePolicy( $sizePolicy1 ); + $theoryFunction->setMinimumSize( Qt::Size(280, 0) ); + $theoryFunction->setVerticalScrollBarPolicy( Qt::ScrollBarAsNeeded() ); + $theoryFunction->setWidgetResizable( 1 ); + my $scrollAreaWidgetContents = Qt::Widget( ); + $self->{scrollAreaWidgetContents} = $scrollAreaWidgetContents; + $scrollAreaWidgetContents->setObjectName( "scrollAreaWidgetContents" ); + $scrollAreaWidgetContents->setGeometry( Qt::Rect(0, 0, 276, 70) ); + my $columnView = Qt::VBoxLayout( $scrollAreaWidgetContents ); + $self->{columnView} = $columnView; + $columnView->setObjectName( "columnView" ); + $columnView->setGeometry( Qt::Rect(10, 10, 261, 151) ); + $theoryFunction->setWidget( $scrollAreaWidgetContents ); - $gridLayout_8->addWidget( $fitType1, 1, 0, 1, 2 ); + $verticalLayout->addWidget( $theoryFunction ); - my $fitType2 = Qt::ComboBox( $groupBox ); - $self->{fitType2} = $fitType2; - $fitType2->setObjectName( "fitType2" ); - $sizePolicy3->setHeightForWidth( $fitType2->sizePolicy()->hasHeightForWidth() ); - $fitType2->setSizePolicy( $sizePolicy3 ); - $fitType2->setMinimumSize( Qt::Size(0, 25) ); - $fitType2->setMaximumSize( Qt::Size(16777215, 25) ); - $gridLayout_8->addWidget( $fitType2, 1, 2, 1, 2 ); + $horizontalLayout_3->addLayout( $verticalLayout ); - my $fitType3 = Qt::ComboBox( $groupBox ); - $self->{fitType3} = $fitType3; - $fitType3->setObjectName( "fitType3" ); - $sizePolicy3->setHeightForWidth( $fitType3->sizePolicy()->hasHeightForWidth() ); - $fitType3->setSizePolicy( $sizePolicy3 ); - $fitType3->setMinimumSize( Qt::Size(0, 25) ); - $fitType3->setMaximumSize( Qt::Size(16777215, 25) ); - - $gridLayout_8->addWidget( $fitType3, 1, 4, 1, 1 ); - - my $tisLabel = Qt::Label( $groupBox ); + my $scrollArea = Qt::ScrollArea( $layoutWidget ); + $self->{scrollArea} = $scrollArea; + $scrollArea->setObjectName( "scrollArea" ); + $sizePolicy1->setHeightForWidth( $scrollArea->sizePolicy()->hasHeightForWidth() ); + $scrollArea->setSizePolicy( $sizePolicy1 ); + $scrollArea->setMinimumSize( Qt::Size(384, 0) ); + $scrollArea->setWidgetResizable( 1 ); + my $scrollAreaWidgetContents_2 = Qt::Widget( ); + $self->{scrollAreaWidgetContents_2} = $scrollAreaWidgetContents_2; + $scrollAreaWidgetContents_2->setObjectName( "scrollAreaWidgetContents_2" ); + $scrollAreaWidgetContents_2->setGeometry( Qt::Rect(0, 0, 380, 109) ); + my $layoutWidget2 = Qt::Widget( $scrollAreaWidgetContents_2 ); + $self->{layoutWidget2} = $layoutWidget2; + $layoutWidget2->setObjectName( "layoutWidget2" ); + $layoutWidget2->setGeometry( Qt::Rect(10, 10, 355, 192) ); + my $gridLayout_1 = Qt::GridLayout( $layoutWidget2 ); + $self->{gridLayout_1} = $gridLayout_1; + $gridLayout_1->setSpacing( 5 ); + $gridLayout_1->setMargin( 11 ); + $gridLayout_1->setObjectName( "gridLayout_1" ); + $gridLayout_1->setContentsMargins(5, 0, 5, 0 ); + my $tisLabel = Qt::Label( $layoutWidget2 ); $self->{tisLabel} = $tisLabel; $tisLabel->setObjectName( "tisLabel" ); - $sizePolicy3->setHeightForWidth( $tisLabel->sizePolicy()->hasHeightForWidth() ); - $tisLabel->setSizePolicy( $sizePolicy3 ); + my $sizePolicy7 = Qt::SizePolicy( Qt::SizePolicy::Preferred(), Qt::SizePolicy::Fixed() ); + $self->{$sizePolicy7} = $sizePolicy7; + $sizePolicy7->setHorizontalStretch( 0 ); + $sizePolicy7->setVerticalStretch( 0 ); + $sizePolicy7->setHeightForWidth( $tisLabel->sizePolicy()->hasHeightForWidth() ); + $tisLabel->setSizePolicy( $sizePolicy7 ); $tisLabel->setWordWrap( 0 ); - $gridLayout_8->addWidget( $tisLabel, 2, 0, 1, 1 ); + $gridLayout_1->addWidget( $tisLabel, 0, 0, 1, 1 ); - my $tfsLabel = Qt::Label( $groupBox ); + my $tfsLabel = Qt::Label( $layoutWidget2 ); $self->{tfsLabel} = $tfsLabel; $tfsLabel->setObjectName( "tfsLabel" ); - $sizePolicy3->setHeightForWidth( $tfsLabel->sizePolicy()->hasHeightForWidth() ); - $tfsLabel->setSizePolicy( $sizePolicy3 ); + $sizePolicy7->setHeightForWidth( $tfsLabel->sizePolicy()->hasHeightForWidth() ); + $tfsLabel->setSizePolicy( $sizePolicy7 ); $tfsLabel->setWordWrap( 0 ); - $gridLayout_8->addWidget( $tfsLabel, 2, 2, 1, 1 ); + $gridLayout_1->addWidget( $tfsLabel, 0, 1, 1, 1 ); - my $binsLabel = Qt::Label( $groupBox ); + my $binsLabel = Qt::Label( $layoutWidget2 ); $self->{binsLabel} = $binsLabel; $binsLabel->setObjectName( "binsLabel" ); - $sizePolicy3->setHeightForWidth( $binsLabel->sizePolicy()->hasHeightForWidth() ); - $binsLabel->setSizePolicy( $sizePolicy3 ); + $sizePolicy7->setHeightForWidth( $binsLabel->sizePolicy()->hasHeightForWidth() ); + $binsLabel->setSizePolicy( $sizePolicy7 ); $binsLabel->setWordWrap( 0 ); - $gridLayout_8->addWidget( $binsLabel, 2, 4, 1, 1 ); + $gridLayout_1->addWidget( $binsLabel, 0, 2, 1, 1 ); - my $tis = Qt::LineEdit( $groupBox ); + my $tis = Qt::LineEdit( $layoutWidget2 ); $self->{tis} = $tis; $tis->setObjectName( "tis" ); - $sizePolicy3->setHeightForWidth( $tis->sizePolicy()->hasHeightForWidth() ); - $tis->setSizePolicy( $sizePolicy3 ); - $tis->setMinimumSize( Qt::Size(0, 25) ); - $tis->setMaximumSize( Qt::Size(16777215, 25) ); + $sizePolicy4->setHeightForWidth( $tis->sizePolicy()->hasHeightForWidth() ); + $tis->setSizePolicy( $sizePolicy4 ); + $tis->setMinimumSize( Qt::Size(0, 29) ); + $tis->setMaximumSize( Qt::Size(16777215, 29) ); - $gridLayout_8->addWidget( $tis, 3, 0, 1, 1 ); + $gridLayout_1->addWidget( $tis, 1, 0, 1, 1 ); - my $tfs = Qt::LineEdit( $groupBox ); + my $tfs = Qt::LineEdit( $layoutWidget2 ); $self->{tfs} = $tfs; $tfs->setObjectName( "tfs" ); - $sizePolicy3->setHeightForWidth( $tfs->sizePolicy()->hasHeightForWidth() ); - $tfs->setSizePolicy( $sizePolicy3 ); - $tfs->setMinimumSize( Qt::Size(0, 25) ); - $tfs->setMaximumSize( Qt::Size(16777215, 25) ); + $sizePolicy4->setHeightForWidth( $tfs->sizePolicy()->hasHeightForWidth() ); + $tfs->setSizePolicy( $sizePolicy4 ); + $tfs->setMinimumSize( Qt::Size(0, 29) ); + $tfs->setMaximumSize( Qt::Size(16777215, 29) ); - $gridLayout_8->addWidget( $tfs, 3, 2, 1, 1 ); + $gridLayout_1->addWidget( $tfs, 1, 1, 1, 1 ); - my $bins = Qt::LineEdit( $groupBox ); + my $bins = Qt::LineEdit( $layoutWidget2 ); $self->{bins} = $bins; $bins->setObjectName( "bins" ); - $sizePolicy3->setHeightForWidth( $bins->sizePolicy()->hasHeightForWidth() ); - $bins->setSizePolicy( $sizePolicy3 ); - $bins->setMinimumSize( Qt::Size(0, 25) ); - $bins->setMaximumSize( Qt::Size(16777215, 25) ); + $sizePolicy4->setHeightForWidth( $bins->sizePolicy()->hasHeightForWidth() ); + $bins->setSizePolicy( $sizePolicy4 ); + $bins->setMinimumSize( Qt::Size(0, 29) ); + $bins->setMaximumSize( Qt::Size(16777215, 29) ); - $gridLayout_8->addWidget( $bins, 3, 4, 1, 1 ); + $gridLayout_1->addWidget( $bins, 1, 2, 1, 1 ); - my $textLabel1_4 = Qt::Label( $groupBox ); + my $textLabel1_4 = Qt::Label( $layoutWidget2 ); $self->{textLabel1_4} = $textLabel1_4; $textLabel1_4->setObjectName( "textLabel1_4" ); + my $sizePolicy8 = Qt::SizePolicy( Qt::SizePolicy::Preferred(), Qt::SizePolicy::Minimum() ); + $self->{$sizePolicy8} = $sizePolicy8; + $sizePolicy8->setHorizontalStretch( 0 ); + $sizePolicy8->setVerticalStretch( 0 ); + $sizePolicy8->setHeightForWidth( $textLabel1_4->sizePolicy()->hasHeightForWidth() ); + $textLabel1_4->setSizePolicy( $sizePolicy8 ); + $textLabel1_4->setMinimumSize( Qt::Size(0, 29) ); $textLabel1_4->setWordWrap( 0 ); - $gridLayout_8->addWidget( $textLabel1_4, 4, 0, 1, 1 ); + $gridLayout_1->addWidget( $textLabel1_4, 2, 0, 1, 1 ); - my $textLabel1_8 = Qt::Label( $groupBox ); + my $textLabel1_8 = Qt::Label( $layoutWidget2 ); $self->{textLabel1_8} = $textLabel1_8; $textLabel1_8->setObjectName( "textLabel1_8" ); + $sizePolicy8->setHeightForWidth( $textLabel1_8->sizePolicy()->hasHeightForWidth() ); + $textLabel1_8->setSizePolicy( $sizePolicy8 ); + $textLabel1_8->setMinimumSize( Qt::Size(0, 29) ); $textLabel1_8->setWordWrap( 0 ); - $gridLayout_8->addWidget( $textLabel1_8, 4, 2, 1, 1 ); + $gridLayout_1->addWidget( $textLabel1_8, 2, 1, 1, 1 ); - my $textLabel1_4_2_2 = Qt::Label( $groupBox ); + my $textLabel1_4_2_2 = Qt::Label( $layoutWidget2 ); $self->{textLabel1_4_2_2} = $textLabel1_4_2_2; $textLabel1_4_2_2->setObjectName( "textLabel1_4_2_2" ); + $sizePolicy8->setHeightForWidth( $textLabel1_4_2_2->sizePolicy()->hasHeightForWidth() ); + $textLabel1_4_2_2->setSizePolicy( $sizePolicy8 ); + $textLabel1_4_2_2->setMinimumSize( Qt::Size(0, 29) ); $textLabel1_4_2_2->setWordWrap( 0 ); - $gridLayout_8->addWidget( $textLabel1_4_2_2, 4, 4, 1, 1 ); + $gridLayout_1->addWidget( $textLabel1_4_2_2, 2, 2, 1, 1 ); - my $xi = Qt::LineEdit( $groupBox ); + my $xi = Qt::LineEdit( $layoutWidget2 ); $self->{xi} = $xi; $xi->setObjectName( "xi" ); - $xi->setMinimumSize( Qt::Size(0, 25) ); + $xi->setMinimumSize( Qt::Size(0, 29) ); - $gridLayout_8->addWidget( $xi, 5, 0, 1, 1 ); + $gridLayout_1->addWidget( $xi, 3, 0, 1, 1 ); - my $xf = Qt::LineEdit( $groupBox ); + my $xf = Qt::LineEdit( $layoutWidget2 ); $self->{xf} = $xf; $xf->setObjectName( "xf" ); - $xf->setMinimumSize( Qt::Size(0, 25) ); + $xf->setMinimumSize( Qt::Size(0, 29) ); - $gridLayout_8->addWidget( $xf, 5, 2, 1, 1 ); + $gridLayout_1->addWidget( $xf, 3, 1, 1, 1 ); - my $viewBin = Qt::LineEdit( $groupBox ); + my $viewBin = Qt::LineEdit( $layoutWidget2 ); $self->{viewBin} = $viewBin; $viewBin->setObjectName( "viewBin" ); - $viewBin->setMinimumSize( Qt::Size(0, 25) ); + $viewBin->setMinimumSize( Qt::Size(0, 29) ); - $gridLayout_8->addWidget( $viewBin, 5, 3, 1, 2 ); + $gridLayout_1->addWidget( $viewBin, 3, 2, 1, 1 ); - my $textLabel1_4_2 = Qt::Label( $groupBox ); + my $textLabel1_4_2 = Qt::Label( $layoutWidget2 ); $self->{textLabel1_4_2} = $textLabel1_4_2; $textLabel1_4_2->setObjectName( "textLabel1_4_2" ); + $textLabel1_4_2->setMinimumSize( Qt::Size(0, 29) ); $textLabel1_4_2->setWordWrap( 0 ); - $gridLayout_8->addWidget( $textLabel1_4_2, 6, 0, 1, 1 ); + $gridLayout_1->addWidget( $textLabel1_4_2, 4, 0, 1, 1 ); - my $textLabel1_4_3 = Qt::Label( $groupBox ); + my $textLabel1_4_3 = Qt::Label( $layoutWidget2 ); $self->{textLabel1_4_3} = $textLabel1_4_3; $textLabel1_4_3->setObjectName( "textLabel1_4_3" ); + $textLabel1_4_3->setMinimumSize( Qt::Size(0, 29) ); $textLabel1_4_3->setWordWrap( 0 ); - $gridLayout_8->addWidget( $textLabel1_4_3, 6, 2, 1, 1 ); + $gridLayout_1->addWidget( $textLabel1_4_3, 4, 1, 1, 1 ); - my $textLabel1_4_4 = Qt::Label( $groupBox ); + my $textLabel1_4_4 = Qt::Label( $layoutWidget2 ); $self->{textLabel1_4_4} = $textLabel1_4_4; $textLabel1_4_4->setObjectName( "textLabel1_4_4" ); + $sizePolicy4->setHeightForWidth( $textLabel1_4_4->sizePolicy()->hasHeightForWidth() ); + $textLabel1_4_4->setSizePolicy( $sizePolicy4 ); + $textLabel1_4_4->setMinimumSize( Qt::Size(0, 29) ); $textLabel1_4_4->setWordWrap( 0 ); - $gridLayout_8->addWidget( $textLabel1_4_4, 6, 4, 1, 1 ); + $gridLayout_1->addWidget( $textLabel1_4_4, 4, 2, 1, 1 ); - my $yi = Qt::LineEdit( $groupBox ); + my $yi = Qt::LineEdit( $layoutWidget2 ); $self->{yi} = $yi; $yi->setObjectName( "yi" ); + $yi->setMinimumSize( Qt::Size(0, 29) ); - $gridLayout_8->addWidget( $yi, 7, 0, 1, 1 ); + $gridLayout_1->addWidget( $yi, 5, 0, 1, 1 ); - my $yf = Qt::LineEdit( $groupBox ); + my $yf = Qt::LineEdit( $layoutWidget2 ); $self->{yf} = $yf; $yf->setObjectName( "yf" ); + $yf->setMinimumSize( Qt::Size(0, 29) ); - $gridLayout_8->addWidget( $yf, 7, 1, 1, 2 ); + $gridLayout_1->addWidget( $yf, 5, 1, 1, 1 ); - my $ltc = Qt::CheckBox( $groupBox ); + my $ltc = Qt::CheckBox( $layoutWidget2 ); $self->{ltc} = $ltc; $ltc->setObjectName( "ltc" ); + $sizePolicy4->setHeightForWidth( $ltc->sizePolicy()->hasHeightForWidth() ); + $ltc->setSizePolicy( $sizePolicy4 ); + $ltc->setMinimumSize( Qt::Size(0, 29) ); $ltc->setChecked( 1 ); - $gridLayout_8->addWidget( $ltc, 7, 4, 1, 1 ); + $gridLayout_1->addWidget( $ltc, 5, 2, 1, 1 ); + + $scrollArea->setWidget( $scrollAreaWidgetContents_2 ); + + $horizontalLayout_3->addWidget( $scrollArea ); - $gridLayout_2->addWidget( $groupBox, 2, 0, 1, 1 ); + $verticalLayout_2->addLayout( $horizontalLayout_3 ); + + my $gridLayout_6 = Qt::GridLayout( ); + $self->{gridLayout_6} = $gridLayout_6; + $gridLayout_6->setSpacing( 5 ); + $gridLayout_6->setObjectName( "gridLayout_6" ); + $gridLayout_6->setSizeConstraint( Qt::Layout::SetDefaultConstraint() ); + my $fitAsyTypeLabel = Qt::Label( $layoutWidget ); + $self->{fitAsyTypeLabel} = $fitAsyTypeLabel; + $fitAsyTypeLabel->setObjectName( "fitAsyTypeLabel" ); + $sizePolicy7->setHeightForWidth( $fitAsyTypeLabel->sizePolicy()->hasHeightForWidth() ); + $fitAsyTypeLabel->setSizePolicy( $sizePolicy7 ); + $fitAsyTypeLabel->setWordWrap( 0 ); + + $gridLayout_6->addWidget( $fitAsyTypeLabel, 0, 0, 1, 1 ); + + my $fitAsyType = Qt::ComboBox( $layoutWidget ); + $self->{fitAsyType} = $fitAsyType; + $fitAsyType->setObjectName( "fitAsyType" ); + $sizePolicy7->setHeightForWidth( $fitAsyType->sizePolicy()->hasHeightForWidth() ); + $fitAsyType->setSizePolicy( $sizePolicy7 ); + $fitAsyType->setMinimumSize( Qt::Size(0, 29) ); + $fitAsyType->setMaximumSize( Qt::Size(16777215, 29) ); + + $gridLayout_6->addWidget( $fitAsyType, 0, 1, 1, 1 ); + + my $histsLRBFLabel = Qt::Label( $layoutWidget ); + $self->{histsLRBFLabel} = $histsLRBFLabel; + $histsLRBFLabel->setObjectName( "histsLRBFLabel" ); + $sizePolicy7->setHeightForWidth( $histsLRBFLabel->sizePolicy()->hasHeightForWidth() ); + $histsLRBFLabel->setSizePolicy( $sizePolicy7 ); + $histsLRBFLabel->setWordWrap( 0 ); + + $gridLayout_6->addWidget( $histsLRBFLabel, 0, 2, 1, 1 ); + + my $histsLRBF = Qt::LineEdit( $layoutWidget ); + $self->{histsLRBF} = $histsLRBF; + $histsLRBF->setObjectName( "histsLRBF" ); + $sizePolicy7->setHeightForWidth( $histsLRBF->sizePolicy()->hasHeightForWidth() ); + $histsLRBF->setSizePolicy( $sizePolicy7 ); + $histsLRBF->setMinimumSize( Qt::Size(0, 29) ); + $histsLRBF->setMaximumSize( Qt::Size(16777215, 29) ); + + $gridLayout_6->addWidget( $histsLRBF, 0, 3, 1, 1 ); + + my $spacer4 = Qt::SpacerItem( 81, 21, Qt::SizePolicy::Expanding(), Qt::SizePolicy::Minimum() ); + + $gridLayout_6->addItem( $spacer4, 0, 4, 1, 1 ); - $gridLayout_1->addLayout( $gridLayout_2, 0, 0, 1, 1 ); + $verticalLayout_2->addLayout( $gridLayout_6 ); $musrfit_tabs->addTab( $runsPage, Qt::Application::translate( 'MuSRFit4', "RUNS", undef, Qt::Application::UnicodeUTF8() ) ); my $fittingPage = Qt::Widget( ); @@ -1709,12 +1566,12 @@ sub setupUi { $fitGrid->setObjectName( "fitGrid" ); my $fitLayout = Qt::GridLayout( ); $self->{fitLayout} = $fitLayout; - $fitLayout->setSpacing( 6 ); + $fitLayout->setSpacing( 5 ); $fitLayout->setObjectName( "fitLayout" ); my $errorCalc = Qt::ComboBox( $fittingPage ); $self->{errorCalc} = $errorCalc; $errorCalc->setObjectName( "errorCalc" ); - $errorCalc->setMinimumSize( Qt::Size(0, 25) ); + $errorCalc->setMinimumSize( Qt::Size(0, 29) ); $errorCalc->setMaximumSize( Qt::Size(150, 16777215) ); $fitLayout->addWidget( $errorCalc, 1, 1, 1, 1 ); @@ -1722,7 +1579,7 @@ sub setupUi { my $minimization = Qt::ComboBox( $fittingPage ); $self->{minimization} = $minimization; $minimization->setObjectName( "minimization" ); - $minimization->setMinimumSize( Qt::Size(0, 25) ); + $minimization->setMinimumSize( Qt::Size(0, 29) ); $minimization->setMaximumSize( Qt::Size(150, 16777215) ); $fitLayout->addWidget( $minimization, 0, 1, 1, 1 ); @@ -1767,8 +1624,8 @@ sub setupUi { my $buttonGroupSharing = Qt::GroupBox( $sharingPage ); $self->{buttonGroupSharing} = $buttonGroupSharing; $buttonGroupSharing->setObjectName( "buttonGroupSharing" ); - $sizePolicy6->setHeightForWidth( $buttonGroupSharing->sizePolicy()->hasHeightForWidth() ); - $buttonGroupSharing->setSizePolicy( $sizePolicy6 ); + $sizePolicy1->setHeightForWidth( $buttonGroupSharing->sizePolicy()->hasHeightForWidth() ); + $buttonGroupSharing->setSizePolicy( $sizePolicy1 ); $buttonGroupSharing->setAlignment( Qt::AlignLeading() ); $buttonGroupSharing->setCheckable( 1 ); $buttonGroupSharing->setChecked( 0 ); @@ -1785,12 +1642,12 @@ sub setupUi { $self->{sharingComp1} = $sharingComp1; $sharingComp1->setObjectName( "sharingComp1" ); $sharingComp1->setEnabled( 0 ); - my $sizePolicy7 = Qt::SizePolicy( Qt::SizePolicy::Expanding(), Qt::SizePolicy::MinimumExpanding() ); - $self->{$sizePolicy7} = $sizePolicy7; - $sizePolicy7->setHorizontalStretch( 0 ); - $sizePolicy7->setVerticalStretch( 0 ); - $sizePolicy7->setHeightForWidth( $sharingComp1->sizePolicy()->hasHeightForWidth() ); - $sharingComp1->setSizePolicy( $sizePolicy7 ); + my $sizePolicy9 = Qt::SizePolicy( Qt::SizePolicy::Expanding(), Qt::SizePolicy::MinimumExpanding() ); + $self->{$sizePolicy9} = $sizePolicy9; + $sizePolicy9->setHorizontalStretch( 0 ); + $sizePolicy9->setVerticalStretch( 0 ); + $sizePolicy9->setHeightForWidth( $sharingComp1->sizePolicy()->hasHeightForWidth() ); + $sharingComp1->setSizePolicy( $sizePolicy9 ); $sharingComp1->setAlignment( Qt::AlignLeading() ); my $layout14 = Qt::Widget( $sharingComp1 ); $self->{layout14} = $layout14; @@ -1874,179 +1731,6 @@ sub setupUi { $horizontalLayout->addWidget( $sharingComp1 ); - my $sharingComp2 = Qt::GroupBox( $buttonGroupSharing ); - $self->{sharingComp2} = $sharingComp2; - $sharingComp2->setObjectName( "sharingComp2" ); - $sharingComp2->setEnabled( 0 ); - $sizePolicy7->setHeightForWidth( $sharingComp2->sizePolicy()->hasHeightForWidth() ); - $sharingComp2->setSizePolicy( $sizePolicy7 ); - my $comp2ShLabel = Qt::Label( $sharingComp2 ); - $self->{comp2ShLabel} = $comp2ShLabel; - $comp2ShLabel->setObjectName( "comp2ShLabel" ); - $comp2ShLabel->setGeometry( Qt::Rect(2, 30, 141, 20) ); - $comp2ShLabel->setWordWrap( 0 ); - my $layout13 = Qt::Widget( $sharingComp2 ); - $self->{layout13} = $layout13; - $layout13->setObjectName( "layout13" ); - $layout13->setGeometry( Qt::Rect(40, 60, 81, 266) ); - my $_1 = Qt::VBoxLayout( $layout13 ); - $self->{_1} = $_1; - $_1->setSpacing( 0 ); - $_1->setMargin( 0 ); - $_1->setObjectName( "_1" ); - $_1->setContentsMargins(0, 0, 0, 0 ); - my $shParam_2_1 = Qt::CheckBox( $layout13 ); - $self->{shParam_2_1} = $shParam_2_1; - $shParam_2_1->setObjectName( "shParam_2_1" ); - - $_1->addWidget( $shParam_2_1 ); - - my $shParam_2_2 = Qt::CheckBox( $layout13 ); - $self->{shParam_2_2} = $shParam_2_2; - $shParam_2_2->setObjectName( "shParam_2_2" ); - - $_1->addWidget( $shParam_2_2 ); - - my $shParam_2_3 = Qt::CheckBox( $layout13 ); - $self->{shParam_2_3} = $shParam_2_3; - $shParam_2_3->setObjectName( "shParam_2_3" ); - - $_1->addWidget( $shParam_2_3 ); - - my $shParam_2_4 = Qt::CheckBox( $layout13 ); - $self->{shParam_2_4} = $shParam_2_4; - $shParam_2_4->setObjectName( "shParam_2_4" ); - - $_1->addWidget( $shParam_2_4 ); - - my $shParam_2_5 = Qt::CheckBox( $layout13 ); - $self->{shParam_2_5} = $shParam_2_5; - $shParam_2_5->setObjectName( "shParam_2_5" ); - - $_1->addWidget( $shParam_2_5 ); - - my $shParam_2_6 = Qt::CheckBox( $layout13 ); - $self->{shParam_2_6} = $shParam_2_6; - $shParam_2_6->setObjectName( "shParam_2_6" ); - $shParam_2_6->setEnabled( 0 ); - $shParam_2_6->setTristate( 0 ); - - $_1->addWidget( $shParam_2_6 ); - - my $shParam_2_7 = Qt::CheckBox( $layout13 ); - $self->{shParam_2_7} = $shParam_2_7; - $shParam_2_7->setObjectName( "shParam_2_7" ); - $shParam_2_7->setEnabled( 0 ); - $shParam_2_7->setTristate( 0 ); - - $_1->addWidget( $shParam_2_7 ); - - my $shParam_2_8 = Qt::CheckBox( $layout13 ); - $self->{shParam_2_8} = $shParam_2_8; - $shParam_2_8->setObjectName( "shParam_2_8" ); - $shParam_2_8->setEnabled( 0 ); - $shParam_2_8->setTristate( 0 ); - - $_1->addWidget( $shParam_2_8 ); - - my $shParam_2_9 = Qt::CheckBox( $layout13 ); - $self->{shParam_2_9} = $shParam_2_9; - $shParam_2_9->setObjectName( "shParam_2_9" ); - $shParam_2_9->setEnabled( 0 ); - $shParam_2_9->setTristate( 0 ); - - $_1->addWidget( $shParam_2_9 ); - - - $horizontalLayout->addWidget( $sharingComp2 ); - - my $sharingComp3 = Qt::GroupBox( $buttonGroupSharing ); - $self->{sharingComp3} = $sharingComp3; - $sharingComp3->setObjectName( "sharingComp3" ); - $sharingComp3->setEnabled( 0 ); - $sizePolicy7->setHeightForWidth( $sharingComp3->sizePolicy()->hasHeightForWidth() ); - $sharingComp3->setSizePolicy( $sizePolicy7 ); - $sharingComp3->setAlignment( Qt::AlignJustify()|Qt::AlignVCenter() ); - my $comp3ShLabel = Qt::Label( $sharingComp3 ); - $self->{comp3ShLabel} = $comp3ShLabel; - $comp3ShLabel->setObjectName( "comp3ShLabel" ); - $comp3ShLabel->setGeometry( Qt::Rect(2, 30, 141, 20) ); - $comp3ShLabel->setWordWrap( 0 ); - my $layout15 = Qt::Widget( $sharingComp3 ); - $self->{layout15} = $layout15; - $layout15->setObjectName( "layout15" ); - $layout15->setGeometry( Qt::Rect(41, 58, 81, 266) ); - my $_3 = Qt::VBoxLayout( $layout15 ); - $self->{_3} = $_3; - $_3->setSpacing( 6 ); - $_3->setMargin( 11 ); - $_3->setObjectName( "_3" ); - $_3->setContentsMargins(0, 0, 0, 0 ); - my $shParam_3_1 = Qt::CheckBox( $layout15 ); - $self->{shParam_3_1} = $shParam_3_1; - $shParam_3_1->setObjectName( "shParam_3_1" ); - - $_3->addWidget( $shParam_3_1 ); - - my $shParam_3_2 = Qt::CheckBox( $layout15 ); - $self->{shParam_3_2} = $shParam_3_2; - $shParam_3_2->setObjectName( "shParam_3_2" ); - - $_3->addWidget( $shParam_3_2 ); - - my $shParam_3_3 = Qt::CheckBox( $layout15 ); - $self->{shParam_3_3} = $shParam_3_3; - $shParam_3_3->setObjectName( "shParam_3_3" ); - - $_3->addWidget( $shParam_3_3 ); - - my $shParam_3_4 = Qt::CheckBox( $layout15 ); - $self->{shParam_3_4} = $shParam_3_4; - $shParam_3_4->setObjectName( "shParam_3_4" ); - - $_3->addWidget( $shParam_3_4 ); - - my $shParam_3_5 = Qt::CheckBox( $layout15 ); - $self->{shParam_3_5} = $shParam_3_5; - $shParam_3_5->setObjectName( "shParam_3_5" ); - - $_3->addWidget( $shParam_3_5 ); - - my $shParam_3_6 = Qt::CheckBox( $layout15 ); - $self->{shParam_3_6} = $shParam_3_6; - $shParam_3_6->setObjectName( "shParam_3_6" ); - $shParam_3_6->setEnabled( 0 ); - $shParam_3_6->setTristate( 0 ); - - $_3->addWidget( $shParam_3_6 ); - - my $shParam_3_7 = Qt::CheckBox( $layout15 ); - $self->{shParam_3_7} = $shParam_3_7; - $shParam_3_7->setObjectName( "shParam_3_7" ); - $shParam_3_7->setEnabled( 0 ); - $shParam_3_7->setTristate( 0 ); - - $_3->addWidget( $shParam_3_7 ); - - my $shParam_3_8 = Qt::CheckBox( $layout15 ); - $self->{shParam_3_8} = $shParam_3_8; - $shParam_3_8->setObjectName( "shParam_3_8" ); - $shParam_3_8->setEnabled( 0 ); - $shParam_3_8->setTristate( 0 ); - - $_3->addWidget( $shParam_3_8 ); - - my $shParam_3_9 = Qt::CheckBox( $layout15 ); - $self->{shParam_3_9} = $shParam_3_9; - $shParam_3_9->setObjectName( "shParam_3_9" ); - $shParam_3_9->setEnabled( 0 ); - $shParam_3_9->setTristate( 0 ); - - $_3->addWidget( $shParam_3_9 ); - - - $horizontalLayout->addWidget( $sharingComp3 ); - $gridLayout_7->addLayout( $horizontalLayout, 0, 0, 1, 1 ); @@ -2087,8 +1771,8 @@ sub setupUi { my $groupTitle = Qt::GroupBox( $msrPage ); $self->{groupTitle} = $groupTitle; $groupTitle->setObjectName( "groupTitle" ); - $sizePolicy1->setHeightForWidth( $groupTitle->sizePolicy()->hasHeightForWidth() ); - $groupTitle->setSizePolicy( $sizePolicy1 ); + $sizePolicy4->setHeightForWidth( $groupTitle->sizePolicy()->hasHeightForWidth() ); + $groupTitle->setSizePolicy( $sizePolicy4 ); my $gridLayout5 = Qt::GridLayout( $groupTitle ); $self->{gridLayout5} = $gridLayout5; $gridLayout5->setSpacing( 6 ); @@ -2096,7 +1780,7 @@ sub setupUi { $gridLayout5->setObjectName( "gridLayout5" ); my $vboxLayout1 = Qt::VBoxLayout( ); $self->{vboxLayout1} = $vboxLayout1; - $vboxLayout1->setSpacing( 6 ); + $vboxLayout1->setSpacing( 5 ); $vboxLayout1->setObjectName( "vboxLayout1" ); my $titleLabel = Qt::Label( $groupTitle ); $self->{titleLabel} = $titleLabel; @@ -2110,12 +1794,12 @@ sub setupUi { my $title = Qt::LineEdit( $groupTitle ); $self->{title} = $title; $title->setObjectName( "title" ); - my $sizePolicy8 = Qt::SizePolicy( Qt::SizePolicy::Expanding(), Qt::SizePolicy::Fixed() ); - $self->{$sizePolicy8} = $sizePolicy8; - $sizePolicy8->setHorizontalStretch( 1 ); - $sizePolicy8->setVerticalStretch( 1 ); - $sizePolicy8->setHeightForWidth( $title->sizePolicy()->hasHeightForWidth() ); - $title->setSizePolicy( $sizePolicy8 ); + my $sizePolicy10 = Qt::SizePolicy( Qt::SizePolicy::Expanding(), Qt::SizePolicy::Fixed() ); + $self->{$sizePolicy10} = $sizePolicy10; + $sizePolicy10->setHorizontalStretch( 1 ); + $sizePolicy10->setVerticalStretch( 1 ); + $sizePolicy10->setHeightForWidth( $title->sizePolicy()->hasHeightForWidth() ); + $title->setSizePolicy( $sizePolicy10 ); $vboxLayout1->addWidget( $title ); @@ -2133,8 +1817,8 @@ sub setupUi { my $fileName = Qt::LineEdit( $groupTitle ); $self->{fileName} = $fileName; $fileName->setObjectName( "fileName" ); - $sizePolicy1->setHeightForWidth( $fileName->sizePolicy()->hasHeightForWidth() ); - $fileName->setSizePolicy( $sizePolicy1 ); + $sizePolicy4->setHeightForWidth( $fileName->sizePolicy()->hasHeightForWidth() ); + $fileName->setSizePolicy( $sizePolicy4 ); $hboxLayout->addWidget( $fileName ); @@ -2169,8 +1853,8 @@ sub setupUi { my $fourierBox = Qt::GroupBox( $fourierPage ); $self->{fourierBox} = $fourierBox; $fourierBox->setObjectName( "fourierBox" ); - $sizePolicy6->setHeightForWidth( $fourierBox->sizePolicy()->hasHeightForWidth() ); - $fourierBox->setSizePolicy( $sizePolicy6 ); + $sizePolicy1->setHeightForWidth( $fourierBox->sizePolicy()->hasHeightForWidth() ); + $fourierBox->setSizePolicy( $sizePolicy1 ); my $layout34 = Qt::Widget( $fourierBox ); $self->{layout34} = $layout34; $layout34->setObjectName( "layout34" ); @@ -2192,12 +1876,12 @@ sub setupUi { my $funits = Qt::ComboBox( $layout34 ); $self->{funits} = $funits; $funits->setObjectName( "funits" ); - my $sizePolicy9 = Qt::SizePolicy( Qt::SizePolicy::Ignored(), Qt::SizePolicy::Preferred() ); - $self->{$sizePolicy9} = $sizePolicy9; - $sizePolicy9->setHorizontalStretch( 0 ); - $sizePolicy9->setVerticalStretch( 0 ); - $sizePolicy9->setHeightForWidth( $funits->sizePolicy()->hasHeightForWidth() ); - $funits->setSizePolicy( $sizePolicy9 ); + my $sizePolicy11 = Qt::SizePolicy( Qt::SizePolicy::Ignored(), Qt::SizePolicy::Preferred() ); + $self->{$sizePolicy11} = $sizePolicy11; + $sizePolicy11->setHorizontalStretch( 0 ); + $sizePolicy11->setVerticalStretch( 0 ); + $sizePolicy11->setHeightForWidth( $funits->sizePolicy()->hasHeightForWidth() ); + $funits->setSizePolicy( $sizePolicy11 ); $gridLayout7->addWidget( $funits, 0, 2, 1, 1 ); @@ -2322,8 +2006,8 @@ sub setupUi { my $rrfBox = Qt::GroupBox( $fourierPage ); $self->{rrfBox} = $rrfBox; $rrfBox->setObjectName( "rrfBox" ); - $sizePolicy6->setHeightForWidth( $rrfBox->sizePolicy()->hasHeightForWidth() ); - $rrfBox->setSizePolicy( $sizePolicy6 ); + $sizePolicy1->setHeightForWidth( $rrfBox->sizePolicy()->hasHeightForWidth() ); + $rrfBox->setSizePolicy( $sizePolicy1 ); my $layout35 = Qt::Widget( $rrfBox ); $self->{layout35} = $layout35; $layout35->setObjectName( "layout35" ); @@ -2418,16 +2102,19 @@ sub setupUi { my $layout16_2 = Qt::Widget( $groupHist0 ); $self->{layout16_2} = $layout16_2; $layout16_2->setObjectName( "layout16_2" ); - $layout16_2->setGeometry( Qt::Rect(5, 18, 100, 150) ); + $layout16_2->setGeometry( Qt::Rect(5, 18, 100, 171) ); my $vboxLayout2 = Qt::VBoxLayout( $layout16_2 ); $self->{vboxLayout2} = $vboxLayout2; - $vboxLayout2->setSpacing( 6 ); + $vboxLayout2->setSpacing( 5 ); $vboxLayout2->setMargin( 11 ); $vboxLayout2->setObjectName( "vboxLayout2" ); $vboxLayout2->setContentsMargins(0, 0, 0, 0 ); my $textLabel2 = Qt::Label( $layout16_2 ); $self->{textLabel2} = $textLabel2; $textLabel2->setObjectName( "textLabel2" ); + $sizePolicy7->setHeightForWidth( $textLabel2->sizePolicy()->hasHeightForWidth() ); + $textLabel2->setSizePolicy( $sizePolicy7 ); + $textLabel2->setMinimumSize( Qt::Size(0, 29) ); $textLabel2->setWordWrap( 0 ); $vboxLayout2->addWidget( $textLabel2 ); @@ -2435,6 +2122,9 @@ sub setupUi { my $textLabel2_2_2_3 = Qt::Label( $layout16_2 ); $self->{textLabel2_2_2_3} = $textLabel2_2_2_3; $textLabel2_2_2_3->setObjectName( "textLabel2_2_2_3" ); + $sizePolicy7->setHeightForWidth( $textLabel2_2_2_3->sizePolicy()->hasHeightForWidth() ); + $textLabel2_2_2_3->setSizePolicy( $sizePolicy7 ); + $textLabel2_2_2_3->setMinimumSize( Qt::Size(0, 29) ); $textLabel2_2_2_3->setWordWrap( 0 ); $vboxLayout2->addWidget( $textLabel2_2_2_3 ); @@ -2442,6 +2132,9 @@ sub setupUi { my $textLabel2_2_2 = Qt::Label( $layout16_2 ); $self->{textLabel2_2_2} = $textLabel2_2_2; $textLabel2_2_2->setObjectName( "textLabel2_2_2" ); + $sizePolicy7->setHeightForWidth( $textLabel2_2_2->sizePolicy()->hasHeightForWidth() ); + $textLabel2_2_2->setSizePolicy( $sizePolicy7 ); + $textLabel2_2_2->setMinimumSize( Qt::Size(0, 29) ); $textLabel2_2_2->setWordWrap( 0 ); $vboxLayout2->addWidget( $textLabel2_2_2 ); @@ -2449,6 +2142,9 @@ sub setupUi { my $textLabel2_2_2_2 = Qt::Label( $layout16_2 ); $self->{textLabel2_2_2_2} = $textLabel2_2_2_2; $textLabel2_2_2_2->setObjectName( "textLabel2_2_2_2" ); + $sizePolicy7->setHeightForWidth( $textLabel2_2_2_2->sizePolicy()->hasHeightForWidth() ); + $textLabel2_2_2_2->setSizePolicy( $sizePolicy7 ); + $textLabel2_2_2_2->setMinimumSize( Qt::Size(0, 29) ); $textLabel2_2_2_2->setWordWrap( 0 ); $vboxLayout2->addWidget( $textLabel2_2_2_2 ); @@ -2456,6 +2152,9 @@ sub setupUi { my $textLabel2_2_2_2_2 = Qt::Label( $layout16_2 ); $self->{textLabel2_2_2_2_2} = $textLabel2_2_2_2_2; $textLabel2_2_2_2_2->setObjectName( "textLabel2_2_2_2_2" ); + $sizePolicy7->setHeightForWidth( $textLabel2_2_2_2_2->sizePolicy()->hasHeightForWidth() ); + $textLabel2_2_2_2_2->setSizePolicy( $sizePolicy7 ); + $textLabel2_2_2_2_2->setMinimumSize( Qt::Size(0, 29) ); $textLabel2_2_2_2_2->setWordWrap( 0 ); $vboxLayout2->addWidget( $textLabel2_2_2_2_2 ); @@ -2472,10 +2171,10 @@ sub setupUi { my $layout18 = Qt::Widget( $groupHist1 ); $self->{layout18} = $layout18; $layout18->setObjectName( "layout18" ); - $layout18->setGeometry( Qt::Rect(8, 17, 75, 150) ); + $layout18->setGeometry( Qt::Rect(8, 17, 75, 167) ); my $vboxLayout3 = Qt::VBoxLayout( $layout18 ); $self->{vboxLayout3} = $vboxLayout3; - $vboxLayout3->setSpacing( 0 ); + $vboxLayout3->setSpacing( 5 ); $vboxLayout3->setMargin( 0 ); $vboxLayout3->setObjectName( "vboxLayout3" ); $vboxLayout3->setContentsMargins(0, 0, 0, 0 ); @@ -2521,10 +2220,10 @@ sub setupUi { my $layout18_2 = Qt::Widget( $groupHist2 ); $self->{layout18_2} = $layout18_2; $layout18_2->setObjectName( "layout18_2" ); - $layout18_2->setGeometry( Qt::Rect(8, 17, 75, 150) ); + $layout18_2->setGeometry( Qt::Rect(8, 17, 75, 167) ); my $vboxLayout4 = Qt::VBoxLayout( $layout18_2 ); $self->{vboxLayout4} = $vboxLayout4; - $vboxLayout4->setSpacing( 0 ); + $vboxLayout4->setSpacing( 5 ); $vboxLayout4->setMargin( 0 ); $vboxLayout4->setObjectName( "vboxLayout4" ); $vboxLayout4->setContentsMargins(0, 0, 0, 0 ); @@ -2570,10 +2269,10 @@ sub setupUi { my $layout18_3 = Qt::Widget( $groupHist3 ); $self->{layout18_3} = $layout18_3; $layout18_3->setObjectName( "layout18_3" ); - $layout18_3->setGeometry( Qt::Rect(8, 17, 75, 150) ); + $layout18_3->setGeometry( Qt::Rect(8, 17, 75, 167) ); my $vboxLayout5 = Qt::VBoxLayout( $layout18_3 ); $self->{vboxLayout5} = $vboxLayout5; - $vboxLayout5->setSpacing( 0 ); + $vboxLayout5->setSpacing( 5 ); $vboxLayout5->setMargin( 0 ); $vboxLayout5->setObjectName( "vboxLayout5" ); $vboxLayout5->setContentsMargins(0, 0, 0, 0 ); @@ -2619,10 +2318,10 @@ sub setupUi { my $layout18_4 = Qt::Widget( $groupHist4 ); $self->{layout18_4} = $layout18_4; $layout18_4->setObjectName( "layout18_4" ); - $layout18_4->setGeometry( Qt::Rect(8, 17, 75, 150) ); + $layout18_4->setGeometry( Qt::Rect(8, 17, 75, 167) ); my $vboxLayout6 = Qt::VBoxLayout( $layout18_4 ); $self->{vboxLayout6} = $vboxLayout6; - $vboxLayout6->setSpacing( 0 ); + $vboxLayout6->setSpacing( 5 ); $vboxLayout6->setMargin( 0 ); $vboxLayout6->setObjectName( "vboxLayout6" ); $vboxLayout6->setContentsMargins(0, 0, 0, 0 ); @@ -2674,12 +2373,12 @@ sub setupUi { $self->{t0Update} = $t0Update; $t0Update->setObjectName( "t0Update" ); $t0Update->setEnabled( 0 ); - my $sizePolicy10 = Qt::SizePolicy( Qt::SizePolicy::Fixed(), Qt::SizePolicy::Fixed() ); - $self->{$sizePolicy10} = $sizePolicy10; - $sizePolicy10->setHorizontalStretch( 0 ); - $sizePolicy10->setVerticalStretch( 0 ); - $sizePolicy10->setHeightForWidth( $t0Update->sizePolicy()->hasHeightForWidth() ); - $t0Update->setSizePolicy( $sizePolicy10 ); + my $sizePolicy12 = Qt::SizePolicy( Qt::SizePolicy::Fixed(), Qt::SizePolicy::Fixed() ); + $self->{$sizePolicy12} = $sizePolicy12; + $sizePolicy12->setHorizontalStretch( 0 ); + $sizePolicy12->setVerticalStretch( 0 ); + $sizePolicy12->setHeightForWidth( $t0Update->sizePolicy()->hasHeightForWidth() ); + $t0Update->setSizePolicy( $sizePolicy12 ); $hboxLayout2->addWidget( $t0Update ); @@ -2706,6 +2405,178 @@ sub setupUi { my $theoryBlock_Label = Qt::Label( $tabPage ); $self->{theoryBlock_Label} = $theoryBlock_Label; $theoryBlock_Label->setObjectName( "theoryBlock_Label" ); + my $palette1 = Qt::Palette(); + $palette1->setBrush(Qt::Palette::Active(), Qt::Palette::WindowText(), $brush); + $palette1->setBrush(Qt::Palette::Active(), Qt::Palette::Button(), $brush1); + $palette1->setBrush(Qt::Palette::Active(), Qt::Palette::Light(), $brush2); + $palette1->setBrush(Qt::Palette::Active(), Qt::Palette::Midlight(), $brush3); + $palette1->setBrush(Qt::Palette::Active(), Qt::Palette::Dark(), $brush4); + $palette1->setBrush(Qt::Palette::Active(), Qt::Palette::Mid(), $brush5); + $palette1->setBrush(Qt::Palette::Active(), Qt::Palette::Text(), $brush); + $palette1->setBrush(Qt::Palette::Active(), Qt::Palette::BrightText(), $brush2); + $palette1->setBrush(Qt::Palette::Active(), Qt::Palette::ButtonText(), $brush); + $palette1->setBrush(Qt::Palette::Active(), Qt::Palette::Base(), $brush2); + $palette1->setBrush(Qt::Palette::Active(), Qt::Palette::Window(), $brush6); + $palette1->setBrush(Qt::Palette::Active(), Qt::Palette::Shadow(), $brush); + $palette1->setBrush(Qt::Palette::Active(), Qt::Palette::Highlight(), $brush7); + $palette1->setBrush(Qt::Palette::Active(), Qt::Palette::HighlightedText(), $brush2); + $palette1->setBrush(Qt::Palette::Active(), Qt::Palette::Link(), $brush); + $palette1->setBrush(Qt::Palette::Active(), Qt::Palette::LinkVisited(), $brush); + $palette1->setBrush(Qt::Palette::Inactive(), Qt::Palette::WindowText(), $brush); + $palette1->setBrush(Qt::Palette::Inactive(), Qt::Palette::Button(), $brush1); + $palette1->setBrush(Qt::Palette::Inactive(), Qt::Palette::Light(), $brush2); + $palette1->setBrush(Qt::Palette::Inactive(), Qt::Palette::Midlight(), $brush2); + $palette1->setBrush(Qt::Palette::Inactive(), Qt::Palette::Dark(), $brush4); + $palette1->setBrush(Qt::Palette::Inactive(), Qt::Palette::Mid(), $brush5); + $palette1->setBrush(Qt::Palette::Inactive(), Qt::Palette::Text(), $brush); + $palette1->setBrush(Qt::Palette::Inactive(), Qt::Palette::BrightText(), $brush2); + $palette1->setBrush(Qt::Palette::Inactive(), Qt::Palette::ButtonText(), $brush); + $palette1->setBrush(Qt::Palette::Inactive(), Qt::Palette::Base(), $brush2); + $palette1->setBrush(Qt::Palette::Inactive(), Qt::Palette::Window(), $brush6); + $palette1->setBrush(Qt::Palette::Inactive(), Qt::Palette::Shadow(), $brush); + $palette1->setBrush(Qt::Palette::Inactive(), Qt::Palette::Highlight(), $brush7); + $palette1->setBrush(Qt::Palette::Inactive(), Qt::Palette::HighlightedText(), $brush2); + $palette1->setBrush(Qt::Palette::Inactive(), Qt::Palette::Link(), $brush8); + $palette1->setBrush(Qt::Palette::Inactive(), Qt::Palette::LinkVisited(), $brush9); + $palette1->setBrush(Qt::Palette::Disabled(), Qt::Palette::WindowText(), $brush10); + $palette1->setBrush(Qt::Palette::Disabled(), Qt::Palette::Button(), $brush1); + $palette1->setBrush(Qt::Palette::Disabled(), Qt::Palette::Light(), $brush2); + $palette1->setBrush(Qt::Palette::Disabled(), Qt::Palette::Midlight(), $brush2); + $palette1->setBrush(Qt::Palette::Disabled(), Qt::Palette::Dark(), $brush4); + $palette1->setBrush(Qt::Palette::Disabled(), Qt::Palette::Mid(), $brush5); + $palette1->setBrush(Qt::Palette::Disabled(), Qt::Palette::Text(), $brush10); + $palette1->setBrush(Qt::Palette::Disabled(), Qt::Palette::BrightText(), $brush2); + $palette1->setBrush(Qt::Palette::Disabled(), Qt::Palette::ButtonText(), $brush10); + $palette1->setBrush(Qt::Palette::Disabled(), Qt::Palette::Base(), $brush2); + $palette1->setBrush(Qt::Palette::Disabled(), Qt::Palette::Window(), $brush6); + $palette1->setBrush(Qt::Palette::Disabled(), Qt::Palette::Shadow(), $brush); + $palette1->setBrush(Qt::Palette::Disabled(), Qt::Palette::Highlight(), $brush7); + $palette1->setBrush(Qt::Palette::Disabled(), Qt::Palette::HighlightedText(), $brush2); + $palette1->setBrush(Qt::Palette::Disabled(), Qt::Palette::Link(), $brush8); + $palette1->setBrush(Qt::Palette::Disabled(), Qt::Palette::LinkVisited(), $brush9); + $theoryBlock_Label->setPalette( $palette1 ); + $theoryBlock_Label->setWordWrap( 0 ); + + $gridLayout11->addWidget( $theoryBlock_Label, 0, 0, 1, 1 ); + + my $theoryBlock = Qt::TextEdit( $tabPage ); + $self->{theoryBlock} = $theoryBlock; + $theoryBlock->setObjectName( "theoryBlock" ); + $theoryBlock->setEnabled( 1 ); + + $gridLayout11->addWidget( $theoryBlock, 1, 0, 1, 1 ); + + my $parametersList_Label = Qt::Label( $tabPage ); + $self->{parametersList_Label} = $parametersList_Label; + $parametersList_Label->setObjectName( "parametersList_Label" ); + my $palette2 = Qt::Palette(); + $palette2->setBrush(Qt::Palette::Active(), Qt::Palette::WindowText(), $brush); + $palette2->setBrush(Qt::Palette::Active(), Qt::Palette::Button(), $brush1); + $palette2->setBrush(Qt::Palette::Active(), Qt::Palette::Light(), $brush2); + $palette2->setBrush(Qt::Palette::Active(), Qt::Palette::Midlight(), $brush3); + $palette2->setBrush(Qt::Palette::Active(), Qt::Palette::Dark(), $brush4); + $palette2->setBrush(Qt::Palette::Active(), Qt::Palette::Mid(), $brush5); + $palette2->setBrush(Qt::Palette::Active(), Qt::Palette::Text(), $brush); + $palette2->setBrush(Qt::Palette::Active(), Qt::Palette::BrightText(), $brush2); + $palette2->setBrush(Qt::Palette::Active(), Qt::Palette::ButtonText(), $brush); + $palette2->setBrush(Qt::Palette::Active(), Qt::Palette::Base(), $brush2); + $palette2->setBrush(Qt::Palette::Active(), Qt::Palette::Window(), $brush6); + $palette2->setBrush(Qt::Palette::Active(), Qt::Palette::Shadow(), $brush); + $palette2->setBrush(Qt::Palette::Active(), Qt::Palette::Highlight(), $brush7); + $palette2->setBrush(Qt::Palette::Active(), Qt::Palette::HighlightedText(), $brush2); + $palette2->setBrush(Qt::Palette::Active(), Qt::Palette::Link(), $brush); + $palette2->setBrush(Qt::Palette::Active(), Qt::Palette::LinkVisited(), $brush); + $palette2->setBrush(Qt::Palette::Inactive(), Qt::Palette::WindowText(), $brush); + $palette2->setBrush(Qt::Palette::Inactive(), Qt::Palette::Button(), $brush1); + $palette2->setBrush(Qt::Palette::Inactive(), Qt::Palette::Light(), $brush2); + $palette2->setBrush(Qt::Palette::Inactive(), Qt::Palette::Midlight(), $brush2); + $palette2->setBrush(Qt::Palette::Inactive(), Qt::Palette::Dark(), $brush4); + $palette2->setBrush(Qt::Palette::Inactive(), Qt::Palette::Mid(), $brush5); + $palette2->setBrush(Qt::Palette::Inactive(), Qt::Palette::Text(), $brush); + $palette2->setBrush(Qt::Palette::Inactive(), Qt::Palette::BrightText(), $brush2); + $palette2->setBrush(Qt::Palette::Inactive(), Qt::Palette::ButtonText(), $brush); + $palette2->setBrush(Qt::Palette::Inactive(), Qt::Palette::Base(), $brush2); + $palette2->setBrush(Qt::Palette::Inactive(), Qt::Palette::Window(), $brush6); + $palette2->setBrush(Qt::Palette::Inactive(), Qt::Palette::Shadow(), $brush); + $palette2->setBrush(Qt::Palette::Inactive(), Qt::Palette::Highlight(), $brush7); + $palette2->setBrush(Qt::Palette::Inactive(), Qt::Palette::HighlightedText(), $brush2); + $palette2->setBrush(Qt::Palette::Inactive(), Qt::Palette::Link(), $brush8); + $palette2->setBrush(Qt::Palette::Inactive(), Qt::Palette::LinkVisited(), $brush9); + $palette2->setBrush(Qt::Palette::Disabled(), Qt::Palette::WindowText(), $brush10); + $palette2->setBrush(Qt::Palette::Disabled(), Qt::Palette::Button(), $brush1); + $palette2->setBrush(Qt::Palette::Disabled(), Qt::Palette::Light(), $brush2); + $palette2->setBrush(Qt::Palette::Disabled(), Qt::Palette::Midlight(), $brush2); + $palette2->setBrush(Qt::Palette::Disabled(), Qt::Palette::Dark(), $brush4); + $palette2->setBrush(Qt::Palette::Disabled(), Qt::Palette::Mid(), $brush5); + $palette2->setBrush(Qt::Palette::Disabled(), Qt::Palette::Text(), $brush10); + $palette2->setBrush(Qt::Palette::Disabled(), Qt::Palette::BrightText(), $brush2); + $palette2->setBrush(Qt::Palette::Disabled(), Qt::Palette::ButtonText(), $brush10); + $palette2->setBrush(Qt::Palette::Disabled(), Qt::Palette::Base(), $brush2); + $palette2->setBrush(Qt::Palette::Disabled(), Qt::Palette::Window(), $brush6); + $palette2->setBrush(Qt::Palette::Disabled(), Qt::Palette::Shadow(), $brush); + $palette2->setBrush(Qt::Palette::Disabled(), Qt::Palette::Highlight(), $brush7); + $palette2->setBrush(Qt::Palette::Disabled(), Qt::Palette::HighlightedText(), $brush2); + $palette2->setBrush(Qt::Palette::Disabled(), Qt::Palette::Link(), $brush8); + $palette2->setBrush(Qt::Palette::Disabled(), Qt::Palette::LinkVisited(), $brush9); + $parametersList_Label->setPalette( $palette2 ); + $parametersList_Label->setWordWrap( 0 ); + + $gridLayout11->addWidget( $parametersList_Label, 0, 1, 1, 1 ); + + my $parametersList = Qt::TextEdit( $tabPage ); + $self->{parametersList} = $parametersList; + $parametersList->setObjectName( "parametersList" ); + $parametersList->setEnabled( 1 ); + + $gridLayout11->addWidget( $parametersList, 1, 1, 1, 1 ); + + + $vboxLayout7->addLayout( $gridLayout11 ); + + my $hboxLayout3 = Qt::HBoxLayout( ); + $self->{hboxLayout3} = $hboxLayout3; + $hboxLayout3->setSpacing( 6 ); + $hboxLayout3->setObjectName( "hboxLayout3" ); + my $cParamsCombo = Qt::ComboBox( $tabPage ); + $self->{cParamsCombo} = $cParamsCombo; + $cParamsCombo->setObjectName( "cParamsCombo" ); + $sizePolicy12->setHeightForWidth( $cParamsCombo->sizePolicy()->hasHeightForWidth() ); + $cParamsCombo->setSizePolicy( $sizePolicy12 ); + + $hboxLayout3->addWidget( $cParamsCombo ); + + my $textLabel1_4_6 = Qt::Label( $tabPage ); + $self->{textLabel1_4_6} = $textLabel1_4_6; + $textLabel1_4_6->setObjectName( "textLabel1_4_6" ); + $sizePolicy12->setHeightForWidth( $textLabel1_4_6->sizePolicy()->hasHeightForWidth() ); + $textLabel1_4_6->setSizePolicy( $sizePolicy12 ); + $textLabel1_4_6->setWordWrap( 0 ); + + $hboxLayout3->addWidget( $textLabel1_4_6 ); + + my $constraintLine = Qt::LineEdit( $tabPage ); + $self->{constraintLine} = $constraintLine; + $constraintLine->setObjectName( "constraintLine" ); + $sizePolicy4->setHeightForWidth( $constraintLine->sizePolicy()->hasHeightForWidth() ); + $constraintLine->setSizePolicy( $sizePolicy4 ); + $constraintLine->setMinimumSize( Qt::Size(0, 29) ); + + $hboxLayout3->addWidget( $constraintLine ); + + my $addConstraint = Qt::PushButton( $tabPage ); + $self->{addConstraint} = $addConstraint; + $addConstraint->setObjectName( "addConstraint" ); + $sizePolicy12->setHeightForWidth( $addConstraint->sizePolicy()->hasHeightForWidth() ); + $addConstraint->setSizePolicy( $sizePolicy12 ); + + $hboxLayout3->addWidget( $addConstraint ); + + + $vboxLayout7->addLayout( $hboxLayout3 ); + + my $textLabel2_2_3_4 = Qt::Label( $tabPage ); + $self->{textLabel2_2_3_4} = $textLabel2_2_3_4; + $textLabel2_2_3_4->setObjectName( "textLabel2_2_3_4" ); my $palette3 = Qt::Palette(); $palette3->setBrush(Qt::Palette::Active(), Qt::Palette::WindowText(), $brush); $palette3->setBrush(Qt::Palette::Active(), Qt::Palette::Button(), $brush1); @@ -2755,179 +2626,7 @@ sub setupUi { $palette3->setBrush(Qt::Palette::Disabled(), Qt::Palette::HighlightedText(), $brush2); $palette3->setBrush(Qt::Palette::Disabled(), Qt::Palette::Link(), $brush8); $palette3->setBrush(Qt::Palette::Disabled(), Qt::Palette::LinkVisited(), $brush9); - $theoryBlock_Label->setPalette( $palette3 ); - $theoryBlock_Label->setWordWrap( 0 ); - - $gridLayout11->addWidget( $theoryBlock_Label, 0, 0, 1, 1 ); - - my $theoryBlock = Qt::TextEdit( $tabPage ); - $self->{theoryBlock} = $theoryBlock; - $theoryBlock->setObjectName( "theoryBlock" ); - $theoryBlock->setEnabled( 1 ); - - $gridLayout11->addWidget( $theoryBlock, 1, 0, 1, 1 ); - - my $parametersList_Label = Qt::Label( $tabPage ); - $self->{parametersList_Label} = $parametersList_Label; - $parametersList_Label->setObjectName( "parametersList_Label" ); - my $palette4 = Qt::Palette(); - $palette4->setBrush(Qt::Palette::Active(), Qt::Palette::WindowText(), $brush); - $palette4->setBrush(Qt::Palette::Active(), Qt::Palette::Button(), $brush1); - $palette4->setBrush(Qt::Palette::Active(), Qt::Palette::Light(), $brush2); - $palette4->setBrush(Qt::Palette::Active(), Qt::Palette::Midlight(), $brush3); - $palette4->setBrush(Qt::Palette::Active(), Qt::Palette::Dark(), $brush4); - $palette4->setBrush(Qt::Palette::Active(), Qt::Palette::Mid(), $brush5); - $palette4->setBrush(Qt::Palette::Active(), Qt::Palette::Text(), $brush); - $palette4->setBrush(Qt::Palette::Active(), Qt::Palette::BrightText(), $brush2); - $palette4->setBrush(Qt::Palette::Active(), Qt::Palette::ButtonText(), $brush); - $palette4->setBrush(Qt::Palette::Active(), Qt::Palette::Base(), $brush2); - $palette4->setBrush(Qt::Palette::Active(), Qt::Palette::Window(), $brush6); - $palette4->setBrush(Qt::Palette::Active(), Qt::Palette::Shadow(), $brush); - $palette4->setBrush(Qt::Palette::Active(), Qt::Palette::Highlight(), $brush7); - $palette4->setBrush(Qt::Palette::Active(), Qt::Palette::HighlightedText(), $brush2); - $palette4->setBrush(Qt::Palette::Active(), Qt::Palette::Link(), $brush); - $palette4->setBrush(Qt::Palette::Active(), Qt::Palette::LinkVisited(), $brush); - $palette4->setBrush(Qt::Palette::Inactive(), Qt::Palette::WindowText(), $brush); - $palette4->setBrush(Qt::Palette::Inactive(), Qt::Palette::Button(), $brush1); - $palette4->setBrush(Qt::Palette::Inactive(), Qt::Palette::Light(), $brush2); - $palette4->setBrush(Qt::Palette::Inactive(), Qt::Palette::Midlight(), $brush2); - $palette4->setBrush(Qt::Palette::Inactive(), Qt::Palette::Dark(), $brush4); - $palette4->setBrush(Qt::Palette::Inactive(), Qt::Palette::Mid(), $brush5); - $palette4->setBrush(Qt::Palette::Inactive(), Qt::Palette::Text(), $brush); - $palette4->setBrush(Qt::Palette::Inactive(), Qt::Palette::BrightText(), $brush2); - $palette4->setBrush(Qt::Palette::Inactive(), Qt::Palette::ButtonText(), $brush); - $palette4->setBrush(Qt::Palette::Inactive(), Qt::Palette::Base(), $brush2); - $palette4->setBrush(Qt::Palette::Inactive(), Qt::Palette::Window(), $brush6); - $palette4->setBrush(Qt::Palette::Inactive(), Qt::Palette::Shadow(), $brush); - $palette4->setBrush(Qt::Palette::Inactive(), Qt::Palette::Highlight(), $brush7); - $palette4->setBrush(Qt::Palette::Inactive(), Qt::Palette::HighlightedText(), $brush2); - $palette4->setBrush(Qt::Palette::Inactive(), Qt::Palette::Link(), $brush8); - $palette4->setBrush(Qt::Palette::Inactive(), Qt::Palette::LinkVisited(), $brush9); - $palette4->setBrush(Qt::Palette::Disabled(), Qt::Palette::WindowText(), $brush10); - $palette4->setBrush(Qt::Palette::Disabled(), Qt::Palette::Button(), $brush1); - $palette4->setBrush(Qt::Palette::Disabled(), Qt::Palette::Light(), $brush2); - $palette4->setBrush(Qt::Palette::Disabled(), Qt::Palette::Midlight(), $brush2); - $palette4->setBrush(Qt::Palette::Disabled(), Qt::Palette::Dark(), $brush4); - $palette4->setBrush(Qt::Palette::Disabled(), Qt::Palette::Mid(), $brush5); - $palette4->setBrush(Qt::Palette::Disabled(), Qt::Palette::Text(), $brush10); - $palette4->setBrush(Qt::Palette::Disabled(), Qt::Palette::BrightText(), $brush2); - $palette4->setBrush(Qt::Palette::Disabled(), Qt::Palette::ButtonText(), $brush10); - $palette4->setBrush(Qt::Palette::Disabled(), Qt::Palette::Base(), $brush2); - $palette4->setBrush(Qt::Palette::Disabled(), Qt::Palette::Window(), $brush6); - $palette4->setBrush(Qt::Palette::Disabled(), Qt::Palette::Shadow(), $brush); - $palette4->setBrush(Qt::Palette::Disabled(), Qt::Palette::Highlight(), $brush7); - $palette4->setBrush(Qt::Palette::Disabled(), Qt::Palette::HighlightedText(), $brush2); - $palette4->setBrush(Qt::Palette::Disabled(), Qt::Palette::Link(), $brush8); - $palette4->setBrush(Qt::Palette::Disabled(), Qt::Palette::LinkVisited(), $brush9); - $parametersList_Label->setPalette( $palette4 ); - $parametersList_Label->setWordWrap( 0 ); - - $gridLayout11->addWidget( $parametersList_Label, 0, 1, 1, 1 ); - - my $parametersList = Qt::TextEdit( $tabPage ); - $self->{parametersList} = $parametersList; - $parametersList->setObjectName( "parametersList" ); - $parametersList->setEnabled( 1 ); - - $gridLayout11->addWidget( $parametersList, 1, 1, 1, 1 ); - - - $vboxLayout7->addLayout( $gridLayout11 ); - - my $hboxLayout3 = Qt::HBoxLayout( ); - $self->{hboxLayout3} = $hboxLayout3; - $hboxLayout3->setSpacing( 6 ); - $hboxLayout3->setObjectName( "hboxLayout3" ); - my $cParamsCombo = Qt::ComboBox( $tabPage ); - $self->{cParamsCombo} = $cParamsCombo; - $cParamsCombo->setObjectName( "cParamsCombo" ); - $sizePolicy10->setHeightForWidth( $cParamsCombo->sizePolicy()->hasHeightForWidth() ); - $cParamsCombo->setSizePolicy( $sizePolicy10 ); - - $hboxLayout3->addWidget( $cParamsCombo ); - - my $textLabel1_4_6 = Qt::Label( $tabPage ); - $self->{textLabel1_4_6} = $textLabel1_4_6; - $textLabel1_4_6->setObjectName( "textLabel1_4_6" ); - $sizePolicy10->setHeightForWidth( $textLabel1_4_6->sizePolicy()->hasHeightForWidth() ); - $textLabel1_4_6->setSizePolicy( $sizePolicy10 ); - $textLabel1_4_6->setWordWrap( 0 ); - - $hboxLayout3->addWidget( $textLabel1_4_6 ); - - my $constraintLine = Qt::LineEdit( $tabPage ); - $self->{constraintLine} = $constraintLine; - $constraintLine->setObjectName( "constraintLine" ); - $sizePolicy1->setHeightForWidth( $constraintLine->sizePolicy()->hasHeightForWidth() ); - $constraintLine->setSizePolicy( $sizePolicy1 ); - $constraintLine->setMinimumSize( Qt::Size(0, 25) ); - - $hboxLayout3->addWidget( $constraintLine ); - - my $addConstraint = Qt::PushButton( $tabPage ); - $self->{addConstraint} = $addConstraint; - $addConstraint->setObjectName( "addConstraint" ); - $sizePolicy10->setHeightForWidth( $addConstraint->sizePolicy()->hasHeightForWidth() ); - $addConstraint->setSizePolicy( $sizePolicy10 ); - - $hboxLayout3->addWidget( $addConstraint ); - - - $vboxLayout7->addLayout( $hboxLayout3 ); - - my $textLabel2_2_3_4 = Qt::Label( $tabPage ); - $self->{textLabel2_2_3_4} = $textLabel2_2_3_4; - $textLabel2_2_3_4->setObjectName( "textLabel2_2_3_4" ); - my $palette5 = Qt::Palette(); - $palette5->setBrush(Qt::Palette::Active(), Qt::Palette::WindowText(), $brush); - $palette5->setBrush(Qt::Palette::Active(), Qt::Palette::Button(), $brush1); - $palette5->setBrush(Qt::Palette::Active(), Qt::Palette::Light(), $brush2); - $palette5->setBrush(Qt::Palette::Active(), Qt::Palette::Midlight(), $brush3); - $palette5->setBrush(Qt::Palette::Active(), Qt::Palette::Dark(), $brush4); - $palette5->setBrush(Qt::Palette::Active(), Qt::Palette::Mid(), $brush5); - $palette5->setBrush(Qt::Palette::Active(), Qt::Palette::Text(), $brush); - $palette5->setBrush(Qt::Palette::Active(), Qt::Palette::BrightText(), $brush2); - $palette5->setBrush(Qt::Palette::Active(), Qt::Palette::ButtonText(), $brush); - $palette5->setBrush(Qt::Palette::Active(), Qt::Palette::Base(), $brush2); - $palette5->setBrush(Qt::Palette::Active(), Qt::Palette::Window(), $brush6); - $palette5->setBrush(Qt::Palette::Active(), Qt::Palette::Shadow(), $brush); - $palette5->setBrush(Qt::Palette::Active(), Qt::Palette::Highlight(), $brush7); - $palette5->setBrush(Qt::Palette::Active(), Qt::Palette::HighlightedText(), $brush2); - $palette5->setBrush(Qt::Palette::Active(), Qt::Palette::Link(), $brush); - $palette5->setBrush(Qt::Palette::Active(), Qt::Palette::LinkVisited(), $brush); - $palette5->setBrush(Qt::Palette::Inactive(), Qt::Palette::WindowText(), $brush); - $palette5->setBrush(Qt::Palette::Inactive(), Qt::Palette::Button(), $brush1); - $palette5->setBrush(Qt::Palette::Inactive(), Qt::Palette::Light(), $brush2); - $palette5->setBrush(Qt::Palette::Inactive(), Qt::Palette::Midlight(), $brush2); - $palette5->setBrush(Qt::Palette::Inactive(), Qt::Palette::Dark(), $brush4); - $palette5->setBrush(Qt::Palette::Inactive(), Qt::Palette::Mid(), $brush5); - $palette5->setBrush(Qt::Palette::Inactive(), Qt::Palette::Text(), $brush); - $palette5->setBrush(Qt::Palette::Inactive(), Qt::Palette::BrightText(), $brush2); - $palette5->setBrush(Qt::Palette::Inactive(), Qt::Palette::ButtonText(), $brush); - $palette5->setBrush(Qt::Palette::Inactive(), Qt::Palette::Base(), $brush2); - $palette5->setBrush(Qt::Palette::Inactive(), Qt::Palette::Window(), $brush6); - $palette5->setBrush(Qt::Palette::Inactive(), Qt::Palette::Shadow(), $brush); - $palette5->setBrush(Qt::Palette::Inactive(), Qt::Palette::Highlight(), $brush7); - $palette5->setBrush(Qt::Palette::Inactive(), Qt::Palette::HighlightedText(), $brush2); - $palette5->setBrush(Qt::Palette::Inactive(), Qt::Palette::Link(), $brush8); - $palette5->setBrush(Qt::Palette::Inactive(), Qt::Palette::LinkVisited(), $brush9); - $palette5->setBrush(Qt::Palette::Disabled(), Qt::Palette::WindowText(), $brush10); - $palette5->setBrush(Qt::Palette::Disabled(), Qt::Palette::Button(), $brush1); - $palette5->setBrush(Qt::Palette::Disabled(), Qt::Palette::Light(), $brush2); - $palette5->setBrush(Qt::Palette::Disabled(), Qt::Palette::Midlight(), $brush2); - $palette5->setBrush(Qt::Palette::Disabled(), Qt::Palette::Dark(), $brush4); - $palette5->setBrush(Qt::Palette::Disabled(), Qt::Palette::Mid(), $brush5); - $palette5->setBrush(Qt::Palette::Disabled(), Qt::Palette::Text(), $brush10); - $palette5->setBrush(Qt::Palette::Disabled(), Qt::Palette::BrightText(), $brush2); - $palette5->setBrush(Qt::Palette::Disabled(), Qt::Palette::ButtonText(), $brush10); - $palette5->setBrush(Qt::Palette::Disabled(), Qt::Palette::Base(), $brush2); - $palette5->setBrush(Qt::Palette::Disabled(), Qt::Palette::Window(), $brush6); - $palette5->setBrush(Qt::Palette::Disabled(), Qt::Palette::Shadow(), $brush); - $palette5->setBrush(Qt::Palette::Disabled(), Qt::Palette::Highlight(), $brush7); - $palette5->setBrush(Qt::Palette::Disabled(), Qt::Palette::HighlightedText(), $brush2); - $palette5->setBrush(Qt::Palette::Disabled(), Qt::Palette::Link(), $brush8); - $palette5->setBrush(Qt::Palette::Disabled(), Qt::Palette::LinkVisited(), $brush9); - $textLabel2_2_3_4->setPalette( $palette5 ); + $textLabel2_2_3_4->setPalette( $palette3 ); $textLabel2_2_3_4->setWordWrap( 0 ); $vboxLayout7->addWidget( $textLabel2_2_3_4 ); @@ -2971,7 +2670,7 @@ sub setupUi { $self->{menuBar} = $menuBar; $menuBar->setObjectName( "menuBar" ); $menuBar->setEnabled( 1 ); - $menuBar->setGeometry( Qt::Rect(0, 0, 674, 27) ); + $menuBar->setGeometry( Qt::Rect(0, 0, 706, 27) ); my $fileMenu = Qt::Menu( $menuBar ); $self->{fileMenu} = $fileMenu; $fileMenu->setObjectName( "fileMenu" ); @@ -3002,19 +2701,7 @@ sub setupUi { Qt::Widget::setTabOrder( $beamLine, $year ); Qt::Widget::setTabOrder( $year, $runFiles ); Qt::Widget::setTabOrder( $runFiles, $browse ); - Qt::Widget::setTabOrder( $browse, $fitType1 ); - Qt::Widget::setTabOrder( $fitType1, $fitType2 ); - Qt::Widget::setTabOrder( $fitType2, $fitType3 ); - Qt::Widget::setTabOrder( $fitType3, $tis ); - Qt::Widget::setTabOrder( $tis, $tfs ); - Qt::Widget::setTabOrder( $tfs, $bins ); - Qt::Widget::setTabOrder( $bins, $xi ); - Qt::Widget::setTabOrder( $xi, $xf ); - Qt::Widget::setTabOrder( $xf, $viewBin ); - Qt::Widget::setTabOrder( $viewBin, $yi ); - Qt::Widget::setTabOrder( $yi, $yf ); - Qt::Widget::setTabOrder( $yf, $ltc ); - Qt::Widget::setTabOrder( $ltc, $fitAsyType ); + Qt::Widget::setTabOrder( $browse, $fitAsyType ); Qt::Widget::setTabOrder( $fitAsyType, $histsLRBF ); Qt::Widget::setTabOrder( $histsLRBF, $minimization ); Qt::Widget::setTabOrder( $minimization, $errorCalc ); @@ -3029,25 +2716,7 @@ sub setupUi { Qt::Widget::setTabOrder( $shParam_1_6, $shParam_1_7 ); Qt::Widget::setTabOrder( $shParam_1_7, $shParam_1_8 ); Qt::Widget::setTabOrder( $shParam_1_8, $shParam_1_9 ); - Qt::Widget::setTabOrder( $shParam_1_9, $shParam_2_1 ); - Qt::Widget::setTabOrder( $shParam_2_1, $shParam_2_2 ); - Qt::Widget::setTabOrder( $shParam_2_2, $shParam_2_3 ); - Qt::Widget::setTabOrder( $shParam_2_3, $shParam_2_4 ); - Qt::Widget::setTabOrder( $shParam_2_4, $shParam_2_5 ); - Qt::Widget::setTabOrder( $shParam_2_5, $shParam_2_6 ); - Qt::Widget::setTabOrder( $shParam_2_6, $shParam_2_7 ); - Qt::Widget::setTabOrder( $shParam_2_7, $shParam_2_8 ); - Qt::Widget::setTabOrder( $shParam_2_8, $shParam_2_9 ); - Qt::Widget::setTabOrder( $shParam_2_9, $shParam_3_1 ); - Qt::Widget::setTabOrder( $shParam_3_1, $shParam_3_2 ); - Qt::Widget::setTabOrder( $shParam_3_2, $shParam_3_3 ); - Qt::Widget::setTabOrder( $shParam_3_3, $shParam_3_4 ); - Qt::Widget::setTabOrder( $shParam_3_4, $shParam_3_5 ); - Qt::Widget::setTabOrder( $shParam_3_5, $shParam_3_6 ); - Qt::Widget::setTabOrder( $shParam_3_6, $shParam_3_7 ); - Qt::Widget::setTabOrder( $shParam_3_7, $shParam_3_8 ); - Qt::Widget::setTabOrder( $shParam_3_8, $shParam_3_9 ); - Qt::Widget::setTabOrder( $shParam_3_9, $initParamTable ); + Qt::Widget::setTabOrder( $shParam_1_9, $initParamTable ); Qt::Widget::setTabOrder( $initParamTable, $title ); Qt::Widget::setTabOrder( $title, $fileName ); Qt::Widget::setTabOrder( $fileName, $textMSROutput ); @@ -3134,12 +2803,13 @@ sub setupUi { Qt::Object::connect($t0Update, SIGNAL 'clicked()' , $muSRFit4, SLOT 't0UpdateClicked()' ); Qt::Object::connect($buttonGroupSharing, SIGNAL 'toggled(bool)' , $muSRFit4, SLOT 'ActivateShComp()' ); Qt::Object::connect($menuBar, SIGNAL 'triggered(QAction*)' , $muSRFit4, SLOT 'RunSelectionToggle()' ); - Qt::Object::connect($fitType1, SIGNAL 'currentIndexChanged(int)' , $muSRFit4, SLOT 'InitializeFunctions()' ); Qt::Object::connect($beamLine, SIGNAL 'currentIndexChanged(int)' , $muSRFit4, SLOT 't0Update()' ); + Qt::Object::connect($numComps, SIGNAL 'valueChanged(int)' , $muSRFit4, SLOT 'addFitType()' ); + Qt::Object::connect($numComps, SIGNAL 'valueChanged(int)' , $muSRFit4, SLOT 'addSharingComp()' ); + Qt::Object::connect($runNumbers, SIGNAL 'textEdited(QString)' , $muSRFit4, SLOT 'runsLineNotEmpy()' ); + Qt::Object::connect($constraintLine, SIGNAL 'editingFinished()' , $muSRFit4, SLOT 'AppendToFunctions()' ); $musrfit_tabs->setCurrentIndex( 0 ); - $fitType2->setCurrentIndex( 18 ); - $fitType3->setCurrentIndex( 18 ); Qt::MetaObject::connectSlotsByName( $muSRFit4 ); @@ -3192,18 +2862,6 @@ sub retranslateUi { $self->{optionsFourier}->setIconText( Qt::Application::translate( 'MuSRFit4', "Fourier", undef, Qt::Application::UnicodeUTF8() ) ); $self->{optionsT0}->setText( Qt::Application::translate( 'MuSRFit4', "T0 and Bg bins", undef, Qt::Application::UnicodeUTF8() ) ); $self->{optionsT0}->setIconText( Qt::Application::translate( 'MuSRFit4', "T0 and Bg bins", undef, Qt::Application::UnicodeUTF8() ) ); - $self->{runsMan}->setTitle( Qt::Application::translate( 'MuSRFit4', "RUN Files", undef, Qt::Application::UnicodeUTF8() ) ); - $self->{runFiles}->setToolTip( Qt::Application::translate( 'MuSRFit4', "Names of data files to be fit. Multiple data files are comma separated.", undef, Qt::Application::UnicodeUTF8() ) ); - $self->{runFiles}->setWhatsThis( Qt::Application::translate( 'MuSRFit4', "Names of data files to be fit. Multiple data files are comma separated.", undef, Qt::Application::UnicodeUTF8() ) ); - $self->{browse}->setToolTip( Qt::Application::translate( 'MuSRFit4', "Browse to select data files for fitting.", undef, Qt::Application::UnicodeUTF8() ) ); - $self->{browse}->setWhatsThis( Qt::Application::translate( 'MuSRFit4', "Browse to select data files for fitting.", undef, Qt::Application::UnicodeUTF8() ) ); - $self->{browse}->setText( Qt::Application::translate( 'MuSRFit4', "Browse", undef, Qt::Application::UnicodeUTF8() ) ); - $self->{fitAsyTypeLabel}->setText( Qt::Application::translate( 'MuSRFit4', "Fit type", undef, Qt::Application::UnicodeUTF8() ) ); - $self->{fitAsyType}->insertItems(0, [Qt::Application::translate( 'MuSRFit4', "Asymmetry GLB", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Single Hist", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Asymmetry", undef, Qt::Application::UnicodeUTF8() )]); - $self->{histsLRBFLabel}->setText( Qt::Application::translate( 'MuSRFit4', "Histograms list", undef, Qt::Application::UnicodeUTF8() ) ); - $self->{histsLRBF}->setText( Qt::Application::translate( 'MuSRFit4', "1 5,3 7", undef, Qt::Application::UnicodeUTF8() ) ); $self->{runsAuto}->setTitle( Qt::Application::translate( 'MuSRFit4', "RUN Numbers", undef, Qt::Application::UnicodeUTF8() ) ); $self->{runNumbers}->setToolTip( Qt::Application::translate( 'MuSRFit4', "Numbers of RUNs to fit. Multiple runs are comma separated.", undef, Qt::Application::UnicodeUTF8() ) ); $self->{runNumbers}->setWhatsThis( Qt::Application::translate( 'MuSRFit4', "Numbers of RUNs to fit. Multiple runs are comma separated.", undef, Qt::Application::UnicodeUTF8() ) ); @@ -3217,66 +2875,13 @@ sub retranslateUi { Qt::Application::translate( 'MuSRFit4', "LEM (PPC)", undef, Qt::Application::UnicodeUTF8() )]); $self->{yearLabel}->setText( Qt::Application::translate( 'MuSRFit4', " Year ", undef, Qt::Application::UnicodeUTF8() ) ); $self->{beamLineLabel}->setText( Qt::Application::translate( 'MuSRFit4', "On beam line ", undef, Qt::Application::UnicodeUTF8() ) ); - $self->{groupBox}->setTitle( Qt::Application::translate( 'MuSRFit4', "Theory Function", undef, Qt::Application::UnicodeUTF8() ) ); - $self->{comp1Label}->setText( Qt::Application::translate( 'MuSRFit4', "First Component", undef, Qt::Application::UnicodeUTF8() ) ); - $self->{comp2Label}->setText( Qt::Application::translate( 'MuSRFit4', "Second Component", undef, Qt::Application::UnicodeUTF8() ) ); - $self->{comp3Label}->setText( Qt::Application::translate( 'MuSRFit4', "Third Component", undef, Qt::Application::UnicodeUTF8() ) ); - $self->{fitType1}->insertItems(0, [Qt::Application::translate( 'MuSRFit4', "Exponential", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Gaussian", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Stretch Exp.", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Exponential Cos", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Gaussian Cos", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Stretch Cos", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Lorentzian Dynamic KT", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Gaussian Dynamic KT", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Background", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Lorentzian Kubo-Toyabe LF x Exp", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Gaussian Kubo-Toyabe LF x Exp", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Lorentzian Kubo-Toyabe LF x Str Exp", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Gaussian Kubo-Toyabe LF x Str Exp", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "MolMag", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Meissner State Model", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Lor-Gss combi KT", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Lor-Gss combi KT x Exp", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Lor-Gss combi KT x SExp", undef, Qt::Application::UnicodeUTF8() )]); - $self->{fitType2}->insertItems(0, [Qt::Application::translate( 'MuSRFit4', "Exponential", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Gaussian", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Stretch Exp.", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Exponential Cos", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Gaussian Cos", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Stretch Cos", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Lorentzian Dynamic KT", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Gaussian Dynamic KT", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Background", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Lorentzian Kubo-Toyabe LF x Exp", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Gaussian Kubo-Toyabe LF x Exp", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Lorentzian Kubo-Toyabe LF x Str Exp", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Gaussian Kubo-Toyabe LF x Str Exp", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "MolMag", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Meissner State Model", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Lor-Gss combi KT", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Lor-Gss combi KT x Exp", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Lor-Gss combi KT x SExp", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "None", undef, Qt::Application::UnicodeUTF8() )]); - $self->{fitType3}->insertItems(0, [Qt::Application::translate( 'MuSRFit4', "Exponential", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Gaussian", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Stretch Exp.", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Exponential Cos", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Gaussian Cos", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Stretch Cos", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Lorentzian Dynamic KT", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Gaussian Dynamic KT", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Background", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Lorentzian Kubo-Toyabe LF x Exp", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Gaussian Kubo-Toyabe LF x Exp", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Lorentzian Kubo-Toyabe LF x Str Exp", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Gaussian Kubo-Toyabe LF x Str Exp", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "MolMag", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Meissner State Model", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Lor-Gss combi KT", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Lor-Gss combi KT x Exp", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "Lor-Gss combi KT x SExp", undef, Qt::Application::UnicodeUTF8() ), - Qt::Application::translate( 'MuSRFit4', "None", undef, Qt::Application::UnicodeUTF8() )]); + $self->{runsMan}->setTitle( Qt::Application::translate( 'MuSRFit4', "RUN Files", undef, Qt::Application::UnicodeUTF8() ) ); + $self->{runFiles}->setToolTip( Qt::Application::translate( 'MuSRFit4', "Names of data files to be fit. Multiple data files are comma separated.", undef, Qt::Application::UnicodeUTF8() ) ); + $self->{runFiles}->setWhatsThis( Qt::Application::translate( 'MuSRFit4', "Names of data files to be fit. Multiple data files are comma separated.", undef, Qt::Application::UnicodeUTF8() ) ); + $self->{browse}->setToolTip( Qt::Application::translate( 'MuSRFit4', "Browse to select data files for fitting.", undef, Qt::Application::UnicodeUTF8() ) ); + $self->{browse}->setWhatsThis( Qt::Application::translate( 'MuSRFit4', "Browse to select data files for fitting.", undef, Qt::Application::UnicodeUTF8() ) ); + $self->{browse}->setText( Qt::Application::translate( 'MuSRFit4', "Browse", undef, Qt::Application::UnicodeUTF8() ) ); + $self->{comp1Label}->setText( Qt::Application::translate( 'MuSRFit4', "Number of components", undef, Qt::Application::UnicodeUTF8() ) ); $self->{tisLabel}->setText( Qt::Application::translate( 'MuSRFit4', "Initial Fit Time", undef, Qt::Application::UnicodeUTF8() ) ); $self->{tfsLabel}->setText( Qt::Application::translate( 'MuSRFit4', "Final Fit Time", undef, Qt::Application::UnicodeUTF8() ) ); $self->{binsLabel}->setText( Qt::Application::translate( 'MuSRFit4', "Fit Binning Factor", undef, Qt::Application::UnicodeUTF8() ) ); @@ -3290,6 +2895,12 @@ sub retranslateUi { $self->{textLabel1_4_3}->setText( Qt::Application::translate( 'MuSRFit4', "Max Y", undef, Qt::Application::UnicodeUTF8() ) ); $self->{textLabel1_4_4}->setText( '' ); $self->{ltc}->setText( Qt::Application::translate( 'MuSRFit4', "Life time correction", undef, Qt::Application::UnicodeUTF8() ) ); + $self->{fitAsyTypeLabel}->setText( Qt::Application::translate( 'MuSRFit4', "Fit type", undef, Qt::Application::UnicodeUTF8() ) ); + $self->{fitAsyType}->insertItems(0, [Qt::Application::translate( 'MuSRFit4', "Asymmetry GLB", undef, Qt::Application::UnicodeUTF8() ), + Qt::Application::translate( 'MuSRFit4', "Single Hist", undef, Qt::Application::UnicodeUTF8() ), + Qt::Application::translate( 'MuSRFit4', "Asymmetry", undef, Qt::Application::UnicodeUTF8() )]); + $self->{histsLRBFLabel}->setText( Qt::Application::translate( 'MuSRFit4', "Histograms list", undef, Qt::Application::UnicodeUTF8() ) ); + $self->{histsLRBF}->setText( Qt::Application::translate( 'MuSRFit4', "1 5,3 7", undef, Qt::Application::UnicodeUTF8() ) ); $self->{musrfit_tabs}->setTabText( $self->{musrfit_tabs}->indexOf( $self->{runsPage}), Qt::Application::translate( 'MuSRFit4', "RUNS", undef, Qt::Application::UnicodeUTF8() ) ); $self->{errorCalc}->insertItems(0, [Qt::Application::translate( 'MuSRFit4', "HESSE", undef, Qt::Application::UnicodeUTF8() ), Qt::Application::translate( 'MuSRFit4', "MINOS", undef, Qt::Application::UnicodeUTF8() )]); @@ -3300,7 +2911,7 @@ sub retranslateUi { $self->{textLabel1_5_2}->setText( Qt::Application::translate( 'MuSRFit4', "Error estimation", undef, Qt::Application::UnicodeUTF8() ) ); $self->{musrfit_tabs}->setTabText( $self->{musrfit_tabs}->indexOf( $self->{fittingPage}), Qt::Application::translate( 'MuSRFit4', "Fitting", undef, Qt::Application::UnicodeUTF8() ) ); $self->{buttonGroupSharing}->setTitle( Qt::Application::translate( 'MuSRFit4', "Shared parameters among different runs", undef, Qt::Application::UnicodeUTF8() ) ); - $self->{sharingComp1}->setTitle( Qt::Application::translate( 'MuSRFit4', "1st Component", undef, Qt::Application::UnicodeUTF8() ) ); + $self->{sharingComp1}->setTitle( Qt::Application::translate( 'MuSRFit4', "Component 1", undef, Qt::Application::UnicodeUTF8() ) ); $self->{shParam_1_1}->setText( Qt::Application::translate( 'MuSRFit4', "Param1", undef, Qt::Application::UnicodeUTF8() ) ); $self->{shParam_1_2}->setText( Qt::Application::translate( 'MuSRFit4', "Param2", undef, Qt::Application::UnicodeUTF8() ) ); $self->{shParam_1_3}->setText( Qt::Application::translate( 'MuSRFit4', "Param3", undef, Qt::Application::UnicodeUTF8() ) ); @@ -3311,28 +2922,6 @@ sub retranslateUi { $self->{shParam_1_8}->setText( Qt::Application::translate( 'MuSRFit4', "Param8", undef, Qt::Application::UnicodeUTF8() ) ); $self->{shParam_1_9}->setText( Qt::Application::translate( 'MuSRFit4', "Param9", undef, Qt::Application::UnicodeUTF8() ) ); $self->{comp1ShLabel}->setText( Qt::Application::translate( 'MuSRFit4', "FitType1", undef, Qt::Application::UnicodeUTF8() ) ); - $self->{sharingComp2}->setTitle( Qt::Application::translate( 'MuSRFit4', "2nd Component", undef, Qt::Application::UnicodeUTF8() ) ); - $self->{comp2ShLabel}->setText( Qt::Application::translate( 'MuSRFit4', "FitType2", undef, Qt::Application::UnicodeUTF8() ) ); - $self->{shParam_2_1}->setText( Qt::Application::translate( 'MuSRFit4', "Param1", undef, Qt::Application::UnicodeUTF8() ) ); - $self->{shParam_2_2}->setText( Qt::Application::translate( 'MuSRFit4', "Param2", undef, Qt::Application::UnicodeUTF8() ) ); - $self->{shParam_2_3}->setText( Qt::Application::translate( 'MuSRFit4', "Param3", undef, Qt::Application::UnicodeUTF8() ) ); - $self->{shParam_2_4}->setText( Qt::Application::translate( 'MuSRFit4', "Param4", undef, Qt::Application::UnicodeUTF8() ) ); - $self->{shParam_2_5}->setText( Qt::Application::translate( 'MuSRFit4', "Param5", undef, Qt::Application::UnicodeUTF8() ) ); - $self->{shParam_2_6}->setText( Qt::Application::translate( 'MuSRFit4', "Param6", undef, Qt::Application::UnicodeUTF8() ) ); - $self->{shParam_2_7}->setText( Qt::Application::translate( 'MuSRFit4', "Param7", undef, Qt::Application::UnicodeUTF8() ) ); - $self->{shParam_2_8}->setText( Qt::Application::translate( 'MuSRFit4', "Param8", undef, Qt::Application::UnicodeUTF8() ) ); - $self->{shParam_2_9}->setText( Qt::Application::translate( 'MuSRFit4', "Param9", undef, Qt::Application::UnicodeUTF8() ) ); - $self->{sharingComp3}->setTitle( Qt::Application::translate( 'MuSRFit4', "3rd Component", undef, Qt::Application::UnicodeUTF8() ) ); - $self->{comp3ShLabel}->setText( Qt::Application::translate( 'MuSRFit4', "FitType3", undef, Qt::Application::UnicodeUTF8() ) ); - $self->{shParam_3_1}->setText( Qt::Application::translate( 'MuSRFit4', "Param1", undef, Qt::Application::UnicodeUTF8() ) ); - $self->{shParam_3_2}->setText( Qt::Application::translate( 'MuSRFit4', "Param2", undef, Qt::Application::UnicodeUTF8() ) ); - $self->{shParam_3_3}->setText( Qt::Application::translate( 'MuSRFit4', "Param3", undef, Qt::Application::UnicodeUTF8() ) ); - $self->{shParam_3_4}->setText( Qt::Application::translate( 'MuSRFit4', "Param4", undef, Qt::Application::UnicodeUTF8() ) ); - $self->{shParam_3_5}->setText( Qt::Application::translate( 'MuSRFit4', "Param5", undef, Qt::Application::UnicodeUTF8() ) ); - $self->{shParam_3_6}->setText( Qt::Application::translate( 'MuSRFit4', "Param6", undef, Qt::Application::UnicodeUTF8() ) ); - $self->{shParam_3_7}->setText( Qt::Application::translate( 'MuSRFit4', "Param7", undef, Qt::Application::UnicodeUTF8() ) ); - $self->{shParam_3_8}->setText( Qt::Application::translate( 'MuSRFit4', "Param8", undef, Qt::Application::UnicodeUTF8() ) ); - $self->{shParam_3_9}->setText( Qt::Application::translate( 'MuSRFit4', "Param9", undef, Qt::Application::UnicodeUTF8() ) ); $self->{musrfit_tabs}->setTabText( $self->{musrfit_tabs}->indexOf( $self->{sharingPage}), Qt::Application::translate( 'MuSRFit4', "Sharing", undef, Qt::Application::UnicodeUTF8() ) ); my $initParamTable = $self->{initParamTable}; if ( $initParamTable->columnCount < 4 ) { From d34d1b96790f216c459ed90f5f6ef5dda3496264 Mon Sep 17 00:00:00 2001 From: Andreas Suter Date: Fri, 23 Mar 2018 12:54:21 +0100 Subject: [PATCH 5/6] minor fix of shortcut overload conflict. --- src/musredit_qt5/musredit/PTextEdit.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/musredit_qt5/musredit/PTextEdit.cpp b/src/musredit_qt5/musredit/PTextEdit.cpp index 4fc18ab2..c828ca07 100644 --- a/src/musredit_qt5/musredit/PTextEdit.cpp +++ b/src/musredit_qt5/musredit/PTextEdit.cpp @@ -706,8 +706,8 @@ void PTextEdit::setupMusrActions() iconName = QString(":/icons/msr2data-dark.svg"); else iconName = QString(":/icons/msr2data-plain.svg"); - a = new QAction( QIcon( QPixmap(iconName) ), tr( "&Msr2Data" ), this ); - a->setShortcut( tr("Alt+M") ); + a = new QAction( QIcon( QPixmap(iconName) ), tr( "Msr&2Data" ), this ); + a->setShortcut( tr("Alt+2") ); a->setStatusTip( tr("Start msr2data interface") ); connect( a, SIGNAL( triggered() ), this, SLOT( musrMsr2Data() ) ); menu->addAction(a); From f843d61bbba161c50dca62d21396863107f5d250 Mon Sep 17 00:00:00 2001 From: Andreas Suter Date: Mon, 26 Mar 2018 12:50:45 +0200 Subject: [PATCH 6/6] (i) when exporting Fourier, and _F is added. (ii) the average flag is now also properly propageted in the batch mode. --- src/classes/PMusrCanvas.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/classes/PMusrCanvas.cpp b/src/classes/PMusrCanvas.cpp index 1ea79af6..74b93014 100644 --- a/src/classes/PMusrCanvas.cpp +++ b/src/classes/PMusrCanvas.cpp @@ -1014,8 +1014,13 @@ void PMusrCanvas::HandleCmdKey(Int_t event, Int_t x, Int_t y, TObject *selected) if (event != kKeyPress) return; - if (fBatchMode) + if (fBatchMode) { + if (fStartWithAvg) { // this is needed to get the averaging in the batch mode + HandleAverage(); + PlotAverage(true); + } return; + } // handle keys and popup menu entries enum eKeySwitch {kNotRelevant, kData, kDiffData, kFourier, kDiffFourier, kFourierDiff}; @@ -1553,7 +1558,10 @@ void PMusrCanvas::SaveGraphicsAndQuit(Char_t *fileName, Char_t *graphicsFormat) return; } - sprintf(ext, "_%d", fPlotNumber); + if (fStartWithFourier) + sprintf(ext, "_%d_F", fPlotNumber); + else + sprintf(ext, "_%d", fPlotNumber); str.Replace(idx, size, ext, strlen(ext)); idx += strlen(ext); size = strlen(ext);