// $Header: https://oberon.oapd.inaf.it/shins/trunk/shins/src/util/constants.h 3989 2022-07-06 16:55:20Z depa $

#ifndef _SHINS_CONSTANTS_
#define _SHINS_CONSTANTS_
// constants values used across SHINS.
// change these values, re-build SHINS.
namespace shins
{
namespace util
{
namespace constants
{
    const std::string motionCtrl    = "MOTION_CTRL";
    const std::string calunitCtrl   = "CALUNIT_CTRL";
    const std::string trackingCtrl  = "TRACKING_CTRL";
    const std::string tiptiltCtrl   = "TIPTILT_CTRL";
    ////////////////
    // SASHA CTRL //
    ////////////////
    const int sashaXMin = 1;
    const int sashaXMax = 2048;
    const int sashaYMin = 1;
    const int sashaYMax = 2048;
    //////////////////
    // TIPTILT_CTRL //
    //////////////////
    const float baseFreq                  = 106.25e+06;
    const float boardFreq                 = (baseFreq / 7.) * 4.;
    const float dspFreq                   = boardFreq * 4;

    // XML TAGS/DEVICE ALIASES
// motion
    const std::string APODIZER_W =      "APODIZER_W";
    const std::string CORO_SLIT_W =     "CORO_SLIT_W";
    const std::string DB_FILT_W =       "DB_FILT_W";
    const std::string LYOT_GRISM_W =    "LYOT_GRISM_W";
    const std::string ND_FILT_W =       "ND_FILT_W";
    const std::string SCI_FILT_W1 =     "SCI_FILT_W1";
    const std::string SCI_FILT_W2 =     "SCI_FILT_W2";
    const std::string INBEAM_DEP =      "INBEAM_DEP";
    const std::string INBEAM_TT =       "INBEAM_TT";
    const std::string PUPIL_LENS_DEP =  "PUPIL_LENS_DEP";
    const std::string SHUTTER =         "SHUTTER";
    // calibration
    const std::string CAL_MIRROR_DEP =  "CAL_MIRROR_DEP";
    const std::string CAL_FIBER_DEP =   "CAL_FIBER_DEP";
    const std::string CAL_FILTER_DEP =  "CAL_FILTER_DEP";
    // tracking
    const std::string DROT =            "DROT";
    const std::string ADC1 =            "ADC1";
    const std::string ADC2 =            "ADC2";

    const std::string INBEAM_TT_X     = "INBEAM_TT_X";
    const std::string INBEAM_TT_Y     = "INBEAM_TT_Y";
    const std::string CAL_FF_LAMP     = "CAL_FF_LAMP";
    const std::string CAL_FIBER_FOCUS_LAMP = "CAL_FIBER_FOCUS_LAMP";
    const std::string CAL_FIBER_DEFOCUS_LAMP = "CAL_FIBER_DEFOCUS_LAMP";
    ////////////////
    ////////////////
    ////////////////
    const std::string ADC_Mode       = "ADC_Mode";
    const std::string DROT_Mode      = "DROT_Mode";
    const std::string DROT_PosAng    = "DROT_PosAng";
    const std::string ADC1_PosAng    = "ADC1_PosAng";
    const std::string ADC2_PosAng    = "ADC2_PosAng";


    const std::string MaskComb       = "MaskComb";
    const std::string InstrumentMode = "InstrumentMode";


    ////////////////
    // TRACK_CTRL //
    ////////////////
    const double DROT_TIMEOUT = 142.0;  // sec
    const double DROT_HOME    = 0;      // steps
    const double ADCOFFSET    = 0.503;
    const double PSLOPE       = 6.3e-4; // arcsec/mbar
    const double PBIAS        = 733;    // mbar
    const double TSLOPE       = 1.8e-3; // arcsec/K
    const double TBIAS        = 273;    // K

    const double DEGREE       = 3.14159265358979/180;



    const std::string steps        = "STEPS";
    const std::string degree       = "DEGREE";
    const std::string mm           = "MM";
    const std::string micron       = "MICRON";
    const std::string arcsec       = "ARCSEC";
    const std::string degreemotor  = "DEGREEMOTOR";
    const std::string rad          = "RAD";
    const std::string absenc       = "ABSENC";
    const std::string default_unit = "DEFAULT";

    const std::string tilde        = " ~ ";

}
}

namespace flags
{
    enum sw_options
    {
        SAVE_INCOMING_SASHA_FILES = 1,
        SAVE_ONLY_EXPOSED_SASHA_FILES = 2,
        SEQDATA_FORCE_PROPERTY_SET = 4,
        FAST_SAVING_MODE = 8,
        DOUBLE_SASHA_TIMEOUTS = 16,
        TCS_SINGLE_SIDE_MODE = 1024,
        TT_CHECK_BCU_WRITE = 524288,
        TT_SAVE_RAW_DIAG_DATA = 1048576,
        TRACK_ADC_TEST0 = 1048576*2,
        TRACK_ADC_TEST1 = 1048576*4,
        TRACK_ADC_TEST2 = 1048576*8,
        TRACK_ADC_TEST3 = 1048576*16,
        SEQDATA_TEST01 = 1048576*32,
        UNUSED_SW_OPTION = -2147483648
    };
}
}


#endif
