Exemple #1
0
 public TextBenchmarksReport(IPreferences preferences, IProteinService proteinService,
                             IProteinBenchmarkService benchmarkService, ClientConfiguration clientConfiguration) : base(KeyName)
 {
     Preferences         = preferences ?? new InMemoryPreferencesProvider();
     ProteinService      = proteinService ?? NullProteinService.Instance;
     BenchmarkService    = benchmarkService ?? NullProteinBenchmarkService.Instance;
     ClientConfiguration = clientConfiguration;
 }
        public void TimePerSectionTest6()
        {
            _benchmarkService = null;
            var unitInfoLogic = CreateUnitInfoModel(null, new UnitInfo());

            unitInfoLogic.UtcOffsetIsZero  = false;
            unitInfoLogic.ClientTimeOffset = 0;
            Assert.AreEqual(TimeSpan.Zero, unitInfoLogic.GetFrameTime(PpdCalculationType.LastFrame));
        }
Exemple #3
0
        public FahClient(ILogger logger, IPreferences preferences, IProteinBenchmarkService benchmarkService,
                         IProteinService proteinService, IWorkUnitRepository workUnitRepository) : base(logger, preferences, benchmarkService)
        {
            ProteinService     = proteinService;
            WorkUnitRepository = workUnitRepository;
            Messages           = new FahClientMessages(this);

            _slots     = new List <SlotModel>();
            _slotsLock = new ReaderWriterLockSlim();
        }
        public BenchmarksForm(IPreferenceSet prefs, IProteinService proteinService, IProteinBenchmarkService benchmarkService,
                              IClientConfiguration clientConfiguration, IMessageBoxView messageBoxView, IExternalProcessStarter processStarter)
        {
            _prefs               = prefs;
            _proteinService      = proteinService;
            _benchmarkService    = benchmarkService;
            _graphColors         = _prefs.Get <List <Color> >(Preference.GraphColors);
            _clientConfiguration = clientConfiguration;
            _messageBoxView      = messageBoxView;
            _processStarter      = processStarter;
            _zedGraphManager     = new ZedGraphManager();

            InitializeComponent();
            StartPosition = FormStartPosition.Manual;
        }
 private static void UpdateBenchmarkData(IProteinBenchmarkService benchmarkService, ClientEditedEventArgs e)
 {
     // the name changed
     if (e.PreviousName != e.NewName)
     {
         // update the Names in the benchmark collection
         benchmarkService.UpdateOwnerName(e.PreviousName, e.PreviousPath, e.NewName);
     }
     // the path changed
     if (!FileSystemPath.Equal(e.PreviousPath, e.NewPath))
     {
         // update the Paths in the benchmark collection
         benchmarkService.UpdateOwnerPath(e.NewName, e.PreviousPath, e.NewPath);
     }
 }
        public BenchmarksModel(IPreferences preferences, IProteinService proteinService,
                               IProteinBenchmarkService benchmarkService, IEnumerable <BenchmarksReport> reports)
        {
            Preferences      = preferences ?? new InMemoryPreferencesProvider();
            ProteinService   = proteinService ?? NullProteinService.Instance;
            BenchmarkService = benchmarkService ?? NullProteinBenchmarkService.Instance;
            Reports          = reports ?? Array.Empty <BenchmarksReport>();

            SlotIdentifiers            = new BindingSource();
            SlotIdentifiers.DataSource = new BindingList <ListItem> {
                RaiseListChangedEvents = false
            };
            SlotProjects            = new BindingSource();
            SlotProjects.DataSource = new BindingList <ListItem> {
                RaiseListChangedEvents = false
            };
            SelectedSlotProjectListItems = new BindingSourceListItemCollection(SlotProjects);
        }
Exemple #7
0
 public NullClient(ILogger logger, IPreferences preferences, IProteinBenchmarkService benchmarkService)
     : base(logger, preferences, benchmarkService)
 {
 }
Exemple #8
0
 private static BenchmarksModel CreateModel(IProteinService proteinService, IProteinBenchmarkService benchmarkService = null)
 {
     return(new BenchmarksModel(null, proteinService, benchmarkService, null));
 }
 private static BenchmarksModel CreateModel(IProteinService proteinService, IProteinBenchmarkService benchmarkService, IEnumerable <BenchmarksReport> reports = null)
 {
     return(new BenchmarksModel(null, proteinService, benchmarkService, reports));
 }
 private static BenchmarksModel CreateModel(IProteinBenchmarkService benchmarkService = null)
 {
     return(CreateModel(null, benchmarkService));
 }
Exemple #11
0
        private static WorkUnitModel CreateWorkUnitModel(Protein protein, WorkUnit workUnit, IProteinBenchmarkService benchmarkService = null)
        {
            var slotModel = new SlotModel(new NullClient(null, null, benchmarkService)
            {
                Settings = new ClientSettings()
            });

            return(new WorkUnitModel(slotModel, workUnit)
            {
                CurrentProtein = protein ?? new Protein()
            });
        }
        internal static void SubscribeToEvents(this IClientConfiguration configuration, IProteinBenchmarkService benchmarkService)
        {
            configuration.ClientEdited += (s, e) => UpdateBenchmarkData(benchmarkService, e);

            configuration.DictionaryChanged += (s, e) =>
            {
                switch (e.ChangedType)
                {
                case ConfigurationChangedType.Add:
                case ConfigurationChangedType.Edit:
                    if (e.Client != null)
                    {
                        Task.Run(() => e.Client.Retrieve());
                    }
                    break;
                }
            };
        }
Exemple #13
0
 public ProjectComparisonZedGraphBenchmarksReport(IPreferences preferences, IProteinService proteinService, IProteinBenchmarkService benchmarkService)
     : base(KeyName, proteinService, benchmarkService)
 {
     Preferences = preferences ?? new InMemoryPreferencesProvider();
 }
Exemple #14
0
 protected Client(ILogger logger, IPreferences preferences, IProteinBenchmarkService benchmarkService)
 {
     Logger           = logger ?? NullLogger.Instance;
     Preferences      = preferences ?? new InMemoryPreferencesProvider();
     BenchmarkService = benchmarkService ?? new ProteinBenchmarkService(new ProteinBenchmarkDataContainer());
 }
 public void Init()
 {
     _benchmarkService = MockRepository.GenerateStub <IProteinBenchmarkService>();
 }
Exemple #16
0
 public UnitInfoModel(IProteinBenchmarkService benchmarkService)
 {
     _benchmarkService = benchmarkService;
 }
Exemple #17
0
 protected ZedGraphBenchmarksReport(string key, IProteinService proteinService, IProteinBenchmarkService benchmarkService) : base(key)
 {
     ProteinService   = proteinService ?? NullProteinService.Instance;
     BenchmarkService = benchmarkService ?? NullProteinBenchmarkService.Instance;
 }
Exemple #18
0
 public FrameTimeZedGraphBenchmarksReport(IProteinService proteinService, IProteinBenchmarkService benchmarkService)
     : base(KeyName, proteinService, benchmarkService)
 {
 }
Exemple #19
0
 protected ZedGraphBarGraphBenchmarksReport(string key, IProteinService proteinService, IProteinBenchmarkService benchmarkService)
     : base(key, proteinService, benchmarkService)
 {
 }