예제 #1
0
 private void GenerateReport(DateTime finishDateTime)
 {
     Action.Safe(() =>
     {
         RunRepository.OnRunFinished(finishDateTime);
         DataService.SaveRun(RunRepository.CurrentRun);
     });
 }
예제 #2
0
 private void GenerateReport(DateTime finishDateTime)
 {
     Action.Safe(() =>
     {
         RunRepository.OnRunFinished(finishDateTime);
         DataWriterService.SaveRun(RunRepository.CurrentRun);
         Logger.Info($"Report generated at {finishDateTime:yyyy-MM-dd HH:mm:ss.fff}");
     });
 }
예제 #3
0
 public RunMessageProcessor(ILogger <RunMessageProcessor> logger, ILaunchService launchService, RunRepository runRepository,
                            IUnitOfWorkProvider unitOfWorkProvider, IContainer container)
 {
     _logger             = logger;
     _launchService      = launchService;
     _runRepository      = runRepository;
     _unitOfWorkProvider = unitOfWorkProvider;
     _container          = container;
 }
예제 #4
0
 public RunFacade(IUnitOfWorkProvider unitOfWorkProvider, ICurrentUserProvider currentUserProvider,
                  AlgorithmRepository algorithmRepository, RunRepository runRepository, IArgumentTranslator argumentTranslator,
                  ILaunchService launchService)
     : base(unitOfWorkProvider, currentUserProvider)
 {
     _algorithmRepository = algorithmRepository;
     _runRepository       = runRepository;
     _argumentTranslator  = argumentTranslator;
     _launchService       = launchService;
 }
예제 #5
0
 private void InitializeOnRunStarted(DateTime startDateTime)
 {
     Action.Safe(() =>
     {
         RunRepository.OnRunStarted(ReporterSettings, startDateTime);
         TestRunsRepository.OnRunStarted();
         ResourceExtractor.ExtractReportBase(ReporterSettings.OutputPath);
         DataService.SaveReportSettings(ReportSettings);
     });
 }
예제 #6
0
 private void OnTestFinish(TestRunDto testDtoWhenFinished)
 {
     Action.Safe(() =>
     {
         RunRepository.OnTestFinished(testDtoWhenFinished);
         var testDtoWhenStarted = TestRunsRepository.ExtractCorrespondingTestRun(testDtoWhenFinished);
         var finalTest          = TestRunProcessor.Process(testDtoWhenStarted, testDtoWhenFinished, RunRepository.RunGuid);
         DataService.SaveTestRun(finalTest);
     });
 }
예제 #7
0
 private void OnTestFinish(TestRunDto testDtoWhenFinished, TestOutputDto testOutputDto)
 {
     Action.Safe(() =>
     {
         RunRepository.OnTestFinished(testDtoWhenFinished);
         var testDtoWhenStarted = TestRunsRepository.ExtractCorrespondingTestRun(testDtoWhenFinished);
         var finalTest          = TestRunProcessor.Process(testDtoWhenStarted, testDtoWhenFinished, RunRepository.RunGuid);
         Logger.Debug($"Saving test run '{finalTest.Name}' (Guid: {finalTest.TestInfo.Guid})");
         DataWriterService.SaveTestRun(finalTest, testOutputDto);
     });
 }
예제 #8
0
        public void Initialize()
        {
            var options = new DbContextOptionsBuilder <MLOpsDbContext>()
                          .UseInMemoryDatabase(databaseName: "MLOpsNET")
                          .Options;

            this.contextFactory = new DbContextFactory(options, RelationalEntityConfigurator.OnModelCreating);

            this.clockMock = new Mock <IClock>();

            this.sut = new RunRepository(contextFactory, clockMock.Object);
        }
예제 #9
0
 private void InitializeOnRunStarted(DateTime startDateTime)
 {
     Action.Safe(() =>
     {
         Logger.Debug("Reporter is initializing on run start...");
         RunRepository.OnRunStarted(ReporterSettings, startDateTime);
         TestRunsRepository.OnRunStarted();
         ResourceExtractor.ExtractReportBase(ReporterSettings.OutputPath);
         DataWriterService.SaveReportSettings(ReportSettings);
         Logger.Debug($"Reporter initializing done. Output folder is '{ReporterSettings.OutputPath}'. " +
                      $"Data service file: '{ReporterSettings.DataServiceFile}', Logger file: '{ReporterSettings.LoggerFile}'");
     });
 }
예제 #10
0
        public LocalLaunchService(IOptions <AlgorithmOptions> options, IProcessService processService, IUnitOfWorkProvider unitOfWorkProvider,
                                  RunRepository runRepository, ITemporaryFileProvider temporaryFileProvider, IFileStorage fileStorage, IAlgorithmFileProvider algorithmFileProvider,
                                  ILogger <LocalLaunchService> logger, FileSystemWrapper fileSystemWrapper)
        {
            _options            = options;
            _processService     = processService;
            _unitOfWorkProvider = unitOfWorkProvider;
            _runRepository      = runRepository;

            _temporaryFileProvider = temporaryFileProvider;
            _fileStorage           = fileStorage;
            _algorithmFileProvider = algorithmFileProvider;
            _logger            = logger;
            _fileSystemWrapper = fileSystemWrapper;
        }
예제 #11
0
        public async Task Update(Run oRun)
        {
            var oRunRepository = new RunRepository();

            try
            {
                string sNote = String.IsNullOrWhiteSpace(oRun.Note) ? String.Empty : oRun.Note.Trim();

                byte[] aSignatureBytes = (oRun.Signature == null) ? null : oRun.Signature.ToPngBytes();
                await oRunRepository.Update(oRun.Number, sNote, aSignatureBytes);
            }
            catch (Exception)
            {
                throw;
            }
        }
        public void ItShouldCopyAndRename_TheSampleSubmissionMaster_ToTheDocxFolder()
        {
            try
            {
                var run = new RunRepository(new PilotPlantEntities()).DbContext.Runs.FirstOrDefault(r => r.Id == 9);

            }
            catch (Exception ex)
            {

                throw;
            }
            string startingpath =
                "S:\\Research\\Fermentation\\Project--Darwin\\140729_300L_sAA2178_2.50EL-1.76D_NH4OH_1.5xKA1(4.05% D) 5.25gLammoniumsulfate, HighPhosphate_34C";
            FileInfo fi = OfficeHandler.FileIO.SampleSubmissionPlan.FindWordFileInfo(
                "140729_300L_Outline.docx",
                ref startingpath);

            FileInfo retval = OfficeHandler.FileIO.SampleSubmissionPlan.CopySubmissionMasterToRun(fi, "nstein");
            Assert.IsTrue(retval.Name == "140729_300L_Sample_Submission_Nick.xlsx");
        }
예제 #13
0
        public async Task <Run> Instance(int iRunNo)
        {
            var oRunRepository = new RunRepository();

            IDataReader oDataReader = null;

            try
            {
                oDataReader = await oRunRepository.Get(iRunNo);
            }
            catch (Exception)
            {
                throw;
            }

            if (!oDataReader.Read())
            {
                return(null);
            }

            return(new Run(oDataReader));
        }
예제 #14
0
 public Boolean AddRun(Run run)
 => RunRepository.AddRun(run);
예제 #15
0
 public void SetRunName(string runName)
 {
     RunRepository.SetRunName(runName);
 }
예제 #16
0
 public Boolean DeleteRun(UInt32 runID)
 => RunRepository.DeleteRun(runID);
예제 #17
0
 public Run GetRun(UInt32 shooter_id, UInt32 stage_id)
 => RunRepository.GetRun(shooter_id, stage_id);
예제 #18
0
 public Boolean EditRun(Run run, UInt32 shooter_id, UInt32 stage_id)
 => RunRepository.EditRun(run, shooter_id, stage_id);