示例#1
0
 private void updateProcessParameters(Model.CompoundProcess compoundProcess, CompoundProcess batchCompoundProcess)
 {
     foreach (var parameterValue in batchCompoundProcess.ParameterValues)
     {
         var parameter = compoundProcess.Parameter(parameterValue.Key);
         if (parameter == null)
         {
             _batchLogger.AddWarning($"Parameter '{parameterValue.Key}' not found in process '{compoundProcess.InternalName}'");
             continue;
         }
         parameter.Value = parameterValue.Value;
         _batchLogger.AddParameterValueToDebug(parameter);
     }
 }
示例#2
0
        public Model.Formulation MapFrom(Formulation batchFormulation)
        {
            if (batchFormulation == null)
            {
                return(null);
            }

            var template    = _formulationRepository.FormulationBy(batchFormulation.FormulationType);
            var formulation = _cloner.Clone(template);

            formulation.Name = batchFormulation.Name;
            foreach (var parameterValue in batchFormulation.Parameters)
            {
                var parameter = formulation.Parameter(parameterValue.Key);
                if (parameter == null)
                {
                    _batchLogger.AddWarning($"Parameter '{parameterValue.Key}' not found in formulation '{formulation.Name}'");
                    continue;
                }

                parameter.Value = parameterValue.Value;
                _batchLogger.AddParameterValueToDebug(parameter);
            }

            return(formulation);
        }