private static void checkThatFormulationIsUsedEitherAsTemplateOrAsSimulationFormulation(IReadOnlyList <Formulation> allFormulationUsed) { var allFormulationNames = allFormulationUsed.AllNames().Distinct().ToList(); if (allFormulationNames.Count == allFormulationUsed.Count) { return; } throw new PKSimException(PKSimConstants.Error.FormulationShouldBeUsedAsTemplateOrAsSimulationBuildingBlock); }
private PartialDerivatives partialDerivativesFrom(string fullOutputPath, DataColumn outputResult, IReadOnlyList <IdentificationParameter> allIdentificationParameters, OutputMapping outputMapping, ISimModelBatch simModelBatch) { var partialDerivatives = new PartialDerivatives(fullOutputPath, allIdentificationParameters.AllNames()); outputResult.Values.Each((outputValue, index) => { var derivativeValues = retrievePartialDerivativeFor(allIdentificationParameters, x => retrievePartialDerivativeForOutputs(x, outputMapping, simModelBatch, index)); partialDerivatives.AddPartialDerivative(derivativeValues); }); return(partialDerivatives); }
public bool Delete(IReadOnlyList <SensitivityAnalysis> sensitivityAnalyses) { var res = _dialogCreator.MessageBoxYesNo(Captions.SensitivityAnalysis.ReallyDeleteSensitivityAnalyses(sensitivityAnalyses.AllNames())); if (res == ViewResult.No) { return(false); } sensitivityAnalyses.Each(delete); return(true); }
public static IMenuBarButton CompareObjectsMenu(IReadOnlyList <IObjectBase> objectsToCompare, IOSPSuiteExecutionContext context) { return(CompareObjectsMenu(objectsToCompare, objectsToCompare.AllNames(), context)); }
public void Delete(IReadOnlyList <TemplateDTO> templateDTOs) { var result = _dialogCreator.MessageBoxYesNo(PKSimConstants.UI.ReallyDeleteTemplate(templateDTOs.AllNames())); if (result == ViewResult.No) { return; } templateDTOs.Each(x => { var template = x.Template; _templateTaskQuery.DeleteTemplate(template); _availableTemplates.Remove(template); _selectedTemplates.Remove(template); }); updateView(); }
public bool Delete <TBuildingBlock>(IReadOnlyList <TBuildingBlock> buildingBlocksToDelete) where TBuildingBlock : class, IPKSimBuildingBlock { if (!buildingBlocksToDelete.Any()) { return(true); } var buildingBlockType = _entityTask.TypeFor(buildingBlocksToDelete.First()); foreach (var buildingBlockToDelete in buildingBlocksToDelete) { var simulationsUsingBuildingBlockToDelete = _buildingBlockInSimulationManager.SimulationsUsing(buildingBlockToDelete).ToList(); if (simulationsUsingBuildingBlockToDelete.Any()) { throw new CannotDeleteBuildingBlockException(buildingBlockToDelete.Name, buildingBlockType, simulationsUsingBuildingBlockToDelete); } } var viewResult = _dialogCreator.MessageBoxYesNo(PKSimConstants.UI.ReallyDeleteObjectOfType(buildingBlockType, buildingBlocksToDelete.AllNames().ToArray())); if (viewResult == ViewResult.No) { return(false); } buildingBlocksToDelete.OfType <Simulation>().Each(simulation => _simulationReferenceUpdater.RemoveSimulationFromParameterIdentificationsAndSensitivityAnalyses(simulation)); var macoCommand = new PKSimMacroCommand { CommandType = PKSimConstants.Command.CommandTypeDelete, ObjectType = buildingBlockType, BuildingBlockType = buildingBlockType, Description = PKSimConstants.Command.ObjectsDeletedFromProject(buildingBlockType), }; buildingBlocksToDelete.Each(x => macoCommand.Add(DeleteCommand(x))); AddCommandToHistory(macoCommand.Run(_executionContext)); buildingBlocksToDelete.Each(RemovePresenterSettings); return(true); }
public bool Delete(IReadOnlyList <ParameterIdentification> parameterIdentifications) { var res = _dialogCreator.MessageBoxYesNo(Captions.ParameterIdentification.ReallyDeleteParameterIdentifications(parameterIdentifications.AllNames())); if (res == ViewResult.No) { return(false); } parameterIdentifications.Each(delete); return(true); }
public bool Delete(IReadOnlyList <ISimulationComparison> simulationComparisons) { if (!simulationComparisons.Any()) { return(true); } var res = _dialogCreator.MessageBoxYesNo(PKSimConstants.UI.ReallyDeleteSimulationComparisons(simulationComparisons.AllNames())); if (res == ViewResult.No) { return(false); } simulationComparisons.Each(deleteSimulationComparison); return(true); }