Esempio n. 1
0
        public static async Task WriteLineAsync(this IDataPresenter dataPresenter, string s)
        {
            var logText     = dataPresenter.GetLogText();
            var textHandler = dataPresenter.Handlers.LogTextHandler;

            s = logText + (string.IsNullOrEmpty(logText) ? "" : "\r\n") + s;
            await textHandler.TextChangedAsync(s);
        }
Esempio n. 2
0
        public static async Task WriteErrorsAsync(this IDataPresenter dataPresenter, IErrorsAndInfos errorsAndInfos)
        {
            var errors = errorsAndInfos.Errors.ToList();

            foreach (var error in errors)
            {
                await dataPresenter.WriteLineAsync(error);
            }
        }
Esempio n. 3
0
 public DataCollector(IDataPresenter dataPresenter, IPostingCollector postingCollector, ISummaryCalculator summaryCalculator, IAverageCalculator averageCalculator,
                      IMonthlyDeltaCalculator monthlyDeltaCalculator, IClassifiedPostingsCalculator classifiedPostingsCalculator, ICalculationLogger calculationLogger)
 {
     DataPresenter                = dataPresenter;
     PostingCollector             = postingCollector;
     SummaryCalculator            = summaryCalculator;
     AverageCalculator            = averageCalculator;
     MonthlyDeltaCalculator       = monthlyDeltaCalculator;
     ClassifiedPostingsCalculator = classifiedPostingsCalculator;
     CalculationLogger            = calculationLogger;
 }
Esempio n. 4
0
 public Startup(ILogger <Startup> logger,
                IDataLoader dataLoader,
                IDataPresenter dataPresenter,
                IStorageRepository storageRepository,
                IOutputFormatter outputFormatter)
 {
     _logger            = logger;
     _dataLoader        = dataLoader;
     _dataPresenter     = dataPresenter;
     _storageRepository = storageRepository;
     _outputFormatter   = outputFormatter;
 }
Esempio n. 5
0
 // TODO WTS: Change the chart as appropriate to your app.
 // For help see http://docs.telerik.com/windows-universal/controls/radchart/getting-started
 public MeasurePage()
 {
     InitializeComponent();
     graphCoordinates = new List <XYDTO>(); //kat
     BC_             = new BlockingCollection <int>();
     producer_       = new producer(BC_);
     dataprocessor_  = new DataProcessor(BC_);
     datacalculator_ = new DataCalculator(dataprocessor_);
     datapresenter_  = new DataPresenter(datacalculator_);
     //zeroPointAdjustment_ = new ZeroPointAdjustment();
     //datapresenter_.sendCoordinate += updateGraph;
     coordinateDownSampling         = new List <double>();
     datapresenter_.sendCoordinate += sampleDown;
     MuscleForceChart.DataContext   = downSampledCoordinate;
 }
        private static void CreatePresenterInstances(IApplicationController applicationController,
                                                     IGraphControlFormView formView,
                                                     IGraphControlView controlView,
                                                     IScalingSelectionView scalingView,
                                                     IGraphControlFormState graphControlFormState,
                                                     IScalingState scalingState,
                                                     IDataService dataService,
                                                     IScaleService scaleService,
                                                     IBufferedDrawingService bufferedDrawingService,
                                                     IBackgroundPresenter backgroundPresenter,
                                                     IGridPresenter gridPresenter,
                                                     IDataPresenter dataPresenter)
        {
            var scalingPresenter = new ScalingSelectionPresenter(scalingView, scalingState, controlView, scaleService);

            applicationController.RegisterInstance <IScalingSelectionPresenter>(scalingPresenter);

            var graphControlPresenter = new GraphControlPresenter(applicationController,
                                                                  controlView,
                                                                  dataService,
                                                                  scaleService,
                                                                  bufferedDrawingService,
                                                                  backgroundPresenter,
                                                                  gridPresenter,
                                                                  dataPresenter,
                                                                  scalingPresenter
                                                                  );

            applicationController.RegisterInstance <IGraphControlPresenter>(graphControlPresenter);

            var graphControlFormPresenter = new GraphControlFormPresenter(
                applicationController,
                formView,
                graphControlFormState,
                graphControlPresenter
                );

            applicationController.RegisterInstance <GraphControlFormPresenter>(graphControlFormPresenter);
        }
        public GraphControlPresenter(IApplicationController controller,
                                     IGraphControlView view,
                                     IDataService dataService,
                                     IScaleService scaleService,
                                     IBufferedDrawingService bufferedDrawingService,
                                     IBackgroundPresenter backgroundPresenter,
                                     IGridPresenter gridPresenter,
                                     IDataPresenter dataPresenter,
                                     IScalingSelectionPresenter scalingSelectionPresenter) : base(controller, view)
        {
            if (dataService == null)
            {
                throw new InvalidArgumentException("data sevice is null");
            }
            this.scaleService              = scaleService;
            this.backgroundPresenter       = backgroundPresenter;
            this.gridPresenter             = gridPresenter;
            this.dataPresenter             = dataPresenter;
            this.scalingSelectionPresenter = scalingSelectionPresenter;

            dataService.DataUpdated += GraphControlPresenter_DataUpdated;

            this.View.DrawGraph          += View_DrawGraph;
            this.View.ControlSizeChanged += View_ControlSizeChanged;

            this.View.MouseDown  += this.scalingSelectionPresenter.MouseDown;
            this.View.MouseMove  += this.scalingSelectionPresenter.MouseMove;
            this.View.MouseUp    += this.scalingSelectionPresenter.MouseUp;
            this.View.MouseWheel += this.scalingSelectionPresenter.MouseWheel;

            if (bufferedDrawingService == null)
            {
                throw new InvalidArgumentException("parameter is null");
            }
            this.bufferedDrawingService              = bufferedDrawingService;
            this.bufferedDrawingService.UpdateScale += BufferedDrawingService_UpdateScale;
            this.bufferedDrawingService.DrawGraph   += BufferedDrawingService_DrawGraph;
            this.bufferedDrawingService.SetImage    += BufferedDrawingService_SetImage;
        }
        private static void CreateViewInstances(IApplicationController applicationController,
                                                IGraphControlView controlView,
                                                IDataService dataService,
                                                IScaleService scaleService,
                                                IBackgroundView userBackgroundView,
                                                IGridView userGridView,
                                                IDataView userDataView,
                                                IScalingSelectionView userScalingSelectionView,
                                                IBackgroundState userBackgroundState,
                                                IGridState userGridState,
                                                IDataDrawState userDataDrawState,
                                                out IBackgroundPresenter backgroundPresenter,
                                                out IGridPresenter gridPresenter,
                                                out IDataPresenter dataPresenter,
                                                out IScalingSelectionView scalingView)
        {
            var backgroundView = userBackgroundView ?? new BackgroundView();

            backgroundPresenter = new BackgroundPresenter(backgroundView, userBackgroundState);
            applicationController.RegisterInstance <IBackgroundPresenter>(backgroundPresenter);

            var gridView = userGridView ?? new GridView(scaleService);

            gridPresenter = new GridPresenter(gridView, userGridState);
            applicationController.RegisterInstance <IGridPresenter>(gridPresenter);

            var dataView = userDataView ?? new DataView(scaleService, dataService);

            dataPresenter = new DataPresenter(dataView, userDataDrawState, dataService);
            applicationController.RegisterInstance <IDataPresenter>(dataPresenter);

            scalingView = userScalingSelectionView ?? new ScalingView();

            // Register IGraphControlView here
            applicationController.RegisterInstance <IGraphControlView>(controlView);
        }
Esempio n. 9
0
 public ClassifiedPostingsCalculator(IDataPresenter dataPresenter, IPostingClassificationMatcher postingClassificationMatcher)
 {
     DataPresenter = dataPresenter;
     PostingClassificationMatcher = postingClassificationMatcher;
 }
Esempio n. 10
0
 public PostingCollector(IDataPresenter dataPresenter)
 {
     DataPresenter = dataPresenter;
 }
Esempio n. 11
0
 public AverageCalculator(IDataPresenter dataPresenter, IPostingAggregator postingAggregator)
 {
     DataPresenter     = dataPresenter;
     PostingAggregator = postingAggregator;
 }
Esempio n. 12
0
 public SampleDataAggregator(IDataPresenter presenter)
 {
     this._presenter = presenter;
 }
Esempio n. 13
0
 public SummaryCalculator(IDataPresenter dataPresenter, IPostingAggregator postingAggregator, IPostingClassificationMatcher postingClassificationMatcher)
 {
     DataPresenter                = dataPresenter;
     PostingAggregator            = postingAggregator;
     PostingClassificationMatcher = postingClassificationMatcher;
 }
Esempio n. 14
0
 public MonthlyDeltaCalculator(IDataPresenter dataPresenter, IPostingAggregator postingAggregator, IPostingClassificationMatcher postingClassificationMatcher)
 {
     DataPresenter                = dataPresenter;
     PostingAggregator            = postingAggregator;
     PostingClassificationMatcher = postingClassificationMatcher;
 }