Changeset 11126 for trunk/FACT++


Ignore:
Timestamp:
06/22/11 23:30:34 (13 years ago)
Author:
tbretz
Message:
Added EventBuilder thread status to UpdateConnectionStatus
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/fadctrl.cc

    r11118 r11126  
    11731173    }
    11741174
     1175    bool            fStatusT;
    11751176    vector<uint8_t> fStatus1;
    11761177    vector<uint8_t> fStatus2;
     
    12361237        // ===== Send connection status via dim =====
    12371238
    1238         if (fStatus1!=stat1 || fStatus2!=stat2)
     1239        if (fStatus1!=stat1 || fStatus2!=stat2 || fStatusT!=IsThreadRunning())
    12391240        {
    12401241            fStatus1 = stat1;
    12411242            fStatus2 = stat2;
    1242             UpdateConnectionStatus(stat1, stat2);
     1243            fStatusT = IsThreadRunning();
     1244            UpdateConnectionStatus(stat1, stat2, IsThreadRunning());
    12431245        }
    12441246
     
    12541256            return FAD::kConnecting;
    12551257
    1256 //        cout << 1 << " " << nconnecting1 << " " << nconnected1 << " " << nclosed1 << endl;
    1257 //        cout << 2 << " " << nconnecting2 << " " << nconnected2 << endl;
    1258 
    12591258        // nconnected1 == nconnected2 == 0
    12601259        return IsThreadRunning() ? FAD::kDisconnected : FAD::kOffline;
     
    12951294    }
    12961295 */
    1297     void UpdateConnectionStatus(const vector<uint8_t> &stat1, const vector<uint8_t> &stat2)
    1298     {
    1299         vector<uint8_t> stat(40);
     1296    void UpdateConnectionStatus(const vector<uint8_t> &stat1, const vector<uint8_t> &stat2, bool thread)
     1297    {
     1298        vector<uint8_t> stat(41);
    13001299
    13011300        for (int i=0; i<40; i++)
    13021301            stat[i] = stat1[i]+stat2[i];
    13031302
    1304         fDimConnection.setData(stat.data(), 40);
     1303        stat[40] = thread;
     1304
     1305        fDimConnection.setData(stat.data(), 41);
    13051306        fDimConnection.updateService();
    13061307    }
     
    13091310    StateMachineFAD(ostream &out=cout) :
    13101311        T(out, "FAD_CONTROL"), EventBuilderWrapper(*static_cast<MessageImp*>(this)), ba::io_service::work(static_cast<ba::io_service&>(*this)),
    1311         fStatus1(40), fStatus2(40),
    1312         fDimConnection("FAD_CONTROL/CONNECTIONS", "C:40", "")
     1312        fStatus1(40), fStatus2(40), fStatusT(false),
     1313        fDimConnection("FAD_CONTROL/CONNECTIONS", "C:40;C:1", "")
    13131314    {
    13141315        // ba::io_service::work is a kind of keep_alive for the loop.
Note: See TracChangeset for help on using the changeset viewer.