Changeset 11036 for trunk


Ignore:
Timestamp:
06/16/11 18:50:48 (13 years ago)
Author:
tbretz
Message:
Changed color palette; do not use disabled pixels for color scale; make sure the DIM_DNS/VERSION service has the right size; set chatserv LED to gray when offline; do not display debug messages in CHAT window
File:
1 edited

Legend:

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

    r10985 r11036  
    4848         double bb[5] = {0., 0.03, 0.06, 0.00, 1.00};
    4949         */
    50         double ss[5] = {0., 0.25, 0.50, 0.75, 1.00};
    51         double rr[5] = {0., 0.00, 0.00, 1.00, 1.00};
    52         double gg[5] = {0., 0.00, 1.00, 0.00, 1.00};
    53         double bb[5] = {0., 1.00, 0.00, 0.00, 1.00};
     50        double ss[5] = {0.00, 0.25, 0.50, 0.75, 1.00};
     51        double rr[5] = {0.15, 0.00, 0.00, 1.00, 0.85};
     52        double gg[5] = {0.15, 0.00, 1.00, 0.00, 0.85};
     53        double bb[5] = {0.15, 1.00, 0.00, 0.00, 0.85};
    5454
    5555        const Int_t nn = 1440;
     
    174174    }
    175175
     176    double align(double min, double val, double max) const
     177    {
     178        if (val<min)
     179            return min;
     180        if (val>max)
     181            return max;
     182        return val;
     183    }
     184
    176185    void Paint(Option_t *)
    177186    {
     
    187196            gPad->Range(-max, -max/r, max, max/r);
    188197
    189 
    190         const double min   = fData.min();
    191         const double scale = fData.max()==fData.min() ? 1 : fData.max()-fData.min();
     198        double dmin = fData[0];
     199        double dmax = fData[0];
     200
     201        for (unsigned int i=0; i<fData.size(); i++)
     202        {
     203            if (!fEnable[i])
     204                continue;
     205
     206            if (fData[i]>dmax)
     207                dmax = fData[i];
     208            if (fData[i]<dmin)
     209                dmin = fData[i];
     210        }
     211
     212        const double min   = dmin;
     213        const double scale = dmax==dmin ? 1 : dmax-dmin;
     214
     215//        const double min   = fData.min();
     216//        const double scale = fData.max()==fData.min() ? 1 : fData.max()-fData.min();
    192217
    193218        TAttFill fill(0, 1001);
     
    200225                continue;
    201226
    202             const int col = (fData[cnt]-min)/scale*(fPalette.size()-1);
     227            const double val = align(dmin, fData[cnt], dmax);
     228
     229            const int col = (val-min)/scale*(fPalette.size()-1);
    203230
    204231            if (fEnable[cnt])
     
    221248                continue;
    222249
    223             const int col = (fData[cnt]-min)/scale*(fPalette.size()-1);
     250            const double val = align(dmin, fData[cnt], dmax);
     251
     252            const int col = (val-min)/scale*(fPalette.size()-1);
    224253
    225254            if (fEnable[cnt])
     
    243272        line.Modify();
    244273
    245         const int col = (fData[fWhite]-min)/scale*(fPalette.size()-1);
     274        const double val = align(dmin, fData[fWhite], dmax);
     275
     276        const int col = (val-min)/scale*(fPalette.size()-1);
    246277
    247278        if (fEnable[fWhite])
     
    722753    void handleDimDNS(const DimData &d)
    723754    {
    724         const int version = d.get<unsigned int>();
     755        const int version = d.size()!=4 ? 0 : d.get<uint32_t>();
    725756
    726757        ostringstream str;
     
    14551486        if (server=="FTM_CONTROL")
    14561487        {
     1488            // FIXME: Enable FTU page!!!
    14571489            fStatusFTMLabel->setText(s.name.c_str());
    14581490            fStatusFTMLabel->setToolTip(s.comment.c_str());
     
    15381570            fChatOnline = s.index==0;
    15391571
    1540             SetLedColor(fStatusChatLed, fChatOnline ? kLedGreen : kLedRed, time);
     1572            SetLedColor(fStatusChatLed, fChatOnline ? kLedGreen : kLedGray, time);
    15411573
    15421574            fChatSend->setEnabled(fChatOnline);
     
    15691601        if (text.substr(0, 6)=="CHAT: ")
    15701602        {
     1603            if (qos==MessageImp::kDebug)
     1604                return;
     1605
    15711606            out << "<font size='-1' color='navy'>[<B>";
    15721607            out << Time::fmt("%H:%M:%S") << time << "</B>]</FONT>  ";
Note: See TracChangeset for help on using the changeset viewer.