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

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

#include "WindowMsgF.h"

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

//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "FRAME_IncidentAutoListF"
#pragma link "cxContainer"
#pragma link "cxControls"
#pragma link "cxEdit"
#pragma link "cxGraphics"
#pragma link "cxLabel"
#pragma link "cxLookAndFeelPainters"
#pragma link "cxLookAndFeels"
#pragma link "dxSkinBlack"
#pragma link "dxSkinBlue"
#pragma link "dxSkinsCore"
#pragma link "dxSkinMcSkin"
#pragma resource "*.dfm"
TFrmIncidentAlarm *FrmIncidentAlarm = NULL;
//---------------------------------------------------------------------------
__fastcall TFrmIncidentAlarm::TFrmIncidentAlarm(TComponent* Owner)
    : TForm(Owner)
{
Width = 920;
Height= 170;
int nHeight = Height;
int nWidth  = Width;

    LangTrans->Translate(this, ITSDb_GetConnection());
    ITSSkin_Load(this);
    CMM_LoadForm(g_sFormsDir, this);

    Caption = lblCaption->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();
}
//---------------------------------------------------------------------------

