public void Init() { try { _objectmanager = (ObjectManager.ObjectManager)_ObjectManager.GetInstance; string Config_Path = AppContext.BaseDirectory + "/settings/System.xml"; Load_Xml_Config_To_Dict(Config_Path); this._run = true; this._th_Proc_Flow = new Thread(new ThreadStart(Proc_Flow)); this._th_Proc_Flow.Start(); _logger.LogTrace("GateWay Service Initial Finished"); GateWayStatus = "Init"; Timer_Routine_Job(_dic_Basicsetting["HeartBeat_Interval"]); //execute routine job } catch (Exception ex) { Dispose(); _logger.LogTrace("EDC Service Initial Faild, Exception Msg = " + ex.Message); } }
public void Init() { try { string Config_Path = AppContext.BaseDirectory + "/settings/System.xml"; Load_Xml_Config_To_Dict(Config_Path); _objectmanager = (ObjectManager.ObjectManager)_ObjectManager.GetInstance; _IOT_Device = new ConcurrentDictionary <string, DBContext.IOT_DEVICE>(); _EDC_Label_Data = new ConcurrentDictionary <string, ConcurrentDictionary <string, int> >(); _Sync_EDC_Label_Data = new ConcurrentDictionary <string, ConcurrentDictionary <string, int> >(); _dic_DB_Partaker = new ConcurrentDictionary <string, ConcurrentQueue <DBPartaker> >(); int DB_Refresh_Interval = 60000; // 60 秒 int DB_Report_Interval = 5000; // 5 秒 Timer_Refresh_DB(DB_Refresh_Interval); //定時Refresh DB Information to local Timer_Report_DB(DB_Report_Interval); //定時Report Data to DB _Initial_Finished = false; // 等待IOT Client 與 CCS 完成通訊以後才開始動作 //ReportAlarm(_dic_Basicsetting[_GatewayID], _dic_Basicsetting[_DeviceID], "0000", "this is testing", "ERROR"); } catch (Exception ex) { Dispose(); string ErrorLog = "DB Service Initial Faild, Exception Msg = " + ex.Message; _logger.LogError(ErrorLog); ReportAlarm(_dic_Basicsetting[_GatewayID], _dic_Basicsetting[_DeviceID], "0001", ErrorLog, "ERROR"); } }