Changeset 10734 for trunk/FACT++/src


Ignore:
Timestamp:
05/17/11 20:49:14 (13 years ago)
Author:
tbretz
Message:
Added EnablePixel to StaticData.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/HeadersFTM.h

    r10726 r10734  
    157157            kMaxSequence        = 0x1f,
    158158            kMaxDAC             = 0xfff,
     159            kMaxPixelIdx        = 1439,
    159160            kMaskSettings       = 0xf,
    160161            kMaskLEDs           = 0xf,
     
    226227        void ToggleFTU(int i)  { fActiveFTU[i/10] ^= (1<<(i%10)); }
    227228
    228         void Enable(GeneralSettings type, bool enable)  {
     229        void Enable(GeneralSettings type, bool enable)
     230        {
    229231            if (enable)
    230232                fGeneralSettings |= uint16_t(type);
     
    233235
    234236        bool IsEnabled(GeneralSettings type)  { return fGeneralSettings&uint16_t(type); }
     237
     238        void EnablePixel(int idx, bool enable)
     239        {
     240            const int board =  idx%40;
     241            const int patch = (idx/40)/9;
     242            const int pixel = (idx/40)%9;
     243
     244            uint16_t &pix = fBoard[board/10][board%10].fEnable[patch];
     245
     246            if (enable)
     247                pix |= (1<<pixel);
     248            else
     249                pix &= ~(1<<pixel);
     250        }
    235251
    236252        uint8_t GetSequencePed() const   { return (fTriggerSequence>>10)&0x1f; }
Note: See TracChangeset for help on using the changeset viewer.