If Bg and Data bins are empty use musrt0 for defaults.

This commit is contained in:
salman 2011-05-03 10:36:20 +00:00
parent 9e0866a56e
commit 26180566e5
2 changed files with 43 additions and 31 deletions

View File

@ -295,28 +295,40 @@ FUNCTIONS
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 ($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{"Data1$NHist"};
}
$NHist++;
}
# Put T0_Line Bg_Line and Data_Line together if not empty
my $T0DataBg=$EMPTY;
if ($T0_Line ne "t0") {
$T0DataBg = $T0DataBg."\n".$T0_Line;
}
if ($Bg_Line ne "background") {
$T0DataBg = $T0DataBg."\n".$Bg_Line;
}
if ($Data_Line ne "data") {
$T0DataBg = $T0DataBg."\n".$Data_Line;
}
$FRANGE_Line = "fit TINI TFIN";
$PAC_Line = "packing BINNING";
if ($T0_Line ne "t0") {
$Data_Line= $Data_Line."\n".$T0_Line;
}
$Single_RUN =
"$RUN_Line\n$Type_Line\n$Alpha_Line$Hist_Lines\n$Bg_Line\n$Data_Line\n$MAP_Line\n$FRANGE_Line\n$PAC_Line\n\n";
"$RUN_Line\n$Type_Line\n$Alpha_Line$Hist_Lines\n$T0DataBg\n$MAP_Line\n$FRANGE_Line\n$PAC_Line\n\n";
# Now add the appropriate values of fit range and packing
my $Range_Min = 8;

View File

@ -23,7 +23,7 @@
<property name="minimumSize">
<size>
<width>21</width>
<height>271</height>
<height>264</height>
</size>
</property>
<property name="caption">
@ -3428,6 +3428,25 @@
<attribute name="title">
<string>t0/Bg</string>
</attribute>
<widget class="QPushButton">
<property name="name">
<cstring>t0Update</cstring>
</property>
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>450</x>
<y>220</y>
<width>94</width>
<height>27</height>
</rect>
</property>
<property name="text">
<string>Update</string>
</property>
</widget>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout25</cstring>
@ -3775,25 +3794,6 @@
</widget>
</hbox>
</widget>
<widget class="QPushButton">
<property name="name">
<cstring>t0Update</cstring>
</property>
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>450</x>
<y>220</y>
<width>94</width>
<height>27</height>
</rect>
</property>
<property name="text">
<string>Update</string>
</property>
</widget>
</widget>
<widget class="QWidget">
<property name="name">