#ifndef __BASEDEVICE_H__
#define __BASEDEVICE_H__

#include"pmc_types.h"
#include"DeviceAttribute.h"

using namespace std;
typedef enum{OffLine,OnLine,Waring,Error} DeviceStatus;
class BaseDevice{
    private:
        PMCBOOL _hasAlarm=FALSE;
    public:
        char className[SHORT_NAME_LEN];
        char name[SHORT_NAME_LEN];
        char module[SHORT_NAME_LEN];
        char displayName[MAX_NAME_LEN];
        PMCBOOL isInstalled;
        DeviceStatus status=OffLine;
        //char alarmText[MAX_CONTEXT_LEN];
        
    public:
        PMCBOOL hasAlarm;
        void clear();
        void addDevice();
    public:
        //设备的构造函数在初始化时执行，不能依赖于任何SC配置
        BaseDevice(const char* className, const char* name, const char* module);
        virtual void monitor(){}
        virtual void reset(){}
        virtual void terminate(){}
        //设备的initialize由Module调用，通常在SC配置加载完成之后
        virtual void initialize(){}

};
//TODO:Please delete these test codes
#include"TestDef.h"
extern M_AI m_AI;
extern M_AO m_AO;
extern M_NDI m_NDI;
extern M_NDO m_NDO;
extern M_SDI m_SDI;
extern M_SDO m_SDO;

#endif
