Exemple #1
0
        public CalculatedParameterValuePresenter(ICalculatedParameterValueView view, IMultiParameterEditPresenter multiParameterEditPresenter) : base(view)
        {
            _multiParameterEditPresenter = multiParameterEditPresenter;
            _multiParameterEditPresenter.IsSimpleEditor = true;

            _view.SetParameterView(_multiParameterEditPresenter.BaseView);
        }
Exemple #2
0
        protected override void Context()
        {
            _view = A.Fake <ISimulationExpressionsView>();
            _simulationExpressionsDTOMapper = A.Fake <IExpressionParametersToSimulationExpressionsDTOMapper>();
            _editParameterPresenterTask     = A.Fake <IEditParameterPresenterTask>();
            _moleculeExpressionTask         = A.Fake <IMoleculeExpressionTask <Individual> >();
            _entityPathResolver             = A.Fake <IEntityPathResolver>();
            _parameterTask = A.Fake <IParameterTask>();
            _moleculeParametersPresenter = A.Fake <IMultiParameterEditPresenter>();
            _commandCollector            = A.Fake <ICommandCollector>();
            sut = new SimulationExpressionsPresenter(_view, _simulationExpressionsDTOMapper, _editParameterPresenterTask, _moleculeExpressionTask, _entityPathResolver, _parameterTask, _moleculeParametersPresenter);

            sut.InitializeWith(_commandCollector);

            _simulationExpressionDTO = new SimulationExpressionsDTO(new ParameterDTO(_propertyParameter), new ParameterDTO(_propertyParameter), new ParameterDTO(_propertyParameter),
                                                                    new List <ExpressionContainerDTO>());

            _propertyParameter           = DomainHelperForSpecs.ConstantParameterWithValue().WithName("PROP");
            _relativeExpressionParameter = DomainHelperForSpecs.ConstantParameterWithValue().WithName("REL_EXP");
            _allParameters = new List <IParameter> {
                _propertyParameter, _relativeExpressionParameter
            };
            _pathCache = new PathCacheForSpecs <IParameter>();

            A.CallTo(() => _parameterTask.PathCacheFor(A <IEnumerable <IParameter> > .That.Matches(x => x.ContainsAll(_allParameters)))).Returns(_pathCache);
            A.CallTo(() => _simulationExpressionsDTOMapper.MapFrom(A <IEnumerable <IParameter> > .That.Matches(x => x.ContainsAll(_allParameters)))).Returns(_simulationExpressionDTO);
        }
Exemple #3
0
        protected override void Context()
        {
            _view                        = A.Fake <IFavoriteParametersView>();
            _parameterTask               = A.Fake <IParameterTask>();
            _favoriteRepository          = A.Fake <IFavoriteRepository>();
            _multiParameterEditPresenter = A.Fake <IMultiParameterEditPresenter>();
            _favoriteTask                = A.Fake <IFavoriteTask>();

            sut = new FavoriteParametersPresenter(_view, _multiParameterEditPresenter, _parameterTask, _favoriteRepository, _favoriteTask);

            _par1       = new PKSimParameter().WithName("par1");
            _par2       = new PKSimParameter().WithName("par2");
            _par3       = new PKSimParameter().WithName("par3");
            _parameters = new List <IParameter> {
                _par1, _par2, _par3
            };
            var pathCache = new PathCache <IParameter>(A.Fake <IEntityPathResolver>())
            {
                { "par1", _par1 }, { "par2", _par2 }, { "par3", _par3 }
            };

            A.CallTo(() => _parameterTask.PathCacheFor(_parameters)).Returns(pathCache);
            _favorites = new List <string>();
            A.CallTo(() => _favoriteRepository.All()).Returns(_favorites);

            A.CallTo(() => _multiParameterEditPresenter.Edit(A <IEnumerable <IParameter> > ._))
            .Invokes(x => _allEditedParameters = x.GetArgument <IEnumerable <IParameter> >(0));
        }
Exemple #4
0
 public MolWeightHalogensPresenter(IMolWeightHalogensView view, IMultiParameterEditPresenter paramEditPresenter) : base(view)
 {
     _paramEditPresenter = paramEditPresenter;
     _paramEditPresenter.IsSimpleEditor = true;
     _paramEditPresenter.StatusChanged += OnStatusChanged;
     view.FillWithParameterView(paramEditPresenter.View);
 }
 protected override void Context()
 {
     _formulationParametersPresenter = A.Fake <IMultiParameterEditPresenter>();
     _view = A.Fake <ITableFormulationView>();
     _tableParameterPresenter = A.Fake <ITableFormulationParameterPresenter>();
     sut = new TableFormulationPresenter(_view, _tableParameterPresenter, _formulationParametersPresenter);
 }
 protected override void Context()
 {
     _multiEditPresenter            = A.Fake <IMultiParameterEditPresenter>();
     _parameterGroupPresenterMapper = A.Fake <IParameterGroupToCustomableParametersPresenter>();
     _containerPresentrMapper       = A.Fake <IContainerToCustomableParametersPresenterMapper>();
     _multiEditPresenterFactory     = A.Fake <IMultiParameterEditPresenterFactory>();
     A.CallTo(() => _multiEditPresenterFactory.Create()).Returns(_multiEditPresenter);
     sut = new NodeToCustomableParametersPresenterMapper(_containerPresentrMapper, _parameterGroupPresenterMapper, _multiEditPresenterFactory);
 }
Exemple #7
0
 public MolWeightHalogensPresenter(IMolWeightHalogensView view, IMultiParameterEditPresenter parameterEditPresenter) : base(view)
 {
     _parameterEditPresenter = parameterEditPresenter;
     _parameterEditPresenter.IsSimpleEditor     = true;
     _parameterEditPresenter.ValueOriginVisible = false;
     _parameterEditPresenter.HeaderVisible      = false;
     AddSubPresenters(_parameterEditPresenter);
     view.FillWithParameterView(parameterEditPresenter.View);
 }
 public AdvancedParameterPresenter(IAdvancedParameterView view, IAdvancedParameterToAdvancedParameterDTOMapper advancedParameterDTOMapper,
                                   IEditDistributionParametersPresenter distributionParameterPresenter)
     : base(view)
 {
     _advancedParameterDTOMapper     = advancedParameterDTOMapper;
     _distributionParameterPresenter = distributionParameterPresenter;
     _view.AddParameterView(_distributionParameterPresenter.View);
     RemoveSelection();
 }
Exemple #9
0
 protected CompoundAdvancedParameterGroupPresenter(TView view, IRepresentationInfoRepository representationInfoRepository,
                                                   IMultiParameterEditPresenter parameterEditPresenter, IParameterGroupTask parameterGroupTask,
                                                   string groupName)
     : base(view)
 {
     _parameterEditPresenter = parameterEditPresenter;
     _parameterGroupTask     = parameterGroupTask;
     _parameterEditPresenter.IsSimpleEditor = true;
     _groupName   = groupName;
     View.Caption = representationInfoRepository.DisplayNameFor(RepresentationObjectType.GROUP, _groupName);
     View.SetParameterView(_parameterEditPresenter.View);
 }
Exemple #10
0
 public SimpleProtocolPresenter(ISimpleProtocolView view,
                                IMultiParameterEditPresenter dynamicParameterPresenter,
                                ISimpleProtocolToSimpleProtocolDTOMapper simpleProtocolDTOMapper,
                                IProtocolTask protocolTask, IParameterTask parameterTask,
                                IIndividualFactory individualFactory, IRepresentationInfoRepository representationInfoRepository)
     : base(view, protocolTask, parameterTask, individualFactory, representationInfoRepository)
 {
     _simpleProtocolDTOMapper   = simpleProtocolDTOMapper;
     _dynamicParameterPresenter = dynamicParameterPresenter;
     _dynamicParameterPresenter.IsSimpleEditor     = true;
     _dynamicParameterPresenter.ValueOriginVisible = false;
     _dynamicParameterPresenter.HeaderVisible      = false;
     _view.AddDynamicParameterView(_dynamicParameterPresenter.View);
 }
 public SimpleProtocolPresenter(ISimpleProtocolView view,
                                IMultiParameterEditPresenter dynamicParameterPresenter,
                                ISimpleProtocolToSimpleProtocolDTOMapper simpleProtocolDTOMapper,
                                IProtocolTask protocolTask, IParameterTask parameterTask,
                                IIndividualFactory individualFactory, IRepresentationInfoRepository representationInfoRepository)
     : base(view, protocolTask, parameterTask)
 {
     _simpleProtocolDTOMapper                  = simpleProtocolDTOMapper;
     _representationInfoRepository             = representationInfoRepository;
     _dynamicParameterPresenter                = dynamicParameterPresenter;
     _dynamicParameterPresenter.IsSimpleEditor = true;
     _view.AddDynamicParameterView(_dynamicParameterPresenter.View);
     _defaultIndivdual = individualFactory.CreateParameterLessIndividual();
 }
        public TableFormulationPresenter(ITableFormulationView view, ITableFormulationParameterPresenter tableParameterPresenter, IMultiParameterEditPresenter formulationParametersPresenter) :
            base(view)
        {
            _tableParameterPresenter        = tableParameterPresenter;
            _formulationParametersPresenter = formulationParametersPresenter;
            _tableParameterPresenter.ConfigureCreatedTableAction = addZeroPointToTable;
            _formulationParametersPresenter.IsSimpleEditor       = true;
            _formulationParametersPresenter.RowIndicatorVisible  = false;
            _view.AddParametersView(_formulationParametersPresenter.BaseView);
            _view.AddTableView(_tableParameterPresenter.BaseView);

            AddSubPresenters(_tableParameterPresenter, _formulationParametersPresenter);
            _tableParameterPresenter.Description    = PKSimConstants.UI.ImportFormulationDescription;
            _tableParameterPresenter.ImportToolTip  = PKSimConstants.UI.ImportFormulation;
            _tableParameterPresenter.StatusChanged += (o, e) => TableFormulaChanged(this, e);
        }
Exemple #13
0
 protected override void Context()
 {
     _view                                    = A.Fake <ISimpleProtocolView>();
     _schemaDTOMapper                         = A.Fake <ISchemaToSchemaDTOMapper>();
     _protocolTask                            = A.Fake <IProtocolTask>();
     _parameterTask                           = A.Fake <IParameterTask>();
     _individualFactory                       = A.Fake <IIndividualFactory>();
     _representationInfoRepository            = A.Fake <IRepresentationInfoRepository>();
     _dynamicParameterPresenter               = A.Fake <IMultiParameterEditPresenter>();
     _simpleProtocolToSimpleProtocolDTOMapper = A.Fake <ISimpleProtocolToSimpleProtocolDTOMapper>();
     _individual                              = DomainHelperForSpecs.CreateIndividual();
     A.CallTo(() => _individualFactory.CreateParameterLessIndividual()).Returns(_individual);
     sut = new SimpleProtocolPresenter(_view, _dynamicParameterPresenter, _simpleProtocolToSimpleProtocolDTOMapper,
                                       _protocolTask, _parameterTask, _individualFactory, _representationInfoRepository);
     sut.InitializeWith(A.Fake <ICommandCollector>());
 }
Exemple #14
0
        public IndividualMoleculePropertiesPresenter(
            IIndividualMoleculePropertiesView view,
            IEditParameterPresenterTask editParameterPresenterTask,
            IOntogenySelectionPresenter <TSimulationSubject> ontogenySelectionPresenter,
            IMultiParameterEditPresenter moleculeParametersPresenter)
            : base(view, editParameterPresenterTask)
        {
            _ontogenySelectionPresenter  = ontogenySelectionPresenter;
            _moleculeParametersPresenter = moleculeParametersPresenter;
            _moleculeParametersPresenter.IsSimpleEditor = true;

            AddSubPresenters(_ontogenySelectionPresenter, _moleculeParametersPresenter);

            view.AddOntogenyView(_ontogenySelectionPresenter.View);
            view.AddMoleculeParametersView(_moleculeParametersPresenter.View);
        }
Exemple #15
0
        public SimulationExpressionsPresenter(
            ISimulationExpressionsView view,
            IExpressionParametersToSimulationExpressionsDTOMapper simulationExpressionsDTOMapper,
            IMultiParameterEditPresenter moleculeParametersPresenter,
            IExpressionParametersPresenter expressionParametersPresenter)
            : base(view)
        {
            _simulationExpressionsDTOMapper = simulationExpressionsDTOMapper;

            _moleculeParametersPresenter   = moleculeParametersPresenter;
            _expressionParametersPresenter = expressionParametersPresenter;
            _moleculeParametersPresenter.IsSimpleEditor = true;

            AddSubPresenters(moleculeParametersPresenter, _expressionParametersPresenter);
            view.AddMoleculeParametersView(_moleculeParametersPresenter.View);
            view.AddExpressionParametersView(_expressionParametersPresenter.View);
        }
 public FavoriteParametersPresenter(
     IFavoriteParametersView view,
     IMultiParameterEditPresenter multiParameterEditPresenter,
     IParameterTask parameterTask,
     IFavoriteRepository favoriteRepository,
     IFavoriteTask favoriteTask) : base(view)
 {
     _multiParameterEditPresenter = multiParameterEditPresenter;
     _parameterTask      = parameterTask;
     _favoriteRepository = favoriteRepository;
     _favoriteTask       = favoriteTask;
     _allParameterCache  = _parameterTask.PathCacheFor(Enumerable.Empty <IParameter>());
     _view.AddParametersView(_multiParameterEditPresenter.BaseView);
     AddSubPresenters(_multiParameterEditPresenter);
     _multiParameterEditPresenter.ScalingVisible = false;
     _multiParameterEditPresenter.OnSelectedParametersChanged += onSelectedParametersChanged;
 }
        protected override void Context()
        {
            _view = A.Fake <IFormulationSettingsView>();
            _formulationDTOMapper         = A.Fake <IFormulationToFormulationDTOMapper>();
            _formulationRepository        = A.Fake <IFormulationRepository>();
            _formulaParameterPresenter    = A.Fake <IMultiParameterEditPresenter>();
            _representationInfoRepository = A.Fake <IRepresentationInfoRepository>();
            _tableFormulationPresenter    = A.Fake <ITableFormulationPresenter>();
            _cloner = A.Fake <ICloner>();
            A.CallTo(() => _formulaParameterPresenter.View).Returns(A.Fake <IMultiParameterEditView>());
            A.CallTo(() => _tableFormulationPresenter.BaseView).Returns(A.Fake <IView>());
            _simpleChartPresenter       = A.Fake <ISimpleChartPresenter>();
            _formulationValuesRetriever = A.Fake <IFormulationValuesRetriever>();

            sut = new FormulationSettingsPresenter(_view, _formulationDTOMapper, _formulaParameterPresenter, _formulationRepository,
                                                   _representationInfoRepository, _tableFormulationPresenter, _cloner, _simpleChartPresenter, _formulationValuesRetriever);
        }
 public CompoundInSimulationPresenter(ICompoundInSimulationView view, IMolWeightGroupPresenter molWeightGroupPresenter,
                                      ICompoundTypeGroupPresenter compoundTypeGroupPresenter, IMultiParameterEditPresenter simpleParameterPresenter,
                                      IMultiParameterEditPresenter advancedParameterPresenter, ICalculationMethodSelectionPresenterForSimulation calculationMethodsPresenter,
                                      IWithIdRepository withIdRepository)
     : base(view)
 {
     _molWeightGroupPresenter     = molWeightGroupPresenter;
     _compoundTypeGroupPresenter  = compoundTypeGroupPresenter;
     _simpleParameterPresenter    = simpleParameterPresenter;
     _advancedParameterPresenter  = advancedParameterPresenter;
     _calculationMethodsPresenter = calculationMethodsPresenter;
     _withIdRepository            = withIdRepository;
     AddSubPresenters(_calculationMethodsPresenter, _molWeightGroupPresenter, _compoundTypeGroupPresenter, _simpleParameterPresenter, _advancedParameterPresenter);
     _calculationMethodsPresenter.ReadOnly     = true;
     _compoundTypeGroupPresenter.ShowFavorites = true;
     initializeParametersPresenter(_simpleParameterPresenter);
     initializeParametersPresenter(_advancedParameterPresenter);
 }
Exemple #19
0
        public SimulationExpressionsPresenter(
            ISimulationExpressionsView view,
            IExpressionParametersToSimulationExpressionsDTOMapper simulationExpressionsDTOMapper,
            IEditParameterPresenterTask editParameterPresenterTask,
            IMoleculeExpressionTask <Individual> moleculeExpressionTask,
            IEntityPathResolver entityPathResolver,
            IParameterTask parameterTask,
            IMultiParameterEditPresenter moleculeParametersPresenter)
            : base(view, editParameterPresenterTask)
        {
            _simulationExpressionsDTOMapper = simulationExpressionsDTOMapper;
            _moleculeExpressionTask         = moleculeExpressionTask;
            _parameterTask = parameterTask;
            _pathCache     = new PathCache <IParameter>(entityPathResolver);

            _moleculeParametersPresenter = moleculeParametersPresenter;
            _moleculeParametersPresenter.IsSimpleEditor = true;

            AddSubPresenters(moleculeParametersPresenter);
            view.AddMoleculeParametersView(_moleculeParametersPresenter.View);
        }
 public FormulationSettingsPresenter(IFormulationSettingsView view, IFormulationToFormulationDTOMapper formulationDTOMapper,
                                     IMultiParameterEditPresenter formulationParametersPresenter, IFormulationRepository formulationRepository,
                                     IRepresentationInfoRepository representationInfoRepository, ITableFormulationPresenter tableFormulationPresenter,
                                     ICloner cloner, ISimpleChartPresenter simpleChartPresenter,
                                     IFormulationValuesRetriever formulationValuesRetriever) : base(view)
 {
     _formulationDTOMapper           = formulationDTOMapper;
     _formulationParametersPresenter = formulationParametersPresenter;
     _formulationRepository          = formulationRepository;
     _representationInfoRepository   = representationInfoRepository;
     _tableFormulationPresenter      = tableFormulationPresenter;
     _cloner = cloner;
     _simpleChartPresenter       = simpleChartPresenter;
     _formulationValuesRetriever = formulationValuesRetriever;
     _formulationParametersPresenter.IsSimpleEditor    = true;
     _formulationParametersPresenter.ParameterChanged += parameterChanged;
     _view.AddChartView(_simpleChartPresenter.View);
     _tableFormulationPresenter.TableFormulaChanged += tableFormulaChanged;
     AddSubPresenters(_formulationParametersPresenter, _tableFormulationPresenter);
     AutoSave = false;
 }
 public void AttachPresenter(IMultiParameterEditPresenter presenter)
 {
     base.AttachPresenter(presenter);
     _presenter = presenter;
 }
 public ParticleDissolutionGroupPresenter(ICompoundAdvancedParameterGroupView view, IRepresentationInfoRepository representationInfoRepository,
                                          IMultiParameterEditPresenter parameterEditPresenter, IParameterGroupTask parameterGroupTask)
     : base(view, representationInfoRepository, parameterEditPresenter, parameterGroupTask, CoreConstants.Groups.COMPOUND_DISSOLUTION)
 {
     view.Hint = PKSimConstants.UI.CompoundParticleDissolutionParametersNote;
 }
 private void initializeParametersPresenter(IMultiParameterEditPresenter multiParameterEditPresenter)
 {
     multiParameterEditPresenter.IsSimpleEditor = true;
     multiParameterEditPresenter.ShowFavorites  = true;
 }
Exemple #24
0
 public TwoPoreGroupPresenter(ICompoundAdvancedParameterGroupView view, IRepresentationInfoRepository representationInfoRepository, IMultiParameterEditPresenter parameterEditPresenter, IParameterGroupTask parameterGroupTask) :
     base(view, representationInfoRepository, parameterEditPresenter, parameterGroupTask, CoreConstants.Groups.COMPOUND_TWO_PORE)
 {
     view.Hint = PKSimConstants.UI.CompoundTwoPoreParametersNote;
 }