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

#ifndef CDSAtmpFH
#define CDSAtmpFH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <stdio.h>
#include <ADODB.hpp>
#include <DB.hpp>
#include <SyncObjs.hpp>
#include <ExtCtrls.hpp>
#include <jpeg.hpp>
#include <GIFimg.hpp>
//---------------------------------------------------------------------------
#include "ITSLibF.h"
#include "CDSItsObjectF.h"
//---------------------------------------------------------------------------

//---------------------------------------------------------------------------
class TCDSAtmp
{
public:
    TCDSAtmp();
    ~TCDSAtmp();

public:
	AnsiString ATMP_STTN_NMBR;  //	N	NUMBER(10)	N			측정소 번호
	AnsiString ATMP_STTN_NM;    //	N	VARCHAR2(30)	N			측정소 명
	AnsiString VMS_DISP_NM;     //	N	VARCHAR2(30)	N			VMS 표출명
	AnsiString DEL_YN;          //	N	CHAR(1)	Y	'N'		삭제 여부

public:
    bool       SUCCESS;

    AnsiString MSRM_DT;         //	N	VARCHAR2(14)	Y			측정 일시
    AnsiString MSRM_SYST_NM;    //	N	VARCHAR2(10)	Y			측정 시스템 명
    AnsiString SO2_VAL;         //	N	VARCHAR2(10)	Y			SO2 값
    AnsiString CO_VAL;          //	N	VARCHAR2(10)	Y			CO 값
    AnsiString NO2_VAL;         //	N	VARCHAR2(10)	Y			NO2 값
    AnsiString O3_VAL;          //	N	VARCHAR2(10)	Y			O3 값
    AnsiString PM10_VAL;        //	N	VARCHAR2(10)	Y			PM10 값
    AnsiString PM10_24HH_VAL;   //	N	VARCHAR2(10)	Y			PM10 24시간 값
    AnsiString PM25_VAL;        //	N	VARCHAR2(10)	Y			PM25 값
    AnsiString PM25_24HH_VAL;   //	N	VARCHAR2(10)	Y			PM25 24시간 값
    AnsiString INTG_ATMP_VAL;   //	N	VARCHAR2(10)	Y			통합 대기 값
    AnsiString INTG_ATMP_GRAD;  //	N	VARCHAR2(10)	Y			통합 대기 등급
    AnsiString SO2_GRAD;        //	N	VARCHAR2(10)	Y			SO2 등급
    AnsiString CO_GRAD;         //	N	VARCHAR2(10)	Y			CO 등급
    AnsiString O3_GRAD;         //	N	VARCHAR2(10)	Y			O3 드급
    AnsiString NO2_GRAD;        //	N	VARCHAR2(10)	Y			NO2 등급
    AnsiString PM10_24HH_GRAD;  //	N	VARCHAR2(10)	Y			PM10 24시간 등급
    AnsiString PM25_24HH_GRAD;  //	N	VARCHAR2(10)	Y			PM25 24시간 등급
    AnsiString PM10_1HH_GRAD;   //	N	VARCHAR2(10)	Y			PM10 1시간 등급
    AnsiString PM25_1HH_GRAD;   //	N	VARCHAR2(10)	Y			PM25 1시간 등급

    void Init();
    AnsiString GetPM10_VAL(bool AUnit=true);
    AnsiString GetPM10_GRAD();
    AnsiString GetPM25_VAL(bool AUnit=true);
    AnsiString GetPM25_GRAD();
    AnsiString GetATMP_VAL(bool AUnit=true);
    AnsiString GetATMP_GRAD();
    AnsiString GetO3_VAL(bool AUnit=true);
    AnsiString GetO3_GRAD();
    AnsiString GetGradeDesc(int AGrad);
    int GetPM10_CLR();
    int GetPM25_CLR();
    int GetATMP_CLR();
    int GetO3_CLR();
    int GetGradeColor(int AGrad);
};
//---------------------------------------------------------------------------

//---------------------------------------------------------------------------
class TCDSAtmpManager : public TCDSItsObject
{
public:
    TCDSAtmpManager();
    ~TCDSAtmpManager();

private:

public:
    TItsMap<AnsiString, TCDSAtmp*> FLists;

public:
    int LoadAtmpInfo(TADOConnection *ADbConn);
    int LoadAtmpRtPnstInfo(TADOConnection *ADbConn);
};
//---------------------------------------------------------------------------
extern TCDSAtmpManager *CDSAtmpManager;
//---------------------------------------------------------------------------

#endif
