123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827 |
- /****************************************************************************
- * @source :
- * @description :
- ****************************************************************************
- * DATE AUTHOR DESCRIPTION
- * --------------------------------------------------------------------------
- * 2016/07/10 shjung 최초작성
- *
- ****************************************************************************/
- //---------------------------------------------------------------------------
- #include <vcl.h>
- #include "ITSSkinF.h"
- #include "ITSUtilF.h"
- #include "AppGlobalF.h"
- #include "CDSVmsIfscF.h"
- #pragma hdrstop
- #include "VMSM810MF.h"
- //---------------------------------------------------------------------------
- #pragma package(smart_init)
- #pragma link "cxButtons"
- #pragma link "cxCalendar"
- #pragma link "cxContainer"
- #pragma link "cxControls"
- #pragma link "cxDropDownEdit"
- #pragma link "cxEdit"
- #pragma link "cxGraphics"
- #pragma link "cxGroupBox"
- #pragma link "cxLabel"
- #pragma link "cxLookAndFeelPainters"
- #pragma link "cxLookAndFeels"
- #pragma link "cxMaskEdit"
- #pragma link "cxPC"
- #pragma link "cxPCdxBarPopupMenu"
- #pragma link "cxSpinEdit"
- #pragma link "cxSplitter"
- #pragma link "cxTextEdit"
- #pragma link "cxTimeEdit"
- #pragma link "dxSkinBlack"
- #pragma link "dxSkinBlue"
- #pragma link "dxSkinCaramel"
- #pragma link "dxSkinCoffee"
- #pragma link "dxSkinDarkRoom"
- #pragma link "dxSkinDarkSide"
- #pragma link "dxSkinFoggy"
- #pragma link "dxSkinGlassOceans"
- #pragma link "dxSkiniMaginary"
- #pragma link "dxSkinLilian"
- #pragma link "dxSkinLiquidSky"
- #pragma link "dxSkinLondonLiquidSky"
- #pragma link "dxSkinMcSkin"
- #pragma link "dxSkinMoneyTwins"
- #pragma link "dxSkinOffice2007Black"
- #pragma link "dxSkinOffice2007Blue"
- #pragma link "dxSkinOffice2007Green"
- #pragma link "dxSkinOffice2007Pink"
- #pragma link "dxSkinOffice2007Silver"
- #pragma link "dxSkinOffice2010Black"
- #pragma link "dxSkinOffice2010Blue"
- #pragma link "dxSkinOffice2010Silver"
- #pragma link "dxSkinsCore"
- #pragma link "dxSkinscxPCPainter"
- #pragma link "dxSkinSeven"
- #pragma link "dxSkinSharp"
- #pragma link "dxSkinSilver"
- #pragma link "dxSkinStardust"
- #pragma link "cxRadioGroup"
- #pragma link "cxClasses"
- #pragma link "cxCustomData"
- #pragma link "cxData"
- #pragma link "cxDataStorage"
- #pragma link "cxDBData"
- #pragma link "cxFilter"
- #pragma link "cxGrid"
- #pragma link "cxGridCustomTableView"
- #pragma link "cxGridCustomView"
- #pragma link "cxGridDBTableView"
- #pragma link "cxGridLevel"
- #pragma link "cxGridTableView"
- #pragma link "cxStyles"
- #pragma link "cxCheckBox"
- #pragma link "cxImage"
- #pragma link "cxButtonEdit"
- #pragma link "cxBlobEdit"
- #pragma link "VmsDesignerF"
- #pragma link "cxColorComboBox"
- #pragma link "cxCalc"
- #pragma resource "*.dfm"
- TVMSM810M *VMSM810M = NULL;
- //---------------------------------------------------------------------------
- __fastcall TVMSM810M::TVMSM810M(TComponent* Owner)
- : TForm(Owner)
- {
- ITSSkin_Load(this);
- //CMM_LoadForm(g_sFormsDir, this);
- FSelected = false;
- FUpdate= false;
- FTitle = "VMS 교통상황 폼 관리";
- APP_InitDisplayColor();
- }
- //---------------------------------------------------------------------------
- /*
- * 닫기버튼 이나 x버튼 클릭시 공통으로 처리하는 로직이들어간다..
- * Form과 DataModule class를 delete시킨다.
- * arguments
- *
- * return
- * void
- */
- void __fastcall TVMSM810M::CommClose()
- {
- try
- {
- if (m_pEdtDesigner)
- {
- delete m_pEdtDesigner;
- m_pEdtDesigner = NULL;
- }
- //CMM_SaveForm(g_sFormsDir, this);
- }
- catch(...)
- {
- }
- }
- //---------------------------------------------------------------------------
- void __fastcall TVMSM810M::FormCreate(TObject *Sender)
- {
- m_pEdtDesigner = new TVmsFormDesigner(PnlEditForm);
- }
- //---------------------------------------------------------------------------
- void __fastcall TVMSM810M::FormShow(TObject *Sender)
- {
- Refresh();
- FormInit();
- PnlEdtBack->Width = FVmsWidth+4;
- PnlEdtBack->Height= FVmsHeight+4;
- LoadVmsIfsc(FVmsNmbr);
- TmrShow->Enabled = true;
- }
- //---------------------------------------------------------------------------
- void __fastcall TVMSM810M::FormInit()
- {
- TvObjList->OptionsView->NoDataToDisplayInfoText = "<등록되어 있는 객체 정보가 없습니다>";
- m_pEdtDesigner->ApplicationHandle = (long)Handle;
- FNewDb = false;
- }
- //---------------------------------------------------------------------------
- void __fastcall TVMSM810M::LoadVmsIfsc(String AVmsNmbr)
- {
- CMM_ClearGridTableView(TvAxis);
- String sQry;
- TADOQuery *pADO = NULL;
- sQry = "SELECT C.VMS_CTLR_NMBR, C.VMS_CTLR_ID, C.VMS_NM, \r\n"
- " A.VMS_IFSC_ID, A.VMS_IFSC_NM, \r\n"
- " A.DSPL_STRT_NODE_NM, A.DSPL_END_NODE_NM, \r\n"
- " A.AXIS_YN \r\n"
- " FROM TB_VMS_IFSC A, \r\n"
- " TB_VMS_IFSC_RLTN B, \r\n"
- " (SELECT VMS_CTLR_NMBR, \r\n"
- " VMS_CTLR_ID, \r\n"
- " VMS_NM \r\n"
- " FROM TB_VMS_CTLR \r\n"
- " WHERE VMS_CTLR_NMBR = :p01) C \r\n"
- " WHERE A.EDTN_CD != 'EDI2' \r\n"
- " AND A.VMS_IFSC_ID = B.VMS_IFSC_ID \r\n"
- " AND B.VMS_CTLR_NMBR = C.VMS_CTLR_NMBR \r\n";
- try
- {
- int nRow;
- TcxDataController *pGDC = TvAxis->DataController;
- TvAxis->BeginUpdate();
- try
- {
- pADO = new TADOQuery(NULL);
- pADO->Close();
- pADO->Connection = ITSDb_GetConnection();
- ITSDb_SQLText(pADO, sQry);
- ITSDb_SQLBind(pADO, "p01", AVmsNmbr);
- ITSDb_SQLOpen(pADO);
- for( ; !pADO->Eof; pADO->Next())
- {
- nRow = pGDC->AppendRecord();
- pGDC->Values[nRow][Col00->Index] = pADO->FieldByName("VMS_CTLR_ID")->AsString;
- pGDC->Values[nRow][Col01->Index] = pADO->FieldByName("VMS_IFSC_ID")->AsString;
- pGDC->Values[nRow][Col02->Index] = pADO->FieldByName("VMS_IFSC_NM")->AsString;
- pGDC->Values[nRow][Col03->Index] = pADO->FieldByName("DSPL_STRT_NODE_NM")->AsString;
- pGDC->Values[nRow][Col04->Index] = pADO->FieldByName("DSPL_END_NODE_NM")->AsString;
- pGDC->Values[nRow][Col05->Index] = pADO->FieldByName("AXIS_YN")->AsString;
- }
- }
- catch(EDatabaseError &E)
- {
- DBERRORMSG("VMS제공구간정보조회", String(E.ClassName()), E.Message, sQry);
- throw Exception(String(E.ClassName()) + E.Message);
- }
- catch(Exception &e)
- {
- DBERRORMSG("VMS제공구간정보조회", String(e.ClassName()), e.Message, sQry);
- throw Exception(String(e.ClassName()) + e.Message);
- }
- }
- __finally
- {
- if (pADO)
- {
- pADO->Close();
- delete pADO;
- }
- TvAxis->EndUpdate();
- CMM_ExpandCollapseChk(TvAxis, true);
- }
- }
- //---------------------------------------------------------------------------
- void __fastcall TVMSM810M::TmrShowTimer(TObject *Sender)
- {
- TmrShow->Enabled = false;
- BtnSearchClick(NULL);
- }
- //---------------------------------------------------------------------------
- void __fastcall TVMSM810M::BtnSearchClick(TObject *Sender)
- {
- RefreshData();
- EdFocus->SetFocus();
- }
- //---------------------------------------------------------------------------
- void __fastcall TVMSM810M::RefreshData()
- {
- // 검색조건에 의한 링크 데이터 조회
- FormClear();
- m_pEdtDesigner->Clear();
- m_pEdtDesigner->SizeType = FVmsTypeCd;
- m_pEdtDesigner->SetSize(FVmsWidth, FVmsHeight);
- m_pEdtDesigner->SetPos(0, 0);
- m_pEdtDesigner->BkColorCode = FFormColor;//m_pDesigner->BkColorCode;
- m_pEdtDesigner->EditMode = true;
- m_pEdtDesigner->Show();
- InitObjectList();
- LoadFormObjectInfo(FFormId, m_pEdtDesigner);
- DispObjectListData();
- }
- //---------------------------------------------------------------------------
- void __fastcall TVMSM810M::AddTrafficTypeObject(int ARow, String AIfscId)
- {
- TVmsIfsc *pObj;
- TcxGridDataController *pGDC = TvObjList->DataController;
- pGDC->Values[ARow][ColIfscId->Index] = AIfscId;
- pObj = VmsIfscManager->FLists.Find(FIfscId[0].ToIntDef(0));
- if (!pObj) return;
- pGDC->Values[ARow][ColIfscNm->Index] = pObj->VMS_IFSC_NM;
- pGDC->Values[ARow][ColIfscStr->Index] = pObj->DSPL_STRT_NODE_NM;
- pGDC->Values[ARow][ColIfscEnd->Index] = pObj->DSPL_END_NODE_NM;
- }
- //---------------------------------------------------------------------------
- void __fastcall TVMSM810M::InitObjectList()
- {
- CMM_ClearGridTableView(TvObjList);
- TcxGridDataController *pGDC = TvObjList->DataController;
- ColObj03->Visible = false;
- ColObj04->Visible = false;
- try
- {
- TvObjList->BeginUpdate();
- pGDC->BeginUpdate();
- int nRow;
- switch(FFormType)
- {
- case 11:// ' 소통상황(1단)
- nRow = pGDC->AppendRecord();
- pGDC->Values[nRow][ColObj01->Index] = "11";
- pGDC->Values[nRow][ColObj02->Index] = "1단 소통정보";
- AddTrafficTypeObject(nRow, FIfscId[0]);
- break;
- case 12:// ' 소통상황(2단)
- nRow = pGDC->AppendRecord();
- pGDC->Values[nRow][ColObj01->Index] = "11";
- pGDC->Values[nRow][ColObj02->Index] = "1단 소통정보";
- AddTrafficTypeObject(nRow, FIfscId[0]);
- nRow = pGDC->AppendRecord();
- pGDC->Values[nRow][ColObj01->Index] = "12";
- pGDC->Values[nRow][ColObj02->Index] = "2단 소통정보";
- AddTrafficTypeObject(nRow, FIfscId[1]);
- break;
- case 13:// ' 소통상황(3단)
- nRow = pGDC->AppendRecord();
- pGDC->Values[nRow][ColObj01->Index] = "11";
- pGDC->Values[nRow][ColObj02->Index] = "1단 소통정보";
- AddTrafficTypeObject(nRow, FIfscId[0]);
- nRow = pGDC->AppendRecord();
- pGDC->Values[nRow][ColObj01->Index] = "12";
- pGDC->Values[nRow][ColObj02->Index] = "2단 소통정보";
- AddTrafficTypeObject(nRow, FIfscId[1]);
- nRow = pGDC->AppendRecord();
- pGDC->Values[nRow][ColObj01->Index] = "13";
- pGDC->Values[nRow][ColObj02->Index] = "3단 소통정보";
- AddTrafficTypeObject(nRow, FIfscId[2]);
- break;
- case 14:// ' 소통상황(4단)
- nRow = pGDC->AppendRecord();
- pGDC->Values[nRow][ColObj01->Index] = "11";
- pGDC->Values[nRow][ColObj02->Index] = "1단 소통정보";
- AddTrafficTypeObject(nRow, FIfscId[0]);
- nRow = pGDC->AppendRecord();
- pGDC->Values[nRow][ColObj01->Index] = "12";
- pGDC->Values[nRow][ColObj02->Index] = "2단 소통정보";
- AddTrafficTypeObject(nRow, FIfscId[1]);
- nRow = pGDC->AppendRecord();
- pGDC->Values[nRow][ColObj01->Index] = "13";
- pGDC->Values[nRow][ColObj02->Index] = "3단 소통정보";
- AddTrafficTypeObject(nRow, FIfscId[2]);
- nRow = pGDC->AppendRecord();
- pGDC->Values[nRow][ColObj01->Index] = "14";
- pGDC->Values[nRow][ColObj02->Index] = "4단 소통정보";
- AddTrafficTypeObject(nRow, FIfscId[2]);
- break;
- case 15:// ' 소통상황(도형식)
- ColObj03->Visible = true;
- break;
- default:
- break;
- }
- }
- __finally
- {
- pGDC->EndUpdate();
- TvObjList->EndUpdate();
- }
- }
- //---------------------------------------------------------------------------
- void __fastcall TVMSM810M::BtnClosexClick(TObject *Sender)
- {
- FSelected = false;
- Close();
- }
- //---------------------------------------------------------------------------
- void __fastcall TVMSM810M::FormClose(TObject *Sender, TCloseAction &Action)
- {
- CommClose();
- VMSM810M = NULL;
- //Action = caFree;
- }
- //---------------------------------------------------------------------------
- void __fastcall TVMSM810M::LoadFormObjectInfo(String AFormId, TVmsFormDesigner *ADesigner)
- {
- ADesigner->Clear();
- String sQry;
- TADOQuery *pADO = NULL;
- sQry = "SELECT A.*, \r\n"
- " C.VMS_FONT_SHPE_NM, \r\n"
- " B.IMAG_DATA AS SYMB_IMG, \r\n"
- " B.SYMB_EXPL AS SYMB_IMG_NM \r\n"
- " FROM TB_VMS_FORM_OBJECT A, \r\n"
- " TB_VMS_SYMB_LIB B, \r\n"
- " TB_VMS_FONT_SHPE C, \r\n"
- " TB_VMS_FORM D \r\n"
- " WHERE D.VMS_FORM_ID = :p01 \r\n"
- " AND D.VMS_FORM_ID = A.VMS_FORM_ID \r\n"
- " AND A.SYMBLIB_NMBR = B.SYMBLIB_NMBR(+) \r\n"
- " AND A.VMS_FONT_TYPE_CD = C.VMS_FONT_SHPE_CD(+) \r\n"
- " ORDER BY A.FORM_OBJECT_ID ASC \r\n";
- try
- {
- try
- {
- pADO = new TADOQuery(NULL);
- pADO->Close();
- pADO->Connection = ITSDb_GetConnection();
- ITSDb_SQLText(pADO, sQry);
- ITSDb_SQLBind(pADO, "p01", AFormId);
- ITSDb_SQLOpen(pADO);
- int nDrawType;
- String sObjKind;
- for( ; !pADO->Eof; pADO->Next())
- {
- int nFormId = pADO->FieldByName("VMS_FORM_ID")->AsInteger;
- int nObjId = pADO->FieldByName("FORM_OBJECT_ID")->AsInteger;
- int nObjType = pADO->FieldByName("VMS_FORM_OBJECT_TYPE_CD")->AsInteger;
- if (nObjType == 1 || //이미지 심볼
- nObjType == 2 || //소통정보이미지
- nObjType == 3 || //파일이미지
- nObjType == 17 || //방향이미지1
- nObjType == 27 || //방향이미지2
- nObjType == 37 || //방향이미지3
- nObjType == 47 ) //방향이미지4
- {
- if (nObjType == 1) sObjKind = OBJKIND_IMAGEID; //Image Id
- else sObjKind = OBJKIND_IMAGE; //Image
- nDrawType = 1; //이미지그리기
- }
- else
- {
- sObjKind = OBJKIND_TEXT; //문자열
- nDrawType = 0; //문자열그리기
- }
- //실재 맵핑된 구간의 정보를 표출하도록 한다.
- int nBlinking = pADO->FieldByName("VMS_DSPL_BLINKING")->AsInteger;
- int nPosX = pADO->FieldByName("VMS_DSPL_XCRDN")->AsInteger;
- int nPosY = pADO->FieldByName("VMS_DSPL_YCRDN")->AsInteger;
- TVmsFormObject *pObj = ADesigner->AddObject((VmsObjectDrawType)nDrawType);
- if (!pObj) continue;
- //11 , ' @구간명
- //12 , ' @시점명
- //13 , ' @종점명
- //14 , ' @소통상황
- //15 , ' @통행시간
- //16 , ' @통행속도
- //17 , ' @방향
- pObj->Text = pADO->FieldByName("VMS_DSPL_TXT")->AsString.Trim();
- pObj->RunText = pObj->Text;
- String sIfscId = "";
- if (nObjType >= 11 && nObjType <= 17)
- sIfscId = FIfscId[0];
- else
- if (nObjType >= 21 && nObjType <= 27)
- sIfscId = FIfscId[1];
- else
- if (nObjType >= 31 && nObjType <= 37)
- sIfscId = FIfscId[2];
- else
- if (nObjType >= 41 && nObjType <= 47)
- sIfscId = FIfscId[3];
- if (sIfscId != "")
- {
- TVmsIfsc *pIfscObj;
- pIfscObj = VmsIfscManager->FLists.Find(sIfscId.ToIntDef(0));
- if (pIfscObj)
- {
- switch(nObjType)
- {
- case 11: case 21: case 31: case 41:
- pObj->RunText = pIfscObj->VMS_IFSC_NM;
- break;
- case 12: case 22: case 32: case 42:
- pObj->RunText = pIfscObj->DSPL_STRT_NODE_NM;
- break;
- case 13: case 23: case 33: case 43:
- pObj->RunText = pIfscObj->DSPL_END_NODE_NM;
- break;
- }
- }
- }
- pObj->ObjSeq = nObjId;
- pObj->ObjId = nObjId;
- pObj->ObjKind = sObjKind;
- pObj->Tag = pADO->FieldByName("VMS_IFSC_ID")->AsString;
- pObj->ObjType = pADO->FieldByName("VMS_FORM_OBJECT_TYPE_CD")->AsString;
- pObj->ObjSize = pADO->FieldByName("VMS_DSPL_SIZE")->AsInteger;
- pObj->BkColorCode = pADO->FieldByName("VMS_DSPL_BKCOLOR")->AsString;
- pObj->Blink = nBlinking == 1 ? true : false;
- pObj->ImageId = pADO->FieldByName("SYMBLIB_NMBR")->AsString;
- if (pObj->ObjKind == OBJKIND_TEXT) // 문자열
- {
- int nFontBold = pADO->FieldByName("VMS_FONT_STYL_CD")->AsInteger;
- pObj->FontName = pADO->FieldByName("VMS_FONT_SHPE_NM")->AsString;
- pObj->FontNameCode = pADO->FieldByName("VMS_FONT_TYPE_CD")->AsString;
- pObj->FontColorCode = pADO->FieldByName("VMS_FONT_HUE_CD")->AsString;
- pObj->FontSize = pADO->FieldByName("VMS_FONT_SIZE")->AsInteger;
- pObj->FontBold = nFontBold == 1 ? true : false;
- pObj->TextAlign = pADO->FieldByName("VMS_FONT_ALIGN")->AsInteger;
- pObj->SetSize(pADO->FieldByName("VMS_DSPL_WIDTH")->AsInteger, pADO->FieldByName("VMS_DSPL_HEIGHT")->AsInteger);
- pObj->SetRuntimeText(pObj->RunText);
- }
- else //if (sObjKind == "1" || sObjKind == "2") // 이미지(1), 이미지 ID(2)
- {
- if (pObj->ObjKind == OBJKIND_IMAGEID)
- {
- pObj->Text = pADO->FieldByName("SYMBLIB_NMBR")->AsString;
- }
- TStream *pStream = NULL;
- pStream = pADO->CreateBlobStream(pADO->FieldByName("VMS_DSPL_FIGR"), bmRead);
- try
- {
- if (pStream && pStream->Size > 0)
- {
- Graphics::TBitmap *Bitmap = pObj->GetBitmap();
- pStream->Position = 0;
- Bitmap->LoadFromStream(pStream);
- pObj->SetSize(Bitmap->Width, Bitmap->Height);
- }
- }
- __finally
- {
- SAFE_DELETE(pStream);
- }
- }
- pObj->SetPos(nPosX, nPosY);
- pObj->Show();
- pObj->BringToFront();
- }
- }
- catch(EDatabaseError &E)
- {
- DBERRORMSG("VMS폼객체조회", String(E.ClassName()), E.Message, sQry);
- throw Exception(String(E.ClassName()) + E.Message);
- }
- catch(Exception &exception)
- {
- DBERRORMSG("VMS폼객체조회", String(exception.ClassName()), exception.Message, sQry);
- throw Exception(String(exception.ClassName()) + exception.Message);
- }
- }
- __finally
- {
- if (pADO)
- {
- pADO->Close();
- delete pADO;
- }
- }
- }
- //---------------------------------------------------------------------------
- void __fastcall TVMSM810M::FormClear()
- {
- FSelIdx = -1;
- EdFormId->Clear();
- EdObjId->Clear();
- FNewDb = false;
- }
- //---------------------------------------------------------------------------
- void __fastcall TVMSM810M::DispObjectListData()
- {
- TcxGridDataController *pGDC = TvObjList->DataController;
- int nRow;
- TVmsFormObject *pObj;
- int nObjCnt = m_pEdtDesigner->GetObjectCount();
- for(int ii = 0; ii < nObjCnt; ii++)
- {
- pObj = m_pEdtDesigner->GetObject(ii);
- if (pObj)
- {
- if (pObj->ObjType.ToIntDef(0) == 91) //@축통행시간(고정)
- {
- nRow = pGDC->AppendRecord();
- pGDC->Values[nRow][ColObj01->Index] = "15";
- pGDC->Values[nRow][ColObj02->Index] = "축통생시간(고정)";
- pGDC->Values[nRow][ColObj03->Index] = String(pObj->ObjSeq);
- AddTrafficTypeObject(nRow, pObj->Tag);
- }
- else
- if (pObj->ObjType.ToIntDef(0) == 92) //@축소통상황(고정)
- {
- nRow = pGDC->AppendRecord();
- pGDC->Values[nRow][ColObj01->Index] = "15";
- pGDC->Values[nRow][ColObj02->Index] = "소통상황(고정)";
- pGDC->Values[nRow][ColObj03->Index] = String(pObj->ObjSeq);
- AddTrafficTypeObject(nRow, pObj->Tag);
- }
- }
- }
- }
- //---------------------------------------------------------------------------
- void __fastcall TVMSM810M::TvObjListFocusedRecordChanged(TcxCustomGridTableView *Sender,
- TcxCustomGridRecord *APrevFocusedRecord, TcxCustomGridRecord *AFocusedRecord,
- bool ANewItemRecordFocusingChanged)
- {
- if (TvObjList->ViewData->RecordCount <= 0) return;
- if (TvObjList->DataController->FocusedRowIndex < 0) return;
- m_pEdtDesigner->SelectedObjectAll(false);
- TcxDataController *pGDC = TvObjList->DataController;
- int nIndex = pGDC->FocusedRecordIndex;
- String sFormType = pGDC->Values[nIndex][ColObj01->Index];
- int nFormType = sFormType.ToIntDef(0);
- if (nFormType == 11 || nFormType == 12 || nFormType == 13 || nFormType == 14)
- {
- BtnListAdd->Enabled = true;
- BtnListDelete->Enabled = true;
- }
- else
- {
- BtnListAdd->Enabled = true;
- BtnListDelete->Enabled = true;
- }
- if (nFormType == 15)
- {
- int nObjSeq = VarToStr(pGDC->Values[nIndex][ColObj03->Index]).ToIntDef(0);
- m_pEdtDesigner->SelectObject(nObjSeq);
- return;
- }
- TVmsFormObject *pObj;
- int nObjCnt = m_pEdtDesigner->GetObjectCount();
- for(int ii = 0; ii < nObjCnt; ii++)
- {
- pObj = m_pEdtDesigner->GetObject(ii);
- if (!pObj) continue;
- int nObjType = pObj->ObjType.ToIntDef(0);
- switch(nFormType)
- {
- case 11:// ' 소통상황(1단)
- //@구간명, @시점명, @종점명
- if (nObjType >= 11 && nObjType <= 17)
- {
- m_pEdtDesigner->SelectObject(pObj->ObjSeq, true);
- }
- break;
- case 12:// ' 소통상황(2단)
- if (nObjType >= 21 && nObjType <= 27)
- {
- m_pEdtDesigner->SelectObject(pObj->ObjSeq, true);
- }
- break;
- case 13:// ' 소통상황(3단)
- if (nObjType >= 31 && nObjType <= 37)
- {
- m_pEdtDesigner->SelectObject(pObj->ObjSeq, true);
- }
- break;
- case 14:// ' 소통상황(4단)
- if (nObjType >= 41 && nObjType <= 47)
- {
- m_pEdtDesigner->SelectObject(pObj->ObjSeq, true);
- }
- break;
- default:
- break;
- }
- }
- }
- //---------------------------------------------------------------------------
- void __fastcall TVMSM810M::BtnListAddClick(TObject *Sender)
- {
- int nCellIdx = CMM_GetRecordIndex(TvObjList);
- if (nCellIdx < 0) return;
- int nIfscIdx = CMM_GetRecordIndex(TvAxis);
- if (nIfscIdx < 0) return;
- TcxGridDataController *pDcCell = TvObjList->DataController;
- TcxGridDataController *pDcIfsc = TvAxis->DataController;
- pDcCell->Values[nCellIdx][ColIfscId->Index] = pDcIfsc->Values[nIfscIdx][Col01->Index];
- pDcCell->Values[nCellIdx][ColIfscNm->Index] = pDcIfsc->Values[nIfscIdx][Col02->Index];
- pDcCell->Values[nCellIdx][ColIfscStr->Index] = pDcIfsc->Values[nIfscIdx][Col03->Index];
- pDcCell->Values[nCellIdx][ColIfscEnd->Index] = pDcIfsc->Values[nIfscIdx][Col04->Index];
- TVmsFormObject *pObj;
- int nObjCnt = m_pEdtDesigner->GetObjectCount();
- for(int ii = 0; ii < nObjCnt; ii++)
- {
- pObj = m_pEdtDesigner->GetObject(ii);
- if (!pObj) continue;
- if (!pObj->Selected) continue;
- int nObjType = pObj->ObjType.ToIntDef(0);
- switch(nObjType)
- {
- case 11: case 21: case 31: case 41:
- pObj->RunText = VarToStr(pDcCell->Values[nCellIdx][ColIfscNm->Index]);
- pObj->SetRuntimeText(pObj->RunText);
- break;
- case 12: case 22: case 32: case 42:
- pObj->RunText = VarToStr(pDcCell->Values[nCellIdx][ColIfscStr->Index]);
- pObj->SetRuntimeText(pObj->RunText);
- break;
- case 13: case 23: case 33: case 43:
- pObj->RunText = VarToStr(pDcCell->Values[nCellIdx][ColIfscEnd->Index]);
- pObj->SetRuntimeText(pObj->RunText);
- break;
- }
- }
- }
- //---------------------------------------------------------------------------
- void __fastcall TVMSM810M::BtnListDeleteClick(TObject *Sender)
- {
- int nCellIdx = CMM_GetRecordIndex(TvObjList);
- if (nCellIdx < 0) return;
- TcxGridDataController *pDcCell = TvObjList->DataController;
- pDcCell->Values[nCellIdx][ColIfscId->Index] = "";
- pDcCell->Values[nCellIdx][ColIfscNm->Index] = "";
- pDcCell->Values[nCellIdx][ColIfscStr->Index] = "";
- pDcCell->Values[nCellIdx][ColIfscEnd->Index] = "";
- TVmsFormObject *pObj;
- int nObjCnt = m_pEdtDesigner->GetObjectCount();
- for(int ii = 0; ii < nObjCnt; ii++)
- {
- pObj = m_pEdtDesigner->GetObject(ii);
- if (!pObj) continue;
- if (!pObj->Selected) continue;
- int nObjType = pObj->ObjType.ToIntDef(0);
- switch(nObjType)
- {
- case 11: case 21: case 31: case 41:
- pObj->SetRuntimeText(pObj->Text);
- break;
- case 12: case 22: case 32: case 42:
- pObj->SetRuntimeText(pObj->Text);
- break;
- case 13: case 23: case 33: case 43:
- pObj->SetRuntimeText(pObj->Text);
- break;
- }
- }
- }
- //---------------------------------------------------------------------------
- void __fastcall TVMSM810M::BtnSaveClick(TObject *Sender)
- {
- TcxDataController *pGDC = TvObjList->DataController;
- #if 0
- FIfscId[0] = "";
- FIfscId[1] = "";
- FIfscId[2] = "";
- FIfscId[3] = "";
- #endif
- try
- {
- TvObjList->BeginUpdate();
- pGDC->BeginUpdate();
- int nRows = pGDC->RecordCount;
- try
- {
- for (int ii = 0; ii < nRows; ii++)
- {
- int nFormType = VarToStr(pGDC->Values[ii][ColObj01->Index]).ToIntDef(0);
- switch(nFormType)
- {
- case 11:// ' 소통상황(1단)
- FIfscId[0] = VarToStr(pGDC->Values[ii][ColIfscId->Index]);
- break;
- case 12:// ' 소통상황(2단)
- FIfscId[1] = VarToStr(pGDC->Values[ii][ColIfscId->Index]);
- break;
- case 13:// ' 소통상황(3단)
- FIfscId[2] = VarToStr(pGDC->Values[ii][ColIfscId->Index]);
- break;
- case 14:// ' 소통상황(4단)
- FIfscId[3] = VarToStr(pGDC->Values[ii][ColIfscId->Index]);
- break;
- }
- }
- }
- catch(Exception &e)
- {
- }
- }
- __finally
- {
- pGDC->EndUpdate();
- TvObjList->EndUpdate();
- }
- m_pEdtDesigner->GetVmsFormImage(ImgForm);
- FSelected = true;
- Close();
- }
- //---------------------------------------------------------------------------
|