Changeset 11112 for trunk/FACT++/src


Ignore:
Timestamp:
06/22/11 17:50:37 (14 years ago)
Author:
tbretz
Message:
Added TOGGLE for singel FAD connections.
File:
1 edited

Legend:

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

    r11109 r11112  
    11081108        if (it==fBoards.end())
    11091109            return T::GetCurrentState();
     1110
     1111        EnableConnection(it->second, enable);
     1112        ConnectSlot(it->first, enable ? it->second.first : tcp::endpoint());
     1113
     1114        return T::GetCurrentState();
     1115    }
     1116
     1117    int ToggleSlot(const EventImp &evt)
     1118    {
     1119        if (!CheckEventSize(evt.GetSize(), "ToggleSlot", 2))
     1120            return T::kSM_FatalError;
     1121
     1122        const int16_t slot = evt.GetShort();
     1123
     1124        const BoardList::iterator it = GetSlot(slot);
     1125        if (it==fBoards.end())
     1126            return T::GetCurrentState();
     1127
     1128        const bool enable = it->second.second->IsDisconnected() && fStatus2[slot]==0;
    11101129
    11111130        EnableConnection(it->second, enable);
     
    14601479            ("Disconnect a connected slot.");
    14611480
     1481        T::AddEvent("TOGGLE", "S:1", FAD::kDisconnected, FAD::kConnecting, FAD::kConnected)
     1482            (boost::bind(&StateMachineFAD::ToggleSlot, this, _1))
     1483            ("");
     1484
    14621485        T::AddEvent("CLOSE_OPEN_FILES", FAD::kConnecting, FAD::kConnected)
    14631486            (boost::bind(&StateMachineFAD::CloseOpenFiles, this))
Note: See TracChangeset for help on using the changeset viewer.