Ejemplo n.º 1
0
 private void MonitorDataCallBack(CompletedMonitorCallback callBack, object userToken)
 {
     CompletedMonitorCallbackParams comParams = GetCompletedMonitorCallbackParams();
     _readHWParams = new ReadHWDataParams(callBack, userToken);
     _readHWParams.CallBack.BeginInvoke(comParams, _readHWParams.UserToken, null, null);
     Thread.Sleep(7000);
     SendStatusMsg("Finish数据Data");
 }
Ejemplo n.º 2
0
 public ReadMonitorDataErrType BeginRetryReadScannerData(Dictionary<string, List<ScanBoardRegionInfo>> scanBordInfos, CompletedMonitorCallback callBack, object userToken)
 {
     _fLogService.Info("start BeginReadOneScannerData");
     SendStatusMsg("StartRetryReadScannerData");
     ReadMonitorDataErrType readErrType = IsExcute();
     if (readErrType != ReadMonitorDataErrType.OK)
     {
         return readErrType;
     }
     if (Interlocked.Exchange(ref _isRunningMetux, 1) == 0)
     {
         _readHWParams = new ReadHWDataParams(callBack, userToken);
         ClearMonitorData();
         if (_hwStatusMonitor != null)
         {
             _stopwatch.Restart();
             if (!_hwStatusMonitor.ManualRefreshStatus(scanBordInfos))
             {
                 Interlocked.Exchange(ref _isRunningMetux, 0);
                 _fLogService.Debug("NoWait:Read Scanner, there is no place to wait");
                 return ReadMonitorDataErrType.BusyWorking;
             }
         }
         else
         {
             Interlocked.Exchange(ref _isRunningMetux, 0);
             return ReadMonitorDataErrType.NoServerObj;
         }
         return ReadMonitorDataErrType.OK;
     }
     else
     {
         _fLogService.Info("RetryScanner:Read Hardware Monitor is busy...");
         return ReadMonitorDataErrType.BusyWorking;
     }
 }
Ejemplo n.º 3
0
 public ReadMonitorDataErrType BeginRetryReadSenderData(SerializableDictionary<string, List<byte>> senderInfos, CompletedMonitorCallback callBack, object userToken)
 {
     _fLogService.Info("start BeginRetryReadSenderData");
     SendStatusMsg("StartRetryReadSenderData");
     ReadMonitorDataErrType readErrType = IsExcute();
     if (readErrType != ReadMonitorDataErrType.OK)
     {
         return readErrType;
     }
     if (Interlocked.Exchange(ref _isRunningMetux, 1) == 0)
     {
         _readHWParams = new ReadHWDataParams(callBack, userToken);
         ClearMonitorData();
         if (_readDviInfo != null)
         {
             _stopwatch.Restart();
             _readDviInfo.RefreshSenderDviInfo(senderInfos);
         }
         else
         {
             Interlocked.Exchange(ref _isRunningMetux, 0);
             return ReadMonitorDataErrType.NoServerObj;
         }
         //#if TestMode
         //                ThreadPool.QueueUserWorkItem(StartReadHWMonitorData, parm);
         //#else
         //                throw new Exception("The method or operation is not implemented.");
         //#endif
         return ReadMonitorDataErrType.OK;
     }
     else
     {
         _fLogService.Info("RetrySender: Hardware Monitor is busy...");
         return ReadMonitorDataErrType.BusyWorking;
     }
 }
Ejemplo n.º 4
0
 public ReadMonitorDataErrType BeginReadData(CompletedMonitorCallback callBack, object userToken)
 {
     _fLogService.Info("start BeginReadData");
     #if TestMode
     Action action = new Action(() =>
     {
         MonitorDataCallBack(callBack, userToken);
     });
     action.BeginInvoke(null, null);
     return ReadMonitorDataErrType.OK;
     #endif
     SendStatusMsg("StartReadMonitorData");
     ReadMonitorDataErrType readErrType = IsExcute();
     if (readErrType != ReadMonitorDataErrType.OK)
     {
         return readErrType;
     }
     if (Interlocked.Exchange(ref _isRunningMetux, 1) == 0)
     {
         _readHWParams = new ReadHWDataParams(callBack, userToken);
         ClearMonitorData();
         _fLogService.Info("Start DVI Data");
         SendStatusMsg("StartReadDVIData");
         if (_readDviInfo != null)
         {
             _stopwatch.Reset();
             _stopwatch.Start();
             _readDviInfo.RefreshSenderDviInfo();
         }
         else
         {
             Interlocked.Exchange(ref _isRunningMetux, 0);
             return ReadMonitorDataErrType.NoServerObj;
         }
         //#if TestMode
         //                ThreadPool.QueueUserWorkItem(StartReadHWMonitorData, parm);
         //#else
         //                throw new Exception("The method or operation is not implemented.");
         //#endif
         return ReadMonitorDataErrType.OK;
     }
     else
     {
         _fLogService.Info("ReadAll: Hardware Monitor is busy...");
         return ReadMonitorDataErrType.BusyWorking;
     }
 }