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

#include <vcl.h>
#include "WindowMsgF.h"
#pragma hdrstop

#include "FrmInitializeF.h"

//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "cxContainer"
#pragma link "cxControls"
#pragma link "cxEdit"
#pragma link "cxGraphics"
#pragma link "cxLabel"
#pragma link "cxLookAndFeelPainters"
#pragma link "cxLookAndFeels"
#pragma link "cxProgressBar"
#pragma link "dxSkinBlack"
#pragma link "dxSkinBlue"
#pragma link "dxSkinCaramel"
#pragma link "dxSkinCoffee"
#pragma link "dxSkinDarkRoom"
#pragma link "dxSkinDarkSide"
#pragma link "dxSkinFoggy"
#pragma link "dxSkinGlassOceans"
#pragma link "dxSkiniMaginary"
#pragma link "dxSkinLilian"
#pragma link "dxSkinLiquidSky"
#pragma link "dxSkinLondonLiquidSky"
#pragma link "dxSkinMcSkin"
#pragma link "dxSkinMoneyTwins"
#pragma link "dxSkinOffice2007Black"
#pragma link "dxSkinOffice2007Blue"
#pragma link "dxSkinOffice2007Green"
#pragma link "dxSkinOffice2007Pink"
#pragma link "dxSkinOffice2007Silver"
#pragma link "dxSkinOffice2010Black"
#pragma link "dxSkinOffice2010Blue"
#pragma link "dxSkinsCore"
#pragma link "dxSkinSeven"
#pragma link "dxSkinSharp"
#pragma link "dxSkinSilver"
#pragma link "dxSkinStardust"
#pragma link "IdBaseComponent"
#pragma link "IdComponent"
#pragma link "IdExplicitTLSClientServerBase"
#pragma link "IdFTP"
#pragma link "IdTCPClient"
#pragma link "IdTCPConnection"
#pragma resource "*.dfm"

//TFrmInitialize *FrmInitialize = NULL;
//---------------------------------------------------------------------------
__fastcall TFrmInitialize::TFrmInitialize(TComponent* Owner)
    : TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TFrmInitialize::FormShow(TObject *Sender)
{
    Refresh();
    TmrShow->Enabled = true;
}
//---------------------------------------------------------------------------

void __fastcall TFrmInitialize::TmrShowTimer(TObject *Sender)
{
    TmrShow->Enabled = false;

    Application->ProcessMessages();
    cxProgressBar1->Properties->Max = 150;

    try
    {
        cxProgressBar1->Position = 5;
        LblStatus->Caption = "VMS 폼유형 로딩...";
        Application->ProcessMessages();
        if (!VmsFormTypeManager)
        {
            VmsFormTypeManager = new TVmsFormTypeManager();
            VmsFormTypeManager->Load();
        }

        cxProgressBar1->Position = 10;
        LblStatus->Caption = "VMS 크기유형 로딩...";
        Application->ProcessMessages();
        if (!VmsSizeTypeManager)
        {
            VmsSizeTypeManager = new TVmsSizeTypeManager();
            VmsSizeTypeManager->Load();
        }

        cxProgressBar1->Position = 20;
        LblStatus->Caption = "VMS 폰트정보 로딩...";
        Application->ProcessMessages();
        if (!VmsFontNameManager)
        {
            VmsFontNameManager = new TVmsFontNameManager();
            VmsFontNameManager->Load();
        }

        cxProgressBar1->Position = 30;
        LblStatus->Caption = "VMS 폰트색상 로딩...";
        Application->ProcessMessages();
        if (!VmsFontColrManager)
        {
            VmsFontColrManager = new TVmsFontColrManager();
            VmsFontColrManager->Load();
        }

        cxProgressBar1->Position = 40;
        LblStatus->Caption = "VMS 표출방법 로딩...";
        Application->ProcessMessages();
        if (!VmsDsplMthdManager)
        {
            VmsDsplMthdManager = new TVmsDsplMthdManager();
            VmsDsplMthdManager->Load();
        }

        cxProgressBar1->Position = 50;
        LblStatus->Caption = "VMS 표출방향 로딩...";
        Application->ProcessMessages();
        if (!VmsDsplDrctManager)
        {
            VmsDsplDrctManager = new TVmsDsplDrctManager();
            VmsDsplDrctManager->Load();
        }

        cxProgressBar1->Position = 60;
        LblStatus->Caption = "VMS 폼 객체정보 로딩...";
        Application->ProcessMessages();
        if (!VmsFormObjTypeManager)
        {
            VmsFormObjTypeManager = new TVmsFormObjTypeManager();
            VmsFormObjTypeManager->Load();
        }

        cxProgressBar1->Position = 70;
        LblStatus->Caption = "VMS 정보제공구간 로딩...";
        Application->ProcessMessages();
        if (!VmsIfscManager)
        {
            VmsIfscManager = new TVmsIfscManager();
            VmsIfscManager->Load();
        }

        cxProgressBar1->Position = 80;
        //LblStatus->Caption = "주차장 정보 로딩...";
        Application->ProcessMessages();
        if (!CDSParkManager)
        {
            CDSParkManager = new TCDSParkManager();
            //CDSAtmpManager->Load();
        }

        cxProgressBar1->Position = 100;
        //LblStatus->Caption = "대기환경 정보 로딩...";
        Application->ProcessMessages();
        if (!CDSAtmpManager)
        {
            CDSAtmpManager = new TCDSAtmpManager();
            //CDSAtmpManager->Load();
        }

    }
    catch(...)
    {
    }

    Close();
}
//---------------------------------------------------------------------------
void __fastcall TFrmInitialize::FormClose(TObject *Sender, TCloseAction &Action)
{
    Action = caFree;
}
//---------------------------------------------------------------------------

