// $Header: https://oberon.oapd.inaf.it/shins/trunk/shins/test/obs_ctrl/sequencerI.h 301 2017-11-21 10:33:13Z depa $

// IceLite (from MPIA) 3.6 does not support C++ 11
#ifndef _SEQUENCER_I_
#define _SEQUENCER_I_

// STDLIB
#include <algorithm>
#include <fstream>
#include <iostream>
#include <map>
#include <stdexcept>
#include <string>
#include <vector>

// ICE
#include <Ice/Ice.h>
// #include <IceUtil/Mutex.h>

//NICE
#include <Nice/Log.h>

// BOOST
// #include <boost/signals2/signal.hpp>
#include <boost/shared_ptr.hpp>

// SHINS
// #include "../motion_ctrl/wheels/multiwheel.h"
#include "../motion_ctrl/motionCtrl.h"
#include "obsControl.h"
//#include "shins_util.h"
#include "os_sm.h"

using namespace sharknir;

// this class implements an Ice servant
class SequencerI : public obsControl::Sequencer {
private: // members
  // ptrSM m_ptrStateMachine; // OS state machine
  boost::shared_ptr<osfsm::OSFsm> m_ptrStateMachine;
  // boost::shared_ptr<IceUtil::Mutex>m_ptrMtxStateMachine;
  motionCtrl m_motion;
  // trackingCtrl m_track;
  // calibrationCtrl m_calibration;
  //boost::signals2::connection  m_connection;
public:
  SequencerI(int argc, char* argv[], const std::string& _strAliasFileName,
             boost::shared_ptr<osfsm::OSFsm>& _ptrSM);//, IceUtil::Mutex& _mtxSm);
  ~SequencerI();
  virtual int setupMotion(const dictNonSciAssembly& d,
                          const std::string& strSetup, const Ice::Current&);

  virtual int setupMotionDict(const dictSetup& dSetup, const Ice::Current&);
  virtual int setupTracking(const std::string& strSetup, const Ice::Current&);

  virtual int setupCalibration(const dictNonSciAssembly& d,
                               const std::string& strSetup, const Ice::Current&);
private:
  std::map<std::string, int> parse_setup_string(const std::string& _strSetup);

};

#endif // _SEQUENCER_I_

