TAS0010MF.cpp 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609
  1. //---------------------------------------------------------------------------
  2. #include <vcl.h>
  3. #include "ITSSkinF.h"
  4. #include "ITSUtilF.h"
  5. #include "ITSDbF.h"
  6. #include "AppGlobalF.h"
  7. #pragma hdrstop
  8. #include "TAS0010MF.h"
  9. //---------------------------------------------------------------------------
  10. #pragma package(smart_init)
  11. #pragma link "cxButtons"
  12. #pragma link "cxCalc"
  13. #pragma link "cxCalendar"
  14. #pragma link "cxClasses"
  15. #pragma link "cxContainer"
  16. #pragma link "cxControls"
  17. #pragma link "cxCustomData"
  18. #pragma link "cxData"
  19. #pragma link "cxDataStorage"
  20. #pragma link "cxDropDownEdit"
  21. #pragma link "cxEdit"
  22. #pragma link "cxFilter"
  23. #pragma link "cxGraphics"
  24. #pragma link "cxGrid"
  25. #pragma link "cxGridCustomTableView"
  26. #pragma link "cxGridCustomView"
  27. #pragma link "cxGridLevel"
  28. #pragma link "cxGridTableView"
  29. #pragma link "cxGroupBox"
  30. #pragma link "cxLabel"
  31. #pragma link "cxLookAndFeelPainters"
  32. #pragma link "cxLookAndFeels"
  33. #pragma link "cxMaskEdit"
  34. #pragma link "cxSpinEdit"
  35. #pragma link "cxSplitter"
  36. #pragma link "cxStyles"
  37. #pragma link "cxTextEdit"
  38. #pragma link "cxTimeEdit"
  39. #pragma link "cxTrackBar"
  40. #pragma link "dxSkinBlack"
  41. #pragma link "dxSkinBlue"
  42. #pragma link "dxSkinsCore"
  43. #pragma link "dxSkinscxPCPainter"
  44. #pragma link "FRAME_FlashMapF"
  45. #pragma resource "*.dfm"
  46. TTAS0010M *TAS0010M = NULL;
  47. //---------------------------------------------------------------------------
  48. __fastcall TTAS0010M::TTAS0010M(TComponent* Owner)
  49. : TForm(Owner)
  50. {
  51. ITSSkin_Load(this);
  52. CMM_LoadForm(g_sFormsDir, this);
  53. FTitle = "혼잡지도분석";
  54. FRAMEGisMap1->DrawMode = 2; //소통정보표출
  55. //FRAMEGisMap1->GrpTool->Visible = false;
  56. FRAMEGisMap1->ImgZoomIn->Left = 9;
  57. FRAMEGisMap1->ImgZoomOut->Left = FRAMEGisMap1->ImgZoomIn->Left + 35;
  58. FRAMEGisMap1->ImgStnd->Left = FRAMEGisMap1->ImgZoomOut->Left + 35;
  59. FRAMEGisMap1->ImgZoomIn->Visible = true;
  60. FRAMEGisMap1->ImgZoomOut->Visible = true;
  61. FRAMEGisMap1->ImgStnd->Visible = true;
  62. FTargetIdx = -1;
  63. }
  64. //---------------------------------------------------------------------------
  65. /*
  66. * 닫기버튼 이나 x버튼 클릭시 공통으로 처리하는 로직이들어간다..
  67. * Form과 DataModule class를 delete시킨다.
  68. * arguments
  69. *
  70. * return
  71. * void
  72. */
  73. void __fastcall TTAS0010M::CommClose()
  74. {
  75. try
  76. {
  77. if (BtnStop->Enabled)
  78. BtnStopClick((TObject*)BtnStop);
  79. CMM_SaveForm(g_sFormsDir, this);
  80. }
  81. catch(...)
  82. {
  83. }
  84. }
  85. //---------------------------------------------------------------------------
  86. /*
  87. * Form을 보여줄때 호출되는 event 메서드이다.
  88. * arguments
  89. * Sender : event handler 객체
  90. * return
  91. * void
  92. */
  93. void __fastcall TTAS0010M::FormShow(TObject *Sender)
  94. {
  95. Refresh();
  96. FormInit();
  97. TmrShow->Enabled = true;
  98. }
  99. //---------------------------------------------------------------------------
  100. /*
  101. * form 초기화
  102. *
  103. * arguments
  104. *
  105. * return
  106. * void
  107. */
  108. void __fastcall TTAS0010M::FormInit()
  109. {
  110. ADOQry->Connection = ITSDb_GetConnection();
  111. ADOSta->Connection = ITSDb_GetConnection();
  112. m_pGDC = TvList->DataController;
  113. TDateTime dtNow = Now() - ((double)3 / (double)24);
  114. DtStDate->Date = dtNow;
  115. DtEdDate->Date = Now();
  116. //DtStTime->EditValue = dtNow.FormatString("hh") + ":00";
  117. dtNow = Now() - ((double)2 / (double)24);
  118. //DtEdTime->EditValue = dtNow.FormatString("hh") + ":59";
  119. DtStTime->Time = StrToDateTime(dtNow.FormatString("hh") + ":00");
  120. DtEdTime->Time = StrToDateTime(dtNow.FormatString("hh") + ":59");
  121. }
  122. //---------------------------------------------------------------------------
  123. /*
  124. * Form이 Show되고 난 후 최초 1회 수행되는 타이머 이벤트
  125. * arguments
  126. * Sender : event handler 객체
  127. * return
  128. * void
  129. */
  130. void __fastcall TTAS0010M::TmrShowTimer(TObject *Sender)
  131. {
  132. TmrShow->Enabled = false;
  133. if (TmrShow->Tag == 1)
  134. {
  135. int nIndex = m_pGDC->FocusedRecordIndex;
  136. if (nIndex < 0)
  137. {
  138. cxTrackBar1->Position = 0;
  139. FStatTime = "";
  140. BtnPlay->Enabled = true;
  141. BtnStop->Enabled = false;
  142. BtnSearch->Enabled = true;
  143. return;
  144. }
  145. if (m_pGDC->FocusedRecordIndex + 1 == m_pGDC->RecordCount)
  146. {
  147. cxTrackBar1->Position = 0;
  148. FStatTime = "";
  149. BtnPlay->Enabled = true;
  150. BtnStop->Enabled = false;
  151. BtnSearch->Enabled = true;
  152. return;
  153. }
  154. m_pGDC->FocusedRecordIndex++;
  155. nIndex = m_pGDC->FocusedRecordIndex;
  156. FSimIndex = nIndex;
  157. cxTrackBar1->Position = nIndex;
  158. FStatTime = VarToStr(m_pGDC->Values[nIndex][Column04->Index]);
  159. cxGroupBox1->Caption = "▶ 소통정보 표출 - " + VarToStr(m_pGDC->Values[nIndex][Column02->Index]);
  160. SelStatisticsHistory(FStatTime);
  161. BtnPlay->Enabled = false;
  162. BtnStop->Enabled = true;
  163. TmrShow->Interval = SeRefreshSec->Value * 1000;
  164. TmrShow->Enabled = true;
  165. }
  166. else
  167. {
  168. FRAMEGisMap1->LinkLevel = 2;
  169. FRAMEGisMap1->LoadGisMap();
  170. }
  171. }
  172. //---------------------------------------------------------------------------
  173. /*
  174. * Search 버튼 클릭 이벤트 핸들러
  175. * arguments
  176. * Sender : event handler 객체
  177. * return
  178. * void
  179. */
  180. void __fastcall TTAS0010M::BtnSearchClick(TObject *Sender)
  181. {
  182. Application->ProcessMessages();
  183. TSqlCursor sqlCrs((TControl*)BtnSearch);
  184. FStDateTime = DtStDate->Date.FormatString("yyyymmdd") + DtStTime->Time.FormatString("hhnn");
  185. FEdDateTime = DtEdDate->Date.FormatString("yyyymmdd") + DtEdTime->Time.FormatString("hhnn");
  186. if (FStDateTime > FEdDateTime)
  187. {
  188. Application->MessageBox(FrmLang->lblQryDtErr->Caption.c_str(),//L"검색 시작시각이 검색 종료시각 보다 큽니다.",
  189. FTitle.c_str(), MB_OK|MB_ICONWARNING|MB_APPLMODAL);
  190. ActiveControl = DtStDate;
  191. return;
  192. }
  193. if ( StrToInt(DtEdTime->Time.FormatString("hh")) - StrToInt(DtStTime->Time.FormatString("hh")) >= 3)
  194. {
  195. Application->MessageBox(L"3시간 이상의 정보를 조회할 수 없습니다.", FTitle.c_str(), MB_OK|MB_ICONWARNING|MB_APPLMODAL);
  196. ActiveControl = DtStDate;
  197. return;
  198. }
  199. FLinkLevel = String(CbLinkLevel->ItemIndex+1);
  200. FTargetIdx = CbTarget->ItemIndex;
  201. switch(FTargetIdx)
  202. {
  203. case 0: //이력 정보(통계 5분 정보)
  204. case 1: //통계 15분 정보
  205. FStDateTime = FStDateTime + "00";
  206. FEdDateTime = FEdDateTime + "59";
  207. break;
  208. case 2: //패턴 5분 정보
  209. case 3: //패턴 15분 정보
  210. FStDateTime = FStDateTime;
  211. FEdDateTime = FEdDateTime;
  212. break;
  213. }
  214. SelHistory();
  215. ClearGis();
  216. }
  217. //---------------------------------------------------------------------------
  218. /*
  219. * Close 버튼 클릭 이벤트 핸들러
  220. * arguments
  221. * Sender : event handler 객체
  222. * return
  223. * void
  224. */
  225. void __fastcall TTAS0010M::BtnCloseClick(TObject *Sender)
  226. {
  227. Close();
  228. }
  229. //---------------------------------------------------------------------------
  230. void __fastcall TTAS0010M::FormClose(TObject *Sender, TCloseAction &Action)
  231. {
  232. CommClose();
  233. TAS0010M = NULL;
  234. Action = caFree;
  235. }
  236. //---------------------------------------------------------------------------
  237. void __fastcall TTAS0010M::DtStDatePropertiesValidate(TObject *Sender, Variant &DisplayValue, TCaption &ErrorText, bool &Error)
  238. {
  239. DtEdDate->Date = DtStDate->Date;
  240. }
  241. //---------------------------------------------------------------------------
  242. void __fastcall TTAS0010M::SelHistory()
  243. {
  244. TSqlCursor sqlCrs;
  245. String sQry;
  246. TADOQuery *pADO = ADOQry;
  247. //select substr('20180108xxyy', 1, 6), substr('20180108xxyy', 9, 4) from dual
  248. switch(FTargetIdx)
  249. {
  250. case 0: //이력 정보(통계 5분 정보)
  251. sQry = "SELECT PRCN_DT AS PRCN_DT, COUNT(IFSC_ID) CNT \r\n"
  252. " FROM TB_IFSC_TRAF_HS A \r\n"
  253. " WHERE PRCN_DT BETWEEN :p01 AND :p03 \r\n"
  254. " GROUP BY PRCN_DT \r\n"
  255. " ORDER BY PRCN_DT \r\n";
  256. ITSDb_SQLText(pADO, sQry);
  257. ITSDb_SQLBind(pADO, "p01", FStDateTime);
  258. ITSDb_SQLBind(pADO, "p03", FEdDateTime);
  259. break;
  260. case 1: //통계 15분 정보
  261. sQry = "SELECT STAT_DT AS PRCN_DT, COUNT(IFSC_ID) CNT \r\n"
  262. " FROM TB_IFSC_15M_STAT A \r\n"
  263. " WHERE STAT_DT BETWEEN :p01 AND :p03 \r\n"
  264. " GROUP BY STAT_DT \r\n"
  265. " ORDER BY STAT_DT \r\n";
  266. ITSDb_SQLText(pADO, sQry);
  267. ITSDb_SQLBind(pADO, "p01", FStDateTime);
  268. ITSDb_SQLBind(pADO, "p03", FEdDateTime);
  269. break;
  270. case 2: //패턴 5분 정보
  271. sQry = "SELECT STAT_YM || ' ' || STAT_HM AS PRCN_DT, COUNT(IFSC_ID) CNT \r\n"
  272. " FROM TB_IFSC_5M_PTRN A \r\n"
  273. " WHERE STAT_YM = SUBSTR(:p01, 1, 6) \r\n"
  274. " AND STAT_HM BETWEEN SUBSTR(:p02, 9, 4) AND SUBSTR(:p03, 9, 4) \r\n"
  275. " GROUP BY STAT_YM || ' ' || STAT_HM \r\n"
  276. " ORDER BY STAT_YM || ' ' || STAT_HM \r\n";
  277. ITSDb_SQLText(pADO, sQry);
  278. ITSDb_SQLBind(pADO, "p01", FStDateTime);
  279. ITSDb_SQLBind(pADO, "p02", FStDateTime);
  280. ITSDb_SQLBind(pADO, "p03", FEdDateTime);
  281. break;
  282. case 3: //패턴 15분 정보
  283. sQry = "SELECT STAT_YM || ' ' || STAT_HM AS PRCN_DT, COUNT(IFSC_ID) CNT \r\n"
  284. " FROM TB_IFSC_15M_PTRN A \r\n"
  285. " WHERE STAT_YM = SUBSTR(:p01, 1, 6) \r\n"
  286. " AND STAT_HM BETWEEN SUBSTR(:p02, 9, 4) AND SUBSTR(:p03, 9, 4) \r\n"
  287. " GROUP BY STAT_YM || ' ' || STAT_HM \r\n"
  288. " ORDER BY STAT_YM || ' ' || STAT_HM \r\n";
  289. ITSDb_SQLText(pADO, sQry);
  290. ITSDb_SQLBind(pADO, "p01", FStDateTime);
  291. ITSDb_SQLBind(pADO, "p02", FStDateTime);
  292. ITSDb_SQLBind(pADO, "p03", FEdDateTime);
  293. break;
  294. }
  295. try
  296. {
  297. ITSDb_SQLOpen(pADO);
  298. DspHistory();
  299. }
  300. catch(EDatabaseError &E)
  301. {
  302. ::PostMessage(Application->MainForm->Handle, (UINT)(WM_USER+0xF4), (WPARAM)0xB2, (LPARAM)0xB2);
  303. DBERRORMSG(Caption, String(E.ClassName()), E.Message, sQry);
  304. throw Exception(String(E.ClassName()) + E.Message);
  305. }
  306. catch(Exception &exception)
  307. {
  308. ::PostMessage(Application->MainForm->Handle, (UINT)(WM_USER+0xF4), (WPARAM)0xB2, (LPARAM)0xB2);
  309. DBERRORMSG(Caption, String(exception.ClassName()), exception.Message, sQry);
  310. throw Exception(String(exception.ClassName()) + exception.Message);
  311. }
  312. }
  313. //---------------------------------------------------------------------------
  314. void __fastcall TTAS0010M::DspHistory()
  315. {
  316. TADOQuery *pADO = ADOQry;
  317. try
  318. {
  319. CMM_ClearGridTableView(TvList);
  320. int nRow = 0;
  321. try
  322. {
  323. TvList->BeginUpdate();
  324. m_pGDC->RecordCount = pADO->RecordCount;
  325. for( ; !pADO->Eof; pADO->Next(), nRow++)
  326. {
  327. m_pGDC->Values[nRow][Column01->Index] = nRow+1;
  328. //m_pGDC->Values[nRow][Column02->Index] = pADO->FieldByName("PRCN_DT2")->AsDateTime.DateTimeString(); //가공시각
  329. //m_pGDC->Values[nRow][Column02->Index] = ITSUtil_StrToTime(pADO->FieldByName("PRCN_DT")->AsString); //가공시각
  330. m_pGDC->Values[nRow][Column02->Index] = pADO->FieldByName("PRCN_DT")->AsString; //가공시각
  331. m_pGDC->Values[nRow][Column03->Index] = pADO->FieldByName("CNT")->AsInteger;
  332. m_pGDC->Values[nRow][Column04->Index] = pADO->FieldByName("PRCN_DT")->AsString;
  333. }
  334. }
  335. __finally
  336. {
  337. if (pADO)
  338. {
  339. pADO->Close();
  340. }
  341. TvList->EndUpdate();
  342. CxList->SetFocus();
  343. LblRecords->Caption = FormatFloat("##,##0", m_pGDC->RecordCount) + " 건";
  344. cxTrackBar1->Position = 0;
  345. cxTrackBar1->Properties->Max = nRow;
  346. cxTrackBar1->Properties->Frequency = cxTrackBar1->Properties->Max * 0.1;
  347. String sEnd = "데이터 " + LblRecords->Caption + " 이 조회 되었습니다.";
  348. Application->MessageBox(sEnd.c_str(), L"데이터 조회 완료", MB_OK|MB_ICONINFORMATION|MB_APPLMODAL);
  349. }
  350. }
  351. catch(EDatabaseError &E)
  352. {
  353. ::PostMessage(Application->MainForm->Handle, (UINT)(WM_USER+0xF4), (WPARAM)0xB2, (LPARAM)0xB2);
  354. throw Exception(String(E.ClassName()) + E.Message);
  355. }
  356. catch(...)
  357. {
  358. ::PostMessage(Application->MainForm->Handle, (UINT)(WM_USER+0xF4), (WPARAM)0xB2, (LPARAM)0xB2);
  359. throw Exception(FrmLang->lblDbErr->Caption);//"알수없는 오류가 발생하였습니다.");
  360. }
  361. }
  362. //---------------------------------------------------------------------------
  363. void __fastcall TTAS0010M::BtnPlayClick(TObject *Sender)
  364. {
  365. if (m_pGDC->RecordCount <= 0)
  366. {
  367. Application->MessageBox(L"표출할 정보가 없습니다. 이력정보를 다시 조회하신 후 작업을 진행 하십시요.",
  368. FTitle.c_str(), MB_OK|MB_ICONERROR|MB_APPLMODAL);
  369. return;
  370. }
  371. m_pGDC->FocusedRecordIndex = 0;
  372. int nIndex = m_pGDC->FocusedRecordIndex;
  373. if (nIndex < 0) return;
  374. FSimIndex = nIndex;
  375. cxTrackBar1->Position = nIndex;
  376. FStatTime = VarToStr(m_pGDC->Values[nIndex][Column04->Index]);
  377. CxList->SetFocus();
  378. BtnPlay->Enabled = false;
  379. BtnStop->Enabled = true;
  380. BtnSearch->Enabled = false;
  381. cxGroupBox1->Caption = "▶ 소통정보 표출 - " + VarToStr(m_pGDC->Values[nIndex][Column02->Index]);
  382. SelStatisticsHistory(FStatTime);
  383. TmrShow->Tag = 1;
  384. TmrShow->Interval = SeRefreshSec->Value * 1000;
  385. TmrShow->Enabled = true;
  386. }
  387. //---------------------------------------------------------------------------
  388. void __fastcall TTAS0010M::BtnStopClick(TObject *Sender)
  389. {
  390. TmrShow->Enabled = false;
  391. BtnPlay->Enabled = true;
  392. BtnStop->Enabled = false;
  393. BtnSearch->Enabled = true;
  394. }
  395. //---------------------------------------------------------------------------
  396. void __fastcall TTAS0010M::SelStatisticsHistory(String AStatTime)
  397. {
  398. int ii;
  399. TSqlCursor sqlCrs;
  400. String sQry;
  401. TADOQuery *pADO = ADOSta;
  402. switch(FTargetIdx)
  403. {
  404. case 0: //이력 정보
  405. sQry = "SELECT A.IFSC_ID, NVL(B.CMTR_GRAD_CD, 'LTC0') TRFGRD, C.SPED, \r\n"
  406. " C.PRCN_DT REGDATE \r\n"
  407. " FROM TB_IFSC A, \r\n"
  408. " TB_CMTR_GRAD_CLSF B, \r\n"
  409. " TB_IFSC_TRAF_HS C \r\n"
  410. " WHERE A.IFSC_ID = C.IFSC_ID \r\n"
  411. " AND A.SECT_GRAD_CD = B.SECT_GRAD_CD \r\n"
  412. " AND (C.SPED >= B.LWST_TRVL_SPED AND C.SPED <= B.HGHS_TRVL_SPED) \r\n"
  413. " AND C.PRCN_DT = :p01 \r\n";
  414. ITSDb_SQLText(pADO, sQry);
  415. ITSDb_SQLBind(pADO, "p01", AStatTime);
  416. break;
  417. case 1: //통계 15분 정보
  418. sQry = "SELECT A.IFSC_ID, NVL(B.CMTR_GRAD_CD, 'LTC0') TRFGRD, C.SPED, \r\n"
  419. " C.STAT_DT REGDATE \r\n"
  420. " FROM TB_IFSC A, \r\n"
  421. " TB_CMTR_GRAD_CLSF B, \r\n"
  422. " TB_IFSC_15M_STAT C \r\n"
  423. " WHERE A.IFSC_ID = C.IFSC_ID \r\n"
  424. " AND A.SECT_GRAD_CD = B.SECT_GRAD_CD \r\n"
  425. " AND (C.SPED >= B.LWST_TRVL_SPED AND C.SPED <= B.HGHS_TRVL_SPED) \r\n"
  426. " AND C.STAT_DT = :p01 \r\n";
  427. ITSDb_SQLText(pADO, sQry);
  428. ITSDb_SQLBind(pADO, "p01", AStatTime);
  429. break;
  430. case 2: //패턴 5분 정보
  431. sQry = "SELECT A.IFSC_ID, NVL(B.CMTR_GRAD_CD, 'LTC0') TRFGRD, \r\n"
  432. " C.SPED, C.STAT_YM || C.STAT_HM REGDATE \r\n"
  433. " FROM TB_IFSC A, \r\n"
  434. " TB_CMTR_GRAD_CLSF B, \r\n"
  435. " TB_IFSC_5M_PTRN C \r\n"
  436. " WHERE A.IFSC_ID = C.IFSC_ID \r\n"
  437. " AND A.SECT_GRAD_CD = B.SECT_GRAD_CD \r\n"
  438. " AND (C.SPED >= B.LWST_TRVL_SPED AND C.SPED <= B.HGHS_TRVL_SPED) \r\n"
  439. " AND C.STAT_YM = SUBSTR(:p01, 1, 6) \r\n"
  440. " AND C.STAT_HM = SUBSTR(:p02, 8, 4) \r\n";
  441. ITSDb_SQLText(pADO, sQry);
  442. ITSDb_SQLBind(pADO, "p01", AStatTime);
  443. ITSDb_SQLBind(pADO, "p02", AStatTime);
  444. break;
  445. case 3: //패턴 15분 정보
  446. sQry = "SELECT A.IFSC_ID, NVL(B.CMTR_GRAD_CD, 'LTC0') TRFGRD, \r\n"
  447. " C.SPED, C.STAT_YM || C.STAT_HM REGDATE \r\n"
  448. " FROM TB_IFSC A, \r\n"
  449. " TB_CMTR_GRAD_CLSF B, \r\n"
  450. " TB_IFSC_15M_PTRN C \r\n"
  451. " WHERE A.IFSC_ID = C.IFSC_ID \r\n"
  452. " AND A.SECT_GRAD_CD = B.SECT_GRAD_CD \r\n"
  453. " AND (C.SPED >= B.LWST_TRVL_SPED AND C.SPED <= B.HGHS_TRVL_SPED) \r\n"
  454. " AND C.STAT_YM = SUBSTR(:p01, 1, 6) \r\n"
  455. " AND C.STAT_HM = SUBSTR(:p02, 8, 4) \r\n";
  456. ITSDb_SQLText(pADO, sQry);
  457. ITSDb_SQLBind(pADO, "p01", AStatTime);
  458. ITSDb_SQLBind(pADO, "p02", AStatTime);
  459. break;
  460. }
  461. try
  462. {
  463. String sLinkInfo = "";
  464. ITSDb_SQLOpen(pADO);
  465. for( ; !pADO->Eof; pADO->Next())
  466. {
  467. String sLinkId = pADO->FieldByName("IFSC_ID")->AsString;
  468. String TRFGRD = pADO->FieldByName("TRFGRD")->AsString;
  469. if (TRFGRD == "LTC1") sLinkInfo += sLinkId + ",1|";
  470. else if (TRFGRD == "LTC2") sLinkInfo += sLinkId + ",2|";
  471. else if (TRFGRD == "LTC3") sLinkInfo += sLinkId + ",3|";
  472. else sLinkInfo += sLinkId + ",0|";
  473. }
  474. if (sLinkInfo != "")
  475. {
  476. sLinkInfo = sLinkInfo.SubString(1, sLinkInfo.Length()-1);
  477. if (FRAMEGisMap1->MapStart)
  478. {
  479. TCommFlash::CallFunc(FRAMEGisMap1->ShockwaveFlash1, "DispTrafficHistory", sLinkInfo);
  480. }
  481. }
  482. }
  483. catch(EDatabaseError &E)
  484. {
  485. ::PostMessage(Application->MainForm->Handle, (UINT)(WM_USER+0xF4), (WPARAM)0xB2, (LPARAM)0xB2);
  486. DBERRORMSG(Caption, String(E.ClassName()), E.Message, sQry);
  487. throw Exception(String(E.ClassName()) + E.Message);
  488. }
  489. catch(Exception &exception)
  490. {
  491. ::PostMessage(Application->MainForm->Handle, (UINT)(WM_USER+0xF4), (WPARAM)0xB2, (LPARAM)0xB2);
  492. DBERRORMSG(Caption, String(exception.ClassName()), exception.Message, sQry);
  493. throw Exception(String(exception.ClassName()) + exception.Message);
  494. }
  495. }
  496. //---------------------------------------------------------------------------
  497. void __fastcall TTAS0010M::ClearGis()
  498. {
  499. cxGroupBox1->Caption = "▶ 소통정보 표출";
  500. }
  501. //---------------------------------------------------------------------------
  502. void __fastcall TTAS0010M::TvListCellDblClick(TcxCustomGridTableView *Sender, TcxGridTableDataCellViewInfo *ACellViewInfo,
  503. TMouseButton AButton, TShiftState AShift, bool &AHandled)
  504. {
  505. if (BtnPlay->Enabled == false) return;
  506. int nRow = m_pGDC->FocusedRecordIndex;
  507. if( nRow <= -1 )
  508. return;
  509. FStatTime = VarToStr(m_pGDC->Values[nRow][Column04->Index]);
  510. cxGroupBox1->Caption = "▶ 소통정보 표출 - " + VarToStr(m_pGDC->Values[nRow][Column02->Index]);
  511. SelStatisticsHistory(FStatTime);
  512. }
  513. //---------------------------------------------------------------------------
  514. void __fastcall TTAS0010M::BtnSearch2Click(TObject *Sender)
  515. {
  516. Application->ProcessMessages();
  517. TSqlCursor sqlCrs((TControl*)BtnSearch);
  518. String sLinkId = EdLinkId->Text.Trim();
  519. TmrClear->Enabled = false;
  520. //TXiMapUtil::ClearPath(FRAMEGisMap1->xclntMap);
  521. //TXiMapUtil::MoveServiceLink(FRAMEGisMap1->xclntMap, sLinkId);
  522. TmrClear->Enabled = true;
  523. }
  524. //---------------------------------------------------------------------------
  525. void __fastcall TTAS0010M::TmrClearTimer(TObject *Sender)
  526. {
  527. try {
  528. //TXiMapUtil::ClearPath(FRAMEGisMap1->xclntMap);
  529. } catch(...) {}
  530. }
  531. //---------------------------------------------------------------------------