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

#include <vcl.h>
#include "ITSSkinF.h"
#include "ITSUtilF.h"
#include "ITSDbF.h"
#include "AppGlobalF.h"
#pragma hdrstop

#include "WindowMsgF.h"

#include "FrmIncidentAlarmF.h"
#include "FrmLinkGradeSetF.h"
#include "CDSNodeF.h"
#include "CDSLinkF.h"
#include "CDSServiceLinkF.h"
#include "CDSRoadF.h"
#include "CDSTrafficGradeF.h"

//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "cxButtons"
#pragma link "cxCalc"
#pragma link "cxClasses"
#pragma link "cxContainer"
#pragma link "cxControls"
#pragma link "cxCustomData"
#pragma link "cxData"
#pragma link "cxDataStorage"
#pragma link "cxEdit"
#pragma link "cxFilter"
#pragma link "cxGraphics"
#pragma link "cxGrid"
#pragma link "cxGridCustomTableView"
#pragma link "cxGridCustomView"
#pragma link "cxGridLevel"
#pragma link "cxGridTableView"
#pragma link "cxGroupBox"
#pragma link "cxLabel"
#pragma link "cxLookAndFeelPainters"
#pragma link "cxLookAndFeels"
#pragma link "cxStyles"
#pragma link "cxTextEdit"
#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 "dxSkinOffice2010Silver"
#pragma link "dxSkinsCore"
#pragma link "dxSkinscxPCPainter"
#pragma link "dxSkinSeven"
#pragma link "dxSkinSharp"
#pragma link "dxSkinSilver"
#pragma link "dxSkinStardust"
#pragma link "FRAME_IncidentAutoListF"
#pragma resource "*.dfm"
TFrmIncidentAlarm *FrmIncidentAlarm = NULL;
//---------------------------------------------------------------------------
__fastcall TFrmIncidentAlarm::TFrmIncidentAlarm(TComponent* Owner)
    : TForm(Owner)
{
Width = 920;
Height= 170;
int nHeight = Height;
int nWidth  = Width;

    ITSSkin_Load(this);
    CMM_LoadForm(g_sFormsDir, this);
//Height = nHeight;
//Width  = nWidth;

    Caption = "  시스템 자동돌발 알람";
    m_sLinkId    = "";
    m_nLinkLevel = 0;
}
//---------------------------------------------------------------------------

void __fastcall TFrmIncidentAlarm::FormClose(TObject *Sender, TCloseAction &Action)
{
    TmrTimeOut->Enabled = false;
    try
    {
        CMM_SaveForm(g_sFormsDir, this);
    }
    catch(...)
    {
    }
    Action = caFree;
    FrmIncidentAlarm = NULL;
}
//---------------------------------------------------------------------------

void __fastcall TFrmIncidentAlarm::ShowIncidentAlarm()
{
    TmrTimeOut->Enabled = false;

    FRAMEIncidentAutoList1->UpdateList();

    TmrTimeOut->Interval = g_AppCfg.Incident.TimeOut * 1000;
    TmrTimeOut->Enabled = true;
}
//---------------------------------------------------------------------------

void __fastcall TFrmIncidentAlarm::TmrTimeOutTimer(TObject *Sender)
{
    TmrTimeOut->Enabled = false;
    Close();
}
//---------------------------------------------------------------------------

