FrmOptionF.cpp 3.4 KB

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