FRAME_IncidentListF.cpp 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. //---------------------------------------------------------------------------
  2. #include <vcl.h>
  3. #include "ITSSkinF.h"
  4. #include "ITSUtilF.h"
  5. #include "FrmResourceF.h"
  6. #include "ITSLangTransF.h"
  7. #pragma hdrstop
  8. #include "FRAME_IncidentListF.h"
  9. #include "CDSNodeF.h"
  10. #include "CDSLinkF.h"
  11. #include "CDSIncidentF.h"
  12. //---------------------------------------------------------------------------
  13. #pragma package(smart_init)
  14. #pragma link "cxClasses"
  15. #pragma link "cxControls"
  16. #pragma link "cxCustomData"
  17. #pragma link "cxData"
  18. #pragma link "cxDataStorage"
  19. #pragma link "cxEdit"
  20. #pragma link "cxFilter"
  21. #pragma link "cxGraphics"
  22. #pragma link "cxGrid"
  23. #pragma link "cxGridCustomTableView"
  24. #pragma link "cxGridCustomView"
  25. #pragma link "cxGridLevel"
  26. #pragma link "cxGridTableView"
  27. #pragma link "cxLabel"
  28. #pragma link "cxLookAndFeelPainters"
  29. #pragma link "cxLookAndFeels"
  30. #pragma link "cxStyles"
  31. #pragma link "dxSkinBlack"
  32. #pragma link "dxSkinBlue"
  33. #pragma link "dxSkinsCore"
  34. #pragma link "dxSkinscxPCPainter"
  35. #pragma resource "*.dfm"
  36. //TFRAMEIncidentList *FRAMEIncidentList;
  37. //---------------------------------------------------------------------------
  38. __fastcall TFRAMEIncidentList::TFRAMEIncidentList(TComponent* Owner)
  39. : TFrame(Owner)
  40. {
  41. LangTrans->Translate(this, ITSDb_GetConnection());
  42. m_pGDC = TvList->DataController;
  43. TvList->OptionsView->NoDataToDisplayInfoText = FrmLang->lblNoInfo->Caption;//"<현재 발생한 돌발정보가 없습니다>";
  44. FCodeIST = ItsCodeManager->FLists.Find("IST"); //돌발상황 원본 코드 : IST
  45. FCodeLTCU = ItsCodeManager->FLists.Find("LTCU");//LTCU"); //소통 등급 코드 : LTCU
  46. FCodeICM = ItsCodeManager->FLists.Find("ICM"); //돌발상황 확인 방법 코드 : ICM
  47. FCodeIDTU = ItsCodeManager->FLists.Find("IDTU"); //돌발상황 유형 분류 코드 : IDTU
  48. FCodeACTU = ItsCodeManager->FLists.Find("ACTU"); //돌발상황 유형 코드 : ACTU, CRTU, EVTU, WETU 중 하나
  49. FCodeCRTU = ItsCodeManager->FLists.Find("CRTU"); //돌발상황 유형 코드 : ACTU, CRTU, EVTU, WETU 중 하나
  50. FCodeEVTU = ItsCodeManager->FLists.Find("EVTU"); //돌발상황 유형 코드 : ACTU, CRTU, EVTU, WETU 중 하나
  51. FCodeWETU = ItsCodeManager->FLists.Find("WETU"); //돌발상황 유형 코드 : ACTU, CRTU, EVTU, WETU 중 하나
  52. FCodeSRLU = ItsCodeManager->FLists.Find("SRLU"); //돌발상황 심각도 코드 : SRLU
  53. FCodePRTU = ItsCodeManager->FLists.Find("PRTU"); //통행 제한 유형 코드 : PRTU
  54. FCodeRSL = ItsCodeManager->FLists.Find("RSL"); //대응 수준 코드 : RSL
  55. FCodeISS = ItsCodeManager->FLists.Find("ISS"); //돌발상황 진행 단계 코드 : ISS
  56. FCodeICM = ItsCodeManager->FLists.Find("ICM"); //돌발상황 종료 확인 방법 코드 : ICM
  57. FCodeDFW = ItsCodeManager->FLists.Find("DFW"); //기상 코드 : DFW
  58. FCodeVIT = ItsCodeManager->FLists.Find("VIT"); //VMS 돌발 유형 코드 : VIT
  59. FCodeIDT = ItsCodeManager->FLists.Find("IDT"); //VMS 돌발 유형 세부 코드 : IDT
  60. FCodeEDT = ItsCodeManager->FLists.Find("EDT"); //VMS 돌발 유형 세부 코드 : EDT
  61. }
  62. //---------------------------------------------------------------------------
  63. void __fastcall TFRAMEIncidentList::UpdateList()
  64. {
  65. TItsSubCode *pSubCode;
  66. CMM_ClearGridTableView(TvList);
  67. int nRow = 0;
  68. try
  69. {
  70. TvList->BeginUpdate();
  71. try
  72. {
  73. ItsIncidentManager->FLists.Lock();
  74. FOR_STL(TItsIncident *, pIncident, ItsIncidentManager->FLists)
  75. {
  76. if (pIncident->INCD_PRGR_STEP_CD != "ISS2") continue;
  77. if (pIncident->DISP_INCD == "N") continue;
  78. nRow = m_pGDC->AppendRecord();
  79. String sIST = "";
  80. if (pIncident->INCD_ORGN_CD != "") sIST = "[" + pIncident->INCD_ORGN_CD + "] ";
  81. String sLTCU= "";
  82. if (pIncident->CMTR_GRAD_CD != "") sLTCU = "[" + pIncident->CMTR_GRAD_CD + "] ";
  83. String sICM = "";
  84. if (pIncident->INCD_CNFM_MTHD_CD != "") sICM = "[" + pIncident->INCD_CNFM_MTHD_CD + "] ";
  85. String sSRLU= "";
  86. if (pIncident->INCD_SERN_CD != "") sSRLU = "[" + pIncident->INCD_SERN_CD + "] ";
  87. String sIDTU = "";
  88. if (pIncident->INCD_TYPE_CLSF_CD != "") sIDTU = "[" + pIncident->INCD_TYPE_CLSF_CD + "] ";
  89. String sACTU = "";
  90. if (pIncident->INCD_TYPE_CD != "") sACTU = "[" + pIncident->INCD_TYPE_CD + "] ";
  91. String sISS = "";
  92. if (pIncident->INCD_PRGR_STEP_CD != "") sISS = "[" + pIncident->INCD_PRGR_STEP_CD + "] ";
  93. String sDFW = "";
  94. if (pIncident->WTHR_CD != "") sDFW = "[" + pIncident->WTHR_CD + "] ";
  95. String sRSL = "";
  96. if (pIncident->RESP_LVL_CD != "") sRSL = "[" + pIncident->RESP_LVL_CD + "] ";
  97. String sPRTU = "";
  98. if (pIncident->TRVL_LMNT_TYPE_CD != "") sPRTU = "[" + pIncident->TRVL_LMNT_TYPE_CD + "] ";
  99. if (FCodeIST)
  100. {
  101. pSubCode = FCodeIST->FSubLists.Find(pIncident->INCD_ORGN_CD);
  102. if (pSubCode) sIST = sIST + pSubCode->CMMN_CD_KOR_NM;
  103. }
  104. if (FCodeLTCU)
  105. {
  106. pSubCode = FCodeLTCU->FSubLists.Find(pIncident->CMTR_GRAD_CD);
  107. if (pSubCode) sLTCU = sLTCU + pSubCode->CMMN_CD_KOR_NM;
  108. }
  109. if (FCodeICM)
  110. {
  111. pSubCode = FCodeICM->FSubLists.Find(pIncident->INCD_CNFM_MTHD_CD);
  112. if (pSubCode) sICM = sICM + pSubCode->CMMN_CD_KOR_NM;
  113. }
  114. if (FCodeSRLU)
  115. {
  116. pSubCode = FCodeSRLU->FSubLists.Find(pIncident->INCD_SERN_CD);
  117. if (pSubCode) sSRLU = sSRLU + pSubCode->CMMN_CD_KOR_NM;
  118. }
  119. if (FCodeIDTU)
  120. {
  121. pSubCode = FCodeIDTU->FSubLists.Find(pIncident->INCD_TYPE_CLSF_CD);
  122. if (pSubCode) sIDTU = sIDTU + pSubCode->CMMN_CD_KOR_NM;
  123. }
  124. if (!pIncident->INCD_TYPE_CLSF_CD.IsEmpty() && !pIncident->INCD_TYPE_CD.IsEmpty())
  125. {
  126. if (pIncident->INCD_TYPE_CLSF_CD == "1")
  127. {
  128. if (FCodeACTU)
  129. {
  130. pSubCode = FCodeACTU->FSubLists.Find(pIncident->INCD_TYPE_CD);
  131. if (pSubCode) sACTU = sACTU + pSubCode->CMMN_CD_KOR_NM;
  132. }
  133. }
  134. else if (pIncident->INCD_TYPE_CLSF_CD == "2")
  135. {
  136. if (FCodeCRTU)
  137. {
  138. pSubCode = FCodeCRTU->FSubLists.Find(pIncident->INCD_TYPE_CD);
  139. if (pSubCode) sACTU = sACTU + pSubCode->CMMN_CD_KOR_NM;
  140. }
  141. }
  142. else if (pIncident->INCD_TYPE_CLSF_CD == "3")
  143. {
  144. if (FCodeEVTU)
  145. {
  146. pSubCode = FCodeEVTU->FSubLists.Find(pIncident->INCD_TYPE_CD);
  147. if (pSubCode) sACTU = sACTU + pSubCode->CMMN_CD_KOR_NM;
  148. }
  149. }
  150. else if (pIncident->INCD_TYPE_CLSF_CD == "4")
  151. {
  152. if (FCodeWETU)
  153. {
  154. pSubCode = FCodeWETU->FSubLists.Find(pIncident->INCD_TYPE_CD);
  155. if (pSubCode) sACTU = sACTU + pSubCode->CMMN_CD_KOR_NM;
  156. }
  157. }
  158. }
  159. if (FCodeISS)
  160. {
  161. pSubCode = FCodeISS->FSubLists.Find(pIncident->INCD_PRGR_STEP_CD);
  162. if (pSubCode) sISS = sISS + pSubCode->CMMN_CD_KOR_NM;
  163. }
  164. if (FCodeDFW)
  165. {
  166. pSubCode = FCodeISS->FSubLists.Find(pIncident->WTHR_CD);
  167. if (pSubCode) sDFW = sDFW + pSubCode->CMMN_CD_KOR_NM;
  168. }
  169. if (FCodeRSL)
  170. {
  171. pSubCode = FCodeRSL->FSubLists.Find(pIncident->RESP_LVL_CD);
  172. if (pSubCode) sRSL = sRSL + pSubCode->CMMN_CD_KOR_NM;
  173. }
  174. if (FCodePRTU)
  175. {
  176. pSubCode = FCodePRTU->FSubLists.Find(pIncident->TRVL_LMNT_TYPE_CD);
  177. if (pSubCode) sPRTU = sPRTU + pSubCode->CMMN_CD_KOR_NM;
  178. }
  179. m_pGDC->Values[nRow][Column01->Index] = pIncident->INCD_OCRR_ID; //돌발상황 발생 ID
  180. m_pGDC->Values[nRow][Column02->Index] = ITSUtil_StrToTime(pIncident->RGST_DT); //등록 일시
  181. m_pGDC->Values[nRow][Column03->Index] = sISS;//pIncident->INCD_PRGR_STEP_CD; //돌발상황 진행 단계 코드 : ISS
  182. m_pGDC->Values[nRow][Column04->Index] = sIST;//pIncident->INCD_ORGN_CD; //돌발상황 원본 코드 : IST
  183. m_pGDC->Values[nRow][Column05->Index] = pIncident->OCRR_LCTN_NM; //발생 위치 명
  184. m_pGDC->Values[nRow][Column06->Index] = pIncident->LINK_ID; //돌발발생 LINK ID
  185. m_pGDC->Values[nRow][Column07->Index] = pIncident->X_CRDN; //X 좌표
  186. m_pGDC->Values[nRow][Column08->Index] = pIncident->Y_CRDN; //Y 좌표
  187. m_pGDC->Values[nRow][Column09->Index] = pIncident->INCD_EXPL; //돌발상황 설명
  188. m_pGDC->Values[nRow][Column10->Index] = sLTCU;//pIncident->CMTR_GRAD_CD; //소통 등급 코드 : LTCU
  189. m_pGDC->Values[nRow][Column11->Index] = pIncident->IFMR_NM; //제보자 명
  190. m_pGDC->Values[nRow][Column12->Index] = sICM;//pIncident->INCD_CNFM_MTHD_CD; //돌발상황 확인 방법 코드 : ICM
  191. m_pGDC->Values[nRow][Column13->Index] = sSRLU;//pIncident->INCD_SERN_CD; //돌발상황 심각도 코드 : SRLU
  192. m_pGDC->Values[nRow][Column14->Index] = pIncident->INCD_TITL; //돌발상황 제목
  193. m_pGDC->Values[nRow][Column15->Index] = sIDTU;//pIncident->INCD_TYPE_CLSF_CD; //돌발상황 유형 분류 코드 : IDTU
  194. m_pGDC->Values[nRow][Column16->Index] = sACTU;//pIncident->INCD_TYPE_CD; //돌발상황 유형 코드 : ACTU, CRTU, EVTU, WETU 중 하나
  195. m_pGDC->Values[nRow][Column17->Index] = ITSUtil_StrToTime(pIncident->INCD_STRT_DT); //돌발상황 시작 일시
  196. m_pGDC->Values[nRow][Column18->Index] = ITSUtil_StrToTime(pIncident->INCD_END_PRAR_DT); //돌발상황 종료 예정 일시
  197. m_pGDC->Values[nRow][Column19->Index] = pIncident->INCD_OCRR_LANE; //돌발상황 발생 차로
  198. m_pGDC->Values[nRow][Column20->Index] = pIncident->INCD_CLSR_LANE; //돌발상황 차단 차로
  199. m_pGDC->Values[nRow][Column21->Index] = pIncident->DELY_LNGT; //지체 길이
  200. m_pGDC->Values[nRow][Column22->Index] = pIncident->INCD_LNGT; //돌발상황 길이
  201. m_pGDC->Values[nRow][Column23->Index] = pIncident->SMLT_VHCL_UNUM; //소형 차량 대수
  202. m_pGDC->Values[nRow][Column24->Index] = pIncident->MDLT_VHCL_UNUM; //중대형 차량 대수
  203. m_pGDC->Values[nRow][Column25->Index] = pIncident->INJR_PNUM; //부상자 인원수
  204. m_pGDC->Values[nRow][Column26->Index] = pIncident->FTLT_PNUM; //사망자 인원수
  205. m_pGDC->Values[nRow][Column27->Index] = sDFW;//pIncident->WTHR_CD; //기상 코드 : DFW
  206. m_pGDC->Values[nRow][Column28->Index] = sRSL;//pIncident->RESP_LVL_CD; //대응 수준 코드 : RSL
  207. m_pGDC->Values[nRow][Column29->Index] = pIncident->UTIS_CNCT_YN; //UTIS 연계 여부
  208. m_pGDC->Values[nRow][Column30->Index] = pIncident->TRUB_VHCL_YN; //고장 차량 여부
  209. m_pGDC->Values[nRow][Column31->Index] = pIncident->FALT_YN; //낙하물 여부
  210. m_pGDC->Values[nRow][Column32->Index] = pIncident->FRWT_YN; //화재위험물 여부
  211. m_pGDC->Values[nRow][Column33->Index] = sPRTU;//pIncident->TRVL_LMNT_TYPE_CD; //통행 제한 유형 코드 : PRTU
  212. m_pGDC->Values[nRow][Column34->Index] = pIncident->VMS_DSPL_YN; //VMS 표출 여부
  213. }
  214. }
  215. __finally
  216. {
  217. ItsIncidentManager->FLists.UnLock();
  218. }
  219. }
  220. __finally
  221. {
  222. TvList->EndUpdate();
  223. TvList->DataController->GotoFirst();
  224. TvList->DataController->FocusedRecordIndex = 0;
  225. }
  226. }
  227. //---------------------------------------------------------------------------