Esempio n. 1
0
 public CNetProxy(CSystemLog systemLog, CSystemConfig systemConfig)
 {
     _SystemLog    = systemLog;
     _SystemConfig = systemConfig;
     _DbConnection = new CDbConnection(_SystemConfig.getConfigItem("DB_MYSQL_CONNECT_STR").ToString(), _SystemLog);
     Id            = Guid.NewGuid().ToString().ToUpper();
 }
Esempio n. 2
0
        static int Main(string[] args)
        {
            string message = string.Empty;

            _SystemConfig = new CSystemConfig();
            if (_SystemConfig.getErrorCode() != 0)
            {
                return(1);
            }

            E_ERROR_CODE errorCode = loadConfigData();

            if (errorCode != E_ERROR_CODE.OK)
            {
                return((int)errorCode);
            }

            _DbConnection = new CDbConnection(_DbConnectStr, _SystemLog);
            if (!_DbConnection.testConnect())
            {
                _SystemLog.disposeLogWriter();
                return((int)E_ERROR_CODE.ERROR_CONNECT_DB_FAILED);
            }

            initLocalVaribles();

            while (true)
            {
                _BeiDouDeviceManager.processBeiDevice();
                message = string.Format("Run cycle <{0}>, Next run time <{1}>....", _RequestCycle, CPublic.getDateTimeString(DateTime.Now.AddSeconds(_RequestCycle)));
                _SystemLog.writeLog(LOG_LEVEL.WARNING, message);
                Thread.Sleep(TimeSpan.FromSeconds(_RequestCycle));
            }
        }
        public CBeiDevieManager(string queryServiceUrl, CDbConnection dbConnection, CSystemLog systemLog)

        {
            _QueryServiceUrl               = queryServiceUrl;
            _DbConnection                  = dbConnection;
            _SystemLog                     = systemLog;
            _DbBeiDouDeviceTable           = new Dictionary <string, CBeiDouDevice>();
            _RemoteServerBeiDouDeviceTable = new Dictionary <string, CBeiDouDevice>();
            _InsertDeviceArray             = new List <CBeiDouDevice>();
            _DeleteDeviceArray             = new List <CBeiDouDevice>();
            _UpdateDeviceArray             = new List <CBeiDouDevice>();
        }
Esempio n. 4
0
 public CBeiDouDevice(CSystemLog systemLog, CDbConnection dbConnection)
 {
     _SystemLog    = systemLog;
     _DbConnection = dbConnection;
 }