FrmInitializeF.cpp 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. //---------------------------------------------------------------------------
  2. #include <vcl.h>
  3. #include "AppGlobalF.h"
  4. #include "CDSMonitoringObjF.h"
  5. #pragma hdrstop
  6. #include "FrmInitializeF.h"
  7. //---------------------------------------------------------------------------
  8. #pragma package(smart_init)
  9. #pragma link "cxContainer"
  10. #pragma link "cxControls"
  11. #pragma link "cxEdit"
  12. #pragma link "cxGraphics"
  13. #pragma link "cxLabel"
  14. #pragma link "cxLookAndFeelPainters"
  15. #pragma link "cxLookAndFeels"
  16. #pragma link "cxProgressBar"
  17. #pragma link "dxSkinBlack"
  18. #pragma link "dxSkinBlue"
  19. #pragma link "dxSkinsCore"
  20. #pragma link "dxSkinMcSkin"
  21. #pragma resource "*.dfm"
  22. TFrmInitialize *FrmInitialize = NULL;
  23. //---------------------------------------------------------------------------
  24. __fastcall TFrmInitialize::TFrmInitialize(TComponent* Owner)
  25. : TForm(Owner)
  26. {
  27. if (g_AppCfg.sLang != "kr")
  28. {
  29. Caption = "Program initialize";
  30. LblStatus->Caption = "Initialize...";
  31. }
  32. }
  33. //---------------------------------------------------------------------------
  34. void __fastcall TFrmInitialize::FormShow(TObject *Sender)
  35. {
  36. Refresh();
  37. TmrShow->Enabled = true;
  38. }
  39. //---------------------------------------------------------------------------
  40. void __fastcall TFrmInitialize::TmrShowTimer(TObject *Sender)
  41. {
  42. TmrShow->Enabled = false;
  43. Refresh();
  44. Application->ProcessMessages();
  45. cxProgressBar1->Properties->Max = 100;
  46. try
  47. {
  48. if (g_AppCfg.sLang != "kr") LblStatus->Caption = "Connect database...";
  49. else LblStatus->Caption = "데이터베이스 연결 중...";
  50. Application->ProcessMessages();
  51. cxProgressBar1->Position = 10;
  52. if (g_AppCfg.sLang != "kr") LblStatus->Caption = "Loading basic informations...";
  53. else LblStatus->Caption = "기본 정보 로딩 중...";
  54. Application->ProcessMessages();
  55. cxProgressBar1->Position = 20;
  56. ObjCtlrManager->LoadCtlrFromDb(NULL);
  57. if (g_AppCfg.sLang != "kr") LblStatus->Caption = "Initialize default monitoring screen...";
  58. else LblStatus->Caption = "기본 모니터링 화면 초기화...";
  59. Application->ProcessMessages();
  60. cxProgressBar1->Position = 40;
  61. ObjCtlrManager->InitMonitoringFormFromDb(NULL);
  62. if (g_AppCfg.sLang != "kr") LblStatus->Caption = "Displaying monitoring screen...";
  63. else LblStatus->Caption = "모니터링 화면 조회중...";
  64. Application->ProcessMessages();
  65. Application->ProcessMessages();
  66. cxProgressBar1->Position = 60;
  67. ObjCtlrManager->LoadMonitoringFormFromDb(NULL);
  68. if (g_AppCfg.sLang != "kr") LblStatus->Caption = "Configuring monitoring screen...";
  69. else LblStatus->Caption = "모니터링 화면 구성중...";
  70. Application->ProcessMessages();
  71. cxProgressBar1->Position = 100;
  72. Application->ProcessMessages();
  73. }
  74. catch(...)
  75. {
  76. }
  77. Close();
  78. }
  79. //---------------------------------------------------------------------------
  80. void __fastcall TFrmInitialize::FormClose(TObject *Sender, TCloseAction &Action)
  81. {
  82. Action = caFree;
  83. }
  84. //---------------------------------------------------------------------------