diff --git a/src/PKSim.Assets.Images/PKSim.Assets.Images.csproj b/src/PKSim.Assets.Images/PKSim.Assets.Images.csproj
index 5d6ea4ee3..d295772ae 100644
--- a/src/PKSim.Assets.Images/PKSim.Assets.Images.csproj
+++ b/src/PKSim.Assets.Images/PKSim.Assets.Images.csproj
@@ -23,8 +23,8 @@
-
-
+
+
diff --git a/src/PKSim.Assets/PKSim.Assets.csproj b/src/PKSim.Assets/PKSim.Assets.csproj
index 5e8c41600..e24980991 100644
--- a/src/PKSim.Assets/PKSim.Assets.csproj
+++ b/src/PKSim.Assets/PKSim.Assets.csproj
@@ -22,9 +22,9 @@
-
-
-
+
+
+
diff --git a/src/PKSim.Assets/PKSimConstants.cs b/src/PKSim.Assets/PKSimConstants.cs
index 29733e6ae..604c8f495 100644
--- a/src/PKSim.Assets/PKSimConstants.cs
+++ b/src/PKSim.Assets/PKSimConstants.cs
@@ -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
{
@@ -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.";
@@ -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.";
@@ -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}'";
@@ -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
@@ -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";
@@ -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";
@@ -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...";
@@ -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...";
@@ -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";
@@ -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)
@@ -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";
@@ -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 {expressionProfileName}";
diff --git a/src/PKSim.BatchTool/PKSim.BatchTool.csproj b/src/PKSim.BatchTool/PKSim.BatchTool.csproj
index 972d41d69..63b8ca8b2 100644
--- a/src/PKSim.BatchTool/PKSim.BatchTool.csproj
+++ b/src/PKSim.BatchTool/PKSim.BatchTool.csproj
@@ -60,8 +60,8 @@
-
-
+
+
diff --git a/src/PKSim.BatchTool/Presenters/FolderListSnapshotPresenter.cs b/src/PKSim.BatchTool/Presenters/FolderListSnapshotPresenter.cs
index 92446e061..5c9fcd2a3 100644
--- a/src/PKSim.BatchTool/Presenters/FolderListSnapshotPresenter.cs
+++ b/src/PKSim.BatchTool/Presenters/FolderListSnapshotPresenter.cs
@@ -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
{
@@ -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()
{
@@ -75,7 +69,7 @@ public void ImportFolderList()
return;
ClearFolderList();
- var settings = new PKSimJsonSerializerSettings();
+ var settings = new OSPSuiteJsonSerializerSettings();
var folders = JsonConvert.DeserializeObject>(File.ReadAllText(file), settings);
_snapshotFolderListDTO.AddFolders(folders);
}
@@ -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));
}
diff --git a/src/PKSim.CLI.Core/PKSim.CLI.Core.csproj b/src/PKSim.CLI.Core/PKSim.CLI.Core.csproj
index 7bef6823a..6e78a1400 100644
--- a/src/PKSim.CLI.Core/PKSim.CLI.Core.csproj
+++ b/src/PKSim.CLI.Core/PKSim.CLI.Core.csproj
@@ -23,9 +23,9 @@
-
+
-
+
diff --git a/src/PKSim.CLI/PKSim.CLI.csproj b/src/PKSim.CLI/PKSim.CLI.csproj
index ece48a8b1..d4ceaf4e0 100644
--- a/src/PKSim.CLI/PKSim.CLI.csproj
+++ b/src/PKSim.CLI/PKSim.CLI.csproj
@@ -55,9 +55,9 @@
-
-
-
+
+
+
diff --git a/src/PKSim.Core/CoreRegister.cs b/src/PKSim.Core/CoreRegister.cs
index c8d02be17..e5621677b 100644
--- a/src/PKSim.Core/CoreRegister.cs
+++ b/src/PKSim.Core/CoreRegister.cs
@@ -7,9 +7,9 @@
using OSPSuite.Core.Domain.Services.ParameterIdentifications;
using OSPSuite.Core.Domain.UnitSystem;
using OSPSuite.Core.Maths.Interpolations;
+using OSPSuite.Core.Snapshots.Mappers;
using OSPSuite.Utility.Container;
using OSPSuite.Utility.Data;
-using OSPSuite.Infrastructure.Import.Services;
using PKSim.Core.Comparison;
using PKSim.Core.Mappers;
using PKSim.Core.Model;
@@ -23,7 +23,7 @@ public class CoreRegister : Register
{
public override void RegisterInContainer(IContainer container)
{
- container.AddRegister(x => x.FromInstance(new OSPSuite.Core.CoreRegister {RegisterParameter = false}));
+ container.AddRegister(x => x.FromInstance(new OSPSuite.Core.CoreRegister { RegisterParameter = false }));
//Register PKSim.Core
container.AddScanner(scan =>
@@ -41,12 +41,12 @@ public override void RegisterInContainer(IContainer container)
scan.ExcludeType();
scan.ExcludeType();
scan.ExcludeType();
-
+
//Do not register the InteractiveSimulationRunner as it should be registered only if needed
scan.ExcludeType();
- scan.ExcludeType();
scan.ExcludeNamespaceContainingType();
+ scan.ExcludeNamespaceContainingType();
scan.WithConvention();
});
@@ -58,15 +58,22 @@ public override void RegisterInContainer(IContainer container)
scan.IncludeType();
scan.IncludeType();
scan.IncludeType();
- scan.IncludeType();
scan.IncludeType();
scan.RegisterAs(LifeStyle.Singleton);
scan.WithConvention();
});
-
+
+ // Registered to satisfy the repository of ISnapshotMapperSpecification
+ container.AddScanner(scan =>
+ {
+ scan.AssemblyContainingType();
+ scan.IncludeNamespaceContainingType();
+ scan.WithConvention>();
+ });
+
container.Register();
- container.Register(LifeStyle.Transient);
+ container.Register(LifeStyle.Transient);
container.Register>();
container.Register, IndividualSimulationEngine>(LifeStyle.Transient);
container.Register, PopulationSimulationEngine>(LifeStyle.Transient);
diff --git a/src/PKSim.Core/Model/IQualificationStep.cs b/src/PKSim.Core/Model/IQualificationStep.cs
deleted file mode 100644
index f5f545d4a..000000000
--- a/src/PKSim.Core/Model/IQualificationStep.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-namespace PKSim.Core.Model
-{
- public interface IQualificationStep
- {
- string Display { get; }
- }
-}
\ No newline at end of file
diff --git a/src/PKSim.Core/Model/QualificationPlan.cs b/src/PKSim.Core/Model/QualificationPlan.cs
deleted file mode 100644
index 3373783c0..000000000
--- a/src/PKSim.Core/Model/QualificationPlan.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-using System.Collections;
-using System.Collections.Generic;
-using OSPSuite.Core.Domain;
-
-namespace PKSim.Core.Model
-{
- public class QualificationPlan : ObjectBase, IEnumerable
- {
- private readonly List _allQualificationSteps = new List();
-
- public void Add(IQualificationStep qualificationStep)
- {
- _allQualificationSteps.Add(qualificationStep);
- }
-
- public IReadOnlyList Steps => _allQualificationSteps;
-
- public IEnumerator GetEnumerator() => _allQualificationSteps.GetEnumerator();
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- return GetEnumerator();
- }
- }
-}
\ No newline at end of file
diff --git a/src/PKSim.Core/Model/RunParameterIdentificationQualificationStep.cs b/src/PKSim.Core/Model/RunParameterIdentificationQualificationStep.cs
index d474473ce..1221b312c 100644
--- a/src/PKSim.Core/Model/RunParameterIdentificationQualificationStep.cs
+++ b/src/PKSim.Core/Model/RunParameterIdentificationQualificationStep.cs
@@ -1,12 +1,12 @@
-using OSPSuite.Core.Domain.ParameterIdentifications;
+using OSPSuite.Core.Domain;
+using OSPSuite.Core.Domain.ParameterIdentifications;
using PKSim.Assets;
-namespace PKSim.Core.Model
+namespace PKSim.Core.Model;
+
+public class RunParameterIdentificationQualificationStep : IQualificationStep
{
- public class RunParameterIdentificationQualificationStep : IQualificationStep
- {
- public ParameterIdentification ParameterIdentification { get; set; }
+ public ParameterIdentification ParameterIdentification { get; set; }
- public string Display => PKSimConstants.QualificationSteps.RunParameterIdentification(ParameterIdentification.Name);
- }
+ public string Display => PKSimConstants.QualificationSteps.RunParameterIdentification(ParameterIdentification.Name);
}
\ No newline at end of file
diff --git a/src/PKSim.Core/Model/RunSimulationQualificationStep.cs b/src/PKSim.Core/Model/RunSimulationQualificationStep.cs
index ee92ad574..a158094cc 100644
--- a/src/PKSim.Core/Model/RunSimulationQualificationStep.cs
+++ b/src/PKSim.Core/Model/RunSimulationQualificationStep.cs
@@ -1,12 +1,11 @@
-using PKSim.Assets;
+using OSPSuite.Core.Domain;
+using PKSim.Assets;
-namespace PKSim.Core.Model
-{
- public class RunSimulationQualificationStep : IQualificationStep
- {
- public Simulation Simulation { get; set; }
+namespace PKSim.Core.Model;
- public string Display => PKSimConstants.QualificationSteps.RunSimulation(Simulation.Name);
+public class RunSimulationQualificationStep : IQualificationStep
+{
+ public Simulation Simulation { get; set; }
- }
+ public string Display => PKSimConstants.QualificationSteps.RunSimulation(Simulation.Name);
}
\ No newline at end of file
diff --git a/src/PKSim.Core/PKSim.Core.csproj b/src/PKSim.Core/PKSim.Core.csproj
index 1a83d3da6..8849e0cdf 100644
--- a/src/PKSim.Core/PKSim.Core.csproj
+++ b/src/PKSim.Core/PKSim.Core.csproj
@@ -26,10 +26,10 @@
-
-
-
-
+
+
+
+
diff --git a/src/PKSim.Core/Services/IJsonSerializer.cs b/src/PKSim.Core/Services/IJsonSerializer.cs
deleted file mode 100644
index 55ca17ae8..000000000
--- a/src/PKSim.Core/Services/IJsonSerializer.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-using System;
-using System.Threading.Tasks;
-
-namespace PKSim.Core.Services
-{
- public interface IJsonSerializer
- {
- Task Serialize(object objectToSerialize, string fileName);
- Task