IAN0040MF.cpp 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655
  1. /****************************************************************************
  2. * @source :
  3. * @description :
  4. ****************************************************************************
  5. * DATE AUTHOR DESCRIPTION
  6. * --------------------------------------------------------------------------
  7. * 2011/12/24 정승호 최초작성
  8. *
  9. ****************************************************************************/
  10. //---------------------------------------------------------------------------
  11. #include <vcl.h>
  12. #include "ITSSkinF.h"
  13. #include "ITSUtilF.h"
  14. #include "ITSDbF.h"
  15. #include "AppGlobalF.h"
  16. #include "XiMapUtilF.h"
  17. #pragma hdrstop
  18. #include "IAN0040MF.h"
  19. //---------------------------------------------------------------------------
  20. #pragma package(smart_init)
  21. #pragma link "cxButtons"
  22. #pragma link "cxCalc"
  23. #pragma link "cxCalendar"
  24. #pragma link "cxClasses"
  25. #pragma link "cxContainer"
  26. #pragma link "cxControls"
  27. #pragma link "cxCustomData"
  28. #pragma link "cxData"
  29. #pragma link "cxDataStorage"
  30. #pragma link "cxDropDownEdit"
  31. #pragma link "cxEdit"
  32. #pragma link "cxFilter"
  33. #pragma link "cxGraphics"
  34. #pragma link "cxGrid"
  35. #pragma link "cxGridCustomTableView"
  36. #pragma link "cxGridCustomView"
  37. #pragma link "cxGridLevel"
  38. #pragma link "cxGridTableView"
  39. #pragma link "cxGroupBox"
  40. #pragma link "cxLabel"
  41. #pragma link "cxLookAndFeelPainters"
  42. #pragma link "cxLookAndFeels"
  43. #pragma link "cxMaskEdit"
  44. #pragma link "cxSpinEdit"
  45. #pragma link "cxSplitter"
  46. #pragma link "cxStyles"
  47. #pragma link "cxTextEdit"
  48. #pragma link "cxTimeEdit"
  49. #pragma link "cxTrackBar"
  50. #pragma link "dxSkinBlack"
  51. #pragma link "dxSkinBlue"
  52. #pragma link "dxSkinCaramel"
  53. #pragma link "dxSkinCoffee"
  54. #pragma link "dxSkinDarkRoom"
  55. #pragma link "dxSkinDarkSide"
  56. #pragma link "dxSkinFoggy"
  57. #pragma link "dxSkinGlassOceans"
  58. #pragma link "dxSkiniMaginary"
  59. #pragma link "dxSkinLilian"
  60. #pragma link "dxSkinLiquidSky"
  61. #pragma link "dxSkinLondonLiquidSky"
  62. #pragma link "dxSkinMcSkin"
  63. #pragma link "dxSkinMoneyTwins"
  64. #pragma link "dxSkinOffice2007Black"
  65. #pragma link "dxSkinOffice2007Blue"
  66. #pragma link "dxSkinOffice2007Green"
  67. #pragma link "dxSkinOffice2007Pink"
  68. #pragma link "dxSkinOffice2007Silver"
  69. #pragma link "dxSkinOffice2010Black"
  70. #pragma link "dxSkinOffice2010Blue"
  71. #pragma link "dxSkinOffice2010Silver"
  72. #pragma link "dxSkinsCore"
  73. #pragma link "dxSkinscxPCPainter"
  74. #pragma link "dxSkinSeven"
  75. #pragma link "dxSkinSharp"
  76. #pragma link "dxSkinSilver"
  77. #pragma link "dxSkinStardust"
  78. #pragma link "FRAME_GisMapF"
  79. #pragma resource "*.dfm"
  80. TIAN0040M *IAN0040M = NULL;
  81. //---------------------------------------------------------------------------
  82. __fastcall TIAN0040M::TIAN0040M(TComponent* Owner)
  83. : TForm(Owner)
  84. {
  85. ITSSkin_Load(this);
  86. CMM_LoadForm(g_sFormsDir, this);
  87. FTitle = "소통정보 이력분석";
  88. //FRAMEGisMap1->GrpTool->Visible = false;
  89. FRAMEGisMap1->LbDef->Visible = false;
  90. FRAMEGisMap1->ImgRefresh->Visible = false;
  91. FRAMEGisMap1->ImgSel->Visible = false;
  92. FGisStream = new TMemoryStream();
  93. }
  94. //---------------------------------------------------------------------------
  95. /*
  96. * 닫기버튼 이나 x버튼 클릭시 공통으로 처리하는 로직이들어간다..
  97. * Form과 DataModule class를 delete시킨다.
  98. * arguments
  99. *
  100. * return
  101. * void
  102. */
  103. void __fastcall TIAN0040M::CommClose()
  104. {
  105. try
  106. {
  107. int ii;
  108. FLists.RemoveAll();
  109. if (FGisStream) delete FGisStream;
  110. CMM_SaveForm(g_sFormsDir, this);
  111. }
  112. catch(...)
  113. {
  114. }
  115. }
  116. //---------------------------------------------------------------------------
  117. /*
  118. * Form을 보여줄때 호출되는 event 메서드이다.
  119. * arguments
  120. * Sender : event handler 객체
  121. * return
  122. * void
  123. */
  124. void __fastcall TIAN0040M::FormShow(TObject *Sender)
  125. {
  126. Refresh();
  127. FormInit();
  128. TmrShow->Enabled = true;
  129. }
  130. //---------------------------------------------------------------------------
  131. /*
  132. * form 초기화
  133. *
  134. * arguments
  135. *
  136. * return
  137. * void
  138. */
  139. void __fastcall TIAN0040M::FormInit()
  140. {
  141. ADOQry->Connection = ITSDb_GetConnection();
  142. ADOSta->Connection = ITSDb_GetConnection();
  143. m_pGDC = TvList->DataController;
  144. TDateTime dtNow = Now() - ((double)3 / (double)24);
  145. DtStDate->Date = dtNow;
  146. DtEdDate->Date = Now();
  147. DtStTime->EditValue = dtNow.FormatString("hh");
  148. dtNow = Now() - ((double)2 / (double)24);
  149. DtEdTime->EditValue = dtNow.FormatString("hh");
  150. }
  151. //---------------------------------------------------------------------------
  152. /*
  153. * Form이 Show되고 난 후 최초 1회 수행되는 타이머 이벤트
  154. * arguments
  155. * Sender : event handler 객체
  156. * return
  157. * void
  158. */
  159. void __fastcall TIAN0040M::TmrShowTimer(TObject *Sender)
  160. {
  161. TmrShow->Enabled = false;
  162. if (TmrShow->Tag == 1)
  163. {
  164. int nIndex = m_pGDC->FocusedRecordIndex;
  165. if (nIndex < 0)
  166. {
  167. cxTrackBar1->Position = 0;
  168. FStatTime = "";
  169. BtnPlay->Enabled = true;
  170. BtnStop->Enabled = false;
  171. BtnSearch->Enabled = true;
  172. return;
  173. }
  174. if (m_pGDC->FocusedRecordIndex + 1 == m_pGDC->RecordCount)
  175. {
  176. cxTrackBar1->Position = 0;
  177. FStatTime = "";
  178. BtnPlay->Enabled = true;
  179. BtnStop->Enabled = false;
  180. BtnSearch->Enabled = true;
  181. return;
  182. }
  183. m_pGDC->FocusedRecordIndex++;
  184. nIndex = m_pGDC->FocusedRecordIndex;
  185. FSimIndex = nIndex;
  186. cxTrackBar1->Position = nIndex;
  187. FStatTime = VarToStr(m_pGDC->Values[nIndex][Column04->Index]);
  188. cxGroupBox1->Caption = "▶ 소통정보 표출 - " + VarToStr(m_pGDC->Values[nIndex][Column02->Index]);
  189. SelStatisticsHistory(FStatTime);
  190. BtnPlay->Enabled = false;
  191. BtnStop->Enabled = true;
  192. TmrShow->Interval = SeRefreshSec->Value * 1000;
  193. TmrShow->Enabled = true;
  194. }
  195. else
  196. {
  197. FRAMEGisMap1->LinkLevel = 2;
  198. FRAMEGisMap1->LoadGisMap();
  199. FLayerIdx = FRAMEGisMap1->GetLayerIndex();
  200. if (FLayerIdx >= 0)
  201. {
  202. TStream *pStream = FRAMEGisMap1->xsrvrMap->GetLayerAttSTM(FLayerIdx);
  203. if (pStream)
  204. {
  205. FGisStream->LoadFromStream(pStream);
  206. }
  207. }
  208. }
  209. }
  210. //---------------------------------------------------------------------------
  211. /*
  212. * Search 버튼 클릭 이벤트 핸들러
  213. * arguments
  214. * Sender : event handler 객체
  215. * return
  216. * void
  217. */
  218. void __fastcall TIAN0040M::BtnSearchClick(TObject *Sender)
  219. {
  220. FStDateTime = DtStDate->Date.FormatString("yyyymmdd") + DtStTime->Time.FormatString("hh");
  221. FEdDateTime = DtEdDate->Date.FormatString("yyyymmdd") + DtEdTime->Time.FormatString("hh");
  222. if (FStDateTime > FEdDateTime)
  223. {
  224. Application->MessageBox(L"검색 시작시각이 검색 종료시각 보다 큽니다.", FTitle.c_str(), MB_OK|MB_ICONWARNING|MB_APPLMODAL);
  225. ActiveControl = DtStDate;
  226. return;
  227. }
  228. if ( StrToInt(DtEdTime->Time.FormatString("hh")) - StrToInt(DtStTime->Time.FormatString("hh")) >= 3)
  229. {
  230. Application->MessageBox(L"3시간 이상의 정보를 조회할 수 없습니다.", FTitle.c_str(), MB_OK|MB_ICONWARNING|MB_APPLMODAL);
  231. ActiveControl = DtStDate;
  232. return;
  233. }
  234. FStDateTime = FStDateTime + "0000";
  235. FEdDateTime = FEdDateTime + "5959";
  236. FIdList = String(CbLinkLevel->ItemIndex+1);
  237. SelHistory();
  238. ClearGis();
  239. }
  240. //---------------------------------------------------------------------------
  241. /*
  242. * Close 버튼 클릭 이벤트 핸들러
  243. * arguments
  244. * Sender : event handler 객체
  245. * return
  246. * void
  247. */
  248. void __fastcall TIAN0040M::BtnCloseClick(TObject *Sender)
  249. {
  250. Close();
  251. }
  252. //---------------------------------------------------------------------------
  253. void __fastcall TIAN0040M::FormClose(TObject *Sender, TCloseAction &Action)
  254. {
  255. CommClose();
  256. IAN0040M = NULL;
  257. Action = caFree;
  258. }
  259. //---------------------------------------------------------------------------
  260. void __fastcall TIAN0040M::DtStDatePropertiesValidate(TObject *Sender, Variant &DisplayValue, TCaption &ErrorText, bool &Error)
  261. {
  262. DtEdDate->Date = DtStDate->Date;
  263. }
  264. //---------------------------------------------------------------------------
  265. void __fastcall TIAN0040M::SelHistory()
  266. {
  267. TSqlCursor sqlCrs;
  268. String sQry;
  269. TADOQuery *pADO = ADOQry;
  270. int nLevel = StrToInt(FIdList);
  271. #if 0
  272. switch(nLevel)
  273. {
  274. case 1:
  275. sQry = "SELECT PRCN_DT, TO_DATE(PRCN_DT, 'YYYYMMDDHH24MISS') AS PRCN_DT2, \r\n"
  276. " COUNT(LINK_ID) CNT \r\n"
  277. " FROM TB_LINK_TRAF_HS A \r\n"
  278. " WHERE PRCN_DT BETWEEN :p01 AND :p02 \r\n"
  279. " GROUP BY PRCN_DT \r\n"
  280. " ORDER BY PRCN_DT \r\n";
  281. break;
  282. case 2:
  283. sQry = "SELECT STAT_DT AS PRCN_DT, TO_DATE(STAT_DT, 'YYYYMMDDHH24MISS') AS PRCN_DT2, \r\n"
  284. " COUNT(IFSC_ID) CNT \r\n"
  285. " FROM TB_IFSC_15M_STAT A \r\n"
  286. " WHERE STAT_DT BETWEEN :p01 AND :p02 \r\n"
  287. " GROUP BY STAT_DT \r\n"
  288. " ORDER BY STAT_DT \r\n";
  289. break;
  290. case 3:
  291. sQry = "SELECT PRCN_DT, TO_DATE(PRCN_DT, 'YYYYMMDDHH24MISS') AS PRCN_DT2, \r\n"
  292. " COUNT(ROAD_ID) CNT \r\n"
  293. " FROM TB_ROAD_TRAF_HS A \r\n"
  294. " WHERE PRCN_DT BETWEEN :p01 AND :p02 \r\n"
  295. " GROUP BY PRCN_DT \r\n"
  296. " ORDER BY PRCN_DT \r\n";
  297. break;
  298. default: return;
  299. }
  300. #else
  301. switch(nLevel)
  302. {
  303. case 1:
  304. sQry = "SELECT PRCN_DT, COUNT(LINK_ID) CNT \r\n"
  305. " FROM TB_LINK_TRAF_HS A \r\n"
  306. " WHERE PRCN_DT BETWEEN :p01 AND :p02 \r\n"
  307. " GROUP BY PRCN_DT \r\n"
  308. " ORDER BY PRCN_DT \r\n";
  309. break;
  310. case 2:
  311. sQry = "SELECT STAT_DT AS PRCN_DT, COUNT(IFSC_ID) CNT \r\n"
  312. " FROM TB_IFSC_15M_STAT A \r\n"
  313. " WHERE STAT_DT BETWEEN :p01 AND :p02 \r\n"
  314. " GROUP BY STAT_DT \r\n"
  315. " ORDER BY STAT_DT \r\n";
  316. break;
  317. case 3:
  318. sQry = "SELECT PRCN_DT, COUNT(ROAD_ID) CNT \r\n"
  319. " FROM TB_ROAD_TRAF_HS A \r\n"
  320. " WHERE PRCN_DT BETWEEN :p01 AND :p02 \r\n"
  321. " GROUP BY PRCN_DT \r\n"
  322. " ORDER BY PRCN_DT \r\n";
  323. break;
  324. default: return;
  325. }
  326. #endif
  327. try
  328. {
  329. ITSDb_SQLText(pADO, sQry);
  330. ITSDb_SQLBind(pADO, "p01", FStDateTime);
  331. ITSDb_SQLBind(pADO, "p02", FEdDateTime);
  332. ITSDb_SQLOpen(pADO);
  333. DspHistory();
  334. }
  335. catch(EDatabaseError &E)
  336. {
  337. throw Exception(String(E.ClassName()) + E.Message);
  338. }
  339. catch(...)
  340. {
  341. throw Exception("알수없는 오류가 발생하였습니다.");
  342. }
  343. }
  344. //---------------------------------------------------------------------------
  345. void __fastcall TIAN0040M::DspHistory()
  346. {
  347. TADOQuery *pADO = ADOQry;
  348. try
  349. {
  350. CMM_ClearGridTableView(TvList);
  351. int nRow = 0;
  352. try
  353. {
  354. TvList->BeginUpdate();
  355. m_pGDC->RecordCount = pADO->RecordCount;
  356. for( ; !pADO->Eof; pADO->Next(), nRow++)
  357. {
  358. m_pGDC->Values[nRow][Column01->Index] = nRow+1;
  359. //m_pGDC->Values[nRow][Column02->Index] = pADO->FieldByName("PRCN_DT2")->AsDateTime.DateTimeString(); //가공시각
  360. m_pGDC->Values[nRow][Column02->Index] = ITSUtil_StrToTime(pADO->FieldByName("PRCN_DT")->AsString); //가공시각
  361. m_pGDC->Values[nRow][Column03->Index] = pADO->FieldByName("CNT")->AsInteger;
  362. m_pGDC->Values[nRow][Column04->Index] = pADO->FieldByName("PRCN_DT")->AsString;
  363. }
  364. }
  365. __finally
  366. {
  367. if (pADO)
  368. {
  369. pADO->Close();
  370. }
  371. TvList->EndUpdate();
  372. CxList->SetFocus();
  373. //LblRecords->Caption = FormatFloat("##,##0", m_pGDC->RecordCount) + " 건";
  374. cxTrackBar1->Position = 0;
  375. cxTrackBar1->Properties->Max = nRow;
  376. cxTrackBar1->Properties->Frequency = cxTrackBar1->Properties->Max * 0.1;
  377. }
  378. }
  379. catch(EDatabaseError &E)
  380. {
  381. throw Exception(String(E.ClassName()) + E.Message);
  382. }
  383. catch(...)
  384. {
  385. throw Exception("알수없는 오류가 발생하였습니다.");
  386. }
  387. }
  388. //---------------------------------------------------------------------------
  389. void __fastcall TIAN0040M::BtnPlayClick(TObject *Sender)
  390. {
  391. if (m_pGDC->RecordCount <= 0)
  392. {
  393. Application->MessageBox(L"표출할 정보가 없습니다. 이력정보를 다시 조회하신 후 작업을 진행 하십시요.",
  394. FTitle.c_str(), MB_OK|MB_ICONERROR|MB_APPLMODAL);
  395. return;
  396. }
  397. m_pGDC->FocusedRecordIndex = 0;
  398. int nIndex = m_pGDC->FocusedRecordIndex;
  399. if (nIndex < 0) return;
  400. FSimIndex = nIndex;
  401. cxTrackBar1->Position = nIndex;
  402. FStatTime = VarToStr(m_pGDC->Values[nIndex][Column04->Index]);
  403. CxList->SetFocus();
  404. BtnPlay->Enabled = false;
  405. BtnStop->Enabled = true;
  406. BtnSearch->Enabled = false;
  407. cxGroupBox1->Caption = "▶ 소통정보 표출 - " + VarToStr(m_pGDC->Values[nIndex][Column02->Index]);
  408. SelStatisticsHistory(FStatTime);
  409. TmrShow->Tag = 1;
  410. TmrShow->Interval = SeRefreshSec->Value * 1000;
  411. TmrShow->Enabled = true;
  412. }
  413. //---------------------------------------------------------------------------
  414. void __fastcall TIAN0040M::BtnStopClick(TObject *Sender)
  415. {
  416. TmrShow->Enabled = false;
  417. BtnPlay->Enabled = true;
  418. BtnStop->Enabled = false;
  419. BtnSearch->Enabled = true;
  420. }
  421. //---------------------------------------------------------------------------
  422. void __fastcall TIAN0040M::SelStatisticsHistory(String AStatTime)
  423. {
  424. int ii;
  425. TSqlCursor sqlCrs;
  426. String sQry;
  427. TADOQuery *pADO = ADOSta;
  428. sQry = "SELECT A.IFSC_ID, NVL(B.CMTR_GRAD_CD, 'LTC0') TRFGRD, C.SPED, C.STAT_DT REGDATE \r\n"
  429. " FROM TB_IFSC A, \r\n"
  430. " TB_CMTR_GRAD_CLSF B, \r\n"
  431. " TB_IFSC_15M_STAT C \r\n"
  432. " WHERE A.IFSC_ID = C.IFSC_ID \r\n"
  433. " AND A.SECT_GRAD_CD = B.SECT_GRAD_CD \r\n"
  434. " AND (C.SPED >= B.LWST_TRVL_SPED AND C.SPED <= B.HGHS_TRVL_SPED) \r\n"
  435. " AND STAT_DT = :p01 \r\n";
  436. try
  437. {
  438. FLists.RemoveAll();
  439. if (FLayerIdx < 0 || FGisStream == NULL) return;
  440. ITSDb_SQLText(pADO, sQry);
  441. ITSDb_SQLBind(pADO, "p01", AStatTime);
  442. ITSDb_SQLOpen(pADO);
  443. for( ; !pADO->Eof; pADO->Next())
  444. {
  445. String sLinkId = pADO->FieldByName("IFSC_ID")->AsString;
  446. MYLinkValue *pValue = new MYLinkValue;
  447. String TRFGRD = pADO->FieldByName("TRFGRD")->AsString;
  448. pValue->Speed = pADO->FieldByName("SPED")->AsInteger;
  449. if (TRFGRD == "LTC1") pValue->clrTraffic = clLime;
  450. else if (TRFGRD == "LTC2") pValue->clrTraffic = clYellow;
  451. else if (TRFGRD == "LTC3") pValue->clrTraffic = clRed;
  452. else pValue->clrTraffic = clSilver;
  453. FLists.Push(sLinkId, pValue);
  454. }
  455. TColor clrTraffic = clSilver;
  456. System::AnsiString sLinkIDNm = "SD_LINK_ID";
  457. System::AnsiString sColor1Nm = "SD_COLOR1";
  458. System::AnsiString sColor2Nm = "SD_COLOR2";
  459. System::AnsiString sSpeedNm = "SD_SPEED";
  460. int jj, idx;
  461. int nFldCnt, nTotCnt;
  462. unsigned char sl;
  463. TFieldInfos FldInfos;
  464. char buf[260];
  465. FGisStream->Position = 0;
  466. FGisStream->ReadBuffer(&nTotCnt, 4);
  467. FGisStream->ReadBuffer(&nFldCnt,4);
  468. FldInfos.Length = nFldCnt;
  469. FGisStream->Position = 8;
  470. for (ii = 0; ii < nFldCnt; ii++)
  471. {
  472. FGisStream->ReadBuffer(&sl, 1);
  473. memset(buf, 0x00, sizeof(buf));
  474. FGisStream->ReadBuffer(buf, sl);
  475. FldInfos[ii].FFieldName = System::AnsiString(buf);
  476. FGisStream->ReadBuffer(&(FldInfos[ii].FFieldType), sizeof(FldInfos[ii].FFieldType));
  477. }
  478. for (ii = 0; ii < nTotCnt; ii++)
  479. {
  480. if (FGisStream->Position >= FGisStream->Size) break;
  481. for (jj = 0; jj < nFldCnt; jj++)
  482. {
  483. switch (FldInfos[jj].FFieldType)
  484. {
  485. case ftSmallint : FGisStream->Position += sizeof(short); break;
  486. case ftFloat : FGisStream->Position += sizeof(double); break;
  487. case ftWord : FGisStream->Position += sizeof(unsigned short); break;
  488. case ftBoolean : FGisStream->Position += sizeof(bool); break;
  489. case ftDate :
  490. case ftTime :
  491. case ftDateTime : FGisStream->Position += sizeof(TDateTime); break;
  492. case ftInteger :
  493. if (FldInfos[jj].FFieldName == sColor1Nm)
  494. {
  495. FGisStream->WriteBuffer(&clrTraffic, sizeof(TColor));
  496. }
  497. else
  498. {
  499. FGisStream->Position += sizeof(int);
  500. }
  501. break;
  502. case ftString :
  503. case ftWideString :
  504. FGisStream->ReadBuffer(&sl, 1);
  505. if (sl <= 1)
  506. {
  507. if (sl == 1)
  508. FGisStream->Position += sl;
  509. else
  510. continue;
  511. }
  512. else
  513. {
  514. memset(buf, 0x00, sizeof(buf));
  515. FGisStream->ReadBuffer(buf, sl);
  516. if (FldInfos[jj].FFieldName == sLinkIDNm)
  517. {
  518. String sLinkId = String(buf);
  519. MYLinkValue *pValue = FLists.Find(sLinkId);
  520. if (pValue)
  521. clrTraffic = pValue->clrTraffic;
  522. else
  523. clrTraffic = clSilver;
  524. }
  525. }
  526. break;
  527. default:
  528. break;
  529. }
  530. }
  531. }
  532. FRAMEGisMap1->xsrvrMap->SetLayerAttSTM(FLayerIdx, FGisStream);
  533. FRAMEGisMap1->xclntMap->FullReDraw( );
  534. }
  535. catch(EDatabaseError &E)
  536. {
  537. throw Exception(String(E.ClassName()) + E.Message);
  538. }
  539. catch(...)
  540. {
  541. throw Exception("알수없는 오류가 발생하였습니다.");
  542. }
  543. }
  544. //---------------------------------------------------------------------------
  545. void __fastcall TIAN0040M::ClearGis()
  546. {
  547. cxGroupBox1->Caption = "▶ 소통정보 표출";
  548. }
  549. //---------------------------------------------------------------------------
  550. void __fastcall TIAN0040M::TvListCellDblClick(TcxCustomGridTableView *Sender, TcxGridTableDataCellViewInfo *ACellViewInfo,
  551. TMouseButton AButton, TShiftState AShift, bool &AHandled)
  552. {
  553. if (BtnPlay->Enabled == false) return;
  554. int nRow = m_pGDC->FocusedRecordIndex;
  555. if( nRow <= -1 )
  556. return;
  557. FStatTime = VarToStr(m_pGDC->Values[nRow][Column04->Index]);
  558. cxGroupBox1->Caption = "▶ 소통정보 표출 - " + VarToStr(m_pGDC->Values[nRow][Column02->Index]);
  559. SelStatisticsHistory(FStatTime);
  560. }
  561. //---------------------------------------------------------------------------
  562. void __fastcall TIAN0040M::BtnSearch2Click(TObject *Sender)
  563. {
  564. String sLinkId = EdLinkId->Text.Trim();
  565. TmrClear->Enabled = false;
  566. TXiMapUtil::ClearPath(FRAMEGisMap1->xclntMap);
  567. TXiMapUtil::MoveServiceLink(FRAMEGisMap1->xclntMap, sLinkId);
  568. TmrClear->Enabled = true;
  569. }
  570. //---------------------------------------------------------------------------
  571. void __fastcall TIAN0040M::TmrClearTimer(TObject *Sender)
  572. {
  573. try {
  574. TXiMapUtil::ClearPath(FRAMEGisMap1->xclntMap);
  575. } catch(...) {}
  576. }
  577. //---------------------------------------------------------------------------
  578. void __fastcall TIAN0040M::cxGroupBox5DblClick(TObject *Sender)
  579. {
  580. cxGroupBox4->Visible = true;
  581. }
  582. //---------------------------------------------------------------------------