FrmOptionF.cpp 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. //---------------------------------------------------------------------------
  2. #include <vcl.h>
  3. #pragma hdrstop
  4. #include "FrmOptionF.h"
  5. #include "AppGlobalF.h"
  6. #include "FrmVmsInfoF.h"
  7. #include "DMCOMMF.h"
  8. //---------------------------------------------------------------------------
  9. #pragma package(smart_init)
  10. #pragma resource "*.dfm"
  11. TFrmOption *FrmOption;
  12. //---------------------------------------------------------------------------
  13. __fastcall TFrmOption::TFrmOption(TComponent* Owner)
  14. : TForm(Owner)
  15. {
  16. FUpdate = false;
  17. }
  18. //---------------------------------------------------------------------------
  19. void __fastcall TFrmOption::btnCloseClick(TObject *Sender)
  20. {
  21. Close();
  22. }
  23. //---------------------------------------------------------------------------
  24. void __fastcall TFrmOption::btnSetLogClick(TObject *Sender)
  25. {
  26. // 로그설정
  27. #ifdef LANG_ENG
  28. if (MessageDlg("Do you want to set option information?", mtWarning, TMsgDlgButtons() << mbYes << mbNo, 0) != mrYes)
  29. #else
  30. if (MessageDlg("옵션 정보를 설정 하시겠습니까?", mtWarning, TMsgDlgButtons() << mbYes << mbNo, 0) != mrYes)
  31. #endif
  32. {
  33. return;
  34. }
  35. bool bUpdate = false;
  36. if (g_LogCfg.Info != chkInfo->Checked)
  37. {
  38. g_LogCfg.Info = chkInfo->Checked;
  39. bUpdate = true;
  40. }
  41. if (g_LogCfg.Data != chkData->Checked)
  42. {
  43. g_LogCfg.Data = chkData->Checked;
  44. bUpdate = true;
  45. }
  46. if (g_LogCfg.Error != chkError->Checked)
  47. {
  48. g_LogCfg.Error = chkError->Checked;
  49. bUpdate = true;
  50. }
  51. if (g_LogCfg.Warning!= chkWarning->Checked)
  52. {
  53. g_LogCfg.Warning = chkWarning->Checked;
  54. bUpdate = true;
  55. }
  56. if (g_LogCfg.Debug != chkDebug->Checked)
  57. {
  58. g_LogCfg.Debug = chkDebug->Checked;
  59. bUpdate = true;
  60. }
  61. if (g_LogCfg.Detail != chkDetail->Checked)
  62. {
  63. g_LogCfg.Detail = chkDetail->Checked;
  64. bUpdate = true;
  65. }
  66. SYS_WriteConfigInfo("LOG", "INFO", g_LogCfg.Info ? "1" : "0", g_AppCfg.sConfigFile);
  67. SYS_WriteConfigInfo("LOG", "DATA", g_LogCfg.Data ? "1" : "0", g_AppCfg.sConfigFile);
  68. SYS_WriteConfigInfo("LOG", "ERROR", g_LogCfg.Error ? "1" : "0", g_AppCfg.sConfigFile);
  69. SYS_WriteConfigInfo("LOG", "WARNING", g_LogCfg.Warning ? "1" : "0", g_AppCfg.sConfigFile);
  70. SYS_WriteConfigInfo("LOG", "DEBUG", g_LogCfg.Debug ? "1" : "0", g_AppCfg.sConfigFile);
  71. SYS_WriteConfigInfo("LOG", "DETAIL", g_LogCfg.Detail ? "1" : "0", g_AppCfg.sConfigFile);
  72. if (bUpdate) FUpdate = bUpdate;
  73. //MessageDlg("로그설정이 변경되었습니다.", mtCustom, TMsgDlgButtons() << mbOK, 0);
  74. }
  75. //---------------------------------------------------------------------------
  76. void __fastcall TFrmOption::FormShow(TObject *Sender)
  77. {
  78. // 서버정보 표출
  79. plTot->Caption = FrmVmsInfo->plTot->Caption;
  80. plErr->Caption = FrmVmsInfo->plErr->Caption;
  81. plNor->Caption = FrmVmsInfo->plNor->Caption;
  82. //plProcessId->Caption = g_AppCfg.sProcessId + " (" + String(g_AppCfg.nProcessPort) + ")";
  83. plProcessId->Caption = g_AppCfg.sProcessId;
  84. plSystemId->Caption = g_AppCfg.sSystemId;
  85. plIpAddress->Caption = DMCOMM->TcpServer->LocalHostAddr();
  86. plCenterPort->Caption = g_AppCfg.comm.nCenterPort;
  87. plVmsPort->Caption = g_AppCfg.comm.nListenPort;
  88. plVmsConPort->Caption = g_AppCfg.comm.nClientPort;
  89. // 로그설정
  90. chkInfo->Checked = g_LogCfg.Info;
  91. chkData->Checked = g_LogCfg.Data;
  92. chkError->Checked = g_LogCfg.Error;
  93. chkWarning->Checked = g_LogCfg.Warning;
  94. chkDebug->Checked = g_LogCfg.Debug;
  95. chkDetail->Checked = g_LogCfg.Detail;
  96. }
  97. //---------------------------------------------------------------------------