示例#1
0
 public Accdata(ParseProtocal protocol, DataRepo dataRepo, Action <string> log, Dev dev)
     : base(protocol, dataRepo, log)
 {
     _dev           = dev;
     _fluxRunModels = dataRepo.GetKJ370_FluxRunModels();
     _lastWriteTime = DateTime.Now;
 }
示例#2
0
 public Rtdata(ParseProtocal protocol, DataRepo dataRepo, Action <string> log, Dev dev)
     : base(protocol, dataRepo, log)
 {
     _dev               = dev;
     RealDatas          = new List <KJ370_RealDataModel>();
     _startTime         = DateTime.Now;
     FluxRealDataModels = new List <KJ370_FluxRealDataModel>();
 }
示例#3
0
 private void TaskBody()
 {
     try
     {
         var  dev      = new Dev(this, _repo, _log);
         var  rtdata   = new Rtdata(this, _repo, _log, dev);
         Base accdata  = new Accdata(this, _repo, _log, dev);
         Base fzdata   = new Fzdata(this, _repo, _log, dev, rtdata);
         Base kgbhdata = new Kgbhdata(this, _repo, _log, dev);
         Base ycbjdata = new Ycbjdata(this, _repo, _log, dev);
         Base unknown  = new Unknown(this, _repo, _log);
         dev.SetSuccessor(rtdata);
         rtdata.SetSuccessor(accdata);
         accdata.SetSuccessor(fzdata);
         fzdata.SetSuccessor(kgbhdata);
         kgbhdata.SetSuccessor(ycbjdata);
         ycbjdata.SetSuccessor(unknown);
         while (!_cts.IsCancellationRequested)
         {
             _repo.HandleYearDapper();
             var files = GetFilesFromDir(Config.MonitorFilePath, Config.FileExtension);
             if (!files.Any())
             {
                 Thread.Sleep(500);
                 continue;
             }
             try
             {
                 foreach (var file in files)
                 {
                     _log($"处理文件 {file}");
                     // 处理接收到的文件
                     if (dev != null)
                     {
                         dev.HandleFile(file);
                     }
                 }
             }
             catch (Exception ex)
             {
                 _log($"处理文件出错:{ex}");
             }
             Thread.Sleep(1000);
         }
     }
     catch (Exception ex)
     {
         _log($"Load:{ex}");
     }
 }
示例#4
0
 public Ycbjdata(ParseProtocal protocol, DataRepo dataRepo, Action <string> log, Dev dev)
     : base(protocol, dataRepo, log)
 {
     _dev = dev;
 }
示例#5
0
 public Kgbhdata(ParseProtocal protocol, DataRepo dataRepo, Action <string> log, Dev dev)
     : base(protocol, dataRepo, log)
 {
 }
示例#6
0
 public Fzdata(ParseProtocal protocol, DataRepo dataRepo, Action <string> log, Dev dev, Rtdata rtdata)
     : base(protocol, dataRepo, log)
 {
     _dev    = dev;
     _rtdata = rtdata;
 }