Пример #1
0
 /// <summary>
 /// 初始化peakhelper,使用 pcanhelper
 /// </summary>
 /// <param name="pcan"></param>
 /// <returns></returns>
 public static PeakHelper Initialize(PcanHelper pcan)
 {
     if (instance != null)
     {
         throw new Exception("peakHelper重复初始化报错");
     }
     instance = new PeakHelper(pcan);
     return(instance);
 }
        private DataStoreManager()
        {
            dbhelper    = DBHelper.GetInstance();
            peakhelper  = PeakHelper.GetInstance();
            storeTimer1 = new System.Threading.Timer(_ =>
            {
                if (peakhelper.hasData)
                {
                    storeData1();
                }
            }, null, Timeout.Infinite, Timeout.Infinite);

            storeTimer2 = new System.Threading.Timer(_ =>
            {
                if (peakhelper.hasData)
                {
                    storeData2();
                }
            }, null, Timeout.Infinite, Timeout.Infinite);
        }