Changeset 11682 for trunk


Ignore:
Timestamp:
07/28/11 11:32:26 (14 years ago)
Author:
tbretz
Message:
Added radio buttons for different scaling methods in ADC tab.
Location:
trunk/FACT++/gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/gui/FactGui.h

    r11675 r11682  
    11901190
    11911191        for (int i=0; i<fEventData->Roi; i++)
    1192             h->SetBinContent(i+1, fEventData->Adc_Data[p*fEventData->Roi+i]*0.5);
    1193 
    1194         if (fAdcAutoScale->isChecked())
     1192            h->SetBinContent(i+1, reinterpret_cast<float*>(fEventData->Adc_Data)[p*fEventData->Roi+i]);
     1193
     1194        if (fAdcDynamicScale->isChecked())
    11951195        {
    11961196            h->SetMinimum(-1111);
    11971197            h->SetMaximum(-1111);
    1198         }
    1199         else
     1198        }
     1199        if (fAdcManualScale->isChecked())
    12001200        {
    12011201            if (h->GetMinimumStored()==-1111)
     
    12041204                h->SetMaximum(1025);
    12051205        }
     1206        if (fAdcAutoScale->isChecked())
     1207        {
     1208            const double min = h->GetMinimumStored();
     1209            const double max = h->GetMaximumStored();
     1210
     1211            h->SetMinimum();
     1212            h->SetMaximum();
     1213
     1214            h->SetMinimum(h->GetMinimum()<min ? h->GetMinimum() : min);
     1215            h->SetMaximum(h->GetMaximum()>max ? h->GetMaximum() : max);
     1216
     1217        }
    12061218
    12071219        c->Modified();
     
    12261238        }
    12271239
    1228         if (d.size()!=sizeof(EVENT)+dat.Roi*2*1440)
    1229         {
    1230             cout << "Size mismatch in " << d.name << ": Found=" << d.size() << " Expected=" << dat.Roi*2*1440+sizeof(EVENT) << endl;
     1240        if (d.size()!=sizeof(EVENT)+dat.Roi*4*1440)
     1241        {
     1242            cout << "Size mismatch in " << d.name << ": Found=" << d.size() << " Expected=" << dat.Roi*4*1440+sizeof(EVENT) << " [roi=" << dat.Roi << "]" << endl;
    12311243            return;
    12321244        }
     
    20732085                SetLedColor(fStatusFADLed, kLedGray, time);
    20742086
    2075                 for (int i=0; i<40; i++)
    2076                     SetLedColor(fFadLED[i], kLedGray, time);
     2087                // Timing problem - sometimes they stay gray :(
     2088                //for (int i=0; i<40; i++)
     2089                //    SetLedColor(fFadLED[i], kLedGray, time);
    20772090
    20782091                /*
  • trunk/FACT++/gui/design.ui

    r11672 r11682  
    68466846              </item>
    68476847              <item>
    6848                <widget class="QCheckBox" name="fAdcAutoScale">
     6848               <spacer name="verticalSpacer_51">
     6849                <property name="orientation">
     6850                 <enum>Qt::Vertical</enum>
     6851                </property>
     6852                <property name="sizeType">
     6853                 <enum>QSizePolicy::Fixed</enum>
     6854                </property>
     6855                <property name="sizeHint" stdset="0">
     6856                 <size>
     6857                  <width>20</width>
     6858                  <height>10</height>
     6859                 </size>
     6860                </property>
     6861               </spacer>
     6862              </item>
     6863              <item>
     6864               <widget class="QRadioButton" name="fAdcManualScale">
    68496865                <property name="text">
    6850                  <string>AutoScale</string>
     6866                 <string>Manual scale</string>
     6867                </property>
     6868                <property name="checked">
     6869                 <bool>true</bool>
     6870                </property>
     6871               </widget>
     6872              </item>
     6873              <item>
     6874               <widget class="QRadioButton" name="fAdcDynamicScale">
     6875                <property name="text">
     6876                 <string>Dynamic scale</string>
     6877                </property>
     6878               </widget>
     6879              </item>
     6880              <item>
     6881               <widget class="QRadioButton" name="fAdcAutoScale">
     6882                <property name="text">
     6883                 <string>Auto min/max</string>
    68516884                </property>
    68526885               </widget>
     
    72217254               <enum>QAbstractSpinBox::NoButtons</enum>
    72227255              </property>
    7223               <property name="currentSection">
    7224                <enum>QDateTimeEdit::HourSection</enum>
    7225               </property>
    7226               <property name="displayFormat">
    7227                <string>hh:mm:ss</string>
    7228               </property>
    7229               <property name="calendarPopup">
    7230                <bool>false</bool>
    7231               </property>
    7232               <property name="timeSpec">
    7233                <enum>Qt::OffsetFromUTC</enum>
    7234               </property>
    72357256              <property name="time">
    72367257               <time>
     
    72397260                <second>0</second>
    72407261               </time>
     7262              </property>
     7263              <property name="currentSection">
     7264               <enum>QDateTimeEdit::HourSection</enum>
     7265              </property>
     7266              <property name="displayFormat">
     7267               <string>hh:mm:ss</string>
     7268              </property>
     7269              <property name="calendarPopup">
     7270               <bool>false</bool>
     7271              </property>
     7272              <property name="timeSpec">
     7273               <enum>Qt::OffsetFromUTC</enum>
    72417274              </property>
    72427275             </widget>
     
    73637396               <enum>QAbstractSpinBox::NoButtons</enum>
    73647397              </property>
    7365               <property name="currentSection">
    7366                <enum>QDateTimeEdit::HourSection</enum>
    7367               </property>
    7368               <property name="displayFormat">
    7369                <string>hh:mm:ss</string>
    7370               </property>
    7371               <property name="calendarPopup">
    7372                <bool>false</bool>
    7373               </property>
    7374               <property name="timeSpec">
    7375                <enum>Qt::OffsetFromUTC</enum>
    7376               </property>
    73777398              <property name="time">
    73787399               <time>
     
    73817402                <second>0</second>
    73827403               </time>
     7404              </property>
     7405              <property name="currentSection">
     7406               <enum>QDateTimeEdit::HourSection</enum>
     7407              </property>
     7408              <property name="displayFormat">
     7409               <string>hh:mm:ss</string>
     7410              </property>
     7411              <property name="calendarPopup">
     7412               <bool>false</bool>
     7413              </property>
     7414              <property name="timeSpec">
     7415               <enum>Qt::OffsetFromUTC</enum>
    73837416              </property>
    73847417             </widget>
Note: See TracChangeset for help on using the changeset viewer.