FrmOptionF.cpp 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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. if (MessageDlg("옵션 정보를 설정 하시겠습니까?", mtWarning, TMsgDlgButtons() << mbYes << mbNo, 0) != mrYes)
  28. {
  29. return;
  30. }
  31. bool bUpdate = false;
  32. if (g_LogCfg.Info != chkInfo->Checked)
  33. {
  34. g_LogCfg.Info = chkInfo->Checked;
  35. bUpdate = true;
  36. }
  37. if (g_LogCfg.Data != chkData->Checked)
  38. {
  39. g_LogCfg.Data = chkData->Checked;
  40. bUpdate = true;
  41. }
  42. if (g_LogCfg.Error != chkError->Checked)
  43. {
  44. g_LogCfg.Error = chkError->Checked;
  45. bUpdate = true;
  46. }
  47. if (g_LogCfg.Warning!= chkWarning->Checked)
  48. {
  49. g_LogCfg.Warning = chkWarning->Checked;
  50. bUpdate = true;
  51. }
  52. if (g_LogCfg.Debug != chkDebug->Checked)
  53. {
  54. g_LogCfg.Debug = chkDebug->Checked;
  55. bUpdate = true;
  56. }
  57. if (g_LogCfg.Detail != chkDetail->Checked)
  58. {
  59. g_LogCfg.Detail = chkDetail->Checked;
  60. bUpdate = true;
  61. }
  62. SYS_WriteConfigInfo("LOG", "INFO", g_LogCfg.Info ? "1" : "0", g_AppCfg.sConfigFile);
  63. SYS_WriteConfigInfo("LOG", "DATA", g_LogCfg.Data ? "1" : "0", g_AppCfg.sConfigFile);
  64. SYS_WriteConfigInfo("LOG", "ERROR", g_LogCfg.Error ? "1" : "0", g_AppCfg.sConfigFile);
  65. SYS_WriteConfigInfo("LOG", "WARNING", g_LogCfg.Warning ? "1" : "0", g_AppCfg.sConfigFile);
  66. SYS_WriteConfigInfo("LOG", "DEBUG", g_LogCfg.Debug ? "1" : "0", g_AppCfg.sConfigFile);
  67. SYS_WriteConfigInfo("LOG", "DETAIL", g_LogCfg.Detail ? "1" : "0", g_AppCfg.sConfigFile);
  68. if (bUpdate) FUpdate = bUpdate;
  69. //MessageDlg("로그설정이 변경되었습니다.", mtCustom, TMsgDlgButtons() << mbOK, 0);
  70. }
  71. //---------------------------------------------------------------------------
  72. void __fastcall TFrmOption::FormShow(TObject *Sender)
  73. {
  74. // 서버정보 표출
  75. plTot->Caption = FrmVmsInfo->plTot->Caption;
  76. plErr->Caption = FrmVmsInfo->plErr->Caption;
  77. plNor->Caption = FrmVmsInfo->plNor->Caption;
  78. plProcessId->Caption = g_AppCfg.sProcessId + " (" + String(g_AppCfg.nProcessPort) + ")";
  79. plSystemId->Caption = g_AppCfg.sSystemId;
  80. plIpAddress->Caption = DMCOMM->TcpServer->LocalHostAddr();
  81. plCenterPort->Caption = g_AppCfg.comm.nCenterPort;
  82. plVmsPort->Caption = g_AppCfg.comm.nListenPort;
  83. plVmsConPort->Caption = g_AppCfg.comm.nClientPort;
  84. // 로그설정
  85. chkInfo->Checked = g_LogCfg.Info;
  86. chkData->Checked = g_LogCfg.Data;
  87. chkError->Checked = g_LogCfg.Error;
  88. chkWarning->Checked = g_LogCfg.Warning;
  89. chkDebug->Checked = g_LogCfg.Debug;
  90. chkDetail->Checked = g_LogCfg.Detail;
  91. }
  92. //---------------------------------------------------------------------------