FRAME_IncidentListF.cpp 13 KB

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