IAN0040MF.cpp 20 KB

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