DSRM010MF.cpp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646
  1. //---------------------------------------------------------------------------
  2. #include <vcl.h>
  3. #include "ITSSkinF.h"
  4. #include "ITSUtilF.h"
  5. #include "AppGlobalF.h"
  6. #include "ITSLangTransF.h"
  7. #include "ITSMapF.h"
  8. #include "WindowMsgF.h"
  9. #include "ITS_OPLibF.h"
  10. #pragma hdrstop
  11. #include "DSRM010MF.h"
  12. //---------------------------------------------------------------------------
  13. #pragma package(smart_init)
  14. #pragma link "FRAME_DsrcListF"
  15. #pragma link "cxButtons"
  16. #pragma link "cxCheckBox"
  17. #pragma link "cxContainer"
  18. #pragma link "cxControls"
  19. #pragma link "cxDropDownEdit"
  20. #pragma link "cxEdit"
  21. #pragma link "cxGraphics"
  22. #pragma link "cxGroupBox"
  23. #pragma link "cxLabel"
  24. #pragma link "cxLookAndFeelPainters"
  25. #pragma link "cxLookAndFeels"
  26. #pragma link "cxMaskEdit"
  27. #pragma link "cxSpinEdit"
  28. #pragma link "cxSplitter"
  29. #pragma link "cxTextEdit"
  30. #pragma link "dxSkinBlack"
  31. #pragma link "dxSkinBlue"
  32. #pragma link "dxSkinsCore"
  33. #pragma link "dxSkinMcSkin"
  34. #pragma link "FRAME_OpenMapF"
  35. #pragma resource "*.dfm"
  36. TDSRM010M *DSRM010M = NULL;
  37. //---------------------------------------------------------------------------
  38. void TDSRM010M_MapCallback(TObject *ASender, const String AFunc, const String AArgs, const bool AFirst)
  39. {
  40. try
  41. {
  42. if (!DSRM010M) return;
  43. DSRM010M->OpenMapCallback(ASender, AFunc, AArgs, AFirst);
  44. }
  45. catch(Exception &exception)
  46. {
  47. }
  48. }
  49. //---------------------------------------------------------------------------
  50. __fastcall TDSRM010M::TDSRM010M(TComponent* Owner)
  51. : TForm(Owner)
  52. {
  53. LangTrans->Translate(this, ITSDb_GetConnection());
  54. ITSSkin_Load(this);
  55. CMM_LoadForm(g_sFormsDir, this);
  56. FUpdate= false;
  57. FTitle = Caption;
  58. //FRAMEDsrcList1->Column02->Visible = false;
  59. FRAMEDsrcList1->PnlTop->Visible = false;
  60. FRAMEDsrcList1->PnlBottom->Visible = false;
  61. FRAMEDsrcList1->ColumnSel->Visible = false;
  62. m_pGDC = FRAMEDsrcList1->TvList->DataController;
  63. FLayerIdx = LyrTp_Dsrc;
  64. FRAMEOpenMap1->LayerIdx = FLayerIdx;
  65. FRAMEOpenMap1->MapCallbackFunc = TDSRM010M_MapCallback;
  66. EditMode = false;
  67. }
  68. //---------------------------------------------------------------------------
  69. void __fastcall TDSRM010M::CommClose()
  70. {
  71. try
  72. {
  73. CMM_SaveForm(g_sFormsDir, this);
  74. }
  75. catch(...)
  76. {
  77. }
  78. }
  79. //---------------------------------------------------------------------------
  80. void __fastcall TDSRM010M::FormShow(TObject *Sender)
  81. {
  82. Refresh();
  83. FRAMEOpenMap1->OpenMap();
  84. APP_FillCode(CbMnfcCmpyCd, "RMF");
  85. #if 0
  86. CbMnfcCmpyCd->Properties->Items->Clear();
  87. TItsCode *FCodeRMF = ItsCodeManager->FLists.Find("RMF");
  88. if (FCodeRMF)
  89. {
  90. FOR_STL(TItsSubCode *, pSubCode, FCodeRMF->FSubLists)
  91. {
  92. if (pSubCode->USE_YN == "N") continue;
  93. CbMnfcCmpyCd->Properties->Items->Add(" [" + pSubCode->CMMN_CD + "] " + pSubCode->CMMN_CD_KOR_NM);
  94. }
  95. }
  96. CbMnfcCmpyCd->ItemIndex = 0;
  97. #endif
  98. FormInit();
  99. ChangeEditMode(1);
  100. TmrShow->Enabled = true;
  101. }
  102. //---------------------------------------------------------------------------
  103. void __fastcall TDSRM010M::FormInit()
  104. {
  105. EdId->Text = "";
  106. EdRseId->Text = "";
  107. EdRoadSpotId->Text = "";
  108. EdLogCnncId->Text = "";
  109. EdLogCnncPwd->Text = "";
  110. EdIstlLctnNm->Text = "";
  111. SePosX->Value = 0;
  112. SePosY->Value = 0;
  113. EdIP->Text = "";
  114. EdPort->Text = "";
  115. CbMnfcCmpyCd->ItemIndex = 0;
  116. FNewDb = false;
  117. }
  118. //---------------------------------------------------------------------------
  119. void __fastcall TDSRM010M::TmrShowTimer(TObject *Sender)
  120. {
  121. TmrShow->Enabled = false;
  122. FRAMEDsrcList1->UpdateList();
  123. }
  124. //---------------------------------------------------------------------------
  125. void __fastcall TDSRM010M::BtnCloseClick(TObject *Sender)
  126. {
  127. Close();
  128. }
  129. //---------------------------------------------------------------------------
  130. void __fastcall TDSRM010M::FormClose(TObject *Sender, TCloseAction &Action)
  131. {
  132. CommClose();
  133. DSRM010M = NULL;
  134. Action = caFree;
  135. }
  136. //---------------------------------------------------------------------------
  137. void __fastcall TDSRM010M::FormCloseQuery(TObject *Sender, bool &CanClose)
  138. {
  139. if (FUpdate)
  140. {
  141. POST_MSG(Application->MainForm->Handle, WM_DATABASE_REFRESH, WP_MSG_14, 0);
  142. }
  143. FRAMEDsrcList1->OnCloseQuery(CanClose);
  144. FRAMEOpenMap1->OnCloseQuery(CanClose);
  145. }
  146. //---------------------------------------------------------------------------
  147. void __fastcall TDSRM010M::DisplayInfo(TItsDsrc* AObj, bool AMoveObj/*=true*/)
  148. {
  149. FormInit();
  150. if (!AObj) return;
  151. if (AMoveObj)
  152. {
  153. sJs.printf(L"selectLayerObject(%d, '%s', %d)", FLayerIdx, AObj->CTLR_NMBR.c_str(), FRAMEOpenMap1->MapZoom);
  154. FRAMEOpenMap1->ExecScript(sJs);
  155. }
  156. EdId->Text = AObj->CTLR_NMBR;
  157. EdRseId->Text = AObj->CTLR_ID;
  158. EdRoadSpotId->Text = AObj->ROAD_SPOT_ID;
  159. EdLogCnncId->Text = AObj->LOG_CNNC_ID;
  160. EdLogCnncPwd->Text = AObj->LOG_CNNC_PW;
  161. EdIstlLctnNm->Text = AObj->ISTL_LCTN_NM;
  162. SePosX->Value = AObj->X_CRDN;
  163. SePosY->Value = AObj->Y_CRDN;
  164. EdIP->Text = AObj->CTLR_IP;
  165. EdPort->Text = String(AObj->CTLR_PORT);
  166. SeCLCT_ABNR_BASI->Value = AObj->CLCT_ABNR_BASI;
  167. SeAbnrAll->Value = SeCLCT_ABNR_BASI->Value;
  168. CMM_SetComboBoxItem(CbMnfcCmpyCd, AObj->MNFC_CMPY_CD);
  169. ChangeEditMode(3);
  170. }
  171. //---------------------------------------------------------------------------
  172. void __fastcall TDSRM010M::UpdateIcon()
  173. {
  174. if (!FRAMEOpenMap1->MapStart) return;
  175. sJs.printf(L"removeLayerObject(%d)", FLayerIdx);
  176. FRAMEOpenMap1->ExecScript(sJs);
  177. String arrObj = "";
  178. String sTemp;
  179. TItsFacility *pFacility;
  180. try
  181. {
  182. FRAMEDsrcList1->MyItsDsrcManager->FLists.Lock();
  183. FOR_STL(TItsDsrc*, pObj, FRAMEDsrcList1->MyItsDsrcManager->FLists)
  184. {
  185. if (pObj->DEL_YN == "Y") continue;
  186. if (arrObj != "") arrObj += "|";
  187. sTemp.printf(L"%s,%s,%s,%.6f,%.6f,0,0,0,0", pObj->CTLR_NMBR.c_str(), pObj->CTLR_ID.c_str(), pObj->ISTL_LCTN_NM.c_str(), pObj->X_CRDN, pObj->Y_CRDN);
  188. arrObj += sTemp;
  189. }
  190. }
  191. __finally
  192. {
  193. FRAMEDsrcList1->MyItsDsrcManager->FLists.UnLock();
  194. if (arrObj != "")
  195. {
  196. sJs.printf(L"addFacility(%d, '%s')", FLayerIdx, arrObj.c_str());
  197. FRAMEOpenMap1->ExecScript(sJs);
  198. }
  199. }
  200. }
  201. //---------------------------------------------------------------------------
  202. void __fastcall TDSRM010M::BtnEditClick(TObject *Sender)
  203. {
  204. String sId = EdId->Text;
  205. TItsDsrc *pObj = FRAMEDsrcList1->MyItsDsrcManager->FLists.Find(sId);
  206. FNewDb = false;
  207. if (BtnEdit->Caption == FrmLang->lblEdit->Caption)//"편집")
  208. {
  209. //편집모드 시작
  210. ChangeEditMode(0);
  211. if (pObj)
  212. {
  213. //시설물아이콘을 편집아이콘으로 변경
  214. //function editFacilityObject(ALyrIdx, ANmbr, AComm(0:오류-편집,1:정상), AEdit(편집모드:1-편집,0-편집취소))
  215. sJs.printf(L"editFacilityObject(%d, %s, 1, 1)", FLayerIdx, pObj->CTLR_NMBR.c_str());
  216. FRAMEOpenMap1->ExecScript(sJs);
  217. }
  218. }
  219. else
  220. {
  221. //편집모드 취소
  222. ChangeEditMode(1);
  223. if (pObj)
  224. {
  225. //원래 정보를 화면에 표출
  226. CMM_SetGridRow(FRAMEDsrcList1->CxList, FRAMEDsrcList1->TvList, sId, FRAMEDsrcList1->Column01->Index);
  227. DisplayInfo(pObj, false);
  228. #if 0
  229. //지도시설물아이콘을 원래아이콘으로 변경
  230. sJs.printf(L"editFacilityObject(%d, %s, 0, 0)", FLayerIdx, pObj->CTLR_NMBR.c_str());
  231. FRAMEOpenMap1->ExecScript(sJs);
  232. #else
  233. //추가 모드에서 취소하는 경우 지도에 신규로 추가한 객체를 찾아서 삭제해 주는것 보다
  234. //새롭게 다시 그리자
  235. UpdateIcon();
  236. #endif
  237. }
  238. else
  239. {
  240. //객체가 없는 경우는 추가 모드에서 취소한 경우임
  241. sJs.printf(L"removeFacilityObject(%d, %s)", FLayerIdx, sId.c_str());
  242. FRAMEOpenMap1->ExecScript(sJs);
  243. }
  244. }
  245. }
  246. //---------------------------------------------------------------------------
  247. void __fastcall TDSRM010M::ChangeEditMode(int AEdit)
  248. {
  249. bool bEnabled = false;
  250. switch(AEdit)
  251. {
  252. case 0: //편집버튼클릭
  253. {
  254. BtnEdit->Enabled = true;
  255. BtnInsert->Enabled = false;
  256. BtnDelete->Enabled = false;
  257. BtnSave->Enabled = true;
  258. BtnEdit->Caption = FrmLang->lblCancel->Caption;//"취소";
  259. BtnEdit->Hint = FrmLang->lblCancel->Hint;//데이터 편집 취소";
  260. EditMode = true;
  261. }
  262. break;
  263. case 1: //편집[취소]버튼클릭
  264. {
  265. FormInit(); //화면을 모두 지운다.
  266. BtnEdit->Enabled = false;
  267. BtnInsert->Enabled = true;
  268. BtnDelete->Enabled = false;
  269. BtnSave->Enabled = false;
  270. BtnEdit->Caption = FrmLang->lblEdit->Caption;//"편집";
  271. BtnEdit->Hint = FrmLang->lblEdit->Hint;//데이터 편집";
  272. //bEnabled = true;
  273. EditMode = false;
  274. }
  275. break;
  276. case 2: //추가
  277. {
  278. BtnEdit->Enabled = true;
  279. BtnInsert->Enabled = false;
  280. BtnDelete->Enabled = false;
  281. BtnSave->Enabled = true;
  282. BtnEdit->Caption = FrmLang->lblCancel->Caption;//"취소";
  283. BtnEdit->Hint = FrmLang->lblCancel->Hint;//데이터 편집 취소";
  284. EditMode = true;
  285. }
  286. break;
  287. case 3: //수정모드
  288. {
  289. BtnEdit->Enabled = true;
  290. BtnInsert->Enabled = true;
  291. BtnDelete->Enabled = true;
  292. BtnSave->Enabled = false;
  293. BtnEdit->Caption = FrmLang->lblEdit->Caption;//"편집";
  294. BtnEdit->Hint = FrmLang->lblEdit->Hint;//데이터 편집";
  295. bEnabled = true;
  296. EditMode = false;
  297. }
  298. break;
  299. }
  300. if (AEdit == 0 || AEdit == 2)
  301. {
  302. FRAMEDsrcList1->CxList->Enabled = false;
  303. }
  304. else
  305. {
  306. FRAMEDsrcList1->CxList->Enabled = true;
  307. }
  308. PnlEdit->Enabled = EditMode;
  309. #if 1
  310. EdId->Properties->ReadOnly = bEnabled;
  311. EdRseId->Properties->ReadOnly = bEnabled;
  312. EdRoadSpotId->Properties->ReadOnly = bEnabled;
  313. EdLogCnncId->Properties->ReadOnly = bEnabled;
  314. EdLogCnncPwd->Properties->ReadOnly = bEnabled;
  315. EdIstlLctnNm->Properties->ReadOnly = bEnabled;
  316. SePosX->Properties->ReadOnly = bEnabled;
  317. SePosY->Properties->ReadOnly = bEnabled;
  318. EdIP->Properties->ReadOnly = bEnabled;
  319. EdPort->Properties->ReadOnly = bEnabled;
  320. CbMnfcCmpyCd->Properties->ReadOnly = bEnabled;
  321. SeCLCT_ABNR_BASI->Properties->ReadOnly = bEnabled;
  322. #endif
  323. }
  324. //---------------------------------------------------------------------------
  325. void __fastcall TDSRM010M::BtnInsertClick(TObject *Sender)
  326. {
  327. FormInit();
  328. //신규아이디를 얻어와서 화면을 초기화한다.
  329. String sRseId;
  330. if (!FRAMEDsrcList1->MyItsDsrcManager->GetNextDsrcId(sRseId))
  331. {
  332. Application->MessageBox(L"새로운 DSRC ID를 생성하지 못하였습니다.\r\n프로그램 종료후에 다시 시도해 보세요.",
  333. FTitle.c_str(), MB_OK|MB_ICONERROR|MB_APPLMODAL);
  334. return;
  335. }
  336. EdId->Text = sRseId;
  337. EdRseId->Text = sRseId;
  338. SePosX->Value = FRAMEOpenMap1->CenterX;
  339. SePosY->Value = FRAMEOpenMap1->CenterY;
  340. //지도에 새로운 시설물 아이콘 추가하면서 편집모드로 변경
  341. String arrObj = "";
  342. arrObj.printf(L"%s,New,New,%.6f,%.6f,0", sRseId.c_str(), FRAMEOpenMap1->CenterX, FRAMEOpenMap1->CenterY);
  343. sJs.printf(L"addFacilityObject(%d, '%s')", FLayerIdx, arrObj.c_str());
  344. FRAMEOpenMap1->ExecScript(sJs);
  345. ChangeEditMode(2);
  346. FNewDb = true;
  347. }
  348. //---------------------------------------------------------------------------
  349. void __fastcall TDSRM010M::BtnDeleteClick(TObject *Sender)
  350. {
  351. if (!FRAMEOpenMap1->MapStart) return;
  352. int nIdx = m_pGDC->FocusedRecordIndex;
  353. if (nIdx < 0) return;
  354. String sId = EdId->Text;
  355. if (sId.IsEmpty())
  356. {
  357. Application->MessageBox(L"삭제할 DSRC를 목록에서 선택하세요.\r\n목록에서 더블클릭하여 선택합니다.",
  358. FTitle.c_str(), MB_OK|MB_ICONERROR|MB_APPLMODAL);
  359. return;
  360. }
  361. String sMsg;
  362. sMsg = "ID: " + sId;
  363. sMsg+= "\r\n선택하신 DSRC 정보를 삭제하시겠습니까?";
  364. if (Application->MessageBox(sMsg.c_str(), FTitle.c_str(), MB_YESNO|MB_ICONQUESTION|MB_APPLMODAL) != IDYES) return;
  365. TItsDsrc *pObj = FRAMEDsrcList1->MyItsDsrcManager->FLists.Find(sId);
  366. if (pObj)
  367. {
  368. if (FRAMEDsrcList1->MyItsDsrcManager->DeleteDsrc(pObj))
  369. {
  370. pObj->DEL_YN = "Y";
  371. FRAMEDsrcList1->UpdateList();
  372. UpdateIcon();
  373. }
  374. FUpdate = true;
  375. #if 0
  376. TItsFacility *pFacility = ItsFacilityManager->FLists.Find(sId);
  377. if (pFacility)
  378. {
  379. FUpdate = true;
  380. }
  381. #endif
  382. Application->MessageBox(L"DSRC 정보삭제\r\nDSRC 정보를 삭제 하였습니다.",
  383. FTitle.c_str(), MB_OK|MB_ICONINFORMATION|MB_APPLMODAL);
  384. FormInit();
  385. ChangeEditMode(1);
  386. UpdateIcon();
  387. //POST_MSG(Application->MainForm->Handle, WM_DATABASE_REFRESH, WP_MSG_14, 0);
  388. }
  389. }
  390. //---------------------------------------------------------------------------
  391. void __fastcall TDSRM010M::BtnSaveClick(TObject *Sender)
  392. {
  393. if (EdId->Text.IsEmpty() ||
  394. EdRseId->Text.Trim().IsEmpty() ||
  395. EdRoadSpotId->Text.IsEmpty() ||
  396. SePosX->Value == 0 ||
  397. SePosY->Value == 0 ||
  398. CbMnfcCmpyCd->Text.IsEmpty() )
  399. {
  400. Application->MessageBox(L"★항목은 필수 입력 항목입니다.\r\n모두 입력후 진행해 주세요.",
  401. FTitle.c_str(), MB_OK|MB_ICONERROR|MB_APPLMODAL);
  402. return;
  403. }
  404. String sId = EdId->Text;
  405. String sDsrcId = EdRseId->Text.Trim();
  406. if (!ITSUtil_CheckIpAddress(EdIP->Text.Trim()))
  407. {
  408. Application->MessageBox(L"제어기 IP가 유효하지 않습니다.",
  409. FTitle.c_str(), MB_OK|MB_ICONERROR|MB_APPLMODAL);
  410. return;
  411. }
  412. FRAMEDsrcList1->MyItsDsrcManager->FLists.Lock();
  413. FOR_STL(TItsDsrc*, pTmpObj, FRAMEDsrcList1->MyItsDsrcManager->FLists)
  414. {
  415. if (pTmpObj->DEL_YN == "Y") continue;
  416. if (pTmpObj->CTLR_NMBR == sId) continue; //자기자신
  417. if (pTmpObj->CTLR_ID == sDsrcId)
  418. {
  419. Application->MessageBox(L"DSRC ID가 이미 사용 중입니다. DSRC ID를 확인하세요.",
  420. FTitle.c_str(), MB_OK|MB_ICONERROR|MB_APPLMODAL);
  421. FRAMEDsrcList1->MyItsDsrcManager->FLists.UnLock();
  422. return;
  423. }
  424. }
  425. FRAMEDsrcList1->MyItsDsrcManager->FLists.UnLock();
  426. TItsDsrc *pObj;
  427. if (FNewDb)
  428. pObj = new TItsDsrc();
  429. else
  430. pObj = FRAMEDsrcList1->MyItsDsrcManager->FLists.Find(sId);
  431. if (pObj)
  432. {
  433. pObj->CTLR_NMBR = sId;
  434. String sOldRseId = pObj->CTLR_ID;
  435. pObj->CTLR_ID = EdRseId->Text.Trim();
  436. pObj->ROAD_SPOT_ID = EdRoadSpotId->Text.Trim();
  437. pObj->LOG_CNNC_ID = EdLogCnncId->Text.Trim();
  438. pObj->LOG_CNNC_PW = EdLogCnncPwd->Text.Trim();
  439. pObj->ISTL_LCTN_NM = EdIstlLctnNm->Text.Trim();
  440. pObj->X_CRDN = SePosX->Value;
  441. pObj->Y_CRDN = SePosY->Value;
  442. pObj->CTLR_IP = EdIP->Text.Trim();
  443. pObj->CTLR_PORT = EdPort->Text.Trim().ToIntDef(0);
  444. pObj->MNFC_CMPY_CD = ITSUtil_GetCode(CbMnfcCmpyCd->Text);
  445. pObj->CLCT_ABNR_BASI = (SeCLCT_ABNR_BASI->Value);
  446. pObj->Completed = true;
  447. pObj->MEM_DEL = "N";
  448. bool bResult;
  449. if (FNewDb)
  450. {
  451. pObj->DEL_YN = "N";
  452. bResult = FRAMEDsrcList1->MyItsDsrcManager->InsertDsrc(pObj);
  453. if (bResult)
  454. {
  455. FRAMEDsrcList1->MyItsDsrcManager->FLists.Push(sId, pObj);
  456. }
  457. }
  458. else
  459. {
  460. bResult = FRAMEDsrcList1->MyItsDsrcManager->UpdateDsrc(sOldRseId, pObj);
  461. }
  462. if (bResult)
  463. {
  464. Application->MessageBox(FrmLang->lblDbSave->Caption.c_str(),//L"DSRC 정보저장\r\nDSRC 정보를 저장 하였습니다.",
  465. FTitle.c_str(), MB_OK|MB_ICONINFORMATION|MB_APPLMODAL);
  466. FUpdate = true;
  467. FRAMEDsrcList1->UpdateList();
  468. UpdateIcon();
  469. CMM_SetGridRow(FRAMEDsrcList1->CxList, FRAMEDsrcList1->TvList, sId, FRAMEDsrcList1->Column01->Index);
  470. DisplayInfo(pObj, true);
  471. //POST_MSG(Application->MainForm->Handle, WM_DATABASE_REFRESH, WP_MSG_14, 0);
  472. }
  473. }
  474. }
  475. //---------------------------------------------------------------------------
  476. void __fastcall TDSRM010M::FRAMEDsrcList1TvListCellDblClick(TcxCustomGridTableView *Sender, TcxGridTableDataCellViewInfo *ACellViewInfo,
  477. TMouseButton AButton, TShiftState AShift, bool &AHandled)
  478. {
  479. if (!ACellViewInfo) return;
  480. int nRow = FRAMEDsrcList1->TvList->DataController->FocusedRecordIndex;
  481. if( nRow <= -1 )
  482. return;
  483. int nMemPtr = FRAMEDsrcList1->TvList->DataController->Values[nRow][FRAMEDsrcList1->Column99->Index];
  484. TItsDsrc* pObj = (TItsDsrc*)nMemPtr;
  485. DisplayInfo(pObj, true);
  486. }
  487. //---------------------------------------------------------------------------
  488. void __fastcall TDSRM010M::EdPortKeyPress(TObject *Sender, wchar_t &Key)
  489. {
  490. if (Key > '9' || Key < '0')
  491. {
  492. if (Key != VK_BACK && Key != VK_TAB && Key != '-')
  493. Key = 0;
  494. }
  495. }
  496. //---------------------------------------------------------------------------
  497. void __fastcall TDSRM010M::BtnSaveAllClick(TObject *Sender)
  498. {
  499. String sMsg;
  500. sMsg = "";
  501. sMsg+= "\r\n수집 이상 기준 정보를 전체 적용 하시겠습니까?";
  502. if (Application->MessageBox(sMsg.c_str(), FTitle.c_str(), MB_YESNO|MB_ICONQUESTION|MB_APPLMODAL) != IDYES) return;
  503. int nCLCT_ABNR_BASI = (SeAbnrAll->Value);
  504. if (FRAMEDsrcList1->MyItsDsrcManager->UpdateClctAbnrBasi(nCLCT_ABNR_BASI))
  505. {
  506. SeCLCT_ABNR_BASI->Value = SeAbnrAll->Value;
  507. FUpdate = true;
  508. Application->MessageBox(FrmLang->lblDbSave->Caption.c_str(),//L"수집 이상 기준\r\n수집 이상 기준 정보를 저장 하였습니다.",
  509. FTitle.c_str(), MB_OK|MB_ICONINFORMATION|MB_APPLMODAL);
  510. }
  511. }
  512. //---------------------------------------------------------------------------
  513. void __fastcall TDSRM010M::OpenMapCallback(TObject *ASender, const String AFunc, const String AArgs, const bool AFirst)
  514. {
  515. try
  516. {
  517. if (AFirst)
  518. {
  519. //지도를 편집모드로 변경
  520. sJs.printf(L"setEditMode(%d, 1)", FLayerIdx);
  521. FRAMEOpenMap1->ExecScript(sJs);
  522. //시설물아이콘 등록
  523. UpdateIcon();
  524. sJs.printf(L"extentLayer(%d)", FLayerIdx);
  525. FRAMEOpenMap1->ExecScript(sJs);
  526. return;
  527. }
  528. if (AFunc.Pos("onfacilitydragend"))
  529. {
  530. TStringList *pStringList = new TStringList;
  531. pStringList->CommaText = AArgs;
  532. try
  533. {
  534. String sNmbr = pStringList->Strings[0];
  535. String sCenterLat = pStringList->Strings[1];
  536. String sCenterLng = pStringList->Strings[2];
  537. SePosX->Value = sCenterLat.ToDouble();
  538. SePosY->Value = sCenterLng.ToDouble();
  539. }
  540. catch(Exception &e)
  541. {
  542. }
  543. delete pStringList;
  544. }
  545. }
  546. catch(Exception &exception)
  547. {
  548. }
  549. }
  550. //---------------------------------------------------------------------------