ITS00MAPF.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493
  1. //---------------------------------------------------------------------------
  2. #ifndef ITS00MAPFH
  3. #define ITS00MAPFH
  4. //---------------------------------------------------------------------------
  5. #include <Classes.hpp>
  6. #include <Controls.hpp>
  7. #include <StdCtrls.hpp>
  8. #include <Forms.hpp>
  9. #include <DB.hpp>
  10. #include <DBClient.hpp>
  11. #include <Provider.hpp>
  12. #include <ADODB.hpp>
  13. #include <ExtCtrls.hpp>
  14. #include <Graphics.hpp>
  15. #include <ImgList.hpp>
  16. #include <Menus.hpp>
  17. #include <pngimage.hpp>
  18. #include <map.h>
  19. #include <vector.h>
  20. #include "ImageBtn.h"
  21. //---------------------------------------------------------------------------
  22. //---------------------------------------------------------------------------
  23. #include "XiC_IndexMap.hpp"
  24. #include "XiC_LinkSpeedUpdate.hpp"
  25. #include "XiClient.hpp"
  26. #include "XiServer.hpp"
  27. //---------------------------------------------------------------------------
  28. #include "DataTypesF.h"
  29. #include "WindowMsgF.h"
  30. #include "cxCheckBox.hpp"
  31. #include "cxContainer.hpp"
  32. #include "cxControls.hpp"
  33. #include "cxEdit.hpp"
  34. #include "cxGraphics.hpp"
  35. #include "cxGroupBox.hpp"
  36. #include "cxLabel.hpp"
  37. #include "cxLookAndFeelPainters.hpp"
  38. #include "cxLookAndFeels.hpp"
  39. #include "cxMaskEdit.hpp"
  40. #include "cxProgressBar.hpp"
  41. #include "cxSpinEdit.hpp"
  42. #include "cxTextEdit.hpp"
  43. #include "dxGDIPlusClasses.hpp"
  44. #include "dxSkinBlack.hpp"
  45. #include "dxSkinBlue.hpp"
  46. #include "dxSkinCaramel.hpp"
  47. #include "dxSkinCoffee.hpp"
  48. #include "dxSkinDarkRoom.hpp"
  49. #include "dxSkinDarkSide.hpp"
  50. #include "dxSkinFoggy.hpp"
  51. #include "dxSkinGlassOceans.hpp"
  52. #include "dxSkiniMaginary.hpp"
  53. #include "dxSkinLilian.hpp"
  54. #include "dxSkinLiquidSky.hpp"
  55. #include "dxSkinLondonLiquidSky.hpp"
  56. #include "dxSkinMcSkin.hpp"
  57. #include "dxSkinMoneyTwins.hpp"
  58. #include "dxSkinOffice2007Black.hpp"
  59. #include "dxSkinOffice2007Blue.hpp"
  60. #include "dxSkinOffice2007Green.hpp"
  61. #include "dxSkinOffice2007Pink.hpp"
  62. #include "dxSkinOffice2007Silver.hpp"
  63. #include "dxSkinOffice2010Black.hpp"
  64. #include "dxSkinOffice2010Blue.hpp"
  65. #include "dxSkinOffice2010Silver.hpp"
  66. #include "dxSkinsCore.hpp"
  67. #include "dxSkinSeven.hpp"
  68. #include "dxSkinSharp.hpp"
  69. #include "dxSkinSilver.hpp"
  70. #include "dxSkinStardust.hpp"
  71. //---------------------------------------------------------------------------
  72. /*
  73. ******************************************************************************
  74. * Define constant
  75. ******************************************************************************
  76. */
  77. /*
  78. * 소통정보 레이어 최대갯수
  79. */
  80. #define MAX_LAYERS 7
  81. /*
  82. * 이전/다음 구현을 위한 구조체 선언(정적 이중링크로 구현)
  83. */
  84. #define D_EXT_QUEUE_SIZE 256 //512//1024/2048
  85. #define D_EXT_QUEUE_MASK (D_EXT_QUEUE_SIZE-1)
  86. /*
  87. * 레이어 Extent 정보
  88. */
  89. typedef struct
  90. {
  91. bool bExtent;
  92. short userIdx;
  93. short currIdx;
  94. TDDRect extent[D_EXT_QUEUE_SIZE+1];
  95. } EXTENT_LIST_QUEUE;
  96. //---------------------------------------------------------------------------
  97. class TITS00MAP : public TForm
  98. {
  99. __published: // IDE-managed Components
  100. TImageList *ilstRSE;
  101. TImageList *ImgGis;
  102. TImageList *ilstTurnInfo;
  103. TImageList *ilstCCTV;
  104. TImageList *ilstObe;
  105. TXiServer *xsrvrMap;
  106. TXiClient *xclntMap;
  107. TImageList *ilstIncident;
  108. TTimer *TmrShow;
  109. TPanel *PnlProgress;
  110. TcxProgressBar *PbLoadMap;
  111. TPanel *Panel5;
  112. TImage *ImgBoundary_n;
  113. TImage *ImgPrint_n;
  114. TImage *ImgPrint_c;
  115. TImage *ImgRefresh_c;
  116. TImage *ImgRefresh_n;
  117. TImage *ImgFull_n;
  118. TImage *ImgFull_c;
  119. TImage *ImgSquare_c;
  120. TImage *ImgSquare_n;
  121. TImage *ImgBoundary_c;
  122. TImage *ImgNext_c;
  123. TImage *ImgNext_n;
  124. TImage *ImgPan_n;
  125. TImage *ImgPan_c;
  126. TImage *ImgZoomOut_c;
  127. TImage *ImgZoomOut_n;
  128. TImage *ImgStnd_c;
  129. TImage *ImgSave_n;
  130. TImage *ImgSave_c;
  131. TImage *ImgStnd_n;
  132. TImage *ImgDist_c;
  133. TImage *ImgCircle_n;
  134. TImage *ImgCircle_c;
  135. TImage *ImgDist_n;
  136. TImage *ImgSel_c;
  137. TImage *ImgSel_n;
  138. TImage *ImgPrev_n;
  139. TImage *ImgPrev_c;
  140. TImage *ImgCenter_c;
  141. TImage *ImgCenter_n;
  142. TImage *ImgZoomIn_c;
  143. TImage *ImgZoomIn_n;
  144. TImageBtn *ImgBoundary;
  145. TImageBtn *ImgPrint;
  146. TImageBtn *ImgDist;
  147. TImageBtn *ImgSquare;
  148. TImageBtn *ImgCircle;
  149. TImageBtn *ImgSave;
  150. TImage *ImgSelect_old;
  151. TTimer *TmrSelect;
  152. TTimer *TmrLinkSelect;
  153. TImage *ImgSelect;
  154. TPanel *PnlToolBar;
  155. TGroupBox *GroupBox1;
  156. TImageBtn *ImgPan;
  157. TImageBtn *ImgZoomIn;
  158. TImageBtn *ImgZoomOut;
  159. TImageBtn *ImgSel;
  160. TImageBtn *ImgCenter;
  161. TImageBtn *ImgPrev;
  162. TImageBtn *ImgNext;
  163. TImageBtn *ImgFull;
  164. TImageBtn *ImgStnd;
  165. TImageBtn *ImgRefresh;
  166. TGroupBox *GroupBox2;
  167. TGroupBox *GrpFacility;
  168. TcxCheckBox *ChkDrawCtv;
  169. TcxCheckBox *ChkDrawVms;
  170. TcxCheckBox *ChkDrawRse;
  171. TcxCheckBox *ChkViewExample;
  172. TcxCheckBox *ChkTrafficLayer;
  173. TcxCheckBox *ChkDrawIncident;
  174. TcxCheckBox *ChkGisSearch;
  175. TcxCheckBox *ChkToolTip;
  176. TGroupBox *GrpPos;
  177. TLabel *Label11;
  178. TLabel *Label12;
  179. TcxSpinEdit *SePosY;
  180. TcxSpinEdit *SePosX;
  181. TcxCheckBox *ChkDrawCenter;
  182. TcxGroupBox *panRemark;
  183. TGroupBox *GrpRse;
  184. TGroupBox *GroupBox7;
  185. TGroupBox *GroupBox8;
  186. TGroupBox *GroupBox9;
  187. TGroupBox *GroupBox10;
  188. TImage *ImgRseN;
  189. TImage *ImgRseC;
  190. TcxLabel *cxLabel1;
  191. TcxLabel *cxLabel2;
  192. TImage *ImgCctvN;
  193. TImage *ImgCctvC;
  194. TImage *ImgCctvM;
  195. TcxLabel *cxLabel3;
  196. TcxLabel *cxLabel4;
  197. TcxLabel *cxLabel5;
  198. TImage *ImgVmsN;
  199. TImage *ImgVmsC;
  200. TImage *ImgVmsM;
  201. TcxLabel *cxLabel6;
  202. TcxLabel *cxLabel7;
  203. TcxLabel *cxLabel8;
  204. TImage *ImgInc01;
  205. TImage *ImgInc02;
  206. TImage *ImgInc03;
  207. TImage *ImgInc04;
  208. TcxLabel *cxLabel9;
  209. TcxLabel *cxLabel10;
  210. TcxLabel *cxLabel11;
  211. TcxLabel *cxLabel12;
  212. TPanel *PnlTrf01;
  213. TPanel *PnlTrf02;
  214. TPanel *PnlTrf03;
  215. TPanel *PnlTrf00;
  216. TcxLabel *cxLabel13;
  217. TcxLabel *cxLabel14;
  218. TcxLabel *cxLabel15;
  219. TcxLabel *cxLabel16;
  220. TImage *ImgOffice;
  221. TImage *ImgTemp;
  222. TImage *ImgTurn001;
  223. TImage *ImgTurn002;
  224. TImage *ImgTurn003;
  225. TImage *ImgTurn011;
  226. TImage *ImgTurn012;
  227. TImage *ImgTurn101;
  228. TImage *ImgTurn102;
  229. TImage *ImgTurn103;
  230. TPopupMenu *pmuGis;
  231. TMenuItem *N1;
  232. TMenuItem *pmuGisDefault;
  233. TMenuItem *pmuMove;
  234. TMenuItem *pmuZoomIn;
  235. TMenuItem *pmuZoomOut;
  236. TMenuItem *pmuIconSel;
  237. TMenuItem *pmuMoveCenter;
  238. TMenuItem *N2;
  239. TMenuItem *pmuCalLen;
  240. TMenuItem *pmuCalArea;
  241. TMenuItem *pmuRadius;
  242. TMenuItem *N7;
  243. TMenuItem *MnuSetStdArea;
  244. TMenuItem *MnuDrawAntiAlias;
  245. TMenuItem *MnuViewGray;
  246. TMenuItem *MnuLayerSetting;
  247. TMenuItem *MnuMoveStdArea;
  248. TPopupMenu *pmuCctv;
  249. TMenuItem *MnuCctvId;
  250. TMenuItem *N6;
  251. TMenuItem *mnuStopImage;
  252. TMenuItem *mnuCctvCam;
  253. TMenuItem *mnuCctvPingCtrl;
  254. TPopupMenu *pmuVms;
  255. TMenuItem *mnuVmsMsg;
  256. TMenuItem *mnuVmsCam;
  257. TMenuItem *mnuVmsPingCtrl;
  258. TPopupMenu *pmuRse;
  259. TMenuItem *pmuRsePing;
  260. TPanel *PnlMapInfo;
  261. TImage *ImgDesc27;
  262. TImage *ImgDesc37;
  263. TLabel *Label16;
  264. TLabel *Label3;
  265. TLabel *LblZoomLevel;
  266. TLabel *LblLinkLevel;
  267. TImageList *ImgFacility2;
  268. TImage *Image1;
  269. TcxLabel *cxLabel17;
  270. TMenuItem *MnuVmsId;
  271. TMenuItem *N3;
  272. TMenuItem *MnuRseId;
  273. TMenuItem *N4;
  274. TMenuItem *NetworkPing1;
  275. TMenuItem *mnuCctvPingCapt;
  276. TMenuItem *mnuCctvPingEncd;
  277. TMenuItem *mnuCctvPingStrm;
  278. TMenuItem *NetworkPing2;
  279. TMenuItem *mnuVmsPingWeb;
  280. TGroupBox *GroupBox4;
  281. TImage *ImgCurrent;
  282. TcxLabel *LblCurrTemp;
  283. TGroupBox *GroupBox5;
  284. TImage *ImgForecast;
  285. TcxLabel *LblMaxFore;
  286. TcxLabel *LblMinFore;
  287. TcxCheckBox *ChkDrawVds;
  288. TcxCheckBox *ChkDrawAvi;
  289. TcxCheckBox *ChkDrawDsrc;
  290. TImageList *ImgGisBackup;
  291. TGroupBox *GrpWeb;
  292. TImage *Image2;
  293. TImage *Image3;
  294. TImage *Image4;
  295. TcxLabel *cxLabel18;
  296. TcxLabel *cxLabel19;
  297. TcxLabel *cxLabel20;
  298. TGroupBox *GrpDsrc;
  299. TImage *Image5;
  300. TImage *Image6;
  301. TImage *Image7;
  302. TcxLabel *cxLabel21;
  303. TcxLabel *cxLabel22;
  304. TcxLabel *cxLabel23;
  305. TGroupBox *GrpAvi;
  306. TImage *Image8;
  307. TImage *Image9;
  308. TImage *Image10;
  309. TcxLabel *cxLabel24;
  310. TcxLabel *cxLabel25;
  311. TcxLabel *cxLabel26;
  312. TcxCheckBox *ChkWebCam;
  313. TGroupBox *GrpVds;
  314. TImage *Image11;
  315. TImage *Image12;
  316. TImage *Image13;
  317. TcxLabel *cxLabel27;
  318. TcxLabel *cxLabel28;
  319. TcxLabel *cxLabel29;
  320. TPopupMenu *pmuWebCam;
  321. TMenuItem *MnuWebCamId;
  322. TMenuItem *MenuItem2;
  323. TMenuItem *MnuWebCam;
  324. TMenuItem *MenuItem5;
  325. TMenuItem *MnuWebCamPing;
  326. TPopupMenu *pmuVds;
  327. TMenuItem *MnuVdsId;
  328. TMenuItem *MenuItem3;
  329. TMenuItem *MenuItem4;
  330. TPopupMenu *pmuAvi;
  331. TMenuItem *MnuAviId;
  332. TMenuItem *MenuItem7;
  333. TMenuItem *MenuItem8;
  334. TPopupMenu *pmuDsrc;
  335. TMenuItem *MnuDsrcId;
  336. TMenuItem *MenuItem10;
  337. TMenuItem *MenuItem11;
  338. TcxLabel *LblTraffic;
  339. TTimer *TmrLblTraffic;
  340. TImage *Image14;
  341. TImage *Image15;
  342. void __fastcall FormDestroy(TObject *Sender);
  343. void __fastcall FormShow(TObject *Sender);
  344. void __fastcall TmrShowTimer(TObject *Sender);
  345. void __fastcall xclntMapMapChange(TObject *Sender, TPacket &ChangePacket, bool PreImage, bool NextImage);
  346. void __fastcall xclntMapMouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y);
  347. void __fastcall MnuLayerSettingClick(TObject *Sender);
  348. void __fastcall xclntMapMouseUp(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y);
  349. void __fastcall pmuGisCalcClick(TObject *Sender);
  350. void __fastcall xclntMapExit(TObject *Sender);
  351. void __fastcall xclntMapMouseLeave(TMessage &Msg);
  352. void __fastcall xclntMapMouseMove(TObject *Sender, TShiftState Shift, int X, int Y);
  353. void __fastcall MnuViewGrayClick(TObject *Sender);
  354. void __fastcall pmuControlGisClick(TObject *Sender);
  355. void __fastcall ImgPrevClick(TObject *Sender);
  356. void __fastcall ImgNextClick(TObject *Sender);
  357. void __fastcall ImgFullClick(TObject *Sender);
  358. void __fastcall ImgStndClick(TObject *Sender);
  359. void __fastcall ImgRefreshClick(TObject *Sender);
  360. void __fastcall ChkTrafficLayerClick(TObject *Sender);
  361. void __fastcall ChkDrawGisClick(TObject *Sender);
  362. void __fastcall ChkToolTipClick(TObject *Sender);
  363. void __fastcall TmrSelectTimer(TObject *Sender);
  364. void __fastcall TmrLinkSelectTimer(TObject *Sender);
  365. void __fastcall MnuSetStdAreaClick(TObject *Sender);
  366. void __fastcall MnuMoveStdAreaClick(TObject *Sender);
  367. void __fastcall xsrvrMapEntityAdd(TObject *Sender, AnsiString EntityName, int TotalCnt, int CurCnt);
  368. void __fastcall mnuStopImageClick(TObject *Sender);
  369. void __fastcall mnuFacilityPingClick(TObject *Sender);
  370. void __fastcall pmuFacilityPopup(TObject *Sender);
  371. void __fastcall mnuCctvCamClick(TObject *Sender);
  372. void __fastcall mnuVmsMsgClick(TObject *Sender);
  373. void __fastcall mnuVmsCamClick(TObject *Sender);
  374. void __fastcall ChkDrawIncidentClick(TObject *Sender);
  375. void __fastcall xclntMapAccClick(TMouseButton Button, TShiftState Shift, int CNT, TArr_Accdt_Rec INFO);
  376. void __fastcall ChkGisSearchClick(TObject *Sender);
  377. void __fastcall MnuDrawAntiAliasClick(TObject *Sender);
  378. void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
  379. void __fastcall panRemarkMouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y);
  380. void __fastcall ChkViewExamplePropertiesChange(TObject *Sender);
  381. void __fastcall xclntMapCCTVClick(TMouseButton Button, TShiftState Shift, int CNT, TArr_CCTV_Rec INFO);
  382. void __fastcall MnuWebCamClick(TObject *Sender);
  383. void __fastcall TmrLblTrafficTimer(TObject *Sender);
  384. private: // User declarations
  385. public:
  386. TXiLinkSpeedUpdate *m_pLinkSpeedUpdate[MAX_LAYERS];
  387. //TXiValueRender *m_pLinkValueUpdate[MAX_LAYERS];
  388. // For Map
  389. TDDRect m_drtViewExtent;
  390. int m_nMapLevel;
  391. //마우스 제어 플래그
  392. TPoint m_ptDown;
  393. bool m_bMouseDown;
  394. bool m_bMoveCenter;
  395. bool m_bCalcMode;
  396. bool m_bCalcCont;
  397. // For Hint
  398. TzHintWindow *m_objToolTip;
  399. TStringList *m_slToolTip;
  400. TStringList *m_slFldName;
  401. TStringList *m_slFldValue;
  402. TStringList *m_slLinkFldName;
  403. TStringList *m_slLinkFldValue;
  404. public:
  405. /*
  406. * 지도 이전/이후 보기 핸들러, 전자지도엔진에서 함수지원은 하나 기능이 수행안됨
  407. */
  408. EXTENT_LIST_QUEUE m_ExtQ; // 이전/다음 정보를 저장할 전역변수
  409. TDDRect m_PrevExt;
  410. bool __fastcall PrevExtentQ();
  411. bool __fastcall NextExtentQ();
  412. bool __fastcall AddExtentQ(TDDRect &curRc);
  413. void __fastcall SetExtent(TDDRect &curRc);
  414. public: // User declarations
  415. __fastcall TITS00MAP(TComponent* Owner, TForm *ParentForm);
  416. void __fastcall LoadConfig();
  417. void __fastcall LoadImageFile(String sImgFile, TImage *pImage);
  418. void __fastcall LoadLocalSkin();
  419. void __fastcall CommClose();
  420. bool __fastcall FormInit();
  421. void __fastcall LoadGisMap();
  422. void __fastcall GetGisTrafficColor(TUTISLinkGrade &pUtisLinkColor);
  423. void __fastcall SetGisTrafficColor();
  424. void __fastcall SetMapOperation(TXiMapOperation nMapOper);
  425. void __fastcall GisMenuCheckClear();
  426. void __fastcall ShowLayerEditForm();
  427. void __fastcall SetTrafficInfo(bool bFlag);
  428. void __fastcall RefreshMapTraffic();
  429. void __fastcall UpdateGisRoadRank();
  430. void __fastcall UpdateGisRoadRank(int ALinkLevel, int ALyrIdx);
  431. #pragma pack(push,1)
  432. TMemoryStream *FGisStream;
  433. #pragma pack(pop)
  434. /*
  435. * 툴팁
  436. */
  437. void __fastcall CreateToolTip();
  438. void __fastcall ClearToolTip();
  439. void __fastcall ShowToolTipInfo(TPoint ptLocation, TStringList *slToolTip);
  440. void __fastcall ShowToolTipInfo(TzHintWindow *pTTipWin, TStringList *slToolTip);
  441. void __fastcall SetTrfLayerShow(bool bShow);
  442. // Hint Object
  443. bool __fastcall HintLinkLyr(TShiftState Shift, int X, int Y);
  444. // Object Select
  445. TDDPoint m_ptSelect;
  446. void __fastcall SelectObjectByPos(double dPosX, double dPosY, bool bArrow=false);
  447. void __fastcall SelectObjectByPos();
  448. void __fastcall RefreshGisLink();
  449. String __fastcall GetLinkLayerName();
  450. bool __fastcall GetLevelLinkId(int ALinkLevel, String &sLinkId, int X, int Y);
  451. bool __fastcall SelectLinkById(int ALinkLevel, String sId, bool bHide=false);
  452. bool __fastcall SelectLinkById2(int ALinkLevel, String sId, bool bHide=false);
  453. bool __fastcall SelectLinkByPos(int X, int Y);
  454. void __fastcall ShowCctvStopImage(String AId, TPoint pt);
  455. void __fastcall ShowCctvCamera(String AId, TPoint pt);
  456. void __fastcall ShowVmsMessage(String AId, TPoint pt);
  457. void __fastcall ShowVmsCamera(String AId, TPoint pt);
  458. void __fastcall ShowWebCamera(String AId, TPoint pt);
  459. void __fastcall ShowLinkDetailInfo(String sLinkId, int nLinkLevel);
  460. void __fastcall UpdateFacilityStatus();
  461. void __fastcall UpdateIncidentStatus();
  462. String FSelId;
  463. };
  464. //---------------------------------------------------------------------------
  465. extern PACKAGE TITS00MAP *ITS00MAP;
  466. //---------------------------------------------------------------------------
  467. #endif