protected BaseAnalyzerTests() { ListStorage = new ListStorage <FlashObservation>(); ListStorage.AddRange(FlashObservationBaseData.InitializeFlashObservations()); _analyzer = this.GetAnalyzer(); }
public RegisteredSourceProcessingGroup(RegisteredEnergyObservationSourceWrapper sourceRegistration, IProcessingFactory factory) { _sourceRegistration = sourceRegistration; Processor = factory.CreateProcessor(); Storage = factory.CreateStorage(); Analizer = factory.CreateAnalizer(); _processorSubscription = _sourceRegistration.Subscribe(Processor); }
public RegisteredSourceProcessingGroup(RegisteredEnergyObservationSourceWrapper <T> sourceRegistration, IProcessingFactory <T> factory) { _sourceRegistration = sourceRegistration ?? throw new ArgumentNullException(nameof(sourceRegistration)); if (factory == null) { throw new ArgumentNullException(nameof(factory)); } Processor = factory.CreateProcessor(); Storage = factory.CreateStorage(); Analizer = factory.CreateAnalizer(); _processorSubscription = _sourceRegistration.Subscribe(Processor); }
public ResearcherService(IEnergyObservationAnalizer analizer, IMapper mapper) { _analizer = analizer; _mapper = mapper; }
private static void ShowAnalizerResult(IEnergyObservationAnalizer analizer) { Console.Clear(); Console.WriteLine("Select and press 'Enter' button:"); Console.WriteLine("1 - GetAverageEnergy"); Console.WriteLine("2 - GetDistributionByCoordinates"); Console.WriteLine("3 - GetDistributionByEnergyValue"); Console.WriteLine("4 - GetDistributionByObservationTime"); Console.WriteLine("5 - GetMaxEnergy"); Console.WriteLine("6 - GetMaxEnergyPosition"); Console.WriteLine("7 - GetMaxEnergyTime"); Console.WriteLine("8 - GetMinEnergy"); Console.WriteLine("9 - GetMinEnergyPosition"); Console.WriteLine("10 - GetMinEnergyTime"); Console.WriteLine("something another - exit"); var exit = false; while (!exit) { int menuIndex = 0; var userChoice = Console.ReadLine(); var isParsed = int.TryParse(userChoice, out menuIndex); if (isParsed) { switch (menuIndex) { case 1: Console.WriteLine(" Average energy is: " + analizer.GetAverageEnergy()); break; case 2: Console.WriteLine("Distribution by coordinates is:"); analizer.GetDistributionByCoordinates().PrintDistribution("Coordinates"); break; case 3: Console.WriteLine("Distribution by energy value is:"); analizer.GetDistributionByEnergyValue().PrintDistribution("Energy value"); break; case 4: Console.WriteLine("Distribution by observation time is:"); analizer.GetDistributionByObservationTime().PrintDistribution("Observation time"); break; case 5: Console.WriteLine(" Max energy is: " + analizer.GetMaxEnergy()); break; case 6: Console.WriteLine(" Max energy position is: " + analizer.GetMaxEnergyPosition()); break; case 7: Console.WriteLine(" Max energyTime is: " + analizer.GetMaxEnergyTime()); break; case 8: Console.WriteLine(" Min energy is: " + analizer.GetMinEnergy()); break; case 9: Console.WriteLine(" Position of min energy is: " + analizer.GetMinEnergyPosition()); break; case 10: Console.WriteLine(" Time of min energy is: " + analizer.GetMinEnergyTime()); break; } } else { exit = true; Console.Clear(); ShowMainMenu(); } } }
private static void ProcessAnalyzer(IEnergyObservationAnalizer analizer) { Console.Clear(); Console.WriteLine("Choose method"); Console.WriteLine("1 - GetAverageEnergy"); Console.WriteLine("2 - GetDistributionByCoordinates"); Console.WriteLine("3 - GetDistributionByEnergyValue"); Console.WriteLine("4 - GetDistributionByObservationTime"); Console.WriteLine("5 - GetMaxEnergy"); Console.WriteLine("6 - GetMaxEnergyPosition"); Console.WriteLine("7 - GetMaxEnergyTime"); Console.WriteLine("8 - GetMinEnergy"); Console.WriteLine("9 - GetMinEnergyPosition"); Console.WriteLine("10 - GetMinEnergyTime"); Console.WriteLine("Anything else to exit"); var userChoiceToExit = false; while (!userChoiceToExit) { if (TryReadUserInput(0, 10, out int userChoice)) { switch (userChoice) { case 1: Console.WriteLine(analizer.GetAverageEnergy()); break; case 2: WriteLineDictionary(analizer.GetDistributionByCoordinates()); break; case 3: WriteLineDictionary(analizer.GetDistributionByEnergyValue()); break; case 4: WriteLineDictionary(analizer.GetDistributionByObservationTime()); break; case 5: Console.WriteLine(analizer.GetMaxEnergy()); break; case 6: Console.WriteLine(analizer.GetMaxEnergyPosition()); break; case 7: Console.WriteLine(analizer.GetMaxEnergyTime()); break; case 8: Console.WriteLine(analizer.GetMinEnergy()); break; case 9: Console.WriteLine(analizer.GetMinEnergyPosition()); break; case 10: Console.WriteLine(analizer.GetMinEnergyTime()); break; } } else { userChoiceToExit = true; } } }
public LogEnergyObservationAnalyzerDecorator(IEnergyObservationAnalizer innerAnalyzer, ILogger logger) { _innerAnalyzer = innerAnalyzer ?? throw new ArgumentNullException(nameof(innerAnalyzer)); _logger = logger ?? throw new ArgumentNullException(nameof(logger)); }
public EnergyObservationAnalyzerController(IEnergyObservationAnalizer analyzer) { _analyzer = analyzer; }