// $Header: https://oberon.oapd.inaf.it/shins/trunk/shins/src/track_ctrl/drot/Interface/Sharknir/Qt/Drot/DrotServicePanel.h 2976 2020-05-14 15:38:34Z depa $

#ifndef     SharknirDrotServicePanel_H_
#define     SharknirDrotServicePanel_H_

#include <Nice/Qt/BridgeItem.h>
#include <Nice/Map/Point.h>
#include <Sharknir/Drot/DrotServiceWorkerInterface.h>
#include <QtDesigner/QDesignerExportWidget>

namespace Ui
{
  class DrotServicePanelUI;
};

/**
 * @brief This class is the implementation of the GUI SharknirDrotServicePanel
 */
class DrotServicePanel : public QWidget, public Nice::BridgeItem
{
    private:
        Q_OBJECT

        /**
         * @brief Connect the Qt Designer Property propertyNode with the methods getPropertyNode and setPropertyNode.
         */
        Q_PROPERTY(QString PropertyNode READ getPropertyNode WRITE setPropertyNode)

        /**
         * @brief Connect the Qt Designer Property AutoSynch with the methods getSynchStatus and setSynchStatus.
         */
        Q_PROPERTY(bool AutoSynch READ getSynchStatus WRITE setSynchStatus)
    
        Ui::DrotServicePanelUI* m_drotView;

        /**
         * @brief member for the command interface
         */
        Sharknir::DrotServiceWorkerInterfacePtr m_cmd;

    public:
        //------------------------------------------------------------
        /**
         * @brief Consturtor
         * @param parent the parent widget
         * @param _connect ??
         */
        DrotServicePanel(QWidget * parent = 0, bool _connect=false );

        //------------------------------------------------------------
        /**
         * @brief Initiate the attributes. The command attributes like the named position and the different units are added.
         *
         * One drop down button will be filled with the labels of the named position. A second drop down button will be filled with the labels of the units.
         */
        virtual void initAttributes();

        //------------------------------------------------------------
        /**
         * @brief This method update the GUI every time when the status of the GUI has changed.
         * @param _val completion state
         */
        virtual void updateGUI( const Nice::Any& _val);

        /**
         * @brief This method can be used to connect different properties with method, which will be executed every time when a property changed.
         */
        virtual void initSlots();

        void slotNice_getRa(double _ra);

        void slotNice_getDec(double _dec);

        void slotNice_getParalacticAngle(double _pa);

        void slotNice_getUTC(std::string _utc);

        void slotNice_getLST(std::string _lst);

        void slotNice_getHourAngle(std::string _ha);

    protected slots:
        /**
         * @brief This is the implementation of the stop button.
         */
        virtual void slotQt_stop();

        /**
         * @brief This is the implementation of the abort button.
         */
        virtual void slotQt_abort();

        virtual void slotQt_update();

        virtual void slotQt_setPresetTelescope();

        virtual void slotQt_setOffsetPointing();

        virtual void slotQt_saveTrajectory();

        virtual void slotQt_getRotatorTrajectory();
};

#endif
