Changeset 11112 for trunk/FACT++


Ignore:
Timestamp:
06/22/11 17:50:37 (13 years ago)
Author:
tbretz
Message:
Added TOGGLE for singel FAD connections.
Location:
trunk/FACT++
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/gui/MainWindow.cc

    r11111 r11112  
    208208}
    209209
     210void MainWindow::slot_fFadLED_clicked()
     211{
     212    for (int32_t i=0; i<40; i++)
     213        if (sender()==fFadLED[i])
     214        {
     215            Dim::SendCommand("FAD_CONTROL/TOGGLE", i);
     216            break;
     217        }
     218}
     219
    210220void MainWindow::SetTriggerSequence()
    211221{
  • trunk/FACT++/gui/MainWindow.h

    r11111 r11112  
    121121
    122122    // Tab: FADs
    123     void slot_fFadLED_clicked() { }
     123    void slot_fFadLED_clicked();
    124124
    125125    // Tab: Chat
  • 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.