ITS0000MF.cpp 87 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715
  1. //---------------------------------------------------------------------------
  2. #include <vcl.h>
  3. #include "ITSSkinF.h"
  4. #include "ITSUtilF.h"
  5. #include "WindowMsgF.h"
  6. #include "CDSFacilityF.h"
  7. #include "CDSIncidentF.h"
  8. #include "FrmMainF.h"
  9. #include "ITSLangTransF.h"
  10. #include "ITSMapF.h"
  11. #include "CDSLayerF.h"
  12. #include "CDSNodeF.h"
  13. #include "CDSLinkF.h"
  14. #include "CDSIfscF.h"
  15. #include "CDSRoadF.h"
  16. #include "CDSLayerF.h"
  17. #include "FrmCctvImgF.h"
  18. #include "FrmVmsMsgF.h"
  19. #include "FrmLinkInfoF.h"
  20. #include "FrmGisSearchF.h"
  21. #include "FrmStreamPlayerF.h"
  22. #include "FrmCrsStreamPlayerF.h"
  23. #include "FrmLinkInfoF.h"
  24. #include "FrmParkMsgF.h"
  25. #pragma hdrstop
  26. #include "ITS0000MF.h"
  27. #include "ITS_OPLibF.h"
  28. //---------------------------------------------------------------------------
  29. #pragma package(smart_init)
  30. #pragma link "FRAME_FacilityStatusListF"
  31. #pragma link "FRAME_ProcessStatusListF"
  32. #pragma link "FRAME_IncidentListF"
  33. #pragma link "FRAME_RepeatCongestListF"
  34. #pragma link "FRAME_TrafficMissLinkListF"
  35. #pragma link "FRAME_IncidentAutoListF"
  36. #pragma link "cxClasses"
  37. #pragma link "cxContainer"
  38. #pragma link "cxControls"
  39. #pragma link "cxCustomData"
  40. #pragma link "cxData"
  41. #pragma link "cxDataStorage"
  42. #pragma link "cxEdit"
  43. #pragma link "cxFilter"
  44. #pragma link "cxGraphics"
  45. #pragma link "cxGrid"
  46. #pragma link "cxGridCustomTableView"
  47. #pragma link "cxGridCustomView"
  48. #pragma link "cxGridLevel"
  49. #pragma link "cxGridTableView"
  50. #pragma link "cxGroupBox"
  51. #pragma link "cxLabel"
  52. #pragma link "cxLookAndFeelPainters"
  53. #pragma link "cxLookAndFeels"
  54. #pragma link "cxPC"
  55. #pragma link "cxPCdxBarPopupMenu"
  56. #pragma link "cxSplitter"
  57. #pragma link "cxStyles"
  58. #pragma link "dxSkinBlack"
  59. #pragma link "dxSkinBlue"
  60. #pragma link "dxSkinsCore"
  61. #pragma link "dxSkinscxPCPainter"
  62. #pragma link "FRAME_DatabaseStatusF"
  63. #pragma link "FRAME_OpenMapF"
  64. #pragma link "cxButtons"
  65. #pragma link "cxCheckBox"
  66. #pragma link "cxTextEdit"
  67. #pragma link "cxProgressBar"
  68. #pragma link "dxGDIPlusClasses"
  69. #pragma link "FRAME_AtmpPltnListF"
  70. #pragma link "FRAME_VilgFrcsListF"
  71. #pragma link "FRAME_VilgShprListF"
  72. #pragma link "dxSkinMcSkin"
  73. #pragma link "cxCheckComboBox"
  74. #pragma link "cxDropDownEdit"
  75. #pragma link "cxMaskEdit"
  76. #pragma link "cxCheckListBox"
  77. #pragma resource "*.dfm"
  78. TITS0000M *ITS0000M = NULL;
  79. //---------------------------------------------------------------------------
  80. TColor g_clrStatus[5] = {
  81. clGreen,
  82. clRed,
  83. clYellow,
  84. clBlack,//clSilver,
  85. clBlack,//clSilver,
  86. };
  87. String g_strStatus[5] = {
  88. "", "", "", "", "",
  89. };
  90. String g_strIncident[8] = {
  91. "", "사고", "공사", "행사", "기상", "통제", "재난", "기타",
  92. };
  93. TColor g_clrTraffic[4] = {
  94. clGray,
  95. clLime,
  96. clYellow,
  97. clRed,
  98. };
  99. String g_strTraffic[4] = {
  100. "", "", "", "",
  101. };
  102. //---------------------------------------------------------------------------
  103. String g_sZoomLevel[] = {
  104. "Link", // 0
  105. "Link", // 1
  106. "Link", // 2
  107. "Link", // 3
  108. "Link", // 4
  109. "Ifsc", // 5
  110. "Ifsc", // 6
  111. "Road", // 7
  112. "Road", // 8
  113. "Road", // 9
  114. "Road", //10
  115. "", //11
  116. "", //12
  117. "", //13
  118. "", //14
  119. };
  120. String g_sTrafficSql[] = {
  121. "0*************************************************************************\r\n",
  122. "1*************************************************************************\r\n",
  123. "SELECT A.ROAD_ID AS LINKID, NVL(B.SPED, 0) AS SPEED, \r\n"
  124. " NVL(B.PRCN_DT, '19000101000000') AS REGDATE, \r\n"
  125. " NVL(B.DATA_NUM, 0) AS DATACNT, \r\n"
  126. " NVL(B.TRVL_HH, 0) AS TRVTM \r\n"
  127. " FROM TB_ROAD A, \r\n"
  128. " (SELECT * \r\n"
  129. " FROM TB_ROAD_TRAF \r\n"
  130. " WHERE PRCN_DT > TO_CHAR(SYSDATE - 5 / 1440, 'YYYYMMDDHH24MISS') \r\n"
  131. " ) B \r\n"
  132. " WHERE A.ROAD_ID = B.ROAD_ID(+) \r\n",
  133. "SELECT A.IFSC_ID AS LINKID, NVL(B.SPED, 0) AS SPEED, \r\n"
  134. " NVL(B.PRCN_DT, '19000101000000') AS REGDATE, \r\n"
  135. " NVL(B.DATA_NUM, 0) AS DATACNT, \r\n"
  136. " NVL(B.TRVL_HH, 0) AS TRVTM \r\n"
  137. " FROM TB_IFSC A, \r\n"
  138. " (SELECT * \r\n"
  139. " FROM TB_IFSC_TRAF \r\n"
  140. " WHERE PRCN_DT > TO_CHAR(SYSDATE - 5 / 1440, 'YYYYMMDDHH24MISS') \r\n"
  141. " ) B \r\n"
  142. " WHERE A.IFSC_ID = B.IFSC_ID(+) \r\n",
  143. "4************************************************************************\r\n",
  144. "SELECT A.LINK_ID AS LINKID, NVL(B.SPED, 0) AS SPEED, \r\n"
  145. " NVL(B.PRCN_DT, '19000101000000') AS REGDATE, \r\n"
  146. " NVL(B.DATA_NUM, 0) AS DATACNT, \r\n"
  147. " NVL(B.TRVL_HH, 0) AS TRVTM \r\n"
  148. " FROM TB_LINK A, \r\n"
  149. " (SELECT * \r\n"
  150. " FROM TB_LINK_TRAF \r\n"
  151. " WHERE PRCN_DT > TO_CHAR(SYSDATE - 5 / 1440, 'YYYYMMDDHH24MISS') \r\n"
  152. " ) B \r\n"
  153. " WHERE A.LINK_ID = B.LINK_ID(+) \r\n",
  154. "6************************************************************************\r\n",
  155. };
  156. void TITS0000M_MapCallback(TObject *ASender, const String AFunc, const String AArgs, const bool AFirst)
  157. {
  158. try
  159. {
  160. if (!ITS0000M) return;
  161. ITS0000M->OpenMapCallback(ASender, AFunc, AArgs, AFirst);
  162. }
  163. catch(Exception &exception)
  164. {
  165. }
  166. }
  167. //---------------------------------------------------------------------------
  168. __fastcall TITS0000M::TITS0000M(TComponent* Owner)
  169. : TForm(Owner)
  170. {
  171. LangTrans->Translate(this, ITSDb_GetConnection());
  172. ITSSkin_Load(this);
  173. LoadLocalSkin();
  174. CMM_LoadForm(g_sFormsDir, this);
  175. GrpSystem->Caption = lblSysTab->Caption + " - " + TsIncident->Caption;//"▶ 시스템 운영 정보 - " + TsIncident->Caption;
  176. FRAMEFacilityStatusList1->PnlBottom->Visible = false;
  177. FRAMETrafficMissLinkList1->Column18->Visible = false;
  178. //FrmMain->dxStatusBar->Panels->Items[isbGisPos]->Visible = true;
  179. //시스템자동돌발
  180. FRAMEIncidentAutoList1->Visible = false;
  181. TsIncidentAuto->TabVisible = false;
  182. TsIncidentAuto->Visible = false;
  183. //기상-초단기예보
  184. FRAMEVilgShprList1->Visible = false;
  185. TsVilgShpr->TabVisible = false;
  186. TsVilgShpr->Visible = false;
  187. //기상-동네예보
  188. FRAMEVilgFrcsList1->Visible = false;
  189. TsVilgFrcs->TabVisible = false;
  190. TsVilgFrcs->Visible = false;
  191. //대기환경
  192. FRAMEAtmpPltnList1->Visible = false;
  193. TsAtmpPltn->TabVisible = false;
  194. TsAtmpPltn->Visible = false;
  195. //데이터베이스 사용량
  196. TsFacilityOpr->TabVisible = false;
  197. GrpBottomUtis->Caption = "▶ 시설물 현황";
  198. FRAMEDatabaseStatus1->Visible = false;
  199. TsDatabaseOpr->TabVisible = false;
  200. TsDatabaseOpr->Visible = false;
  201. TabDebug->TabVisible = false;
  202. TabDebug->Visible = false;
  203. reMsg->Lines->Clear();
  204. PgSystem->Properties->ActivePage = TsIncident;
  205. PgSystemOpr->Properties->ActivePage = TsFacilityOpr;
  206. FRAMEOpenMap1->PnlToolbar->Visible = false;
  207. FRAMEOpenMap1->MapCallbackFunc = TITS0000M_MapCallback;
  208. TsClctSystStts->TabVisible = false;
  209. TsClctSystStts->Visible = false;
  210. ChkPark->Tag = LyrTp_Park;
  211. ChkIncident->Tag = LyrTp_Incd;
  212. ChkPark->Visible = false;
  213. #if 0
  214. FOR_STL(TItsLayer*, pLayer, ItsLayerManager->FLists)
  215. {
  216. if (pLayer->Index == LyrTp_Incd)
  217. {
  218. pLayer->Visible = ChkIncident->Checked;
  219. break;
  220. }
  221. }
  222. #endif
  223. }
  224. //---------------------------------------------------------------------------
  225. void __fastcall TITS0000M::CommClose()
  226. {
  227. try
  228. {
  229. FOR_STL(TItsLayer*, pLayer, ItsLayerManager->FLists)
  230. {
  231. if (pLayer->Enabled)
  232. {
  233. String sValue = (pLayer->Visible) ? "1" : "0";
  234. WriteConfigInfo(g_AppCfg.sConfigFile, "LAYER", pLayer->Name, sValue);
  235. }
  236. }
  237. if (FrmMain->dxStatusBar->Panels->Items[isbGisPos]->Visible)
  238. FrmMain->dxStatusBar->Panels->Items[isbGisPos]->Visible = false;
  239. CMM_SaveForm(g_sFormsDir, this);
  240. }
  241. catch(...)
  242. {
  243. }
  244. }
  245. //---------------------------------------------------------------------------
  246. void __fastcall TITS0000M::FormCreate(TObject *Sender)
  247. {
  248. //
  249. }
  250. //---------------------------------------------------------------------------
  251. void __fastcall TITS0000M::FormShow(TObject *Sender)
  252. {
  253. Refresh();
  254. FRAMEOpenMap1->OpenMap();
  255. Application->ProcessMessages();
  256. TmrShow->Enabled = true;
  257. }
  258. //---------------------------------------------------------------------------
  259. void __fastcall TITS0000M::LoadLocalSkin()
  260. {
  261. #define MAX_VIEW 12
  262. TcxGridTableView *pView[MAX_VIEW];
  263. TcxGrid *pGrid[MAX_VIEW];
  264. for (int ii = 0; ii < MAX_VIEW; ii++)
  265. {
  266. pGrid[ii] = NULL;
  267. pView[ii] = NULL;
  268. }
  269. pGrid[ 0] = FRAMEProcessStatusList1->CxList; //프로세스상태
  270. pGrid[ 1] = FRAMEFacilityStatusList1->CxList; //시설물상태
  271. #if 1
  272. pGrid[ 2] = NULL;
  273. pGrid[ 3] = NULL;
  274. #else
  275. pGrid[ 2] = FRAMEDatabaseStatus1->CxList;//FRAMEUtisStatusList1->CxUtisRun; //UTIS현황-운영현황
  276. //pGrid[ 3] = FRAMEUtisStatusList1->CxUtisRse; //UTIS현황-RSE상태현황
  277. #endif
  278. pGrid[ 4] = FRAMEIncidentList1->CxList; //돌발
  279. pGrid[ 5] = FRAMERepeatCongestList1->CxList; //반복정체구간
  280. pGrid[ 6] = FRAMETrafficMissLinkList1->CxList; //소통정보결측구간
  281. pGrid[ 7] = FRAMEIncidentAutoList1->CxList2; //소통정보결측구간
  282. //pGrid[ 8] = FRAMEBlackBoxEventList1->CxList; //블랙박스이벤트리스트
  283. pGrid[ 9] = FRAMEVilgFrcsList1->CxList; //기상정보리스트
  284. pGrid[10] = FRAMEVilgShprList1->CxList; //기상정보리스트(초단기예보)
  285. pGrid[11] = FRAMEAtmpPltnList1->CxList; //환경정보(대기오염)
  286. pView[ 0] = FRAMEProcessStatusList1->TvList;
  287. pView[ 1] = FRAMEFacilityStatusList1->TvList;
  288. #if 1
  289. pView[ 2] = NULL;
  290. pView[ 3] = NULL;
  291. #else
  292. pView[ 2] = FRAMEDatabaseStatus1->TvList;//FRAMEUtisStatusList1->TvUtisRun;
  293. //pView[ 3] = FRAMEUtisStatusList1->TvUtisRse;
  294. #endif
  295. pView[ 4] = FRAMEIncidentList1->TvList;
  296. pView[ 5] = FRAMERepeatCongestList1->TvList;
  297. pView[ 6] = FRAMETrafficMissLinkList1->TvList;
  298. pView[ 7] = FRAMEIncidentAutoList1->TvList2;
  299. //pView[ 8] = FRAMEBlackBoxEventList1->TvList;
  300. pView[ 9] = FRAMEVilgFrcsList1->TvList;
  301. pView[10] = FRAMEVilgShprList1->TvList;
  302. pView[11] = (TcxGridTableView*)FRAMEAtmpPltnList1->TvList;
  303. for (int ii = 0; ii < MAX_VIEW; ii++)
  304. {
  305. if (!pView[ii]) continue;
  306. //pGrid[ii]->LookAndFeel->SkinName = "McSkin";
  307. pView[ii]->Styles->Inactive = NULL;
  308. pView[ii]->Styles->ContentOdd = NULL;
  309. pView[ii]->Styles->ContentEven= NULL;
  310. pView[ii]->Styles->Selection = NULL;
  311. pView[ii]->OptionsSelection->CellSelect = false;
  312. }
  313. }
  314. //---------------------------------------------------------------------------
  315. void __fastcall TITS0000M::TmrShowTimer(TObject *Sender)
  316. {
  317. TmrShow->Enabled = false;
  318. // 상태바 표출
  319. PnlProgress->Left = (this->Width - PnlProgress->Width) / 2;
  320. PnlProgress->Top = (this->Height - PnlProgress->Height) / 2;
  321. PnlProgress->Top -= 50;
  322. PnlProgress->Visible = true;
  323. PbLoadMap->Properties->Text = lblGisStep1->Caption;//"지도 로딩 중...";
  324. Application->ProcessMessages();
  325. PbLoadMap->Position = 30;
  326. // 리스트 항목을 초기화한다.
  327. InitListData();
  328. }
  329. //---------------------------------------------------------------------------
  330. void __fastcall TITS0000M::InitListData()
  331. {
  332. FIncidentCnt = 0;
  333. FRrCongestCnt = 0;
  334. FMissLinkCnt = 0;
  335. FRAMEFacilityStatusList1->UpdateList();
  336. UpdateFacilityStatusTotal();
  337. FRAMEProcessStatusList1->UpdateList();
  338. if (GrpBottomUtis->Visible)
  339. {
  340. if (FRAMEDatabaseStatus1->Visible) FRAMEDatabaseStatus1->UpdateList();
  341. //FRAMEUtisStatusList1->UpdateList();
  342. }
  343. if (FRAMEIncidentList1->Visible) FRAMEIncidentList1->UpdateList();
  344. if (FRAMERepeatCongestList1->Visible) FRAMERepeatCongestList1->UpdateList();
  345. if (FRAMETrafficMissLinkList1->Visible) FRAMETrafficMissLinkList1->UpdateList();
  346. if (FRAMEIncidentAutoList1->Visible) FRAMEIncidentAutoList1->UpdateList();
  347. //FRAMEBlackBoxEventList1->UpdateList();
  348. if (FRAMEVilgFrcsList1->Visible) FRAMEVilgFrcsList1->UpdateList();
  349. if (FRAMEVilgShprList1->Visible) FRAMEVilgShprList1->UpdateList();
  350. if (FRAMEAtmpPltnList1->Visible) FRAMEAtmpPltnList1->UpdateList();
  351. UpdateAlarmStatus();
  352. if (TsClctSystStts->Visible) UpdateClctSystStts(); // 수집/가공현황 업데이트
  353. }
  354. //---------------------------------------------------------------------------
  355. void __fastcall TITS0000M::UpdateAlarmStatus()
  356. {
  357. String sAlarmMsg = "";
  358. FIncidentCnt = FRAMEIncidentList1->TvList->DataController->RecordCount;
  359. FRrCongestCnt = FRAMERepeatCongestList1->TvList->DataController->RecordCount;
  360. FMissLinkCnt = FRAMETrafficMissLinkList1->TvList->DataController->RecordCount;
  361. FIncidentAutoCnt = FRAMEIncidentAutoList1->TvList2->DataController->RecordCount;
  362. //FBlackBoxEventCnt = FRAMEBlackBoxEventList1->TvList->DataController->RecordCount;
  363. FVilgFrcsCnt1 = FRAMEVilgFrcsList1->GetAlarmCount1();
  364. FVilgFrcsCnt2 = FRAMEVilgFrcsList1->GetAlarmCount2();
  365. FVilgFrcsCnt3 = FRAMEVilgShprList1->GetAlarmCount();
  366. FAtmpPlntCnt = FRAMEAtmpPltnList1->GetAlarmCount();
  367. if (TsIncidentAuto->TabVisible == false)
  368. {
  369. FIncidentAutoCnt = 0;
  370. }
  371. if (TsVilgShpr->TabVisible == false)
  372. {
  373. FVilgFrcsCnt3 = 0;
  374. }
  375. if (TsVilgFrcs->TabVisible == false)
  376. {
  377. FVilgFrcsCnt1 = 0;
  378. FVilgFrcsCnt2 = 0;
  379. }
  380. if (TsAtmpPltn->TabVisible == false)
  381. {
  382. FAtmpPlntCnt = 0;
  383. }
  384. if (FIncidentCnt > 0)
  385. {
  386. sAlarmMsg += TsIncident->Caption + "(" + String(FIncidentCnt) + ") ";//"돌발상황(" + String(FIncidentCnt) + ") ";
  387. TsIncident->ImageIndex = 1;
  388. }
  389. else
  390. TsIncident->ImageIndex = 2;
  391. if (FRrCongestCnt > 0)
  392. {
  393. sAlarmMsg += TsRrCongest->Caption + "(" + String(FRrCongestCnt) + ") ";//"반복정체구간(" + String(FRrCongestCnt) + ") ";
  394. TsRrCongest->ImageIndex = 1;
  395. }
  396. else
  397. TsRrCongest->ImageIndex = 2;
  398. if (FMissLinkCnt > 0)
  399. {
  400. sAlarmMsg += TsMissingLink->Caption + "(" + String(FMissLinkCnt) + ") ";//"결측구간(" + String(FMissLinkCnt) + ") ";
  401. TsMissingLink->ImageIndex = 1;
  402. }
  403. else
  404. TsMissingLink->ImageIndex = 2;
  405. if (FIncidentAutoCnt > 0)
  406. {
  407. sAlarmMsg += TsIncidentAuto->Caption + "(" + String(FIncidentAutoCnt) + ") ";//"자동돌발(" + String(FIncidentAutoCnt) + ") ";
  408. TsIncidentAuto->ImageIndex = 1;
  409. }
  410. else
  411. TsIncidentAuto->ImageIndex = 2;
  412. if ((FVilgFrcsCnt1 + FVilgFrcsCnt2) > 0)
  413. {
  414. //sAlarmMsg += TsVilgFrcs->Caption + "(" + String(FVilgFrcsCnt1 + FVilgFrcsCnt2) + ") ";
  415. sAlarmMsg += TsVilgFrcs->Caption + " ";
  416. TsVilgFrcs->ImageIndex = 1;
  417. }
  418. else
  419. TsVilgFrcs->ImageIndex = 2;
  420. if ((FVilgFrcsCnt3) > 0)
  421. {
  422. //sAlarmMsg += TsVilgShpr->Caption + "(" + String(FVilgFrcsCnt3) + ") ";
  423. sAlarmMsg += TsVilgShpr->Caption + " ";
  424. TsVilgShpr->ImageIndex = 1;
  425. }
  426. else
  427. TsVilgShpr->ImageIndex = 2;
  428. if ((FAtmpPlntCnt) > 0)
  429. {
  430. sAlarmMsg += TsAtmpPltn->Caption + "(" + String(FAtmpPlntCnt) + ") ";
  431. TsAtmpPltn->ImageIndex = 1;
  432. }
  433. else
  434. TsAtmpPltn->ImageIndex = 2;
  435. LblAlarm->Caption = sAlarmMsg;
  436. if ((FIncidentCnt+FRrCongestCnt+FMissLinkCnt+FIncidentAutoCnt+FBlackBoxEventCnt+FVilgFrcsCnt1+FVilgFrcsCnt2+FVilgFrcsCnt3+FAtmpPlntCnt) > 0)
  437. {
  438. LblAlarm->Visible = true;
  439. }
  440. else
  441. {
  442. LblAlarm->Visible = false;
  443. }
  444. }
  445. //---------------------------------------------------------------------------
  446. void __fastcall TITS0000M::PgSystemPageChanging(TObject *Sender, TcxTabSheet *NewPage, bool &AllowChange)
  447. {
  448. GrpSystem->Caption = lblSysTab->Caption + " - " + NewPage->Caption;//"▶ 시스템 운영 정보 - " + NewPage->Caption;
  449. }
  450. //---------------------------------------------------------------------------
  451. void __fastcall TITS0000M::FormClose(TObject *Sender, TCloseAction &Action)
  452. {
  453. try {
  454. CommClose();
  455. ITS0000M = NULL;
  456. Action = caFree;
  457. } catch(...) {}
  458. }
  459. //---------------------------------------------------------------------------
  460. /*
  461. * 메인폼에서 데이터를 수신시 발생하는 이벤트 핸들러
  462. * arguments
  463. *
  464. * return
  465. * void
  466. */
  467. void __fastcall TITS0000M::OnMainFormMessage(TMessage &Msg)
  468. {
  469. switch(Msg.WParam)
  470. {
  471. case WP_DB_SELECT_OK:
  472. switch(Msg.LParam)
  473. {
  474. case LP_MSG_TRAFFIC: //소통정보 조회 완료
  475. DebugMsg("교통정보 업데이트");
  476. UpdateTrafficMissLinkInfo(); // 결측구간
  477. UpdateTrafficRrCongestInfo(); // 반복정체구간
  478. UpdateGisTraffic(); // 지도 소통정보 업데이트
  479. if (BtnRefresh->Enabled == false)
  480. {
  481. BtnRefresh->Enabled = true;
  482. }
  483. UpdateClctSystStts(); // 수집/가공현황 업데이트
  484. break;
  485. case LP_MSG_PROCESS_STTS: //프로세스 상태 조회 완료
  486. DebugMsg("프로세스 상태정보 업데이트");
  487. UpdateProcessStatusInfo();
  488. break;
  489. case LP_MSG_DATABASE_STTS: //데이터베이스 상태
  490. DebugMsg("데이터베이스 상태정보 업데이트");
  491. UpdateDatabaseStatusInfo();
  492. break;
  493. case LP_MSG_FACILITY_STTS: //시설물 상태 조회 완료
  494. DebugMsg("시설물 상태정보 업데이트");
  495. UpdateFacilityStatusInfo();
  496. break;
  497. case LP_MSG_INCIDENT: //돌발정보 조회 완료
  498. DebugMsg("돌발정보 업데이트");
  499. UpdateIncidentInfo();
  500. break;
  501. case LP_MSG_16: DebugMsg("블랙박스정보 로딩"); UpdateBlackBoxEventInfo(); break;
  502. case LP_MSG_WEATHER: DebugMsg("기상정보 로딩"); UpdateVilgFrcsInfo(); break;
  503. case LP_MSG_05: DebugMsg("UTIS 정보 로딩"); UpdateUtisStatusInfo(); break;
  504. case LP_MSG_14: DebugMsg("시설물정보 로딩"); UpdateFacilityInfo(); break;
  505. case LP_MSG_09: DebugMsg("프로세스정보 로딩"); FRAMEProcessStatusList1->UpdateList(); break;
  506. case LP_MSG_VMS_DSPLMSG: DebugMsg("VMS 표출 스케쥴 로딩"); UpdateVmsMsg(1); break;
  507. }
  508. break;
  509. case WP_MSG_01: //소통등급이 변경되었다.
  510. SetGisTrafficColor();
  511. break;
  512. case WP_MSG_02: //돌발정보를 현단말에서 취소/등록/해제 하였다.
  513. UpdateIncidentInfo();
  514. break;
  515. case WP_MSG_03: //시설물 기본정보가 변경됨
  516. UpdateFacilityInfo();
  517. break;
  518. case WP_DB_SELECT_ERROR:
  519. case WP_DB_SELECT_CANCEL:
  520. break;
  521. case WP_MSG_15:
  522. if (LP_MSG_15 == Msg.LParam)
  523. {
  524. RefreshGisLink();
  525. }
  526. break;
  527. }
  528. //TmrDebugHideTimer((TObject*)TmrDebugHide);
  529. }
  530. //---------------------------------------------------------------------------
  531. void __fastcall TITS0000M::UpdateTrafficMissLinkInfo()
  532. {
  533. FMissLinkCnt = 0;
  534. FRAMETrafficMissLinkList1->UpdateList();
  535. FRAMEIncidentAutoList1->UpdateList();
  536. UpdateAlarmStatus();
  537. }
  538. //---------------------------------------------------------------------------
  539. void __fastcall TITS0000M::UpdateTrafficRrCongestInfo()
  540. {
  541. FRrCongestCnt = 0;
  542. FRAMERepeatCongestList1->UpdateList();
  543. UpdateAlarmStatus();
  544. }
  545. //---------------------------------------------------------------------------
  546. void __fastcall TITS0000M::UpdateIncidentInfo()
  547. {
  548. FIncidentCnt = 0;
  549. FRAMEIncidentList1->UpdateList();
  550. FRAMEIncidentAutoList1->UpdateList();
  551. UpdateAlarmStatus();
  552. UpdateGisIncident();
  553. }
  554. //---------------------------------------------------------------------------
  555. void __fastcall TITS0000M::UpdateFacilityStatusInfo()
  556. {
  557. //FRAMEFacilityStatusList1->UpdateList();
  558. FRAMEFacilityStatusList1->RefreshList();
  559. UpdateFacilityStatusTotal();
  560. UpdateAlarmStatus();
  561. UpdateGisFacility();
  562. }
  563. //---------------------------------------------------------------------------
  564. void __fastcall TITS0000M::UpdateProcessStatusInfo()
  565. {
  566. FRAMEProcessStatusList1->RefreshList();
  567. UpdateAlarmStatus();
  568. }
  569. //---------------------------------------------------------------------------
  570. void __fastcall TITS0000M::UpdateUtisStatusInfo()
  571. {
  572. if (GrpBottomUtis->Visible)
  573. {
  574. //FRAMEUtisStatusList1->RefreshList();
  575. }
  576. }
  577. //---------------------------------------------------------------------------
  578. void __fastcall TITS0000M::UpdateDatabaseStatusInfo()
  579. {
  580. if (GrpBottomUtis->Visible)
  581. {
  582. if (FRAMEDatabaseStatus1->Visible) FRAMEDatabaseStatus1->RefreshList();
  583. }
  584. }
  585. //---------------------------------------------------------------------------
  586. void __fastcall TITS0000M::UpdateFacilityInfo()
  587. {
  588. FRAMEFacilityStatusList1->UpdateList();
  589. UpdateFacilityStatusTotal();
  590. UpdateAlarmStatus();
  591. UpdateGisFacility(); //지도 시설물 재로딩
  592. }
  593. //---------------------------------------------------------------------------
  594. void __fastcall TITS0000M::UpdateBlackBoxEventInfo()
  595. {
  596. FBlackBoxEventCnt = 0;
  597. //FRAMEBlackBoxEventList1->UpdateList();
  598. UpdateAlarmStatus();
  599. }
  600. //---------------------------------------------------------------------------
  601. void __fastcall TITS0000M::UpdateVilgFrcsInfo()
  602. {
  603. FVilgFrcsCnt1 = 0;
  604. FVilgFrcsCnt2 = 0;
  605. FVilgFrcsCnt3 = 0;
  606. FAtmpPlntCnt = 0;
  607. if (FRAMEVilgFrcsList1->Visible) FRAMEVilgFrcsList1->RefreshList();
  608. if (FRAMEVilgShprList1->Visible) FRAMEVilgShprList1->RefreshList();
  609. if (FRAMEAtmpPltnList1->Visible) FRAMEAtmpPltnList1->RefreshList();
  610. UpdateAlarmStatus();
  611. }
  612. //---------------------------------------------------------------------------
  613. void __fastcall TITS0000M::FRAMEIncidentList1TvListCellDblClick(TcxCustomGridTableView *Sender, TcxGridTableDataCellViewInfo *ACellViewInfo,
  614. TMouseButton AButton, TShiftState AShift, bool &AHandled)
  615. {
  616. //돌발 클릭
  617. if (!ACellViewInfo) return;
  618. try {
  619. TcxDataController *pGDC = FRAMEIncidentList1->TvList->DataController;
  620. int nRow = pGDC->FocusedRecordIndex;
  621. if (nRow < 0) return;
  622. String sId = VarToStr(pGDC->Values[nRow][FRAMEIncidentList1->Column01->Index]);
  623. String sDx = VarToStr(pGDC->Values[nRow][FRAMEIncidentList1->Column07->Index]);
  624. String sDy = VarToStr(pGDC->Values[nRow][FRAMEIncidentList1->Column08->Index]);
  625. SelectObjectByPos(StrToFloat(sDx), StrToFloat(sDy), true);
  626. } catch(...) {}
  627. }
  628. //---------------------------------------------------------------------------
  629. void __fastcall TITS0000M::FRAMERepeatCongestList1TvListCellDblClick(TcxCustomGridTableView *Sender, TcxGridTableDataCellViewInfo *ACellViewInfo,
  630. TMouseButton AButton, TShiftState AShift, bool &AHandled)
  631. {
  632. //반복정체구간 클릭
  633. if (!ACellViewInfo) return;
  634. try {
  635. TcxDataController *pGDC = FRAMERepeatCongestList1->TvList->DataController;
  636. int nRow = pGDC->FocusedRecordIndex;
  637. if (nRow < 0) return;
  638. String sSvcLinkId = VarToStr(pGDC->Values[nRow][FRAMERepeatCongestList1->Column01->Index]);
  639. SelectLinkById(2, sSvcLinkId, true);
  640. } catch(...) {}
  641. }
  642. //---------------------------------------------------------------------------
  643. void __fastcall TITS0000M::FRAMETrafficMissLinkList1TvListCellDblClick(TcxCustomGridTableView *Sender, TcxGridTableDataCellViewInfo *ACellViewInfo,
  644. TMouseButton AButton, TShiftState AShift, bool &AHandled)
  645. {
  646. //소통정보 결측구간 클릭
  647. if (!ACellViewInfo) return;
  648. try {
  649. TcxDataController *pGDC = FRAMETrafficMissLinkList1->TvList->DataController;
  650. int nRow = pGDC->FocusedRecordIndex;
  651. if (nRow < 0) return;
  652. String sLinkId = VarToStr(pGDC->Values[nRow][FRAMETrafficMissLinkList1->Column02->Index]);
  653. SelectLinkById(1, sLinkId, true);
  654. } catch(...) {}
  655. }
  656. //---------------------------------------------------------------------------
  657. void __fastcall TITS0000M::FRAMEFacilityStatusList1TvListCellDblClick(TcxCustomGridTableView *Sender, TcxGridTableDataCellViewInfo *ACellViewInfo,
  658. TMouseButton AButton, TShiftState AShift, bool &AHandled)
  659. {
  660. //시설물 위치이동
  661. if (!ACellViewInfo) return;
  662. try {
  663. TcxDataController *pGDC = FRAMEFacilityStatusList1->TvList->DataController;
  664. int nRow = pGDC->FocusedRecordIndex;
  665. if (nRow < 0) return;
  666. String sType = VarToStr(pGDC->Values[nRow][FRAMEFacilityStatusList1->Column01->Index]);
  667. FSelId = VarToStr(pGDC->Values[nRow][FRAMEFacilityStatusList1->Column02->Index]);
  668. if (sType == "CRSSVR") return;
  669. MoveGisFacility(sType, FSelId);
  670. } catch(...) {}
  671. }
  672. //---------------------------------------------------------------------------
  673. void __fastcall TITS0000M::MoveGisFacility(String AType, String AId)
  674. {
  675. if (!FRAMEOpenMap1->MapStart) return;
  676. int nLayerIdx = ItsLayerManager->GetLayerIndex(AType);
  677. if (nLayerIdx < 0) return;
  678. TItsFacility *pFacility = ItsFacilityManager->FLists.Find(AId);
  679. if (pFacility)
  680. {
  681. if (pFacility->Object)
  682. {
  683. sJs.printf(L"selectLayerObject(%d, '%s', %d)", nLayerIdx, pFacility->Object->CTLR_NMBR.c_str(), FRAMEOpenMap1->MapZoom);
  684. FRAMEOpenMap1->ExecScript(sJs);
  685. }
  686. }
  687. }
  688. //---------------------------------------------------------------------------
  689. void __fastcall TITS0000M::FRAMEFacilityStatusList1TvListCellClick(TcxCustomGridTableView *Sender, TcxGridTableDataCellViewInfo *ACellViewInfo,
  690. TMouseButton AButton, TShiftState AShift, bool &AHandled)
  691. {
  692. if (AButton != mbRight) return;
  693. if (!ACellViewInfo) return;
  694. try {
  695. TcxDataController *pGDC = FRAMEFacilityStatusList1->TvList->DataController;
  696. int nRow = pGDC->FocusedRecordIndex;
  697. if (nRow < 0) return;
  698. String sType = VarToStr(pGDC->Values[nRow][FRAMEFacilityStatusList1->Column01->Index]);
  699. FSelId = VarToStr(pGDC->Values[nRow][FRAMEFacilityStatusList1->Column02->Index]);
  700. if (sType == "CRSSVR") return;
  701. int nLayerIndex = ItsLayerManager->GetLayerIndex(sType);
  702. OnMapPopupMenu(nLayerIndex, FSelId, true);
  703. } catch(...) {}
  704. }
  705. //---------------------------------------------------------------------------
  706. void __fastcall TITS0000M::pmuFacilityPopup(TObject *Sender)
  707. {
  708. TPopupMenu *pPopup = (TPopupMenu*)Sender;
  709. FSelMenuTag = pPopup->Tag;
  710. TItsFacility *pFacility = ItsFacilityManager->FLists.Find(FSelId);
  711. if (!pFacility) return;
  712. //String sLayerType = ItsLayerManager->GetLayerType(FSelMenuTag);
  713. String sLayerType = ItsLayerManager->GetLayerName(pFacility->FCLT_TYPE);
  714. if (sLayerType == "") return;
  715. TCDSObject *pObj = pFacility->Object;
  716. if (!pObj) return;
  717. pPopup->Items->Items[0]->Caption = "[" + sLayerType + "] " + pObj->NAME;
  718. }
  719. //---------------------------------------------------------------------------
  720. void __fastcall TITS0000M::mnuFacilityMoveClick(TObject *Sender)
  721. {
  722. TMenuItem *pMenu = (TMenuItem*)Sender;
  723. Application->ProcessMessages();
  724. String sLayerType = ItsLayerManager->GetLayerType(FSelMenuTag);
  725. if (sLayerType != "")
  726. {
  727. MoveGisFacility(sLayerType, FSelId);
  728. }
  729. }
  730. //---------------------------------------------------------------------------
  731. void __fastcall TITS0000M::mnuFacilityPingClick(TObject *Sender)
  732. {
  733. TMenuItem *pMenu = (TMenuItem*)Sender;
  734. Application->ProcessMessages();
  735. String sIp = "";
  736. TItsFacility *pFacility = ItsFacilityManager->FLists.Find(FSelId);
  737. if (!pFacility) return;
  738. TCDSObject *pObj = pFacility->Object;
  739. if (!pObj) return;
  740. if (pMenu->Tag == 21) //제어기 핑 테스트
  741. {
  742. sIp = pObj->CTLR_IP;
  743. }
  744. else
  745. if (pMenu->Tag == 22 && FSelMenuTag == LyrTp_Vms)
  746. {
  747. TVmsCtlr *pObj = (TVmsCtlr*)pObj;
  748. sIp = pObj->WEB_CMRA_IP;
  749. }
  750. if (sIp.IsEmpty())
  751. {
  752. Application->MessageBox(Label2->Caption.c_str(),//L"IP Address 정보가 없습니다.\r\nIP Address 정보를 확인하세요.",
  753. Label1->Caption.c_str(), MB_OK|MB_ICONERROR|MB_APPLMODAL);
  754. return;
  755. }
  756. else
  757. {
  758. ITSUtil_NetworkPing(sIp);
  759. }
  760. }
  761. //---------------------------------------------------------------------------
  762. void __fastcall TITS0000M::mnuStopImageClick(TObject *Sender)
  763. {
  764. Application->ProcessMessages();
  765. TPoint pt;
  766. GetCursorPos(&pt);
  767. pt = ScreenToClient(pt);
  768. ShowCctvStopImage(FSelId, pt);
  769. }
  770. //---------------------------------------------------------------------------
  771. void __fastcall TITS0000M::ShowCctvStopImage(String AId, TPoint pt)
  772. {
  773. TItsFacility *pFacility = ItsFacilityManager->FLists.Find(AId);
  774. if (!pFacility) return;
  775. TCctvCtlr *pObj = (TCctvCtlr*)pFacility->Object;
  776. if (!pObj) return;
  777. try {
  778. if (pObj->FData1)
  779. {
  780. TFrmCctvImg *pForm = (TFrmCctvImg *)pObj->FData1;
  781. pForm->SetFocus();
  782. pForm->LoadStopImage();
  783. }
  784. else
  785. {
  786. TFrmCctvImg *pForm = new TFrmCctvImg(ITS0000M);
  787. pForm->Parent = ITS0000M;
  788. if ((pt.x + pForm->Width + 5) > this->Width)
  789. {
  790. pt.x = this->Width - pForm->Width - 5;
  791. }
  792. if ((pt.y + pForm->Height + 5) > this->Height)
  793. {
  794. pt.y = this->Height - pForm->Height - 5;
  795. }
  796. pForm->Left = Left + pt.x;
  797. pForm->Top = Top + pt.y;
  798. pForm->FObj = pObj;
  799. pObj->FData2 = (void*)pForm;
  800. pForm->Show();
  801. }
  802. } catch(...) {}
  803. }
  804. //---------------------------------------------------------------------------
  805. void __fastcall TITS0000M::mnuVmsMsgClick(TObject *Sender)
  806. {
  807. Application->ProcessMessages();
  808. TPoint pt;
  809. GetCursorPos(&pt);
  810. pt = ITS0000M->ScreenToClient(pt);
  811. ShowVmsMessage(FSelId, pt);
  812. }
  813. //---------------------------------------------------------------------------
  814. void __fastcall TITS0000M::UpdateVmsMsg(int AType)
  815. {
  816. try
  817. {
  818. FOR_STL(TVmsCtlr*, pObj, VmsCtlrManager->FLists)
  819. {
  820. if (pObj->DEL_YN == "Y") continue;
  821. if (pObj->FData2)
  822. {
  823. TFrmVmsMsg *pForm = (TFrmVmsMsg *)pObj->FData2;
  824. if (AType == 1)
  825. pForm->VmsFormReload();
  826. else
  827. pForm->VmsFormReload();
  828. }
  829. }
  830. }
  831. catch(Exception &e)
  832. {
  833. }
  834. }
  835. //---------------------------------------------------------------------------
  836. void __fastcall TITS0000M::ShowVmsMessage(String AId, TPoint pt)
  837. {
  838. TItsFacility *pFacility = ItsFacilityManager->FLists.Find(AId);
  839. if (!pFacility) return;
  840. TVmsCtlr *pObj = (TVmsCtlr*)pFacility->Object;
  841. if (!pObj) return;
  842. try {
  843. if (pObj->FData2)
  844. {
  845. TFrmVmsMsg *pForm = (TFrmVmsMsg *)pObj->FData2;
  846. pForm->SetFocus();
  847. }
  848. else
  849. {
  850. TFrmVmsMsg *pForm = new TFrmVmsMsg(ITS0000M, pObj);
  851. pForm->Parent = ITS0000M;
  852. int nHG = pForm->ClientHeight - pForm->PnlVmsMsgDisp->Height;
  853. int nWG = pForm->ClientWidth - pForm->PnlVmsMsgDisp->Width;
  854. #if 0
  855. pForm->ClientHeight = nHG + pObj->Height;
  856. pForm->ClientWidth = nWG + pObj->Width;
  857. #endif
  858. if ((pt.x + pForm->Width + 5) > this->Width)
  859. {
  860. pt.x = this->Width - pForm->Width - 5;
  861. }
  862. if ((pt.y + pForm->Height + 5) > this->Height)
  863. {
  864. pt.y = this->Height - pForm->Height - 5;
  865. }
  866. pForm->Left = Left + pt.x;
  867. pForm->Top = Top + pt.y;
  868. pObj->FData2 = (void*)pForm;
  869. pForm->Show();
  870. }
  871. } catch(...) {}
  872. }
  873. //---------------------------------------------------------------------------
  874. void __fastcall TITS0000M::mnuStrmCamClick(TObject *Sender)
  875. {
  876. Application->ProcessMessages();
  877. TPoint pt;
  878. GetCursorPos(&pt);
  879. pt = ITS0000M->ScreenToClient(pt);
  880. ShowStrmCamera(FSelId, pt);
  881. }
  882. //---------------------------------------------------------------------------
  883. void __fastcall TITS0000M::ShowStrmCamera(String AId, TPoint pt)
  884. {
  885. TItsFacility *pFacility = ItsFacilityManager->FLists.Find(AId);
  886. if (!pFacility) return;
  887. TCDSObject *pObj = (TCDSObject*)pFacility->Object;
  888. if (!pObj) return;
  889. try {
  890. if (pObj->FData1)
  891. {
  892. TFrmStreamPlayer *pForm = (TFrmStreamPlayer *)pObj->FData1;
  893. pForm->SetFocus();
  894. }
  895. else
  896. {
  897. TFrmStreamPlayer *pForm = new TFrmStreamPlayer(ITS0000M);
  898. pForm->FObj.ID = pObj->CTLR_ID;
  899. pForm->FObj.NAME = pObj->NAME;
  900. pForm->FObj.STRM_ADDR = pObj->STRM_ADDR;
  901. pForm->FObj.FULL_STRM_ADDR = pObj->FULL_STRM_ADDR;
  902. pForm->FObj.Data = (TCDSObject*)pObj;
  903. pForm->FObj.FCLT_TYPE = pObj->TYPE_CD;
  904. pForm->FObj.Installed = true;
  905. pForm->Parent = ITS0000M;
  906. if ((pt.x + pForm->Width + 5) > this->Width)
  907. {
  908. pt.x = this->Width - pForm->Width - 5;
  909. }
  910. if ((pt.y + pForm->Height + 5) > this->Height)
  911. {
  912. pt.y = this->Height - pForm->Height - 5;
  913. }
  914. pForm->Left = Left + pt.x;
  915. pForm->Top = Top + pt.y;
  916. pObj->FData1 = (void*)pForm;
  917. pForm->Show();
  918. }
  919. } catch(...) {}
  920. }
  921. //---------------------------------------------------------------------------
  922. void __fastcall TITS0000M::FRAMEIncidentAutoList1TvList2CellDblClick(TcxCustomGridTableView *Sender, TcxGridTableDataCellViewInfo *ACellViewInfo,
  923. TMouseButton AButton, TShiftState AShift, bool &AHandled)
  924. {
  925. //소통정보 결측구간 클릭
  926. if (!ACellViewInfo) return;
  927. try {
  928. TcxDataController *pGDC = FRAMEIncidentAutoList1->TvList2->DataController;
  929. int nRow = pGDC->FocusedRecordIndex;
  930. if (nRow < 0) return;
  931. String sLinkId = VarToStr(pGDC->Values[nRow][FRAMEIncidentAutoList1->ColumnA01->Index]);
  932. SelectLinkById(1, sLinkId, true);
  933. } catch(...) {}
  934. }
  935. //---------------------------------------------------------------------------
  936. void __fastcall TITS0000M::UpdateFacilityStatusTotal()
  937. {
  938. TItsLayer *pLayer;
  939. int nRow = 0;
  940. try
  941. {
  942. CMM_ClearGridTableView(TvStatus);
  943. TcxDataController *pGDC = TvStatus->DataController;
  944. TvStatus->BeginUpdate();
  945. ItsFacilityManager->FListStatus.Lock();
  946. try
  947. {
  948. FOR_STL(TFacilityStatus*, pStatus, ItsFacilityManager->FListStatus)
  949. {
  950. #if 0
  951. if (pStatus->Type == "CRS") {
  952. // 교차로교통량
  953. continue;
  954. }
  955. #endif
  956. nRow = pGDC->AppendRecord();
  957. pLayer = ItsLayerManager->FLists.Find(pStatus->Type);
  958. if (pLayer)
  959. {
  960. pGDC->Values[nRow][ColName->Index] = pLayer->Name;
  961. }
  962. else
  963. {
  964. pGDC->Values[nRow][ColName->Index] = pStatus->Type;
  965. }
  966. #if 0
  967. if (pStatus->Type == "CCAM")
  968. pGDC->Values[nRow][ColName->Index] = "교차로감시";
  969. else
  970. if (pStatus->Type == "ICAM")
  971. pGDC->Values[nRow][ColName->Index] = "돌발상황감시";
  972. else
  973. if (pStatus->Type == "WCAM")
  974. pGDC->Values[nRow][ColName->Index] = "CCTV(웹카메라)";
  975. else
  976. if (pStatus->Type == "CRSSVR")
  977. {
  978. pGDC->Values[nRow][ColName->Index] = "교차로분석서버";
  979. }
  980. else
  981. if (pStatus->Type == "PARK")
  982. {
  983. pGDC->Values[nRow][ColName->Index] = "주차장";
  984. }
  985. else
  986. pGDC->Values[nRow][ColName->Index] = pStatus->Type;
  987. #endif
  988. pGDC->Values[nRow][ColTotal->Index] = pStatus->Total;
  989. pGDC->Values[nRow][ColNormal->Index] = pStatus->Total - pStatus->Error;
  990. pGDC->Values[nRow][ColFail->Index] = pStatus->Error;
  991. if (pStatus->Type == "VDS" || pStatus->Type == "AVI" || pStatus->Type == "DSRC")
  992. pGDC->Values[nRow][ColModule->Index] = pStatus->Collect;//Module;
  993. else
  994. pGDC->Values[nRow][ColModule->Index] = "-";
  995. }
  996. }
  997. catch(Exception &exception)
  998. {
  999. }
  1000. }
  1001. __finally
  1002. {
  1003. ItsFacilityManager->FListStatus.UnLock();
  1004. TvStatus->EndUpdate();
  1005. }
  1006. }
  1007. //---------------------------------------------------------------------------
  1008. void __fastcall TITS0000M::UpdateClctSystStts()
  1009. {
  1010. int nRow = 0;
  1011. CMM_ClearGridTableView(TvClctStts);
  1012. TcxDataController *pGDC = TvClctStts->DataController;
  1013. TvClctStts->BeginUpdate();
  1014. ItsLinkManager->FClctSystStts.Lock();
  1015. try
  1016. {
  1017. try
  1018. {
  1019. FOR_STL(TClctSystStts*, pObj, ItsLinkManager->FClctSystStts)
  1020. {
  1021. nRow = pGDC->AppendRecord();
  1022. pGDC->Values[nRow][Column1->Index] = pObj->CLCT_SYST_NM;
  1023. pGDC->Values[nRow][Column2->Index] = APP_FormatStr(pObj->PRCN_DT, STR_DATETIME);
  1024. if (pObj->IsCollected)
  1025. {
  1026. pGDC->Values[nRow][Column3->Index] = FormatFloat("##,##0", pObj->CLCT_NUM);
  1027. pGDC->Values[nRow][Column4->Index] = FormatFloat("##,##0", pObj->FLTR_NUM);
  1028. pGDC->Values[nRow][Column5->Index] = FormatFloat("##,##0", pObj->FUSN_NUM);
  1029. }
  1030. else
  1031. {
  1032. pGDC->Values[nRow][Column3->Index] = "-";
  1033. pGDC->Values[nRow][Column4->Index] = "-";
  1034. pGDC->Values[nRow][Column5->Index] = "-";
  1035. }
  1036. }
  1037. }
  1038. catch(Exception &exception)
  1039. {
  1040. }
  1041. }
  1042. __finally
  1043. {
  1044. ItsLinkManager->FClctSystStts.UnLock();
  1045. TvClctStts->EndUpdate();
  1046. }
  1047. }
  1048. //---------------------------------------------------------------------------
  1049. void __fastcall TITS0000M::ColNameCustomDrawCell(TcxCustomGridTableView *Sender, TcxCanvas *ACanvas,
  1050. TcxGridTableDataCellViewInfo *AViewInfo, bool &ADone)
  1051. {
  1052. // 장비명
  1053. if (AViewInfo->GridRecord->RecordIndex < 0) return;
  1054. ACanvas->Font->Style = TFontStyles() << fsBold;
  1055. ACanvas->Font->Color = Sender->LookAndFeelPainter->DefaultContentTextColor();
  1056. }
  1057. //---------------------------------------------------------------------------
  1058. void __fastcall TITS0000M::ColTotalCustomDrawCell(TcxCustomGridTableView *Sender,
  1059. TcxCanvas *ACanvas, TcxGridTableDataCellViewInfo *AViewInfo,
  1060. bool &ADone)
  1061. {
  1062. // 전체
  1063. if (AViewInfo->GridRecord->RecordIndex < 0) return;
  1064. ACanvas->Font->Style = TFontStyles() << fsBold;
  1065. ACanvas->Font->Color = Sender->LookAndFeelPainter->DefaultContentTextColor();
  1066. }
  1067. //---------------------------------------------------------------------------
  1068. void __fastcall TITS0000M::ColNormalCustomDrawCell(TcxCustomGridTableView *Sender,
  1069. TcxCanvas *ACanvas, TcxGridTableDataCellViewInfo *AViewInfo,
  1070. bool &ADone)
  1071. {
  1072. // 정상
  1073. if (AViewInfo->GridRecord->RecordIndex < 0) return;
  1074. ACanvas->Font->Style = TFontStyles() << fsBold;
  1075. ACanvas->Font->Color = Sender->LookAndFeelPainter->DefaultContentTextColor();
  1076. }
  1077. //---------------------------------------------------------------------------
  1078. void __fastcall TITS0000M::ColFailCustomDrawCell(TcxCustomGridTableView *Sender, TcxCanvas *ACanvas,
  1079. TcxGridTableDataCellViewInfo *AViewInfo, bool &ADone)
  1080. {
  1081. // 이상
  1082. if (AViewInfo->GridRecord->RecordIndex < 0) return;
  1083. ACanvas->Font->Style = TFontStyles() << fsBold;
  1084. if (!VarIsNull(AViewInfo->GridRecord->DisplayTexts[ColFail->Index]))
  1085. {
  1086. String sErr = AViewInfo->GridRecord->DisplayTexts[ColFail->Index];
  1087. if (sErr != "0" || AViewInfo->GridRecord->Selected)
  1088. {
  1089. ACanvas->Font->Color = clRed;
  1090. }
  1091. }
  1092. }
  1093. //---------------------------------------------------------------------------
  1094. void __fastcall TITS0000M::ColModuleCustomDrawCell(TcxCustomGridTableView *Sender,
  1095. TcxCanvas *ACanvas, TcxGridTableDataCellViewInfo *AViewInfo,
  1096. bool &ADone)
  1097. {
  1098. // 이상
  1099. if (AViewInfo->GridRecord->RecordIndex < 0) return;
  1100. ACanvas->Font->Style = TFontStyles() << fsBold;
  1101. if (!VarIsNull(AViewInfo->GridRecord->DisplayTexts[ColModule->Index]))
  1102. {
  1103. String sErr = AViewInfo->GridRecord->DisplayTexts[ColModule->Index];
  1104. if (sErr.Trim() == "-")
  1105. return;
  1106. if (sErr != "0")
  1107. {
  1108. ACanvas->Font->Color = clRed;
  1109. }
  1110. }
  1111. }
  1112. //---------------------------------------------------------------------------
  1113. void __fastcall TITS0000M::TvStatusCustomDrawCell(TcxCustomGridTableView *Sender,
  1114. TcxCanvas *ACanvas, TcxGridTableDataCellViewInfo *AViewInfo,
  1115. bool &ADone)
  1116. {
  1117. if (AViewInfo->GridRecord->Selected)
  1118. {
  1119. //ACanvas->Brush->Color = Sender->LookAndFeelPainter->DefaultContentColor();
  1120. //ACanvas->Font->Color = Sender->LookAndFeelPainter->DefaultContentTextColor();
  1121. if (AViewInfo->GridRecord->Index % 2 == 0)
  1122. {
  1123. ACanvas->Brush->Color = Sender->LookAndFeelPainter->DefaultContentEvenColor();
  1124. //ACanvas->Font->Color = Sender->LookAndFeelPainter->DefaultContentTextColor();
  1125. }
  1126. else
  1127. {
  1128. ACanvas->Brush->Color = Sender->LookAndFeelPainter->DefaultContentOddColor();
  1129. //ACanvas->Font->Color = Sender->LookAndFeelPainter->DefaultContentTextColor();
  1130. }
  1131. }
  1132. }
  1133. //---------------------------------------------------------------------------
  1134. void __fastcall TITS0000M::BtnMapToJpgClick(TObject *Sender)
  1135. {
  1136. FRAMEOpenMap1->BtnMapToJpgClick(Sender);
  1137. }
  1138. //---------------------------------------------------------------------------
  1139. void __fastcall TITS0000M::BtnMoveDefBoundsClick(TObject *Sender)
  1140. {
  1141. FRAMEOpenMap1->BtnMoveDefBoundsClick(Sender);
  1142. }
  1143. //---------------------------------------------------------------------------
  1144. void __fastcall TITS0000M::BtnZoomInClick(TObject *Sender)
  1145. {
  1146. FRAMEOpenMap1->BtnZoomInClick(Sender);
  1147. }
  1148. //---------------------------------------------------------------------------
  1149. void __fastcall TITS0000M::BtnZoomOutClick(TObject *Sender)
  1150. {
  1151. FRAMEOpenMap1->BtnZoomOutClick(Sender);
  1152. }
  1153. //---------------------------------------------------------------------------
  1154. void __fastcall TITS0000M::BtnMapSelectClick(TObject *Sender)
  1155. {
  1156. if (FRAMEOpenMap1->MapStart)
  1157. {
  1158. sJs.printf(L"selectMode(%d)", BtnMapSelect->Down ? 1 : 0);
  1159. FRAMEOpenMap1->ExecScript(sJs);
  1160. sJs.printf(L"setMouseClick(%d)", (BtnMapSelect->Down) ? 1: 0);
  1161. FRAMEOpenMap1->ExecScript(sJs);
  1162. }
  1163. }
  1164. //---------------------------------------------------------------------------
  1165. void __fastcall TITS0000M::BtnRefreshClick(TObject *Sender)
  1166. {
  1167. if (FRAMEOpenMap1->MapStart)
  1168. {
  1169. FrmMain->FPollStatus01.Reset(); // 시설물상태정보
  1170. FrmMain->FPollStatus02.Reset(); // 프로세스상태정보
  1171. FrmMain->FPollStatus03.Reset(); // 돌발정보
  1172. FrmMain->FPollTraffic00.Reset(); // 링크소통정보(전체)
  1173. FrmMain->FPollTraffic05.Reset(); // UTIS운영정보
  1174. FrmMain->FPollDatabase.Reset(); // 데이터베이스 상태
  1175. FrmMain->FPollEvent01.Reset(); // 블랙박스이벤트
  1176. FrmMain->FPollVilgFrcs.Reset(); // 기상정보
  1177. BtnRefresh->Enabled = false;
  1178. //TmrRefresh->Enabled = true;
  1179. }
  1180. }
  1181. //---------------------------------------------------------------------------
  1182. void __fastcall TITS0000M::TmrRefreshTimer(TObject *Sender)
  1183. {
  1184. TmrRefresh->Enabled = false;
  1185. BtnRefresh->Enabled = true;
  1186. }
  1187. //---------------------------------------------------------------------------
  1188. void __fastcall TITS0000M::UpdateGisIncident()
  1189. {
  1190. if (!FRAMEOpenMap1->MapStart) return;
  1191. sJs.printf(L"removeLayerObject(%d)", LyrTp_Incd);
  1192. FRAMEOpenMap1->ExecScript(sJs);
  1193. int nStatus;
  1194. String ROAD_NAME = " ";
  1195. String arrObj = "";
  1196. String sTemp;
  1197. try
  1198. {
  1199. ItsIncidentManager->FLists.Lock();
  1200. FOR_STL(TItsIncident *, pObj, ItsIncidentManager->FLists)
  1201. {
  1202. if (pObj->DISP_INCD == "N") continue;
  1203. if (pObj->INCD_PRGR_STEP_CD == "ISS2")
  1204. {
  1205. ROAD_NAME = "";
  1206. TItsLink *pLink = ItsLinkManager->FLists.Find(pObj->LINK_ID);
  1207. if (pLink)
  1208. {
  1209. ROAD_NAME = pLink->ROAD_NAME;
  1210. }
  1211. nStatus = pObj->INCD_TYPE_CLSF_CD.ToIntDef(1);
  1212. if (nStatus > 6 || nStatus < 1) nStatus = 1;
  1213. String INCD_TITL = StringReplace(pObj->INCD_TITL, "\n", " ", TReplaceFlags() << rfReplaceAll);
  1214. String OCRR_LCTN_NM = StringReplace(pObj->OCRR_LCTN_NM, "\n", " ", TReplaceFlags() << rfReplaceAll);
  1215. String INCD_EXPL = StringReplace(pObj->INCD_EXPL, "\n", " ", TReplaceFlags() << rfReplaceAll);
  1216. INCD_TITL = StringReplace(INCD_TITL, ",", ".", TReplaceFlags() << rfReplaceAll);
  1217. OCRR_LCTN_NM = StringReplace(OCRR_LCTN_NM, ",", ".", TReplaceFlags() << rfReplaceAll);
  1218. INCD_EXPL = StringReplace(INCD_EXPL, ",", ".", TReplaceFlags() << rfReplaceAll);
  1219. if (arrObj != "") arrObj += "|";
  1220. sTemp.printf(L"%s,%s,%s,%s,%s,%s,%s,%s,%d,%s,%s,%s,%s",
  1221. pObj->INCD_OCRR_ID.c_str(),
  1222. pObj->X_CRDN.c_str(),
  1223. pObj->Y_CRDN.c_str(),
  1224. ITSUtil_StrToTime(pObj->RGST_DT).c_str(),
  1225. ITSUtil_StrToTime(pObj->INCD_STRT_DT).c_str(),
  1226. ITSUtil_StrToTime(pObj->INCD_END_PRAR_DT).c_str(),
  1227. ROAD_NAME.c_str(),
  1228. INCD_TITL.c_str(),
  1229. nStatus,
  1230. g_strIncident[nStatus].c_str(),
  1231. OCRR_LCTN_NM.c_str(),
  1232. INCD_EXPL.c_str(),
  1233. pObj->LINK_ID.c_str());
  1234. arrObj += sTemp;
  1235. }
  1236. }
  1237. }
  1238. __finally
  1239. {
  1240. ItsIncidentManager->FLists.UnLock();
  1241. }
  1242. if (arrObj != "")
  1243. {
  1244. sJs.printf(L"addIncident('%s')", arrObj.c_str());
  1245. FRAMEOpenMap1->ExecScript(sJs);
  1246. }
  1247. }
  1248. //---------------------------------------------------------------------------
  1249. void __fastcall TITS0000M::UpdateGisFacility()
  1250. {
  1251. if (!FRAMEOpenMap1->MapStart) return;
  1252. FOR_STL(TItsLayer*, pLayer, ItsLayerManager->FLists) {
  1253. pLayer->arrObj = "";
  1254. }
  1255. String sTemp;
  1256. TCDSObject *pObj;
  1257. TItsLayer *pLayer;
  1258. ItsFacilityManager->FLists.Lock();
  1259. try {
  1260. FOR_STL(TItsFacility*, pFacility, ItsFacilityManager->FLists)
  1261. {
  1262. if (pFacility->FOldComm == pFacility->FComm)
  1263. continue;
  1264. pObj = pFacility->Object;
  1265. if (pObj == NULL) {
  1266. continue;
  1267. }
  1268. if (pFacility->FCLT_TYPE == "VDS" && pFacility->FCLT_KIND == "C") {
  1269. continue;
  1270. }
  1271. pLayer = ItsLayerManager->FLists.Find(pFacility->FCLT_TYPE);
  1272. if (pLayer) {
  1273. if (pLayer->arrObj != "") pLayer->arrObj += "|";
  1274. sTemp.printf(L"%s,%d", pObj->CTLR_NMBR.c_str(), pFacility->FComm.ToIntDef(2));
  1275. pLayer->arrObj += sTemp;
  1276. }
  1277. pFacility->FOldComm = pFacility->FComm;
  1278. }
  1279. }
  1280. __finally
  1281. {
  1282. ItsFacilityManager->FLists.UnLock();
  1283. }
  1284. FOR_STL(TItsLayer*, pLayer, ItsLayerManager->FLists) {
  1285. if (pLayer->arrObj != "") {
  1286. sJs.printf(L"updateFacility(%d, '%s')", pLayer->Index, pLayer->arrObj.c_str());
  1287. FRAMEOpenMap1->ExecScript(sJs);
  1288. pLayer->arrObj = "";
  1289. }
  1290. }
  1291. }
  1292. //---------------------------------------------------------------------------
  1293. void __fastcall TITS0000M::InitGisFacility()
  1294. {
  1295. TNotifyEvent evt = CbLayerVisible->Properties->OnChange;
  1296. CbLayerVisible->Properties->OnChange = NULL;
  1297. CbLayerVisible->Properties->Items->Clear();
  1298. CbLayerVisible->Clear();
  1299. if (!FRAMEOpenMap1->MapStart) return;
  1300. FOR_STL(TItsLayer*, pLayer, ItsLayerManager->FLists)
  1301. {
  1302. pLayer->arrObj = "";
  1303. sJs.printf(L"removeLayerObject(%d)", pLayer->Index);
  1304. FRAMEOpenMap1->ExecScript(sJs);
  1305. }
  1306. String sTemp;
  1307. TCDSObject *pObj;
  1308. TItsLayer *pLayer;
  1309. ItsFacilityManager->FLists.Lock();
  1310. try
  1311. {
  1312. FOR_STL(TItsFacility*, pFacility, ItsFacilityManager->FLists)
  1313. {
  1314. pObj = pFacility->Object;
  1315. if (pObj == NULL)
  1316. {
  1317. continue;
  1318. }
  1319. if (pFacility->FCLT_TYPE == "VDS" && pFacility->FCLT_KIND == "C")
  1320. {
  1321. continue;
  1322. }
  1323. pLayer = ItsLayerManager->FLists.Find(pFacility->FCLT_TYPE);
  1324. if (pLayer)
  1325. {
  1326. if (pLayer->arrObj != "") pLayer->arrObj += "|";
  1327. sTemp.printf(L"%s,%s,%s,%.6f,%.6f,%d,0,0,0", pObj->CTLR_NMBR.c_str(), pObj->CTLR_ID.c_str(), pObj->NAME.c_str(), pObj->X_CRDN, pObj->Y_CRDN, pFacility->FComm.ToIntDef(2));
  1328. pLayer->arrObj += sTemp;
  1329. }
  1330. pFacility->FOldComm = pFacility->FComm;
  1331. }
  1332. }
  1333. __finally
  1334. {
  1335. ItsFacilityManager->FLists.UnLock();
  1336. }
  1337. FLayerVisible = "";
  1338. CbLayerVisible->Properties->Items->BeginUpdate();
  1339. FOR_STL(TItsLayer*, pLayer, ItsLayerManager->FLists)
  1340. {
  1341. pLayer->Visible = false;
  1342. if (pLayer->arrObj != "")
  1343. {
  1344. pLayer->Enabled = true;
  1345. sJs.printf(L"addFacility(%d, '%s')", pLayer->Index, pLayer->arrObj.c_str());
  1346. FRAMEOpenMap1->ExecScript(sJs);
  1347. pLayer->arrObj = "";
  1348. String sValue;
  1349. if (ReadConfigInfo(g_AppCfg.sConfigFile, "LAYER", pLayer->Name, sValue))
  1350. {
  1351. pLayer->Visible = (sValue == "1") ? true : false;
  1352. }
  1353. else
  1354. {
  1355. pLayer->Visible = true; //환경설정정보에 없으면 일단 표출해 주자
  1356. }
  1357. TcxCheckComboBoxItem *pItem = CbLayerVisible->Properties->Items->Add();
  1358. pItem->Description = pLayer->Name;
  1359. //pItem->ShortDescription = pLayer->Type;
  1360. pItem->DisplayName = pLayer->Type;
  1361. pItem->Enabled = true;
  1362. pItem->Tag = (int)pLayer;
  1363. FLayerVisible += (pLayer->Visible) ? "1" : "0";
  1364. }
  1365. sJs.printf(L"showLayer(%d, %d)", pLayer->Index, (pLayer->Visible) ? 1 : 0);
  1366. FRAMEOpenMap1->ExecScript(sJs);
  1367. }
  1368. CbLayerVisible->EditValue = FLayerVisible;
  1369. CbLayerVisible->Properties->Items->EndUpdate();
  1370. CbLayerVisible->Properties->OnChange = evt;
  1371. }
  1372. //---------------------------------------------------------------------------
  1373. void __fastcall TITS0000M::CbLayerVisiblePropertiesChange(TObject *Sender)
  1374. {
  1375. String sEditValue = CbLayerVisible->EditValue;
  1376. if (FLayerVisible != sEditValue)
  1377. {
  1378. for (int ii = 0; ii < CbLayerVisible->Properties->Items->Count; ii++)
  1379. {
  1380. if (FLayerVisible.SubString(ii+1, 1) != sEditValue.SubString(ii+1, 1))
  1381. {
  1382. TcxCheckComboBoxItem *pItem = CbLayerVisible->Properties->Items->operator [](ii);
  1383. TItsLayer *pLayer = (TItsLayer*)pItem->Tag;
  1384. pLayer->Visible = (sEditValue.SubString(ii+1, 1) == "1") ? true : false;
  1385. sJs.printf(L"showLayer(%d, %d)", pLayer->Index, (pLayer->Visible) ? 1 : 0);
  1386. FRAMEOpenMap1->ExecScript(sJs);
  1387. break;
  1388. }
  1389. }
  1390. }
  1391. FLayerVisible = sEditValue;
  1392. }
  1393. //---------------------------------------------------------------------------
  1394. void __fastcall TITS0000M::UpdateGisTraffic()
  1395. {
  1396. if (!FRAMEOpenMap1->MapStart) return;
  1397. TItsVrtx* pVrtx;
  1398. TItsNode* pNode;
  1399. String STRT_NM;
  1400. String END_NM;
  1401. int nLinks, nIfscs, nRoads;
  1402. nLinks = nIfscs = nRoads = 0;
  1403. ItsLinkManager->FLists.Lock();
  1404. try
  1405. {
  1406. FOR_STL(TItsLink*, pLink, ItsLinkManager->FLists)
  1407. {
  1408. if (pLink->DEL_YN == "Y") continue;
  1409. if (pLink->IsVertex && pLink->TRAF && (pLink->SPED != pLink->TRAF->SPED || pLink->TRAF_GRAD != pLink->TRAF->TRAF_GRAD))
  1410. {
  1411. sJs.printf(L"updateLink('%s', '%d', %d)",
  1412. pLink->LINK_ID.c_str(),
  1413. pLink->TRAF->SPED,
  1414. pLink->TRAF->TRAF_GRAD);
  1415. FRAMEOpenMap1->ExecScript(sJs);
  1416. pLink->SPED = pLink->TRAF->SPED;
  1417. pLink->TRAF_GRAD = pLink->TRAF->TRAF_GRAD;
  1418. nLinks++;
  1419. }
  1420. }
  1421. }
  1422. __finally
  1423. {
  1424. ItsLinkManager->FLists.UnLock();
  1425. }
  1426. ItsIfscManager->FLists.Lock();
  1427. try
  1428. {
  1429. FOR_STL(TItsIfsc*, pIfsc, ItsIfscManager->FLists)
  1430. {
  1431. if (pIfsc->DEL_YN == "Y") continue;
  1432. if (pIfsc->IsVertex && pIfsc->TRAF && (pIfsc->SPED != pIfsc->TRAF->SPED || pIfsc->TRAF_GRAD != pIfsc->TRAF->TRAF_GRAD))
  1433. {
  1434. sJs.printf(L"updateIfsc('%s', '%d', %d)",
  1435. pIfsc->IFSC_ID.c_str(),
  1436. pIfsc->TRAF->SPED,
  1437. pIfsc->TRAF->TRAF_GRAD);
  1438. FRAMEOpenMap1->ExecScript(sJs);
  1439. pIfsc->SPED = pIfsc->TRAF->SPED;
  1440. pIfsc->TRAF_GRAD = pIfsc->TRAF->TRAF_GRAD;
  1441. nIfscs++;
  1442. }
  1443. }
  1444. }
  1445. __finally
  1446. {
  1447. ItsIfscManager->FLists.UnLock();
  1448. }
  1449. ItsRoadManager->FLists.Lock();
  1450. try
  1451. {
  1452. FOR_STL(TItsRoad*, pRoad, ItsRoadManager->FLists)
  1453. {
  1454. if (pRoad->DEL_YN == "Y") continue;
  1455. if (pRoad->IsVertex && pRoad->TRAF && (pRoad->SPED != pRoad->TRAF->SPED || pRoad->TRAF_GRAD != pRoad->TRAF->TRAF_GRAD))
  1456. {
  1457. sJs.printf(L"updateRoad('%s', '%d', %d)",
  1458. pRoad->ROAD_ID.c_str(),
  1459. pRoad->TRAF->SPED,
  1460. pRoad->TRAF->TRAF_GRAD);
  1461. FRAMEOpenMap1->ExecScript(sJs);
  1462. pRoad->SPED = pRoad->TRAF->SPED;
  1463. pRoad->TRAF_GRAD = pRoad->TRAF->TRAF_GRAD;
  1464. nRoads++;
  1465. }
  1466. }
  1467. }
  1468. __finally
  1469. {
  1470. ItsRoadManager->FLists.UnLock();
  1471. }
  1472. try
  1473. {
  1474. if (FrmLinkInfo)
  1475. {
  1476. FrmLinkInfo->RefreshLinkInfo();
  1477. }
  1478. }
  1479. catch(...)
  1480. {
  1481. }
  1482. String sMsg;
  1483. sMsg.printf(L"GIS Traffic Update: %d, %d, %d", nLinks, nIfscs, nRoads);
  1484. DebugLog(sMsg);
  1485. }
  1486. //---------------------------------------------------------------------------
  1487. void __fastcall TITS0000M::InitGisTraffic_File()
  1488. {
  1489. if (!FRAMEOpenMap1->MapStart) return;
  1490. TItsVrtx* pVrtx;
  1491. TItsNode* pNode;
  1492. String STRT_NM;
  1493. String END_NM;
  1494. TStringList *sl = NULL;
  1495. FILE *fd = NULL;
  1496. char szBuff[8192];
  1497. AnsiString sFileName;
  1498. FRAMEOpenMap1->ExecScript("initTrafficLayer()");
  1499. PbLoadMap->Properties->Text = "링크정보 로딩 중...";
  1500. PbLoadMap->Position = 70;
  1501. Application->ProcessMessages();
  1502. sl = new TStringList;
  1503. if (sl == NULL)
  1504. {
  1505. return;
  1506. }
  1507. sl->Delimiter = ';';
  1508. sl->StrictDelimiter = true;
  1509. sFileName = g_sAppDir + "\\MAPDATA\\layers\\LINKx.dat";
  1510. if ((fd = fopen(sFileName.c_str(), "r")) != NULL)
  1511. {
  1512. ItsLinkManager->FLists.Lock();
  1513. try
  1514. {
  1515. while (1)
  1516. {
  1517. memset(szBuff, 0x00, sizeof(szBuff));
  1518. if (fgets(szBuff, sizeof(szBuff), fd) == NULL) break;
  1519. sl->DelimitedText = String(szBuff);
  1520. if (sl->Count != 3)
  1521. {
  1522. continue;
  1523. }
  1524. try {
  1525. String LINK_ID = sl->Strings[0];
  1526. TItsLink *pLink = ItsLinkManager->FLists.Find(LINK_ID);
  1527. if (pLink && pLink->TRAF)
  1528. {
  1529. if (pLink->DEL_YN == "Y") continue;
  1530. pNode = ItsNodeManager->FLists.Find(pLink->F_NODE_ID);
  1531. if (pNode) STRT_NM = pNode->NODE_NAME; else STRT_NM = " ";
  1532. pNode = ItsNodeManager->FLists.Find(pLink->T_NODE_ID);
  1533. if (pNode) END_NM = pNode->NODE_NAME; else END_NM = " ";
  1534. String X_CRDN_ARR = sl->Strings[1];
  1535. String Y_CRDN_ARR = StringReplace(sl->Strings[2], "\n", "", TReplaceFlags() << rfReplaceAll);
  1536. sJs.printf(L"addLink('%s', '%s', '%s', '%s', '%s', '%d', %d, '%s', '%s')",
  1537. pLink->LINK_ID.c_str(),
  1538. pLink->ROAD_NAME.c_str(),
  1539. STRT_NM.c_str(),
  1540. END_NM.c_str(),
  1541. pLink->LINK_LENG.c_str(),
  1542. pLink->TRAF->SPED,
  1543. pLink->TRAF->TRAF_GRAD,
  1544. X_CRDN_ARR.c_str(),
  1545. Y_CRDN_ARR.c_str());
  1546. FRAMEOpenMap1->ExecScript(sJs);
  1547. pLink->SPED = pLink->TRAF->SPED;
  1548. pLink->TRAF_GRAD = pLink->TRAF->TRAF_GRAD;
  1549. }
  1550. }
  1551. catch(Exception &e)
  1552. {
  1553. throw Exception(String(e.ClassName()) + e.Message);
  1554. }
  1555. }
  1556. }
  1557. __finally
  1558. {
  1559. if (fd) fclose(fd);
  1560. ItsLinkManager->FLists.UnLock();
  1561. }
  1562. }
  1563. PbLoadMap->Properties->Text = "서비스링크정보 로딩 중...";
  1564. PbLoadMap->Position = 80;
  1565. Application->ProcessMessages();
  1566. sFileName = g_sAppDir + "\\MAPDATA\\layers\\IFSC.dat";
  1567. if ((fd = fopen(sFileName.c_str(), "r")) != NULL)
  1568. {
  1569. ItsIfscManager->FLists.Lock();
  1570. try
  1571. {
  1572. while (1)
  1573. {
  1574. memset(szBuff, 0x00, sizeof(szBuff));
  1575. if (fgets(szBuff, sizeof(szBuff), fd) == NULL) break;
  1576. sl->DelimitedText = String(szBuff);
  1577. if (sl->Count != 3)
  1578. {
  1579. continue;
  1580. }
  1581. try {
  1582. String IFSC_ID = sl->Strings[0];
  1583. TItsIfsc *pIfsc = ItsIfscManager->FLists.Find(IFSC_ID);
  1584. if (pIfsc && pIfsc->TRAF)
  1585. {
  1586. if (pIfsc->DEL_YN == "Y") continue;
  1587. String X_CRDN_ARR = sl->Strings[1];
  1588. String Y_CRDN_ARR = StringReplace(sl->Strings[2], "\n", "", TReplaceFlags() << rfReplaceAll);
  1589. sJs.printf(L"addIfsc('%s', '%s', '%s', '%s', '%s', '%d', %d, '%s', '%s')",
  1590. pIfsc->IFSC_ID.c_str(),
  1591. pIfsc->IFSC_NM.c_str(),
  1592. pIfsc->STRT_NM.c_str(),
  1593. pIfsc->END_NM.c_str(),
  1594. pIfsc->SECT_LNGT.c_str(),
  1595. pIfsc->TRAF->SPED,
  1596. pIfsc->TRAF->TRAF_GRAD,
  1597. X_CRDN_ARR.c_str(),
  1598. Y_CRDN_ARR.c_str());
  1599. FRAMEOpenMap1->ExecScript(sJs);
  1600. pIfsc->SPED = pIfsc->TRAF->SPED;
  1601. pIfsc->TRAF_GRAD = pIfsc->TRAF->TRAF_GRAD;
  1602. }
  1603. }
  1604. catch(Exception &e)
  1605. {
  1606. throw Exception(String(e.ClassName()) + e.Message);
  1607. }
  1608. }
  1609. }
  1610. __finally
  1611. {
  1612. if (fd) fclose(fd);
  1613. ItsIfscManager->FLists.UnLock();
  1614. }
  1615. }
  1616. PbLoadMap->Properties->Text = "도로정보 로딩 중...";
  1617. PbLoadMap->Position = 90;
  1618. Application->ProcessMessages();
  1619. sFileName = g_sAppDir + "\\MAPDATA\\layers\\ROAD.dat";
  1620. if ((fd = fopen(sFileName.c_str(), "r")) != NULL)
  1621. {
  1622. ItsRoadManager->FLists.Lock();
  1623. try
  1624. {
  1625. while (1)
  1626. {
  1627. memset(szBuff, 0x00, sizeof(szBuff));
  1628. if (fgets(szBuff, sizeof(szBuff), fd) == NULL) break;
  1629. sl->DelimitedText = String(szBuff);
  1630. if (sl->Count != 3)
  1631. {
  1632. continue;
  1633. }
  1634. try {
  1635. String ROAD_ID = sl->Strings[0];
  1636. TItsRoad *pRoad = ItsRoadManager->FLists.Find(ROAD_ID);
  1637. if (pRoad && pRoad->TRAF)
  1638. {
  1639. if (pRoad->DEL_YN == "Y") continue;
  1640. String X_CRDN_ARR = sl->Strings[1];
  1641. String Y_CRDN_ARR = StringReplace(sl->Strings[2], "\n", "", TReplaceFlags() << rfReplaceAll);
  1642. sJs.printf(L"addRoad('%s', '%s', '%s', '%s', '%s', '%d', %d, '%s', '%s')",
  1643. pRoad->ROAD_ID.c_str(),
  1644. pRoad->ROAD_NM.c_str(),
  1645. pRoad->STRT_NM.c_str(),
  1646. pRoad->END_NM.c_str(),
  1647. pRoad->SECT_LNGT.c_str(),
  1648. pRoad->TRAF->SPED,
  1649. pRoad->TRAF->TRAF_GRAD,
  1650. X_CRDN_ARR.c_str(),
  1651. Y_CRDN_ARR.c_str());
  1652. FRAMEOpenMap1->ExecScript(sJs);
  1653. pRoad->SPED = pRoad->TRAF->SPED;
  1654. pRoad->TRAF_GRAD = pRoad->TRAF->TRAF_GRAD;
  1655. }
  1656. }
  1657. catch(Exception &e)
  1658. {
  1659. throw Exception(String(e.ClassName()) + e.Message);
  1660. }
  1661. }
  1662. }
  1663. __finally
  1664. {
  1665. if (fd) fclose(fd);
  1666. ItsRoadManager->FLists.UnLock();
  1667. }
  1668. }
  1669. if (sl) delete sl;
  1670. FRAMEOpenMap1->ExecScript("makeTrafficLayer()");
  1671. }
  1672. //---------------------------------------------------------------------------
  1673. void __fastcall TITS0000M::InitGisTraffic()
  1674. {
  1675. if (!FRAMEOpenMap1->MapStart) return;
  1676. TItsVrtx* pVrtx;
  1677. TItsNode* pNode;
  1678. String STRT_NM;
  1679. String END_NM;
  1680. #if 0
  1681. PbLoadMap->Properties->Text = "노드정보 로딩 중...";
  1682. PbLoadMap->Position = 50;
  1683. Application->ProcessMessages();
  1684. FLayerIdx = LyrTp_Node;
  1685. sJs.printf(L"removeLayerObject(%d)", FLayerIdx);
  1686. FRAMEOpenMap1->ExecScript(sJs);
  1687. String arrObj = "";
  1688. String sTemp;
  1689. int cnt = 0;
  1690. ItsNodeManager->FLists.Lock();
  1691. try
  1692. {
  1693. FOR_STL(TItsNode*, pObj, ItsNodeManager->FLists)
  1694. {
  1695. #if 0
  1696. //if (arrObj != "") arrObj += "|";
  1697. if (cnt == 0)
  1698. {
  1699. sTemp.printf(L"%s,%s,%s,%.6f,%.6f,0,0,0,0", pObj->NODE_ID.c_str(), pObj->NODE_ID.c_str(), pObj->NODE_NAME.c_str(), pObj->X_CRDN, pObj->Y_CRDN);
  1700. arrObj += sTemp;
  1701. sJs.printf(L"addFacility(%d, '%s')", FLayerIdx, arrObj.c_str());
  1702. FRAMEOpenMap1->ExecScript(sJs);
  1703. }
  1704. else
  1705. {
  1706. sTemp.printf(L"%s,%s,%s,%.6f,%.6f,0,0,0,0", pObj->NODE_ID.c_str(), pObj->NODE_ID.c_str(), pObj->NODE_NAME.c_str(), pObj->X_CRDN, pObj->Y_CRDN);
  1707. sJs.printf(L"addFacilityObject(%d, '%s')", FLayerIdx, sTemp.c_str());
  1708. FRAMEOpenMap1->ExecScript(sJs);
  1709. }
  1710. cnt++;
  1711. #else
  1712. if (arrObj != "") arrObj += "|";
  1713. sTemp.printf(L"%s,%s,%s,%.6f,%.6f,0,0,0,0", pObj->NODE_ID.c_str(), pObj->NODE_ID.c_str(), pObj->NODE_NAME.c_str(), pObj->X_CRDN, pObj->Y_CRDN);
  1714. arrObj += sTemp;
  1715. if (cnt++ > 50)
  1716. {
  1717. sJs.printf(L"addFacility(%d, '%s')", FLayerIdx, arrObj.c_str());
  1718. FRAMEOpenMap1->ExecScript(sJs);
  1719. cnt = 0;
  1720. arrObj = "";
  1721. }
  1722. #endif
  1723. }
  1724. #if 1
  1725. if (cnt > 0)
  1726. {
  1727. sJs.printf(L"addFacility(%d, '%s')", FLayerIdx, arrObj.c_str());
  1728. FRAMEOpenMap1->ExecScript(sJs);
  1729. cnt = 0;
  1730. arrObj = "";
  1731. }
  1732. #endif
  1733. }
  1734. __finally
  1735. {
  1736. ItsNodeManager->FLists.UnLock();
  1737. sJs.printf(L"showLayer(%d, 0)", FLayerIdx);
  1738. FRAMEOpenMap1->ExecScript(sJs);
  1739. }
  1740. #endif
  1741. FRAMEOpenMap1->ExecScript("initTrafficLayer()");
  1742. PbLoadMap->Properties->Text = "링크정보 로딩 중...";
  1743. PbLoadMap->Position = 70;
  1744. Application->ProcessMessages();
  1745. ItsLinkManager->FLists.Lock();
  1746. try
  1747. {
  1748. FOR_STL(TItsLink*, pLink, ItsLinkManager->FLists)
  1749. {
  1750. if (pLink->DEL_YN == "Y") continue;
  1751. if (pLink->IsVertex && pLink->TRAF)
  1752. {
  1753. pNode = ItsNodeManager->FLists.Find(pLink->F_NODE_ID);
  1754. if (pNode) STRT_NM = pNode->NODE_NAME; else STRT_NM = " ";
  1755. pNode = ItsNodeManager->FLists.Find(pLink->T_NODE_ID);
  1756. if (pNode) END_NM = pNode->NODE_NAME; else END_NM = " ";
  1757. sJs.printf(L"addLink('%s', '%s', '%s', '%s', '%s', '%d', %d, '%s', '%s')",
  1758. pLink->LINK_ID.c_str(),
  1759. pLink->ROAD_NAME.c_str(),
  1760. STRT_NM.c_str(),
  1761. END_NM.c_str(),
  1762. pLink->LINK_LENG.c_str(),
  1763. pLink->TRAF->SPED,
  1764. pLink->TRAF->TRAF_GRAD,
  1765. pLink->X_CRDN_ARR.c_str(),
  1766. pLink->Y_CRDN_ARR.c_str());
  1767. FRAMEOpenMap1->ExecScript(sJs);
  1768. pLink->SPED = pLink->TRAF->SPED;
  1769. pLink->TRAF_GRAD = pLink->TRAF->TRAF_GRAD;
  1770. }
  1771. }
  1772. }
  1773. __finally
  1774. {
  1775. ItsLinkManager->FLists.UnLock();
  1776. }
  1777. PbLoadMap->Properties->Text = "서비스링크정보 로딩 중...";
  1778. PbLoadMap->Position = 80;
  1779. Application->ProcessMessages();
  1780. ItsIfscManager->FLists.Lock();
  1781. try
  1782. {
  1783. FOR_STL(TItsIfsc*, pIfsc, ItsIfscManager->FLists)
  1784. {
  1785. if (pIfsc->DEL_YN == "Y") continue;
  1786. if (pIfsc->IsVertex && pIfsc->TRAF)
  1787. {
  1788. sJs.printf(L"addIfsc('%s', '%s', '%s', '%s', '%s', '%d', %d, '%s', '%s')",
  1789. pIfsc->IFSC_ID.c_str(),
  1790. pIfsc->IFSC_NM.c_str(),
  1791. pIfsc->STRT_NM.c_str(),
  1792. pIfsc->END_NM.c_str(),
  1793. pIfsc->SECT_LNGT.c_str(),
  1794. pIfsc->TRAF->SPED,
  1795. pIfsc->TRAF->TRAF_GRAD,
  1796. pIfsc->X_CRDN_ARR.c_str(),
  1797. pIfsc->Y_CRDN_ARR.c_str());
  1798. FRAMEOpenMap1->ExecScript(sJs);
  1799. pIfsc->SPED = pIfsc->TRAF->SPED;
  1800. pIfsc->TRAF_GRAD = pIfsc->TRAF->TRAF_GRAD;
  1801. }
  1802. }
  1803. }
  1804. __finally
  1805. {
  1806. ItsIfscManager->FLists.UnLock();
  1807. }
  1808. PbLoadMap->Properties->Text = "도로정보 로딩 중...";
  1809. PbLoadMap->Position = 90;
  1810. Application->ProcessMessages();
  1811. ItsRoadManager->FLists.Lock();
  1812. try
  1813. {
  1814. FOR_STL(TItsRoad*, pRoad, ItsRoadManager->FLists)
  1815. {
  1816. if (pRoad->DEL_YN == "Y") continue;
  1817. if (pRoad->IsVertex && pRoad->TRAF)
  1818. {
  1819. sJs.printf(L"addRoad('%s', '%s', '%s', '%s', '%s', '%d', %d, '%s', '%s')",
  1820. pRoad->ROAD_ID.c_str(),
  1821. pRoad->ROAD_NM.c_str(),
  1822. pRoad->STRT_NM.c_str(),
  1823. pRoad->END_NM.c_str(),
  1824. pRoad->SECT_LNGT.c_str(),
  1825. pRoad->TRAF->SPED,
  1826. pRoad->TRAF->TRAF_GRAD,
  1827. pRoad->X_CRDN_ARR.c_str(),
  1828. pRoad->Y_CRDN_ARR.c_str());
  1829. FRAMEOpenMap1->ExecScript(sJs);
  1830. pRoad->SPED = pRoad->TRAF->SPED;
  1831. pRoad->TRAF_GRAD = pRoad->TRAF->TRAF_GRAD;
  1832. }
  1833. }
  1834. }
  1835. __finally
  1836. {
  1837. ItsRoadManager->FLists.UnLock();
  1838. }
  1839. FRAMEOpenMap1->ExecScript("makeTrafficLayer()");
  1840. }
  1841. //---------------------------------------------------------------------------
  1842. void __fastcall TITS0000M::OnMapPopupMenu(int ALayerType, String AFID, bool AOnList)
  1843. {
  1844. FSelId = AFID;
  1845. #if 0
  1846. TItsFacility *pFacility = ItsFacilityManager->FLists.Find(FSelId);
  1847. if (!pFacility) return;
  1848. TCDSObject *pObj = pFacility->Object;
  1849. if (!pObj) return;
  1850. #endif
  1851. POINT p;
  1852. GetCursorPos(&p);
  1853. switch(ALayerType)
  1854. {
  1855. case LyrTp_Cctv:
  1856. N1->Visible = AOnList;
  1857. mnuMoveCctv->Visible = AOnList;
  1858. pmuCctv->Popup(p.x, p.y);
  1859. break;
  1860. #if 0
  1861. case LyrTp_Event: //교차로감시카메라(구미)
  1862. N231->Visible = AOnList;
  1863. mnuMoveIncCctv->Visible = AOnList;
  1864. pmuIncCctv->Popup(p.x, p.y);
  1865. break;
  1866. #endif
  1867. case LyrTp_Vms:
  1868. N2->Visible = AOnList;
  1869. mnuMoveVms->Visible = AOnList;
  1870. pmuVms->Popup(p.x, p.y);
  1871. break;
  1872. case LyrTp_Vds:
  1873. MenuItem6->Visible = AOnList;
  1874. MenuItem7->Visible = AOnList;
  1875. pmuVds->Popup(p.x, p.y);
  1876. break;
  1877. case LyrTp_VdsDet:
  1878. case LyrTp_VdsR:
  1879. case LyrTp_VdsRDet:
  1880. case LyrTp_VdsC:
  1881. case LyrTp_VdsCDet:
  1882. break;
  1883. case LyrTp_Avi:
  1884. MenuItem11->Visible = AOnList;
  1885. MenuItem12->Visible = AOnList;
  1886. pmuAvi->Popup(p.x, p.y);
  1887. break;
  1888. case LyrTp_Rse:
  1889. N5->Visible = AOnList;
  1890. mnuMoveRse->Visible = AOnList;
  1891. pmuRse->Popup(p.x, p.y);
  1892. break;
  1893. case LyrTp_Dsrc:
  1894. MenuItem16->Visible = AOnList;
  1895. MenuItem17->Visible = AOnList;
  1896. pmuDsrc->Popup(p.x, p.y);
  1897. break;
  1898. case LyrTp_Park:
  1899. MenuItem28->Visible = AOnList;
  1900. MenuItem29->Visible = AOnList;
  1901. pmuPark->Popup(p.x, p.y);
  1902. break;
  1903. case LyrTp_PVms:
  1904. MenuItem24->Visible = AOnList;
  1905. MenuItem25->Visible = AOnList;
  1906. pmuPVms->Popup(p.x, p.y);
  1907. break;
  1908. case LyrTp_Bit:
  1909. MenuItem18->Visible = AOnList;
  1910. mnuMoveBit->Visible = AOnList;
  1911. pmuBit->Popup(p.x, p.y);
  1912. break;
  1913. case LyrTp_Sig:
  1914. MenuItem22->Visible = AOnList;
  1915. mnuMoveSig->Visible = AOnList;
  1916. pmuSig->Popup(p.x, p.y);
  1917. break;
  1918. case LyrTp_SigDet:
  1919. MenuItem23->Visible = AOnList;
  1920. mnuMoveSigDet->Visible = AOnList;
  1921. pmuSigDet->Popup(p.x, p.y);
  1922. break;
  1923. case LyrTp_WCam:
  1924. case LyrTp_CCam:
  1925. case LyrTp_ICam:
  1926. case LyrTp_CCol:
  1927. case LyrTp_SPCam:
  1928. N7->Visible = AOnList;
  1929. mnuMoveVmsWebCam->Visible = AOnList;
  1930. pmuWCam->Popup(p.x, p.y);
  1931. break;
  1932. #if 0
  1933. case LyrTp_CCam:
  1934. N18->Visible = AOnList;
  1935. mnuMoveCrsCam->Visible = AOnList;
  1936. pmuCCam->Popup(p.x, p.y);
  1937. break;
  1938. #endif
  1939. case LyrTp_Wthr:
  1940. case LyrTp_Atmp:
  1941. break;
  1942. case LyrTp_Incd:
  1943. break;
  1944. case LyrTp_Crs:
  1945. N20->Visible = AOnList;
  1946. MenuItem57->Visible = AOnList;
  1947. pmuCrs->Popup(p.x, p.y);
  1948. break;
  1949. case LyrTp_CrsCam:
  1950. N19->Visible = AOnList;
  1951. MenuItem50->Visible = AOnList;
  1952. pmuCrsCam->Popup(p.x, p.y);
  1953. break;
  1954. case LyrTp_Lprs:
  1955. MenuItem56->Visible = false;
  1956. MenuItem59->Visible = false;
  1957. MenuItem60->Visible = false;
  1958. MenuItem61->Visible = AOnList;
  1959. pmuLprsCam->Popup(p.x, p.y);
  1960. break;
  1961. }
  1962. }
  1963. //---------------------------------------------------------------------------
  1964. void __fastcall TITS0000M::SelectObjectByPos(double dPosX, double dPosY, bool bArrow/*=false*/)
  1965. {
  1966. FRAMEOpenMap1->SelectObjectByPos(dPosX, dPosY, bArrow);
  1967. }
  1968. //---------------------------------------------------------------------------
  1969. void __fastcall TITS0000M::ShowLinkDetailInfo(String ALinkId, int ALinkLevel)
  1970. {
  1971. try
  1972. {
  1973. if (FrmLinkInfo == NULL)
  1974. {
  1975. FrmLinkInfo = new TFrmLinkInfo(Application);
  1976. }
  1977. FrmLinkInfo->Show();
  1978. FrmLinkInfo->ShowLinkInfo(ALinkId, ALinkLevel);
  1979. }
  1980. catch(...)
  1981. {
  1982. }
  1983. }
  1984. //---------------------------------------------------------------------------
  1985. void __fastcall TITS0000M::MapZoomChanged(int AMapZoom)
  1986. {
  1987. if (g_nMapSource == 2)
  1988. {
  1989. //VWorld
  1990. String sLevl = ", L ";
  1991. switch(AMapZoom)
  1992. {
  1993. case 12: case 13: sLevl = ", R "; break;
  1994. case 14: case 15: sLevl = ", I "; break;
  1995. }
  1996. LblZoom->Caption = "Zoom: " + String(FRAMEOpenMap1->MapZoom) + sLevl;
  1997. }
  1998. else
  1999. {
  2000. String sLevl = g_sZoomLevel[AMapZoom];
  2001. if (sLevl == "")
  2002. LblZoom->Caption = "Zoom: " + String(FRAMEOpenMap1->MapZoom);
  2003. else
  2004. LblZoom->Caption = "Zoom: " + String(FRAMEOpenMap1->MapZoom) + ", " + sLevl;
  2005. }
  2006. }
  2007. //---------------------------------------------------------------------------
  2008. void __fastcall TITS0000M::OpenMapCallback(TObject *ASender, const String AFunc, const String AArgs, const bool AFirst)
  2009. {
  2010. try
  2011. {
  2012. DebugLog(AFunc + " " + AArgs + (AFirst ? ", First" : ""));
  2013. if (AFirst)
  2014. {
  2015. MapZoomChanged(FRAMEOpenMap1->MapZoom);
  2016. Application->ProcessMessages();
  2017. TmrInitGis->Enabled = true;
  2018. return;
  2019. }
  2020. if (FRAMEOpenMap1->MapStart)
  2021. {
  2022. MapZoomChanged(FRAMEOpenMap1->MapZoom);
  2023. }
  2024. if (AFunc.Pos("onlinkclick"))
  2025. {
  2026. if (BtnMapSelect->Down)
  2027. {
  2028. String sLyrType = "";
  2029. String sLinkId = "";
  2030. TStringList *pStringList = new TStringList;
  2031. pStringList->CommaText = AArgs;
  2032. try
  2033. {
  2034. sLyrType = pStringList->Strings[0];
  2035. sLinkId = pStringList->Strings[1];
  2036. }
  2037. catch(Exception &e)
  2038. {
  2039. }
  2040. delete pStringList;
  2041. if (sLinkId != "")
  2042. {
  2043. ShowLinkDetailInfo(sLinkId, sLyrType.ToIntDef(1));
  2044. }
  2045. }
  2046. return;
  2047. }
  2048. if (AFunc.Pos("onfacilityrightclick"))
  2049. {
  2050. int nLyrType;
  2051. String sFID;
  2052. //int X, Y;
  2053. TStringList *pStringList = new TStringList;
  2054. pStringList->CommaText = AArgs;
  2055. try
  2056. {
  2057. nLyrType = pStringList->Strings[0].ToIntDef(0);
  2058. sFID = pStringList->Strings[1];
  2059. //X = pStringList->Strings[4].ToIntDef(0);
  2060. //Y = pStringList->Strings[5].ToIntDef(0);
  2061. //if (nLyrType != LyrTp_Vds)
  2062. {
  2063. OnMapPopupMenu(nLyrType, sFID, false);
  2064. }
  2065. }
  2066. catch(Exception &e)
  2067. {
  2068. }
  2069. delete pStringList;
  2070. }
  2071. }
  2072. catch(Exception &exception)
  2073. {
  2074. }
  2075. }
  2076. //---------------------------------------------------------------------------
  2077. void __fastcall TITS0000M::SetGisTrafficColor()
  2078. {
  2079. #if 0
  2080. //TODO
  2081. //소통등급별 색상을 던지는 것을 여기에 추가한다.
  2082. TUTISLinkGrade UtisLinkColor;
  2083. GetGisTrafficColor(UtisLinkColor);
  2084. // 소통정보를 표출할 스레드 생성
  2085. for (int ii = 0; ii < MAX_LAYERS; ii++)
  2086. {
  2087. if (m_pLinkSpeedUpdate[ii] == NULL) continue;
  2088. m_pLinkSpeedUpdate[ii]->SetUTISLinkColor(UtisLinkColor);
  2089. }
  2090. #endif
  2091. }
  2092. //---------------------------------------------------------------------------
  2093. bool __fastcall TITS0000M::SelectLinkById(int ALinkLevel, String AId, bool AHide/*=false*/)
  2094. {
  2095. if (!FRAMEOpenMap1->MapStart) return false;
  2096. int nMapZoom = FRAMEOpenMap1->MapZoom;
  2097. if (g_nMapSource == 2) {
  2098. //VWorld
  2099. switch(ALinkLevel)
  2100. {
  2101. case 0:
  2102. FLayerIdx = LyrTp_Node;
  2103. break;
  2104. case 1:
  2105. FLayerIdx = LyrTp_Link;
  2106. if (nMapZoom > 20 || nMapZoom < 16) nMapZoom = 17;
  2107. break;
  2108. case 2:
  2109. FLayerIdx = LyrTp_Ifsc;
  2110. if (nMapZoom > 15 || nMapZoom < 14) nMapZoom = 15;
  2111. break;
  2112. case 3:
  2113. FLayerIdx = LyrTp_Road;
  2114. if (nMapZoom > 13 || nMapZoom < 12) nMapZoom = 13;
  2115. break;
  2116. }
  2117. }
  2118. else
  2119. {
  2120. switch(ALinkLevel)
  2121. {
  2122. case 0:
  2123. FLayerIdx = LyrTp_Node;
  2124. break;
  2125. case 1:
  2126. FLayerIdx = LyrTp_Link;
  2127. if (nMapZoom > 4) nMapZoom = 4;
  2128. break;
  2129. case 2:
  2130. FLayerIdx = LyrTp_Ifsc;
  2131. if (nMapZoom > 6 || nMapZoom < 5) nMapZoom = 6;
  2132. break;
  2133. case 3:
  2134. FLayerIdx = LyrTp_Road;
  2135. if (nMapZoom > 10 || nMapZoom < 7) nMapZoom = 7;
  2136. break;
  2137. }
  2138. }
  2139. if (FLayerIdx == LyrTp_Node)
  2140. {
  2141. TItsNode *pObj = ItsNodeManager->FLists.Find(AId);
  2142. if (pObj)
  2143. {
  2144. sJs.printf(L"selectPos(%d, '%f', '%f')", nMapZoom, pObj->X_CRDN, pObj->Y_CRDN);
  2145. FRAMEOpenMap1->ExecScript(sJs);
  2146. }
  2147. }
  2148. else
  2149. {
  2150. sJs.printf(L"selectLayerObject(%d, '%s', %d)", FLayerIdx, AId.c_str(), nMapZoom);
  2151. FRAMEOpenMap1->ExecScript(sJs);
  2152. }
  2153. return true;
  2154. }
  2155. //---------------------------------------------------------------------------
  2156. void __fastcall TITS0000M::RefreshGisLink()
  2157. {
  2158. SelectLinkById(g_SelLink.Level, g_SelLink.Id, true);
  2159. }
  2160. //---------------------------------------------------------------------------
  2161. void __fastcall TITS0000M::SelGisItem(int AType, String AId)
  2162. {
  2163. SelectLinkById(AType, AId);
  2164. }
  2165. //---------------------------------------------------------------------------
  2166. void __fastcall TITS0000M::TmrInitGisTimer(TObject *Sender)
  2167. {
  2168. TmrInitGis->Enabled = false;
  2169. if (!FRAMEOpenMap1->MapStart) return;
  2170. PbLoadMap->Properties->Text = lblGisStep2->Caption;//"시설물 로딩 중...";
  2171. PbLoadMap->Position = 30;
  2172. Application->ProcessMessages();
  2173. InitGisFacility();
  2174. PbLoadMap->Properties->Text = lblGisStep3->Caption;//"소통정보 로딩 중...";
  2175. PbLoadMap->Position = 40;
  2176. Application->ProcessMessages();
  2177. InitGisTraffic();
  2178. PbLoadMap->Properties->Text = lblGisStep4->Caption;//"돌발정보 로딩 중...";
  2179. PbLoadMap->Position = 100;
  2180. Application->ProcessMessages();
  2181. UpdateGisIncident();
  2182. sJs.printf(L"showLayer(%d, %d)", ChkIncident->Tag, ChkIncident->Checked ? 1 : 0);
  2183. FRAMEOpenMap1->ExecScript(sJs);
  2184. //여기부분은 모든 레이어를 생성한 후에 실행해야 한다.
  2185. //ChkTrafficClick((TObject*)ChkTraffic);
  2186. ChkTrafficTooltipClick((TObject*)ChkTrafficTooltip);
  2187. PnlProgress->Visible = false;
  2188. PnlToolbar->Enabled = true;
  2189. }
  2190. //---------------------------------------------------------------------------
  2191. void __fastcall TITS0000M::ChkFacilityLayerShowHideClick(TObject *Sender)
  2192. {
  2193. if (!FRAMEOpenMap1->MapStart) return;
  2194. TcxCheckBox *pCheck = (TcxCheckBox*)Sender;
  2195. FOR_STL(TItsLayer*, pLayer, ItsLayerManager->FLists)
  2196. {
  2197. if (pLayer->Index == pCheck->Tag)
  2198. {
  2199. pLayer->Visible = pCheck->Checked;
  2200. break;
  2201. }
  2202. }
  2203. sJs.printf(L"showLayer(%d, %d)", pCheck->Tag, pCheck->Checked ? 1 : 0);
  2204. FRAMEOpenMap1->ExecScript(sJs);
  2205. }
  2206. //---------------------------------------------------------------------------
  2207. void __fastcall TITS0000M::ChkTrafficClick(TObject *Sender)
  2208. {
  2209. if (!FRAMEOpenMap1->MapStart) return;
  2210. TcxCheckBox *pCheck = (TcxCheckBox*)Sender;
  2211. sJs.printf(L"showTrafficLayer(%d)", pCheck->Checked ? 1 : 0);
  2212. FRAMEOpenMap1->ExecScript(sJs);
  2213. ChkTrafficTooltip->Visible = pCheck->Checked;
  2214. }
  2215. //---------------------------------------------------------------------------
  2216. void __fastcall TITS0000M::ChkTrafficTooltipClick(TObject *Sender)
  2217. {
  2218. if (!FRAMEOpenMap1->MapStart) return;
  2219. TcxCheckBox *pCheck = (TcxCheckBox*)Sender;
  2220. sJs.printf(L"showTrafficTooltip(%d)", pCheck->Checked ? 1 : 0);
  2221. FRAMEOpenMap1->ExecScript(sJs);
  2222. }
  2223. //---------------------------------------------------------------------------
  2224. void __fastcall TITS0000M::LblZoomDblClick(TObject *Sender)
  2225. {
  2226. FRAMEOpenMap1->reMsg->Visible = !FRAMEOpenMap1->reMsg->Visible;
  2227. }
  2228. //---------------------------------------------------------------------------
  2229. void __fastcall TITS0000M::ChkGisSearchClick(TObject *Sender)
  2230. {
  2231. try
  2232. {
  2233. if (ChkGisSearch->Checked)
  2234. {
  2235. if (FrmGisSearch == NULL)
  2236. {
  2237. FrmGisSearch = new TFrmGisSearch(this);
  2238. //FrmGisSearch->Parent = this;
  2239. }
  2240. FrmGisSearch->Show();
  2241. }
  2242. else
  2243. {
  2244. if (FrmGisSearch)
  2245. {
  2246. if (FrmGisSearch->m_bClose == false)
  2247. {
  2248. FrmGisSearch->Close();
  2249. }
  2250. }
  2251. }
  2252. }
  2253. catch(...)
  2254. {
  2255. }
  2256. }
  2257. //---------------------------------------------------------------------------
  2258. void __fastcall TITS0000M::FormCloseQuery(TObject *Sender, bool &CanClose)
  2259. {
  2260. FRAMEOpenMap1->OnCloseQuery(CanClose);
  2261. }
  2262. //---------------------------------------------------------------------------
  2263. void __fastcall TITS0000M::DebugMsg(String AMsg)
  2264. {
  2265. LblMsg->Caption = AMsg;
  2266. LblMsg->Refresh();
  2267. if (LblMsg->Visible == false) LblMsg->Visible = true;
  2268. TmrDebugHide->Enabled = false;
  2269. TmrDebugHide->Enabled = true;
  2270. DebugLog(AMsg);
  2271. }
  2272. //---------------------------------------------------------------------------
  2273. void __fastcall TITS0000M::DebugLog(String AMsg)
  2274. {
  2275. if (TabDebug->Visible)
  2276. {
  2277. reMsg->Lines->Add(Now().FormatString("HH:NN:SS.ZZZ") + ": " + AMsg);
  2278. }
  2279. }
  2280. //---------------------------------------------------------------------------
  2281. void __fastcall TITS0000M::TmrDebugHideTimer(TObject *Sender)
  2282. {
  2283. LblMsg->Visible = false;
  2284. TmrDebugHide->Enabled = false;
  2285. }
  2286. //---------------------------------------------------------------------------
  2287. void __fastcall TITS0000M::reMsgDblClick(TObject *Sender)
  2288. {
  2289. reMsg->Lines->Clear();
  2290. }
  2291. //---------------------------------------------------------------------------
  2292. void __fastcall TITS0000M::FRAMEAtmpPltnList1TvListCellDblClick(TcxCustomGridTableView *Sender, TcxGridTableDataCellViewInfo *ACellViewInfo,
  2293. TMouseButton AButton, TShiftState AShift, bool &AHandled)
  2294. {
  2295. if (!ACellViewInfo) return;
  2296. try {
  2297. TcxDataController *pGDC = FRAMEAtmpPltnList1->TvList->DataController;
  2298. int nRow = pGDC->FocusedRecordIndex;
  2299. if (nRow < 0) return;
  2300. String sId = VarToStr(pGDC->Values[nRow][FRAMEAtmpPltnList1->Col00->Index]);
  2301. String sDx = VarToStr(pGDC->Values[nRow][FRAMEAtmpPltnList1->Col30->Index]);
  2302. String sDy = VarToStr(pGDC->Values[nRow][FRAMEAtmpPltnList1->Col31->Index]);
  2303. SelectObjectByPos(StrToFloat(sDx), StrToFloat(sDy), true);
  2304. } catch(...) {}
  2305. }
  2306. //---------------------------------------------------------------------------
  2307. void __fastcall TITS0000M::FRAMEVilgShprList1TvListCellDblClick(TcxCustomGridTableView *Sender, TcxGridTableDataCellViewInfo *ACellViewInfo,
  2308. TMouseButton AButton, TShiftState AShift, bool &AHandled)
  2309. {
  2310. if (!ACellViewInfo) return;
  2311. try {
  2312. TcxDataController *pGDC = FRAMEVilgShprList1->TvList->DataController;
  2313. int nRow = pGDC->FocusedRecordIndex;
  2314. if (nRow < 0) return;
  2315. String sId = VarToStr(pGDC->Values[nRow][FRAMEVilgShprList1->Col00->Index]);
  2316. String sDx = VarToStr(pGDC->Values[nRow][FRAMEVilgShprList1->Col20->Index]);
  2317. String sDy = VarToStr(pGDC->Values[nRow][FRAMEVilgShprList1->Col21->Index]);
  2318. SelectObjectByPos(StrToFloat(sDx), StrToFloat(sDy), true);
  2319. } catch(...) {}
  2320. }
  2321. //---------------------------------------------------------------------------
  2322. void __fastcall TITS0000M::FRAMEVilgFrcsList1TvListCellDblClick(TcxCustomGridTableView *Sender, TcxGridTableDataCellViewInfo *ACellViewInfo,
  2323. TMouseButton AButton, TShiftState AShift, bool &AHandled)
  2324. {
  2325. if (!ACellViewInfo) return;
  2326. try {
  2327. TcxDataController *pGDC = FRAMEVilgFrcsList1->TvList->DataController;
  2328. int nRow = pGDC->FocusedRecordIndex;
  2329. if (nRow < 0) return;
  2330. String sId = VarToStr(pGDC->Values[nRow][FRAMEVilgFrcsList1->Col00->Index]);
  2331. String sDx = VarToStr(pGDC->Values[nRow][FRAMEVilgFrcsList1->Col20->Index]);
  2332. String sDy = VarToStr(pGDC->Values[nRow][FRAMEVilgFrcsList1->Col21->Index]);
  2333. SelectObjectByPos(StrToFloat(sDx), StrToFloat(sDy), true);
  2334. } catch(...) {}
  2335. }
  2336. //---------------------------------------------------------------------------
  2337. void __fastcall TITS0000M::PnlFacilityDblClick(TObject *Sender)
  2338. {
  2339. FRAMEOpenMap1->ExecScript("getMapExtent()");
  2340. }
  2341. //---------------------------------------------------------------------------
  2342. void __fastcall TITS0000M::mnuParkMsgClick(TObject *Sender)
  2343. {
  2344. Application->ProcessMessages();
  2345. TPoint pt;
  2346. GetCursorPos(&pt);
  2347. pt = ITS0000M->ScreenToClient(pt);
  2348. ShowParkingLotInfo(FSelId, pt);
  2349. }
  2350. //---------------------------------------------------------------------------
  2351. void __fastcall TITS0000M::ShowParkingLotInfo(String AId, TPoint pt)
  2352. {
  2353. TItsFacility *pFacility = ItsFacilityManager->FLists.Find(AId);
  2354. if (!pFacility) return;
  2355. TPrltCtlr *pObj = (TPrltCtlr*)pFacility->Object;
  2356. if (!pObj) return;
  2357. try {
  2358. if (pObj->FData1)
  2359. {
  2360. TFrmParkMsg *pForm = (TFrmParkMsg *)pObj->FData1;
  2361. pForm->SetFocus();
  2362. }
  2363. else
  2364. {
  2365. TFrmParkMsg *pForm = new TFrmParkMsg(ITS0000M, pObj);
  2366. pForm->Parent = ITS0000M;
  2367. if ((pt.x + pForm->Width + 5) > this->Width)
  2368. {
  2369. pt.x = this->Width - pForm->Width - 5;
  2370. }
  2371. if ((pt.y + pForm->Height + 5) > this->Height)
  2372. {
  2373. pt.y = this->Height - pForm->Height - 5;
  2374. }
  2375. pForm->Left = Left + pt.x;
  2376. pForm->Top = Top + pt.y;
  2377. pObj->FData1 = (void*)pForm;
  2378. pForm->Show();
  2379. }
  2380. } catch(...) {}
  2381. }
  2382. //---------------------------------------------------------------------------
  2383. void __fastcall TITS0000M::mnuCrsStreamClick(TObject *Sender)
  2384. {
  2385. Application->ProcessMessages();
  2386. TPoint pt;
  2387. GetCursorPos(&pt);
  2388. pt = ITS0000M->ScreenToClient(pt);
  2389. ShowCrsStrmCamera(FSelId, pt);
  2390. }
  2391. //---------------------------------------------------------------------------
  2392. void __fastcall TITS0000M::ShowCrsStrmCamera(String AId, TPoint pt)
  2393. {
  2394. TItsFacility *pFacility = ItsFacilityManager->FLists.Find(AId);
  2395. if (!pFacility) return;
  2396. TCDSObject *pObj = (TCDSObject*)pFacility->Object;
  2397. if (!pObj) return;
  2398. try {
  2399. if (pObj->FData1)
  2400. {
  2401. TFrmCrsStreamPlayer *pForm = (TFrmCrsStreamPlayer *)pObj->FData1;
  2402. pForm->SetFocus();
  2403. }
  2404. else
  2405. {
  2406. TFrmCrsStreamPlayer *pForm = new TFrmCrsStreamPlayer(ITS0000M, (TCross*)pObj);
  2407. //pForm->FCross = (TCross*)pObj;
  2408. pForm->Parent = ITS0000M;
  2409. pObj->FData1 = (void*)pForm;
  2410. pForm->Show();
  2411. }
  2412. } catch(...) {}
  2413. }
  2414. //---------------------------------------------------------------------------
  2415. void __fastcall TITS0000M::CbLayerVisiblePropertiesCloseUp(TObject *Sender)
  2416. {
  2417. FRAMEOpenMap1->SetFocus();
  2418. }
  2419. //---------------------------------------------------------------------------