//--------------------------------------------------------------------------- #include #include "AppGlobalF.h" #include "ITSSkinF.h" #include "ITSUtilF.h" #include "CenterCommF.h" #include "WindowMsgF.h" #pragma hdrstop #include "VMSFORM0F.h" //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma link "cxContainer" #pragma link "cxControls" #pragma link "cxEdit" #pragma link "cxGraphics" #pragma link "cxGroupBox" #pragma link "cxLookAndFeelPainters" #pragma link "cxLookAndFeels" #pragma link "dxSkinBlack" #pragma link "dxSkinMcSkin" #pragma link "dxSkinsCore" #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 "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 "dxSkinSeven" #pragma link "dxSkinSharp" #pragma link "dxSkinSilver" #pragma link "dxSkinStardust" #pragma link "cxLabel" #pragma link "FFBaseComponent" #pragma link "FFBasePlay" #pragma link "FFPlay" #pragma link "FRAME_VmsStatusF" #pragma resource "*.dfm" #define WIDTH_GAP 3 #define HEIGHT_GAP 3 #define LICENSE_KEY "FSXXXXXX-XXXXXXXX-XXXXXXXX-XXXXXXXX-XXXXXXXX" //TVMSFORM0 *VMSFORM0 = NULL; //--------------------------------------------------------------------------- __fastcall TVMSFORM0::TVMSFORM0(TComponent* Owner, TVmsCtlr *AVmsObj) : TForm(Owner) { FVmsObj = AVmsObj; FScrollBox = NULL; FSelected = false; FDisplayMode = 0; FZoomRate = 1.0; FVmsDispIndex = 0; FLcsDispIndex = 0; FPlay = false; FWndParent = NULL; FZoomView = false; PnlForm->ParentColor = false; PnlForm->Color = clBtnFace; PnlLcsForm->ParentColor = false; PnlLcsForm->Color = clBtnFace; FDispW = FVmsObj->WIDTH; FDispH = FVmsObj->HEIGHT; //PnlName->Caption = "[" + FVmsObj->VMS_CTLR_ID + "] " + FVmsObj->VMS_NM; PnlName->Caption = FVmsObj->VMS_NM; PnlName->Hint = (FVmsObj->VMS_CTLR_ID) + " [" + FVmsObj->VMS_CTLR_ID + "] \r\n" + FVmsObj->VMS_NM; FGapW = 16; FGapH = 8; PnlForm->Align = alCustom; //PnlForm->Anchors = TAnchors() >> akLeft >> akTop >> akRight >> akBottom; PnlForm->Anchors = TAnchors() >> akLeft >> akRight >> akBottom; PnlForm->Left = 0; PnlForm->Top = 0; //PnlLcsForm->Align = alCustom; //PnlLcsForm->Anchors = TAnchors() >> akLeft >> akTop >> akRight >> akBottom; //PnlLcsForm->Anchors = TAnchors() >> akTop >> akRight >> akBottom; PnlLcsForm->Visible = false; //PnlForm->Locked = true; ImgState1->Parent = ImgState0->Parent; ImgState2->Parent = ImgState0->Parent; ImgState1->Left = ImgState0->Left; ImgState1->Top = ImgState0->Top; ImgState2->Left = ImgState0->Left; ImgState2->Top = ImgState0->Top; ImgState1->Visible = false; ImgState2->Visible = false; LoadLocalSkin(); String sAVILibDir = g_sAppDir + "LibAV"; FFPlayer1->SetLicenseKey(LICENSE_KEY); FFPlayer1->DisableFPUExceptions(); if (!FFPlayer1->LoadAVLib(sAVILibDir)) { #if 0 if (g_AppCfg.sLang != "kr") Application->MessageBox(L"Stream display library load failed.", L"Stream display fail", MB_OK|MB_ICONERROR|MB_APPLMODAL); else Application->MessageBox(L"¿µ»óÇ¥Ãâ ¶óÀ̺귯¸®¸¦ ·ÎµåÇÏÁö ¸øÇÏ¿´½À´Ï´Ù.", L"¿µ»óÇ¥Ãâ ¿À·ù", MB_OK|MB_ICONERROR|MB_APPLMODAL); #endif } if (FVmsObj != NULL) { PopupMenu = PopupMenu2; } } //--------------------------------------------------------------------------- void __fastcall TVMSFORM0::LoadLocalSkin() { PnlMain->ParentColor = false; PnlMain->Color = clBtnFace; PnlForm->ParentColor = false; PnlForm->Color = clBlack; PnlLcsForm->ParentColor = false; PnlLcsForm->Color = clBlack; FRAME_VmsStatus1->LoadLocalSkin(); } //--------------------------------------------------------------------------- void __fastcall TVMSFORM0::FormDestroy(TObject *Sender) { TmrVmsDisp->Enabled = false; TmrLcsDisp->Enabled = false; } //--------------------------------------------------------------------------- void __fastcall TVMSFORM0::FormShow(TObject *Sender) { TmrShow->Enabled = true; RefreshVmsStatus(); } //--------------------------------------------------------------------------- void __fastcall TVMSFORM0::SetFormSizeFitWindow(int AFormW/* = 0 */, float AZoomRate/* = 1.0*/) { Width = 315; Height= 300; PnFormBack->Width = Width - 5; int nDispW = 306; // ImgForm->Width; int nDispH = 229; int nLcsDispH = 28; int nLcsDispW = 0; float fZoomRate = 1.0; if (FVmsObj->FLcsInfo != NULL) { PnlLcsForm->Visible = true; if (FVmsObj->FLcsInfo->HEIGHT > nLcsDispH) { fZoomRate = (float)nLcsDispH / (float)FVmsObj->FLcsInfo->HEIGHT; } else { fZoomRate = (float)FVmsObj->FLcsInfo->HEIGHT / (float)nLcsDispH; } nLcsDispW = (int)(fZoomRate * (float)FVmsObj->FLcsInfo->WIDTH); PnlLcsFormTemp->Width = nLcsDispW + (2+2); //PnlLcsForm->Height = nLcsDispH + (2+2); ImgLcsForm->Width = nLcsDispW; ImgLcsForm->Height= nLcsDispH; ImgLcsForm->Picture->Bitmap->Width = ImgLcsForm->Width; ImgLcsForm->Picture->Bitmap->Height = ImgLcsForm->Height; APP_ImageClear(ImgLcsForm->Canvas, 0, 0, ImgLcsForm->Width, ImgLcsForm->Height, clBlack); nDispH = nDispH - PnlLcsForm->Height; } else { PnlLcsForm->Visible = false; } fZoomRate = 1.0; if (FVmsObj->WIDTH > nDispW) { float fTempZoomRate = (float)nDispW / (float)FVmsObj->WIDTH; if (fZoomRate > fTempZoomRate) { fZoomRate = fTempZoomRate; } } if (FVmsObj->HEIGHT > nDispH) { float fTempZoomRate = (float)nDispH / (float)FVmsObj->HEIGHT; if (fZoomRate > fTempZoomRate) { fZoomRate = fTempZoomRate; } } if (fZoomRate == 1.0) { // Å©±â¸¦ 2¹è·Î ÇØµµ È­¸éÅ©±âº¸´Ù ÀÛÀ¸¸é ½ÃÀμºÀ» À§ÇØ Å©±â¸¦ 2¹è ´Ã·ÁÁØ´Ù. if (nDispW > (FVmsObj->WIDTH * 2) && nDispH > (FVmsObj->HEIGHT * 2)) { fZoomRate = 2.0; } } FDispW = (int)(fZoomRate * (float)FVmsObj->WIDTH); FDispH = (int)(fZoomRate * (float)FVmsObj->HEIGHT); try { LockWindowUpdate(Handle); PnlForm->Width = FDispW + (2+2); PnlForm->Height = FDispH + (2+2); PnlForm->Left = (PnFormBack->Width - PnlForm->Width) / 2; //PnlForm->Top = 0;//(PnFormBack->Height - PnlForm->Height) / 2; PnlForm->Visible = true; ImgForm->Left = 2; ImgForm->Top = 2; ImgForm->Width = FDispW; ImgForm->Height= FDispH; ImgForm->Picture->Bitmap->Width = ImgForm->Width; ImgForm->Picture->Bitmap->Height = ImgForm->Height; APP_ImageClear(ImgForm->Canvas, 0, 0, ImgForm->Width, ImgForm->Height, clBlack); } __finally { LockWindowUpdate(0); } } //--------------------------------------------------------------------------- void __fastcall TVMSFORM0::SetFormSize(int AFormW/* = 0 */, float AZoomRate/* = 1.0*/) { //Ç¥ÃâµÇ´Â È­¸éÀº ³ÐÀÌ 370À¸·Î ¼³Á¤, 1920 ¿¡¼­ ÃÖ´ë 5°³ VMS Ç¥ÃâµÇ°Ô... // 480 À» ±âÁØÀ¸·Î ÀÛÀ¸¸é È®´ë, Å©¸é ¿ø·¡ È­¸éÀ¸·Î º¸°Ô ÇÏÀÚ. // ij³ëÇǸ¸ 0.7 Å©±â·Î Ç¥ÃâµÇ°Ô //Width = 378; //PnFormBack->Width = Width - 5; int nMinFormH = 164; int nDispW = 369; int nDispH = nMinFormH - PnlTitle->Height - PnlBottom->Height; // ÃÖ¼Ò ³ôÀÌ --> È­¸éº¸±â ÁÁ°Ô ¸ÂÃßÀÚ... int nLcsDispH = 28; int nLcsDispW = 0; float fZoomRate = 1.0; if (FVmsObj->FLcsInfo != NULL) { PnlLcsForm->Visible = true; if (FVmsObj->FLcsInfo->HEIGHT > nLcsDispH) { fZoomRate = (float)nLcsDispH / (float)FVmsObj->FLcsInfo->HEIGHT; } else { fZoomRate = (float)FVmsObj->FLcsInfo->HEIGHT / (float)nLcsDispH; } nLcsDispW = (int)(fZoomRate * (float)FVmsObj->FLcsInfo->WIDTH); PnlLcsFormTemp->Width = nLcsDispW + (2+2); //PnlLcsForm->Height = nLcsDispH + (2+2); ImgLcsForm->Width = nLcsDispW; ImgLcsForm->Height= nLcsDispH; ImgLcsForm->Picture->Bitmap->Width = ImgLcsForm->Width; ImgLcsForm->Picture->Bitmap->Height = ImgLcsForm->Height; APP_ImageClear(ImgLcsForm->Canvas, 0, 0, ImgLcsForm->Width, ImgLcsForm->Height, clBlack); } else { PnlLcsForm->Visible = false; } fZoomRate = 1.0; if (FVmsObj->WIDTH > nDispW) { fZoomRate = (float)nDispW / (float)FVmsObj->WIDTH; //if (fZoomRate > fTempZoomRate) { // fZoomRate = fTempZoomRate; //} } if (fZoomRate == 1.0) { // Å©±â¸¦ 2¹è·Î ÇØµµ È­¸éÅ©±âº¸´Ù ÀÛÀ¸¸é ½ÃÀμºÀ» À§ÇØ Å©±â¸¦ 2¹è ´Ã·ÁÁØ´Ù. if (nDispW > (FVmsObj->WIDTH * 2)) { fZoomRate = 2.0; } } FDispW = (int)(fZoomRate * (float)FVmsObj->WIDTH); FDispH = (int)(fZoomRate * (float)FVmsObj->HEIGHT); if (fZoomRate < 0.43) { fZoomRate = 0.43; // ij³ëÇÇ FDispW = (int)(fZoomRate * (float)FVmsObj->WIDTH); FDispH = (int)(fZoomRate * (float)FVmsObj->HEIGHT); nDispW = FDispW; } //if (FDispW < nDispW) { // FDispW = nDispW; //} int nFormW = nDispW + (3+3); int nFormH = FDispH + (3+3) + PnlTitle->Height + PnlBottom->Height; if (FVmsObj->FLcsInfo != NULL) { nFormH = nFormH + PnlLcsForm->Height; } if (nFormH < 164) { nFormH = 164; } try { LockWindowUpdate(Handle); Width = nFormW; Height = nFormH; PnFormBack->Width = Width - 5; PnFormBack->Height = Height - PnlTitle->Height - PnlBottom->Height; PnlForm->Width = FDispW + (2+2); PnlForm->Height = FDispH + (2+2); PnlForm->Left = (PnFormBack->Width - PnlForm->Width) / 2; //PnlForm->Top = 0;//(PnFormBack->Height - PnlForm->Height) / 2; PnlForm->Visible = true; ImgForm->Left = 2; ImgForm->Top = 2; ImgForm->Width = FDispW; ImgForm->Height= FDispH; ImgForm->Picture->Bitmap->Width = ImgForm->Width; ImgForm->Picture->Bitmap->Height = ImgForm->Height; APP_ImageClear(ImgForm->Canvas, 0, 0, ImgForm->Width, ImgForm->Height, clBlack); } __finally { LockWindowUpdate(0); } } //--------------------------------------------------------------------------- void __fastcall TVMSFORM0::SetFormSizeOrg(int AFormW/* = 0 */, float AZoomRate/* = 1.0*/) { //384*64, 2´Ü12¿­ ±âÁØÀ¸·Î //Ç¥ÃâµÇ´Â È­¸éÀº ³ÐÀÌ 370À¸·Î ¼³Á¤, 1920 ¿¡¼­ ÃÖ´ë 5°³ VMS Ç¥ÃâµÇ°Ô... int DispW = 370; int MaxW = VmsCtlrManager->FMaxWidth >= 384 ? 384 : VmsCtlrManager->FMaxWidth; if (FVmsObj->WIDTH > MaxW) { FZoomRate = ((float)DispW / (float)FVmsObj->WIDTH); } else { FZoomRate = ((float)DispW / (float)MaxW); } FDispW = FVmsObj->WIDTH * FZoomRate; FDispH = FVmsObj->HEIGHT * FZoomRate; if (FDispW > FVmsObj->WIDTH) { // ¹èÀ²ÀÌ 1.0 ÀÌ»ó ³Ñ¾î°¡¸é ¿øº»À» º¸¿©ÁÖÀÚ... È®´ëÇØ¼­ º¸¿©ÁÙ ÇÊ¿ä ¾øÀ½. //FDispW = FVmsObj->WIDTH; //FDispH = FVmsObj->HEIGHT; } int nFormW = DispW + (3+3); int nFormH = FDispH + (3+3) + PnlTitle->Height + PnlBottom->Height; try { LockWindowUpdate(Handle); Width = nFormW; Height = nFormH; PnlForm->Width = FDispW + (2+2); PnlForm->Height = FDispH + (2+2); PnlForm->Left = (PnFormBack->Width - PnlForm->Width) / 2; PnlForm->Top = (PnFormBack->Height - PnlForm->Height) / 2; PnlForm->Visible = true; ImgForm->Width = FDispW; ImgForm->Height= FDispH; ImgForm->Picture->Bitmap->Width = ImgForm->Width; ImgForm->Picture->Bitmap->Height = ImgForm->Height; APP_ImageClear(ImgForm->Canvas, 0, 0, ImgForm->Width, ImgForm->Height, clBlack); } __finally { LockWindowUpdate(0); } } //--------------------------------------------------------------------------- void __fastcall TVMSFORM0::SelectForm(bool ASelect) { FSelected = ASelect; if (ASelect) { //PopupMenu = PopupMenu1; PnlMain->ParentColor = false; PnlMain->Color = clBtnHighlight;//clBackground; this->ParentColor = false; this->Color = clRed; } else { //PopupMenu = NULL; PnlMain->ParentColor = false; PnlMain->Color = clBtnFace; this->ParentColor = true; } if (FVmsObj) { TVmsStts *Stts = FVmsObj->Stts; if (Stts->RPRS_STTS != "O") { PnlForm->Caption = "Åë½Å Offline"; if (ImgForm->Visible) { if (g_AppCfg.isDispOfflineMsg == false) { //Åë½Å¿ÀÇÁ¶óÀνà ¸Þ½ÃÁö Ç¥ÃâÀ» ÇÏÁö ¾ÊÀ» °æ¿ì ImgForm->Visible = false; } } } else { PnlForm->Caption = "Ç¥ÃâÁ¤º¸°¡ ¾ø½À´Ï´Ù."; if (ImgForm->Visible == false) { ImgForm->Visible = true; } } } } //--------------------------------------------------------------------------- void __fastcall TVMSFORM0::TmrShowTimer(TObject *Sender) { TmrShow->Enabled = false; PopupMenu = NULL; if (!FVmsObj) { PnlName->Caption = "VMS"; ImgForm->Visible = false; PnlLcsForm->Visible = false; ImgLcsForm->Visible = false; } else { PopupMenu = PopupMenu2; } RefreshVmsStatus(); //TmrVmsDisp->Enabled = true; //TmrLcsDisp->Enabled = true; } //--------------------------------------------------------------------------- void __fastcall TVMSFORM0::SetPlay(bool APlay) { FPlay = APlay; if (FPlay) { TmrVmsDisp->Enabled = false; TmrLcsDisp->Enabled = false; FVmsDispIndex = 0; FLcsDispIndex = 0; TmrVmsDisp->Interval = 300; TmrVmsDisp->Enabled = true; TmrLcsDisp->Interval = 300; TmrLcsDisp->Enabled = true; } else { TmrVmsDisp->Enabled = false; TmrLcsDisp->Enabled = false; } } //--------------------------------------------------------------------------- void __fastcall TVMSFORM0::TmrLcsDispTimer(TObject *Sender) { // LCS Message int nDispTime = 1000; TCanvas *pCanvas = ImgLcsForm->Canvas; TLcsCtlr *pLcsCtlr = FVmsObj->FLcsInfo; try { TmrLcsDisp->Enabled = false; if (pLcsCtlr == NULL) { return; } pLcsCtlr->Lock(); pCanvas->Lock(); try { if (pLcsCtlr->FVmsMsg->Total == 0) { if (pLcsCtlr->FVmsMsg->IsLoading) { return; } ImgLcsForm->Visible = false; FLcsDispIndex = 0; return; } if (ImgLcsForm->Visible == false) ImgLcsForm->Visible = true; if (FLcsDispIndex >= pLcsCtlr->FVmsMsg->Total || FLcsDispIndex >= INT_VMS_MAX_FORM) { FLcsDispIndex = 0; } VMS_PHASE *pVmsPhase = &pLcsCtlr->FVmsMsg->PHASE[FLcsDispIndex]; nDispTime = pVmsPhase->DSPL_HR * 1000; //if (nDispTime > 5000) nDispTime = 5000; if (FPlay == false) { return; } Graphics::TBitmap *pBitmap = pVmsPhase->DSPL_PICT; if (pBitmap) { try { SetStretchBltMode(ImgLcsForm->Canvas->Handle, MAXSTRETCHBLTMODE);//HALFTONE);//MAXSTRETCHBLTMODE)//STRETCH_HALFTONE; ImgLcsForm->Canvas->CopyRect(Classes::Rect(0, 0, ImgLcsForm->Width, ImgLcsForm->Height), pBitmap->Canvas, Classes::Rect(0, 0, pBitmap->Width, pBitmap->Height)); } catch(Exception &e) { } } } catch(...) {} } __finally { if (pLcsCtlr) { pLcsCtlr->UnLock(); } ImgLcsForm->Refresh(); pCanvas->Unlock(); FLcsDispIndex++; TmrLcsDisp->Interval = nDispTime; TmrLcsDisp->Enabled = true; } } //--------------------------------------------------------------------------- void __fastcall TVMSFORM0::TmrVmsDispTimer(TObject *Sender) { int nDispTime = 1000; TCanvas *pCanvas = ImgForm->Canvas; try { TmrVmsDisp->Enabled = false; TmrTicker->Enabled = false; LblTicker->Caption = " - "; if (FFPlayer1->ScreenHandle != NULL) { FFPlayer1->Stop(true); PostMessage(FFPlayer1->ScreenHandle, CM_INVALIDATE, 0, 0); UpdateWindow(FFPlayer1->ScreenHandle); FFPlayer1->ScreenHandle = NULL; ImgForm->Visible = true; } FVmsObj->Lock(); pCanvas->Lock(); try { if (FVmsObj->FVmsMsg->Total == 0) { if (FVmsObj->FVmsMsg->IsLoading) { return; } PnlSeq->Caption = "0/0"; ImgForm->Visible = false; FVmsDispIndex = 0; PnlSvcTime->Caption = "Á¦°ø½Ã°¢: -"; return; } if (ImgForm->Visible == false) ImgForm->Visible = true; if (FVmsDispIndex >= FVmsObj->FVmsMsg->Total || FVmsDispIndex >= INT_VMS_MAX_FORM) { FVmsDispIndex = 0; } VMS_PHASE *pVmsPhase = &FVmsObj->FVmsMsg->PHASE[FVmsDispIndex]; FCycle = pVmsPhase->DSPL_HR; nDispTime = FCycle * 1000; //if (nDispTime > 5000) nDispTime = 5000; if (FPlay == false) { return; } PnlSvcTime->Caption = "Á¦°ø½Ã°¢: " + pVmsPhase->PROV_DT_FMT; PnlSvcTime->Font->Color = pVmsPhase->PROV_YN == "Y" ? clNavy : clRed; PnlSeq->Caption = String(FVmsDispIndex+1) + "/" + String(FVmsObj->FVmsMsg->Total); Graphics::TBitmap *pBitmap = pVmsPhase->DSPL_PICT; if (pBitmap) { try { SetStretchBltMode(ImgForm->Canvas->Handle, MAXSTRETCHBLTMODE);//HALFTONE);//MAXSTRETCHBLTMODE)//STRETCH_HALFTONE; ImgForm->Canvas->CopyRect(Classes::Rect(0, 0, ImgForm->Width, ImgForm->Height), pBitmap->Canvas, Classes::Rect(0, 0, pBitmap->Width, pBitmap->Height)); } catch(Exception &e) { } } } catch(...) {} } __finally { FVmsObj->UnLock(); ImgForm->Refresh(); pCanvas->Unlock(); FVmsDispIndex++; LblTicker->Caption = " " + String(FCycle) + " "; TmrTicker->Enabled = true; TmrVmsDisp->Interval = nDispTime; TmrVmsDisp->Enabled = true; } } //--------------------------------------------------------------------------- void __fastcall TVMSFORM0::TmrTickerTimer(TObject *Sender) { TmrTicker->Enabled = false; FCycle--; LblTicker->Caption = " " + String(FCycle) + " "; if (FCycle > 0) TmrTicker->Enabled = true; } //--------------------------------------------------------------------------- void __fastcall TVMSFORM0::FormClose(TObject *Sender, TCloseAction &Action) { TmrVmsDisp->Enabled = false; TmrLcsDisp->Enabled = false; TmrTicker->Enabled = false; if (FFPlayer1->ScreenHandle != NULL) { FFPlayer1->Stop(true); PostMessage(FFPlayer1->ScreenHandle, CM_INVALIDATE, 0, 0); UpdateWindow(FFPlayer1->ScreenHandle); FFPlayer1->ScreenHandle = NULL; } } //--------------------------------------------------------------------------- void __fastcall TVMSFORM0::OnFormClick(TObject *Sender) { if (FScrollBox) FScrollBox->SetFocus(); } //--------------------------------------------------------------------------- void __fastcall TVMSFORM0::RefreshVmsMessage() { TmrVmsDisp->Enabled = false; FVmsDispIndex = 0; TmrVmsDisp->Interval= 300; TmrVmsDisp->Enabled = true; TmrLcsDisp->Enabled = false; FLcsDispIndex = 0; TmrLcsDisp->Interval= 300; TmrLcsDisp->Enabled = true; } //--------------------------------------------------------------------------- void __fastcall TVMSFORM0::RefreshVmsStatus() { if (FVmsObj->Stts->RPRS_STTS == "O") { if (!ImgState0->Visible) ImgState0->Visible = true; if ( ImgState1->Visible) ImgState1->Visible = false; if ( ImgState2->Visible) ImgState2->Visible = false; } else if (FVmsObj->Stts->RPRS_STTS == "X") { if ( ImgState0->Visible) ImgState0->Visible = false; //false if (!ImgState1->Visible) ImgState1->Visible = true; if ( ImgState2->Visible) ImgState2->Visible = false; //true } else { if ( ImgState0->Visible) ImgState0->Visible = false; if ( ImgState1->Visible) ImgState1->Visible = false; if (!ImgState2->Visible) ImgState2->Visible = true; } FRAME_VmsStatus1->RefreshStatus(FVmsObj); SelectForm(FSelected); } //--------------------------------------------------------------------------- void __fastcall TVMSFORM0::PnlNameClick(TObject *Sender) { //ShowMessage(String(Width) + ", " + String(Height)); if (FScrollBox) FScrollBox->SetFocus(); if (FWndParent) { //POST_MSG(FWndParent, WM_VMS_SELECT, (WPARAM)FVmsObj, (LPARAM)this); } } //--------------------------------------------------------------------------- void __fastcall TVMSFORM0::PnlNameDblClick(TObject *Sender) { if (FScrollBox) FScrollBox->SetFocus(); if (FWndParent) { //POST_MSG(FWndParent, WM_VMS_SELECT_DBLCLICK, (WPARAM)FVmsObj, (LPARAM)this); } } //--------------------------------------------------------------------------- void __fastcall TVMSFORM0::FFPlayer1State(TObject *Sender, TPlayState APlayState) { switch(APlayState) { case Ffbasecomponent::psPlay: case Ffbasecomponent::psResume: break; case Ffbasecomponent::psPause: case Ffbasecomponent::psStep: break; case Ffbasecomponent::psStop: if (FFPlayer1->ScreenHandle != NULL) { PostMessage(FFPlayer1->ScreenHandle, CM_INVALIDATE, 0, 0); UpdateWindow(FFPlayer1->ScreenHandle); FFPlayer1->ScreenHandle = NULL; } break; case Ffbasecomponent::psEnd: { FFPlayer1->Stop(true); PostMessage(FFPlayer1->ScreenHandle, CM_INVALIDATE, 0, 0); UpdateWindow(FFPlayer1->ScreenHandle); FFPlayer1->ScreenHandle = NULL; } break; } } //--------------------------------------------------------------------------- void __fastcall TVMSFORM0::PopupMenu2Popup(TObject *Sender) { if (FVmsObj == NULL) { return; } MnuVmsInfo->Caption = "[" + FVmsObj->VMS_CTLR_ID + "]"; } //--------------------------------------------------------------------------- void __fastcall TVMSFORM0::MnuVmsUserMsgClick(TObject *Sender) { if (FVmsObj == NULL) { return; } String sClassName = "TFrmVmsMsgUserDisp"; String sExeName = "VmsMsgUserDisp.exe"; String sTitle = "VMS ¸Þ½ÃÁö ¼öµ¿Ç¥Ãâ"; String sModlType = FVmsObj->VMS_MODL_KIND; String sAVmsCtlrId = FVmsObj->VMS_CTLR_ID; ExecuteVmsProgram(sClassName, sExeName, sTitle, sModlType, sAVmsCtlrId); } //--------------------------------------------------------------------------- void __fastcall TVMSFORM0::ExecuteVmsProgram(String AClassName, String AExeName, String ATitle, String AModlType, String AVmsCtlrId) { String sAppPath = ""; String sMagicId = "ICAIR"; String sOperId = g_AppCfg.OPER_ID; String sPrcsId = g_AppCfg.PRCS_ID; String sParam1 = AModlType; String sParam2 = AVmsCtlrId; HWND hExeForm = FindWindow(AClassName.c_str(), NULL);//ATitle.c_str()); if (hExeForm) { memset((char*)&wmData1, 0x00, sizeof(wmData1)); wmData1.Handle = Handle; sprintf(wmData1.Class, "%s", "TVMSFORM0"); sprintf(wmData1.OPER_ID, "%s", AnsiString(sOperId).c_str()); sprintf(wmData1.PRCS_ID, "%s", AnsiString(sPrcsId).c_str()); sprintf(wmData1.Param1, "%s", AnsiString(sParam1).c_str()); sprintf(wmData1.Param2, "%s", AnsiString(sParam2).c_str()); COPYDATASTRUCT copyData; copyData.dwData = 1; copyData.cbData = sizeof(wmData1); copyData.lpData = &wmData1; SendMessage(hExeForm, WM_COPYDATA, (WPARAM)Handle, (LPARAM)©Data); SetWindowPos(hExeForm, HWND_TOP, 0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOSIZE | SWP_NOMOVE); ShowWindow(hExeForm, SW_RESTORE); } else { String sExeName = ""; String sExeParam= ""; if (sAppPath == "") { sExeName = AExeName; } else { sExeName = sAppPath + "\\" + AExeName; } sExeParam = sMagicId + " " + sOperId + " " + sPrcsId + " " + sParam1 + " " + sParam2; ShellExecute(Handle, NULL, sExeName.c_str(), sExeParam.c_str(), NULL, SW_SHOWNORMAL); } } //---------------------------------------------------------------------------