예제 #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);
        }
예제 #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);
            }
        }
예제 #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;
 }
예제 #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;
 }
예제 #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;
 }
예제 #6
0
        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);
        }
예제 #7
0
        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;
        }
예제 #8
0
        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);
        }
예제 #9
0
 public ClassifiedPostingsCalculator(IDataPresenter dataPresenter, IPostingClassificationMatcher postingClassificationMatcher)
 {
     DataPresenter = dataPresenter;
     PostingClassificationMatcher = postingClassificationMatcher;
 }
예제 #10
0
 public PostingCollector(IDataPresenter dataPresenter)
 {
     DataPresenter = dataPresenter;
 }
예제 #11
0
 public AverageCalculator(IDataPresenter dataPresenter, IPostingAggregator postingAggregator)
 {
     DataPresenter     = dataPresenter;
     PostingAggregator = postingAggregator;
 }
예제 #12
0
 public SampleDataAggregator(IDataPresenter presenter)
 {
     this._presenter = presenter;
 }
예제 #13
0
 public SummaryCalculator(IDataPresenter dataPresenter, IPostingAggregator postingAggregator, IPostingClassificationMatcher postingClassificationMatcher)
 {
     DataPresenter                = dataPresenter;
     PostingAggregator            = postingAggregator;
     PostingClassificationMatcher = postingClassificationMatcher;
 }
예제 #14
0
 public MonthlyDeltaCalculator(IDataPresenter dataPresenter, IPostingAggregator postingAggregator, IPostingClassificationMatcher postingClassificationMatcher)
 {
     DataPresenter                = dataPresenter;
     PostingAggregator            = postingAggregator;
     PostingClassificationMatcher = postingClassificationMatcher;
 }