123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797 |
- //---------------------------------------------------------------------------
- #include <vcl.h>
- #include "ITSSkinF.h"
- #include "ITSUtilF.h"
- #include "WindowMsgF.h"
- #include "AppGlobalF.h"
- #include "ITSSEL1MF.h"
- #include "ITSSELAMF.h"
- #include "CDSLinkF.h"
- #include "CDSNodeF.h"
- #include "ITSLangTransF.h"
- #pragma hdrstop
- #include "FRAME_IncidentProcessF.h"
- #include "FrmIncidVmsInfoF.h"
- #include "ITS00MAPF.h"
- //---------------------------------------------------------------------------
- #pragma package(smart_init)
- #pragma link "cxButtons"
- #pragma link "cxCalc"
- #pragma link "cxCalendar"
- #pragma link "cxCheckBox"
- #pragma link "cxClasses"
- #pragma link "cxContainer"
- #pragma link "cxControls"
- #pragma link "cxCustomData"
- #pragma link "cxData"
- #pragma link "cxDataStorage"
- #pragma link "cxDropDownEdit"
- #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 "cxMaskEdit"
- #pragma link "cxSpinEdit"
- #pragma link "cxSplitter"
- #pragma link "cxStyles"
- #pragma link "cxTextEdit"
- #pragma link "dxGDIPlusClasses"
- #pragma link "dxSkinBlack"
- #pragma link "dxSkinBlue"
- #pragma link "dxSkinsCore"
- #pragma link "dxSkinscxPCPainter"
- #pragma resource "*.dfm"
- TFRAMEIncidentProcess *FRAMEIncidentProcess;
- //---------------------------------------------------------------------------
- __fastcall TFRAMEIncidentProcess::TFRAMEIncidentProcess(TComponent* Owner)
- : TFrame(Owner)
- {
- LangTrans->Translate(this, ITSDb_GetConnection());
- ITSSkin_Load((TForm*)this);
- FTitle = Caption;//"돌발 진행상황 처리";
- FOcrrType = 0;
- FLinkId = "";
- FINCD_OCRR_ID = "";
- TvList->OptionsView->NoDataToDisplayInfoText = FrmLang->lblNoInfo->Caption;//"<등록된 돌발정보가 없습니다>";
- FCodeIST = ItsCodeManager->FLists.Find("IST"); //돌발상황 원본 코드 : IST
- FCodeLTCU = ItsCodeManager->FLists.Find("LTCU"); //소통 등급 코드 : LTCU
- FCodeICM = ItsCodeManager->FLists.Find("ICM"); //돌발상황 확인 방법 코드 : ICM
- FCodeIDTU = ItsCodeManager->FLists.Find("IDTU"); //돌발상황 유형 분류 코드 : IDTU
- FCodeACTU = ItsCodeManager->FLists.Find("ACTU"); //돌발상황 유형 코드 : ACTU, CRTU, EVTU, WETU 중 하나
- FCodeCRTU = ItsCodeManager->FLists.Find("CRTU"); //돌발상황 유형 코드 : ACTU, CRTU, EVTU, WETU 중 하나
- FCodeEVTU = ItsCodeManager->FLists.Find("EVTU"); //돌발상황 유형 코드 : ACTU, CRTU, EVTU, WETU 중 하나
- FCodeWETU = ItsCodeManager->FLists.Find("WETU"); //돌발상황 유형 코드 : ACTU, CRTU, EVTU, WETU 중 하나
- FCodeSRLU = ItsCodeManager->FLists.Find("SRLU"); //돌발상황 심각도 코드 : SRLU
- FCodePRTU = ItsCodeManager->FLists.Find("PRTU"); //통행 제한 유형 코드 : PRTU
- FCodeRSL = ItsCodeManager->FLists.Find("RSL"); //대응 수준 코드 : RSL
- FCodeISS = ItsCodeManager->FLists.Find("ISS"); //돌발상황 진행 단계 코드 : ISS
- FCodeICM = ItsCodeManager->FLists.Find("ICM"); //돌발상황 종료 확인 방법 코드 : ICM
- FCodeDFW = ItsCodeManager->FLists.Find("DFW"); //기상 코드 : DFW
- FCodeVIT = ItsCodeManager->FLists.Find("VIT"); //VMS 돌발 유형 코드 : VIT
- FCodeIDT = ItsCodeManager->FLists.Find("IDT"); //VMS 돌발 유형 세부 코드 : IDT
- FCodeEDT = ItsCodeManager->FLists.Find("EDT"); //VMS 돌발 유형 세부 코드 : EDT
- FCodeVRT = ItsCodeManager->FLists.Find("VRT"); //VMS 돌발 통제 코드 : VRT
- InitForm();
- }
- //---------------------------------------------------------------------------
- void __fastcall TFRAMEIncidentProcess::InitForm()
- {
- FSelLink.nSelLink = 0;
- for(int ii = 0; ii < MAX_INCLINK; ii++)
- {
- FSelLink.info[ii].sIncidentId = "";
- FSelLink.info[ii].sLinkId = "";
- FSelLink.info[ii].FPosX = 0;
- FSelLink.info[ii].FPosY = 0;
- }
- DtINCD_STRT_DT->Date = Now();
- DtINCD_END_PRAR_DT->Date = Now() + ( 1 / 24 );
- CbINCD_ORGN_CD->Properties->Items->Clear();
- if (FCodeIST)
- {
- FOR_STL(TItsSubCode *, pSubCode, FCodeIST->FSubLists)
- {
- if (pSubCode->USE_YN == "N") continue;
- CbINCD_ORGN_CD->Properties->Items->Add(" [" + pSubCode->CMMN_CD + "] " + pSubCode->CMMN_CD_KOR_NM);
- }
- }
- CbINCD_ORGN_CD->ItemIndex = 0;
- CbCMTR_GRAD_CD->Properties->Items->Clear();
- if (FCodeLTCU)
- {
- FOR_STL(TItsSubCode *, pSubCode, FCodeLTCU->FSubLists)
- {
- if (pSubCode->USE_YN == "N") continue;
- CbCMTR_GRAD_CD->Properties->Items->Add(" [" + pSubCode->CMMN_CD + "] " + pSubCode->CMMN_CD_KOR_NM);
- }
- }
- CbCMTR_GRAD_CD->ItemIndex = 0;
- CbINCD_CNFM_MTHD_CD->Properties->Items->Clear();
- if (FCodeICM)
- {
- FOR_STL(TItsSubCode *, pSubCode, FCodeICM->FSubLists)
- {
- if (pSubCode->USE_YN == "N") continue;
- CbINCD_CNFM_MTHD_CD->Properties->Items->Add(" [" + pSubCode->CMMN_CD + "] " + pSubCode->CMMN_CD_KOR_NM);
- }
- }
- CbINCD_CNFM_MTHD_CD->ItemIndex = 0;
- CbINCD_SERN_CD->Properties->Items->Clear();
- if (FCodeSRLU)
- {
- FOR_STL(TItsSubCode *, pSubCode, FCodeSRLU->FSubLists)
- {
- if (pSubCode->USE_YN == "N") continue;
- CbINCD_SERN_CD->Properties->Items->Add(" [" + pSubCode->CMMN_CD + "] " + pSubCode->CMMN_CD_KOR_NM);
- }
- }
- CbINCD_SERN_CD->ItemIndex = 0;
- CbINCD_TYPE_CLSF_CD->Properties->Items->Clear();
- if (FCodeIDTU)
- {
- FOR_STL(TItsSubCode *, pSubCode, FCodeIDTU->FSubLists)
- {
- if (pSubCode->USE_YN == "N") continue;
- CbINCD_TYPE_CLSF_CD->Properties->Items->Add(" [" + pSubCode->CMMN_CD + "] " + pSubCode->CMMN_CD_KOR_NM);
- }
- }
- CbINCD_TYPE_CLSF_CD->ItemIndex = 0;
- CbINCD_TYPE_CLSF_CDClick((TObject *)CbINCD_TYPE_CLSF_CD);
- #if 0
- if (FCodeACTU)
- {
- FOR_STL(TItsSubCode *, pSubCode , FCodeACTU->FSubLists)
- {
- if (pSubCode->USE_YN == "N") continue;
- CbINCD_TYPE_CD->Properties->Items->Add( " [" + pSubCode->CMMN_CD + "] " + pSubCode->CMMN_CD_KOR_NM);
- }
- }
- if (FCodeCRTU)
- {
- FOR_STL(TItsSubCode *, pSubCode , FCodeCRTU->FSubLists)
- {
- if (pSubCode->USE_YN == "N") continue;
- CbINCD_TYPE_CD->Properties->Items->Add( " [" + pSubCode->CMMN_CD + "] " + pSubCode->CMMN_CD_KOR_NM);
- }
- }
- if (FCodeEVTU)
- {
- FOR_STL(TItsSubCode *, pSubCode , FCodeEVTU->FSubLists)
- {
- if (pSubCode->USE_YN == "N") continue;
- CbINCD_TYPE_CD->Properties->Items->Add( " [" + pSubCode->CMMN_CD + "] " + pSubCode->CMMN_CD_KOR_NM);
- }
- }
- if (FCodeWETU)
- {
- FOR_STL(TItsSubCode *, pSubCode , FCodeWETU->FSubLists)
- {
- if (pSubCode->USE_YN == "N") continue;
- CbINCD_TYPE_CD->Properties->Items->Add( " [" + pSubCode->CMMN_CD + "] " + pSubCode->CMMN_CD_KOR_NM);
- }
- }
- #endif
- //통행 제한 유형 코드 : PRTU
- if (FCodePRTU)
- {
- FOR_STL(TItsSubCode *, pSubCode , FCodePRTU->FSubLists)
- {
- if (pSubCode->USE_YN == "N") continue;
- CbTRVL_LMNT_TYPE_CD->Properties->Items->Add( " [" + pSubCode->CMMN_CD + "] " + pSubCode->CMMN_CD_KOR_NM);
- }
- }
- //대응 수준 코드 : RSL
- if (FCodeRSL)
- {
- FOR_STL(TItsSubCode *, pSubCode , FCodeRSL->FSubLists)
- {
- if (pSubCode->USE_YN == "N") continue;
- CbRESP_LVL_CD->Properties->Items->Add( " [" + pSubCode->CMMN_CD + "] " + pSubCode->CMMN_CD_KOR_NM);
- }
- }
- //기상 코드 : DFW
- if (FCodeDFW)
- {
- FOR_STL(TItsSubCode *, pSubCode , FCodeDFW->FSubLists)
- {
- if (pSubCode->USE_YN == "N") continue;
- CbWTHR_CD->Properties->Items->Add( " [" + pSubCode->CMMN_CD + "] " + pSubCode->CMMN_CD_KOR_NM);
- }
- }
- //VMS 돌발 유형 코드 : VIT
- if (FCodeVIT)
- {
- FOR_STL(TItsSubCode *, pSubCode , FCodeVIT->FSubLists)
- {
- if (pSubCode->USE_YN == "N") continue;
- CbVMS_INCD_TYPE_CD->Properties->Items->Add( " [" + pSubCode->CMMN_CD + "] " + pSubCode->CMMN_CD_KOR_NM);
- }
- }
- //VMS 돌발 통제 코드 : VRT
- if (FCodeVRT)
- {
- FOR_STL(TItsSubCode *, pSubCode , FCodeVRT->FSubLists)
- {
- if (pSubCode->USE_YN == "N") continue;
- CbVMS_INCD_RSTR_TYPE_CD->Properties->Items->Add( " [" + pSubCode->CMMN_CD + "] " + pSubCode->CMMN_CD_KOR_NM);
- }
- }
- }
- //---------------------------------------------------------------------------
- void __fastcall TFRAMEIncidentProcess::InitScreen()
- {
- FSelLink.nSelLink = 0;
- for(int ii = 0; ii < MAX_INCLINK; ii++)
- {
- FSelLink.info[ii].sIncidentId = "";
- FSelLink.info[ii].sLinkId = "";
- FSelLink.info[ii].FPosX = 0;
- FSelLink.info[ii].FPosY = 0;
- }
- EdINCD_OCRR_ID->Text = "";
- EdRGST_DT->Text = "";
- EdRegDt->Text = "";
- CbINCD_ORGN_CD->Text = "";
- EdOCRR_LCTN_NM->Text = "";
- EdLINK_ID->Text = "";
- EdLinkId->Text = "";
- SePosX->Value = 0;
- SePosY->Value = 0;
- EdINCD_EXPL->Text = "";
- CbCMTR_GRAD_CD->Text = "";
- EdIFMR_NM->Text = "";
- CbINCD_CNFM_MTHD_CD->Text = "";
- CbINCD_SERN_CD->Text = "";
- EdINCD_TITL->Text = "";
- CbINCD_TYPE_CLSF_CD->Text = "";
- CbINCD_TYPE_CD->Text = "";
- DtINCD_STRT_DT->Date = Now();
- DtINCD_END_PRAR_DT->Date = Now();
- ChkINCD_OCRR_LANE_Extra->Checked = false;
- ChkINCD_OCRR_LANE_1->Checked = false;
- ChkINCD_OCRR_LANE_2->Checked = false;
- ChkINCD_OCRR_LANE_3->Checked = false;
- ChkINCD_OCRR_LANE_4->Checked = false;
- ChkINCD_OCRR_LANE_5->Checked = false;
- ChkINCD_CLSR_LANE_Extra->Checked = false;
- ChkINCD_CLSR_LANE_1->Checked = false;
- ChkINCD_CLSR_LANE_2->Checked = false;
- ChkINCD_CLSR_LANE_3->Checked = false;
- ChkINCD_CLSR_LANE_4->Checked = false;
- ChkINCD_CLSR_LANE_5->Checked = false;
- SeDELY_LNGT->Value = 0;
- SeINCD_LNGT->Value = 0;
- SeSMLT_VHCL_UNUM->Value = 0;
- SeMDLT_VHCL_UNUM->Value = 0;
- SeINJR_PNUM->Value = 0;
- SeFTLT_PNUM->Value = 0;
- CbWTHR_CD->Text = "";
- CbRESP_LVL_CD->Text = "";
- if (ChkUTIS_CNCT_YN->Enabled) ChkUTIS_CNCT_YN->Checked = false;
- ChkTRUB_VHCL_YN->Checked = false;
- ChkFALT_YN->Checked = false;
- ChkFRWT_YN->Checked = false;
- CbTRVL_LMNT_TYPE_CD->Text = "";
- ChkVMS_DSPL_YN->Checked = false;
- EdSTRT_LCTN_NM->Text = "";
- EdEND_LCTN_NM->Text = "";
- CbVMS_INCD_TYPE_CD->Text = "";
- CbVMS_INCD_DETL_TYPE_CD->Text = "";
- #ifdef YONGIN_INC
- CbVMS_INCD_RSTR_TYPE_CD->Text = "";
- #endif
- }
- //---------------------------------------------------------------------------
- void __fastcall TFRAMEIncidentProcess::UpdateList()
- {
- InitScreen();
- TItsSubCode *pSubCode;
- CMM_ClearGridTableView(TvList);
- TcxDataController *pGDC = TvList->DataController;
- int nRow = 0;
- try
- {
- TvList->BeginUpdate();
- try
- {
- ItsIncidentManager->FLists.Lock();
- FOR_STL(TItsIncident *, pObj, ItsIncidentManager->FLists)
- {
- #if 0
- if (pObj->INCD_PRGR_STEP_CD != "ISS1" &&
- pObj->INCD_PRGR_STEP_CD != "ISS2") continue;
- #else
- if (pObj->INCD_PRGR_STEP_CD != "ISS2") continue;
- #endif
- nRow = pGDC->AppendRecord();
- String sIST = "";
- if (pObj->INCD_ORGN_CD != "") sIST = " [" + pObj->INCD_ORGN_CD + "] ";
- String sLTCU= "";
- if (pObj->CMTR_GRAD_CD != "") sLTCU = " [" + pObj->CMTR_GRAD_CD + "] ";
- String sICM = "";
- if (pObj->INCD_CNFM_MTHD_CD != "") sICM = " [" + pObj->INCD_CNFM_MTHD_CD + "] ";
- String sSRLU= "";
- if (pObj->INCD_SERN_CD != "") sSRLU = " [" + pObj->INCD_SERN_CD + "] ";
- String sIDTU = "";
- if (pObj->INCD_TYPE_CLSF_CD != "") sIDTU = " [" + pObj->INCD_TYPE_CLSF_CD + "] ";
- String sACTU = "";
- if (pObj->INCD_TYPE_CD != "") sACTU = " [" + pObj->INCD_TYPE_CD + "] ";
- String sISS = "";
- if (pObj->INCD_PRGR_STEP_CD != "") sISS = " [" + pObj->INCD_PRGR_STEP_CD + "] ";
- String sDFW = "";
- if (pObj->WTHR_CD != "") sDFW = " [" + pObj->WTHR_CD + "] ";
- String sRSL = "";
- if (pObj->RESP_LVL_CD != "") sRSL = " [" + pObj->RESP_LVL_CD + "] ";
- String sPRTU = "";
- if (pObj->TRVL_LMNT_TYPE_CD != "") sPRTU = " [" + pObj->TRVL_LMNT_TYPE_CD + "] ";
- if (FCodeIST)
- {
- pSubCode = FCodeIST->FSubLists.Find(pObj->INCD_ORGN_CD);
- if (pSubCode) sIST = sIST + pSubCode->CMMN_CD_KOR_NM;
- }
- if (FCodeLTCU)
- {
- pSubCode = FCodeLTCU->FSubLists.Find(pObj->CMTR_GRAD_CD);
- if (pSubCode) sLTCU = sLTCU + pSubCode->CMMN_CD_KOR_NM;
- }
- if (FCodeICM)
- {
- pSubCode = FCodeICM->FSubLists.Find(pObj->INCD_CNFM_MTHD_CD);
- if (pSubCode) sICM = sICM + pSubCode->CMMN_CD_KOR_NM;
- }
- if (FCodeSRLU)
- {
- pSubCode = FCodeSRLU->FSubLists.Find(pObj->INCD_SERN_CD);
- if (pSubCode) sSRLU = sSRLU + pSubCode->CMMN_CD_KOR_NM;
- }
- if (FCodeIDTU)
- {
- pSubCode = FCodeIDTU->FSubLists.Find(pObj->INCD_TYPE_CLSF_CD);
- if (pSubCode) sIDTU = sIDTU + pSubCode->CMMN_CD_KOR_NM;
- }
- if (!pObj->INCD_TYPE_CLSF_CD.IsEmpty() && !pObj->INCD_TYPE_CD.IsEmpty())
- {
- if (pObj->INCD_TYPE_CLSF_CD == "1")
- {
- if (FCodeACTU)
- {
- pSubCode = FCodeACTU->FSubLists.Find(pObj->INCD_TYPE_CD);
- if (pSubCode) sACTU = sACTU + pSubCode->CMMN_CD_KOR_NM;
- }
- }
- else if (pObj->INCD_TYPE_CLSF_CD == "2")
- {
- if (FCodeCRTU)
- {
- pSubCode = FCodeCRTU->FSubLists.Find(pObj->INCD_TYPE_CD);
- if (pSubCode) sACTU = sACTU + pSubCode->CMMN_CD_KOR_NM;
- }
- }
- else if (pObj->INCD_TYPE_CLSF_CD == "3")
- {
- if (FCodeEVTU)
- {
- pSubCode = FCodeEVTU->FSubLists.Find(pObj->INCD_TYPE_CD);
- if (pSubCode) sACTU = sACTU + pSubCode->CMMN_CD_KOR_NM;
- }
- }
- else if (pObj->INCD_TYPE_CLSF_CD == "4")
- {
- if (FCodeWETU)
- {
- pSubCode = FCodeWETU->FSubLists.Find(pObj->INCD_TYPE_CD);
- if (pSubCode) sACTU = sACTU + pSubCode->CMMN_CD_KOR_NM;
- }
- }
- }
- if (FCodeISS)
- {
- pSubCode = FCodeISS->FSubLists.Find(pObj->INCD_PRGR_STEP_CD);
- if (pSubCode) sISS = sISS + pSubCode->CMMN_CD_KOR_NM;
- }
- if (FCodeDFW)
- {
- pSubCode = FCodeISS->FSubLists.Find(pObj->WTHR_CD);
- if (pSubCode) sDFW = sDFW + pSubCode->CMMN_CD_KOR_NM;
- }
- if (FCodeRSL)
- {
- pSubCode = FCodeRSL->FSubLists.Find(pObj->RESP_LVL_CD);
- if (pSubCode) sRSL = sRSL + pSubCode->CMMN_CD_KOR_NM;
- }
- if (FCodePRTU)
- {
- pSubCode = FCodePRTU->FSubLists.Find(pObj->TRVL_LMNT_TYPE_CD);
- if (pSubCode) sPRTU = sPRTU + pSubCode->CMMN_CD_KOR_NM;
- }
- pGDC->Values[nRow][Column01->Index] = pObj->INCD_OCRR_ID; //돌발상황 발생 ID
- pGDC->Values[nRow][Column02->Index] = ITSUtil_StrToTime(pObj->RGST_DT); //등록 일시
- pGDC->Values[nRow][Column03->Index] = sISS;//pObj->INCD_PRGR_STEP_CD; //돌발상황 진행 단계 코드 : ISS
- pGDC->Values[nRow][Column04->Index] = sIST;//pObj->INCD_ORGN_CD; //돌발상황 원본 코드 : IST
- pGDC->Values[nRow][Column05->Index] = pObj->OCRR_LCTN_NM; //발생 위치 명
- pGDC->Values[nRow][Column06->Index] = pObj->LINK_ID; //돌발발생 LINK ID
- pGDC->Values[nRow][Column07->Index] = pObj->X_CRDN; //X 좌표
- pGDC->Values[nRow][Column08->Index] = pObj->Y_CRDN; //Y 좌표
- pGDC->Values[nRow][Column09->Index] = pObj->INCD_EXPL; //돌발상황 설명
- pGDC->Values[nRow][Column10->Index] = sLTCU;//pObj->CMTR_GRAD_CD; //소통 등급 코드 : LTCU
- pGDC->Values[nRow][Column11->Index] = pObj->IFMR_NM; //제보자 명
- pGDC->Values[nRow][Column12->Index] = sICM;//pObj->INCD_CNFM_MTHD_CD; //돌발상황 확인 방법 코드 : ICM
- pGDC->Values[nRow][Column13->Index] = sSRLU;//pObj->INCD_SERN_CD; //돌발상황 심각도 코드 : SRLU
- pGDC->Values[nRow][Column14->Index] = pObj->INCD_TITL; //돌발상황 제목
- pGDC->Values[nRow][Column15->Index] = sIDTU;//pObj->INCD_TYPE_CLSF_CD; //돌발상황 유형 분류 코드 : IDTU
- pGDC->Values[nRow][Column16->Index] = sACTU;//pObj->INCD_TYPE_CD; //돌발상황 유형 코드 : ACTU, CRTU, EVTU, WETU 중 하나
- pGDC->Values[nRow][Column17->Index] = ITSUtil_StrToTime(pObj->INCD_STRT_DT); //돌발상황 시작 일시
- pGDC->Values[nRow][Column18->Index] = ITSUtil_StrToTime(pObj->INCD_END_PRAR_DT); //돌발상황 종료 예정 일시
- pGDC->Values[nRow][Column19->Index] = pObj->INCD_OCRR_LANE; //돌발상황 발생 차로
- pGDC->Values[nRow][Column20->Index] = pObj->INCD_CLSR_LANE; //돌발상황 차단 차로
- pGDC->Values[nRow][Column21->Index] = pObj->DELY_LNGT; //지체 길이
- pGDC->Values[nRow][Column22->Index] = pObj->INCD_LNGT; //돌발상황 길이
- pGDC->Values[nRow][Column23->Index] = pObj->SMLT_VHCL_UNUM; //소형 차량 대수
- pGDC->Values[nRow][Column24->Index] = pObj->MDLT_VHCL_UNUM; //중대형 차량 대수
- pGDC->Values[nRow][Column25->Index] = pObj->INJR_PNUM; //부상자 인원수
- pGDC->Values[nRow][Column26->Index] = pObj->FTLT_PNUM; //사망자 인원수
- pGDC->Values[nRow][Column27->Index] = sDFW;//pObj->WTHR_CD; //기상 코드 : DFW
- pGDC->Values[nRow][Column28->Index] = sRSL;//pObj->RESP_LVL_CD; //대응 수준 코드 : RSL
- pGDC->Values[nRow][Column29->Index] = pObj->UTIS_CNCT_YN; //UTIS 연계 여부
- pGDC->Values[nRow][Column30->Index] = pObj->TRUB_VHCL_YN; //고장 차량 여부
- pGDC->Values[nRow][Column31->Index] = pObj->FALT_YN; //낙하물 여부
- pGDC->Values[nRow][Column32->Index] = pObj->FRWT_YN; //화재위험물 여부
- pGDC->Values[nRow][Column33->Index] = sPRTU;//pObj->TRVL_LMNT_TYPE_CD; //통행 제한 유형 코드 : PRTU
- pGDC->Values[nRow][Column34->Index] = pObj->VMS_DSPL_YN; //VMS 표출 여부
- pGDC->Values[nRow][Column35->Index] = ITSUtil_StrToDateTime(pObj->INCD_CNFM_DT); //VMS 표출 여부
- pGDC->Values[nRow][Column99->Index] = (int)pObj;
- }
- }
- __finally
- {
- ItsIncidentManager->FLists.UnLock();
- }
- }
- __finally
- {
- LblRecords->Caption = "("+FormatFloat("##,##0", pGDC->FilteredRecordCount) +"/"+FormatFloat("##,##0", pGDC->RecordCount) + ")";
- TvList->EndUpdate();
- TvList->DataController->GotoFirst();
- TvList->DataController->FocusedRecordIndex = 0;
- }
- #if 0
- if (FINCD_OCRR_ID != "")
- {
- CMM_SetGridRow(CxList, TvList, FINCD_OCRR_ID, Column01->Index);
- DisplayIncidentInfo();
- }
- #endif
- }
- //---------------------------------------------------------------------------
- void __fastcall TFRAMEIncidentProcess::TvListDataControllerFilterChanged(TObject *Sender)
- {
- CMM_SetFilterLike(TvList);
- TcxDataController *pGDC = TvList->DataController;
- LblRecords->Caption = "("+FormatFloat("##,##0", pGDC->FilteredRecordCount) +"/"+FormatFloat("##,##0", pGDC->RecordCount) + ")";
- }
- //---------------------------------------------------------------------------
- void __fastcall TFRAMEIncidentProcess::BtnExlSaveClick(TObject *Sender)
- {
- TcxGrid *pGrid = CxList;
- TcxGridTableView *pView = TvList;
- String sTitle= lblFileName->Caption;//"등록된 돌발정보";
- CMM_ExportToExcelFile(sTitle, pGrid, pView, (TForm*)this);
- }
- //---------------------------------------------------------------------------
- void __fastcall TFRAMEIncidentProcess::CbINCD_TYPE_CLSF_CDClick(TObject *Sender)
- {
- if (CbINCD_TYPE_CLSF_CD->ItemIndex < 0) return;
- CbINCD_TYPE_CD->Properties->Items->Clear();
- String sCode = ITSUtil_GetCode(CbINCD_TYPE_CLSF_CD->Text);
- if (sCode == "1")
- {
- if (FCodeACTU)
- {
- FOR_STL(TItsSubCode *, pSubCode, FCodeACTU->FSubLists)
- {
- if (pSubCode->USE_YN == "N") continue;
- CbINCD_TYPE_CD->Properties->Items->Add(" [" + pSubCode->CMMN_CD + "] " + pSubCode->CMMN_CD_KOR_NM);
- }
- }
- }
- else
- if (sCode == "2")
- {
- if (FCodeCRTU)
- {
- FOR_STL(TItsSubCode *, pSubCode, FCodeCRTU->FSubLists)
- {
- if (pSubCode->USE_YN == "N") continue;
- CbINCD_TYPE_CD->Properties->Items->Add(" [" + pSubCode->CMMN_CD + "] " + pSubCode->CMMN_CD_KOR_NM);
- }
- }
- }
- else
- if (sCode == "3")
- {
- if (FCodeEVTU)
- {
- FOR_STL(TItsSubCode *, pSubCode, FCodeEVTU->FSubLists)
- {
- if (pSubCode->USE_YN == "N") continue;
- CbINCD_TYPE_CD->Properties->Items->Add(" [" + pSubCode->CMMN_CD + "] " + pSubCode->CMMN_CD_KOR_NM);
- }
- }
- }
- else
- if (sCode == "4")
- {
- if (FCodeWETU)
- {
- FOR_STL(TItsSubCode *, pSubCode, FCodeWETU->FSubLists)
- {
- if (pSubCode->USE_YN == "N") continue;
- CbINCD_TYPE_CD->Properties->Items->Add(" [" + pSubCode->CMMN_CD + "] " + pSubCode->CMMN_CD_KOR_NM);
- }
- }
- }
- CbINCD_TYPE_CD->ItemIndex = 0;
- }
- //---------------------------------------------------------------------------
- void __fastcall TFRAMEIncidentProcess::CbVMS_INCD_TYPE_CDClick(TObject *Sender)
- {
- if (CbVMS_INCD_TYPE_CD->ItemIndex < 0) return;
- CbVMS_INCD_DETL_TYPE_CD->Properties->Items->Clear();
- String strText = CbVMS_INCD_TYPE_CD->Text;
- cxLabel_VMS_INCD_TYPE_CD->Caption = strText.SubString( 0, strText.Pos( "[" )-1 );
- String sCode = ITSUtil_GetCode(CbVMS_INCD_TYPE_CD->Text);
- if (sCode == "VIT1")
- {
- if (FCodeIDT)
- {
- FOR_STL(TItsSubCode *, pSubCode, FCodeIDT->FSubLists)
- {
- if (pSubCode->USE_YN == "N") continue;
- CbVMS_INCD_DETL_TYPE_CD->Properties->Items->Add(" [" + pSubCode->CMMN_CD + "] " + pSubCode->CMMN_CD_KOR_NM);
- }
- }
- }
- else
- if (sCode == "VIT2" )
- {
- if (FCodeEDT)
- {
- FOR_STL(TItsSubCode *, pSubCode, FCodeEDT->FSubLists)
- {
- if (pSubCode->USE_YN == "N") continue;
- CbVMS_INCD_DETL_TYPE_CD->Properties->Items->Add(" [" + pSubCode->CMMN_CD + "] " + pSubCode->CMMN_CD_KOR_NM);
- }
- }
- }
- }
- //---------------------------------------------------------------------------
- void __fastcall TFRAMEIncidentProcess::DisplayIncidentInfo()
- {
- FLinkId = "";
- //BtnVmsTarget->Enabled = false;
- TcxDataController *pGDC = TvList->DataController;
- int nRow = pGDC->FocusedRecordIndex;
- if( nRow <= -1 )
- return;
- TItsSubCode *pSubCode;
- //TItsIncident *pObj = NULL;
- //int nMemPtr = pGDC->Values[nRow][Column99->Index];
- //pObj = (TItsIncident *)nMemPtr;
- try
- {
- String sINCD_OCRR_ID = pGDC->Values[nRow][Column01->Index];
- FINCD_OCRR_ID = sINCD_OCRR_ID;
- TItsIncident *pObj = ItsIncidentManager->FLists.Find(sINCD_OCRR_ID);
- if (!pObj) return;
- //InitScreen();
- String sIST = "";
- String sLTCU = "";
- String sICM = "";
- String sSRLU = "";
- String sIDTU = "";
- String sACTU = "";
- String sISS = "";
- String sDFW = "";
- String sRSL = "";
- String sPRTU = "";
- if (pObj->INCD_ORGN_CD != "") sIST = " [" + pObj->INCD_ORGN_CD + "] ";
- if (pObj->CMTR_GRAD_CD != "") sLTCU = " [" + pObj->CMTR_GRAD_CD + "] ";
- if (pObj->INCD_CNFM_MTHD_CD != "") sICM = " [" + pObj->INCD_CNFM_MTHD_CD + "] ";
- if (pObj->INCD_SERN_CD != "") sSRLU = " [" + pObj->INCD_SERN_CD + "] ";
- if (pObj->INCD_TYPE_CLSF_CD != "") sIDTU = " [" + pObj->INCD_TYPE_CLSF_CD + "] ";
- if (pObj->INCD_TYPE_CD != "") sACTU = " [" + pObj->INCD_TYPE_CD + "] ";
- if (pObj->INCD_PRGR_STEP_CD != "") sISS = " [" + pObj->INCD_PRGR_STEP_CD + "] ";
- if (pObj->WTHR_CD != "") sDFW = " [" + pObj->WTHR_CD + "] ";
- if (pObj->RESP_LVL_CD != "") sRSL = " [" + pObj->RESP_LVL_CD + "] ";
- if (pObj->TRVL_LMNT_TYPE_CD != "") sPRTU = " [" + pObj->TRVL_LMNT_TYPE_CD + "] ";
- if (FCodeIST)
- {
- pSubCode = FCodeIST->FSubLists.Find(pObj->INCD_ORGN_CD);
- if (pSubCode) sIST = sIST + pSubCode->CMMN_CD_KOR_NM;
- }
- if (FCodeLTCU)
- {
- pSubCode = FCodeLTCU->FSubLists.Find(pObj->CMTR_GRAD_CD);
- if (pSubCode) sLTCU = sLTCU + pSubCode->CMMN_CD_KOR_NM;
- }
- if (FCodeICM)
- {
- pSubCode = FCodeICM->FSubLists.Find(pObj->INCD_CNFM_MTHD_CD);
- if (pSubCode) sICM = sICM + pSubCode->CMMN_CD_KOR_NM;
- }
- if (FCodeSRLU)
- {
- pSubCode = FCodeSRLU->FSubLists.Find(pObj->INCD_SERN_CD);
- if (pSubCode) sSRLU = sSRLU + pSubCode->CMMN_CD_KOR_NM;
- }
- if (FCodeIDTU)
- {
- pSubCode = FCodeIDTU->FSubLists.Find(pObj->INCD_TYPE_CLSF_CD);
- if (pSubCode) sIDTU = sIDTU + pSubCode->CMMN_CD_KOR_NM;
- }
- if (!pObj->INCD_TYPE_CLSF_CD.IsEmpty() && !pObj->INCD_TYPE_CD.IsEmpty())
- {
- if (pObj->INCD_TYPE_CLSF_CD == "1")
- {
- if (FCodeACTU)
- {
- pSubCode = FCodeACTU->FSubLists.Find(pObj->INCD_TYPE_CD);
- if (pSubCode) sACTU = sACTU + pSubCode->CMMN_CD_KOR_NM;
- }
- }
- else if (pObj->INCD_TYPE_CLSF_CD == "2")
- {
- if (FCodeCRTU)
- {
- pSubCode = FCodeCRTU->FSubLists.Find(pObj->INCD_TYPE_CD);
- if (pSubCode) sACTU = sACTU + pSubCode->CMMN_CD_KOR_NM;
- }
- }
- else if (pObj->INCD_TYPE_CLSF_CD == "3")
- {
- if (FCodeEVTU)
- {
- pSubCode = FCodeEVTU->FSubLists.Find(pObj->INCD_TYPE_CD);
- if (pSubCode) sACTU = sACTU + pSubCode->CMMN_CD_KOR_NM;
- }
- }
- else if (pObj->INCD_TYPE_CLSF_CD == "4")
- {
- if (FCodeWETU)
- {
- pSubCode = FCodeWETU->FSubLists.Find(pObj->INCD_TYPE_CD);
- if (pSubCode) sACTU = sACTU + pSubCode->CMMN_CD_KOR_NM;
- }
- }
- }
- if (FCodeISS)
- {
- pSubCode = FCodeISS->FSubLists.Find(pObj->INCD_PRGR_STEP_CD);
- if (pSubCode) sISS = sISS + pSubCode->CMMN_CD_KOR_NM;
- }
- if (FCodeDFW)
- {
- pSubCode = FCodeDFW->FSubLists.Find(pObj->WTHR_CD);
- if (pSubCode) sDFW = sDFW + pSubCode->CMMN_CD_KOR_NM;
- }
- if (FCodeRSL)
- {
- pSubCode = FCodeRSL->FSubLists.Find(pObj->RESP_LVL_CD);
- if (pSubCode) sRSL = sRSL + pSubCode->CMMN_CD_KOR_NM;
- }
- if (FCodePRTU)
- {
- pSubCode = FCodePRTU->FSubLists.Find(pObj->TRVL_LMNT_TYPE_CD);
- if (pSubCode) sPRTU = sPRTU + pSubCode->CMMN_CD_KOR_NM;
- }
- EdINCD_OCRR_ID->Text = pObj->INCD_OCRR_ID;
- EdRGST_DT->Text = ITSUtil_StrToDateTime(pObj->RGST_DT);
- EdRegDt->Text = pObj->RGST_DT;
- CbINCD_ORGN_CD->Text = sIST;
- EdOCRR_LCTN_NM->Text = pObj->OCRR_LCTN_NM;
- EdLINK_ID->Text = pObj->LINK_ID;
- EdLinkId->Text = pObj->LINK_ID;
- FLinkId = pObj->LINK_ID;
- if (pObj->X_CRDN.IsEmpty()) pObj->X_CRDN = "0.0";
- SePosX->Value = StrToFloat(pObj->X_CRDN);
- if (pObj->Y_CRDN.IsEmpty()) pObj->Y_CRDN = "0.0";
- SePosY->Value = StrToFloat(pObj->Y_CRDN);
- FSelLink.nSelLink = 0;
- FSelLink.info[FSelLink.nSelLink].sIncidentId = EdINCD_OCRR_ID->Text;
- FSelLink.info[FSelLink.nSelLink].sLinkId = FLinkId;
- FSelLink.info[FSelLink.nSelLink].FPosX = SePosX->Value;
- FSelLink.info[FSelLink.nSelLink].FPosY = SePosY->Value;
- FSelLink.nSelLink++;
- EdINCD_EXPL->Text = pObj->INCD_EXPL;
- CbCMTR_GRAD_CD->Text = sLTCU;
- EdIFMR_NM->Text = pObj->IFMR_NM;
- CbINCD_CNFM_MTHD_CD->Text = sICM;
- CbINCD_SERN_CD->Text = sSRLU;
- CbINCD_TYPE_CLSF_CD->Text = sIDTU;
- CbINCD_TYPE_CLSF_CDClick((TObject *)CbINCD_TYPE_CLSF_CD);
- CbINCD_TYPE_CD->Text = sACTU;
- EdINCD_TITL->Text = pObj->INCD_TITL;
- DtINCD_STRT_DT->Date = ITSUtil_StrToDateTime(pObj->INCD_STRT_DT);
- DtINCD_END_PRAR_DT->Date = ITSUtil_StrToDateTime(pObj->INCD_END_PRAR_DT);
- String sTemp;
- sTemp = pObj->INCD_OCRR_LANE; //돌발상황 발생 차로
- if (sTemp.IsEmpty())
- {
- sTemp = "000000";
- }
- else
- if (sTemp.Length() != 6)
- {
- sTemp = "000000";
- }
- int A1, A2, A3, A4, A5, A6;
- A1 = sTemp.SubString(1, 1).ToIntDef(0);
- A2 = sTemp.SubString(2, 1).ToIntDef(0);
- A3 = sTemp.SubString(3, 1).ToIntDef(0);
- A4 = sTemp.SubString(4, 1).ToIntDef(0);
- A5 = sTemp.SubString(5, 1).ToIntDef(0);
- A6 = sTemp.SubString(6, 1).ToIntDef(0);
- ChkINCD_OCRR_LANE_Extra->Checked = sTemp.SubString(1, 1).ToIntDef(0);
- ChkINCD_OCRR_LANE_1->Checked = sTemp.SubString(2, 1).ToIntDef(0);
- ChkINCD_OCRR_LANE_2->Checked = sTemp.SubString(3, 1).ToIntDef(0);
- ChkINCD_OCRR_LANE_3->Checked = sTemp.SubString(4, 1).ToIntDef(0);
- ChkINCD_OCRR_LANE_4->Checked = sTemp.SubString(5, 1).ToIntDef(0);
- ChkINCD_OCRR_LANE_5->Checked = sTemp.SubString(6, 1).ToIntDef(0);
- sTemp = pObj->INCD_CLSR_LANE; //돌발상황 차단 차로
- ChkINCD_CLSR_LANE_Extra->Checked = sTemp.SubString(1, 1).ToIntDef(0);
- ChkINCD_CLSR_LANE_1->Checked = sTemp.SubString(2, 1).ToIntDef(0);
- ChkINCD_CLSR_LANE_2->Checked = sTemp.SubString(3, 1).ToIntDef(0);
- ChkINCD_CLSR_LANE_3->Checked = sTemp.SubString(4, 1).ToIntDef(0);
- ChkINCD_CLSR_LANE_4->Checked = sTemp.SubString(5, 1).ToIntDef(0);
- ChkINCD_CLSR_LANE_5->Checked = sTemp.SubString(6, 1).ToIntDef(0);
- SeDELY_LNGT->Value = pObj->DELY_LNGT.ToIntDef(0);
- SeINCD_LNGT->Value = pObj->INCD_LNGT.ToIntDef(0);
- SeSMLT_VHCL_UNUM->Value = pObj->SMLT_VHCL_UNUM.ToIntDef(0);
- SeMDLT_VHCL_UNUM->Value = pObj->MDLT_VHCL_UNUM.ToIntDef(0);
- SeINJR_PNUM->Value = pObj->INJR_PNUM.ToIntDef(0);
- SeFTLT_PNUM->Value = pObj->FTLT_PNUM.ToIntDef(0);
- CbWTHR_CD->Text = sDFW;
- CbRESP_LVL_CD->Text = sRSL;
- //공단에서 넘어온 돌발은 공단연계가 표출안되게
- if (pObj->INCD_ORGN_CD == "IST5")
- {
- ChkUTIS_CNCT_YN->Checked = false;
- ChkUTIS_CNCT_YN->Enabled = false;
- }
- else
- {
- ChkUTIS_CNCT_YN->Enabled = true;
- ChkUTIS_CNCT_YN->Checked = pObj->UTIS_CNCT_YN == "Y" ? true : false;
- }
- ChkTRUB_VHCL_YN->Checked = pObj->TRUB_VHCL_YN == "Y" ? true : false;
- ChkFALT_YN->Checked = pObj->FALT_YN == "Y" ? true : false;
- ChkFRWT_YN->Checked = pObj->FRWT_YN == "Y" ? true : false;
- CbTRVL_LMNT_TYPE_CD->Text = sPRTU;
- ChkVMS_DSPL_YN->Checked = pObj->VMS_DSPL_YN == "Y" ? true : false;
- EdSTRT_LCTN_NM->Text = "";
- EdEND_LCTN_NM->Text = "";
- CbVMS_INCD_TYPE_CD->Text = "";
- CbVMS_INCD_DETL_TYPE_CD->Text = "";
- CbVMS_INCD_RSTR_TYPE_CD->Text = "";
- TItsVmsIncident *pVmsObj = ItsIncidentManager->FVmsLists.Find(pObj->INCD_OCRR_ID);
- if (pVmsObj)
- {
- String sVIT;
- String sIDT;
- String sVRT;
- if (FCodeVIT)
- {
- pSubCode = FCodeVIT->FSubLists.Find(pVmsObj->VMS_INCD_TYPE_CD);
- if (pSubCode)
- {
- sVIT = " [" + pSubCode->CMMN_CD + "] " + pSubCode->CMMN_CD_KOR_NM;
- if (pSubCode->CMMN_CD == "VIT1")
- {
- if (FCodeIDT)
- {
- pSubCode = FCodeIDT->FSubLists.Find(pVmsObj->VMS_INCD_DETL_TYPE_CD);
- if (pSubCode)
- {
- sIDT = " [" + pSubCode->CMMN_CD + "] " + pSubCode->CMMN_CD_KOR_NM;
- }
- }
- }
- else if (pSubCode->CMMN_CD == "VIT2")
- {
- if (FCodeEDT)
- {
- pSubCode = FCodeEDT->FSubLists.Find(pVmsObj->VMS_INCD_DETL_TYPE_CD);
- if (pSubCode)
- {
- sIDT = " [" + pSubCode->CMMN_CD + "] " + pSubCode->CMMN_CD_KOR_NM;
- }
- }
- }
- }
- }
- if (FCodeVRT)
- {
- pSubCode = FCodeVRT->FSubLists.Find(pVmsObj->VMS_INCD_RSTR_TYPE_CD);
- if (pSubCode)
- {
- sVRT = " [" + pSubCode->CMMN_CD + "] " + pSubCode->CMMN_CD_KOR_NM;
- }
- }
- EdSTRT_LCTN_NM->Text = pVmsObj->STRT_LCTN_NM;
- EdEND_LCTN_NM->Text = pVmsObj->END_LCTN_NM;
- CbVMS_INCD_TYPE_CD->Text = sVIT;//pVmsObj->VMS_INCD_TYPE_CD
- CbVMS_INCD_DETL_TYPE_CD->Text = sIDT;//pVmsObj->VMS_INCD_DETL_TYPE_CD
- CbVMS_INCD_RSTR_TYPE_CD->Text = sVRT;
- }
- FOcrrType = 0;
- if (FLinkId != "")
- {
- //BtnVmsTarget->Enabled = true;
- }
- }
- catch(...)
- {
- }
- }
- //---------------------------------------------------------------------------
- void __fastcall TFRAMEIncidentProcess::TvListCellDblClick(TcxCustomGridTableView *Sender, TcxGridTableDataCellViewInfo *ACellViewInfo,
- TMouseButton AButton, TShiftState AShift, bool &AHandled)
- {
- DisplayIncidentInfo();
- }
- //---------------------------------------------------------------------------
- void __fastcall TFRAMEIncidentProcess::BtnSelectClick(TObject *Sender)
- {
- PopupSelLink->Popup(BtnSelect->ClientOrigin.x, BtnSelect->ClientOrigin.y + BtnSelect->Height);
- }
- //---------------------------------------------------------------------------
- void __fastcall TFRAMEIncidentProcess::BtnInfoCancelClick(TObject *Sender)
- {
- InitScreen();
- FOcrrType = 0;
- }
- //---------------------------------------------------------------------------
- void __fastcall TFRAMEIncidentProcess::BtnMissInfoClick(TObject *Sender)
- {
- if (EdINCD_OCRR_ID->Text.IsEmpty())
- {
- Application->MessageBox(L"돌발 오보 판정\r\n돌발 구간을 먼저 선택하세요.",
- FTitle.c_str(), MB_OK|MB_ICONERROR|MB_APPLMODAL);
- return;
- }
- if (FOcrrType == 1)
- {
- Application->MessageBox(L"돌발 오보 판정\r\n돌발 예상구간 정보는 오보로 판정할 수 없습니다.",
- FTitle.c_str(), MB_OK|MB_ICONERROR|MB_APPLMODAL);
- return;
- }
- if (Application->MessageBox(L"돌발 오보 판정\r\n현재 돌발 정보를 오보로 판정 하시겠습니까?",
- FTitle.c_str(), MB_YESNO|MB_ICONQUESTION|MB_APPLMODAL) != IDYES) return;
- TItsIncident *pObj = ItsIncidentManager->FLists.Find(EdINCD_OCRR_ID->Text);
- if (!pObj) return;
- if (UpdateMissIncident(pObj->INCD_OCRR_ID))
- {
- pObj->INCD_PRGR_STEP_CD = "ISS4"; // 오보판정
- UpdateList();
- InitScreen();
- Application->ProcessMessages();
- POST_MSG(Application->MainForm->Handle, WM_DATABASE_REFRESH, WP_MSG_02, 0);
- }
- }
- //---------------------------------------------------------------------------
- bool __fastcall TFRAMEIncidentProcess::UpdateMissIncident(String AINCD_OCRR_ID)
- {
- String sQry;
- TADOQuery *pADO = NULL;
- try
- {
- try
- {
- pADO = new TADOQuery(NULL);
- pADO->Close();
- pADO->Connection = ITSDb_GetConnection();
- ITSDb_GetConnection()->BeginTrans();
- sQry = "UPDATE TB_INCD_OCRR \r\n"
- " SET INCD_PRGR_STEP_CD = 'ISS4' \r\n"
- " WHERE INCD_OCRR_ID = :p01 \r\n";
- ITSDb_SQLText(pADO, sQry);
- ITSDb_SQLBind(pADO, "p01", AINCD_OCRR_ID);
- ITSDb_SQLExec(pADO);
- ITSDb_GetConnection()->CommitTrans();
- // 공단연계 정보도 삭제해 버리자.
- ItsIncidentManager->DeleteIncidentLoc(AINCD_OCRR_ID);
- Application->MessageBox(FrmLang->lblDbSave->Caption.c_str(),//L"돌발정보를 오보 판정 돌발 정보로 저장 하였습니다.",
- FTitle.c_str(), MB_OK|MB_ICONINFORMATION|MB_APPLMODAL);
- }
- catch(EDatabaseError &E)
- {
- ITSDb_GetConnection()->RollbackTrans();
- ::PostMessage(Application->MainForm->Handle, (UINT)(WM_USER+0xF4), (WPARAM)0xB2, (LPARAM)0xB2);
- ShowMessage(String(E.ClassName()) + E.Message);
- }
- catch(Exception &exception)
- {
- ITSDb_GetConnection()->RollbackTrans();
- ::PostMessage(Application->MainForm->Handle, (UINT)(WM_USER+0xF4), (WPARAM)0xB2, (LPARAM)0xB2);
- ShowMessage(String(exception.ClassName()) + exception.Message);
- }
- catch(...)
- {
- ITSDb_GetConnection()->RollbackTrans();
- ::PostMessage(Application->MainForm->Handle, (UINT)(WM_USER+0xF4), (WPARAM)0xB2, (LPARAM)0xB2);
- ShowMessage(FrmLang->lblDbErr->Caption);//"데이터 작업 중에 알수없는 DB 오류가 발생하였습니다.");
- }
- }
- __finally
- {
- if (pADO)
- {
- pADO->Close();
- delete pADO;
- }
- }
- return true;
- }
- //---------------------------------------------------------------------------
- void __fastcall TFRAMEIncidentProcess::BtnSaveClick(TObject *Sender)
- {
- //입력
- if (EdINCD_OCRR_ID->Text.Trim().IsEmpty())
- {
- Application->MessageBox(L"돌발정보입력\r\n목록에서 돌발정보를 선택하신 후에 작업을 진행하세요.",
- FTitle.c_str(), MB_OK|MB_ICONERROR|MB_APPLMODAL);
- return;
- }
- if (CbINCD_ORGN_CD->Text.IsEmpty())
- {
- Application->MessageBox(L"★[돌발구분] 항목은 필수 입력 항목입니다.\r\n입력후 진행해 주세요.",
- FTitle.c_str(), MB_OK|MB_ICONERROR|MB_APPLMODAL);
- if (CbINCD_ORGN_CD->CanFocus()) CbINCD_ORGN_CD->SetFocus();
- return;
- }
- if (CbINCD_CNFM_MTHD_CD->Text.IsEmpty())
- {
- Application->MessageBox(L"★[확인방법] 항목은 필수 입력 항목입니다.\r\n입력후 진행해 주세요.",
- FTitle.c_str(), MB_OK|MB_ICONERROR|MB_APPLMODAL);
- if (CbINCD_CNFM_MTHD_CD->CanFocus()) CbINCD_CNFM_MTHD_CD->SetFocus();
- return;
- }
- if (CbINCD_TYPE_CLSF_CD->Text.IsEmpty())
- {
- Application->MessageBox(L"★[돌발유형] 항목은 필수 입력 항목입니다.\r\n입력후 진행해 주세요.",
- FTitle.c_str(), MB_OK|MB_ICONERROR|MB_APPLMODAL);
- if (CbINCD_TYPE_CLSF_CD->CanFocus()) CbINCD_TYPE_CLSF_CD->SetFocus();
- return;
- }
- if (CbINCD_SERN_CD->Text.IsEmpty())
- {
- Application->MessageBox(L"★[심각도] 항목은 필수 입력 항목입니다.\r\n입력후 진행해 주세요.",
- FTitle.c_str(), MB_OK|MB_ICONERROR|MB_APPLMODAL);
- if (CbINCD_SERN_CD->CanFocus()) CbINCD_SERN_CD->SetFocus();
- return;
- }
- if (CbINCD_TYPE_CD->Text.IsEmpty())
- {
- Application->MessageBox(L"★[돌발세부유형] 항목은 필수 입력 항목입니다.\r\n입력후 진행해 주세요.",
- FTitle.c_str(), MB_OK|MB_ICONERROR|MB_APPLMODAL);
- if (CbINCD_TYPE_CD->CanFocus()) CbINCD_TYPE_CD->SetFocus();
- return;
- }
- if (DtINCD_STRT_DT->EditValue.IsEmpty())
- {
- Application->MessageBox(L"★[돌발시작시각] 항목은 필수 입력 항목입니다.\r\n입력후 진행해 주세요.",
- FTitle.c_str(), MB_OK|MB_ICONERROR|MB_APPLMODAL);
- if (DtINCD_STRT_DT->CanFocus()) DtINCD_STRT_DT->SetFocus();
- return;
- }
- if (DtINCD_END_PRAR_DT->EditValue.IsEmpty())
- {
- Application->MessageBox(L"★[종료예정시각] 항목은 필수 입력 항목입니다.\r\n입력후 진행해 주세요.",
- FTitle.c_str(), MB_OK|MB_ICONERROR|MB_APPLMODAL);
- if (DtINCD_END_PRAR_DT->CanFocus()) DtINCD_END_PRAR_DT->SetFocus();
- return;
- }
- if (EdLinkId->Text.Trim().IsEmpty())
- {
- Application->MessageBox(L"★[발생구간(링크)] 항목은 필수 입력 항목입니다.\r\n입력후 진행해 주세요.",
- FTitle.c_str(), MB_OK|MB_ICONERROR|MB_APPLMODAL);
- if (EdLinkId->CanFocus()) EdLinkId->SetFocus();
- return;
- }
- if (SePosX->Value == 0 ||
- SePosY->Value == 0)
- {
- Application->MessageBox(L"★발생구간(링크) 좌표값은 0이 될수 없습니다.] 항목은 필수 입력 항목입니다.\r\n입력후 진행해 주세요.",
- FTitle.c_str(), MB_OK|MB_ICONERROR|MB_APPLMODAL);
- if (SePosX->CanFocus()) SePosX->SetFocus();
- return;
- }
- if (EdINCD_EXPL->Text.Trim().IsEmpty())
- {
- Application->MessageBox(L"★[돌발상황설명] 항목은 필수 입력 항목입니다.\r\n입력후 진행해 주세요.",
- FTitle.c_str(), MB_OK|MB_ICONERROR|MB_APPLMODAL);
- if (EdINCD_EXPL->CanFocus()) EdINCD_EXPL->SetFocus();
- return;
- }
- if (EdINCD_TITL->Text.Trim().IsEmpty())
- {
- Application->MessageBox(L"★[돌발제목] 항목은 필수 입력 항목입니다.\r\n입력후 진행해 주세요.",
- FTitle.c_str(), MB_OK|MB_ICONERROR|MB_APPLMODAL);
- if (EdINCD_TITL->CanFocus()) EdINCD_TITL->SetFocus();
- return;
- }
- String sStartTm = DtINCD_STRT_DT->Date.FormatString("YYYYMMDDHHNNSS");
- String sEndTm = DtINCD_END_PRAR_DT->Date.FormatString("YYYYMMDDHHNNSS");
- if (sStartTm >= sEndTm)
- {
- Application->MessageBox(L"돌발종료예정시각이 돌발시작시각과 같거나 큽니다.\r\n확인 후 진행해 주세요",
- FTitle.c_str(), MB_OK|MB_ICONERROR|MB_APPLMODAL);
- if (DtINCD_STRT_DT->CanFocus()) DtINCD_STRT_DT->SetFocus();
- return;
- }
- if (Application->MessageBox(L"돌발정보입력\r\n현재 입력 정보를 저장 하시겠습니까?",
- FTitle.c_str(), MB_YESNO|MB_ICONQUESTION|MB_APPLMODAL) != IDYES) return;
- String sIncidentId = EdINCD_OCRR_ID->Text;
- TItsIncident *pObj = ItsIncidentManager->FLists.Find(sIncidentId);
- if (!pObj && FOcrrType == 1)
- {
- //돌발감지 정보를 돌발 정보로 등록한다.
- if (InsertAutoIncident(sIncidentId, EdRegDt->Text))
- {
- ItsIncidentManager->LoadFromDb();
- pObj = ItsIncidentManager->FLists.Find(sIncidentId);
- if (!pObj) return; //신규로 정보가 저장되지 않은 것이다.
- }
- }
- String sINCD_OCRR_LANE;
- String sINCD_CLSR_LANE;
- sINCD_OCRR_LANE.sprintf(L"%d%d%d%d%d%d",
- ChkINCD_OCRR_LANE_Extra->Checked,
- ChkINCD_OCRR_LANE_1->Checked,
- ChkINCD_OCRR_LANE_2->Checked,
- ChkINCD_OCRR_LANE_3->Checked,
- ChkINCD_OCRR_LANE_4->Checked,
- ChkINCD_OCRR_LANE_5->Checked);
- sINCD_CLSR_LANE.sprintf(L"%d%d%d%d%d%d",
- ChkINCD_CLSR_LANE_Extra->Checked,
- ChkINCD_CLSR_LANE_1->Checked,
- ChkINCD_CLSR_LANE_2->Checked,
- ChkINCD_CLSR_LANE_3->Checked,
- ChkINCD_CLSR_LANE_4->Checked,
- ChkINCD_CLSR_LANE_5->Checked);
- pObj->INCD_ORGN_CD = ITSUtil_GetCode(CbINCD_ORGN_CD->Text);
- pObj->OCRR_LCTN_NM = EdOCRR_LCTN_NM->Text.Trim();
- pObj->X_CRDN = VarToStr(SePosX->Value);
- pObj->Y_CRDN = VarToStr(SePosY->Value);
- pObj->INCD_EXPL = EdINCD_EXPL->Text.Trim();
- pObj->CMTR_GRAD_CD = ITSUtil_GetCode(CbCMTR_GRAD_CD->Text);
- pObj->IFMR_NM = EdIFMR_NM->Text.Trim();
- pObj->INCD_CNFM_MTHD_CD = ITSUtil_GetCode(CbINCD_CNFM_MTHD_CD->Text);
- pObj->INCD_STRT_DT = DtINCD_STRT_DT->Date.FormatString("YYYYMMDDHHNNSS");
- pObj->INCD_END_PRAR_DT = DtINCD_END_PRAR_DT->Date.FormatString("YYYYMMDDHHNNSS");
- pObj->INCD_TYPE_CLSF_CD = ITSUtil_GetCode(CbINCD_TYPE_CLSF_CD->Text);
- pObj->INCD_TYPE_CD = ITSUtil_GetCode(CbINCD_TYPE_CD->Text);
- pObj->INCD_TITL = EdINCD_TITL->Text.Trim();
- pObj->INCD_SERN_CD = ITSUtil_GetCode(CbINCD_SERN_CD->Text);
- pObj->DELY_LNGT = SeDELY_LNGT->Value;
- pObj->INCD_LNGT = SeINCD_LNGT->Value;
- pObj->INCD_OCRR_LANE = sINCD_OCRR_LANE;
- pObj->INCD_CLSR_LANE = sINCD_CLSR_LANE;
- pObj->TRVL_LMNT_TYPE_CD = ITSUtil_GetCode(CbTRVL_LMNT_TYPE_CD->Text);
- pObj->TRUB_VHCL_YN = ChkTRUB_VHCL_YN->Checked ? "Y" : "N";
- pObj->FALT_YN = ChkFALT_YN->Checked ? "Y" : "N";
- pObj->FRWT_YN = ChkFRWT_YN->Checked ? "Y" : "N";
- pObj->UTIS_CNCT_YN = ChkUTIS_CNCT_YN->Checked ? "Y" : "N";
- pObj->SMLT_VHCL_UNUM = SeSMLT_VHCL_UNUM->Value;
- pObj->MDLT_VHCL_UNUM = SeMDLT_VHCL_UNUM->Value;
- pObj->INJR_PNUM = SeINJR_PNUM->Value;
- pObj->FTLT_PNUM = SeFTLT_PNUM->Value;
- pObj->WTHR_CD = ITSUtil_GetCode(CbWTHR_CD->Text);
- pObj->RESP_LVL_CD = ITSUtil_GetCode(CbRESP_LVL_CD->Text);
- pObj->VMS_DSPL_YN = ChkVMS_DSPL_YN->Checked ? "Y" : "N";
- pObj->LINK_ID = EdLinkId->Text.Trim();
- pObj->INCD_PRGR_STEP_CD = "ISS2"; // 현재는 진행단계이다.
- if (!ItsIncidentManager->UpdateIncidentInfo(pObj))
- {
- return;
- }
- if (FOcrrType == 1)
- {
- UpdateAutoIncident(pObj->LINK_ID, pObj->RGST_DT);
- }
- ItsIncidentManager->MergeVmsIncidentInfo(pObj->INCD_OCRR_ID, // '돌발상황 발생 ID
- EdSTRT_LCTN_NM->Text, // '시작 위치 명
- EdEND_LCTN_NM->Text, // '종료 위치 명
- pObj->OCRR_LCTN_NM, // '발생 위치 명
- pObj->CMTR_GRAD_CD, // '소통 등급 코드
- sINCD_CLSR_LANE, // '돌발상황 차단 차로
- pObj->VMS_DSPL_YN, // 'VMS 표출 여부
- pObj->INCD_PRGR_STEP_CD, // '돌발상황 진행 단계 코드
- pObj->INCD_STRT_DT, // '돌발상황 시작 일시
- pObj->INCD_END_PRAR_DT, // '돌발상황 종료 예정 일시
- pObj->LINK_ID, // '링크ID
- ITSUtil_GetCode(CbVMS_INCD_TYPE_CD->Text), // 'VMS 돌발유형코드
- ITSUtil_GetCode(CbVMS_INCD_DETL_TYPE_CD->Text), // 'VMS 돌발세부유형코드
- ITSUtil_GetCode(CbVMS_INCD_RSTR_TYPE_CD->Text)
- );
- if (FSelLink.nSelLink > 1)
- {
- bool bResult;
- for (int ii = 1; ii < FSelLink.nSelLink; ii++)
- {
- String sIncidentId = "";
- if (!ItsIncidentManager->GetNextIncidentId(CenterId, sIncidentId))
- {
- Application->MessageBox(L"신규 돌발 ID를 조회하지 못하였습니다.\r\n데이터베이스 관리자에게 확인 후에 작업하세요.",
- FTitle.c_str(), MB_OK|MB_ICONERROR|MB_APPLMODAL);
- break;
- }
- bResult = InsertToDb(sIncidentId,
- pObj->INCD_ORGN_CD,
- pObj->OCRR_LCTN_NM,
- pObj->INCD_EXPL,
- pObj->CMTR_GRAD_CD,
- pObj->IFMR_NM,
- pObj->INCD_CNFM_MTHD_CD,
- pObj->INCD_SERN_CD,
- pObj->INCD_TYPE_CLSF_CD,
- pObj->INCD_TYPE_CD,
- pObj->INCD_CNFM_DT,
- pObj->INCD_STRT_DT,
- pObj->INCD_END_PRAR_DT,
- pObj->LINK_ID,
- pObj->INCD_TITL);
- pObj->INCD_OCRR_ID = sIncidentId;
- pObj->LINK_ID = FSelLink.info[ii].sLinkId;
- pObj->X_CRDN = VarToStr(FSelLink.info[ii].FPosX);
- pObj->Y_CRDN = VarToStr(FSelLink.info[ii].FPosY);
- ItsIncidentManager->UpdateIncidentInfo(pObj);
- }
- }
- Application->MessageBox(FrmLang->lblDbSave->Caption.c_str(),//L"입력하신 돌발정보를 저장 하였습니다.",
- FTitle.c_str(), MB_OK|MB_ICONINFORMATION|MB_APPLMODAL);
- ItsIncidentManager->LoadFromDb();
- ItsIncidentManager->LoadFromVmsIncident();
- if (FOcrrType == 1)
- {
- ItsIncidentManager->LoadFromAutoIncident();
- }
- UpdateList();
- InitScreen();
- FOcrrType = 0;
- Application->ProcessMessages();
- POST_MSG(Application->MainForm->Handle, WM_DATABASE_REFRESH, WP_MSG_02, 0);
- //if (cxPageControl1->ActivePage == cxTabSheet1)
- CMM_SetGridFocusRow(CxList, TvList, sIncidentId, Column01->Index);
- DisplayIncidentInfo();
- //else
- // CMM_SetGridRow(CxList, TvList, sIncidentId, Column01->Index);
- }
- //---------------------------------------------------------------------------
- bool __fastcall TFRAMEIncidentProcess::InsertToDb(String AINCD_OCRR_ID, //돌발ID
- String AINCD_ORGN_CD, //돌발상황 원본 코드 : IST
- String AOCRR_LCTN_NM, //발생 위치 명
- String AINCD_EXPL, //돌발상황 설명
- String ACMTR_GRAD_CD, //소통 등급 코드 : LTCU
- String AIFMR_NM, //제보자 명
- String AINCD_CNFM_MTHD_CD, //돌발상황 확인 방법 코드 : ICM
- String AINCD_SERN_CD, //돌발상황 심각도 코드 : SRLU
- String AINCD_TYPE_CLSF_CD, //돌발상황 유형 분류 코드 : IDTU
- String AINCD_TYPE_CD, //돌발상황 유형 코드 : ACTU, CRTU, EVTU, WETU 중 하나
- String AINCD_CNFM_DT, //돌발상황 확인 일시
- String AINCD_STRT_DT, //돌발상황 시작 일시
- String AINCD_END_PRAR_DT, //돌발상황 종료 예정 일시
- String ALINK_ID,
- String AINCD_TITL) //돌발제목
- {
- String sQry;
- TADOQuery *pADO = NULL;
- try
- {
- try
- {
- pADO = new TADOQuery(NULL);
- pADO->Close();
- pADO->Connection = ITSDb_GetConnection();
- ITSDb_GetConnection()->BeginTrans();
- sQry = "INSERT INTO TB_INCD_OCRR(INCD_OCRR_ID, RGST_DT, INCD_ORGN_CD, OCRR_LCTN_NM, \r\n"
- " INCD_EXPL, CMTR_GRAD_CD, IFMR_NM, INCD_CNFM_MTHD_CD, \r\n"
- " INCD_CNFM_DT, INCD_STRT_DT, INCD_END_PRAR_DT, INCD_TYPE_CLSF_CD, \r\n"
- " INCD_TYPE_CD, INCD_SERN_CD, INCD_PRGR_STEP_CD, LINK_ID, INCD_TITL ) \r\n"
- " VALUES(:p01, :p02, :p03, :p04, \r\n"
- " :p05, :p06, :p07, :p08, \r\n"
- " :p09, :p10, :p11, :p12, \r\n"
- " :p13, :p14, 'ISS2', :p15, :p16 ) \r\n";
- ITSDb_SQLText(pADO, sQry);
- ITSDb_SQLBind(pADO, "p01", AINCD_OCRR_ID);
- ITSDb_SQLBind(pADO, "p02", Now().FormatString("YYYYMMDDHHNNSS"));
- ITSDb_SQLBind(pADO, "p03", AINCD_ORGN_CD);
- ITSDb_SQLBind(pADO, "p04", AOCRR_LCTN_NM);
- ITSDb_SQLBind(pADO, "p05", AINCD_EXPL);
- ITSDb_SQLBind(pADO, "p06", ACMTR_GRAD_CD);
- ITSDb_SQLBind(pADO, "p07", AIFMR_NM);
- ITSDb_SQLBind(pADO, "p08", AINCD_CNFM_MTHD_CD);
- ITSDb_SQLBind(pADO, "p09", AINCD_CNFM_DT);
- ITSDb_SQLBind(pADO, "p10", AINCD_STRT_DT);
- ITSDb_SQLBind(pADO, "p11", AINCD_END_PRAR_DT);
- ITSDb_SQLBind(pADO, "p12", AINCD_TYPE_CLSF_CD);
- ITSDb_SQLBind(pADO, "p13", AINCD_TYPE_CD);
- ITSDb_SQLBind(pADO, "p14", AINCD_SERN_CD);
- ITSDb_SQLBind(pADO, "p15", ALINK_ID);
- ITSDb_SQLBind(pADO, "p16", AINCD_TITL);
- ITSDb_SQLExec(pADO);
- ITSDb_GetConnection()->CommitTrans();
- //Application->MessageBox(FrmLang->lblDbSave->Caption.c_str(),//L"돌발 확정 정보를 저장 하였습니다.",
- // FTitle.c_str(), MB_OK|MB_ICONINFORMATION|MB_APPLMODAL);
- }
- catch(EDatabaseError &E)
- {
- ITSDb_GetConnection()->RollbackTrans();
- ShowMessage(String(E.ClassName()) + E.Message);
- }
- catch(Exception &exception)
- {
- ITSDb_GetConnection()->RollbackTrans();
- ShowMessage(String(exception.ClassName()) + exception.Message);
- }
- catch(...)
- {
- ITSDb_GetConnection()->RollbackTrans();
- ::PostMessage(Application->MainForm->Handle, (UINT)(WM_USER+0xF4), (WPARAM)0xB2, (LPARAM)0xB2);
- ShowMessage(FrmLang->lblDbErr->Caption);//"데이터 작업 중에 알수없는 DB 오류가 발생하였습니다.");
- }
- }
- __finally
- {
- if (pADO)
- {
- pADO->Close();
- delete pADO;
- }
- }
- return true;
- }
- //---------------------------------------------------------------------------
- bool __fastcall TFRAMEIncidentProcess::UpdateAutoIncident(String AINCD_OCRR_ID, String ARGST_DT)
- {
- String sQry;
- TADOQuery *pADO = NULL;
- try
- {
- try
- {
- pADO = new TADOQuery(NULL);
- pADO->Close();
- pADO->Connection = ITSDb_GetConnection();
- ITSDb_GetConnection()->BeginTrans();
- sQry = "UPDATE TB_INCD_ESTM_SECT \r\n"
- " SET REAL_YN = 'Y' \r\n"
- " WHERE LINK_ID = :p01 \r\n"
- " AND DETC_DT = :p02 \r\n";
- ITSDb_SQLText(pADO, sQry);
- ITSDb_SQLBind(pADO, "p01", AINCD_OCRR_ID);
- ITSDb_SQLBind(pADO, "p02", ARGST_DT);
- ITSDb_SQLExec(pADO);
- ITSDb_GetConnection()->CommitTrans();
- //Application->MessageBox(FrmLang->lblDbSave->Caption.c_str(),//L"돌발정보를 오보 판정 돌발 정보로 저장 하였습니다.",
- // FTitle.c_str(), MB_OK|MB_ICONINFORMATION|MB_APPLMODAL);
- }
- catch(EDatabaseError &E)
- {
- ITSDb_GetConnection()->RollbackTrans();
- ShowMessage(String(E.ClassName()) + E.Message);
- }
- catch(Exception &exception)
- {
- ITSDb_GetConnection()->RollbackTrans();
- ShowMessage(String(exception.ClassName()) + exception.Message);
- }
- catch(...)
- {
- ITSDb_GetConnection()->RollbackTrans();
- ::PostMessage(Application->MainForm->Handle, (UINT)(WM_USER+0xF4), (WPARAM)0xB2, (LPARAM)0xB2);
- ShowMessage(FrmLang->lblDbErr->Caption);//"데이터 작업 중에 알수없는 DB 오류가 발생하였습니다.");
- }
- }
- __finally
- {
- if (pADO)
- {
- pADO->Close();
- delete pADO;
- }
- }
- return true;
- }
- //---------------------------------------------------------------------------
- bool __fastcall TFRAMEIncidentProcess::InsertAutoIncident(String AINCD_OCRR_ID, String ARGST_DT)
- {
- String sQry;
- TADOQuery *pADO = NULL;
- try
- {
- try
- {
- pADO = new TADOQuery(NULL);
- pADO->Close();
- pADO->Connection = ITSDb_GetConnection();
- ITSDb_GetConnection()->BeginTrans();
- sQry = "INSERT INTO TB_INCD_OCRR(INCD_OCRR_ID, RGST_DT, INCD_PRGR_STEP_CD) \r\n"
- " VALUES(:p01, :p02, 'ISS1' ) \r\n";
- ITSDb_SQLText(pADO, sQry);
- ITSDb_SQLBind(pADO, "p01", AINCD_OCRR_ID);
- ITSDb_SQLBind(pADO, "p02", ARGST_DT);
- ITSDb_SQLExec(pADO);
- ITSDb_GetConnection()->CommitTrans();
- //Application->MessageBox(FrmLang->lblDbSave->Caption.c_str(),//L"돌발정보를 오보 판정 돌발 정보로 저장 하였습니다.",
- // FTitle.c_str(), MB_OK|MB_ICONINFORMATION|MB_APPLMODAL);
- }
- catch(EDatabaseError &E)
- {
- ITSDb_GetConnection()->RollbackTrans();
- ShowMessage(String(E.ClassName()) + E.Message);
- }
- catch(Exception &exception)
- {
- ITSDb_GetConnection()->RollbackTrans();
- ShowMessage(String(exception.ClassName()) + exception.Message);
- }
- catch(...)
- {
- ITSDb_GetConnection()->RollbackTrans();
- ::PostMessage(Application->MainForm->Handle, (UINT)(WM_USER+0xF4), (WPARAM)0xB2, (LPARAM)0xB2);
- ShowMessage(FrmLang->lblDbErr->Caption);//"데이터 작업 중에 알수없는 DB 오류가 발생하였습니다.");
- }
- }
- __finally
- {
- if (pADO)
- {
- pADO->Close();
- delete pADO;
- }
- }
- return true;
- }
- //---------------------------------------------------------------------------
- void __fastcall TFRAMEIncidentProcess::MnuListAddClick(TObject *Sender)
- {
- if (EdINCD_OCRR_ID->Text.Trim().IsEmpty())
- {
- Application->MessageBox(L"돌발정보입력\r\n목록에서 돌발정보를 선택하신 후에 작업을 진행하세요.",
- FTitle.c_str(), MB_OK|MB_ICONERROR|MB_APPLMODAL);
- return;
- }
- TITSSEL1M *pSelForm = NULL;
- try
- {
- try {
- pSelForm = new TITSSEL1M(this);
- pSelForm->m_bSelected = false;
- pSelForm->MultiSelect = false;
- pSelForm->ShowModal();
- if (pSelForm->m_bSelected)
- {
- String sLinkId = pSelForm->m_sSelLinkId;
- TItsLink *pLink = ItsLinkManager->FLists.Find(sLinkId);
- if (!pLink)
- {
- Application->MessageBox(L"정보가 없는 구간을 선택하였습니다. 다른 구간을 선택하세요.",
- FTitle.c_str(), MB_OK|MB_ICONERROR|MB_APPLMODAL);
- return;
- }
- EdLinkId->Text = sLinkId;
- EdLINK_ID->Text = sLinkId;
- TItsNode *pNode;
- String sFNode = "";
- pNode = ItsNodeManager->FLists.Find(pLink->F_NODEID);
- if (pNode)
- {
- sFNode = sFNode + pNode->NODE_NAME;
- SePosX->Value = StrToFloat(pNode->FX_CRDN);
- SePosY->Value = StrToFloat(pNode->FY_CRDN);
- }
- String sTNode = "";
- pNode = ItsNodeManager->FLists.Find(pLink->T_NODEID);
- if (pNode) sTNode = sTNode + pNode->NODE_NAME;
- EdLINK_ID->Text = "[" + sLinkId + "] " + sFNode + "→" + sTNode;
- }
- } catch(...) { }
- }
- __finally
- {
- if (pSelForm) delete pSelForm;
- }
- }
- //---------------------------------------------------------------------------
- void __fastcall TFRAMEIncidentProcess::MnuGisAddClick(TObject *Sender)
- {
- if (EdINCD_OCRR_ID->Text.Trim().IsEmpty())
- {
- Application->MessageBox(L"돌발정보입력\r\n목록에서 돌발정보를 선택하신 후에 작업을 진행하세요.",
- FTitle.c_str(), MB_OK|MB_ICONERROR|MB_APPLMODAL);
- return;
- }
- TITSSELAM *pSelForm = NULL;
- try
- {
- try {
- pSelForm = new TITSSELAM(this);
- pSelForm->MultiSelect = true;
- pSelForm->LinkLevel = 1;
- pSelForm->FRefreshId = EdLinkId->Text;
- pSelForm->FSelPosX = VarToStr(SePosX->Value);
- pSelForm->FSelPosY = VarToStr(SePosY->Value);
- String sOrgLinkId = EdLinkId->Text;
- int nRow;
- TcxDataController *pGDC = pSelForm->TvList->DataController;
- for (int ii = 0; ii < FSelLink.nSelLink; ii++)
- {
- if (FSelLink.info[ii].sLinkId == "") continue;
- nRow = pGDC->AppendRecord();
- pGDC->Values[nRow][pSelForm->Column01->Index] = FSelLink.info[ii].sLinkId;
- pGDC->Values[nRow][pSelForm->Column02->Index] = FSelLink.info[ii].FPosX;
- pGDC->Values[nRow][pSelForm->Column03->Index] = FSelLink.info[ii].FPosY;
- }
- pSelForm->ShowModal();
- Application->ProcessMessages();
- if (pSelForm->Selected)
- {
- #if 0
- String sLinkId = pSelForm->TvList->DataController->Values[0][pSelForm->Column01->Index];
- TItsLink *pLink = ItsLinkManager->FLists.Find(sLinkId);
- if (!pLink)
- {
- Application->MessageBox(L"정보가 없는 구간을 선택하였습니다. 다른 구간을 선택하세요.",
- FTitle.c_str(), MB_OK|MB_ICONERROR|MB_APPLMODAL);
- return;
- }
- SePosX->Value = pSelForm->FPosX;
- SePosY->Value = pSelForm->FPosY;
- EdLinkId->Text = sLinkId;
- EdLINK_ID->Text = sLinkId;
- TItsNode *pNode;
- String sFNode = "";
- pNode = ItsNodeManager->FLists.Find(pLink->F_NODEID);
- if (pNode)
- {
- sFNode = sFNode + pNode->NODE_NAME;
- }
- String sTNode = "";
- pNode = ItsNodeManager->FLists.Find(pLink->T_NODEID);
- if (pNode) sTNode = sTNode + pNode->NODE_NAME;
- EdLINK_ID->Text = "[" + sLinkId + "] " + sFNode + "→" + sTNode;
- #else
- String sFLinkId = "";
- double dX = 0;
- double dY = 0;
- try
- {
- int nRow;
- TcxDataController *pGDC = pSelForm->TvList->DataController;
- pSelForm->TvList->BeginUpdate();
- try
- {
- int ii;
- for (ii = 0; ii < pGDC->RecordCount; ii++)
- {
- String sTmpLinkId = pGDC->Values[ii][pSelForm->Column01->Index];
- if (sOrgLinkId == sTmpLinkId)
- {
- sFLinkId = sTmpLinkId;
- String sX = pGDC->Values[ii][pSelForm->Column02->Index];
- String sY = pGDC->Values[ii][pSelForm->Column03->Index];
- dX = sX.ToDouble();
- dY = sY.ToDouble();
- break;
- }
- }
- FSelLink.nSelLink = 0;
- //무조건 첫번째는 업데이트를 해야 하기 때문에 ID를 추가하자
- //나머지는 ID ==""로 처리해서 Insert 하도록 하자
- FSelLink.info[FSelLink.nSelLink].sIncidentId = EdINCD_OCRR_ID->Text;
- if (sFLinkId != "")
- {
- FSelLink.info[FSelLink.nSelLink].sLinkId = sFLinkId;
- FSelLink.info[FSelLink.nSelLink].FPosX = dX;
- FSelLink.info[FSelLink.nSelLink].FPosY = dY;
- FSelLink.nSelLink++;
- }
- {
- for (ii = 0; ii < pGDC->RecordCount; ii++)
- {
- String sTmpLinkId = pGDC->Values[ii][pSelForm->Column01->Index];
- if (sFLinkId != "" && sFLinkId == sTmpLinkId)
- {
- //이미 위에서 첫번째 인덱스에 저장했다
- continue;
- }
- String sX = pGDC->Values[ii][pSelForm->Column02->Index];
- String sY = pGDC->Values[ii][pSelForm->Column03->Index];
- dX = sX.ToDouble();
- dY = sY.ToDouble();
- FSelLink.info[FSelLink.nSelLink].sLinkId = sTmpLinkId;
- FSelLink.info[FSelLink.nSelLink].FPosX = dX;
- FSelLink.info[FSelLink.nSelLink].FPosY = dY;
- FSelLink.nSelLink++;
- }
- }
- TItsLink *pLink = ItsLinkManager->FLists.Find(FSelLink.info[0].sLinkId);
- if (!pLink)
- {
- Application->MessageBox(L"정보가 없는 구간을 선택하였습니다. 다른 구간을 선택하세요.",
- FTitle.c_str(), MB_OK|MB_ICONERROR|MB_APPLMODAL);
- return;
- }
- SePosX->Value = FSelLink.info[0].FPosX;
- SePosY->Value = FSelLink.info[0].FPosY;
- EdLinkId->Text = FSelLink.info[0].sLinkId;
- EdLINK_ID->Text = FSelLink.info[0].sLinkId;
- TItsNode *pNode;
- String sFNode = "";
- pNode = ItsNodeManager->FLists.Find(pLink->LINK_ID);
- if (pNode)
- {
- sFNode = sFNode + pNode->NODE_NAME;
- }
- String sTNode = "";
- pNode = ItsNodeManager->FLists.Find(pLink->T_NODEID);
- if (pNode) sTNode = sTNode + pNode->NODE_NAME;
- EdLINK_ID->Text = "[" + FSelLink.info[0].sLinkId + "] " + sFNode + "→" + sTNode;
- }
- catch(...)
- {
- }
- }
- __finally
- {
- pSelForm->TvList->EndUpdate();
- }
- #endif
- }
- } catch(...) { }
- }
- __finally
- {
- if (pSelForm) delete pSelForm;
- }
- }
- //---------------------------------------------------------------------------
- void __fastcall TFRAMEIncidentProcess::BtnMoveGisClick(TObject *Sender)
- {
- #if 0
- if (EdLinkId->Text.IsEmpty()) return;
- g_SelLink.pForm = NULL;
- g_SelLink.Level = 1;
- g_SelLink.Id = EdLinkId->Text;
- POST_MSG(Application->MainForm->Handle, WM_PLUGINFORM, WP_MSG_15, LP_MSG_15);
- #else
- float sDx = SePosX->Value;
- float sDy = SePosY->Value;
- if (sDx != 0 && sDy != 0)
- {
- if (ITS00MAP) ITS00MAP->SelectObjectByPos(sDx, sDy, true);
- }
- else
- {
- if (EdLinkId->Text.IsEmpty()) return;
- if (ITS00MAP) ITS00MAP->SelectLinkById(1, EdLinkId->Text, true);
- #if 0
- g_SelLink.pForm = NULL;
- g_SelLink.Level = 1;
- g_SelLink.Id = EdLinkId->Text;
- POST_MSG(Application->MainForm->Handle, WM_PLUGINFORM, WP_MSG_15, LP_MSG_15);
- #endif
- }
- #endif
- }
- //---------------------------------------------------------------------------
- void __fastcall TFRAMEIncidentProcess::BtnVmsTargetClick(TObject *Sender)
- {
- if (!ChkVMS_DSPL_YN->Checked) return;
- if (EdLinkId->Text.IsEmpty()) return;
- String sLinkId = EdLinkId->Text.Trim();
- //if (FLinkId == "") return;
- //String sLinkId = FLinkId;
- try
- {
- if (FrmIncidVmsInfo == NULL)
- {
- FrmIncidVmsInfo = new TFrmIncidVmsInfo(Application);
- }
- FrmIncidVmsInfo->Show();
- FrmIncidVmsInfo->ShowIncidVmsInfo(sLinkId);
- }
- catch(...)
- {
- }
- }
- //---------------------------------------------------------------------------
|