23 #ifndef FrontSeatBase20130220H 24 #define FrontSeatBase20130220H 26 #include <boost/signals2.hpp> 28 #include "goby/common/time.h" 30 #include "goby/moos/moos_geodesy.h" 32 #include "goby/moos/frontseat/frontseat_exception.h" 33 #include "goby/moos/protobuf/frontseat.pb.h" 34 #include "goby/moos/protobuf/frontseat_config.pb.h" 48 virtual goby::moos::protobuf::FrontSeatState frontseat_state()
const = 0;
49 virtual bool frontseat_providing_data()
const = 0;
51 void set_helm_state(goby::moos::protobuf::HelmState
state) { helm_state_ = state; }
52 goby::moos::protobuf::HelmState helm_state()
const {
return helm_state_; }
53 goby::moos::protobuf::InterfaceState state()
const {
return state_; }
61 s.set_frontseat_state(frontseat_state());
62 s.set_helm_state(helm_state_);
63 if (last_helm_error_ != goby::moos::protobuf::ERROR_HELM_NONE)
64 s.set_helm_error(last_helm_error_);
65 if (last_frontseat_error_ != goby::moos::protobuf::ERROR_FRONTSEAT_NONE)
66 s.set_frontseat_error(last_frontseat_error_);
72 virtual void loop() = 0;
76 boost::signals2::signal<void(const goby::moos::protobuf::CommandResponse& data)>
77 signal_command_response;
78 boost::signals2::signal<void(const goby::moos::protobuf::FrontSeatInterfaceData& data)>
79 signal_data_from_frontseat;
80 boost::signals2::signal<void(const goby::moos::protobuf::FrontSeatRaw& data)>
81 signal_raw_from_frontseat;
82 boost::signals2::signal<void(const goby::moos::protobuf::FrontSeatRaw& data)>
83 signal_raw_to_frontseat;
90 friend class FrontSeatLegacyTranslator;
92 void check_error_states();
93 void check_change_state();
97 boost::signals2::signal<void(goby::moos::protobuf::InterfaceState state)> signal_state_change;
101 DIRECTION_TO_FRONTSEAT,
102 DIRECTION_FROM_FRONTSEAT
109 goby::moos::protobuf::HelmState helm_state_;
110 goby::moos::protobuf::InterfaceState state_;
112 goby::moos::protobuf::FrontSeatError last_frontseat_error_;
113 goby::moos::protobuf::HelmError last_helm_error_;
117 std::string glog_out_group_, glog_in_group_;