AppGlobalF.h 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. //---------------------------------------------------------------------------
  2. #ifndef AppGlobalFH
  3. #define AppGlobalFH
  4. //---------------------------------------------------------------------------
  5. #include <map.h>
  6. #include "ITSDbF.h"
  7. #include "ITSLogF.h"
  8. /*
  9. ******************************************************************************
  10. * Defines
  11. ******************************************************************************
  12. */
  13. #define FORMSHOW(x) if (x) \
  14. { \
  15. try { \
  16. ShowWindow(x->Handle, SW_RESTORE); \
  17. x->BringToFront(); \
  18. } catch(...) {} \
  19. } \
  20. else \
  21. { \
  22. Application->CreateForm(__classid(T##x), &x); \
  23. if (x) x->Show(); \
  24. }
  25. /*
  26. ******************************************************************************
  27. * User Data Types
  28. ******************************************************************************
  29. */
  30. #define STR_DATETIME "YYYY-MM-DD HH:NN:SS"
  31. #define STR_HHNN "YYYY-MM-DD HH:NN"
  32. #define STR_DATEHOUR "YYYY-MM-DD HH"
  33. #define STR_DATE "YYYY-MM-DD"
  34. #define STR_MM "YYYY-MM"
  35. typedef struct tag_AppConfig
  36. {
  37. String sConfigFile;
  38. bool bAppClose;
  39. long lMainWinHandle; /* Main Window Handle */
  40. String sTitle;
  41. String sProcessId; /* 프로세스 ID */
  42. String sSkinName;
  43. bool bSaveForm;
  44. bool bLoginPrompt;
  45. String sDefUseId;
  46. int nLogLevel;
  47. AnsiString sLogDay;
  48. bool bDebug;
  49. String sAppPath;
  50. String sLang;
  51. struct
  52. {
  53. bool Window;
  54. bool Enabled;
  55. int TimeOut;
  56. } Alarm;
  57. struct
  58. {
  59. bool Window;
  60. bool Enabled;
  61. int TimeOut;
  62. } Incident;
  63. struct
  64. {
  65. int AlarmValue;
  66. } Temp;
  67. struct
  68. {
  69. bool Enabled;
  70. int IntervalMin;
  71. bool LogoutExit;
  72. } AutoLogout;
  73. struct
  74. {
  75. TThread *pThread;
  76. DWORD dwThreadId;
  77. unsigned int nHandle;
  78. bool bRunning;
  79. } thr;
  80. struct
  81. {
  82. String sConnectStr;
  83. String sProvider;
  84. String sServerName;
  85. String sUserName;
  86. String sPassword;
  87. bool bSqlLog;
  88. } itsdb;
  89. struct
  90. {
  91. String sMainMap;
  92. String sLinkMap;
  93. } flashmap;
  94. struct
  95. {
  96. String sComModel;
  97. String sDevModel;
  98. } vmscam;
  99. } APP_CONFIG;
  100. /*
  101. ******************************************************************************
  102. * Global variable definitions
  103. ******************************************************************************
  104. */
  105. extern String CenterCd; // 지역센터 코드
  106. extern String CenterId; // 지역센터 아이디
  107. extern String CenterName; // 지역센터 명칭
  108. extern int g_nPid; // Application Process ID
  109. extern String g_sAppDir; // Application Directory
  110. extern String g_sAppName; // Program name
  111. extern String g_sCfgDir; // Config File Directory
  112. extern String g_sLogDir; // Program Log Directory
  113. extern String g_sTempDir; // Program Temp Directory
  114. extern String g_sFormsDir; // Program Forms Directory
  115. extern String g_sLangDir;
  116. extern APP_CONFIG g_AppCfg;
  117. extern LOGININFO *g_pLOGIN;
  118. extern LOG_INFO g_LogCfg;
  119. extern TITSLog *ITSLog;
  120. /*
  121. ******************************************************************************
  122. * PlugIn Global variables
  123. ******************************************************************************
  124. */
  125. /*
  126. ******************************************************************************
  127. * Global function definitios
  128. ******************************************************************************
  129. */
  130. bool LoadDefaultConfigInfo(String ACfgFile="");
  131. bool WriteConfigInfo(String sCfgFile, String sTitle, String sItem, String sValue);
  132. bool ReadConfigInfo(String sCfgFile, String sTitle, String sItem, String &sValue);
  133. bool DeleteLogFiles(PTCHAR pszPath, int nDays, PTCHAR pszFile);
  134. void ShowErrorMsg(String ATitle, String AErrMsg);
  135. #include "cxControls.hpp"
  136. #include "cxDropDownEdit.hpp"
  137. TDateTime APP_StrToDateTime(String AStrDateTime);
  138. String APP_GetCode(TcxComboBox *ACombo);
  139. String APP_GetCodeDesc(TcxComboBox *ACombo, String ACode);
  140. String APP_GetCodeName(TcxComboBox *ACombo, String ACode);
  141. String APP_GetCodeIdByName(TcxComboBox *ACombo, String AName);
  142. String APP_GetCodeDefCode(TcxComboBox *ACombo);
  143. String APP_GetCodeDefDesc(TcxComboBox *ACombo);
  144. int APP_SetCode(TcxComboBox *ACombo, String ACode);
  145. String ITSUtil_FormatStr(String AStrDateTime, String AFormat);
  146. //----------------------------------------------------------------------------
  147. #define MAX_DISPCOLOR 22
  148. extern TColor g_DispColor[MAX_DISPCOLOR];
  149. void APP_InitDisplayColor();
  150. TColor APP_GetDisplayColor(int ASeq);
  151. void APP_ImageClear(TCanvas *c, int offX, int offY, int w, int h, TColor color);
  152. //////////////////////////////////////////////////////////////////////////////////
  153. class TVmsSizeType : public TObject
  154. {
  155. public: // User declarations
  156. String TypeCd;
  157. String TypeNm;
  158. int Width;
  159. int Height;
  160. public: // User declarations
  161. __fastcall TVmsSizeType(String ATypeCd,
  162. String ATypeNm,
  163. int AWidth,
  164. int AHeight)
  165. {
  166. TypeCd = ATypeCd;
  167. TypeNm = ATypeNm;
  168. Width = AWidth;
  169. Height = AHeight;
  170. }
  171. };
  172. //////////////////////////////////////////////////////////////////////////////////
  173. void APP_DelVmsSizeCombo(TcxComboBox *cboBox);
  174. TVmsSizeType* APP_GetVmsSizeTypeObject(TcxComboBox *cboBox);
  175. //----------------------------------------------------------------------------
  176. ULONG ProcIDFromWnd(HWND hwnd);
  177. HWND GetWinHandle(ULONG pid);
  178. #endif