FRAME_IncidentListF.cpp 14 KB

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