Пример #1
0
        private void updateParameterDTOFromParameter(ParameterDTO parameterDTO, IParameter parameter)
        {
            var parameterPath      = _entityPathResolver.ObjectPathFor(parameter);
            var representationInfo = _representationInfoRepository.InfoFor(parameter);

            parameterDTO.DisplayName  = representationInfo.DisplayName;
            parameterDTO.Description  = representationInfo.Description;
            parameterDTO.AllUnits     = allUnitsFor(parameter);
            parameterDTO.FormulaType  = _formulaTypeMapper.MapFrom(parameter.Formula);
            parameterDTO.IsFavorite   = _favoriteRepository.Contains(parameterPath);
            parameterDTO.Sequence     = parameter.Sequence;
            parameterDTO.PathElements = _parameterDisplayPathMapper.MapFrom(parameter);

            //now create special list of values for parameter for our discrete parameters
            updateListOfValues(parameterDTO, parameter);
        }
Пример #2
0
        public IParameterDTO MapFrom(IParameter parameter)
        {
            var dto = new ParameterDTO(parameter);

            MapProperties(parameter, dto);
            dto.Formula                 = _formulaToDTOFormulaBuilderMapper.MapFrom(parameter.Formula);
            dto.RHSFormula              = _formulaToDTOFormulaBuilderMapper.MapFrom(parameter.RHSFormula);
            dto.BuildMode               = parameter.BuildMode;
            dto.Dimension               = parameter.Dimension;
            dto.HasRHS                  = (parameter.RHSFormula != null);
            dto.DisplayUnit             = parameter.Dimension.BaseUnit;
            dto.Group                   = _groupRepository.GroupByName(parameter.GroupName);
            dto.IsAdvancedParameter     = !parameter.Visible;
            dto.CanBeVariedInPopulation = parameter.CanBeVariedInPopulation;
            dto.PathElements            = _pathToPathElementsMapper.MapFrom(parameter);
            var parameterPath = _entityPathResolver.ObjectPathFor(parameter);

            dto.IsFavorite = _favoriteRepository.Contains(parameterPath);

            return(dto);
        }