123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- //---------------------------------------------------------------------------
- #include <vcl.h>
- #pragma hdrstop
- #include "FrmOptionF.h"
- #include "AppGlobalF.h"
- #include "FrmVmsInfoF.h"
- #include "DMCOMMF.h"
- //---------------------------------------------------------------------------
- #pragma package(smart_init)
- #pragma resource "*.dfm"
- TFrmOption *FrmOption;
- //---------------------------------------------------------------------------
- __fastcall TFrmOption::TFrmOption(TComponent* Owner)
- : TForm(Owner)
- {
- FUpdate = false;
- }
- //---------------------------------------------------------------------------
- void __fastcall TFrmOption::btnCloseClick(TObject *Sender)
- {
- Close();
- }
- //---------------------------------------------------------------------------
- void __fastcall TFrmOption::btnSetLogClick(TObject *Sender)
- {
- // 로그설정
- #ifdef LANG_ENG
- if (MessageDlg("Do you want to set option information?", mtWarning, TMsgDlgButtons() << mbYes << mbNo, 0) != mrYes)
- #else
- if (MessageDlg("옵션 정보를 설정 하시겠습니까?", mtWarning, TMsgDlgButtons() << mbYes << mbNo, 0) != mrYes)
- #endif
- {
- return;
- }
- bool bUpdate = false;
- if (g_LogCfg.Info != chkInfo->Checked)
- {
- g_LogCfg.Info = chkInfo->Checked;
- bUpdate = true;
- }
- if (g_LogCfg.Data != chkData->Checked)
- {
- g_LogCfg.Data = chkData->Checked;
- bUpdate = true;
- }
- if (g_LogCfg.Error != chkError->Checked)
- {
- g_LogCfg.Error = chkError->Checked;
- bUpdate = true;
- }
- if (g_LogCfg.Warning!= chkWarning->Checked)
- {
- g_LogCfg.Warning = chkWarning->Checked;
- bUpdate = true;
- }
- if (g_LogCfg.Debug != chkDebug->Checked)
- {
- g_LogCfg.Debug = chkDebug->Checked;
- bUpdate = true;
- }
- if (g_LogCfg.Detail != chkDetail->Checked)
- {
- g_LogCfg.Detail = chkDetail->Checked;
- bUpdate = true;
- }
- SYS_WriteConfigInfo("LOG", "INFO", g_LogCfg.Info ? "1" : "0", g_AppCfg.sConfigFile);
- SYS_WriteConfigInfo("LOG", "DATA", g_LogCfg.Data ? "1" : "0", g_AppCfg.sConfigFile);
- SYS_WriteConfigInfo("LOG", "ERROR", g_LogCfg.Error ? "1" : "0", g_AppCfg.sConfigFile);
- SYS_WriteConfigInfo("LOG", "WARNING", g_LogCfg.Warning ? "1" : "0", g_AppCfg.sConfigFile);
- SYS_WriteConfigInfo("LOG", "DEBUG", g_LogCfg.Debug ? "1" : "0", g_AppCfg.sConfigFile);
- SYS_WriteConfigInfo("LOG", "DETAIL", g_LogCfg.Detail ? "1" : "0", g_AppCfg.sConfigFile);
- if (bUpdate) FUpdate = bUpdate;
- //MessageDlg("로그설정이 변경되었습니다.", mtCustom, TMsgDlgButtons() << mbOK, 0);
- }
- //---------------------------------------------------------------------------
- void __fastcall TFrmOption::FormShow(TObject *Sender)
- {
- // 서버정보 표출
- plTot->Caption = FrmVmsInfo->plTot->Caption;
- plErr->Caption = FrmVmsInfo->plErr->Caption;
- plNor->Caption = FrmVmsInfo->plNor->Caption;
- //plProcessId->Caption = g_AppCfg.sProcessId + " (" + String(g_AppCfg.nProcessPort) + ")";
- plProcessId->Caption = g_AppCfg.sProcessId;
- plSystemId->Caption = g_AppCfg.sSystemId;
- plIpAddress->Caption = DMCOMM->TcpServer->LocalHostAddr();
- plCenterPort->Caption = g_AppCfg.comm.nCenterPort;
- plVmsPort->Caption = g_AppCfg.comm.nListenPort;
- plVmsConPort->Caption = g_AppCfg.comm.nClientPort;
- // 로그설정
- chkInfo->Checked = g_LogCfg.Info;
- chkData->Checked = g_LogCfg.Data;
- chkError->Checked = g_LogCfg.Error;
- chkWarning->Checked = g_LogCfg.Warning;
- chkDebug->Checked = g_LogCfg.Debug;
- chkDetail->Checked = g_LogCfg.Detail;
- }
- //---------------------------------------------------------------------------
|