Ignore:
Timestamp:
05/26/12 14:33:13 (12 years ago)
Author:
tbretz
Message:
Moved stated to namespace FSC::State
File:
1 edited

Legend:

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

    r13819 r13914  
    1313#include "tools.h"
    1414
     15#include "HeadersState.h"
     16
    1517namespace ba    = boost::asio;
    1618namespace bs    = boost::system;
     
    1820
    1921using namespace std;
     22using namespace FSC;
    2023
    2124// ------------------------------------------------------------------------
     
    672675                    "|T_sens[deg C]:Sensor compartment temperatures"
    673676                    "|T_crate[deg C]:Temperatures crate 0 (back/front), 1 (b/f), 2 (b/f), 3 (b/f)"
    674                      "|T_ps[deg C]:Temp power supplies crate 0 (back/front), 1, 2, 3"
     677                    "|T_ps[deg C]:Temp power supplies crate 0 (back/front), 1, 2, 3"
    675678                    "|T_aux[deg C]:Auxiliary power supply temperatures FTM (top/bottom), FSC (t/b)"
    676679                    "|T_back[deg C]:FTM backpanel temperatures FTM (top/bottom), FSC (top/bottom)"
     
    715718class StateMachineFSC : public T, public ba::io_service, public ba::io_service::work
    716719{
    717     int Wrap(boost::function<void()> f)
    718     {
    719         f();
    720         return T::GetCurrentState();
    721     }
    722 
    723     function<int(const EventImp &)> Wrapper(function<void()> func)
    724     {
    725         return bind(&StateMachineFSC::Wrap, this, func);
    726     }
    727 
    728720private:
    729721    S fFSC;
    730 
    731     enum states_t
    732     {
    733         kStateDisconnected = 1,
    734         kStateConnected    = 2,
    735     };
    736722
    737723    int Disconnect()
     
    776762        poll_one();
    777763
    778         return fFSC.IsConnected() ? kStateConnected : kStateDisconnected;
     764        return fFSC.IsConnected() ? State::kConnected : State::kDisconnected;
    779765    }
    780766
     
    823809
    824810        // State names
    825         AddStateName(kStateDisconnected, "Disconnected",
     811        T::AddStateName(State::kDisconnected, "Disconnected",
    826812                     "FSC board not connected via ethernet.");
    827813
    828         AddStateName(kStateConnected, "Connected",
     814        T::AddStateName(State::kConnected, "Connected",
    829815                     "Ethernet connection to FSC established.");
    830816
     
    841827
    842828        // Conenction commands
    843         AddEvent("DISCONNECT", kStateConnected)
     829        T::AddEvent("DISCONNECT", State::kConnected)
    844830            (bind(&StateMachineFSC::Disconnect, this))
    845831            ("disconnect from ethernet");
    846832
    847         AddEvent("RECONNECT", "O", kStateDisconnected, kStateConnected)
     833        T::AddEvent("RECONNECT", "O", State::kDisconnected, State::kConnected)
    848834            (bind(&StateMachineFSC::Reconnect, this, placeholders::_1))
    849835            ("(Re)connect ethernet connection to FTM, a new address can be given"
Note: See TracChangeset for help on using the changeset viewer.