// Output.h: interface for the COutput class.
//
//////////////////////////////////////////////////////////////////////
#pragma once

#include "OutputBase.h"

#include "HardwareIni.h"

#ifdef BUILD_IODLL
#define IODLLCLASS __declspec(dllexport)
#else
#define IODLLCLASS __declspec(dllimport)
#endif

class IODLLCLASS COutputSetting
{
public:
    std::string m_strName;
    std::string m_strModuleName;
    BOOL        m_bLogic{ FALSE };
    int         m_nPointNo{ 0 };
    int         m_nSlaveID{ 0 };
    int         m_nPtrNo{ 0 };
    int         m_nBoardType{ 0 };
    BOOL        m_bEnableCheck{ FALSE };
    int         m_nCardNo{ 0 };
};

class IODLLCLASS COutput : public CCard
{
public:
    COutput(const COutputSetting& Setting);
    virtual ~COutput();

    // dRange = -10 for 0-10V output
    // dRange = 10 for -10-0V output
    BOOL SetVoltage(double dVoltage, double dRange);

    BOOL Off(void);
    BOOL On(void);
    BOOL IsOff(void);
    BOOL IsOn(void);

    BOOL operator=(const BOOL bState);
    BOOL operator==(const BOOL bState);
    BOOL operator!=(const BOOL bState);

private:
    CMutex       m_OutputMutex;
    COutputBase* m_outputBase;
};
