123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235 |
- //---------------------------------------------------------------------------
- #include <vcl.h>
- #include "ITSSkinF.h"
- #include "ITSUtilF.h"
- #include "CDSProcessF.h"
- #include "FrmResourceF.h"
- #include "ITSLangTransF.h"
- #pragma hdrstop
- #include "FRAME_ProcessStatusListF.h"
- //---------------------------------------------------------------------------
- #pragma package(smart_init)
- #pragma link "cxClasses"
- #pragma link "cxControls"
- #pragma link "cxCustomData"
- #pragma link "cxData"
- #pragma link "cxDataStorage"
- #pragma link "cxEdit"
- #pragma link "cxFilter"
- #pragma link "cxGraphics"
- #pragma link "cxGrid"
- #pragma link "cxGridCustomTableView"
- #pragma link "cxGridCustomView"
- #pragma link "cxGridLevel"
- #pragma link "cxGridTableView"
- #pragma link "cxLookAndFeelPainters"
- #pragma link "cxLookAndFeels"
- #pragma link "cxStyles"
- #pragma link "cxTextEdit"
- #pragma link "dxSkinBlack"
- #pragma link "dxSkinBlue"
- #pragma link "dxSkinsCore"
- #pragma link "dxSkinscxPCPainter"
- #pragma resource "*.dfm"
- //TFRAMEProcessStatusList *FRAMEProcessStatusList;
- //---------------------------------------------------------------------------
- __fastcall TFRAMEProcessStatusList::TFRAMEProcessStatusList(TComponent* Owner)
- : TFrame(Owner)
- {
- LangTrans->Translate(this, ITSDb_GetConnection());
- m_pGDC = TvList->DataController;
- TvList->OptionsView->NoDataToDisplayInfoText = FrmLang->lblNoInfo->Caption;//"<프로세스 정보가 없습니다>";
- FCodeCMS = ItsCodeManager->FLists.Find("CMS");
- FCodeCDS = ItsCodeManager->FLists.Find("CDS");
- }
- //---------------------------------------------------------------------------
- void __fastcall TFRAMEProcessStatusList::UpdateList()
- {
- CMM_ClearGridTableView(TvList);
- int nRow = 0;
- try
- {
- TvList->BeginUpdate();
- TItsSubCode *pSubCode;
- try
- {
- ItsProcessManager->FLists.Lock();
- FOR_STL(TItsProcess*, pObj, ItsProcessManager->FLists)
- {
- pObj->FGridIndex = -1;
- if (pObj->DEL_YN == "Y") continue;
- if (pObj->STTS_DSPL_YN == "N") continue;
- nRow = m_pGDC->AppendRecord();
- pObj->FGridIndex = nRow;
- #if 0
- String sCMS = pObj->CommStatus;
- if (FCodeCMS)
- {
- pSubCode = FCodeCMS->FSubLists.Find(sCMS);
- if (pSubCode) sCMS = pSubCode->CMMN_CD_KOR_NM;
- }
- String sCDS = pObj->DoorStatus;
- if (FCodeCDS)
- {
- pSubCode = FCodeCDS->FSubLists.Find(sCDS);
- if (pSubCode) sCDS = pSubCode->CMMN_CD_KOR_NM;
- }
- #endif
- m_pGDC->Values[nRow][Column00->Index] = pObj->SYST_TYPE;
- m_pGDC->Values[nRow][Column01->Index] = pObj->SYST_NM;
- m_pGDC->Values[nRow][Column02->Index] = pObj->SYST_ID;
- m_pGDC->Values[nRow][Column03->Index] = pObj->CommStatus;
- m_pGDC->Values[nRow][Column04->Index] = pObj->CommStatus;
- //m_pGDC->Values[nRow][Column99->Index] = 0;
- }
- }
- __finally
- {
- ItsProcessManager->FLists.UnLock();
- }
- }
- __finally
- {
- TvList->EndUpdate();
- }
- }
- //---------------------------------------------------------------------------
- void __fastcall TFRAMEProcessStatusList::RefreshList()
- {
- int nRow = 0;
- try
- {
- int nTotalRows = m_pGDC->RecordCount;
- TvList->BeginUpdate();
- TItsSubCode *pSubCode;
- try
- {
- ItsProcessManager->FLists.Lock();
- FOR_STL(TItsProcess*, pObj, ItsProcessManager->FLists)
- {
- if (pObj->DEL_YN == "Y") continue;
- if (pObj->STTS_DSPL_YN == "N") continue;
- if (pObj->FGridIndex < 0) continue;
- nRow = pObj->FGridIndex;
- #if 0
- String sCMS = pObj->CommStatus;
- if (FCodeCMS)
- {
- pSubCode = FCodeCMS->FSubLists.Find(sCMS);
- if (pSubCode) sCMS = pSubCode->CMMN_CD_KOR_NM;
- }
- #endif
- m_pGDC->Values[nRow][Column03->Index] = pObj->CommStatus;
- m_pGDC->Values[nRow][Column04->Index] = pObj->CommStatus;
- }
- }
- __finally
- {
- ItsProcessManager->FLists.UnLock();
- }
- }
- __finally
- {
- TvList->EndUpdate();
- }
- }
- //---------------------------------------------------------------------------
- void __fastcall TFRAMEProcessStatusList::Column03CustomDrawCell(TcxCustomGridTableView *Sender, TcxCanvas *ACanvas, TcxGridTableDataCellViewInfo *AViewInfo,
- bool &ADone)
- {
- if (AViewInfo->GridRecord->RecordIndex < 0) return;
- Graphics::TBitmap *pBmp = NULL;
- pBmp = ImgState1->Picture->Bitmap;
- if (!VarIsNull(AViewInfo->GridRecord->DisplayTexts[Column03->Index]))
- {
- String sCode = AViewInfo->GridRecord->DisplayTexts[Column03->Index];
- if (sCode == "0") pBmp = ImgState1->Picture->Bitmap;
- else if (sCode == "1") pBmp = ImgState0->Picture->Bitmap;
- else if (sCode == "2") pBmp = ImgState2->Picture->Bitmap;
- }
- if (!pBmp) return;
- pBmp->Transparent = true;
- int nW, nH;
- nW = nH = 21;
- try
- {
- TColor bBrush = ACanvas->Brush->Color;
- if (AViewInfo->GridRecord->Selected)
- {
- if (AViewInfo->GridRecord->Index % 2 == 0)
- {
- bBrush = Sender->LookAndFeelPainter->DefaultContentEvenColor();
- }
- else
- {
- bBrush = Sender->LookAndFeelPainter->DefaultContentOddColor();
- }
- }
- ACanvas->Brush->Color = bBrush;
- TRect rc;
- TRect rcOrg = AViewInfo->Bounds;
- ACanvas->FillRect(rcOrg);
- nW = rcOrg.Bottom - rcOrg.Top - 4;
- rc.Top = rcOrg.Top+2;
- rc.Bottom = rcOrg.Bottom - 2;
- rc.Left = rcOrg.Left + (rcOrg.Width() - nW) / 2;
- rc.Right = rc.Left + nW;
- ACanvas->Canvas->StretchDraw(rc, pBmp);
- //ACanvas->Draw(AViewInfo->ContentBounds.Left, AViewInfo->ContentBounds.Top, pBmp);
- ADone = true;
- }
- catch(...) {}
- }
- //---------------------------------------------------------------------------
- void __fastcall TFRAMEProcessStatusList::TvListCustomDrawCell(TcxCustomGridTableView *Sender, TcxCanvas *ACanvas, TcxGridTableDataCellViewInfo *AViewInfo,
- bool &ADone)
- {
- //OptionsSelection.InvertSelect = False
- //OptionsView.FocusRect = False
- if (AViewInfo->GridRecord->Selected)
- {
- //ACanvas->Brush->Color = Sender->LookAndFeelPainter->DefaultContentColor();
- //ACanvas->Font->Color = Sender->LookAndFeelPainter->DefaultContentTextColor();
- if (AViewInfo->GridRecord->Index % 2 == 0)
- {
- ACanvas->Brush->Color = Sender->LookAndFeelPainter->DefaultContentEvenColor();
- ACanvas->Font->Color = Sender->LookAndFeelPainter->DefaultContentTextColor();
- }
- else
- {
- ACanvas->Brush->Color = Sender->LookAndFeelPainter->DefaultContentOddColor();
- ACanvas->Font->Color = Sender->LookAndFeelPainter->DefaultContentTextColor();
- }
- }
- else
- {
- }
- }
- //---------------------------------------------------------------------------
|