//---------------------------------------------------------------------------

#ifndef CDSObjectFH
#define CDSObjectFH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include "ITSLibF.h"
//---------------------------------------------------------------------------
class TCDSObject
{
public:
    TCDSObject();
    ~TCDSObject();

private:
    //CRITICAL_SECTION    FCS;

    bool    FCompleted;
    int     FEditMode;
	int     FGridIndex;
    String  FMEM_DEL;

    String  FCTLR_NMBR;          //	N	NUMBER(10)	    N			VMS 제어기 번호
    String  FCTLR_ID;            //	N	VARCHAR2(10)	Y			VMS 제어기 ID
    String  FNAME;               //	N	VARCHAR2(40)	Y			VMS 명칭
    String  FCTLR_IP;            //	N	VARCHAR2(20)	Y			VMS 제어기 아이피
    int     FCTLR_PORT;          //	N	NUMBER(5)	    Y	0		VMS 제어기 포트
    int     FCTLR_LOCAL_NO;      //	N	NUMBER(5)	    Y	0		VMS 제어기 지역번호
    String  FTYPE_CD;            //	N	VARCHAR2(7)	    Y			VMS 유형 코드
    String  FISTL_LCTN_NM;       //	N	VARCHAR2(40)	Y			설치 위치 명
    String  FISTL_LCTN_ADDR;     //	N	VARCHAR2(200)	Y			설치 위치 주소
    double  FX_CRDN;             //	N	NUMBER(11,8)	Y			X 좌표
    double  FY_CRDN;             //	N	NUMBER(10,8)	Y			Y 좌표
    String  FDEL_YN;             //	N	CHAR(1)	        Y	'N'		삭제 여부
    void   *FFData1;
    void   *FFData2;
    void   *FFData3;

public:
    void Lock();
    void UnLock();

    String  STRM_ADDR;
    String  FULL_STRM_ADDR;

public:
    __property bool   Completed      = { read = FCompleted,      write = FCompleted      };
	__property int    EditMode       = { read = FEditMode,       write = FEditMode       };
	__property int    GridIndex      = { read = FGridIndex,      write = FGridIndex      };
	__property String MEM_DEL        = { read = FMEM_DEL,        write = FMEM_DEL        };
    __property String CTLR_NMBR      = { read = FCTLR_NMBR,      write = FCTLR_NMBR      };
    __property String CTLR_ID        = { read = FCTLR_ID,        write = FCTLR_ID        };
    __property String NAME           = { read = FNAME,           write = FNAME           };
    __property String CTLR_IP        = { read = FCTLR_IP,        write = FCTLR_IP        };
    __property int    CTLR_PORT      = { read = FCTLR_PORT,      write = FCTLR_PORT      };
    __property int    CTLR_LOCAL_NO  = { read = FCTLR_LOCAL_NO,  write = FCTLR_LOCAL_NO  };
    __property String TYPE_CD        = { read = FTYPE_CD,        write = FTYPE_CD        };
    __property String ISTL_LCTN_NM   = { read = FISTL_LCTN_NM,   write = FISTL_LCTN_NM   };
    __property String ISTL_LCTN_ADDR = { read = FISTL_LCTN_ADDR, write = FISTL_LCTN_ADDR };
    __property double X_CRDN         = { read = FX_CRDN,         write = FX_CRDN         };
    __property double Y_CRDN         = { read = FY_CRDN,         write = FY_CRDN         };
    __property String DEL_YN         = { read = FDEL_YN,         write = FDEL_YN         };
    __property void*  FData1         = { read = FFData1,         write = FFData1         };
    __property void*  FData2         = { read = FFData2,         write = FFData2         };
    __property void*  FData3         = { read = FFData3,         write = FFData3         };
};
//---------------------------------------------------------------------------

class TCDSTraffic
{
public:
    TCDSTraffic();
    virtual ~TCDSTraffic();

private:

public:
    String PRCN_DT;        // VARCHAR2(14 BYTE),                                '가공 일시';
    int    TFVL;           // NUMBER(6)                       DEFAULT 0,        '교통량';
    int    SPED;           // NUMBER(3)                       DEFAULT 0,        '속도';
    float  OCPY_RATE;      // NUMBER(5,2)                     DEFAULT 0,        '점유 율';
    int    TRVL_HH;        // NUMBER(6)                       DEFAULT 0,        '통행 시간';
    String CMTR_GRAD_CD;   // VARCHAR2(7 BYTE)                DEFAULT NULL,     '소통 등급 코드';

    String MISSING;
    String LASTANS;
    String MPRCN_DT;
    int    DATA_NUM;       // NUMBER(4)                       DEFAULT 0         '데이터 개수';

    int    PTRN_SPED;      // NUMBER(3)                       DEFAULT 0,        '패턴 속도';

    int    PRCN_SPED;      // NUMBER(3)                       DEFAULT 0,        '가공 속도';
    int    SMTH_SPED;      // NUMBER(3)                       DEFAULT 0,        '평활화 속도';
    int    ADJS_SPED;      // NUMBER(3)                       DEFAULT 0,        '보정 속도';
    String PRCN_SORC;      // VARCHAR2(7 BYTE)                DEFAULT NULL,     '가공 소스';
    String ADJS_SORC;      // VARCHAR2(7 BYTE)                DEFAULT NULL,     '보정 소스';
    String MISS_YN;        // CHAR(1 BYTE)                    DEFAULT 'N',      '결측 여부';

    int    TRAF_GRAD;

public:
    void InitTraffic();

};
//---------------------------------------------------------------------------
class TTrafficVal
{
public:
    TTrafficVal()  {};
    ~TTrafficVal() {};

private:

public:
    String  ID;
    String	GRADE;
    int     GRADE_VAL;
    bool    IsUpdate;
};
//---------------------------------------------------------------------------

/*
* Traffic Manager
*/
class TTrafficValManager
{
public:
    TTrafficValManager()
    {
    }
    ~TTrafficValManager()
    {
        FLists.RemoveAll();
    }

public:
    TItsMap<String, TTrafficVal*>   FLists;
};
//---------------------------------------------------------------------------

#endif
