CrsCamViewer.cpp 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. //---------------------------------------------------------------------------
  2. #include <vcl.h>
  3. #pragma hdrstop
  4. #include <tchar.h>
  5. //---------------------------------------------------------------------------
  6. #include "AppGlobalF.h"
  7. #include "ITSDbF.h"
  8. #include "DMDbF.h"
  9. #include "ITSLangTransF.h"
  10. //---------------------------------------------------------------------------
  11. USEFORM("..\COMMON\DM\DMDbF.cpp", DMDb); /* TDataModule: File Type */
  12. USEFORM("MAIN\FrmCameraScreenF.cpp", FrmCameraScreen);
  13. USEFORM("MAIN\FrmCrsCamViewerF.cpp", FrmCrsCamViewer);
  14. USEFORM("MAIN\FRAME\FRAME_ObjListF.cpp", FRAMEObjList); /* TFrame: File Type */
  15. USEFORM("MAIN\FrmCameraPlayerF.cpp", FrmCameraPlayer);
  16. USEFORM("MAIN\FrmCameraFullScreenF.cpp", FrmCameraFullScreen);
  17. USEFORM("MAIN\FrmCameraScreenManagerF.cpp", FrmCameraScreenManager);
  18. USEFORM("MAIN\FrmCameraInfoF.cpp", FrmCameraInfo);
  19. USEFORM("MAIN\FrmInitializeF.cpp", FrmInitialize);
  20. USEFORM("MAIN\FRAME\FRAME_CameraF.cpp", FRAMECamera); /* TFrame: File Type */
  21. //---------------------------------------------------------------------------
  22. WINAPI _tWinMain(HINSTANCE, HINSTANCE, LPTSTR, int)
  23. {
  24. int nLoginRes;
  25. DateSeparator = '-';
  26. TimeSeparator = ':';
  27. ShortDateFormat ="yyyy-MM-dd";
  28. ShortTimeFormat = "hh:nn:ss";
  29. LongTimeFormat = "hh:nn:ss";
  30. String sLoginId = "ADMIN";
  31. bool bLogin = true;
  32. int nArgs = ParamCount();
  33. if (nArgs >= 1)
  34. {
  35. sLoginId = ParamStr(1);
  36. bLogin = false;
  37. }
  38. int nRes;
  39. g_nPid = (int)GetCurrentProcessId();
  40. g_sAppDir = ExtractFilePath(Application->ExeName);
  41. g_sAppName = ChangeFileExt(ExtractFileName(Application->ExeName), "");
  42. g_sCfgDir = g_sAppDir + "Cfg\\";
  43. g_sLogDir = g_sAppDir + "Log\\";
  44. g_sTempDir = g_sAppDir + "Temp\\";
  45. g_sFormsDir = g_sCfgDir + "Forms\\";
  46. ForceDirectories(g_sCfgDir.c_str());
  47. ForceDirectories(g_sLogDir.c_str());
  48. ForceDirectories(g_sTempDir.c_str());
  49. ForceDirectories(g_sFormsDir.c_str());
  50. String sTempDir = g_sLogDir + "Db\\";
  51. ForceDirectories(sTempDir.c_str());
  52. String sAppDir = ExtractFilePath(Application->ExeName);
  53. ChDir(sAppDir);
  54. /*
  55. * 시스템 운영환경을 ini 파일에서 읽어 온다.
  56. */
  57. LoadDefaultConfigInfo("ITS_OP");
  58. g_sLangDir = g_sAppDir + "Lang\\";
  59. g_sLangDir = g_sLangDir + g_AppCfg.sLang + "\\";
  60. ForceDirectories(g_sLangDir.c_str());
  61. LangTrans = new TLangTrans("CrsCamViewer", g_AppCfg.sLang, g_sLangDir, true);
  62. ITSLog = new TITSLog(g_sLogDir, g_sAppName, g_AppCfg.sLogDay);
  63. ITSLog->FLogCfg = g_LogCfg;
  64. try
  65. {
  66. ReportMemoryLeaksOnShutdown = true;
  67. Application->Initialize();
  68. Application->MainFormOnTaskBar = true;
  69. Application->Title = g_AppCfg.sTitle;
  70. Application->Title = "교차로감시카메라 영상 모니터링";
  71. Application->CreateForm(__classid(TFrmCrsCamViewer), &FrmCrsCamViewer);
  72. Application->CreateForm(__classid(TDMDb), &DMDb);
  73. Application->Run();
  74. }
  75. catch (Exception &exception)
  76. {
  77. Application->ShowException(&exception);
  78. }
  79. catch (...)
  80. {
  81. try
  82. {
  83. throw Exception("");
  84. }
  85. catch (Exception &exception)
  86. {
  87. Application->ShowException(&exception);
  88. }
  89. }
  90. prog_exit:
  91. try
  92. {
  93. }
  94. catch(...)
  95. {
  96. }
  97. return 0;
  98. }
  99. //---------------------------------------------------------------------------