From 90b5c3c7288b5fa55101f39316d62876cbda5e4c Mon Sep 17 00:00:00 2001
From: Robert McIntosh <261477+rwmcintosh@users.noreply.github.com>
Date: Tue, 13 Dec 2022 09:38:54 -0500
Subject: [PATCH] 2475 expression profile from pksim (#2476)
* #784_expression_profile_from_pksim
* updating with mapper
* Fixes #2475 Create expression profile from PK-sim
* add dimensions as resource for tests
* Add pkparameters for test project
* add sqlite db
* PR feedback
---
PKSim.sln | 12 +-
.../PKSim.Assets.Images.csproj | 4 +-
src/PKSim.Assets/PKSim.Assets.csproj | 4 +-
src/PKSim.Assets/PKSimConstants.cs | 2 -
src/PKSim.BatchTool/PKSim.BatchTool.csproj | 4 +-
src/PKSim.CLI.Core/PKSim.CLI.Core.csproj | 4 +-
src/PKSim.CLI/PKSim.CLI.csproj | 6 +-
src/PKSim.Core/PKSim.Core.csproj | 8 +-
.../PKSim.Infrastructure.csproj | 18 +--
src/PKSim.Matlab/PKSim.Matlab.csproj | 4 +-
.../PKSim.Presentation.csproj | 6 +-
.../CreateExpressionProfilePresenter.cs | 3 +
.../Repositories/MenuBarItemRepository.cs | 4 +-
src/PKSim.R/PKSim.R.csproj | 4 +-
src/PKSim.UI.Starter/ApplicationStartup.cs | 115 ++++++++++++++++
.../ExpressionProfileCreator.cs | 42 ++++++
src/PKSim.UI.Starter/PKSim.UI.Starter.csproj | 21 +++
src/PKSim.UI.Starter/UIStarterUserSettings.cs | 50 +++++++
.../BootStrapping/ApplicationStartup.cs | 4 +-
src/PKSim.UI/PKSim.UI.csproj | 8 +-
src/PKSim/PKSim.csproj | 7 +-
.../PKSim.Matlab.Tests.csproj | 4 +-
tests/PKSim.R.Tests/PKSim.R.Tests.csproj | 4 +-
tests/PKSim.Tests/PKSim.Tests.csproj | 4 +-
tests/PKSim.UI.Starter/ApplicationStartup.cs | 82 ------------
.../PKSim.UI.Starter/PKSim.UI.Starter.csproj | 6 +-
.../Presenters/StarterMainPresenter.cs | 38 ------
.../StarterRelativeExpressionPresenter.cs | 82 ------------
tests/PKSim.UI.Starter/Program.cs | 40 ------
.../PKSim.UI.Starter/Properties/licenses.licx | 1 -
tests/PKSim.UI.Starter/StarterRegister.cs | 20 ---
.../Views/IStarterMainView.cs | 10 --
.../Views/IStarterRelativeExpressionView.cs | 10 --
.../Views/StarterMainView.Designer.cs | 119 -----------------
.../PKSim.UI.Starter/Views/StarterMainView.cs | 39 ------
.../Views/StarterMainView.resx | 123 ------------------
.../StarterRelativeExpressionView.Designer.cs | 108 ---------------
.../Views/StarterRelativeExpressionView.cs | 27 ----
.../Views/StarterRelativeExpressionView.resx | 123 ------------------
tests/PKSim.UI.Starter/app.config | 6 -
tests/PKSim.UI.Tests/PKSim.UI.Tests.csproj | 79 ++++++-----
.../ApplicationStartupTests.cs | 59 +++++++++
42 files changed, 397 insertions(+), 917 deletions(-)
create mode 100644 src/PKSim.UI.Starter/ApplicationStartup.cs
create mode 100644 src/PKSim.UI.Starter/ExpressionProfileCreator.cs
create mode 100644 src/PKSim.UI.Starter/PKSim.UI.Starter.csproj
create mode 100644 src/PKSim.UI.Starter/UIStarterUserSettings.cs
delete mode 100644 tests/PKSim.UI.Starter/ApplicationStartup.cs
delete mode 100644 tests/PKSim.UI.Starter/Presenters/StarterMainPresenter.cs
delete mode 100644 tests/PKSim.UI.Starter/Presenters/StarterRelativeExpressionPresenter.cs
delete mode 100644 tests/PKSim.UI.Starter/Program.cs
delete mode 100644 tests/PKSim.UI.Starter/Properties/licenses.licx
delete mode 100644 tests/PKSim.UI.Starter/StarterRegister.cs
delete mode 100644 tests/PKSim.UI.Starter/Views/IStarterMainView.cs
delete mode 100644 tests/PKSim.UI.Starter/Views/IStarterRelativeExpressionView.cs
delete mode 100644 tests/PKSim.UI.Starter/Views/StarterMainView.Designer.cs
delete mode 100644 tests/PKSim.UI.Starter/Views/StarterMainView.cs
delete mode 100644 tests/PKSim.UI.Starter/Views/StarterMainView.resx
delete mode 100644 tests/PKSim.UI.Starter/Views/StarterRelativeExpressionView.Designer.cs
delete mode 100644 tests/PKSim.UI.Starter/Views/StarterRelativeExpressionView.cs
delete mode 100644 tests/PKSim.UI.Starter/Views/StarterRelativeExpressionView.resx
delete mode 100644 tests/PKSim.UI.Starter/app.config
create mode 100644 tests/PKSim.UI.Tests/UI.StarterTests/ApplicationStartupTests.cs
diff --git a/PKSim.sln b/PKSim.sln
index 4952398eb..cbe65b7fe 100644
--- a/PKSim.sln
+++ b/PKSim.sln
@@ -56,7 +56,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PKSim.R", "src\PKSim.R\PKSi
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PKSim.R.Tests", "tests\PKSim.R.Tests\PKSim.R.Tests.csproj", "{4E310F99-4604-4502-8F0B-A4E4F27B062B}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PKSim.UI.Starter", "tests\PKSim.UI.Starter\PKSim.UI.Starter.csproj", "{795B1096-E236-4A0B-AB67-590F264F9F8E}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PKSim.UI.Starter", "src\PKSim.UI.Starter\PKSim.UI.Starter.csproj", "{35E511E9-0130-4E28-9DB3-EDCCB098D383}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -128,17 +128,17 @@ Global
{4E310F99-4604-4502-8F0B-A4E4F27B062B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4E310F99-4604-4502-8F0B-A4E4F27B062B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4E310F99-4604-4502-8F0B-A4E4F27B062B}.Release|Any CPU.Build.0 = Release|Any CPU
- {795B1096-E236-4A0B-AB67-590F264F9F8E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {795B1096-E236-4A0B-AB67-590F264F9F8E}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {795B1096-E236-4A0B-AB67-590F264F9F8E}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {795B1096-E236-4A0B-AB67-590F264F9F8E}.Release|Any CPU.Build.0 = Release|Any CPU
+ {35E511E9-0130-4E28-9DB3-EDCCB098D383}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {35E511E9-0130-4E28-9DB3-EDCCB098D383}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {35E511E9-0130-4E28-9DB3-EDCCB098D383}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {35E511E9-0130-4E28-9DB3-EDCCB098D383}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
- VisualSVNWorkingCopyRoot =
SolutionGuid = {13620E23-1993-42C6-A4AB-468E29DD24DE}
+ VisualSVNWorkingCopyRoot =
EndGlobalSection
GlobalSection(NDepend) = preSolution
Project = ".\PKSim.ndproj"
diff --git a/src/PKSim.Assets.Images/PKSim.Assets.Images.csproj b/src/PKSim.Assets.Images/PKSim.Assets.Images.csproj
index 46eeda8ad..7912b7d71 100644
--- a/src/PKSim.Assets.Images/PKSim.Assets.Images.csproj
+++ b/src/PKSim.Assets.Images/PKSim.Assets.Images.csproj
@@ -26,8 +26,8 @@
-
-
+
+
diff --git a/src/PKSim.Assets/PKSim.Assets.csproj b/src/PKSim.Assets/PKSim.Assets.csproj
index d8a26a570..0a98cdb05 100644
--- a/src/PKSim.Assets/PKSim.Assets.csproj
+++ b/src/PKSim.Assets/PKSim.Assets.csproj
@@ -26,8 +26,8 @@
-
-
+
+
diff --git a/src/PKSim.Assets/PKSimConstants.cs b/src/PKSim.Assets/PKSimConstants.cs
index 71903ace8..4e0a56dda 100644
--- a/src/PKSim.Assets/PKSimConstants.cs
+++ b/src/PKSim.Assets/PKSimConstants.cs
@@ -1150,7 +1150,6 @@ public static class MenuNames
public static readonly string NewFormulation = "Add &Formulation...";
public static readonly string NewEvent = "Add &Event...";
public static readonly string NewObservers = "Add &Observers...";
- public static readonly string NewExpressionProfile = "Add &Expression Profile";
public static readonly string AddObservedData = "Add &Observed Data...";
public static readonly string AddObservedDataFor = "Add Observed Data for";
public static readonly string SaveAs = "Save As...";
@@ -1886,7 +1885,6 @@ public static class UI
public static readonly string NewFormulationDescription = "Create a new formulation...";
public static readonly string NewEventDescription = "Create a new event...";
public static readonly string NewObserversDescription = "Create a new observer list...";
- public static readonly string NewExpressionProfileDescription = "Create a new expression profile...";
public static readonly string NewCompoundDescription = "Create a new compound...";
public static readonly string OptionsDescription = "Manage the options for the application and the current user...";
public static readonly string ExitDescription = "Exit the application";
diff --git a/src/PKSim.BatchTool/PKSim.BatchTool.csproj b/src/PKSim.BatchTool/PKSim.BatchTool.csproj
index 2811719ce..15cbdf2d7 100644
--- a/src/PKSim.BatchTool/PKSim.BatchTool.csproj
+++ b/src/PKSim.BatchTool/PKSim.BatchTool.csproj
@@ -59,8 +59,8 @@
-
-
+
+
diff --git a/src/PKSim.CLI.Core/PKSim.CLI.Core.csproj b/src/PKSim.CLI.Core/PKSim.CLI.Core.csproj
index b323e0572..114a9def8 100644
--- a/src/PKSim.CLI.Core/PKSim.CLI.Core.csproj
+++ b/src/PKSim.CLI.Core/PKSim.CLI.Core.csproj
@@ -27,9 +27,9 @@
-
+
-
+
diff --git a/src/PKSim.CLI/PKSim.CLI.csproj b/src/PKSim.CLI/PKSim.CLI.csproj
index 03c1c2059..1e0a5a818 100644
--- a/src/PKSim.CLI/PKSim.CLI.csproj
+++ b/src/PKSim.CLI/PKSim.CLI.csproj
@@ -61,9 +61,9 @@
-
-
-
+
+
+
diff --git a/src/PKSim.Core/PKSim.Core.csproj b/src/PKSim.Core/PKSim.Core.csproj
index 789de4f91..de42c1ac2 100644
--- a/src/PKSim.Core/PKSim.Core.csproj
+++ b/src/PKSim.Core/PKSim.Core.csproj
@@ -30,10 +30,10 @@
-
-
-
-
+
+
+
+
diff --git a/src/PKSim.Infrastructure/PKSim.Infrastructure.csproj b/src/PKSim.Infrastructure/PKSim.Infrastructure.csproj
index f2e03ba4c..2ba034faa 100644
--- a/src/PKSim.Infrastructure/PKSim.Infrastructure.csproj
+++ b/src/PKSim.Infrastructure/PKSim.Infrastructure.csproj
@@ -41,15 +41,15 @@
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
diff --git a/src/PKSim.Matlab/PKSim.Matlab.csproj b/src/PKSim.Matlab/PKSim.Matlab.csproj
index 961ea6b69..6bb0327c5 100644
--- a/src/PKSim.Matlab/PKSim.Matlab.csproj
+++ b/src/PKSim.Matlab/PKSim.Matlab.csproj
@@ -26,9 +26,9 @@
-
+
-
+
diff --git a/src/PKSim.Presentation/PKSim.Presentation.csproj b/src/PKSim.Presentation/PKSim.Presentation.csproj
index 6f3b68970..939c7042a 100644
--- a/src/PKSim.Presentation/PKSim.Presentation.csproj
+++ b/src/PKSim.Presentation/PKSim.Presentation.csproj
@@ -27,11 +27,11 @@
-
+
-
-
+
+
diff --git a/src/PKSim.Presentation/Presenters/ExpressionProfiles/CreateExpressionProfilePresenter.cs b/src/PKSim.Presentation/Presenters/ExpressionProfiles/CreateExpressionProfilePresenter.cs
index 1b8a6cc69..6a9b5a537 100644
--- a/src/PKSim.Presentation/Presenters/ExpressionProfiles/CreateExpressionProfilePresenter.cs
+++ b/src/PKSim.Presentation/Presenters/ExpressionProfiles/CreateExpressionProfilePresenter.cs
@@ -47,8 +47,11 @@ public IPKSimCommand Create() where TMolecule : IndividualMolecule
_view.Caption = PKSimConstants.UI.CreateExpressionProfile;
_view.BindTo(_dto);
_view.Display();
+
if (_view.Canceled)
+ {
return new PKSimEmptyCommand();
+ }
//we create a new one with all new features
ExpressionProfile = _expressionProfileFactory.Create(_dto.Species, _dto.MoleculeName);
diff --git a/src/PKSim.Presentation/Repositories/MenuBarItemRepository.cs b/src/PKSim.Presentation/Repositories/MenuBarItemRepository.cs
index ea9afafce..b0915bd83 100644
--- a/src/PKSim.Presentation/Repositories/MenuBarItemRepository.cs
+++ b/src/PKSim.Presentation/Repositories/MenuBarItemRepository.cs
@@ -175,9 +175,9 @@ protected override IEnumerable AllMenuBarItems()
.WithCommand()
.WithIcon(ApplicationIcons.LoadFromTemplate);
- var newExpressionProfile = CreateSubMenu.WithCaption(PKSimConstants.MenuNames.NewExpressionProfile)
+ var newExpressionProfile = CreateSubMenu.WithCaption(MenuNames.NewExpressionProfile)
.WithIcon(ApplicationIcons.ExpressionProfile)
- .WithDescription(PKSimConstants.UI.NewExpressionProfileDescription)
+ .WithDescription(MenuDescriptions.NewExpressionProfileDescription)
.WithId(MenuBarItemIds.NewExpressionProfile);
var newEnzyme = CreateMenuButton.WithCaption(PKSimConstants.UI.AddMetabolizingEnzyme)
diff --git a/src/PKSim.R/PKSim.R.csproj b/src/PKSim.R/PKSim.R.csproj
index 1db65d051..ef08633ae 100644
--- a/src/PKSim.R/PKSim.R.csproj
+++ b/src/PKSim.R/PKSim.R.csproj
@@ -49,9 +49,9 @@
-
+
-
+
diff --git a/src/PKSim.UI.Starter/ApplicationStartup.cs b/src/PKSim.UI.Starter/ApplicationStartup.cs
new file mode 100644
index 000000000..eea7790e5
--- /dev/null
+++ b/src/PKSim.UI.Starter/ApplicationStartup.cs
@@ -0,0 +1,115 @@
+using System.Globalization;
+using System.Threading;
+using OSPSuite.Assets;
+using OSPSuite.Core.Commands.Core;
+using OSPSuite.Core.Journal;
+using OSPSuite.Core.Services;
+using OSPSuite.Infrastructure.Import.Services;
+using OSPSuite.Presentation;
+using OSPSuite.Presentation.Core;
+using OSPSuite.Presentation.DTO;
+using OSPSuite.Presentation.Services;
+using OSPSuite.Presentation.Views;
+using OSPSuite.UI.Mappers;
+using OSPSuite.UI.Services;
+using OSPSuite.Utility.Container;
+using OSPSuite.Utility.Exceptions;
+using PKSim.CLI.Core.MinimalImplementations;
+using PKSim.Core;
+using PKSim.Core.Services;
+using PKSim.Infrastructure;
+using PKSim.Presentation;
+using PKSim.Presentation.DTO.Mappers;
+using PKSim.Presentation.Presenters.ExpressionProfiles;
+using PKSim.Presentation.Services;
+using PKSim.Presentation.Views.ExpressionProfiles;
+using PKSim.UI.Views.ExpressionProfiles;
+
+namespace PKSim.UI.Starter
+{
+ public static class ApplicationStartup
+ {
+ static IContainer _container;
+
+ public static IContainer Initialize(IShell shell)
+ {
+ if (_container != null)
+ return _container;
+
+ _container = initializeForStartup(shell);
+
+ return _container;
+ }
+
+ private static IContainer initializeForStartup(IShell shell)
+ {
+ Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
+ Thread.CurrentThread.CurrentUICulture = new CultureInfo("en");
+ ApplicationIcons.DefaultIcon = ApplicationIcons.PKSim;
+
+
+ var container = InfrastructureRegister.Initialize(registerContainerAsStatic: false);
+ container.RegisterImplementationOf(SynchronizationContext.Current);
+
+ container.Register(LifeStyle.Singleton);
+ container.Register(LifeStyle.Singleton);
+
+ // registerImplementationsFromCore(container);
+ registerMinimalImplementations(container);
+
+
+ using (container.OptimizeDependencyResolution())
+ {
+ container.RegisterImplementationOf(shell);
+ container.AddRegister(x => x.FromType());
+ container.AddRegister(x => x.FromType());
+ container.Register();
+ container.Register();
+ container.Register();
+ container.Register();
+ container.Register(LifeStyle.Singleton);
+ container.Register();
+ container.Register();
+ container.Register();
+ container.Register>();
+ InfrastructureRegister.LoadSerializers(container);
+ }
+
+ return container;
+ }
+
+ // ///
+ // /// Use this method to register all dependencies in Core.UI and Core.Presentation
+ // ///
+ // private static void registerImplementationsFromCore(IContainer container)
+ // {
+ // container.Register(LifeStyle.Singleton);
+ // container.AddRegister(x => x.FromType());
+ // container.AddRegister(x => x.FromType());
+ // }
+
+ ///
+ /// Use this method to register and refine the minimal implementations for dependencies
+ ///
+ private static void registerMinimalImplementations(IContainer container)
+ {
+ container.Register();
+ container.Register();
+ container.Register();
+ container.Register();
+ container.Register();
+ container.Register();
+ container.Register();
+ container.Register();
+ }
+ }
+
+ internal class Workspace : CLIWorkspace, IWorkspace
+ {
+ public Workspace(IRegistrationTask registrationTask) : base(registrationTask)
+ {
+ }
+
+ public IWorkspaceLayout WorkspaceLayout { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/src/PKSim.UI.Starter/ExpressionProfileCreator.cs b/src/PKSim.UI.Starter/ExpressionProfileCreator.cs
new file mode 100644
index 000000000..bcb843b53
--- /dev/null
+++ b/src/PKSim.UI.Starter/ExpressionProfileCreator.cs
@@ -0,0 +1,42 @@
+using OSPSuite.Core.Commands.Core;
+using OSPSuite.Presentation.Views;
+using PKSim.Core.Mappers;
+using PKSim.Core.Model;
+using PKSim.Presentation;
+using PKSim.Presentation.Presenters.ExpressionProfiles;
+
+namespace PKSim.UI.Starter
+{
+ public static class ExpressionProfileCreator
+ {
+ public static object CreateIndividualEnzymeExpressionProfile(IShell shell)
+ {
+ return createExpressionProfile(shell);
+ }
+
+ public static object CreateTransporterExpressionProfile(IShell shell)
+ {
+ return createExpressionProfile(shell);
+ }
+
+ public static object CreateBindingPartnerExpressionProfile(IShell shell)
+ {
+ return createExpressionProfile(shell);
+ }
+
+ private static object createExpressionProfile(IShell shell) where T : IndividualMolecule
+ {
+ var container = ApplicationStartup.Initialize(shell);
+
+ using (var presenter = container.Resolve())
+ {
+ var workspace = container.Resolve();
+ workspace.Project = new PKSimProject();
+ var mapper = container.Resolve();
+
+
+ return presenter.Create().IsEmpty() ? null : mapper.MapFrom(presenter.ExpressionProfile);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/PKSim.UI.Starter/PKSim.UI.Starter.csproj b/src/PKSim.UI.Starter/PKSim.UI.Starter.csproj
new file mode 100644
index 000000000..52eda407b
--- /dev/null
+++ b/src/PKSim.UI.Starter/PKSim.UI.Starter.csproj
@@ -0,0 +1,21 @@
+
+
+
+ netstandard2.0
+ true
+ 11.1.0
+ 11.1.0
+ 11.1.0
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/PKSim.UI.Starter/UIStarterUserSettings.cs b/src/PKSim.UI.Starter/UIStarterUserSettings.cs
new file mode 100644
index 000000000..19fef38de
--- /dev/null
+++ b/src/PKSim.UI.Starter/UIStarterUserSettings.cs
@@ -0,0 +1,50 @@
+using System.Collections.Generic;
+using System.Drawing;
+using OSPSuite.Assets;
+using OSPSuite.Core.Comparison;
+using OSPSuite.Core.Diagram;
+using OSPSuite.Core.Domain;
+using OSPSuite.Presentation;
+using OSPSuite.Presentation.Diagram.Elements;
+using OSPSuite.Presentation.Presenters.ParameterIdentifications;
+using OSPSuite.Presentation.Presenters.SensitivityAnalyses;
+using OSPSuite.Presentation.Settings;
+using PKSim.CLI.Core.MinimalImplementations;
+
+namespace PKSim.UI.Starter
+{
+ public class UIStarterUserSettings : CLIUserSettings, IPresentationUserSettings
+ {
+ public UIStarterUserSettings()
+ {
+ DisplayUnits = new DisplayUnitsManager();
+ ComparerSettings = new ComparerSettings { CompareHiddenEntities = false };
+ ProjectFiles = new List();
+ DiagramOptions = new DiagramOptions();
+ JournalPageEditorSettings = new JournalPageEditorSettings();
+ ParameterIdentificationFeedbackEditorSettings = new ParameterIdentificationFeedbackEditorSettings();
+ SensitivityAnalysisFeedbackEditorSettings = new SensitivityAnalysisFeedbackEditorSettings();
+
+ ResetToDefault();
+ }
+
+ public string DefaultChartEditorLayout { get; set; }
+ public string ActiveSkin { get; set; }
+ public Scalings DefaultChartYScaling { get; set; }
+ public IconSize IconSizeTreeView { get; set; }
+ public IconSize IconSizeTab { get; set; }
+ public IconSize IconSizeContextMenu { get; set; }
+ public Color ChartBackColor { get; set; }
+ public Color ChartDiagramBackColor { get; set; }
+ public bool ColorGroupObservedDataFromSameFolder { get; set; }
+ public DisplayUnitsManager DisplayUnits { get; set; }
+ public IList ProjectFiles { get; set; }
+ public uint MRUListItemCount { get; set; }
+ public ComparerSettings ComparerSettings { get; set; }
+ public IDiagramOptions DiagramOptions { get; set; }
+ public string ChartEditorLayout { get; set; }
+ public JournalPageEditorSettings JournalPageEditorSettings { get; set; }
+ public ParameterIdentificationFeedbackEditorSettings ParameterIdentificationFeedbackEditorSettings { get; set; }
+ public SensitivityAnalysisFeedbackEditorSettings SensitivityAnalysisFeedbackEditorSettings { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/src/PKSim.UI/BootStrapping/ApplicationStartup.cs b/src/PKSim.UI/BootStrapping/ApplicationStartup.cs
index 91b2301d1..b5db161ca 100644
--- a/src/PKSim.UI/BootStrapping/ApplicationStartup.cs
+++ b/src/PKSim.UI/BootStrapping/ApplicationStartup.cs
@@ -122,7 +122,7 @@ public void Start()
showStatusMessage(progress, PKSimConstants.UI.RegisterAssembly(PKSimConstants.UI.Infrastructure));
container.AddRegister(x => x.FromType());
- showStatusMessage(progress, message: PKSimConstants.UI.RegisterAssembly(PKSimConstants.UI.Presentation));
+ showStatusMessage(progress, PKSimConstants.UI.RegisterAssembly(PKSimConstants.UI.Presentation));
container.AddRegister(x => x.FromType());
showStatusMessage(progress, PKSimConstants.UI.RegisterAssembly(PKSimConstants.UI.UserInterface));
@@ -153,7 +153,7 @@ private void finalizeRegistration(IContainer container)
container.Resolve();
var mainPresenter = container.Resolve();
- container.RegisterImplementationOf((IChangePropagator) mainPresenter);
+ container.RegisterImplementationOf((IChangePropagator)mainPresenter);
//This runner is only register when running PKSim as an executable. All other implementation should use the ISimulationRunner
container.Register(LifeStyle.Singleton);
diff --git a/src/PKSim.UI/PKSim.UI.csproj b/src/PKSim.UI/PKSim.UI.csproj
index 43cfbe394..f257ad330 100644
--- a/src/PKSim.UI/PKSim.UI.csproj
+++ b/src/PKSim.UI/PKSim.UI.csproj
@@ -60,14 +60,14 @@
-
+
-
-
-
+
+
+
diff --git a/src/PKSim/PKSim.csproj b/src/PKSim/PKSim.csproj
index 3d04bf135..095275081 100644
--- a/src/PKSim/PKSim.csproj
+++ b/src/PKSim/PKSim.csproj
@@ -76,18 +76,19 @@
-
-
+
+
-
+
+
diff --git a/tests/PKSim.Matlab.Tests/PKSim.Matlab.Tests.csproj b/tests/PKSim.Matlab.Tests/PKSim.Matlab.Tests.csproj
index 4321df250..a30d355b3 100644
--- a/tests/PKSim.Matlab.Tests/PKSim.Matlab.Tests.csproj
+++ b/tests/PKSim.Matlab.Tests/PKSim.Matlab.Tests.csproj
@@ -22,9 +22,9 @@
runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
-
+
diff --git a/tests/PKSim.R.Tests/PKSim.R.Tests.csproj b/tests/PKSim.R.Tests/PKSim.R.Tests.csproj
index ee451ae5d..6c7f61fd0 100644
--- a/tests/PKSim.R.Tests/PKSim.R.Tests.csproj
+++ b/tests/PKSim.R.Tests/PKSim.R.Tests.csproj
@@ -22,9 +22,9 @@
runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
-
+
diff --git a/tests/PKSim.Tests/PKSim.Tests.csproj b/tests/PKSim.Tests/PKSim.Tests.csproj
index 1cca4b340..488c36e71 100644
--- a/tests/PKSim.Tests/PKSim.Tests.csproj
+++ b/tests/PKSim.Tests/PKSim.Tests.csproj
@@ -20,9 +20,9 @@
runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
-
+
diff --git a/tests/PKSim.UI.Starter/ApplicationStartup.cs b/tests/PKSim.UI.Starter/ApplicationStartup.cs
deleted file mode 100644
index e60a723e6..000000000
--- a/tests/PKSim.UI.Starter/ApplicationStartup.cs
+++ /dev/null
@@ -1,82 +0,0 @@
-using DevExpress.LookAndFeel;
-using Microsoft.Extensions.Logging;
-using OSPSuite.Core.Diagram;
-using OSPSuite.Core.Journal;
-using OSPSuite.Core.Serialization.Diagram;
-using OSPSuite.Core.Services;
-using OSPSuite.Presentation;
-using OSPSuite.Presentation.Services;
-using OSPSuite.Utility.Container;
-using OSPSuite.Utility.Events;
-using OSPSuite.Utility.Exceptions;
-using PKSim.BatchTool;
-using PKSim.CLI.Core.MinimalImplementations;
-using PKSim.Core;
-using PKSim.Core.Model;
-using PKSim.Core.Services;
-using PKSim.Infrastructure;
-using PKSim.Presentation;
-using PKSim.Presentation.Views.Individuals;
-using PKSim.Presentation.Views.Parameters;
-using PKSim.UI.Views.Individuals;
-using PKSim.UI.Views.Parameters;
-using CoreRegister = PKSim.Core.CoreRegister;
-using IWorkspace = OSPSuite.Core.IWorkspace;
-using PresenterRegister = PKSim.Presentation.PresenterRegister;
-
-namespace PKSim.UI.Starter
-{
- public static class ApplicationStartup
- {
- public static void Start()
- {
- BootStrapping.ApplicationStartup.Initialize(LogLevel.Debug);
-
- var container = IoC.Container;
- using (container.OptimizeDependencyResolution())
- {
- container.AddRegister(x => x.FromType());
- container.AddRegister(x => x.FromType());
- container.AddRegister(x => x.FromType());
- container.AddRegister(x => x.FromType());
-
- registerMinimalImplementations(container);
- registerUIImplementation(container);
-
- InfrastructureRegister.LoadSerializers(container);
- InfrastructureRegister.RegisterWorkspace(container);
- BootStrapping.ApplicationStartup.RegisterCommands(container);
- container.RegisterImplementationOf(new DefaultLookAndFeel().LookAndFeel);
- }
-
- container.Register(LifeStyle.Transient);
- var skinManager = container.Resolve();
- var userSettings = container.Resolve();
- // skinManager.ActivateSkin(userSettings, Constants.DEFAULT_SKIN);
- }
-
- private static void registerUIImplementation(IContainer container)
- {
- container.Register();
- container.Register();
- container.Register();
- container.Register();
- container.Register();
- container.Register();
- }
-
- private static void registerMinimalImplementations(IContainer container)
- {
- container.Register(LifeStyle.Singleton);
- container.Register(
- LifeStyle.Singleton);
- container.Register();
- container.Register();
- container.Register();
- container.Register();
- container.Register();
- container.Register();
- container.Register();
- }
- }
-}
\ No newline at end of file
diff --git a/tests/PKSim.UI.Starter/PKSim.UI.Starter.csproj b/tests/PKSim.UI.Starter/PKSim.UI.Starter.csproj
index 3af20f05e..c70feed01 100644
--- a/tests/PKSim.UI.Starter/PKSim.UI.Starter.csproj
+++ b/tests/PKSim.UI.Starter/PKSim.UI.Starter.csproj
@@ -56,14 +56,14 @@
-
-
+
+
-
+
diff --git a/tests/PKSim.UI.Starter/Presenters/StarterMainPresenter.cs b/tests/PKSim.UI.Starter/Presenters/StarterMainPresenter.cs
deleted file mode 100644
index 4037784a8..000000000
--- a/tests/PKSim.UI.Starter/Presenters/StarterMainPresenter.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-using OSPSuite.Presentation.Core;
-using OSPSuite.Presentation.Presenters;
-using PKSim.UI.Starter.Views;
-
-namespace PKSim.UI.Starter.Presenters
-{
-
- public interface IStarterMainPresenter : IPresenter
- {
- void ShowRelativeExpression();
- }
-
- public class StarterMainPresenter : AbstractPresenter, IStarterMainPresenter
- {
- private readonly IApplicationController _applicationController;
-
- public StarterMainPresenter(IStarterMainView view, IApplicationController applicationController) : base(view)
- {
- _applicationController = applicationController;
- }
-
-
-
- // private T start() where T : IBatchPresenter
- // {
- // var presenter = _applicationController.Start();
- // View.Hide();
- // presenter.InitializeForStandAloneStart();
- // return presenter;
- //}
- public void ShowRelativeExpression()
- {
- using (var presenter = _applicationController.Start())
- presenter.Start();
-
- }
- }
-}
\ No newline at end of file
diff --git a/tests/PKSim.UI.Starter/Presenters/StarterRelativeExpressionPresenter.cs b/tests/PKSim.UI.Starter/Presenters/StarterRelativeExpressionPresenter.cs
deleted file mode 100644
index 43e91c897..000000000
--- a/tests/PKSim.UI.Starter/Presenters/StarterRelativeExpressionPresenter.cs
+++ /dev/null
@@ -1,82 +0,0 @@
-using OSPSuite.Presentation.Presenters;
-using PKSim.Core;
-using PKSim.Core.Commands;
-using PKSim.Core.Model;
-using PKSim.Core.Services;
-using PKSim.Core.Snapshots;
-using PKSim.Core.Snapshots.Mappers;
-using PKSim.Presentation.Presenters.Individuals;
-using PKSim.UI.Starter.Views;
-using Individual = PKSim.Core.Model.Individual;
-using OriginData = PKSim.Core.Snapshots.OriginData;
-
-namespace PKSim.UI.Starter.Presenters
-{
- public interface IStarterRelativeExpressionPresenter : IDisposablePresenter
- {
- void Start();
- }
-
- public class StarterRelativeExpressionPresenter : AbstractDisposableCommandCollectorPresenter,
- IStarterRelativeExpressionPresenter
- {
- private readonly OriginDataMapper _originDataMapper;
- private readonly IIndividualFactory _individualFactory;
- private readonly IIndividualEnzymeFactory _individualEnzymeFactory;
- private readonly IIndividualEnzymeExpressionsPresenter _individualEnzymeExpressionsPresenter;
-
- public StarterRelativeExpressionPresenter(
- IStarterRelativeExpressionView view,
- OriginDataMapper originDataMapper,
- IIndividualFactory individualFactory,
- IIndividualEnzymeFactory individualEnzymeFactory, IIndividualEnzymeExpressionsPresenter individualEnzymeExpressionsPresenter) : base(view)
- {
- _originDataMapper = originDataMapper;
- _individualFactory = individualFactory;
- _individualEnzymeFactory = individualEnzymeFactory;
- _individualEnzymeExpressionsPresenter = individualEnzymeExpressionsPresenter;
- AddSubPresenters(individualEnzymeExpressionsPresenter);
- InitializeWith(new PKSimMacroCommand());
- }
-
- public void Start()
- {
- var individual = createIndividual();
- var enzyme = _individualEnzymeFactory.AddMoleculeTo(individual, "CYP3A4");
- View.AddExpressionPresenter(_individualEnzymeExpressionsPresenter.BaseView);
- _individualEnzymeExpressionsPresenter.SimulationSubject = individual;
- _individualEnzymeExpressionsPresenter.ActivateMolecule(enzyme);
- View.Display();
- }
-
- private Individual createIndividual()
- {
- var originData = new OriginData
- {
- Species = CoreConstants.Species.HUMAN,
- Population = CoreConstants.Population.ICRP,
- Age = new Parameter
- {
- Value = 30,
- Unit = "year(s)",
- },
- Weight = new Parameter
- {
- Value = 75,
- Unit = "kg",
- },
- Height = new Parameter
- {
- Value = 175,
- Unit = "cm",
- },
- Gender = CoreConstants.Gender.MALE
- };
-
- var modelOriginData = _originDataMapper.MapToModel(originData, new SnapshotContext()).Result;
- var individual = _individualFactory.CreateAndOptimizeFor(modelOriginData);
-
- return individual;
- }
- }
-}
\ No newline at end of file
diff --git a/tests/PKSim.UI.Starter/Program.cs b/tests/PKSim.UI.Starter/Program.cs
deleted file mode 100644
index 264e214ef..000000000
--- a/tests/PKSim.UI.Starter/Program.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-using System;
-using System.Windows.Forms;
-using DevExpress.LookAndFeel;
-using DevExpress.XtraEditors;
-using Microsoft.Extensions.Logging;
-using OSPSuite.Core.Extensions;
-using OSPSuite.Utility.Container;
-using OSPSuite.Utility.Extensions;
-using PKSim.UI.BootStrapping;
-using PKSim.UI.Starter.Presenters;
-
-namespace PKSim.UI.Starter
-{
- internal static class Program
- {
- ///
- /// The main entry point for the application.
- ///
- [STAThread]
- private static void Main(string[] args)
- {
- Application.EnableVisualStyles();
- Application.SetCompatibleTextRenderingDefault(false);
-
- // WindowsFormsSettings.SetDPIAware();
- WindowsFormsSettings.TouchUIMode = TouchUIMode.False;
-
- try
- {
- ApplicationStartup.Start();
- var mainPresenter = IoC.Resolve();
- Application.Run(mainPresenter.BaseView.DowncastTo