123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298 |
- //---------------------------------------------------------------------------
- #ifndef AppGlobalFH
- #define AppGlobalFH
- #include "VmsCommonLibF.h"
- //---------------------------------------------------------------------------
- #include <map.h>
- #include "ITSDbF.h"
- #include "ITSUtilF.h"
- #include "ITSLogF.h"
- #include "CenterCommF.h"
- #include "CDSCodeF.h"
- #include "CDSVmsObjTypeF.h"
- #include "FrmLangF.h"
- /*
- ******************************************************************************
- * Defines
- ******************************************************************************
- */
- #define FORMSHOW(x) if (x) \
- { \
- try { \
- ShowWindow(x->Handle, SW_RESTORE); \
- x->BringToFront(); \
- } catch(...) {} \
- } \
- else \
- { \
- Application->CreateForm(__classid(T##x), &x); \
- if (x) x->Show(); \
- }
- typedef enum
- {
- icon_n = 0,
- icon_e,
- icon_m,
- icon_r,
- icon_s,
- } facility_icon;
- typedef struct
- {
- String ICON[5];
- } FACILITY_ICON;
- typedef struct tag_AppConfig
- {
- String sConfigFile;
- bool bAppClose;
- long lMainWinHandle; /* Main Window Handle */
- String sTitle;
- String sProcessId; /* ÇÁ·Î¼¼½º ID */
- int nVmsServerPort;
- String sSkinName;
- bool bSaveForm;
- bool bLoginPrompt;
- String sDefUseId;
- int nLogLevel;
- AnsiString sLogDay;
- bool bDebug;
- String sAppPath;
- String sLang;
- bool isDispOfflineMsg;
- struct
- {
- bool Window;
- bool Enabled;
- int TimeOut;
- } Alarm;
- struct
- {
- bool Window;
- bool Enabled;
- int TimeOut;
- } Incident;
- struct
- {
- int AlarmValue;
- } Temp;
- struct
- {
- bool Enabled;
- int IntervalMin;
- bool LogoutExit;
- } AutoLogout;
- FACILITY_ICON vms;
- FACILITY_ICON vds;
- struct
- {
- TThread *pThread;
- DWORD dwThreadId;
- unsigned int nHandle;
- bool bRunning;
- } thr;
- struct
- {
- String sConnectStr;
- String sProvider;
- String sServerName;
- String sUserName;
- String sPassword;
- bool bSqlLog;
- } itsdb;
- struct
- {
- String sProvider;
- String sServerName;
- String sUserName;
- String sPassword;
- bool bSqlLog;
- } utisdb;
- struct
- {
- String sMainMap;
- String sLinkMap;
- } flashmap;
- struct
- {
- String sComModel;
- String sDevModel;
- } vmscam;
- struct
- {
- String saveDir;
- String viewer;
- String server;
- int port;
- String user;
- String pswd;
- String dir;
- } blackbox;
- struct
- {
- String SERVER;
- int PORT;
- String USER;
- String PSWD;
- bool PASSIVE;
- } vmsFtp;
- bool bOnlyOneScreen;
- bool bTermChildProg;
- bool isLoadFromFile;
- int cmraViewerResetMin;
- int cmraViewerDelaySec;
- String MAGIC_ID;
- String OPER_ID;
- String PRCS_ID;
- String PARAM1;
- String PARAM2;
- String PARAM3;
- String PARAM4;
- } APP_CONFIG;
- #define MAX_CMRA_VIEW_CAMERA 20
- #define DEFAULT_PRCS_ID "P08010"
- /*
- ******************************************************************************
- * Global variable definitions
- ******************************************************************************
- */
- extern String g_IniFileDir;
- extern String g_IniFileName;
- extern int g_nPid; // Application Process ID
- extern String g_sAppDir; // Application Directory
- extern String g_sAppName; // Program name
- extern String g_sCfgDir; // Config File Directory
- extern String g_sLogDir; // Program Log Directory
- extern String g_sTempDir; // Program Temp Directory
- extern String g_sFormsDir; // Program Forms Directory
- extern String g_sBlackBox;
- extern String g_sLangDir;
- extern String g_sImageDir;
- extern String g_sVideoDir;
- extern String g_sMapDir;
- extern APP_CONFIG g_AppCfg;
- extern LOG_INFO g_LogCfg;
- extern TITSLog *ITSLog;
- extern String g_sLang;
- extern bool g_bControlAuth;
- /*
- ******************************************************************************
- * PlugIn Global variables
- ******************************************************************************
- */
- /*
- ******************************************************************************
- * Global function definitios
- ******************************************************************************
- */
- String DbPictTypeToReal(String APictType);
- String RealPictTypeToDb(String APictType);
- String DbMovieTypeToReal(String APictType);
- String RealMovieTypeToDb(String APictType);
- bool CheckApplicationParam();
- bool ApplicationSingleRun(String AClassName, String ATitle);
- bool LoadDefaultConfigInfo(String ACfgFile="");
- bool WriteConfigInfo(String sCfgFile, String sTitle, String sItem, String sValue);
- bool ReadConfigInfo(String sCfgFile, String sTitle, String sItem, String &sValue);
- bool DeleteLogFiles(PTCHAR pszPath, int nDays, PTCHAR pszFile);
- void ShowErrorMsg(String ATitle, String AErrMsg);
- #include "cxControls.hpp"
- #include "cxDropDownEdit.hpp"
- TDateTime APP_StrToDateTime(String AStrDateTime);
- String APP_FillCode(TcxComboBox *ACombo, String ACode);
- String APP_GetCode(TcxComboBox *ACombo);
- String APP_GetCodeDesc(TcxComboBox *ACombo, String ACode);
- String APP_GetCodeName(TcxComboBox *ACombo, String ACode);
- String APP_GetCodeName(TcxComboBox *ACombo);
- String APP_GetCodeIdByName(TcxComboBox *ACombo, String AName);
- String APP_GetCodeDefCode(TcxComboBox *ACombo);
- String APP_GetCodeDefDesc(TcxComboBox *ACombo);
- int APP_SetCode(TcxComboBox *ACombo, String ACode);
- //----------------------------------------------------------------------------
- #define MAX_DISPCOLOR 20
- extern TColor g_DispColor[MAX_DISPCOLOR];
- void APP_InitDisplayColor();
- TColor APP_GetDisplayColor(int ASeq);
- void APP_ImageClear(TCanvas *c, int offX, int offY, int w, int h, TColor color);
- //////////////////////////////////////////////////////////////////////////////////
- class TVmsSizeType : public TObject
- {
- public: // User declarations
- String TypeCd;
- String TypeNm;
- int Width;
- int Height;
- int Rows;
- int Cols;
- bool IsLcs;
- int LcsLanes;
- public: // User declarations
- __fastcall TVmsSizeType(String ATypeCd,
- String ATypeNm,
- int AWidth,
- int AHeight,
- int ARows,
- int ACols,
- bool AIsLcs,
- int ALcsLanes)
- {
- TypeCd = ATypeCd;
- TypeNm = ATypeNm;
- Width = AWidth;
- Height = AHeight;
- Rows = ARows;
- Cols = ACols;
- IsLcs = AIsLcs;
- LcsLanes = ALcsLanes;
- }
- };
- //////////////////////////////////////////////////////////////////////////////////
- void APP_DelVmsSizeCombo(TcxComboBox *cboBox);
- void APP_FillVmsSizeType(TcxComboBox *cboBox, bool bAddAll=false);
- void APP_FillLcsSizeType(TcxComboBox *cboBox, bool bAddAll=false);
- TVmsSizeType* APP_GetVmsSizeTypeObject(TcxComboBox *cboBox);
- bool APP_CheckBmpFile(String AInFileName, String &AOutFileName);
- //----------------------------------------------------------------------------
- ULONG ProcIDFromWnd(HWND hwnd);
- HWND GetWinHandle(ULONG pid);
- #endif
|