123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190 |
- //---------------------------------------------------------------------------
- #ifndef AppGlobalFH
- #define AppGlobalFH
- //---------------------------------------------------------------------------
- #include <vcl.h>
- #include <assert.h>
- #include <stdio.h>
- #include <inifiles.hpp>
- //---------------------------------------------------------------------------
- #include "ITSLogF.h"
- #include "ITSCommF.h"
- #include "SysGlobalF.h"
- #include "TVmsCtlrF.h"
- #include "TVmsImageF.h"
- #include "TCDSFormF.h"
- #include "TVmsIfscF.h"
- #include "VitzroCommF.h"
- #include "VMSProtocol.h"
- #include "WVMSProtocol.h"
- #include "ProtocolF.h"
- //---------------------------------------------------------------------------
- /*
- ******************************************************************************
- * User Define
- ******************************************************************************
- */
- //---------------------------------------------------------------------------
- #define LINFO(args...) LogWrite(eLOG_INFO, ##args)
- #define LDATA(args...) LogWrite(eLOG_DATA, ##args)
- #define LERROR(args...) LogWrite(eLOG_ERROR, ##args)
- #define LWARN(args...) LogWrite(eLOG_WARNING, ##args)
- #define LDEBUG(args...) LogWrite(eLOG_DEBUG, ##args)
- #define LDETAIL(args...) LogWrite(eLOG_DETAIL, ##args)
- #define SINFO(args...) SysLogWrite(eLOG_INFO, ##args)
- #define SDATA(args...) SysLogWrite(eLOG_DATA, ##args)
- #define SERROR(args...) SysLogWrite(eLOG_ERROR, ##args)
- #define SWARN(args...) SysLogWrite(eLOG_WARNING, ##args)
- #define SDEBUG(args...) SysLogWrite(eLOG_DEBUG, ##args)
- #define SDETAIL(args...) SysLogWrite(eLOG_DETAIL, ##args)
- #define WM_THREAD_TERMINATE (WM_USER+0x92) /* Thread 종료 메시지 */
- #define WM_PROCESS_STATE (WM_USER+0xA4) /* 프로세스 상태 입력 */
- //---------------------------------------------------------------------------
- #define MAX_SENDER_SIZE 20
- typedef struct tagIpcLogMessage
- {
- int Kind;
- int Flag;
- int Len;
- TDateTime Tm;
- char Type;
- char Msg[MAX_LOG_BUFFER];
- void *Obj;
- } IPC_LOG_MESSAGE;
- typedef struct tagCommConfig
- {
- int nCenterPort; // center udp port
- int nListenPort; // vms listen port
- AnsiString sLocalDomain; // vms server domain
- int nClientPort; // vms controller connect port
- AnsiString sLoginUser; // vms controller login id
- AnsiString sLoginPswd; // vms controller login pswd
- int nConnectWait;
- int nCmdTimeOut;
- int nWatchDogTime;
- int nPollingTime;
- void Clear()
- {
- }
- } COMM_CONFIG;
- typedef struct tagAppConfig
- {
- String sConfigFile;
- bool bAppClose;
- bool bAppLoad;
- bool bThrExit;
- String sTitle;
- long lMainWinHandle; /* Main Window Handle */
- String sManagerApp;
- AnsiString sProcessId; /* Process ID */
- int nProcessId;
- int nProcessPort;
- AnsiString sSystemId; /* System ID */
- AnsiString sLogDay;
- int nTrafficCycleTime;
- int nTrafficBasisTime;
- int nSaveFormType;
- int nDefaultFillColor;
- int nMaxLogLines;
- int MaxMemory; /* Max Memory size Mbyte */
- int MaxHandle; /* Max Handle count */
- int MaxThread; /* Max Thread count */
- int MaxGdi; /* Max Gdi count */
- bool RcRestart; /* 리소스 오류시 재기동 여부 */
- bool DownloadBitmap;
- //THREAD_INFO thrDb; /* DB Thread */
- DATABASE_INFO db;
- COMM_CONFIG comm;
- int nCenterCommLogLevel;
- bool bSendCenterComm;
- public:
- void Clear()
- {
- bThrExit = false;
- bAppClose = false;
- bAppLoad = false;
- sTitle = "";
- lMainWinHandle = 0;
- sProcessId = "";
- sLogDay = "";
- MaxMemory = 0;
- MaxHandle = 0;
- MaxThread = 0;
- MaxGdi = 0;
- //thrDb.Clear();
- db.Clear();
- comm.Clear();
- bSendCenterComm = false;
- }
- } APP_CONFIG;
- // system state
- typedef struct tagSystemState
- {
- BYTE Action; /* 동작 상태 */
- BYTE Comm; /* 통신 상태 */
- BYTE DB; /* DB 상태 */
- HANDLE hFinishEvent; /* finish event */
- DWORD CommThreadID; /* 통신 데이터 처리 스레드 ID */
- } SYSTEM_STATE;
- // system informations
- typedef struct tagSystemInformation
- {
- SYSTEM_STATE State; /* system state */
- } SYSTEM_INFORMATION;
- /*
- ******************************************************************************
- * Global variable definitions
- ******************************************************************************
- */
- extern APP_CONFIG g_AppCfg;
- extern LOG_INFO g_LogCfg;
- extern TITSLog *ITSLog;
- extern TITSLog *FDbLog;
- extern bool LOGIN_CHECK;
- extern bool LOAD_DB;
- extern bool APP_EXIT;
- extern SYSTEM_INFORMATION *g_SysInfo;
- #define USE_Q 0
- /*
- ******************************************************************************
- * Global function definitios
- ******************************************************************************
- */
- bool APP_LoadConfigInfo();
- int ITSUtil_Trace(const char *lpszFormat, ...);
- #endif
|