public Accdata(ParseProtocal protocol, DataRepo dataRepo, Action <string> log, Dev dev) : base(protocol, dataRepo, log) { _dev = dev; _fluxRunModels = dataRepo.GetKJ370_FluxRunModels(); _lastWriteTime = DateTime.Now; }
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>(); }
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}"); } }
public Ycbjdata(ParseProtocal protocol, DataRepo dataRepo, Action <string> log, Dev dev) : base(protocol, dataRepo, log) { _dev = dev; }
public Kgbhdata(ParseProtocal protocol, DataRepo dataRepo, Action <string> log, Dev dev) : base(protocol, dataRepo, log) { }
public Fzdata(ParseProtocal protocol, DataRepo dataRepo, Action <string> log, Dev dev, Rtdata rtdata) : base(protocol, dataRepo, log) { _dev = dev; _rtdata = rtdata; }