Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/PKSim.Assets.Images/PKSim.Assets.Images.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="OSPSuite.Assets" Version="13.0.13" />
<PackageReference Include="OSPSuite.Assets.Images" Version="13.0.13" />
<PackageReference Include="OSPSuite.Assets" Version="13.0.15" />
<PackageReference Include="OSPSuite.Assets.Images" Version="13.0.15" />
<PackageReference Include="System.Resources.Extensions" Version="9.0.2" />
</ItemGroup>

Expand Down
6 changes: 3 additions & 3 deletions src/PKSim.Assets/PKSim.Assets.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="OSPSuite.Assets" Version="13.0.13" />
<PackageReference Include="OSPSuite.Assets.Images" Version="13.0.13" />
<PackageReference Include="OSPSuite.Core" Version="13.0.13" />
<PackageReference Include="OSPSuite.Assets" Version="13.0.15" />
<PackageReference Include="OSPSuite.Assets.Images" Version="13.0.15" />
<PackageReference Include="OSPSuite.Core" Version="13.0.15" />
</ItemGroup>

<ItemGroup>
Expand Down
78 changes: 11 additions & 67 deletions src/PKSim.Assets/PKSimConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -466,22 +466,16 @@ public static string SaturationEnabledCanOnlyBeUsedForOralApplicationUsingPartic

public static string CouldNotFindOutputInSimulation(string outputFullPath, string simulationName) => $"Cannot find output '{outputFullPath}' in simulation '{simulationName}'";

public static string CouldNotFind(string objectType, string objectName) => $"Cannot find {objectType.ToLower()} '{objectName}'";

public static string CouldNotFindParameterIdentification(string parameterIdentificationName) => CouldNotFind(OSPSuite.Assets.ObjectTypes.ParameterIdentification, parameterIdentificationName);

public static string CouldNotFindQualificationStep(string qualificationStepType) => CouldNotFind(ObjectTypes.QualificationStep, qualificationStepType);

public static string NotMappingDefinedForQualificationStep(string qualificationStepType) => $"No mapping defined for {ObjectTypes.QualificationStep.ToLower()} '{qualificationStepType}'";
public static string CouldNotFindParameterIdentification(string parameterIdentificationName) => OSPSuite.Assets.Error.CouldNotFind(OSPSuite.Assets.ObjectTypes.ParameterIdentification, parameterIdentificationName);

public static string TableFormulationRequiresAtLeastOnePoint(string formulation) => $"Table formulation '{formulation}' requires at least one point to be used in a simulation.";

public static string CouldNotFindSimulation(string simulationName) => CouldNotFind(OSPSuite.Assets.ObjectTypes.Simulation, simulationName);
public static string CouldNotFindSimulation(string simulationName) => OSPSuite.Assets.Error.CouldNotFind(OSPSuite.Assets.ObjectTypes.Simulation, simulationName);

public static string CannotCreateIdentificationParameter(string parameterPath, string parameterIdentificationName)
=> $"Cannot create identification parameter '{parameterPath}' for parameter identification '{parameterIdentificationName}'.";

public static string ParameterIsRequired(string parameterName) => CouldNotFind(OSPSuite.Assets.ObjectTypes.Parameter, parameterName);
public static string ParameterIsRequired(string parameterName) => OSPSuite.Assets.Error.CouldNotFind(OSPSuite.Assets.ObjectTypes.Parameter, parameterName);

public static string SimulationResultsFileDoesNotHaveTheExpectedFormat
{
Expand Down Expand Up @@ -833,13 +827,9 @@ public static string ComparisonBetweenBuildingBLocksNotSupportedForBuildingBlock

public static string CannotExtractIndividualFrom(string objectType) => $"Individual extraction is not available for '{objectType}'.";

public static string SnapshotNotFoundFor(string modelTypeName) => $"Snapshot not found for '{modelTypeName}'.";

public static string SnapshotParameterNotFoundInContainer(string parameterName, string container) => $"Snapshot parameter '{parameterName}' was not found in '{container}'.";

public static string SnapshotParameterNotFound(string parameterName) => $"Snapshot parameter '{parameterName}' was not found.";

public const string SnapshotIsOutdated = "Snapshot is outdated and cannot be loaded for the following reason: ";

public static string MoleculeTypeNotSupported(string moleculeType) => $"Molecule type '{moleculeType}' not supported.";

Expand All @@ -853,16 +843,6 @@ public static string ComparisonBetweenBuildingBLocksNotSupportedForBuildingBlock

public static string SnapshotProcessNameNotFound(string processName) => $"Snapshot process '{processName}' not found in the PK-Sim database.";

public static string MapToModelNotSupportedWithoutContext(string modelType, string contextType)
{
return $"{modelType} should not be created from snapshot directly. Instead use the overload with {contextType}.";
}

public static string MapToSnapshotNotSupportedWithoutContext(string snapshotType, string contextType)
{
return $"{snapshotType} should not be created from model directly. Instead use the overload with {contextType}.";
}

public const string PopulationSnapshotOnlySupportedForRandomPopulation = "Population snapshot can only be created for randomized population.";

public const string SimulationSubjectUndefinedInSnapshot = "Simulation subject (Individual or Population) is not defined in snapshot.";
Expand All @@ -873,16 +853,12 @@ public static string MapToSnapshotNotSupportedWithoutContext(string snapshotType

public static string OnlyPKSimSimulationCanBeExportedToSnapshot(string simulationName, string origin) => $"Snapshot export is not supported for {origin} simulation '{simulationName}'.";

public static string SnapshotFileMismatch(string desiredType) => $"Snapshot file cannot be used to load a {desiredType.ToLowerInvariant()}.";

public static string CannotLoadRelatedItemAsObjectAlreadyExistInProject(string objectType, string objectName) => $"Cannot load related item into project. A {objectType.ToLower()} named '{objectName}' already exists.";

public static string CompoundGroupNotFoundFor(string compoundGroup, string compoundName) => $"Cannot find compound group '{compoundGroup}' for compound '{compoundName}'";

public static string CompoundAlternativeNotFoundFor(string alternativeName, string defaultAlternativeName, string compoundGroup, string compoundName) => $"Cannot find alternative '{alternativeName}' in compound group '{compoundGroup}' for compound '{compoundName}'. Default alternative '{defaultAlternativeName}' will be used instead";

public static string UnableToFindAQualificationStepRunnerFor(string qualificationStep) => $"Cannot find {ObjectTypes.QualificationStep} runner for '{qualificationStep}'";

public static string CannotLoadSimulation(string simulationName) => $"Cannot load {ObjectTypes.Simulation} '{simulationName}'";

public static string UnableToLoadQualificationConfigurationFromFile(string fileFullPath) => $"Unable to read configuration from file '{fileFullPath}'";
Expand Down Expand Up @@ -1063,19 +1039,7 @@ public static string ObservedDataYAsTooltip(string y, string lowerValue, string
return $"{ObservedDataYAsTooltip(y)}\n{TimeProfileYAsTooltip(lowerValue, upperValue)}";
}

public static string Starting(string type, string name) => $"Starting {type.ToLower()} '{name}'...";

public static string ObservedDataYAsTooltip(string y) => ScatterYAsTooltip(y);

public static string LoadingSnapshot(string snapshotFile, string type) => $"Loading {type} from {ObjectTypes.Snapshot.ToLower()} file '{snapshotFile}'";

public static string SnapshotLoaded(string typeToLoad) => $"{typeToLoad} loaded from {ObjectTypes.Snapshot.ToLower()}";

public static string LoadingSimulation(string simulationName, int count, int total) => $"Loading simulation '{simulationName}' ({count}/{total})...";

public static string StartingQualificationPlan(string qualificationPlan) => Starting(ObjectTypes.QualificationPlan, qualificationPlan);

public static string StartingQualificationStep(string qualificationStep) => Starting(ObjectTypes.QualificationStep, qualificationStep);
}

public static class MenuNames
Expand Down Expand Up @@ -1110,10 +1074,7 @@ public static class MenuNames
public static readonly string About = "&About...";
public static readonly string OpenProject = "&Open...";
public static readonly string ProjectDescription = "&Description...";
public static readonly string ExportProjectToSnapshot = "Export to Snapshot";
public static readonly string LoadProjectFromSnapshot = "Load from Snapshot";
public static readonly string ExportProjectToSnapshotMenu = $"&{ExportProjectToSnapshot}...";
public static readonly string LoadProjectFromSnapshotMenu = $"{LoadProjectFromSnapshot}...";

public static readonly string Clone = "Clone...";
public static readonly string CloneMenu = "Clone";
public static readonly string ActivateSimulation = "Set as Active Simulation";
Expand Down Expand Up @@ -1272,9 +1233,6 @@ public static class ObjectTypes
public static readonly string Species = "Species";
public static readonly string SimulationAnalysisWorkflow = "Analysis";
public static readonly string IndividualOrPopulation = $"{Individual} or {Population}";
public static readonly string QualificationStep = "Qualification Step";
public static readonly string QualificationPlan = "Qualification Plan";
public static readonly string Snapshot = "Snapshot";
public static readonly string ObserverSet = "Observers";
public static readonly string ExpressionProfile = "Expression Profile";
public static readonly string DiseaseState = "Disease State";
Expand Down Expand Up @@ -1622,8 +1580,7 @@ public static class UI
public static readonly string OpeningProjectDatabase = "Opening project database...";
public static readonly string CreatingProjectDatabase = "Creating project database...";
public static readonly string LoadingProject = "Loading project...";
public static readonly string LoadingSnapshot = "Loading snapshot...";
public static readonly string SnapshotFile = "Select snapshot file";

public static readonly string SavingProject = "Saving project...";
public static readonly string LoadingHistory = "Loading history...";
public static readonly string LoadingLayout = "Loading layout...";
Expand Down Expand Up @@ -1858,8 +1815,6 @@ public static class UI
public static readonly string NewProjectDescription = "Create a new project...";
public static readonly string OpenProjectDescription = "Open an existing project...";
public static readonly string ProjectDescriptionDescription = "Show or edit project description...";
public static readonly string ExportProjectToSnapshotDescription = "Export project to snapshot...";
public static readonly string LoadProjectFromSnapshotDescription = "Load project from snapshot...";
public static readonly string CloseProjectDescription = "Close the project";
public static readonly string NewSimulationDescription = "Create a new simulation...";
public static readonly string ImportIndividualSimulationDescription = "Import an individual simulation from file...";
Expand Down Expand Up @@ -2070,7 +2025,7 @@ public static class UI
public static readonly string Range = "Range";
public static readonly string ImportFolder = "Import all files from a specific folder";
public static readonly string ImportFiles = "Import single files";
public static readonly string StartImport = "Start Import";

public static readonly string Browse = "Browse";
public static readonly string SelectFolderContainingSimulationResults = "Select folder containing the results to import";
public static readonly string FileSuccessfullyImported = "File successfully imported";
Expand Down Expand Up @@ -2215,16 +2170,10 @@ public static class UI
public static readonly string GlobalPKAnalysisDescription = "The median value calculated from all individual values";

public static readonly string[] DefaultExpressionProfileCategories = { Healthy };

public static string DoYouWantToProceed(params string[] messages) => $"WARNING:\n{messages.ToString("\n")}\n\nDo you wish to continue?";

private static readonly string _snapshotOfProjectWithChangedSimulationText = "Some simulations are in a changed state (red icon) and may not be re-imported correctly.";
public static readonly string SnapshotOfProjectCreatedWithEarlierVersion = OSPSuite.Assets.Captions.DoYouWantToProceed(_snapshotOfProjectCreatedWithEarlierVersionText);
public static readonly string SnapshotOfProjectCreatedWithEarlierVersionAndWithChangedSimulation = OSPSuite.Assets.Captions.DoYouWantToProceed(_snapshotOfProjectCreatedWithEarlierVersionText, OSPSuite.Assets.Captions.SnapshotOfProjectWithChangedSimulationText);
private static readonly string _snapshotOfProjectCreatedWithEarlierVersionText = "Project was created with an older version of PK-Sim (earlier than 7.3.0). The created snapshot file will likely be incomplete. Only use if you know what you are doing!";

public static readonly string SnapshotOfProjectWithChangedSimulation = DoYouWantToProceed(_snapshotOfProjectWithChangedSimulationText);
public static readonly string SnapshotOfProjectCreatedWithEarlierVersion = DoYouWantToProceed(_snapshotOfProjectCreatedWithEarlierVersionText);
public static readonly string SnapshotOfProjectCreatedWithEarlierVersionAndWithChangedSimulation = DoYouWantToProceed(_snapshotOfProjectCreatedWithEarlierVersionText, _snapshotOfProjectWithChangedSimulationText);

public static string NumberOfIndividualsToExtract(int count, string populationName) => $"{count} {"individual".PluralizeIf(count)} will be extracted from population {populationName}.";

public static string IndividualExtractionNamingPatternDescription(string populationNamePattern, string individualIdPattern)
Expand Down Expand Up @@ -2555,14 +2504,9 @@ public static string DragFieldMessage(string fieldType)
public static string FilterAreaDragFieldMessage() => "Drag a field here to remove grouping";

public static readonly string ChartYScale = "Chart Y Scale";

public static string SelectSnapshotExportFile(string objectName, string objectType) => $"Export snapshot for {objectType.ToLowerInvariant()} '{objectName}'";

public static string LoadObjectFromSnapshot(string objectType) => $"Load {objectType.ToLowerInvariant()} from snapshot";

public static string LoadFromSnapshot = "Load Snapshot";

public static string SelectExpressionProfile = "Select an expression profile";
public static string RunSimulations = "Run Simulations";


public static string NumberOfTemplatesSelectedIs(int number, string templateType) => $"{number} {templateType.PluralizeIf(number).ToLowerInvariant()} selected";

Expand All @@ -2575,7 +2519,7 @@ public static string UserTemplateDatabaseDatabaseUsedOldFormatAndCannotBeLoaded(
"If you don't make a backup, you will be the only one to blame!"
};

public static readonly string ReallyClearUnusedContent = DoYouWantToProceed(_reallyClearUnusedContent);
public static readonly string ReallyClearUnusedContent = OSPSuite.Assets.Captions.DoYouWantToProceed(_reallyClearUnusedContent);
public static readonly string DidYouReallyBackupProject = "Did you really make a backup of your project?";

public static string LinkedExpressionProfileIs(string expressionProfileName) => $"Using expression profile <b>{expressionProfileName}</b>";
Expand Down
4 changes: 2 additions & 2 deletions src/PKSim.BatchTool/PKSim.BatchTool.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="OSPSuite.Core" Version="13.0.13" />
<PackageReference Include="OSPSuite.Assets" Version="13.0.13" />
<PackageReference Include="OSPSuite.Core" Version="13.0.15" />
<PackageReference Include="OSPSuite.Assets" Version="13.0.15" />
<PackageReference Include="OSPSuite.DevExpress" Version="21.2.15" />
<PackageReference Include="OSPSuite.FuncParser" Version="4.0.0.73" GeneratePathProperty="true" />
<PackageReference Include="OSPSuite.SimModel" Version="4.0.0.75" GeneratePathProperty="true" />
Expand Down
16 changes: 5 additions & 11 deletions src/PKSim.BatchTool/Presenters/FolderListSnapshotPresenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
using System.Linq;
using Newtonsoft.Json;
using OSPSuite.Core.Services;
using OSPSuite.Infrastructure.Serialization.Json;
using OSPSuite.Presentation.Presenters;
using PKSim.BatchTool.DTO;
using PKSim.BatchTool.Views;
using PKSim.CLI.Core.RunOptions;
using PKSim.Core;
using PKSim.Infrastructure.Serialization.Json;

namespace PKSim.BatchTool.Presenters
{
Expand Down Expand Up @@ -58,15 +58,9 @@ public void AddFolder(string folder)
_snapshotFolderListDTO.CurrentFolder = string.Empty;
}

public void RemoveFolder(FolderDTO folderDTO)
{
_snapshotFolderListDTO.RemoveFolder(folderDTO);
}
public void RemoveFolder(FolderDTO folderDTO) => _snapshotFolderListDTO.RemoveFolder(folderDTO);

public void ClearFolderList()
{
_snapshotFolderListDTO.ClearList();
}
public void ClearFolderList() => _snapshotFolderListDTO.ClearList();

public void ImportFolderList()
{
Expand All @@ -75,7 +69,7 @@ public void ImportFolderList()
return;

ClearFolderList();
var settings = new PKSimJsonSerializerSettings();
var settings = new OSPSuiteJsonSerializerSettings();
var folders = JsonConvert.DeserializeObject<IEnumerable<string>>(File.ReadAllText(file), settings);
_snapshotFolderListDTO.AddFolders(folders);
}
Expand All @@ -86,7 +80,7 @@ public void ExportFolderList()
if (string.IsNullOrEmpty(file))
return;

var settings = new PKSimJsonSerializerSettings();
var settings = new OSPSuiteJsonSerializerSettings();
File.WriteAllText(file, JsonConvert.SerializeObject(_snapshotFolderListDTO.Folders.Select(x => x.Folder), Formatting.Indented, settings));
}

Expand Down
4 changes: 2 additions & 2 deletions src/PKSim.CLI.Core/PKSim.CLI.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="OSPSuite.Assets" Version="13.0.13" />
<PackageReference Include="OSPSuite.Assets" Version="13.0.15" />
<PackageReference Include="OSPSuite.Utility" Version="4.1.1.1" />
<PackageReference Include="OSPSuite.Core" Version="13.0.13" />
<PackageReference Include="OSPSuite.Core" Version="13.0.15" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions src/PKSim.CLI/PKSim.CLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.9.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="9.0.2" />
<PackageReference Include="OSPSuite.Core" Version="13.0.13" />
<PackageReference Include="OSPSuite.Presentation" Version="13.0.13" />
<PackageReference Include="OSPSuite.Assets" Version="13.0.13" />
<PackageReference Include="OSPSuite.Core" Version="13.0.15" />
<PackageReference Include="OSPSuite.Presentation" Version="13.0.15" />
<PackageReference Include="OSPSuite.Assets" Version="13.0.15" />
<PackageReference Include="OSPSuite.Utility" Version="4.1.1.1" />
<PackageReference Include="OSPSuite.FuncParser" Version="4.0.0.73" GeneratePathProperty="true" />
<PackageReference Include="OSPSuite.SimModel" Version="4.0.0.75" GeneratePathProperty="true" />
Expand Down
Loading
Loading