Пример #1
0
        protected ChartPresenter(
            TView view,
            ChartPresenterContext chartPresenterContext,
            IChartTemplatingTask chartTemplatingTask,
            IIndividualPKAnalysisPresenter pkAnalysisPresenter,
            IChartTask chartTask,
            IObservedDataTask observedDataTask,
            IChartUpdater chartUpdater, bool useSimulationNameToCreateCurveName)
            : base(view, chartPresenterContext)
        {
            _chartTask        = chartTask;
            _observedDataTask = observedDataTask;
            _chartUpdater     = chartUpdater;
            _useSimulationNameToCreateCurveName = useSimulationNameToCreateCurveName;
            _view.SetChartView(chartPresenterContext.EditorAndDisplayPresenter.BaseView);
            _pkAnalysisPresenter = pkAnalysisPresenter;
            _view.SetPKAnalysisView(_pkAnalysisPresenter.View);
            AddSubPresenters(_pkAnalysisPresenter);
            _chartTemplatingTask = chartTemplatingTask;
            _repositoryCache     = new Cache <DataRepository, IndividualSimulation> {
                OnMissingKey = noDataForSimulation
            };

            ChartEditorPresenter.SetShowDataColumnInDataBrowserDefinition(IsColumnVisibleInDataBrowser);
            ChartDisplayPresenter.DragDrop   += OnDragDrop;
            ChartDisplayPresenter.DragOver   += OnDragOver;
            ChartDisplayPresenter.ExportToPDF = () => _chartTask.ExportToPDF(Chart);
            AddAllButtons();
            _chartDisplayMode           = ChartDisplayMode.Chart;
            _observedDataDragDropBinder = new ObservedDataDragDropBinder();
        }
Пример #2
0
        protected override void Context()
        {
            _view = A.Fake <ISimulationTimeProfileChartView>();
            _chartDisplayPresenter          = A.Fake <IChartDisplayPresenter>();
            _pkAnalysisPresenter            = A.Fake <IIndividualPKAnalysisPresenter>();
            _chartEditorPresenter           = A.Fake <IChartEditorPresenter>();
            _chartEditorAndDisplayPresenter = A.Fake <IChartEditorAndDisplayPresenter>();
            _dataColumnToPathElementsMapper = A.Fake <IDataColumnToPathElementsMapper>();
            _chartTask                = A.Fake <IChartTask>();
            _dimensionFactory         = A.Fake <IDimensionFactory>();
            _observedDataTask         = A.Fake <IObservedDataTask>();
            _chartLayoutTask          = A.Fake <IChartEditorLayoutTask>();
            _chartUpdateTask          = A.Fake <IChartUpdater>();
            _presentationSettingsTask = A.Fake <IPresentationSettingsTask>();
            _allTemplates             = new List <ChartEditorLayoutTemplate>();
            A.CallTo(() => _chartLayoutTask.AllTemplates()).Returns(_allTemplates);
            A.CallTo(() => _chartEditorAndDisplayPresenter.EditorPresenter).Returns(_chartEditorPresenter);
            A.CallTo(() => _chartEditorAndDisplayPresenter.DisplayPresenter).Returns(_chartDisplayPresenter);
            A.CallTo(() => _chartEditorPresenter.ColumnSettingsFor(A <BrowserColumns> ._)).Returns(new GridColumnSettings(BrowserColumns.Origin.ToString()));
            A.CallTo(() => _chartEditorPresenter.ColumnSettingsFor(A <AxisOptionsColumns> ._)).Returns(new GridColumnSettings(AxisOptionsColumns.AxisType.ToString()));
            A.CallTo(() => _chartEditorPresenter.ColumnSettingsFor(A <CurveOptionsColumns> ._)).Returns(new GridColumnSettings(CurveOptionsColumns.xData.ToString()));
            _chartTemplatingTask   = A.Fake <IChartTemplatingTask>();
            _projectRetriever      = A.Fake <IProjectRetriever>();
            _chartPresenterContext = new ChartPresenterContext(_chartEditorAndDisplayPresenter, _curveNamer, _dataColumnToPathElementsMapper, _chartTemplatingTask, _presentationSettingsTask, _chartLayoutTask, _projectRetriever, _dimensionFactory);
            _curveNamer            = A.Fake <ICurveNamer>();

            sut = new SimulationTimeProfileChartPresenter(_view, _chartPresenterContext, _pkAnalysisPresenter, _chartTask, _observedDataTask, _chartTemplatingTask, _chartUpdateTask);
        }
        protected override void Context()
        {
            _view = A.Fake <ISimulationTimeProfileChartView>();
            _chartDisplayPresenter          = A.Fake <IChartDisplayPresenter>();
            _pkAnalysisPresenter            = A.Fake <IIndividualPKAnalysisPresenter>();
            _chartEditorPresenter           = A.Fake <IChartEditorPresenter>();
            _chartEditorAndDisplayPresenter = A.Fake <IChartEditorAndDisplayPresenter>();
            A.CallTo(() => _chartEditorAndDisplayPresenter.Control).Returns(new Control());
            _dataColumnToPathElementsMapper = A.Fake <IDataColumnToPathElementsMapper>();
            _quantityDisplayPathMapper      = A.Fake <IQuantityPathToQuantityDisplayPathMapper>();
            _chartTask        = A.Fake <IChartTask>();
            _observedDataTask = A.Fake <IObservedDataTask>();
            _chartLayoutTask  = A.Fake <IChartEditorLayoutTask>();
            _allTemplates     = new List <ChartEditorLayoutTemplate>();
            A.CallTo(() => _chartLayoutTask.AllTemplates()).Returns(_allTemplates);
            A.CallTo(() => _chartEditorAndDisplayPresenter.EditorPresenter).Returns(_chartEditorPresenter);
            A.CallTo(() => _chartEditorAndDisplayPresenter.DisplayPresenter).Returns(_chartDisplayPresenter);
            A.CallTo(() => _chartEditorPresenter.GetDataBrowserColumnSettings(A <BrowserColumns> .Ignored)).Returns(new GridColumnSettings(BrowserColumns.Origin.ToString()));
            A.CallTo(() => _chartEditorPresenter.GetAxisOptionsColumnSettings(A <AxisOptionsColumns> .Ignored)).Returns(new GridColumnSettings(AxisOptionsColumns.AxisType.ToString()));
            A.CallTo(() => _chartEditorPresenter.GetCurveOptionsColumnSettings(A <CurveOptionsColumns> .Ignored)).Returns(new GridColumnSettings(CurveOptionsColumns.xData.ToString()));
            _chartTemplatingTask   = A.Fake <IChartTemplatingTask>();
            _projectRetriever      = A.Fake <IProjectRetriever>();
            _userSettings          = A.Fake <IUserSettings>();
            _chartPresenterContext = A.Fake <ChartPresenterContext>();

            A.CallTo(() => _chartPresenterContext.ChartEditorAndDisplayPresenter).Returns(_chartEditorAndDisplayPresenter);
            A.CallTo(() => _chartPresenterContext.QuantityDisplayPathMapper).Returns(_quantityDisplayPathMapper);
            A.CallTo(() => _chartPresenterContext.EditorLayoutTask).Returns(_chartLayoutTask);
            A.CallTo(() => _chartPresenterContext.TemplatingTask).Returns(_chartTemplatingTask);
            A.CallTo(() => _chartPresenterContext.ProjectRetriever).Returns(_projectRetriever);

            sut = new SimulationTimeProfileChartPresenter(_view, _chartPresenterContext, _pkAnalysisPresenter, _chartTask, _observedDataTask, _chartTemplatingTask, _userSettings);
        }
        protected override void Context()
        {
            _view                           = A.Fake <IIndividualSimulationComparisonView>();
            _chartPresenter                 = A.Fake <IChartEditorAndDisplayPresenter>();
            _pkAnalysisPresenter            = A.Fake <IIndividualPKAnalysisPresenter>();
            _curveNamer                     = A.Fake <ICurveNamer>();
            _chartTask                      = A.Fake <IChartTask>();
            _observedDataTask               = A.Fake <IObservedDataTask>();
            _lazyLoadTask                   = A.Fake <ILazyLoadTask>();
            _chartLayoutTask                = A.Fake <IChartEditorLayoutTask>();
            _chartTemplatingTask            = A.Fake <IChartTemplatingTask>();
            _dataColumnToPathElementsMapper = A.Fake <IDataColumnToPathElementsMapper>();
            _projectRetriever               = A.Fake <IProjectRetriever>();
            _chartPresenterContext          = A.Fake <ChartPresenterContext>();
            _chartUpdateTask                = A.Fake <IChartUpdater>();
            _userSettings                   = A.Fake <IUserSettings>();
            A.CallTo(() => _chartPresenterContext.EditorAndDisplayPresenter).Returns(_chartPresenter);
            A.CallTo(() => _chartPresenterContext.CurveNamer).Returns(_curveNamer);
            A.CallTo(() => _chartPresenterContext.EditorLayoutTask).Returns(_chartLayoutTask);
            A.CallTo(() => _chartPresenterContext.TemplatingTask).Returns(_chartTemplatingTask);
            A.CallTo(() => _chartPresenterContext.ProjectRetriever).Returns(_projectRetriever);

            sut = new IndividualSimulationComparisonPresenter(_view, _chartPresenterContext, _pkAnalysisPresenter,
                                                              _chartTask, _observedDataTask, _lazyLoadTask, _chartTemplatingTask, _chartUpdateTask, _userSettings);
        }
 public SimulationTimeProfileChartPresenter(ISimulationTimeProfileChartView view, ChartPresenterContext chartPresenterContext, IIndividualPKAnalysisPresenter pkAnalysisPresenter, IChartTask chartTask, IObservedDataTask observedDataTask, IChartTemplatingTask chartTemplatingTask, IChartUpdater chartUpdateTask) :
     base(view, chartPresenterContext, chartTemplatingTask, pkAnalysisPresenter, chartTask, observedDataTask, chartUpdateTask, useSimulationNameToCreateCurveName: false)
 {
     PresentationKey = PresenterConstants.PresenterKeys.SimulationTimeProfileChartPresenter;
 }
Пример #6
0
 public IndividualSimulationComparisonPresenter(IIndividualSimulationComparisonView view, ChartPresenterContext chartPresenterContext, IIndividualPKAnalysisPresenter pkAnalysisPresenter, IChartTask chartTask, IObservedDataTask observedDataTask, ILazyLoadTask lazyLoadTask, IChartTemplatingTask chartTemplatingTask, IChartUpdater chartUpdater, IUserSettings userSettings) :
     base(view, chartPresenterContext, chartTemplatingTask, pkAnalysisPresenter, chartTask, observedDataTask, chartUpdater, useSimulationNameToCreateCurveName: true, userSettings)
 {
     _lazyLoadTask   = lazyLoadTask;
     PresentationKey = PresenterConstants.PresenterKeys.IndividualSimulationComparisonPresenter;
 }
Пример #7
0
 public SimulationTimeProfileChartPresenter(ISimulationTimeProfileChartView view, ChartPresenterContext chartPresenterContext, IIndividualPKAnalysisPresenter pkAnalysisPresenter, IChartTask chartTask, IObservedDataTask observedDataTask, IChartTemplatingTask chartTemplatingTask, IUserSettings userSettings) :
     base(view, chartPresenterContext, chartTemplatingTask, pkAnalysisPresenter, chartTask, observedDataTask, userSettings)
 {
     PresentationKey = PresenterConstants.PresenterKeys.SimulationTimeProfileChartPresenter;
 }