From 30aea346128a5618c26aabb29aee6724501e27a9 Mon Sep 17 00:00:00 2001 From: georgeDaskalakis <37107428+georgeDaskalakis@users.noreply.github.com> Date: Tue, 28 Jun 2022 00:39:53 +0200 Subject: [PATCH 01/18] initial --- src/MoBi.Assets/AppConstants.cs | 1 + src/MoBi.Assets/MoBi.Assets.csproj | 6 +- src/MoBi.BatchTool/MoBi.BatchTool.csproj | 2 +- src/MoBi.Core/Domain/Model/MoBiSimulation.cs | 3 +- src/MoBi.Core/MoBi.Core.csproj | 14 +-- src/MoBi.Engine/MoBi.Engine.csproj | 4 +- .../MoBi.Presentation.csproj | 6 +- .../Presenter/EditSimulationPresenter.cs | 8 +- .../Views/IEditSimulationView.cs | 2 + src/MoBi.UI/MoBi.UI.csproj | 10 +-- .../EditSimulationView.Designer.cs | 90 ++++++++++++++----- .../SimulationView/EditSimulationView.cs | 6 ++ src/MoBi/MoBi.csproj | 4 +- tests/MoBi.Tests/MoBi.Tests.csproj | 8 +- .../EditSimulationPresenterSpecs.cs | 6 +- tests/MoBi.UI.Tests/MoBi.UI.Tests.csproj | 4 +- 16 files changed, 117 insertions(+), 57 deletions(-) diff --git a/src/MoBi.Assets/AppConstants.cs b/src/MoBi.Assets/AppConstants.cs index b6636f902..4f5e802e7 100644 --- a/src/MoBi.Assets/AppConstants.cs +++ b/src/MoBi.Assets/AppConstants.cs @@ -1423,6 +1423,7 @@ public static class Captions public static readonly string ModelDiagram = "Diagram"; public static readonly string SimulationParameters = "Parameters"; public static readonly string Results = "Results"; + public static readonly string SimulationData = "Data"; public static readonly string IsStationary = "Stationary"; public static readonly string DefaultStartAmount = "Amount"; public static readonly string MoleculeType = "Molecule Type"; diff --git a/src/MoBi.Assets/MoBi.Assets.csproj b/src/MoBi.Assets/MoBi.Assets.csproj index e32ba921a..ce1dc1418 100644 --- a/src/MoBi.Assets/MoBi.Assets.csproj +++ b/src/MoBi.Assets/MoBi.Assets.csproj @@ -26,9 +26,9 @@ - - - + + + diff --git a/src/MoBi.BatchTool/MoBi.BatchTool.csproj b/src/MoBi.BatchTool/MoBi.BatchTool.csproj index 87951aa46..4048758fa 100644 --- a/src/MoBi.BatchTool/MoBi.BatchTool.csproj +++ b/src/MoBi.BatchTool/MoBi.BatchTool.csproj @@ -60,7 +60,7 @@ - + diff --git a/src/MoBi.Core/Domain/Model/MoBiSimulation.cs b/src/MoBi.Core/Domain/Model/MoBiSimulation.cs index 708ec36d5..41d64a3ec 100644 --- a/src/MoBi.Core/Domain/Model/MoBiSimulation.cs +++ b/src/MoBi.Core/Domain/Model/MoBiSimulation.cs @@ -5,6 +5,7 @@ using OSPSuite.Core.Domain; using OSPSuite.Core.Domain.Builder; using OSPSuite.Core.Domain.Data; +using OSPSuite.Core.Domain.ParameterIdentifications; using OSPSuite.Core.Domain.Services; using OSPSuite.Utility.Collections; using OSPSuite.Utility.Visitor; @@ -43,7 +44,7 @@ public class MoBiSimulation : ModelCoreSimulation, IMoBiSimulation public CurveChart Chart { get; set; } public string ParameterIdentificationWorkingDirectory { get; set; } public IDiagramManager DiagramManager { get; set; } - + public OutputMappings OutputMappings { get; set; } = new OutputMappings(); public MoBiSimulation() { HistoricResults = new Cache(x => x.Id, x => null); diff --git a/src/MoBi.Core/MoBi.Core.csproj b/src/MoBi.Core/MoBi.Core.csproj index 594ae873d..04050b48f 100644 --- a/src/MoBi.Core/MoBi.Core.csproj +++ b/src/MoBi.Core/MoBi.Core.csproj @@ -32,13 +32,13 @@ - - - - - - - + + + + + + + diff --git a/src/MoBi.Engine/MoBi.Engine.csproj b/src/MoBi.Engine/MoBi.Engine.csproj index cb8530f66..db58af53c 100644 --- a/src/MoBi.Engine/MoBi.Engine.csproj +++ b/src/MoBi.Engine/MoBi.Engine.csproj @@ -32,8 +32,8 @@ - - + + diff --git a/src/MoBi.Presentation/MoBi.Presentation.csproj b/src/MoBi.Presentation/MoBi.Presentation.csproj index 0f179c274..3f1b61c37 100644 --- a/src/MoBi.Presentation/MoBi.Presentation.csproj +++ b/src/MoBi.Presentation/MoBi.Presentation.csproj @@ -28,9 +28,9 @@ - - - + + + diff --git a/src/MoBi.Presentation/Presenter/EditSimulationPresenter.cs b/src/MoBi.Presentation/Presenter/EditSimulationPresenter.cs index a63bad04c..046d865a5 100644 --- a/src/MoBi.Presentation/Presenter/EditSimulationPresenter.cs +++ b/src/MoBi.Presentation/Presenter/EditSimulationPresenter.cs @@ -50,11 +50,12 @@ public class EditSimulationPresenter : SingleStartPresenter _favoritesPresenter.Favorites(); _view.SetChartView(chartPresenter.View); - AddSubPresenters(_chartPresenter, _hierarchicalPresenter, _simulationDiagramPresenter, _solverSettingsPresenter, _editOutputSchemaPresenter, _favoritesPresenter, _userDefinedParametersPresenter); + _view.SetDataView(_simulationOutputMappingPresenter.View); + AddSubPresenters(_chartPresenter, _hierarchicalPresenter, _simulationDiagramPresenter, _solverSettingsPresenter, _editOutputSchemaPresenter, _favoritesPresenter, _userDefinedParametersPresenter, _simulationOutputMappingPresenter); _cacheShowPresenter = new Cache {OnMissingKey = x => null}; } @@ -109,6 +112,7 @@ public void Edit(IMoBiSimulation simulation) _favoritesPresenter.Edit(_simulation); _chartPresenter.UpdateTemplatesFor(_simulation); _view.SetEditView(_favoritesPresenter.BaseView); + _simulationOutputMappingPresenter.SetSimulation(simulation); UpdateCaption(); _view.Display(); loadChart(); diff --git a/src/MoBi.Presentation/Views/IEditSimulationView.cs b/src/MoBi.Presentation/Views/IEditSimulationView.cs index 1249921fe..b2c5673d3 100644 --- a/src/MoBi.Presentation/Views/IEditSimulationView.cs +++ b/src/MoBi.Presentation/Views/IEditSimulationView.cs @@ -20,5 +20,7 @@ public interface IEditSimulationView : IMdiChildView /// Changes the displayed view to the results view /// void ShowResultsTab(); + + void SetDataView(ISimulationOutputMappingView view); } } \ No newline at end of file diff --git a/src/MoBi.UI/MoBi.UI.csproj b/src/MoBi.UI/MoBi.UI.csproj index 11d76aafe..93905cc24 100644 --- a/src/MoBi.UI/MoBi.UI.csproj +++ b/src/MoBi.UI/MoBi.UI.csproj @@ -27,12 +27,12 @@ - - - - + + + + - + diff --git a/src/MoBi.UI/Views/SimulationView/EditSimulationView.Designer.cs b/src/MoBi.UI/Views/SimulationView/EditSimulationView.Designer.cs index 57e034065..6b7edb5f2 100644 --- a/src/MoBi.UI/Views/SimulationView/EditSimulationView.Designer.cs +++ b/src/MoBi.UI/Views/SimulationView/EditSimulationView.Designer.cs @@ -37,19 +37,26 @@ private void InitializeComponent() this.tabsNavigation = new DevExpress.XtraTab.XtraTabControl(); this.tabTree = new DevExpress.XtraTab.XtraTabPage(); this.tabDiagram = new DevExpress.XtraTab.XtraTabPage(); - this.tabResults = new DevExpress.XtraTab.XtraTabPage(); this.spliterDiagram = new DevExpress.XtraEditors.SplitContainerControl(); this.modelOverview = new Northwoods.Go.GoOverview(); + this.tabResults = new DevExpress.XtraTab.XtraTabPage(); + this.tabData = new DevExpress.XtraTab.XtraTabPage(); ((System.ComponentModel.ISupportInitialize)(this._errorProvider)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.tabs)).BeginInit(); this.tabs.SuspendLayout(); this.tabSimulation.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.splitSimulationParameters)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.splitSimulationParameters.Panel1)).BeginInit(); + this.splitSimulationParameters.Panel1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitSimulationParameters.Panel2)).BeginInit(); this.splitSimulationParameters.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.tabsNavigation)).BeginInit(); this.tabsNavigation.SuspendLayout(); this.tabDiagram.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.spliterDiagram)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.spliterDiagram.Panel1)).BeginInit(); + this.spliterDiagram.Panel1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.spliterDiagram.Panel2)).BeginInit(); this.spliterDiagram.SuspendLayout(); this.SuspendLayout(); // @@ -57,9 +64,10 @@ private void InitializeComponent() // this.tabs.Dock = System.Windows.Forms.DockStyle.Fill; this.tabs.Location = new System.Drawing.Point(0, 0); + this.tabs.Margin = new System.Windows.Forms.Padding(8, 8, 8, 8); this.tabs.Name = "tabs"; this.tabs.SelectedTabPage = this.tabSimulation; - this.tabs.Size = new System.Drawing.Size(516, 389); + this.tabs.Size = new System.Drawing.Size(1290, 987); this.tabs.TabIndex = 0; this.tabs.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[] { this.tabSimulation, @@ -68,8 +76,9 @@ private void InitializeComponent() // tabSimulation // this.tabSimulation.Controls.Add(this.splitSimulationParameters); + this.tabSimulation.Margin = new System.Windows.Forms.Padding(8, 8, 8, 8); this.tabSimulation.Name = "tabSimulation"; - this.tabSimulation.Size = new System.Drawing.Size(510, 361); + this.tabSimulation.Size = new System.Drawing.Size(1286, 926); this.tabSimulation.Text = "Simulation"; // // splitSimulationParameters @@ -77,12 +86,19 @@ private void InitializeComponent() this.splitSimulationParameters.Dock = System.Windows.Forms.DockStyle.Fill; this.splitSimulationParameters.FixedPanel = DevExpress.XtraEditors.SplitFixedPanel.None; this.splitSimulationParameters.Location = new System.Drawing.Point(0, 0); + this.splitSimulationParameters.Margin = new System.Windows.Forms.Padding(8, 8, 8, 8); this.splitSimulationParameters.Name = "splitSimulationParameters"; + // + // splitSimulationParameters.Panel1 + // this.splitSimulationParameters.Panel1.Controls.Add(this.tabsNavigation); this.splitSimulationParameters.Panel1.Text = "Panel1"; + // + // splitSimulationParameters.Panel2 + // this.splitSimulationParameters.Panel2.Text = "Panel2"; - this.splitSimulationParameters.Size = new System.Drawing.Size(510, 361); - this.splitSimulationParameters.SplitterPosition = 255; + this.splitSimulationParameters.Size = new System.Drawing.Size(3215, 2315); + this.splitSimulationParameters.SplitterPosition = 1608; this.splitSimulationParameters.TabIndex = 0; this.splitSimulationParameters.Text = "splitContainerControl1"; // @@ -90,43 +106,48 @@ private void InitializeComponent() // this.tabsNavigation.Dock = System.Windows.Forms.DockStyle.Fill; this.tabsNavigation.Location = new System.Drawing.Point(0, 0); + this.tabsNavigation.Margin = new System.Windows.Forms.Padding(8, 8, 8, 8); this.tabsNavigation.Name = "tabsNavigation"; this.tabsNavigation.SelectedTabPage = this.tabTree; - this.tabsNavigation.Size = new System.Drawing.Size(255, 361); + this.tabsNavigation.Size = new System.Drawing.Size(1608, 2315); this.tabsNavigation.TabIndex = 0; this.tabsNavigation.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[] { this.tabTree, - this.tabDiagram}); + this.tabDiagram, + this.tabData}); // - // tabHirarchic + // tabTree // + this.tabTree.Margin = new System.Windows.Forms.Padding(8, 8, 8, 8); this.tabTree.Name = "tabTree"; - this.tabTree.Size = new System.Drawing.Size(249, 333); + this.tabTree.Size = new System.Drawing.Size(639, 865); this.tabTree.Text = "tabTree"; // // tabDiagram // this.tabDiagram.Controls.Add(this.spliterDiagram); + this.tabDiagram.Margin = new System.Windows.Forms.Padding(8, 8, 8, 8); this.tabDiagram.Name = "tabDiagram"; - this.tabDiagram.Size = new System.Drawing.Size(249, 333); + this.tabDiagram.Size = new System.Drawing.Size(634, 855); this.tabDiagram.Text = "tabDiagram"; // - // tabResults - // - this.tabResults.Name = "tabResults"; - this.tabResults.Size = new System.Drawing.Size(510, 361); - this.tabResults.Text = "tabResults"; - // // spliterDiagram // this.spliterDiagram.Dock = System.Windows.Forms.DockStyle.Fill; this.spliterDiagram.Location = new System.Drawing.Point(0, 0); + this.spliterDiagram.Margin = new System.Windows.Forms.Padding(8, 8, 8, 8); this.spliterDiagram.Name = "spliterDiagram"; + // + // spliterDiagram.Panel1 + // this.spliterDiagram.Panel1.Controls.Add(this.modelOverview); this.spliterDiagram.Panel1.Text = "Panel1"; + // + // spliterDiagram.Panel2 + // this.spliterDiagram.Panel2.Text = "Panel2"; - this.spliterDiagram.Size = new System.Drawing.Size(249, 333); - this.spliterDiagram.SplitterPosition = 123; + this.spliterDiagram.Size = new System.Drawing.Size(634, 855); + this.spliterDiagram.SplitterPosition = 307; this.spliterDiagram.TabIndex = 1; this.spliterDiagram.Text = "splitContainerControl2"; // @@ -146,28 +167,49 @@ private void InitializeComponent() this.modelOverview.DocScale = 0.125F; this.modelOverview.DragsRealtime = true; this.modelOverview.Location = new System.Drawing.Point(0, 0); + this.modelOverview.Margin = new System.Windows.Forms.Padding(8, 8, 8, 8); this.modelOverview.Name = "modelOverview"; this.modelOverview.ShowsNegativeCoordinates = false; - this.modelOverview.Size = new System.Drawing.Size(123, 333); + this.modelOverview.Size = new System.Drawing.Size(307, 855); this.modelOverview.TabIndex = 0; this.modelOverview.Text = "modelOverview"; // - // SimulationView + // tabResults // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.tabResults.Margin = new System.Windows.Forms.Padding(8, 8, 8, 8); + this.tabResults.Name = "tabResults"; + this.tabResults.Size = new System.Drawing.Size(1286, 926); + this.tabResults.Text = "tabResults"; + // + // tabData + // + this.tabData.Name = "tabData"; + this.tabData.Size = new System.Drawing.Size(1604, 2254); + this.tabData.Text = "tabData"; + // + // EditSimulationView + // + this.AutoScaleDimensions = new System.Drawing.SizeF(15F, 33F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(516, 389); + this.ClientSize = new System.Drawing.Size(1290, 987); this.Controls.Add(this.tabs); - this.Name = "SimulationView"; + this.Margin = new System.Windows.Forms.Padding(20, 20, 20, 20); + this.Name = "EditSimulationView"; ((System.ComponentModel.ISupportInitialize)(this._errorProvider)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.tabs)).EndInit(); this.tabs.ResumeLayout(false); this.tabSimulation.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitSimulationParameters.Panel1)).EndInit(); + this.splitSimulationParameters.Panel1.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitSimulationParameters.Panel2)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.splitSimulationParameters)).EndInit(); this.splitSimulationParameters.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.tabsNavigation)).EndInit(); this.tabsNavigation.ResumeLayout(false); this.tabDiagram.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.spliterDiagram.Panel1)).EndInit(); + this.spliterDiagram.Panel1.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.spliterDiagram.Panel2)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.spliterDiagram)).EndInit(); this.spliterDiagram.ResumeLayout(false); this.ResumeLayout(false); @@ -185,6 +227,6 @@ private void InitializeComponent() private DevExpress.XtraTab.XtraTabPage tabDiagram; private SplitContainerControl spliterDiagram; private Northwoods.Go.GoOverview modelOverview; - + private DevExpress.XtraTab.XtraTabPage tabData; } } diff --git a/src/MoBi.UI/Views/SimulationView/EditSimulationView.cs b/src/MoBi.UI/Views/SimulationView/EditSimulationView.cs index 179d2ed1d..9c1b6c700 100644 --- a/src/MoBi.UI/Views/SimulationView/EditSimulationView.cs +++ b/src/MoBi.UI/Views/SimulationView/EditSimulationView.cs @@ -38,6 +38,7 @@ public override void InitializeResources() tabTree.InitWith(AppConstants.Captions.Tree, ApplicationIcons.Tree); tabSimulation.InitWith(AppConstants.Captions.SimulationParameters, ApplicationIcons.Parameter); tabResults.InitWith(AppConstants.Captions.Results, ApplicationIcons.TimeProfileAnalysis); + tabData.InitWith(AppConstants.Captions.SimulationData, ApplicationIcons.PKSim); tabsNavigation.SelectedPageChanging += (o, e) => OnEvent(tabSelectionChanged, e); tabs.SelectedPageChanging += (o, e) => OnEvent(tabSelectionChanged, e); @@ -62,6 +63,11 @@ public void SetTreeView(IView view) tabTree.FillWith(view); } + public void SetDataView(ISimulationOutputMappingView view) + { + tabData.FillWith(view); + } + public void SetChartView(IChartView chartView) { chartView.CaptionChanged += (o, e) => OnEvent(() => tabResults.Text = simulationPresenter.CreateResultTabCaption(chartView.Caption)); diff --git a/src/MoBi/MoBi.csproj b/src/MoBi/MoBi.csproj index 0cc8b4b10..c69d0b345 100644 --- a/src/MoBi/MoBi.csproj +++ b/src/MoBi/MoBi.csproj @@ -68,13 +68,13 @@ - + - + diff --git a/tests/MoBi.Tests/MoBi.Tests.csproj b/tests/MoBi.Tests/MoBi.Tests.csproj index 2bebf1f82..d4993181c 100644 --- a/tests/MoBi.Tests/MoBi.Tests.csproj +++ b/tests/MoBi.Tests/MoBi.Tests.csproj @@ -45,10 +45,10 @@ - - - - + + + + diff --git a/tests/MoBi.Tests/Presentation/EditSimulationPresenterSpecs.cs b/tests/MoBi.Tests/Presentation/EditSimulationPresenterSpecs.cs index 4056982b3..776a1d688 100644 --- a/tests/MoBi.Tests/Presentation/EditSimulationPresenterSpecs.cs +++ b/tests/MoBi.Tests/Presentation/EditSimulationPresenterSpecs.cs @@ -13,6 +13,7 @@ using OSPSuite.Core.Domain; using OSPSuite.Core.Domain.Data; using OSPSuite.Core.Domain.UnitSystem; +using OSPSuite.Presentation.Presenters; using OSPSuite.Presentation.Views; namespace MoBi.Presentation @@ -29,6 +30,7 @@ public abstract class concern_for_EditSimulationPresenter : ContextSpecification protected IEditFavoritesInSimulationPresenter _editFavoritePresenter; protected IChartTasks _chartTasks; protected IUserDefinedParametersPresenter _userDefinedParametersPresenter; + protected ISimulationOutputMappingPresenter _simulationOutputMappingPresenter; protected override void Context() { @@ -42,9 +44,11 @@ protected override void Context() _editFavoritePresenter = A.Fake(); _chartTasks = A.Fake(); _userDefinedParametersPresenter = A.Fake(); + _simulationOutputMappingPresenter = A.Fake(); + sut = new EditSimulationPresenter(_view, _chartPresenter, _hierarchicalSimulationPresenter, _diagramPresenter, _solverSettings, _outputSchemaPresenter, _presenterFactory, new HeavyWorkManagerForSpecs(), - A.Fake(), _editFavoritePresenter, _chartTasks, _userDefinedParametersPresenter); + A.Fake(), _editFavoritePresenter, _chartTasks, _userDefinedParametersPresenter, _simulationOutputMappingPresenter); } } diff --git a/tests/MoBi.UI.Tests/MoBi.UI.Tests.csproj b/tests/MoBi.UI.Tests/MoBi.UI.Tests.csproj index 031d878a8..bc3642236 100644 --- a/tests/MoBi.UI.Tests/MoBi.UI.Tests.csproj +++ b/tests/MoBi.UI.Tests/MoBi.UI.Tests.csproj @@ -17,8 +17,8 @@ - - + + From 1eb38f79c939493cc839de1ce8cc2805689cdf33 Mon Sep 17 00:00:00 2001 From: georgeDaskalakis <37107428+georgeDaskalakis@users.noreply.github.com> Date: Thu, 14 Jul 2022 12:26:49 +0200 Subject: [PATCH 02/18] plugging in new dlls --- src/MoBi.Assets/MoBi.Assets.csproj | 6 +++--- src/MoBi.BatchTool/MoBi.BatchTool.csproj | 2 +- src/MoBi.Core/MoBi.Core.csproj | 14 +++++++------- src/MoBi.Engine/MoBi.Engine.csproj | 4 ++-- src/MoBi.Presentation/MoBi.Presentation.csproj | 6 +++--- src/MoBi.UI/MoBi.UI.csproj | 10 +++++----- src/MoBi/MoBi.csproj | 4 ++-- 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/MoBi.Assets/MoBi.Assets.csproj b/src/MoBi.Assets/MoBi.Assets.csproj index ce1dc1418..0bcd3f0fa 100644 --- a/src/MoBi.Assets/MoBi.Assets.csproj +++ b/src/MoBi.Assets/MoBi.Assets.csproj @@ -26,9 +26,9 @@ - - - + + + diff --git a/src/MoBi.BatchTool/MoBi.BatchTool.csproj b/src/MoBi.BatchTool/MoBi.BatchTool.csproj index 4048758fa..96bf3aa14 100644 --- a/src/MoBi.BatchTool/MoBi.BatchTool.csproj +++ b/src/MoBi.BatchTool/MoBi.BatchTool.csproj @@ -60,7 +60,7 @@ - + diff --git a/src/MoBi.Core/MoBi.Core.csproj b/src/MoBi.Core/MoBi.Core.csproj index 04050b48f..0cb8e40f8 100644 --- a/src/MoBi.Core/MoBi.Core.csproj +++ b/src/MoBi.Core/MoBi.Core.csproj @@ -32,13 +32,13 @@ - - - - - - - + + + + + + + diff --git a/src/MoBi.Engine/MoBi.Engine.csproj b/src/MoBi.Engine/MoBi.Engine.csproj index db58af53c..c87c24a23 100644 --- a/src/MoBi.Engine/MoBi.Engine.csproj +++ b/src/MoBi.Engine/MoBi.Engine.csproj @@ -32,8 +32,8 @@ - - + + diff --git a/src/MoBi.Presentation/MoBi.Presentation.csproj b/src/MoBi.Presentation/MoBi.Presentation.csproj index 3f1b61c37..aafb15150 100644 --- a/src/MoBi.Presentation/MoBi.Presentation.csproj +++ b/src/MoBi.Presentation/MoBi.Presentation.csproj @@ -28,9 +28,9 @@ - - - + + + diff --git a/src/MoBi.UI/MoBi.UI.csproj b/src/MoBi.UI/MoBi.UI.csproj index 93905cc24..29d390aef 100644 --- a/src/MoBi.UI/MoBi.UI.csproj +++ b/src/MoBi.UI/MoBi.UI.csproj @@ -27,12 +27,12 @@ - - - - + + + + - + diff --git a/src/MoBi/MoBi.csproj b/src/MoBi/MoBi.csproj index c69d0b345..4f57b1a91 100644 --- a/src/MoBi/MoBi.csproj +++ b/src/MoBi/MoBi.csproj @@ -68,13 +68,13 @@ - + - + From 2e82dd1820ef4e472e3ba7113eb096bd57aa5928 Mon Sep 17 00:00:00 2001 From: georgeDaskalakis <37107428+georgeDaskalakis@users.noreply.github.com> Date: Thu, 14 Jul 2022 13:39:03 +0200 Subject: [PATCH 03/18] plugging in --- src/MoBi.Assets/AppConstants.cs | 1 + src/MoBi.Assets/MoBi.Assets.csproj | 6 +- src/MoBi.BatchTool/MoBi.BatchTool.csproj | 2 +- src/MoBi.Core/Domain/Model/MoBiSimulation.cs | 3 + src/MoBi.Core/MoBi.Core.csproj | 14 +-- src/MoBi.Engine/MoBi.Engine.csproj | 4 +- .../MoBi.Presentation.csproj | 6 +- .../Presenter/EditSimulationPresenter.cs | 8 +- .../Views/IEditSimulationView.cs | 5 ++ src/MoBi.UI/MoBi.UI.csproj | 10 +-- .../EditSimulationView.Designer.cs | 90 ++++++++++++++----- .../SimulationView/EditSimulationView.cs | 6 ++ src/MoBi/MoBi.csproj | 4 +- tests/MoBi.Tests/MoBi.Tests.csproj | 8 +- .../EditSimulationPresenterSpecs.cs | 6 +- tests/MoBi.UI.Tests/MoBi.UI.Tests.csproj | 4 +- 16 files changed, 121 insertions(+), 56 deletions(-) diff --git a/src/MoBi.Assets/AppConstants.cs b/src/MoBi.Assets/AppConstants.cs index 3b072dc7b..2f6def3df 100644 --- a/src/MoBi.Assets/AppConstants.cs +++ b/src/MoBi.Assets/AppConstants.cs @@ -1422,6 +1422,7 @@ public static class Captions public static readonly string ModelDiagram = "Diagram"; public static readonly string SimulationParameters = "Parameters"; public static readonly string Results = "Results"; + public static readonly string SimulationData = "Data"; public static readonly string IsStationary = "Stationary"; public static readonly string DefaultStartAmount = "Amount"; public static readonly string MoleculeType = "Molecule Type"; diff --git a/src/MoBi.Assets/MoBi.Assets.csproj b/src/MoBi.Assets/MoBi.Assets.csproj index 3dc385181..8d7e1e45c 100644 --- a/src/MoBi.Assets/MoBi.Assets.csproj +++ b/src/MoBi.Assets/MoBi.Assets.csproj @@ -26,9 +26,9 @@ - - - + + + diff --git a/src/MoBi.BatchTool/MoBi.BatchTool.csproj b/src/MoBi.BatchTool/MoBi.BatchTool.csproj index d56a2bf72..f0693e272 100644 --- a/src/MoBi.BatchTool/MoBi.BatchTool.csproj +++ b/src/MoBi.BatchTool/MoBi.BatchTool.csproj @@ -60,7 +60,7 @@ - + diff --git a/src/MoBi.Core/Domain/Model/MoBiSimulation.cs b/src/MoBi.Core/Domain/Model/MoBiSimulation.cs index 708ec36d5..a54b4f99b 100644 --- a/src/MoBi.Core/Domain/Model/MoBiSimulation.cs +++ b/src/MoBi.Core/Domain/Model/MoBiSimulation.cs @@ -5,6 +5,7 @@ using OSPSuite.Core.Domain; using OSPSuite.Core.Domain.Builder; using OSPSuite.Core.Domain.Data; +using OSPSuite.Core.Domain.ParameterIdentifications; using OSPSuite.Core.Domain.Services; using OSPSuite.Utility.Collections; using OSPSuite.Utility.Visitor; @@ -124,6 +125,8 @@ public IEnumerable Charts get { yield return Chart; } } + public OutputMappings OutputMappings { get; set; } = new OutputMappings(); + public new IReactionBuildingBlock Reactions { get => BuildConfiguration.Reactions; diff --git a/src/MoBi.Core/MoBi.Core.csproj b/src/MoBi.Core/MoBi.Core.csproj index 898da1942..f8617be54 100644 --- a/src/MoBi.Core/MoBi.Core.csproj +++ b/src/MoBi.Core/MoBi.Core.csproj @@ -32,13 +32,13 @@ - - - - - - - + + + + + + + diff --git a/src/MoBi.Engine/MoBi.Engine.csproj b/src/MoBi.Engine/MoBi.Engine.csproj index 62e7002ac..6181f095b 100644 --- a/src/MoBi.Engine/MoBi.Engine.csproj +++ b/src/MoBi.Engine/MoBi.Engine.csproj @@ -32,8 +32,8 @@ - - + + diff --git a/src/MoBi.Presentation/MoBi.Presentation.csproj b/src/MoBi.Presentation/MoBi.Presentation.csproj index b5c640c13..3404a5603 100644 --- a/src/MoBi.Presentation/MoBi.Presentation.csproj +++ b/src/MoBi.Presentation/MoBi.Presentation.csproj @@ -28,9 +28,9 @@ - - - + + + diff --git a/src/MoBi.Presentation/Presenter/EditSimulationPresenter.cs b/src/MoBi.Presentation/Presenter/EditSimulationPresenter.cs index a63bad04c..046d865a5 100644 --- a/src/MoBi.Presentation/Presenter/EditSimulationPresenter.cs +++ b/src/MoBi.Presentation/Presenter/EditSimulationPresenter.cs @@ -50,11 +50,12 @@ public class EditSimulationPresenter : SingleStartPresenter _favoritesPresenter.Favorites(); _view.SetChartView(chartPresenter.View); - AddSubPresenters(_chartPresenter, _hierarchicalPresenter, _simulationDiagramPresenter, _solverSettingsPresenter, _editOutputSchemaPresenter, _favoritesPresenter, _userDefinedParametersPresenter); + _view.SetDataView(_simulationOutputMappingPresenter.View); + AddSubPresenters(_chartPresenter, _hierarchicalPresenter, _simulationDiagramPresenter, _solverSettingsPresenter, _editOutputSchemaPresenter, _favoritesPresenter, _userDefinedParametersPresenter, _simulationOutputMappingPresenter); _cacheShowPresenter = new Cache {OnMissingKey = x => null}; } @@ -109,6 +112,7 @@ public void Edit(IMoBiSimulation simulation) _favoritesPresenter.Edit(_simulation); _chartPresenter.UpdateTemplatesFor(_simulation); _view.SetEditView(_favoritesPresenter.BaseView); + _simulationOutputMappingPresenter.SetSimulation(simulation); UpdateCaption(); _view.Display(); loadChart(); diff --git a/src/MoBi.Presentation/Views/IEditSimulationView.cs b/src/MoBi.Presentation/Views/IEditSimulationView.cs index 1249921fe..2a8f6cb02 100644 --- a/src/MoBi.Presentation/Views/IEditSimulationView.cs +++ b/src/MoBi.Presentation/Views/IEditSimulationView.cs @@ -20,5 +20,10 @@ public interface IEditSimulationView : IMdiChildView /// Changes the displayed view to the results view /// void ShowResultsTab(); + + /// + /// Sets the outputMappingView to the corresponding tab + /// + void SetDataView(ISimulationOutputMappingView view); } } \ No newline at end of file diff --git a/src/MoBi.UI/MoBi.UI.csproj b/src/MoBi.UI/MoBi.UI.csproj index 2cbe58db3..6a9545852 100644 --- a/src/MoBi.UI/MoBi.UI.csproj +++ b/src/MoBi.UI/MoBi.UI.csproj @@ -27,12 +27,12 @@ - - - - + + + + - + diff --git a/src/MoBi.UI/Views/SimulationView/EditSimulationView.Designer.cs b/src/MoBi.UI/Views/SimulationView/EditSimulationView.Designer.cs index 57e034065..41b071700 100644 --- a/src/MoBi.UI/Views/SimulationView/EditSimulationView.Designer.cs +++ b/src/MoBi.UI/Views/SimulationView/EditSimulationView.Designer.cs @@ -37,19 +37,26 @@ private void InitializeComponent() this.tabsNavigation = new DevExpress.XtraTab.XtraTabControl(); this.tabTree = new DevExpress.XtraTab.XtraTabPage(); this.tabDiagram = new DevExpress.XtraTab.XtraTabPage(); - this.tabResults = new DevExpress.XtraTab.XtraTabPage(); this.spliterDiagram = new DevExpress.XtraEditors.SplitContainerControl(); this.modelOverview = new Northwoods.Go.GoOverview(); + this.tabResults = new DevExpress.XtraTab.XtraTabPage(); + this.tabData = new DevExpress.XtraTab.XtraTabPage(); ((System.ComponentModel.ISupportInitialize)(this._errorProvider)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.tabs)).BeginInit(); this.tabs.SuspendLayout(); this.tabSimulation.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.splitSimulationParameters)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.splitSimulationParameters.Panel1)).BeginInit(); + this.splitSimulationParameters.Panel1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitSimulationParameters.Panel2)).BeginInit(); this.splitSimulationParameters.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.tabsNavigation)).BeginInit(); this.tabsNavigation.SuspendLayout(); this.tabDiagram.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.spliterDiagram)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.spliterDiagram.Panel1)).BeginInit(); + this.spliterDiagram.Panel1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.spliterDiagram.Panel2)).BeginInit(); this.spliterDiagram.SuspendLayout(); this.SuspendLayout(); // @@ -57,9 +64,10 @@ private void InitializeComponent() // this.tabs.Dock = System.Windows.Forms.DockStyle.Fill; this.tabs.Location = new System.Drawing.Point(0, 0); + this.tabs.Margin = new System.Windows.Forms.Padding(8, 8, 8, 8); this.tabs.Name = "tabs"; this.tabs.SelectedTabPage = this.tabSimulation; - this.tabs.Size = new System.Drawing.Size(516, 389); + this.tabs.Size = new System.Drawing.Size(1290, 987); this.tabs.TabIndex = 0; this.tabs.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[] { this.tabSimulation, @@ -68,8 +76,9 @@ private void InitializeComponent() // tabSimulation // this.tabSimulation.Controls.Add(this.splitSimulationParameters); + this.tabSimulation.Margin = new System.Windows.Forms.Padding(8, 8, 8, 8); this.tabSimulation.Name = "tabSimulation"; - this.tabSimulation.Size = new System.Drawing.Size(510, 361); + this.tabSimulation.Size = new System.Drawing.Size(1286, 926); this.tabSimulation.Text = "Simulation"; // // splitSimulationParameters @@ -77,12 +86,19 @@ private void InitializeComponent() this.splitSimulationParameters.Dock = System.Windows.Forms.DockStyle.Fill; this.splitSimulationParameters.FixedPanel = DevExpress.XtraEditors.SplitFixedPanel.None; this.splitSimulationParameters.Location = new System.Drawing.Point(0, 0); + this.splitSimulationParameters.Margin = new System.Windows.Forms.Padding(8, 8, 8, 8); this.splitSimulationParameters.Name = "splitSimulationParameters"; + // + // splitSimulationParameters.Panel1 + // this.splitSimulationParameters.Panel1.Controls.Add(this.tabsNavigation); this.splitSimulationParameters.Panel1.Text = "Panel1"; + // + // splitSimulationParameters.Panel2 + // this.splitSimulationParameters.Panel2.Text = "Panel2"; - this.splitSimulationParameters.Size = new System.Drawing.Size(510, 361); - this.splitSimulationParameters.SplitterPosition = 255; + this.splitSimulationParameters.Size = new System.Drawing.Size(1286, 926); + this.splitSimulationParameters.SplitterPosition = 643; this.splitSimulationParameters.TabIndex = 0; this.splitSimulationParameters.Text = "splitContainerControl1"; // @@ -90,43 +106,48 @@ private void InitializeComponent() // this.tabsNavigation.Dock = System.Windows.Forms.DockStyle.Fill; this.tabsNavigation.Location = new System.Drawing.Point(0, 0); + this.tabsNavigation.Margin = new System.Windows.Forms.Padding(8, 8, 8, 8); this.tabsNavigation.Name = "tabsNavigation"; this.tabsNavigation.SelectedTabPage = this.tabTree; - this.tabsNavigation.Size = new System.Drawing.Size(255, 361); + this.tabsNavigation.Size = new System.Drawing.Size(643, 926); this.tabsNavigation.TabIndex = 0; this.tabsNavigation.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[] { this.tabTree, - this.tabDiagram}); + this.tabDiagram, + this.tabData}); // - // tabHirarchic + // tabTree // + this.tabTree.Margin = new System.Windows.Forms.Padding(8, 8, 8, 8); this.tabTree.Name = "tabTree"; - this.tabTree.Size = new System.Drawing.Size(249, 333); + this.tabTree.Size = new System.Drawing.Size(639, 865); this.tabTree.Text = "tabTree"; // // tabDiagram // this.tabDiagram.Controls.Add(this.spliterDiagram); + this.tabDiagram.Margin = new System.Windows.Forms.Padding(8, 8, 8, 8); this.tabDiagram.Name = "tabDiagram"; - this.tabDiagram.Size = new System.Drawing.Size(249, 333); + this.tabDiagram.Size = new System.Drawing.Size(634, 855); this.tabDiagram.Text = "tabDiagram"; // - // tabResults - // - this.tabResults.Name = "tabResults"; - this.tabResults.Size = new System.Drawing.Size(510, 361); - this.tabResults.Text = "tabResults"; - // // spliterDiagram // this.spliterDiagram.Dock = System.Windows.Forms.DockStyle.Fill; this.spliterDiagram.Location = new System.Drawing.Point(0, 0); + this.spliterDiagram.Margin = new System.Windows.Forms.Padding(8, 8, 8, 8); this.spliterDiagram.Name = "spliterDiagram"; + // + // spliterDiagram.Panel1 + // this.spliterDiagram.Panel1.Controls.Add(this.modelOverview); this.spliterDiagram.Panel1.Text = "Panel1"; + // + // spliterDiagram.Panel2 + // this.spliterDiagram.Panel2.Text = "Panel2"; - this.spliterDiagram.Size = new System.Drawing.Size(249, 333); - this.spliterDiagram.SplitterPosition = 123; + this.spliterDiagram.Size = new System.Drawing.Size(634, 855); + this.spliterDiagram.SplitterPosition = 307; this.spliterDiagram.TabIndex = 1; this.spliterDiagram.Text = "splitContainerControl2"; // @@ -146,28 +167,49 @@ private void InitializeComponent() this.modelOverview.DocScale = 0.125F; this.modelOverview.DragsRealtime = true; this.modelOverview.Location = new System.Drawing.Point(0, 0); + this.modelOverview.Margin = new System.Windows.Forms.Padding(8, 8, 8, 8); this.modelOverview.Name = "modelOverview"; this.modelOverview.ShowsNegativeCoordinates = false; - this.modelOverview.Size = new System.Drawing.Size(123, 333); + this.modelOverview.Size = new System.Drawing.Size(307, 855); this.modelOverview.TabIndex = 0; this.modelOverview.Text = "modelOverview"; // - // SimulationView + // tabResults // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.tabResults.Margin = new System.Windows.Forms.Padding(8, 8, 8, 8); + this.tabResults.Name = "tabResults"; + this.tabResults.Size = new System.Drawing.Size(1286, 926); + this.tabResults.Text = "tabResults"; + // + // tabData + // + this.tabData.Name = "tabData"; + this.tabData.Size = new System.Drawing.Size(639, 865); + this.tabData.Text = "tabData"; + // + // EditSimulationView + // + this.AutoScaleDimensions = new System.Drawing.SizeF(15F, 33F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(516, 389); + this.ClientSize = new System.Drawing.Size(1290, 987); this.Controls.Add(this.tabs); - this.Name = "SimulationView"; + this.Margin = new System.Windows.Forms.Padding(20, 20, 20, 20); + this.Name = "EditSimulationView"; ((System.ComponentModel.ISupportInitialize)(this._errorProvider)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.tabs)).EndInit(); this.tabs.ResumeLayout(false); this.tabSimulation.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitSimulationParameters.Panel1)).EndInit(); + this.splitSimulationParameters.Panel1.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitSimulationParameters.Panel2)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.splitSimulationParameters)).EndInit(); this.splitSimulationParameters.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.tabsNavigation)).EndInit(); this.tabsNavigation.ResumeLayout(false); this.tabDiagram.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.spliterDiagram.Panel1)).EndInit(); + this.spliterDiagram.Panel1.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.spliterDiagram.Panel2)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.spliterDiagram)).EndInit(); this.spliterDiagram.ResumeLayout(false); this.ResumeLayout(false); @@ -185,6 +227,6 @@ private void InitializeComponent() private DevExpress.XtraTab.XtraTabPage tabDiagram; private SplitContainerControl spliterDiagram; private Northwoods.Go.GoOverview modelOverview; - + private DevExpress.XtraTab.XtraTabPage tabData; } } diff --git a/src/MoBi.UI/Views/SimulationView/EditSimulationView.cs b/src/MoBi.UI/Views/SimulationView/EditSimulationView.cs index 179d2ed1d..1f1a8bbe1 100644 --- a/src/MoBi.UI/Views/SimulationView/EditSimulationView.cs +++ b/src/MoBi.UI/Views/SimulationView/EditSimulationView.cs @@ -38,6 +38,7 @@ public override void InitializeResources() tabTree.InitWith(AppConstants.Captions.Tree, ApplicationIcons.Tree); tabSimulation.InitWith(AppConstants.Captions.SimulationParameters, ApplicationIcons.Parameter); tabResults.InitWith(AppConstants.Captions.Results, ApplicationIcons.TimeProfileAnalysis); + tabData.InitWith(AppConstants.Captions.SimulationData, ApplicationIcons.PKSim); tabsNavigation.SelectedPageChanging += (o, e) => OnEvent(tabSelectionChanged, e); tabs.SelectedPageChanging += (o, e) => OnEvent(tabSelectionChanged, e); @@ -80,5 +81,10 @@ public void ShowResultsTab() { tabs.SelectedTabPage = tabResults; } + + public void SetDataView(ISimulationOutputMappingView view) + { + tabData.FillWith(view); + } } } \ No newline at end of file diff --git a/src/MoBi/MoBi.csproj b/src/MoBi/MoBi.csproj index d75e0551e..8cfeca880 100644 --- a/src/MoBi/MoBi.csproj +++ b/src/MoBi/MoBi.csproj @@ -71,13 +71,13 @@ - + - + diff --git a/tests/MoBi.Tests/MoBi.Tests.csproj b/tests/MoBi.Tests/MoBi.Tests.csproj index f1720c331..488995d8e 100644 --- a/tests/MoBi.Tests/MoBi.Tests.csproj +++ b/tests/MoBi.Tests/MoBi.Tests.csproj @@ -45,10 +45,10 @@ - - - - + + + + diff --git a/tests/MoBi.Tests/Presentation/EditSimulationPresenterSpecs.cs b/tests/MoBi.Tests/Presentation/EditSimulationPresenterSpecs.cs index 4056982b3..9b376f95c 100644 --- a/tests/MoBi.Tests/Presentation/EditSimulationPresenterSpecs.cs +++ b/tests/MoBi.Tests/Presentation/EditSimulationPresenterSpecs.cs @@ -13,6 +13,7 @@ using OSPSuite.Core.Domain; using OSPSuite.Core.Domain.Data; using OSPSuite.Core.Domain.UnitSystem; +using OSPSuite.Presentation.Presenters; using OSPSuite.Presentation.Views; namespace MoBi.Presentation @@ -29,6 +30,7 @@ public abstract class concern_for_EditSimulationPresenter : ContextSpecification protected IEditFavoritesInSimulationPresenter _editFavoritePresenter; protected IChartTasks _chartTasks; protected IUserDefinedParametersPresenter _userDefinedParametersPresenter; + protected ISimulationOutputMappingPresenter _simulationOutputMappingPresenter; protected override void Context() { @@ -41,10 +43,12 @@ protected override void Context() _presenterFactory = A.Fake(); _editFavoritePresenter = A.Fake(); _chartTasks = A.Fake(); + _simulationOutputMappingPresenter = A.Fake(); _userDefinedParametersPresenter = A.Fake(); + sut = new EditSimulationPresenter(_view, _chartPresenter, _hierarchicalSimulationPresenter, _diagramPresenter, _solverSettings, _outputSchemaPresenter, _presenterFactory, new HeavyWorkManagerForSpecs(), - A.Fake(), _editFavoritePresenter, _chartTasks, _userDefinedParametersPresenter); + A.Fake(), _editFavoritePresenter, _chartTasks, _userDefinedParametersPresenter, _simulationOutputMappingPresenter); } } diff --git a/tests/MoBi.UI.Tests/MoBi.UI.Tests.csproj b/tests/MoBi.UI.Tests/MoBi.UI.Tests.csproj index edcda0626..2cc7891f8 100644 --- a/tests/MoBi.UI.Tests/MoBi.UI.Tests.csproj +++ b/tests/MoBi.UI.Tests/MoBi.UI.Tests.csproj @@ -17,8 +17,8 @@ - - + + From c83c38d24a465931580ade36a7725c1013488cc3 Mon Sep 17 00:00:00 2001 From: georgeDaskalakis <37107428+georgeDaskalakis@users.noreply.github.com> Date: Thu, 14 Jul 2022 15:02:02 +0200 Subject: [PATCH 04/18] updating packages --- src/MoBi.Assets/MoBi.Assets.csproj | 6 +++--- src/MoBi.BatchTool/MoBi.BatchTool.csproj | 2 +- src/MoBi.Core/MoBi.Core.csproj | 14 +++++++------- src/MoBi.Engine/MoBi.Engine.csproj | 4 ++-- src/MoBi.Presentation/MoBi.Presentation.csproj | 6 +++--- src/MoBi.UI/MoBi.UI.csproj | 10 +++++----- src/MoBi/MoBi.csproj | 4 ++-- tests/MoBi.Tests/MoBi.Tests.csproj | 8 ++++---- tests/MoBi.UI.Tests/MoBi.UI.Tests.csproj | 4 ++-- 9 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/MoBi.Assets/MoBi.Assets.csproj b/src/MoBi.Assets/MoBi.Assets.csproj index 8d7e1e45c..7dda55546 100644 --- a/src/MoBi.Assets/MoBi.Assets.csproj +++ b/src/MoBi.Assets/MoBi.Assets.csproj @@ -26,9 +26,9 @@ - - - + + + diff --git a/src/MoBi.BatchTool/MoBi.BatchTool.csproj b/src/MoBi.BatchTool/MoBi.BatchTool.csproj index f0693e272..d90d27710 100644 --- a/src/MoBi.BatchTool/MoBi.BatchTool.csproj +++ b/src/MoBi.BatchTool/MoBi.BatchTool.csproj @@ -60,7 +60,7 @@ - + diff --git a/src/MoBi.Core/MoBi.Core.csproj b/src/MoBi.Core/MoBi.Core.csproj index f8617be54..30c293ac8 100644 --- a/src/MoBi.Core/MoBi.Core.csproj +++ b/src/MoBi.Core/MoBi.Core.csproj @@ -32,13 +32,13 @@ - - - - - - - + + + + + + + diff --git a/src/MoBi.Engine/MoBi.Engine.csproj b/src/MoBi.Engine/MoBi.Engine.csproj index 6181f095b..6cd2085a3 100644 --- a/src/MoBi.Engine/MoBi.Engine.csproj +++ b/src/MoBi.Engine/MoBi.Engine.csproj @@ -32,8 +32,8 @@ - - + + diff --git a/src/MoBi.Presentation/MoBi.Presentation.csproj b/src/MoBi.Presentation/MoBi.Presentation.csproj index 3404a5603..4acdc15a3 100644 --- a/src/MoBi.Presentation/MoBi.Presentation.csproj +++ b/src/MoBi.Presentation/MoBi.Presentation.csproj @@ -28,9 +28,9 @@ - - - + + + diff --git a/src/MoBi.UI/MoBi.UI.csproj b/src/MoBi.UI/MoBi.UI.csproj index 6a9545852..36c98bf54 100644 --- a/src/MoBi.UI/MoBi.UI.csproj +++ b/src/MoBi.UI/MoBi.UI.csproj @@ -27,12 +27,12 @@ - - - - + + + + - + diff --git a/src/MoBi/MoBi.csproj b/src/MoBi/MoBi.csproj index 8cfeca880..d542d79d8 100644 --- a/src/MoBi/MoBi.csproj +++ b/src/MoBi/MoBi.csproj @@ -71,13 +71,13 @@ - + - + diff --git a/tests/MoBi.Tests/MoBi.Tests.csproj b/tests/MoBi.Tests/MoBi.Tests.csproj index 488995d8e..fb5db91b8 100644 --- a/tests/MoBi.Tests/MoBi.Tests.csproj +++ b/tests/MoBi.Tests/MoBi.Tests.csproj @@ -45,10 +45,10 @@ - - - - + + + + diff --git a/tests/MoBi.UI.Tests/MoBi.UI.Tests.csproj b/tests/MoBi.UI.Tests/MoBi.UI.Tests.csproj index 2cc7891f8..e37cd9d7c 100644 --- a/tests/MoBi.UI.Tests/MoBi.UI.Tests.csproj +++ b/tests/MoBi.UI.Tests/MoBi.UI.Tests.csproj @@ -17,8 +17,8 @@ - - + + From a44298e7ed044189143e1db5b5ba7a9ce70670ab Mon Sep 17 00:00:00 2001 From: georgeDaskalakis <37107428+georgeDaskalakis@users.noreply.github.com> Date: Thu, 4 Aug 2022 12:39:34 +0200 Subject: [PATCH 05/18] code cleanup --- .../Presenter/EditSimulationPresenter.cs | 11 ++++++---- .../Views/IEditSimulationView.cs | 6 +++--- .../EditSimulationPresenterSpecs.cs | 21 ++++++++++++------- 3 files changed, 23 insertions(+), 15 deletions(-) diff --git a/src/MoBi.Presentation/Presenter/EditSimulationPresenter.cs b/src/MoBi.Presentation/Presenter/EditSimulationPresenter.cs index 046d865a5..26172ac7b 100644 --- a/src/MoBi.Presentation/Presenter/EditSimulationPresenter.cs +++ b/src/MoBi.Presentation/Presenter/EditSimulationPresenter.cs @@ -52,10 +52,12 @@ public class EditSimulationPresenter : SingleStartPresenter _favoritesPresenter.Favorites(); _view.SetChartView(chartPresenter.View); _view.SetDataView(_simulationOutputMappingPresenter.View); - AddSubPresenters(_chartPresenter, _hierarchicalPresenter, _simulationDiagramPresenter, _solverSettingsPresenter, _editOutputSchemaPresenter, _favoritesPresenter, _userDefinedParametersPresenter, _simulationOutputMappingPresenter); - _cacheShowPresenter = new Cache {OnMissingKey = x => null}; + AddSubPresenters(_chartPresenter, _hierarchicalPresenter, _simulationDiagramPresenter, _solverSettingsPresenter, _editOutputSchemaPresenter, + _favoritesPresenter, _userDefinedParametersPresenter, _simulationOutputMappingPresenter); + _cacheShowPresenter = new Cache { OnMissingKey = x => null }; } public string CreateResultTabCaption(string chartName) diff --git a/src/MoBi.Presentation/Views/IEditSimulationView.cs b/src/MoBi.Presentation/Views/IEditSimulationView.cs index 2a8f6cb02..a3f0850ae 100644 --- a/src/MoBi.Presentation/Views/IEditSimulationView.cs +++ b/src/MoBi.Presentation/Views/IEditSimulationView.cs @@ -12,17 +12,17 @@ public interface IEditSimulationView : IMdiChildView void SetModelDiagram(ISimulationDiagramView subView); /// - /// Indicates whether or not the current view is the results view + /// Indicates whether or not the current view is the results view /// bool ShowsResults { get; } /// - /// Changes the displayed view to the results view + /// Changes the displayed view to the results view /// void ShowResultsTab(); /// - /// Sets the outputMappingView to the corresponding tab + /// Sets the outputMappingView to the corresponding tab /// void SetDataView(ISimulationOutputMappingView view); } diff --git a/tests/MoBi.Tests/Presentation/EditSimulationPresenterSpecs.cs b/tests/MoBi.Tests/Presentation/EditSimulationPresenterSpecs.cs index 9b376f95c..bac2f5b08 100644 --- a/tests/MoBi.Tests/Presentation/EditSimulationPresenterSpecs.cs +++ b/tests/MoBi.Tests/Presentation/EditSimulationPresenterSpecs.cs @@ -140,7 +140,9 @@ public void should_initialise_hierarchical_presenter() } } - public class When_the_simulation_simulation_presenter_is_notified_that_a_simulation_run_is_finished_for_the_edited_simulation : concern_for_EditSimulationPresenter + public class + When_the_simulation_simulation_presenter_is_notified_that_a_simulation_run_is_finished_for_the_edited_simulation : + concern_for_EditSimulationPresenter { private IMoBiSimulation _simulation; private CurveChart _chart; @@ -205,7 +207,7 @@ public class When_the_simulation_simulation_presenter_is_editing_a_simulation_wi protected override void Context() { base.Context(); - _simulation = new MoBiSimulation {Results = new DataRepository()}; + _simulation = new MoBiSimulation { Results = new DataRepository() }; var chart = new CurveChart(); @@ -273,7 +275,9 @@ private Curve createObservedCurve(DataRepository observedDataRepository) } } - public class When_the_edit_simulation_presenter_is_notified_that_a_parameter_should_be_selected_for_the_edited_simulation : concern_for_EditSimulationPresenter + public class + When_the_edit_simulation_presenter_is_notified_that_a_parameter_should_be_selected_for_the_edited_simulation : + concern_for_EditSimulationPresenter { private IParameter _parameter; private IMoBiSimulation _simulation; @@ -284,18 +288,19 @@ public class When_the_edit_simulation_presenter_is_notified_that_a_parameter_sho protected override void Context() { base.Context(); - _simulation= A.Fake(); - _parameter= A.Fake(); - _rootContainer= A.Fake(); + _simulation = A.Fake(); + _parameter = A.Fake(); + _rootContainer = A.Fake(); //ensures that the parameter belongs to the simulation _simulation.Model.Root = _rootContainer; A.CallTo(() => _parameter.RootContainer).Returns(_rootContainer); sut.Edit(_simulation); - _parameterContainer= A.Fake(); + _parameterContainer = A.Fake(); _parameter.ParentContainer = _parameterContainer; - _= A.Fake(); + _ = A.Fake(); A.CallTo(() => _presenterFactory.PresenterFor(_parameterContainer)).Returns(_); } + protected override void Because() { sut.Handle(new EntitySelectedEvent(_parameter, new object())); From 5408e825b113c921c1a2171ba018c813921702c4 Mon Sep 17 00:00:00 2001 From: georgeDaskalakis <37107428+georgeDaskalakis@users.noreply.github.com> Date: Wed, 10 Aug 2022 14:26:33 +0200 Subject: [PATCH 06/18] initial --- src/MoBi.Assets/AppConstants.cs | 1 + src/MoBi.Assets/MoBi.Assets.csproj | 6 +- src/MoBi.BatchTool/MoBi.BatchTool.csproj | 2 +- src/MoBi.Core/Domain/Model/MoBiSimulation.cs | 9 ++ src/MoBi.Core/MoBi.Core.csproj | 14 +-- src/MoBi.Engine/MoBi.Engine.csproj | 4 +- .../MoBi.Presentation.csproj | 6 +- .../Presenter/EditSimulationPresenter.cs | 11 +- .../Views/IEditSimulationView.cs | 3 + src/MoBi.UI/MoBi.UI.csproj | 10 +- .../EditSimulationView.Designer.cs | 118 +++++++++++++++--- .../SimulationView/EditSimulationView.cs | 13 +- src/MoBi/MoBi.csproj | 4 +- tests/MoBi.Tests/MoBi.Tests.csproj | 8 +- tests/MoBi.UI.Tests/MoBi.UI.Tests.csproj | 4 +- 15 files changed, 162 insertions(+), 51 deletions(-) diff --git a/src/MoBi.Assets/AppConstants.cs b/src/MoBi.Assets/AppConstants.cs index 2f6def3df..1889f5275 100644 --- a/src/MoBi.Assets/AppConstants.cs +++ b/src/MoBi.Assets/AppConstants.cs @@ -1422,6 +1422,7 @@ public static class Captions public static readonly string ModelDiagram = "Diagram"; public static readonly string SimulationParameters = "Parameters"; public static readonly string Results = "Results"; + public static readonly string TimeProfile = "Time Profile"; public static readonly string SimulationData = "Data"; public static readonly string IsStationary = "Stationary"; public static readonly string DefaultStartAmount = "Amount"; diff --git a/src/MoBi.Assets/MoBi.Assets.csproj b/src/MoBi.Assets/MoBi.Assets.csproj index 7dda55546..dd9f98ece 100644 --- a/src/MoBi.Assets/MoBi.Assets.csproj +++ b/src/MoBi.Assets/MoBi.Assets.csproj @@ -26,9 +26,9 @@ - - - + + + diff --git a/src/MoBi.BatchTool/MoBi.BatchTool.csproj b/src/MoBi.BatchTool/MoBi.BatchTool.csproj index d90d27710..ec723ef2d 100644 --- a/src/MoBi.BatchTool/MoBi.BatchTool.csproj +++ b/src/MoBi.BatchTool/MoBi.BatchTool.csproj @@ -60,7 +60,7 @@ - + diff --git a/src/MoBi.Core/Domain/Model/MoBiSimulation.cs b/src/MoBi.Core/Domain/Model/MoBiSimulation.cs index a54b4f99b..270f2a5a3 100644 --- a/src/MoBi.Core/Domain/Model/MoBiSimulation.cs +++ b/src/MoBi.Core/Domain/Model/MoBiSimulation.cs @@ -40,6 +40,7 @@ public class MoBiSimulation : ModelCoreSimulation, IMoBiSimulation private bool _hasChanged; private readonly IList _allSimulationAnalyses = new List(); private DataRepository _results; + private SimulationResults _results1; public IDiagramModel DiagramModel { get; set; } public CurveChart Chart { get; set; } public string ParameterIdentificationWorkingDirectory { get; set; } @@ -127,6 +128,14 @@ public IEnumerable Charts public OutputMappings OutputMappings { get; set; } = new OutputMappings(); + SimulationResults ISimulation.Results + { + get => _results1; + set => _results1 = value; + } + + public DataRepository ResultRepository { get; } + public new IReactionBuildingBlock Reactions { get => BuildConfiguration.Reactions; diff --git a/src/MoBi.Core/MoBi.Core.csproj b/src/MoBi.Core/MoBi.Core.csproj index 30c293ac8..3422547bb 100644 --- a/src/MoBi.Core/MoBi.Core.csproj +++ b/src/MoBi.Core/MoBi.Core.csproj @@ -32,13 +32,13 @@ - - - - - - - + + + + + + + diff --git a/src/MoBi.Engine/MoBi.Engine.csproj b/src/MoBi.Engine/MoBi.Engine.csproj index 6cd2085a3..f0d5dcf59 100644 --- a/src/MoBi.Engine/MoBi.Engine.csproj +++ b/src/MoBi.Engine/MoBi.Engine.csproj @@ -32,8 +32,8 @@ - - + + diff --git a/src/MoBi.Presentation/MoBi.Presentation.csproj b/src/MoBi.Presentation/MoBi.Presentation.csproj index 4acdc15a3..40c9780ef 100644 --- a/src/MoBi.Presentation/MoBi.Presentation.csproj +++ b/src/MoBi.Presentation/MoBi.Presentation.csproj @@ -28,9 +28,9 @@ - - - + + + diff --git a/src/MoBi.Presentation/Presenter/EditSimulationPresenter.cs b/src/MoBi.Presentation/Presenter/EditSimulationPresenter.cs index 26172ac7b..721ddbbd7 100644 --- a/src/MoBi.Presentation/Presenter/EditSimulationPresenter.cs +++ b/src/MoBi.Presentation/Presenter/EditSimulationPresenter.cs @@ -40,6 +40,8 @@ public class EditSimulationPresenter : SingleStartPresenter _favoritesPresenter.Favorites(); _view.SetChartView(chartPresenter.View); + _view.SetPredictedVsObservedView(simulationPredictedVsObservedChartPresenter.View); + _view.SetResidualsVsTimeView(simulationResidualVsTimeChartPresenter.View); _view.SetDataView(_simulationOutputMappingPresenter.View); AddSubPresenters(_chartPresenter, _hierarchicalPresenter, _simulationDiagramPresenter, _solverSettingsPresenter, _editOutputSchemaPresenter, - _favoritesPresenter, _userDefinedParametersPresenter, _simulationOutputMappingPresenter); + _favoritesPresenter, _userDefinedParametersPresenter, _simulationOutputMappingPresenter, _simulationPredictedVsObservedChartPresenter, _simulationResidualVsTimeChartPresenter); _cacheShowPresenter = new Cache { OnMissingKey = x => null }; } diff --git a/src/MoBi.Presentation/Views/IEditSimulationView.cs b/src/MoBi.Presentation/Views/IEditSimulationView.cs index a3f0850ae..6f1c88c2c 100644 --- a/src/MoBi.Presentation/Views/IEditSimulationView.cs +++ b/src/MoBi.Presentation/Views/IEditSimulationView.cs @@ -25,5 +25,8 @@ public interface IEditSimulationView : IMdiChildView /// Sets the outputMappingView to the corresponding tab /// void SetDataView(ISimulationOutputMappingView view); + + void SetPredictedVsObservedView(ISimulationRunAnalysisView view); + void SetResidualsVsTimeView(ISimulationRunAnalysisView view); } } \ No newline at end of file diff --git a/src/MoBi.UI/MoBi.UI.csproj b/src/MoBi.UI/MoBi.UI.csproj index 36c98bf54..535cb546c 100644 --- a/src/MoBi.UI/MoBi.UI.csproj +++ b/src/MoBi.UI/MoBi.UI.csproj @@ -27,12 +27,12 @@ - - - - + + + + - + diff --git a/src/MoBi.UI/Views/SimulationView/EditSimulationView.Designer.cs b/src/MoBi.UI/Views/SimulationView/EditSimulationView.Designer.cs index 41b071700..499f2b9fe 100644 --- a/src/MoBi.UI/Views/SimulationView/EditSimulationView.Designer.cs +++ b/src/MoBi.UI/Views/SimulationView/EditSimulationView.Designer.cs @@ -1,4 +1,5 @@ -using DevExpress.XtraEditors; +using System.Windows.Forms; +using DevExpress.XtraEditors; namespace MoBi.UI.Views.SimulationView { @@ -39,8 +40,15 @@ private void InitializeComponent() this.tabDiagram = new DevExpress.XtraTab.XtraTabPage(); this.spliterDiagram = new DevExpress.XtraEditors.SplitContainerControl(); this.modelOverview = new Northwoods.Go.GoOverview(); - this.tabResults = new DevExpress.XtraTab.XtraTabPage(); this.tabData = new DevExpress.XtraTab.XtraTabPage(); + this.tabResults = new DevExpress.XtraTab.XtraTabPage(); + this.plotTabs = new DevExpress.XtraTab.XtraTabControl(); + this.tabTimeProfile = new DevExpress.XtraTab.XtraTabPage(); + this.tabPredVsObs = new DevExpress.XtraTab.XtraTabPage(); + this.xtraTabPage2 = new DevExpress.XtraTab.XtraTabPage(); + this.xtraTabPage1 = new DevExpress.XtraTab.XtraTabPage(); + this.xtraTabControl1 = new DevExpress.XtraTab.XtraTabControl(); + this.tabResidVsTime = new DevExpress.XtraTab.XtraTabPage(); ((System.ComponentModel.ISupportInitialize)(this._errorProvider)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.tabs)).BeginInit(); this.tabs.SuspendLayout(); @@ -58,13 +66,18 @@ private void InitializeComponent() this.spliterDiagram.Panel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.spliterDiagram.Panel2)).BeginInit(); this.spliterDiagram.SuspendLayout(); + this.tabResults.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.plotTabs)).BeginInit(); + this.plotTabs.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.xtraTabControl1)).BeginInit(); + this.xtraTabControl1.SuspendLayout(); this.SuspendLayout(); // // tabs // this.tabs.Dock = System.Windows.Forms.DockStyle.Fill; this.tabs.Location = new System.Drawing.Point(0, 0); - this.tabs.Margin = new System.Windows.Forms.Padding(8, 8, 8, 8); + this.tabs.Margin = new System.Windows.Forms.Padding(8); this.tabs.Name = "tabs"; this.tabs.SelectedTabPage = this.tabSimulation; this.tabs.Size = new System.Drawing.Size(1290, 987); @@ -76,7 +89,7 @@ private void InitializeComponent() // tabSimulation // this.tabSimulation.Controls.Add(this.splitSimulationParameters); - this.tabSimulation.Margin = new System.Windows.Forms.Padding(8, 8, 8, 8); + this.tabSimulation.Margin = new System.Windows.Forms.Padding(8); this.tabSimulation.Name = "tabSimulation"; this.tabSimulation.Size = new System.Drawing.Size(1286, 926); this.tabSimulation.Text = "Simulation"; @@ -86,7 +99,7 @@ private void InitializeComponent() this.splitSimulationParameters.Dock = System.Windows.Forms.DockStyle.Fill; this.splitSimulationParameters.FixedPanel = DevExpress.XtraEditors.SplitFixedPanel.None; this.splitSimulationParameters.Location = new System.Drawing.Point(0, 0); - this.splitSimulationParameters.Margin = new System.Windows.Forms.Padding(8, 8, 8, 8); + this.splitSimulationParameters.Margin = new System.Windows.Forms.Padding(8); this.splitSimulationParameters.Name = "splitSimulationParameters"; // // splitSimulationParameters.Panel1 @@ -106,7 +119,7 @@ private void InitializeComponent() // this.tabsNavigation.Dock = System.Windows.Forms.DockStyle.Fill; this.tabsNavigation.Location = new System.Drawing.Point(0, 0); - this.tabsNavigation.Margin = new System.Windows.Forms.Padding(8, 8, 8, 8); + this.tabsNavigation.Margin = new System.Windows.Forms.Padding(8); this.tabsNavigation.Name = "tabsNavigation"; this.tabsNavigation.SelectedTabPage = this.tabTree; this.tabsNavigation.Size = new System.Drawing.Size(643, 926); @@ -118,7 +131,7 @@ private void InitializeComponent() // // tabTree // - this.tabTree.Margin = new System.Windows.Forms.Padding(8, 8, 8, 8); + this.tabTree.Margin = new System.Windows.Forms.Padding(8); this.tabTree.Name = "tabTree"; this.tabTree.Size = new System.Drawing.Size(639, 865); this.tabTree.Text = "tabTree"; @@ -126,16 +139,16 @@ private void InitializeComponent() // tabDiagram // this.tabDiagram.Controls.Add(this.spliterDiagram); - this.tabDiagram.Margin = new System.Windows.Forms.Padding(8, 8, 8, 8); + this.tabDiagram.Margin = new System.Windows.Forms.Padding(8); this.tabDiagram.Name = "tabDiagram"; - this.tabDiagram.Size = new System.Drawing.Size(634, 855); + this.tabDiagram.Size = new System.Drawing.Size(639, 865); this.tabDiagram.Text = "tabDiagram"; // // spliterDiagram // this.spliterDiagram.Dock = System.Windows.Forms.DockStyle.Fill; this.spliterDiagram.Location = new System.Drawing.Point(0, 0); - this.spliterDiagram.Margin = new System.Windows.Forms.Padding(8, 8, 8, 8); + this.spliterDiagram.Margin = new System.Windows.Forms.Padding(8); this.spliterDiagram.Name = "spliterDiagram"; // // spliterDiagram.Panel1 @@ -146,7 +159,7 @@ private void InitializeComponent() // spliterDiagram.Panel2 // this.spliterDiagram.Panel2.Text = "Panel2"; - this.spliterDiagram.Size = new System.Drawing.Size(634, 855); + this.spliterDiagram.Size = new System.Drawing.Size(639, 865); this.spliterDiagram.SplitterPosition = 307; this.spliterDiagram.TabIndex = 1; this.spliterDiagram.Text = "splitContainerControl2"; @@ -167,25 +180,80 @@ private void InitializeComponent() this.modelOverview.DocScale = 0.125F; this.modelOverview.DragsRealtime = true; this.modelOverview.Location = new System.Drawing.Point(0, 0); - this.modelOverview.Margin = new System.Windows.Forms.Padding(8, 8, 8, 8); + this.modelOverview.Margin = new System.Windows.Forms.Padding(8); this.modelOverview.Name = "modelOverview"; this.modelOverview.ShowsNegativeCoordinates = false; - this.modelOverview.Size = new System.Drawing.Size(307, 855); + this.modelOverview.Size = new System.Drawing.Size(307, 865); this.modelOverview.TabIndex = 0; this.modelOverview.Text = "modelOverview"; // + // tabData + // + this.tabData.Name = "tabData"; + this.tabData.Size = new System.Drawing.Size(639, 865); + this.tabData.Text = "tabData"; + // // tabResults // - this.tabResults.Margin = new System.Windows.Forms.Padding(8, 8, 8, 8); + this.tabResults.Controls.Add(this.plotTabs); + this.tabResults.Margin = new System.Windows.Forms.Padding(8); this.tabResults.Name = "tabResults"; this.tabResults.Size = new System.Drawing.Size(1286, 926); this.tabResults.Text = "tabResults"; // - // tabData + // plotTabs // - this.tabData.Name = "tabData"; - this.tabData.Size = new System.Drawing.Size(639, 865); - this.tabData.Text = "tabData"; + this.plotTabs.Dock = System.Windows.Forms.DockStyle.Fill; + this.plotTabs.Location = new System.Drawing.Point(0, 0); + this.plotTabs.Name = "plotTabs"; + this.plotTabs.SelectedTabPage = this.tabTimeProfile; + this.plotTabs.Size = new System.Drawing.Size(1286, 926); + this.plotTabs.TabIndex = 0; + this.plotTabs.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[] { + this.tabTimeProfile, + this.tabPredVsObs, + this.tabResidVsTime}); + // + // tabTimeProfile + // + this.tabTimeProfile.Name = "tabTimeProfile"; + this.tabTimeProfile.Size = new System.Drawing.Size(1282, 865); + this.tabTimeProfile.Text = "tabTimeProfile"; + // + // tabPredVsObs + // + this.tabPredVsObs.Name = "tabPredVsObs"; + this.tabPredVsObs.Size = new System.Drawing.Size(1282, 865); + this.tabPredVsObs.Text = "tabPredVsObs"; + // + // xtraTabPage2 + // + this.xtraTabPage2.Name = "xtraTabPage2"; + this.xtraTabPage2.Size = new System.Drawing.Size(296, 239); + this.xtraTabPage2.Text = "xtraTabPage2"; + // + // xtraTabPage1 + // + this.xtraTabPage1.Name = "xtraTabPage1"; + this.xtraTabPage1.Size = new System.Drawing.Size(296, 239); + this.xtraTabPage1.Text = "xtraTabPage1"; + // + // xtraTabControl1 + // + this.xtraTabControl1.Location = new System.Drawing.Point(256, 17); + this.xtraTabControl1.Name = "xtraTabControl1"; + this.xtraTabControl1.SelectedTabPage = this.xtraTabPage1; + this.xtraTabControl1.Size = new System.Drawing.Size(300, 300); + this.xtraTabControl1.TabIndex = 2; + this.xtraTabControl1.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[] { + this.xtraTabPage1, + this.xtraTabPage2}); + // + // tabResidVsTime + // + this.tabResidVsTime.Name = "tabResidVsTime"; + this.tabResidVsTime.Size = new System.Drawing.Size(1282, 865); + this.tabResidVsTime.Text = "tabResidVsTime"; // // EditSimulationView // @@ -193,7 +261,7 @@ private void InitializeComponent() this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(1290, 987); this.Controls.Add(this.tabs); - this.Margin = new System.Windows.Forms.Padding(20, 20, 20, 20); + this.Margin = new System.Windows.Forms.Padding(20); this.Name = "EditSimulationView"; ((System.ComponentModel.ISupportInitialize)(this._errorProvider)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.tabs)).EndInit(); @@ -212,6 +280,11 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.spliterDiagram.Panel2)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.spliterDiagram)).EndInit(); this.spliterDiagram.ResumeLayout(false); + this.tabResults.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.plotTabs)).EndInit(); + this.plotTabs.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.xtraTabControl1)).EndInit(); + this.xtraTabControl1.ResumeLayout(false); this.ResumeLayout(false); } @@ -228,5 +301,12 @@ private void InitializeComponent() private SplitContainerControl spliterDiagram; private Northwoods.Go.GoOverview modelOverview; private DevExpress.XtraTab.XtraTabPage tabData; + private DevExpress.XtraTab.XtraTabControl plotTabs; + private DevExpress.XtraTab.XtraTabPage tabTimeProfile; + private DevExpress.XtraTab.XtraTabPage tabPredVsObs; + private DevExpress.XtraTab.XtraTabPage xtraTabPage2; + private DevExpress.XtraTab.XtraTabPage xtraTabPage1; + private DevExpress.XtraTab.XtraTabControl xtraTabControl1; + private DevExpress.XtraTab.XtraTabPage tabResidVsTime; } } diff --git a/src/MoBi.UI/Views/SimulationView/EditSimulationView.cs b/src/MoBi.UI/Views/SimulationView/EditSimulationView.cs index 1f1a8bbe1..cc4fbe735 100644 --- a/src/MoBi.UI/Views/SimulationView/EditSimulationView.cs +++ b/src/MoBi.UI/Views/SimulationView/EditSimulationView.cs @@ -39,6 +39,7 @@ public override void InitializeResources() tabSimulation.InitWith(AppConstants.Captions.SimulationParameters, ApplicationIcons.Parameter); tabResults.InitWith(AppConstants.Captions.Results, ApplicationIcons.TimeProfileAnalysis); tabData.InitWith(AppConstants.Captions.SimulationData, ApplicationIcons.PKSim); + tabTimeProfile.InitWith(AppConstants.Captions.TimeProfile, ApplicationIcons.TimeProfileAnalysis); tabsNavigation.SelectedPageChanging += (o, e) => OnEvent(tabSelectionChanged, e); tabs.SelectedPageChanging += (o, e) => OnEvent(tabSelectionChanged, e); @@ -66,7 +67,7 @@ public void SetTreeView(IView view) public void SetChartView(IChartView chartView) { chartView.CaptionChanged += (o, e) => OnEvent(() => tabResults.Text = simulationPresenter.CreateResultTabCaption(chartView.Caption)); - tabResults.FillWith(chartView); + tabTimeProfile.FillWith(chartView); } public void SetModelDiagram(ISimulationDiagramView subView) @@ -86,5 +87,15 @@ public void SetDataView(ISimulationOutputMappingView view) { tabData.FillWith(view); } + + public void SetPredictedVsObservedView(ISimulationRunAnalysisView view) + { + tabPredVsObs.FillWith(view); + } + + public void SetResidualsVsTimeView(ISimulationRunAnalysisView view) + { + tabResidVsTime.FillWith(view); + } } } \ No newline at end of file diff --git a/src/MoBi/MoBi.csproj b/src/MoBi/MoBi.csproj index d542d79d8..f0d6be73b 100644 --- a/src/MoBi/MoBi.csproj +++ b/src/MoBi/MoBi.csproj @@ -71,13 +71,13 @@ - + - + diff --git a/tests/MoBi.Tests/MoBi.Tests.csproj b/tests/MoBi.Tests/MoBi.Tests.csproj index fb5db91b8..0a13fc24c 100644 --- a/tests/MoBi.Tests/MoBi.Tests.csproj +++ b/tests/MoBi.Tests/MoBi.Tests.csproj @@ -45,10 +45,10 @@ - - - - + + + + diff --git a/tests/MoBi.UI.Tests/MoBi.UI.Tests.csproj b/tests/MoBi.UI.Tests/MoBi.UI.Tests.csproj index e37cd9d7c..1cbb7f145 100644 --- a/tests/MoBi.UI.Tests/MoBi.UI.Tests.csproj +++ b/tests/MoBi.UI.Tests/MoBi.UI.Tests.csproj @@ -17,8 +17,8 @@ - - + + From d27f457236185065ac2f2e023b6560562f371006 Mon Sep 17 00:00:00 2001 From: georgeDaskalakis <37107428+georgeDaskalakis@users.noreply.github.com> Date: Thu, 1 Sep 2022 19:46:01 +0200 Subject: [PATCH 07/18] temp plugging in mappings --- src/MoBi.Assets/AppConstants.cs | 2 ++ src/MoBi.Assets/MoBi.Assets.csproj | 6 ++--- src/MoBi.BatchTool/MoBi.BatchTool.csproj | 2 +- ...moveHistoricResultFromSimulationCommand.cs | 4 ++-- .../Commands/RemoveSimulationCommand.cs | 4 ++-- .../RenameSimulationResultsCommand.cs | 2 +- src/MoBi.Core/Domain/Model/MoBiSimulation.cs | 15 +++---------- src/MoBi.Core/MoBi.Core.csproj | 14 ++++++------ src/MoBi.Core/Reporting/Constants.cs | 4 ++-- .../Mappers/ProjectMetaDataToProjectMapper.cs | 2 +- .../Services/SerializationContextFactory.cs | 2 +- .../Serializer/MoBiSimulationXmlSerializer.cs | 6 ++--- src/MoBi.Core/Services/SimulationLoader.cs | 2 +- src/MoBi.Engine/MoBi.Engine.csproj | 4 ++-- .../ContextMenuForHistoricalResultsNode.cs | 2 +- .../MoBi.Presentation.csproj | 6 ++--- .../Nodes/TreeNodeFactory.cs | 4 ++-- .../Presenter/ChartPresenter.cs | 2 +- .../Presenter/EditSimulationPresenter.cs | 22 +++++++++++++++++-- .../Tasks/Edit/EditTasksForSimulation.cs | 4 ++-- .../Tasks/ObservedDataTask.cs | 4 ++-- .../Tasks/SimulationRunner.cs | 7 +++--- .../ExportSimulationResultsToExcelCommand.cs | 2 +- src/MoBi.UI/MoBi.UI.csproj | 10 ++++----- .../SimulationView/EditSimulationView.cs | 2 ++ src/MoBi/MoBi.csproj | 4 ++-- tests/MoBi.Tests/Core/MoBiSimulationSpecs.cs | 4 ++-- .../ModelConstructionSpecs.cs | 4 ++-- tests/MoBi.Tests/MoBi.Tests.csproj | 8 +++---- .../EditSimulationPresenterSpecs.cs | 9 ++++++-- .../Tasks/ObservedDataTasksSpecs.cs | 16 +++++++------- .../Tasks/SimulationRunnerSpecs.cs | 4 ++-- tests/MoBi.UI.Tests/MoBi.UI.Tests.csproj | 4 ++-- 33 files changed, 103 insertions(+), 84 deletions(-) diff --git a/src/MoBi.Assets/AppConstants.cs b/src/MoBi.Assets/AppConstants.cs index 1889f5275..30c6f8b3e 100644 --- a/src/MoBi.Assets/AppConstants.cs +++ b/src/MoBi.Assets/AppConstants.cs @@ -1423,6 +1423,8 @@ public static class Captions public static readonly string SimulationParameters = "Parameters"; public static readonly string Results = "Results"; public static readonly string TimeProfile = "Time Profile"; + public static readonly string PredictedVsObserved = "Predicted vs Observed"; + public static readonly string ResidualsVsTime = "Residuals vs Time"; public static readonly string SimulationData = "Data"; public static readonly string IsStationary = "Stationary"; public static readonly string DefaultStartAmount = "Amount"; diff --git a/src/MoBi.Assets/MoBi.Assets.csproj b/src/MoBi.Assets/MoBi.Assets.csproj index dd9f98ece..7c7f7e4a4 100644 --- a/src/MoBi.Assets/MoBi.Assets.csproj +++ b/src/MoBi.Assets/MoBi.Assets.csproj @@ -26,9 +26,9 @@ - - - + + + diff --git a/src/MoBi.BatchTool/MoBi.BatchTool.csproj b/src/MoBi.BatchTool/MoBi.BatchTool.csproj index ec723ef2d..84c58adcf 100644 --- a/src/MoBi.BatchTool/MoBi.BatchTool.csproj +++ b/src/MoBi.BatchTool/MoBi.BatchTool.csproj @@ -60,7 +60,7 @@ - + diff --git a/src/MoBi.Core/Commands/RemoveHistoricResultFromSimulationCommand.cs b/src/MoBi.Core/Commands/RemoveHistoricResultFromSimulationCommand.cs index bc851211e..455e96e74 100644 --- a/src/MoBi.Core/Commands/RemoveHistoricResultFromSimulationCommand.cs +++ b/src/MoBi.Core/Commands/RemoveHistoricResultFromSimulationCommand.cs @@ -51,8 +51,8 @@ public ClearResultsCommand(IMoBiSimulation simulation) protected override void ExecuteWith(IMoBiContext context) { - var result = _simulation.Results; - _simulation.Results = null; + var result = _simulation.ResultsDataRepository; + _simulation.ResultsDataRepository = null; Description = AppConstants.Commands.RemoveFromDescription(ObjectType, result.Name, _simulation.Name); context.PublishEvent(new RemovedDataEvent(result)); } diff --git a/src/MoBi.Core/Commands/RemoveSimulationCommand.cs b/src/MoBi.Core/Commands/RemoveSimulationCommand.cs index fbe229d78..c5416065a 100644 --- a/src/MoBi.Core/Commands/RemoveSimulationCommand.cs +++ b/src/MoBi.Core/Commands/RemoveSimulationCommand.cs @@ -25,8 +25,8 @@ protected override void ExecuteWith(IMoBiContext context) context.UnregisterSimulation(_simulation); context.PublishEvent(new SimulationRemovedEvent(_simulation)); - //Do not serialize Results - _simulation.Results = null; + //Do not serialize ResultsDataRepository + _simulation.ResultsDataRepository = null; _serializationStream = context.Serialize(_simulation); } diff --git a/src/MoBi.Core/Commands/RenameSimulationResultsCommand.cs b/src/MoBi.Core/Commands/RenameSimulationResultsCommand.cs index 158a2bcf2..eaa09e804 100644 --- a/src/MoBi.Core/Commands/RenameSimulationResultsCommand.cs +++ b/src/MoBi.Core/Commands/RenameSimulationResultsCommand.cs @@ -47,7 +47,7 @@ protected override void ExecuteWith(IMoBiContext context) public override void RestoreExecutionData(IMoBiContext context) { _simulation = context.Get(SimulationId); - _dataRepository = _simulation.HistoricResults[DataRepositoryId] ?? _simulation.Results; + _dataRepository = _simulation.HistoricResults[DataRepositoryId] ?? _simulation.ResultsDataRepository; } } } \ No newline at end of file diff --git a/src/MoBi.Core/Domain/Model/MoBiSimulation.cs b/src/MoBi.Core/Domain/Model/MoBiSimulation.cs index 270f2a5a3..bd7ca0dbd 100644 --- a/src/MoBi.Core/Domain/Model/MoBiSimulation.cs +++ b/src/MoBi.Core/Domain/Model/MoBiSimulation.cs @@ -14,7 +14,7 @@ namespace MoBi.Core.Domain.Model { public interface IMoBiSimulation : IWithDiagramFor, ISimulation, IWithChartTemplates { - DataRepository Results { get; set; } + //DataRepository ResultsDataRepository { get; set; } ICache HistoricResults { get; } CurveChart Chart { get; set; } IMoBiBuildConfiguration MoBiBuildConfiguration { get; } @@ -40,7 +40,6 @@ public class MoBiSimulation : ModelCoreSimulation, IMoBiSimulation private bool _hasChanged; private readonly IList _allSimulationAnalyses = new List(); private DataRepository _results; - private SimulationResults _results1; public IDiagramModel DiagramModel { get; set; } public CurveChart Chart { get; set; } public string ParameterIdentificationWorkingDirectory { get; set; } @@ -128,14 +127,6 @@ public IEnumerable Charts public OutputMappings OutputMappings { get; set; } = new OutputMappings(); - SimulationResults ISimulation.Results - { - get => _results1; - set => _results1 = value; - } - - public DataRepository ResultRepository { get; } - public new IReactionBuildingBlock Reactions { get => BuildConfiguration.Reactions; @@ -180,9 +171,9 @@ public void MarkResultsOutOfDate() HasUpToDateResults = false; } - public bool HasResults => Results != null; + public bool HasResults => ResultsDataRepository != null; - public DataRepository Results + public DataRepository ResultsDataRepository { get => _results; set diff --git a/src/MoBi.Core/MoBi.Core.csproj b/src/MoBi.Core/MoBi.Core.csproj index 3422547bb..7a91fd4e1 100644 --- a/src/MoBi.Core/MoBi.Core.csproj +++ b/src/MoBi.Core/MoBi.Core.csproj @@ -32,13 +32,13 @@ - - - - - - - + + + + + + + diff --git a/src/MoBi.Core/Reporting/Constants.cs b/src/MoBi.Core/Reporting/Constants.cs index 7a3a46344..918b4349d 100644 --- a/src/MoBi.Core/Reporting/Constants.cs +++ b/src/MoBi.Core/Reporting/Constants.cs @@ -25,12 +25,12 @@ class Constants public const string SIMULATION_SETTINGS = "Simulation Settings"; public const string SIMULATIONS = "Simulations"; public const string SIMULATION = "Simulation"; - public const string RESULTS = "Results"; + public const string RESULTS = "ResultsDataRepository"; public const string CHARTS = "Charts"; public const string CHART = "Chart"; public const string DATA = "Data"; public const string OBSERVED_DATA = "Observed Data"; - public const string HISTORIC_RESULTS = "Historic Results"; + public const string HISTORIC_RESULTS = "Historic ResultsDataRepository"; public const string DIMENSION = "Dimension"; public const string ID = "ID"; diff --git a/src/MoBi.Core/Serialization/ORM/Mappers/ProjectMetaDataToProjectMapper.cs b/src/MoBi.Core/Serialization/ORM/Mappers/ProjectMetaDataToProjectMapper.cs index 5da7d9299..b30124e06 100644 --- a/src/MoBi.Core/Serialization/ORM/Mappers/ProjectMetaDataToProjectMapper.cs +++ b/src/MoBi.Core/Serialization/ORM/Mappers/ProjectMetaDataToProjectMapper.cs @@ -91,7 +91,7 @@ private void addSimulationToProject(SimulationMetaData simulationMetaData, Seria _project.AddSimulation(simulation); deserializeResults(simulation, simulationMetaData, serializationContext); //Ensure that all references to simulations (Simulation itself, results etc) are available in the serialization context - serializationContext.AddRepository(simulation.Results); + serializationContext.AddRepository(simulation.ResultsDataRepository); simulation.HistoricResults.Each(serializationContext.AddRepository); serializationContext.Register(simulation); } diff --git a/src/MoBi.Core/Serialization/Services/SerializationContextFactory.cs b/src/MoBi.Core/Serialization/Services/SerializationContextFactory.cs index 0cc9efe63..2d88916f3 100644 --- a/src/MoBi.Core/Serialization/Services/SerializationContextFactory.cs +++ b/src/MoBi.Core/Serialization/Services/SerializationContextFactory.cs @@ -60,7 +60,7 @@ public SerializationContext Create(Type type = null, SerializationContext parent if (project != null && shouldRegisterSimulations) { var allSimulations = project.Simulations; - var allSimulationResults = allSimulations.Where(s => s.HasResults).Select(s => s.Results); + var allSimulationResults = allSimulations.Where(s => s.HasResults).Select(s => s.ResultsDataRepository); allRepositories.AddRange(allSimulationResults.Union(project.AllObservedData)); //Also register simulations to ensure that they are available as well for deserialization diff --git a/src/MoBi.Core/Serialization/Xml/Serializer/MoBiSimulationXmlSerializer.cs b/src/MoBi.Core/Serialization/Xml/Serializer/MoBiSimulationXmlSerializer.cs index a82c8a568..41ccaac9d 100644 --- a/src/MoBi.Core/Serialization/Xml/Serializer/MoBiSimulationXmlSerializer.cs +++ b/src/MoBi.Core/Serialization/Xml/Serializer/MoBiSimulationXmlSerializer.cs @@ -16,7 +16,7 @@ public MoBiSimulationXmlSerializer() : base(SerializationConstants.MoBiSimulatio public override void PerformMapping() { base.PerformMapping(); - Map(x => x.Results); + Map(x => x.ResultsDataRepository); Map(x => x.ParameterIdentificationWorkingDirectory); Map(x => x.HasUpToDateResults); } @@ -30,8 +30,8 @@ protected override void TypedDeserialize(MoBiSimulation simulation, XElement out { base.TypedDeserialize(simulation, outputToDeserialize, serializationContext); - if (simulation.Results != null) - serializationContext.AddRepository(simulation.Results); + if (simulation.ResultsDataRepository != null) + serializationContext.AddRepository(simulation.ResultsDataRepository); var chartSerializer = SerializerRepository.SerializerFor(); var chartElement = outputToDeserialize.Element(chartSerializer.ElementName); diff --git a/src/MoBi.Core/Services/SimulationLoader.cs b/src/MoBi.Core/Services/SimulationLoader.cs index 6dda6e3eb..2746200e8 100644 --- a/src/MoBi.Core/Services/SimulationLoader.cs +++ b/src/MoBi.Core/Services/SimulationLoader.cs @@ -61,7 +61,7 @@ private void addSimulationToProject(IMoBiSimulation simulation, MoBiMacroCommand addBuildConfigurationToProject(project, moBiSimulation.MoBiBuildConfiguration, loadCommand); - moBiSimulation.Results = simulation.Results; + moBiSimulation.ResultsDataRepository = simulation.ResultsDataRepository; if (!_nameCorrector.CorrectName(project.Simulations, moBiSimulation)) return; diff --git a/src/MoBi.Engine/MoBi.Engine.csproj b/src/MoBi.Engine/MoBi.Engine.csproj index f0d5dcf59..4e882cbae 100644 --- a/src/MoBi.Engine/MoBi.Engine.csproj +++ b/src/MoBi.Engine/MoBi.Engine.csproj @@ -32,8 +32,8 @@ - - + + diff --git a/src/MoBi.Presentation/MenusAndBars/ContextMenus/ContextMenuForHistoricalResultsNode.cs b/src/MoBi.Presentation/MenusAndBars/ContextMenus/ContextMenuForHistoricalResultsNode.cs index e7c12de94..a2f96e29c 100644 --- a/src/MoBi.Presentation/MenusAndBars/ContextMenus/ContextMenuForHistoricalResultsNode.cs +++ b/src/MoBi.Presentation/MenusAndBars/ContextMenus/ContextMenuForHistoricalResultsNode.cs @@ -33,7 +33,7 @@ public IContextMenu InitializeWith(DataRepository dataRepository, IMoBiSimulatio .WithIcon(ApplicationIcons.SimulationComparison) .WithCommandFor(dataRepository)); - if (!Equals(simulation.Results, dataRepository)) + if (!Equals(simulation.ResultsDataRepository, dataRepository)) { var persitableCommand = CreateMenuButton.WithCaption(dataRepository.IsPersistable() ? AppConstants.MenuNames.DiscardResults : AppConstants.MenuNames.KeepResults) .WithCommandFor(dataRepository); diff --git a/src/MoBi.Presentation/MoBi.Presentation.csproj b/src/MoBi.Presentation/MoBi.Presentation.csproj index 40c9780ef..6572b6a92 100644 --- a/src/MoBi.Presentation/MoBi.Presentation.csproj +++ b/src/MoBi.Presentation/MoBi.Presentation.csproj @@ -28,9 +28,9 @@ - - - + + + diff --git a/src/MoBi.Presentation/Nodes/TreeNodeFactory.cs b/src/MoBi.Presentation/Nodes/TreeNodeFactory.cs index a2a5c4f67..cfba154d9 100644 --- a/src/MoBi.Presentation/Nodes/TreeNodeFactory.cs +++ b/src/MoBi.Presentation/Nodes/TreeNodeFactory.cs @@ -60,8 +60,8 @@ public ITreeNode CreateFor(ClassifiableSimulation classifiableSimulation) var buildConfigNode = CreateFor(simulation.MoBiBuildConfiguration); simNode.AddChild(buildConfigNode); - if (simulation.Results != null) - simNode.AddChild(CreateFor(simulation.Results)); + if (simulation.ResultsDataRepository != null) + simNode.AddChild(CreateFor(simulation.ResultsDataRepository)); //uses reverse so that the first result is the last node simulation.HistoricResults.Reverse().Each(res => simNode.AddChild(CreateFor(res))); diff --git a/src/MoBi.Presentation/Presenter/ChartPresenter.cs b/src/MoBi.Presentation/Presenter/ChartPresenter.cs index b20367203..79c172357 100644 --- a/src/MoBi.Presentation/Presenter/ChartPresenter.cs +++ b/src/MoBi.Presentation/Presenter/ChartPresenter.cs @@ -291,7 +291,7 @@ private void addDataRepositoriesToDataRepositoryCache(IReadOnlyCollection Equals(simulation.Results, dataRepository)); + .FirstOrDefault(simulation => Equals(simulation.ResultsDataRepository, dataRepository)); } private IMoBiSimulation findHistoricSimulation(DataRepository dataRepository) diff --git a/src/MoBi.Presentation/Presenter/EditSimulationPresenter.cs b/src/MoBi.Presentation/Presenter/EditSimulationPresenter.cs index 721ddbbd7..2bc00fdf7 100644 --- a/src/MoBi.Presentation/Presenter/EditSimulationPresenter.cs +++ b/src/MoBi.Presentation/Presenter/EditSimulationPresenter.cs @@ -10,6 +10,7 @@ using MoBi.Presentation.Tasks; using MoBi.Presentation.Views; using OSPSuite.Core.Chart; +using OSPSuite.Core.Chart.Simulations; using OSPSuite.Core.Domain; using OSPSuite.Core.Domain.Data; using OSPSuite.Core.Services; @@ -126,6 +127,8 @@ public void Edit(IMoBiSimulation simulation) UpdateCaption(); _view.Display(); loadChart(); + _simulationPredictedVsObservedChartPresenter.UpdateAnalysisBasedOn(_simulation); + _simulationResidualVsTimeChartPresenter.UpdateAnalysisBasedOn(_simulation); } private void addObservedDataRepositories(IList data, IEnumerable curves) @@ -146,11 +149,24 @@ public override void Edit(object subject) private void loadChart() { + //probably have to rename to charts + if (_simulationPredictedVsObservedChartPresenter.Chart == null) + { + var chart = _chartFactory.Create(); + _simulationPredictedVsObservedChartPresenter.InitializeAnalysis(chart, _simulation); + } + + if (_simulationResidualVsTimeChartPresenter.Chart == null) + { + var chart = _chartFactory.Create(); + _simulationResidualVsTimeChartPresenter.InitializeAnalysis(chart, _simulation); + } + CurveChartTemplate defaultTemplate = null; var data = new List(); - if (_simulation.Results != null) - data.Add(_simulation.Results); + if (_simulation.ResultsDataRepository != null) + data.Add(_simulation.ResultsDataRepository); if (_simulation.Chart == null) { @@ -164,6 +180,8 @@ private void loadChart() defaultTemplate = _simulation.DefaultChartTemplate; addObservedDataRepositories(data, _simulation.Chart.Curves); + _simulationPredictedVsObservedChartPresenter.UpdateAnalysisBasedOn(_simulation); + _simulationResidualVsTimeChartPresenter.UpdateAnalysisBasedOn(_simulation); _chartPresenter.Show(_simulation.Chart, data, defaultTemplate); } diff --git a/src/MoBi.Presentation/Tasks/Edit/EditTasksForSimulation.cs b/src/MoBi.Presentation/Tasks/Edit/EditTasksForSimulation.cs index a0da762ad..70338abd6 100644 --- a/src/MoBi.Presentation/Tasks/Edit/EditTasksForSimulation.cs +++ b/src/MoBi.Presentation/Tasks/Edit/EditTasksForSimulation.cs @@ -85,7 +85,7 @@ public override void Edit(IMoBiSimulation simulation) public void ExportResultsToExcel(IMoBiSimulation simulation) { - ExportResultsToExcel(simulation, simulation.Results); + ExportResultsToExcel(simulation, simulation.ResultsDataRepository); } public void ExportResultsToExcel(IMoBiSimulation simulation, DataRepository dataRepository) @@ -160,7 +160,7 @@ public void CalculateScaleFactors(IMoBiSimulation simulation) private IEnumerable allUsedResultsNameIn(IMoBiSimulation simulation) { - return simulation.HistoricResults.Select(x => x.Name).Union(new[] {simulation.Results.Name}); + return simulation.HistoricResults.Select(x => x.Name).Union(new[] {simulation.ResultsDataRepository.Name}); } private void addCommand(IMoBiCommand command) diff --git a/src/MoBi.Presentation/Tasks/ObservedDataTask.cs b/src/MoBi.Presentation/Tasks/ObservedDataTask.cs index b976ebf8d..eea2c5d96 100644 --- a/src/MoBi.Presentation/Tasks/ObservedDataTask.cs +++ b/src/MoBi.Presentation/Tasks/ObservedDataTask.cs @@ -150,7 +150,7 @@ private static MoBiMacroCommand deleteAllResultsFromSimulationCommand(IMoBiSimul Description = AppConstants.Commands.DeleteResultsFromSimulation(simulation.Name), }; - if (simulation.Results != null) + if (simulation.ResultsDataRepository != null) macroCommand.AddCommand(new ClearResultsCommand(simulation)); simulation.HistoricResults.Each(x => macroCommand.Add(new RemoveHistoricResultFromSimulationCommand(simulation, x))); @@ -210,7 +210,7 @@ private IMoBiSimulation getSimulationWithHistoricResult(DataRepository repositor private IMoBiSimulation getSimulationWithCurrentResult(DataRepository repository) { var simulations = _context.CurrentProject.Simulations; - return simulations.FirstOrDefault(sim => sim.Results != null && sim.Results.Id.Equals(repository.Id)); + return simulations.FirstOrDefault(sim => sim.ResultsDataRepository != null && sim.ResultsDataRepository.Id.Equals(repository.Id)); } public void RemoveResultsFromSimulations(IReadOnlyList resultsToRemove) diff --git a/src/MoBi.Presentation/Tasks/SimulationRunner.cs b/src/MoBi.Presentation/Tasks/SimulationRunner.cs index b1e945ab4..f75c33eb0 100644 --- a/src/MoBi.Presentation/Tasks/SimulationRunner.cs +++ b/src/MoBi.Presentation/Tasks/SimulationRunner.cs @@ -152,11 +152,12 @@ private void showWarningsIfAny(SimulationRunResults results) private void copyResultsToSimulation(SimulationRunResults results, IMoBiSimulation simulation) { var resultsResults = results.Results; - if (simulation.Results != null) - simulation.HistoricResults.Add(simulation.Results); + if (simulation.ResultsDataRepository != null) + simulation.HistoricResults.Add(simulation.ResultsDataRepository); setMolecularWeight(simulation, resultsResults); - simulation.Results = resultsResults; + simulation.ResultsDataRepository = resultsResults; + //so theoretically we could add here the calculation of the individual results... } private void setMolecularWeight(IMoBiSimulation simulation, IEnumerable results) diff --git a/src/MoBi.Presentation/UICommand/ExportSimulationResultsToExcelCommand.cs b/src/MoBi.Presentation/UICommand/ExportSimulationResultsToExcelCommand.cs index 0d8478591..53a2a585a 100644 --- a/src/MoBi.Presentation/UICommand/ExportSimulationResultsToExcelCommand.cs +++ b/src/MoBi.Presentation/UICommand/ExportSimulationResultsToExcelCommand.cs @@ -24,7 +24,7 @@ public ExportSimulationResultsToExcelCommand(IEditTasksForSimulation simulationT protected override void PerformExecute() { - _simulationTasks.ExportResultsToExcel(Subject, DataRepository ?? Subject.Results); + _simulationTasks.ExportResultsToExcel(Subject, DataRepository ?? Subject.ResultsDataRepository); } } } \ No newline at end of file diff --git a/src/MoBi.UI/MoBi.UI.csproj b/src/MoBi.UI/MoBi.UI.csproj index 535cb546c..c66defbfe 100644 --- a/src/MoBi.UI/MoBi.UI.csproj +++ b/src/MoBi.UI/MoBi.UI.csproj @@ -27,12 +27,12 @@ - - - - + + + + - + diff --git a/src/MoBi.UI/Views/SimulationView/EditSimulationView.cs b/src/MoBi.UI/Views/SimulationView/EditSimulationView.cs index cc4fbe735..fcc72f79e 100644 --- a/src/MoBi.UI/Views/SimulationView/EditSimulationView.cs +++ b/src/MoBi.UI/Views/SimulationView/EditSimulationView.cs @@ -40,6 +40,8 @@ public override void InitializeResources() tabResults.InitWith(AppConstants.Captions.Results, ApplicationIcons.TimeProfileAnalysis); tabData.InitWith(AppConstants.Captions.SimulationData, ApplicationIcons.PKSim); tabTimeProfile.InitWith(AppConstants.Captions.TimeProfile, ApplicationIcons.TimeProfileAnalysis); + tabPredVsObs.InitWith(AppConstants.Captions.PredictedVsObserved, ApplicationIcons.PredictedVsObservedAnalysis); + tabResidVsTime.InitWith(AppConstants.Captions.ResidualsVsTime, ApplicationIcons.ResidualVsTimeAnalysis); tabsNavigation.SelectedPageChanging += (o, e) => OnEvent(tabSelectionChanged, e); tabs.SelectedPageChanging += (o, e) => OnEvent(tabSelectionChanged, e); diff --git a/src/MoBi/MoBi.csproj b/src/MoBi/MoBi.csproj index f0d6be73b..4a40486c5 100644 --- a/src/MoBi/MoBi.csproj +++ b/src/MoBi/MoBi.csproj @@ -71,13 +71,13 @@ - + - + diff --git a/tests/MoBi.Tests/Core/MoBiSimulationSpecs.cs b/tests/MoBi.Tests/Core/MoBiSimulationSpecs.cs index f2967d4e0..d6ec3321c 100644 --- a/tests/MoBi.Tests/Core/MoBiSimulationSpecs.cs +++ b/tests/MoBi.Tests/Core/MoBiSimulationSpecs.cs @@ -23,13 +23,13 @@ protected override void Context() { base.Context(); sut.Creation.Version = "a version"; - sut.Results = A.Fake(); + sut.ResultsDataRepository = A.Fake(); sut.Creation.Version = "another version"; } protected override void Because() { - sut.Results = A.Fake(); + sut.ResultsDataRepository = A.Fake(); } [Observation] diff --git a/tests/MoBi.Tests/IntegrationTests/ModelConstructionSpecs.cs b/tests/MoBi.Tests/IntegrationTests/ModelConstructionSpecs.cs index fa22a4503..deb0b24ec 100644 --- a/tests/MoBi.Tests/IntegrationTests/ModelConstructionSpecs.cs +++ b/tests/MoBi.Tests/IntegrationTests/ModelConstructionSpecs.cs @@ -79,8 +79,8 @@ public override void GlobalContext() [Observation] public void should_add_the_parameter_value_to_the_resulting_data_repository() { - _simulation.Results.ShouldNotBeNull(); - var volumeParmaeterDataColumn = _simulation.Results.First(x => x.QuantityInfo.PathAsString == new[] {_simulation.Name, _organism.Name, Constants.Parameters.VOLUME}.ToPathString()); + _simulation.ResultsDataRepository.ShouldNotBeNull(); + var volumeParmaeterDataColumn = _simulation.ResultsDataRepository.First(x => x.QuantityInfo.PathAsString == new[] {_simulation.Name, _organism.Name, Constants.Parameters.VOLUME}.ToPathString()); volumeParmaeterDataColumn.ShouldNotBeNull(); } } diff --git a/tests/MoBi.Tests/MoBi.Tests.csproj b/tests/MoBi.Tests/MoBi.Tests.csproj index 0a13fc24c..d6a8372e0 100644 --- a/tests/MoBi.Tests/MoBi.Tests.csproj +++ b/tests/MoBi.Tests/MoBi.Tests.csproj @@ -45,10 +45,10 @@ - - - - + + + + diff --git a/tests/MoBi.Tests/Presentation/EditSimulationPresenterSpecs.cs b/tests/MoBi.Tests/Presentation/EditSimulationPresenterSpecs.cs index bac2f5b08..22e565009 100644 --- a/tests/MoBi.Tests/Presentation/EditSimulationPresenterSpecs.cs +++ b/tests/MoBi.Tests/Presentation/EditSimulationPresenterSpecs.cs @@ -22,6 +22,8 @@ public abstract class concern_for_EditSimulationPresenter : ContextSpecification { protected IEditSimulationView _view; protected ISimulationChartPresenter _chartPresenter; + protected ISimulationPredictedVsObservedChartPresenter _simulationPredictedVsObservedChartPresenter; + protected ISimulationResidualVsTimeChartPresenter _simulationResidualVsTimeChartPresenter; protected IHierarchicalSimulationPresenter _hierarchicalSimulationPresenter; protected ISimulationDiagramPresenter _diagramPresenter; protected IEditSolverSettingsPresenter _solverSettings; @@ -36,6 +38,8 @@ protected override void Context() { _view = A.Fake(); _chartPresenter = A.Fake(); + _simulationPredictedVsObservedChartPresenter = A.Fake(); + _simulationResidualVsTimeChartPresenter = A.Fake(); _hierarchicalSimulationPresenter = A.Fake(); _diagramPresenter = A.Fake(); _solverSettings = A.Fake(); @@ -48,7 +52,8 @@ protected override void Context() sut = new EditSimulationPresenter(_view, _chartPresenter, _hierarchicalSimulationPresenter, _diagramPresenter, _solverSettings, _outputSchemaPresenter, _presenterFactory, new HeavyWorkManagerForSpecs(), - A.Fake(), _editFavoritePresenter, _chartTasks, _userDefinedParametersPresenter, _simulationOutputMappingPresenter); + A.Fake(), _editFavoritePresenter, _chartTasks, _userDefinedParametersPresenter, _simulationOutputMappingPresenter, + _simulationPredictedVsObservedChartPresenter, _simulationResidualVsTimeChartPresenter); } } @@ -207,7 +212,7 @@ public class When_the_simulation_simulation_presenter_is_editing_a_simulation_wi protected override void Context() { base.Context(); - _simulation = new MoBiSimulation { Results = new DataRepository() }; + _simulation = new MoBiSimulation { ResultsDataRepository = new DataRepository() }; var chart = new CurveChart(); diff --git a/tests/MoBi.Tests/Presentation/Tasks/ObservedDataTasksSpecs.cs b/tests/MoBi.Tests/Presentation/Tasks/ObservedDataTasksSpecs.cs index c379aab34..f95d9555a 100644 --- a/tests/MoBi.Tests/Presentation/Tasks/ObservedDataTasksSpecs.cs +++ b/tests/MoBi.Tests/Presentation/Tasks/ObservedDataTasksSpecs.cs @@ -68,7 +68,7 @@ protected override void Context() _currentResult = new DataRepository("id1"); _historicResult = new DataRepository("id2"); _repositories = new List {_currentResult, _historicResult}; - _moBiSimulation = new MoBiSimulation {Results = _currentResult}; + _moBiSimulation = new MoBiSimulation {ResultsDataRepository = _currentResult}; _moBiSimulation.HistoricResults.Add(_historicResult); _project.AddSimulation(_moBiSimulation); @@ -85,7 +85,7 @@ protected override void Because() public void the_data_repositories_must_be_removed_from_the_simulations() { _moBiSimulation.HistoricResults.Contains(_historicResult).ShouldBeFalse(); - _moBiSimulation.Results.ShouldBeNull(); + _moBiSimulation.ResultsDataRepository.ShouldBeNull(); } } @@ -259,7 +259,7 @@ protected override void Context() _simulation = new MoBiSimulation().WithName("TOTO"); _simulation.HistoricResults.Add(new DataRepository("Rep1")); _simulation.HistoricResults.Add(new DataRepository("Rep2")); - _simulation.Results = new DataRepository("Res"); + _simulation.ResultsDataRepository = new DataRepository("Res"); A.CallTo(_dialogCreator).WithReturnType().Returns(ViewResult.Yes); } @@ -279,7 +279,7 @@ public void should_ask_the_user_if_he_really_wants_to_delete_the_results() public void should_remove_all_historical_results_and_current_results() { _simulation.HistoricResults.Count.ShouldBeEqualTo(0); - _simulation.Results.ShouldBeNull(); + _simulation.ResultsDataRepository.ShouldBeNull(); } } @@ -295,8 +295,8 @@ protected override void Context() _simulation2 = new MoBiSimulation().WithName("SIM1"); _simulation1.HistoricResults.Add(new DataRepository("Rep1")); _simulation2.HistoricResults.Add(new DataRepository("Rep2")); - _simulation1.Results = new DataRepository("Res"); - _simulation2.Results = new DataRepository("Res"); + _simulation1.ResultsDataRepository = new DataRepository("Res"); + _simulation2.ResultsDataRepository = new DataRepository("Res"); A.CallTo(_dialogCreator).WithReturnType().Returns(ViewResult.Yes); @@ -319,10 +319,10 @@ public void should_ask_the_user_if_he_really_wants_to_delete_the_results() public void should_remove_all_historical_results_and_current_results() { _simulation1.HistoricResults.Count.ShouldBeEqualTo(0); - _simulation1.Results.ShouldBeNull(); + _simulation1.ResultsDataRepository.ShouldBeNull(); _simulation2.HistoricResults.Count.ShouldBeEqualTo(0); - _simulation2.Results.ShouldBeNull(); + _simulation2.ResultsDataRepository.ShouldBeNull(); } } } \ No newline at end of file diff --git a/tests/MoBi.Tests/Presentation/Tasks/SimulationRunnerSpecs.cs b/tests/MoBi.Tests/Presentation/Tasks/SimulationRunnerSpecs.cs index a41e383f5..5807c415a 100644 --- a/tests/MoBi.Tests/Presentation/Tasks/SimulationRunnerSpecs.cs +++ b/tests/MoBi.Tests/Presentation/Tasks/SimulationRunnerSpecs.cs @@ -192,7 +192,7 @@ protected override void Context() A.CallTo(() => _simModelManagerFactory.Create()).Returns(_simModelManager); _oldResults = new DataRepository("OLD"); - _simulation.Results = _oldResults; + _simulation.ResultsDataRepository = _oldResults; _newResults = new DataRepository("NEW"); _simulationResults = new SimulationRunResults(success:true, warnings: Enumerable.Empty(), results: _newResults); @@ -237,7 +237,7 @@ public void should_move_the_previous_results_as_historical_results_in_the_simula [Observation] public void should_set_the_newly_calculated_results_as_new_results() { - _simulation.Results.ShouldBeEqualTo(_newResults); + _simulation.ResultsDataRepository.ShouldBeEqualTo(_newResults); } [Observation] diff --git a/tests/MoBi.UI.Tests/MoBi.UI.Tests.csproj b/tests/MoBi.UI.Tests/MoBi.UI.Tests.csproj index 1cbb7f145..bb403a1d7 100644 --- a/tests/MoBi.UI.Tests/MoBi.UI.Tests.csproj +++ b/tests/MoBi.UI.Tests/MoBi.UI.Tests.csproj @@ -17,8 +17,8 @@ - - + + From 71ea3436a506f24e18291c0d1f4b0b1ac8867ed5 Mon Sep 17 00:00:00 2001 From: georgeDaskalakis <37107428+georgeDaskalakis@users.noreply.github.com> Date: Wed, 14 Sep 2022 15:42:54 +0200 Subject: [PATCH 08/18] corrections --- src/MoBi.Assets/AppConstants.cs | 2 +- src/MoBi.Core/Domain/Model/MoBiSimulation.cs | 2 -- src/MoBi.Presentation/Presenter/EditSimulationPresenter.cs | 1 - src/MoBi.UI/Views/SimulationView/EditSimulationView.cs | 5 ----- 4 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/MoBi.Assets/AppConstants.cs b/src/MoBi.Assets/AppConstants.cs index a4e985658..7dcef4d80 100644 --- a/src/MoBi.Assets/AppConstants.cs +++ b/src/MoBi.Assets/AppConstants.cs @@ -1423,7 +1423,7 @@ public static class Captions public static readonly string SimulationParameters = "Parameters"; public static readonly string Results = "Results"; public static readonly string TimeProfile = "Time Profile"; - public static readonly string PredictedVsObserved = "Predicted vs Observed";<< + public static readonly string PredictedVsObserved = "Predicted vs Observed"; public static readonly string ResidualsVsTime = "Residuals vs Time"; public static readonly string SimulationData = "Data"; public static readonly string IsStationary = "Stationary"; diff --git a/src/MoBi.Core/Domain/Model/MoBiSimulation.cs b/src/MoBi.Core/Domain/Model/MoBiSimulation.cs index 9b4343ddc..7153e15c5 100644 --- a/src/MoBi.Core/Domain/Model/MoBiSimulation.cs +++ b/src/MoBi.Core/Domain/Model/MoBiSimulation.cs @@ -125,8 +125,6 @@ public IEnumerable Charts get { yield return Chart; } } - public OutputMappings OutputMappings { get; set; } = new OutputMappings(); - public new IReactionBuildingBlock Reactions { get => BuildConfiguration.Reactions; diff --git a/src/MoBi.Presentation/Presenter/EditSimulationPresenter.cs b/src/MoBi.Presentation/Presenter/EditSimulationPresenter.cs index 2bc00fdf7..6254eae52 100644 --- a/src/MoBi.Presentation/Presenter/EditSimulationPresenter.cs +++ b/src/MoBi.Presentation/Presenter/EditSimulationPresenter.cs @@ -146,7 +146,6 @@ public override void Edit(object subject) } public override object Subject => _simulation; - private void loadChart() { //probably have to rename to charts diff --git a/src/MoBi.UI/Views/SimulationView/EditSimulationView.cs b/src/MoBi.UI/Views/SimulationView/EditSimulationView.cs index 3cbd49515..d90dc7be6 100644 --- a/src/MoBi.UI/Views/SimulationView/EditSimulationView.cs +++ b/src/MoBi.UI/Views/SimulationView/EditSimulationView.cs @@ -90,11 +90,6 @@ public void ShowResultsTab() tabs.SelectedTabPage = tabResults; } - public void SetDataView(ISimulationOutputMappingView view) - { - tabData.FillWith(view); - } - public void SetPredictedVsObservedView(ISimulationRunAnalysisView view) { tabPredVsObs.FillWith(view); From 4cd939050a415f4e73cd52337ed8dce87863a56a Mon Sep 17 00:00:00 2001 From: georgeDaskalakis <37107428+georgeDaskalakis@users.noreply.github.com> Date: Thu, 20 Oct 2022 16:20:40 +0200 Subject: [PATCH 09/18] finishing up the plugin --- src/MoBi.Assets/MoBi.Assets.csproj | 6 +- src/MoBi.BatchTool/MoBi.BatchTool.csproj | 2 +- src/MoBi.Core/MoBi.Core.csproj | 14 +-- src/MoBi.Engine/MoBi.Engine.csproj | 4 +- .../MoBi.Presentation.csproj | 6 +- .../Presenter/ChartPresenter.cs | 90 +++++++++++++++++-- .../Presenter/ComparisonChartPresenter.cs | 5 +- .../Presenter/EditSimulationPresenter.cs | 70 ++++++++++++++- .../Presenter/SimulationChartPresenter.cs | 5 +- .../Views/IEditSimulationView.cs | 4 +- src/MoBi.UI/MoBi.UI.csproj | 10 +-- .../EditSimulationView.Designer.cs | 53 +++++------ .../SimulationView/EditSimulationView.cs | 7 +- src/MoBi/MoBi.csproj | 4 +- tests/MoBi.Tests/MoBi.Tests.csproj | 8 +- .../EditSimulationPresenterSpecs.cs | 7 +- tests/MoBi.UI.Tests/MoBi.UI.Tests.csproj | 4 +- 17 files changed, 218 insertions(+), 81 deletions(-) diff --git a/src/MoBi.Assets/MoBi.Assets.csproj b/src/MoBi.Assets/MoBi.Assets.csproj index 7c7f7e4a4..d31f14c40 100644 --- a/src/MoBi.Assets/MoBi.Assets.csproj +++ b/src/MoBi.Assets/MoBi.Assets.csproj @@ -26,9 +26,9 @@ - - - + + + diff --git a/src/MoBi.BatchTool/MoBi.BatchTool.csproj b/src/MoBi.BatchTool/MoBi.BatchTool.csproj index 84c58adcf..042f659ba 100644 --- a/src/MoBi.BatchTool/MoBi.BatchTool.csproj +++ b/src/MoBi.BatchTool/MoBi.BatchTool.csproj @@ -60,7 +60,7 @@ - + diff --git a/src/MoBi.Core/MoBi.Core.csproj b/src/MoBi.Core/MoBi.Core.csproj index 7a91fd4e1..1cae88617 100644 --- a/src/MoBi.Core/MoBi.Core.csproj +++ b/src/MoBi.Core/MoBi.Core.csproj @@ -32,13 +32,13 @@ - - - - - - - + + + + + + + diff --git a/src/MoBi.Engine/MoBi.Engine.csproj b/src/MoBi.Engine/MoBi.Engine.csproj index 4e882cbae..d29fc4ad7 100644 --- a/src/MoBi.Engine/MoBi.Engine.csproj +++ b/src/MoBi.Engine/MoBi.Engine.csproj @@ -32,8 +32,8 @@ - - + + diff --git a/src/MoBi.Presentation/MoBi.Presentation.csproj b/src/MoBi.Presentation/MoBi.Presentation.csproj index 6572b6a92..71b4a3aa5 100644 --- a/src/MoBi.Presentation/MoBi.Presentation.csproj +++ b/src/MoBi.Presentation/MoBi.Presentation.csproj @@ -28,9 +28,9 @@ - - - + + + diff --git a/src/MoBi.Presentation/Presenter/ChartPresenter.cs b/src/MoBi.Presentation/Presenter/ChartPresenter.cs index 79c172357..58e72c66b 100644 --- a/src/MoBi.Presentation/Presenter/ChartPresenter.cs +++ b/src/MoBi.Presentation/Presenter/ChartPresenter.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Linq; using MoBi.Assets; using MoBi.Core.Domain.Extensions; @@ -10,6 +11,8 @@ using OSPSuite.Core.Chart; using OSPSuite.Core.Domain; using OSPSuite.Core.Domain.Data; +using OSPSuite.Core.Domain.ParameterIdentifications; +using OSPSuite.Core.Domain.Services; using OSPSuite.Core.Events; using OSPSuite.Presentation.Binders; using OSPSuite.Presentation.Core; @@ -25,6 +28,11 @@ namespace MoBi.Presentation.Presenter { + public class ObservedDataAddedToChartEventArgs : EventArgs + { + public IReadOnlyList AddedDataRepositories { get; set; } + } + /// /// Aggregates the presenters needed to show a chart /// @@ -49,10 +57,13 @@ public interface IChartPresenter : IPresenter, void Show(CurveChart chart, IReadOnlyList dataRepositories, CurveChartTemplate defaultTemplate = null); void UpdateTemplatesFor(IWithChartTemplates withChartTemplates); + event EventHandler OnObservedDataAddedToChart; } public abstract class ChartPresenter : ChartPresenter, IChartPresenter { + public event EventHandler OnObservedDataAddedToChart = delegate { }; + protected readonly IMoBiContext _context; private readonly IUserSettings _userSettings; private readonly IChartUpdater _chartUpdater; @@ -64,9 +75,10 @@ public abstract class ChartPresenter : ChartPresenter _chartPresenterContext.DisplayPresenter; private IChartEditorPresenter editorPresenter => _chartPresenterContext.EditorPresenter; + private readonly IEntitiesInSimulationRetriever _entitiesInSimulationRetriever; protected ChartPresenter(IChartView chartView, ChartPresenterContext chartPresenterContext, IMoBiContext context, IUserSettings userSettings, - IChartTemplatingTask chartTemplatingTask, IChartUpdater chartUpdater) : + IChartTemplatingTask chartTemplatingTask, IChartUpdater chartUpdater, IEntitiesInSimulationRetriever entitiesInSimulationRetriever) : base(chartView, chartPresenterContext) { _chartUpdater = chartUpdater; @@ -85,6 +97,7 @@ protected ChartPresenter(IChartView chartView, ChartPresenterContext chartPresen initEditorPresenterSettings(); _observedDataDragDropBinder = new ObservedDataDragDropBinder(); + _entitiesInSimulationRetriever = entitiesInSimulationRetriever; AddSubPresenters(chartPresenterContext.EditorAndDisplayPresenter); } @@ -157,7 +170,8 @@ private void initLayout() protected void LoadFromTemplate(CurveChartTemplate chartTemplate, bool triggeredManually, bool propagateChartChangeEvent = true) { - _chartTemplatingTask.InitFromTemplate(_dataRepositoryCache, Chart, editorPresenter, chartTemplate, CurveNameDefinition, triggeredManually, propagateChartChangeEvent); + _chartTemplatingTask.InitFromTemplate(_dataRepositoryCache, Chart, editorPresenter, chartTemplate, CurveNameDefinition, triggeredManually, + propagateChartChangeEvent); } protected virtual void OnDragOver(object sender, IDragEvent e) @@ -229,6 +243,22 @@ private void addObservedData(IReadOnlyList repositories) { editorPresenter.AddDataRepositories(repositories); repositories.SelectMany(x => x.ObservationColumns()).Each(observationColumn => editorPresenter.AddCurveForColumn(observationColumn)); + /* + foreach (var dataRepository in repositories) + { + var simulation = findSimulation(dataRepository) ?? findHistoricSimulation(dataRepository); + if (simulation == null) return; + + _dataRepositoryCache.Add(dataRepository, simulation); + var newOutputMapping = mapMatchingOutput(dataRepository, simulation); + + if (newOutputMapping.Output != null) + simulation.OutputMappings.Add(newOutputMapping); + _context.PublishEvent(new ObservedDataAddedToAnalysableEvent(simulation, dataRepository, false)); + + }*/ + + OnObservedDataAddedToChart(this, new ObservedDataAddedToChartEventArgs() { AddedDataRepositories = repositories }); _chartPresenterContext.Refresh(); } @@ -279,13 +309,61 @@ public virtual void UpdateTemplatesFor(IWithChartTemplates withChartTemplates) private void addDataRepositoriesToDataRepositoryCache(IReadOnlyCollection dataRepositories) { + //OK here is the place we actually need to add the outputMappings.... + //it is the correct place, so we will do this, regardless of whether this will actually do + //result in duplication dataRepositories.Where(dataRepository => !_dataRepositoryCache.Contains(dataRepository)) .Each(dataRepository => { var simulation = findSimulation(dataRepository) ?? findHistoricSimulation(dataRepository); - if (simulation != null) - _dataRepositoryCache.Add(dataRepository, simulation); + if (simulation == null) return; + + _dataRepositoryCache.Add(dataRepository, simulation); + var newOutputMapping = mapMatchingOutput(dataRepository, simulation); + + if (newOutputMapping.Output != null) + simulation.OutputMappings.Add(newOutputMapping); + _context.PublishEvent(new ObservedDataAddedToAnalysableEvent(simulation, dataRepository, false)); }); + ; + } + + private OutputMapping mapMatchingOutput(DataRepository observedData, ISimulation simulation) + { + var newOutputMapping = new OutputMapping(); + var pathCache = _entitiesInSimulationRetriever.OutputsFrom(simulation); + var matchingOutputPath = pathCache.Keys.FirstOrDefault(x => observedDataMatchesOutput(observedData, x)); + + if (matchingOutputPath == null) + { + newOutputMapping.WeightedObservedData = new WeightedObservedData(observedData); + return newOutputMapping; + } + + var matchingOutput = pathCache[matchingOutputPath]; + + newOutputMapping.OutputSelection = + new SimulationQuantitySelection(simulation, new QuantitySelection(matchingOutputPath, matchingOutput.QuantityType)); + newOutputMapping.WeightedObservedData = new WeightedObservedData(observedData); + newOutputMapping.Scaling = defaultScalingFor(matchingOutput); + return newOutputMapping; + } + + private Scalings defaultScalingFor(IQuantity output) + { + return output.IsFraction() ? Scalings.Linear : Scalings.Log; + } + + private bool observedDataMatchesOutput(DataRepository observedData, string outputPath) + { + var organ = observedData.ExtendedPropertyValueFor(Constants.ObservedData.ORGAN); + var compartment = observedData.ExtendedPropertyValueFor(Constants.ObservedData.COMPARTMENT); + var molecule = observedData.ExtendedPropertyValueFor(Constants.ObservedData.MOLECULE); + + if (organ == null || compartment == null || molecule == null) + return false; + + return outputPath.Contains(organ) && outputPath.Contains(compartment) && outputPath.Contains(molecule); } private IMoBiSimulation findSimulation(DataRepository dataRepository) @@ -316,7 +394,7 @@ private void replaceSimulationRepositories(IReadOnlyCollection d public void Handle(ObservedDataRemovedEvent eventToHandle) { var dataRepository = eventToHandle.DataRepository; - editorPresenter.RemoveDataRepositories(new[] {dataRepository}); + editorPresenter.RemoveDataRepositories(new[] { dataRepository }); displayPresenter.Refresh(); } diff --git a/src/MoBi.Presentation/Presenter/ComparisonChartPresenter.cs b/src/MoBi.Presentation/Presenter/ComparisonChartPresenter.cs index b325a2d33..95500a99e 100644 --- a/src/MoBi.Presentation/Presenter/ComparisonChartPresenter.cs +++ b/src/MoBi.Presentation/Presenter/ComparisonChartPresenter.cs @@ -4,6 +4,7 @@ using OSPSuite.Core.Chart; using OSPSuite.Core.Domain.Data; using OSPSuite.Core.Domain.Mappers; +using OSPSuite.Core.Domain.Services; using OSPSuite.Presentation.Services.Charts; using IChartTemplatingTask = MoBi.Presentation.Tasks.IChartTemplatingTask; @@ -17,8 +18,8 @@ public class ComparisonChartPresenter : ChartPresenter, IComparisonChartPresente { private readonly IQuantityPathToQuantityDisplayPathMapper _quantityDisplayPathMapper; - public ComparisonChartPresenter(IChartView chartView, IMoBiContext context, IUserSettings userSettings, IChartTemplatingTask chartTemplatingTask, IQuantityPathToQuantityDisplayPathMapper quantityDisplayPathMapper, IChartUpdater chartUpdater, ChartPresenterContext chartPresenterContext) : - base(chartView, chartPresenterContext, context, userSettings, chartTemplatingTask, chartUpdater) + public ComparisonChartPresenter(IChartView chartView, IMoBiContext context, IUserSettings userSettings, IChartTemplatingTask chartTemplatingTask, IQuantityPathToQuantityDisplayPathMapper quantityDisplayPathMapper, IChartUpdater chartUpdater, ChartPresenterContext chartPresenterContext, IEntitiesInSimulationRetriever entitiesInSimulationRetriever) : + base(chartView, chartPresenterContext, context, userSettings, chartTemplatingTask, chartUpdater, entitiesInSimulationRetriever) { _quantityDisplayPathMapper = quantityDisplayPathMapper; } diff --git a/src/MoBi.Presentation/Presenter/EditSimulationPresenter.cs b/src/MoBi.Presentation/Presenter/EditSimulationPresenter.cs index 6254eae52..635743573 100644 --- a/src/MoBi.Presentation/Presenter/EditSimulationPresenter.cs +++ b/src/MoBi.Presentation/Presenter/EditSimulationPresenter.cs @@ -13,6 +13,9 @@ using OSPSuite.Core.Chart.Simulations; using OSPSuite.Core.Domain; using OSPSuite.Core.Domain.Data; +using OSPSuite.Core.Domain.ParameterIdentifications; +using OSPSuite.Core.Domain.Services; +using OSPSuite.Core.Events; using OSPSuite.Core.Services; using OSPSuite.Presentation.Presenters; using OSPSuite.Utility.Collections; @@ -53,7 +56,9 @@ public class EditSimulationPresenter : SingleStartPresenter { OnMissingKey = x => null }; + _chartPresenter.OnObservedDataAddedToChart += onObservedDataAddedToChart; + _context = context; + _entitiesInSimulationRetriever = entitiesInSimulationRetriever; } public string CreateResultTabCaption(string chartName) @@ -181,7 +189,7 @@ private void loadChart() addObservedDataRepositories(data, _simulation.Chart.Curves); _simulationPredictedVsObservedChartPresenter.UpdateAnalysisBasedOn(_simulation); _simulationResidualVsTimeChartPresenter.UpdateAnalysisBasedOn(_simulation); - _chartPresenter.Show(_simulation.Chart, data, defaultTemplate); + _chartPresenter.Show(_simulation.Chart, data, defaultTemplate); //MyComm: HERE it is this presenters that knows about the simulation and should be handling this. } public void Handle(SimulationRunFinishedEvent eventToHandle) @@ -312,5 +320,63 @@ private bool canHandle(IObjectBaseEvent objectBaseEvent) { return Equals(_simulation, objectBaseEvent.ObjectBase); } + + private void onObservedDataAddedToChart(object sender, ObservedDataAddedToChartEventArgs e) + { + foreach (var dataRepository in e.AddedDataRepositories) + { + var newOutputMapping = mapMatchingOutput(dataRepository, _simulation); + + if (newOutputMapping.Output != null) + _simulation.OutputMappings.Add(newOutputMapping); + _context.PublishEvent(new ObservedDataAddedToAnalysableEvent(_simulation, dataRepository, false)); + + } + } + + private OutputMapping mapMatchingOutput(DataRepository observedData, ISimulation simulation) + { + var newOutputMapping = new OutputMapping(); + var pathCache = _entitiesInSimulationRetriever.OutputsFrom(simulation); + var matchingOutputPath = pathCache.Keys.FirstOrDefault(x => observedDataMatchesOutput(observedData, x)); + + if (matchingOutputPath == null) + { + newOutputMapping.WeightedObservedData = new WeightedObservedData(observedData); + return newOutputMapping; + } + + var matchingOutput = pathCache[matchingOutputPath]; + + newOutputMapping.OutputSelection = + new SimulationQuantitySelection(simulation, new QuantitySelection(matchingOutputPath, matchingOutput.QuantityType)); + newOutputMapping.WeightedObservedData = new WeightedObservedData(observedData); + newOutputMapping.Scaling = defaultScalingFor(matchingOutput); + return newOutputMapping; + } + + private Scalings defaultScalingFor(IQuantity output) + { + return output.IsFraction() ? Scalings.Linear : Scalings.Log; + } + + private bool observedDataMatchesOutput(DataRepository observedData, string outputPath) + { + var organ = observedData.ExtendedPropertyValueFor(Constants.ObservedData.ORGAN); + var compartment = observedData.ExtendedPropertyValueFor(Constants.ObservedData.COMPARTMENT); + var molecule = observedData.ExtendedPropertyValueFor(Constants.ObservedData.MOLECULE); + + if (organ == null || compartment == null || molecule == null) + return false; + + return outputPath.Contains(organ) && outputPath.Contains(compartment) && outputPath.Contains(molecule); + } + + private IMoBiSimulation findSimulation(DataRepository dataRepository) + { + return _context.CurrentProject.Simulations + .FirstOrDefault(simulation => Equals(simulation.ResultsDataRepository, dataRepository)); + } + } } \ No newline at end of file diff --git a/src/MoBi.Presentation/Presenter/SimulationChartPresenter.cs b/src/MoBi.Presentation/Presenter/SimulationChartPresenter.cs index e6368dc47..c496e2c87 100644 --- a/src/MoBi.Presentation/Presenter/SimulationChartPresenter.cs +++ b/src/MoBi.Presentation/Presenter/SimulationChartPresenter.cs @@ -3,6 +3,7 @@ using MoBi.Presentation.Views; using OSPSuite.Core.Chart; using OSPSuite.Core.Domain.Data; +using OSPSuite.Core.Domain.Services; using OSPSuite.Core.Services; using OSPSuite.Presentation.Services.Charts; using OSPSuite.Utility.Extensions; @@ -18,8 +19,8 @@ public class SimulationChartPresenter : ChartPresenter, ISimulationChartPresente { private readonly ICurveNamer _curveNamer; - public SimulationChartPresenter(IChartView chartView, IMoBiContext context, IUserSettings userSettings, IChartTemplatingTask chartTemplatingTask, ICurveNamer curveNamer, IChartUpdater chartUpdater, ChartPresenterContext chartPresenterContext) - : base(chartView, chartPresenterContext, context, userSettings, chartTemplatingTask, chartUpdater) + public SimulationChartPresenter(IChartView chartView, IMoBiContext context, IUserSettings userSettings, IChartTemplatingTask chartTemplatingTask, ICurveNamer curveNamer, IChartUpdater chartUpdater, ChartPresenterContext chartPresenterContext, IEntitiesInSimulationRetriever entitiesInSimulationRetriever) + : base(chartView, chartPresenterContext, context, userSettings, chartTemplatingTask, chartUpdater, entitiesInSimulationRetriever) { _curveNamer = curveNamer; } diff --git a/src/MoBi.Presentation/Views/IEditSimulationView.cs b/src/MoBi.Presentation/Views/IEditSimulationView.cs index 6f1c88c2c..1ece0fe84 100644 --- a/src/MoBi.Presentation/Views/IEditSimulationView.cs +++ b/src/MoBi.Presentation/Views/IEditSimulationView.cs @@ -26,7 +26,7 @@ public interface IEditSimulationView : IMdiChildView /// void SetDataView(ISimulationOutputMappingView view); - void SetPredictedVsObservedView(ISimulationRunAnalysisView view); - void SetResidualsVsTimeView(ISimulationRunAnalysisView view); + void SetPredictedVsObservedView(ISimulationVsObservedDataView view); + void SetResidualsVsTimeView(ISimulationVsObservedDataView view); } } \ No newline at end of file diff --git a/src/MoBi.UI/MoBi.UI.csproj b/src/MoBi.UI/MoBi.UI.csproj index c66defbfe..6aa8a7aeb 100644 --- a/src/MoBi.UI/MoBi.UI.csproj +++ b/src/MoBi.UI/MoBi.UI.csproj @@ -27,12 +27,12 @@ - - - - + + + + - + diff --git a/src/MoBi.UI/Views/SimulationView/EditSimulationView.Designer.cs b/src/MoBi.UI/Views/SimulationView/EditSimulationView.Designer.cs index 499f2b9fe..776b1da77 100644 --- a/src/MoBi.UI/Views/SimulationView/EditSimulationView.Designer.cs +++ b/src/MoBi.UI/Views/SimulationView/EditSimulationView.Designer.cs @@ -40,15 +40,14 @@ private void InitializeComponent() this.tabDiagram = new DevExpress.XtraTab.XtraTabPage(); this.spliterDiagram = new DevExpress.XtraEditors.SplitContainerControl(); this.modelOverview = new Northwoods.Go.GoOverview(); - this.tabData = new DevExpress.XtraTab.XtraTabPage(); this.tabResults = new DevExpress.XtraTab.XtraTabPage(); this.plotTabs = new DevExpress.XtraTab.XtraTabControl(); - this.tabTimeProfile = new DevExpress.XtraTab.XtraTabPage(); + this.tabData = new DevExpress.XtraTab.XtraTabPage(); this.tabPredVsObs = new DevExpress.XtraTab.XtraTabPage(); + this.tabResidVsTime = new DevExpress.XtraTab.XtraTabPage(); this.xtraTabPage2 = new DevExpress.XtraTab.XtraTabPage(); this.xtraTabPage1 = new DevExpress.XtraTab.XtraTabPage(); this.xtraTabControl1 = new DevExpress.XtraTab.XtraTabControl(); - this.tabResidVsTime = new DevExpress.XtraTab.XtraTabPage(); ((System.ComponentModel.ISupportInitialize)(this._errorProvider)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.tabs)).BeginInit(); this.tabs.SuspendLayout(); @@ -68,7 +67,6 @@ private void InitializeComponent() this.spliterDiagram.SuspendLayout(); this.tabResults.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.plotTabs)).BeginInit(); - this.plotTabs.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.xtraTabControl1)).BeginInit(); this.xtraTabControl1.SuspendLayout(); this.SuspendLayout(); @@ -84,7 +82,10 @@ private void InitializeComponent() this.tabs.TabIndex = 0; this.tabs.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[] { this.tabSimulation, - this.tabResults}); + this.tabResults, + this.tabData, + this.tabPredVsObs, + this.tabResidVsTime}); // // tabSimulation // @@ -126,8 +127,7 @@ private void InitializeComponent() this.tabsNavigation.TabIndex = 0; this.tabsNavigation.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[] { this.tabTree, - this.tabDiagram, - this.tabData}); + this.tabDiagram}); // // tabTree // @@ -187,12 +187,6 @@ private void InitializeComponent() this.modelOverview.TabIndex = 0; this.modelOverview.Text = "modelOverview"; // - // tabData - // - this.tabData.Name = "tabData"; - this.tabData.Size = new System.Drawing.Size(639, 865); - this.tabData.Text = "tabData"; - // // tabResults // this.tabResults.Controls.Add(this.plotTabs); @@ -206,26 +200,27 @@ private void InitializeComponent() this.plotTabs.Dock = System.Windows.Forms.DockStyle.Fill; this.plotTabs.Location = new System.Drawing.Point(0, 0); this.plotTabs.Name = "plotTabs"; - this.plotTabs.SelectedTabPage = this.tabTimeProfile; this.plotTabs.Size = new System.Drawing.Size(1286, 926); this.plotTabs.TabIndex = 0; - this.plotTabs.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[] { - this.tabTimeProfile, - this.tabPredVsObs, - this.tabResidVsTime}); // - // tabTimeProfile + // tabData // - this.tabTimeProfile.Name = "tabTimeProfile"; - this.tabTimeProfile.Size = new System.Drawing.Size(1282, 865); - this.tabTimeProfile.Text = "tabTimeProfile"; + this.tabData.Name = "tabData"; + this.tabData.Size = new System.Drawing.Size(1286, 926); + this.tabData.Text = "tabData"; // // tabPredVsObs // this.tabPredVsObs.Name = "tabPredVsObs"; - this.tabPredVsObs.Size = new System.Drawing.Size(1282, 865); + this.tabPredVsObs.Size = new System.Drawing.Size(1286, 926); this.tabPredVsObs.Text = "tabPredVsObs"; // + // tabResidVsTime + // + this.tabResidVsTime.Name = "tabResidVsTime"; + this.tabResidVsTime.Size = new System.Drawing.Size(1286, 926); + this.tabResidVsTime.Text = "tabResidVsTime"; + // // xtraTabPage2 // this.xtraTabPage2.Name = "xtraTabPage2"; @@ -249,12 +244,6 @@ private void InitializeComponent() this.xtraTabPage1, this.xtraTabPage2}); // - // tabResidVsTime - // - this.tabResidVsTime.Name = "tabResidVsTime"; - this.tabResidVsTime.Size = new System.Drawing.Size(1282, 865); - this.tabResidVsTime.Text = "tabResidVsTime"; - // // EditSimulationView // this.AutoScaleDimensions = new System.Drawing.SizeF(15F, 33F); @@ -282,7 +271,6 @@ private void InitializeComponent() this.spliterDiagram.ResumeLayout(false); this.tabResults.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.plotTabs)).EndInit(); - this.plotTabs.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.xtraTabControl1)).EndInit(); this.xtraTabControl1.ResumeLayout(false); this.ResumeLayout(false); @@ -300,13 +288,12 @@ private void InitializeComponent() private DevExpress.XtraTab.XtraTabPage tabDiagram; private SplitContainerControl spliterDiagram; private Northwoods.Go.GoOverview modelOverview; - private DevExpress.XtraTab.XtraTabPage tabData; private DevExpress.XtraTab.XtraTabControl plotTabs; - private DevExpress.XtraTab.XtraTabPage tabTimeProfile; - private DevExpress.XtraTab.XtraTabPage tabPredVsObs; private DevExpress.XtraTab.XtraTabPage xtraTabPage2; private DevExpress.XtraTab.XtraTabPage xtraTabPage1; private DevExpress.XtraTab.XtraTabControl xtraTabControl1; + private DevExpress.XtraTab.XtraTabPage tabData; + private DevExpress.XtraTab.XtraTabPage tabPredVsObs; private DevExpress.XtraTab.XtraTabPage tabResidVsTime; } } diff --git a/src/MoBi.UI/Views/SimulationView/EditSimulationView.cs b/src/MoBi.UI/Views/SimulationView/EditSimulationView.cs index d90dc7be6..bc0b37481 100644 --- a/src/MoBi.UI/Views/SimulationView/EditSimulationView.cs +++ b/src/MoBi.UI/Views/SimulationView/EditSimulationView.cs @@ -39,7 +39,6 @@ public override void InitializeResources() tabSimulation.InitWith(AppConstants.Captions.SimulationParameters, ApplicationIcons.Parameter); tabResults.InitWith(AppConstants.Captions.Results, ApplicationIcons.TimeProfileAnalysis); tabData.InitWith(AppConstants.Captions.SimulationData, ApplicationIcons.PKSim); - tabTimeProfile.InitWith(AppConstants.Captions.TimeProfile, ApplicationIcons.TimeProfileAnalysis); tabPredVsObs.InitWith(AppConstants.Captions.PredictedVsObserved, ApplicationIcons.PredictedVsObservedAnalysis); tabResidVsTime.InitWith(AppConstants.Captions.ResidualsVsTime, ApplicationIcons.ResidualVsTimeAnalysis); @@ -74,7 +73,7 @@ public void SetDataView(ISimulationOutputMappingView view) public void SetChartView(IChartView chartView) { chartView.CaptionChanged += (o, e) => OnEvent(() => tabResults.Text = simulationPresenter.CreateResultTabCaption(chartView.Caption)); - tabTimeProfile.FillWith(chartView); + tabResults.FillWith(chartView); } public void SetModelDiagram(ISimulationDiagramView subView) @@ -90,12 +89,12 @@ public void ShowResultsTab() tabs.SelectedTabPage = tabResults; } - public void SetPredictedVsObservedView(ISimulationRunAnalysisView view) + public void SetPredictedVsObservedView(ISimulationVsObservedDataView view) { tabPredVsObs.FillWith(view); } - public void SetResidualsVsTimeView(ISimulationRunAnalysisView view) + public void SetResidualsVsTimeView(ISimulationVsObservedDataView view) { tabResidVsTime.FillWith(view); } diff --git a/src/MoBi/MoBi.csproj b/src/MoBi/MoBi.csproj index 4a40486c5..376d75831 100644 --- a/src/MoBi/MoBi.csproj +++ b/src/MoBi/MoBi.csproj @@ -71,13 +71,13 @@ - + - + diff --git a/tests/MoBi.Tests/MoBi.Tests.csproj b/tests/MoBi.Tests/MoBi.Tests.csproj index d6a8372e0..ba5b19aa4 100644 --- a/tests/MoBi.Tests/MoBi.Tests.csproj +++ b/tests/MoBi.Tests/MoBi.Tests.csproj @@ -45,10 +45,10 @@ - - - - + + + + diff --git a/tests/MoBi.Tests/Presentation/EditSimulationPresenterSpecs.cs b/tests/MoBi.Tests/Presentation/EditSimulationPresenterSpecs.cs index 22e565009..0bcdd32eb 100644 --- a/tests/MoBi.Tests/Presentation/EditSimulationPresenterSpecs.cs +++ b/tests/MoBi.Tests/Presentation/EditSimulationPresenterSpecs.cs @@ -12,6 +12,7 @@ using OSPSuite.Core.Chart; using OSPSuite.Core.Domain; using OSPSuite.Core.Domain.Data; +using OSPSuite.Core.Domain.Services; using OSPSuite.Core.Domain.UnitSystem; using OSPSuite.Presentation.Presenters; using OSPSuite.Presentation.Views; @@ -33,6 +34,8 @@ public abstract class concern_for_EditSimulationPresenter : ContextSpecification protected IChartTasks _chartTasks; protected IUserDefinedParametersPresenter _userDefinedParametersPresenter; protected ISimulationOutputMappingPresenter _simulationOutputMappingPresenter; + protected IMoBiContext _context; + protected IEntitiesInSimulationRetriever _entitiesInSimulationRetriever; protected override void Context() { @@ -49,11 +52,13 @@ protected override void Context() _chartTasks = A.Fake(); _simulationOutputMappingPresenter = A.Fake(); _userDefinedParametersPresenter = A.Fake(); + _context = A.Fake(); + _entitiesInSimulationRetriever = A.Fake(); sut = new EditSimulationPresenter(_view, _chartPresenter, _hierarchicalSimulationPresenter, _diagramPresenter, _solverSettings, _outputSchemaPresenter, _presenterFactory, new HeavyWorkManagerForSpecs(), A.Fake(), _editFavoritePresenter, _chartTasks, _userDefinedParametersPresenter, _simulationOutputMappingPresenter, - _simulationPredictedVsObservedChartPresenter, _simulationResidualVsTimeChartPresenter); + _simulationPredictedVsObservedChartPresenter, _simulationResidualVsTimeChartPresenter, _context, _entitiesInSimulationRetriever); } } diff --git a/tests/MoBi.UI.Tests/MoBi.UI.Tests.csproj b/tests/MoBi.UI.Tests/MoBi.UI.Tests.csproj index bb403a1d7..52a12a4ba 100644 --- a/tests/MoBi.UI.Tests/MoBi.UI.Tests.csproj +++ b/tests/MoBi.UI.Tests/MoBi.UI.Tests.csproj @@ -17,8 +17,8 @@ - - + + From 7d8023f242c5e62dbc28e4e878dda2d82252248f Mon Sep 17 00:00:00 2001 From: georgeDaskalakis <37107428+georgeDaskalakis@users.noreply.github.com> Date: Thu, 20 Oct 2022 16:32:11 +0200 Subject: [PATCH 10/18] corrections --- src/MoBi.Core/Domain/Model/MoBiSimulation.cs | 3 +-- .../Presenter/ChartPresenter.cs | 18 ------------------ .../Presenter/EditSimulationPresenter.cs | 3 +-- 3 files changed, 2 insertions(+), 22 deletions(-) diff --git a/src/MoBi.Core/Domain/Model/MoBiSimulation.cs b/src/MoBi.Core/Domain/Model/MoBiSimulation.cs index 7153e15c5..01da5dfcf 100644 --- a/src/MoBi.Core/Domain/Model/MoBiSimulation.cs +++ b/src/MoBi.Core/Domain/Model/MoBiSimulation.cs @@ -13,8 +13,7 @@ namespace MoBi.Core.Domain.Model { public interface IMoBiSimulation : IWithDiagramFor, ISimulation, IWithChartTemplates - { - //DataRepository ResultsDataRepository { get; set; } + { ICache HistoricResults { get; } CurveChart Chart { get; set; } IMoBiBuildConfiguration MoBiBuildConfiguration { get; } diff --git a/src/MoBi.Presentation/Presenter/ChartPresenter.cs b/src/MoBi.Presentation/Presenter/ChartPresenter.cs index 58e72c66b..5f1b98b87 100644 --- a/src/MoBi.Presentation/Presenter/ChartPresenter.cs +++ b/src/MoBi.Presentation/Presenter/ChartPresenter.cs @@ -243,21 +243,6 @@ private void addObservedData(IReadOnlyList repositories) { editorPresenter.AddDataRepositories(repositories); repositories.SelectMany(x => x.ObservationColumns()).Each(observationColumn => editorPresenter.AddCurveForColumn(observationColumn)); - /* - foreach (var dataRepository in repositories) - { - var simulation = findSimulation(dataRepository) ?? findHistoricSimulation(dataRepository); - if (simulation == null) return; - - _dataRepositoryCache.Add(dataRepository, simulation); - var newOutputMapping = mapMatchingOutput(dataRepository, simulation); - - if (newOutputMapping.Output != null) - simulation.OutputMappings.Add(newOutputMapping); - _context.PublishEvent(new ObservedDataAddedToAnalysableEvent(simulation, dataRepository, false)); - - }*/ - OnObservedDataAddedToChart(this, new ObservedDataAddedToChartEventArgs() { AddedDataRepositories = repositories }); _chartPresenterContext.Refresh(); } @@ -309,9 +294,6 @@ public virtual void UpdateTemplatesFor(IWithChartTemplates withChartTemplates) private void addDataRepositoriesToDataRepositoryCache(IReadOnlyCollection dataRepositories) { - //OK here is the place we actually need to add the outputMappings.... - //it is the correct place, so we will do this, regardless of whether this will actually do - //result in duplication dataRepositories.Where(dataRepository => !_dataRepositoryCache.Contains(dataRepository)) .Each(dataRepository => { diff --git a/src/MoBi.Presentation/Presenter/EditSimulationPresenter.cs b/src/MoBi.Presentation/Presenter/EditSimulationPresenter.cs index 635743573..4a573a066 100644 --- a/src/MoBi.Presentation/Presenter/EditSimulationPresenter.cs +++ b/src/MoBi.Presentation/Presenter/EditSimulationPresenter.cs @@ -156,7 +156,6 @@ public override void Edit(object subject) public override object Subject => _simulation; private void loadChart() { - //probably have to rename to charts if (_simulationPredictedVsObservedChartPresenter.Chart == null) { var chart = _chartFactory.Create(); @@ -189,7 +188,7 @@ private void loadChart() addObservedDataRepositories(data, _simulation.Chart.Curves); _simulationPredictedVsObservedChartPresenter.UpdateAnalysisBasedOn(_simulation); _simulationResidualVsTimeChartPresenter.UpdateAnalysisBasedOn(_simulation); - _chartPresenter.Show(_simulation.Chart, data, defaultTemplate); //MyComm: HERE it is this presenters that knows about the simulation and should be handling this. + _chartPresenter.Show(_simulation.Chart, data, defaultTemplate); } public void Handle(SimulationRunFinishedEvent eventToHandle) From bbff4410f89e3fc12ace7f2c2c69585a5d6adfbf Mon Sep 17 00:00:00 2001 From: georgeDaskalakis <37107428+georgeDaskalakis@users.noreply.github.com> Date: Sun, 23 Oct 2022 12:08:18 +0200 Subject: [PATCH 11/18] plugging in OutputMappingMatching service --- src/MoBi.Assets/AppConstants.cs | 2 - src/MoBi.Assets/MoBi.Assets.csproj | 6 +-- src/MoBi.BatchTool/MoBi.BatchTool.csproj | 2 +- src/MoBi.Core/MoBi.Core.csproj | 14 +++--- src/MoBi.Engine/MoBi.Engine.csproj | 4 +- .../MoBi.Presentation.csproj | 6 +-- .../Presenter/ChartPresenter.cs | 49 ++----------------- .../Presenter/ComparisonChartPresenter.cs | 5 +- .../Presenter/EditSimulationPresenter.cs | 12 +++-- .../Presenter/SimulationChartPresenter.cs | 4 +- src/MoBi.UI/MoBi.UI.csproj | 10 ++-- .../SimulationView/EditSimulationView.cs | 4 +- src/MoBi/MoBi.csproj | 4 +- tests/MoBi.Tests/MoBi.Tests.csproj | 8 +-- tests/MoBi.UI.Tests/MoBi.UI.Tests.csproj | 4 +- 15 files changed, 48 insertions(+), 86 deletions(-) diff --git a/src/MoBi.Assets/AppConstants.cs b/src/MoBi.Assets/AppConstants.cs index b1ba41dd1..1d3948366 100644 --- a/src/MoBi.Assets/AppConstants.cs +++ b/src/MoBi.Assets/AppConstants.cs @@ -1424,8 +1424,6 @@ public static class Captions public static readonly string SimulationParameters = "Parameters"; public static readonly string Results = "Results"; public static readonly string TimeProfile = "Time Profile"; - public static readonly string PredictedVsObserved = "Predicted vs Observed"; - public static readonly string ResidualsVsTime = "Residuals vs Time"; public static readonly string SimulationData = "Data"; public static readonly string IsStationary = "Stationary"; public static readonly string DefaultStartAmount = "Amount"; diff --git a/src/MoBi.Assets/MoBi.Assets.csproj b/src/MoBi.Assets/MoBi.Assets.csproj index 6c346dd95..c9b0fc7ca 100644 --- a/src/MoBi.Assets/MoBi.Assets.csproj +++ b/src/MoBi.Assets/MoBi.Assets.csproj @@ -26,9 +26,9 @@ - - - + + + diff --git a/src/MoBi.BatchTool/MoBi.BatchTool.csproj b/src/MoBi.BatchTool/MoBi.BatchTool.csproj index fc417c9c0..432ca7dda 100644 --- a/src/MoBi.BatchTool/MoBi.BatchTool.csproj +++ b/src/MoBi.BatchTool/MoBi.BatchTool.csproj @@ -60,7 +60,7 @@ - + diff --git a/src/MoBi.Core/MoBi.Core.csproj b/src/MoBi.Core/MoBi.Core.csproj index 30848021a..49bc82920 100644 --- a/src/MoBi.Core/MoBi.Core.csproj +++ b/src/MoBi.Core/MoBi.Core.csproj @@ -32,13 +32,13 @@ - - - - - - - + + + + + + + diff --git a/src/MoBi.Engine/MoBi.Engine.csproj b/src/MoBi.Engine/MoBi.Engine.csproj index 5ee43e447..68f4ca163 100644 --- a/src/MoBi.Engine/MoBi.Engine.csproj +++ b/src/MoBi.Engine/MoBi.Engine.csproj @@ -32,8 +32,8 @@ - - + + diff --git a/src/MoBi.Presentation/MoBi.Presentation.csproj b/src/MoBi.Presentation/MoBi.Presentation.csproj index 367f47b05..32e2e6a00 100644 --- a/src/MoBi.Presentation/MoBi.Presentation.csproj +++ b/src/MoBi.Presentation/MoBi.Presentation.csproj @@ -28,9 +28,9 @@ - - - + + + diff --git a/src/MoBi.Presentation/Presenter/ChartPresenter.cs b/src/MoBi.Presentation/Presenter/ChartPresenter.cs index 5f1b98b87..d4d1f46aa 100644 --- a/src/MoBi.Presentation/Presenter/ChartPresenter.cs +++ b/src/MoBi.Presentation/Presenter/ChartPresenter.cs @@ -14,6 +14,7 @@ using OSPSuite.Core.Domain.ParameterIdentifications; using OSPSuite.Core.Domain.Services; using OSPSuite.Core.Events; +using OSPSuite.Core.Services; using OSPSuite.Presentation.Binders; using OSPSuite.Presentation.Core; using OSPSuite.Presentation.MenuAndBars; @@ -70,15 +71,15 @@ public abstract class ChartPresenter : ChartPresenter _dataRepositoryCache; + private readonly IOutputMappingMatchingService _outputMappingMatchingService; private readonly ObservedDataDragDropBinder _observedDataDragDropBinder; private bool _initialized; private IChartDisplayPresenter displayPresenter => _chartPresenterContext.DisplayPresenter; private IChartEditorPresenter editorPresenter => _chartPresenterContext.EditorPresenter; - private readonly IEntitiesInSimulationRetriever _entitiesInSimulationRetriever; protected ChartPresenter(IChartView chartView, ChartPresenterContext chartPresenterContext, IMoBiContext context, IUserSettings userSettings, - IChartTemplatingTask chartTemplatingTask, IChartUpdater chartUpdater, IEntitiesInSimulationRetriever entitiesInSimulationRetriever) : + IChartTemplatingTask chartTemplatingTask, IChartUpdater chartUpdater, IOutputMappingMatchingService outputMappingMatchingService) : base(chartView, chartPresenterContext) { _chartUpdater = chartUpdater; @@ -87,6 +88,7 @@ protected ChartPresenter(IChartView chartView, ChartPresenterContext chartPresen _chartTemplatingTask = chartTemplatingTask; _dataRepositoryCache = new Cache(onMissingKey: x => null); + _outputMappingMatchingService = outputMappingMatchingService; _userSettings = userSettings; _context = context; @@ -97,7 +99,6 @@ protected ChartPresenter(IChartView chartView, ChartPresenterContext chartPresen initEditorPresenterSettings(); _observedDataDragDropBinder = new ObservedDataDragDropBinder(); - _entitiesInSimulationRetriever = entitiesInSimulationRetriever; AddSubPresenters(chartPresenterContext.EditorAndDisplayPresenter); } @@ -301,53 +302,13 @@ private void addDataRepositoriesToDataRepositoryCache(IReadOnlyCollection observedDataMatchesOutput(observedData, x)); - - if (matchingOutputPath == null) - { - newOutputMapping.WeightedObservedData = new WeightedObservedData(observedData); - return newOutputMapping; - } - - var matchingOutput = pathCache[matchingOutputPath]; - - newOutputMapping.OutputSelection = - new SimulationQuantitySelection(simulation, new QuantitySelection(matchingOutputPath, matchingOutput.QuantityType)); - newOutputMapping.WeightedObservedData = new WeightedObservedData(observedData); - newOutputMapping.Scaling = defaultScalingFor(matchingOutput); - return newOutputMapping; - } - - private Scalings defaultScalingFor(IQuantity output) - { - return output.IsFraction() ? Scalings.Linear : Scalings.Log; - } - - private bool observedDataMatchesOutput(DataRepository observedData, string outputPath) - { - var organ = observedData.ExtendedPropertyValueFor(Constants.ObservedData.ORGAN); - var compartment = observedData.ExtendedPropertyValueFor(Constants.ObservedData.COMPARTMENT); - var molecule = observedData.ExtendedPropertyValueFor(Constants.ObservedData.MOLECULE); - - if (organ == null || compartment == null || molecule == null) - return false; - - return outputPath.Contains(organ) && outputPath.Contains(compartment) && outputPath.Contains(molecule); - } - private IMoBiSimulation findSimulation(DataRepository dataRepository) { return _context.CurrentProject.Simulations diff --git a/src/MoBi.Presentation/Presenter/ComparisonChartPresenter.cs b/src/MoBi.Presentation/Presenter/ComparisonChartPresenter.cs index 95500a99e..1009c071f 100644 --- a/src/MoBi.Presentation/Presenter/ComparisonChartPresenter.cs +++ b/src/MoBi.Presentation/Presenter/ComparisonChartPresenter.cs @@ -5,6 +5,7 @@ using OSPSuite.Core.Domain.Data; using OSPSuite.Core.Domain.Mappers; using OSPSuite.Core.Domain.Services; +using OSPSuite.Core.Services; using OSPSuite.Presentation.Services.Charts; using IChartTemplatingTask = MoBi.Presentation.Tasks.IChartTemplatingTask; @@ -18,8 +19,8 @@ public class ComparisonChartPresenter : ChartPresenter, IComparisonChartPresente { private readonly IQuantityPathToQuantityDisplayPathMapper _quantityDisplayPathMapper; - public ComparisonChartPresenter(IChartView chartView, IMoBiContext context, IUserSettings userSettings, IChartTemplatingTask chartTemplatingTask, IQuantityPathToQuantityDisplayPathMapper quantityDisplayPathMapper, IChartUpdater chartUpdater, ChartPresenterContext chartPresenterContext, IEntitiesInSimulationRetriever entitiesInSimulationRetriever) : - base(chartView, chartPresenterContext, context, userSettings, chartTemplatingTask, chartUpdater, entitiesInSimulationRetriever) + public ComparisonChartPresenter(IChartView chartView, IMoBiContext context, IUserSettings userSettings, IChartTemplatingTask chartTemplatingTask, IQuantityPathToQuantityDisplayPathMapper quantityDisplayPathMapper, IChartUpdater chartUpdater, ChartPresenterContext chartPresenterContext, IOutputMappingMatchingService outputMappingMatchingService) : + base(chartView, chartPresenterContext, context, userSettings, chartTemplatingTask, chartUpdater, outputMappingMatchingService) { _quantityDisplayPathMapper = quantityDisplayPathMapper; } diff --git a/src/MoBi.Presentation/Presenter/EditSimulationPresenter.cs b/src/MoBi.Presentation/Presenter/EditSimulationPresenter.cs index 4a573a066..d726e6175 100644 --- a/src/MoBi.Presentation/Presenter/EditSimulationPresenter.cs +++ b/src/MoBi.Presentation/Presenter/EditSimulationPresenter.cs @@ -66,7 +66,9 @@ public EditSimulationPresenter(IEditSimulationView view, ISimulationChartPresent IEditInSimulationPresenterFactory showPresenterFactory, IHeavyWorkManager heavyWorkManager, IChartFactory chartFactory, IEditFavoritesInSimulationPresenter favoritesPresenter, IChartTasks chartTask, IUserDefinedParametersPresenter userDefinedParametersPresenter, ISimulationOutputMappingPresenter simulationOutputMappingPresenter, - ISimulationPredictedVsObservedChartPresenter simulationPredictedVsObservedChartPresenter, ISimulationResidualVsTimeChartPresenter simulationResidualVsTimeChartPresenter, IMoBiContext context, IEntitiesInSimulationRetriever entitiesInSimulationRetriever) + ISimulationPredictedVsObservedChartPresenter simulationPredictedVsObservedChartPresenter, + ISimulationResidualVsTimeChartPresenter simulationResidualVsTimeChartPresenter, IMoBiContext context, + IEntitiesInSimulationRetriever entitiesInSimulationRetriever) : base(view) { _editOutputSchemaPresenter = editOutputSchemaPresenter; @@ -93,11 +95,12 @@ public EditSimulationPresenter(IEditSimulationView view, ISimulationChartPresent _view.SetResidualsVsTimeView(simulationResidualVsTimeChartPresenter.View); _view.SetDataView(_simulationOutputMappingPresenter.View); AddSubPresenters(_chartPresenter, _hierarchicalPresenter, _simulationDiagramPresenter, _solverSettingsPresenter, _editOutputSchemaPresenter, - _favoritesPresenter, _userDefinedParametersPresenter, _simulationOutputMappingPresenter, _simulationPredictedVsObservedChartPresenter, _simulationResidualVsTimeChartPresenter); + _favoritesPresenter, _userDefinedParametersPresenter, _simulationOutputMappingPresenter, _simulationPredictedVsObservedChartPresenter, + _simulationResidualVsTimeChartPresenter); _cacheShowPresenter = new Cache { OnMissingKey = x => null }; _chartPresenter.OnObservedDataAddedToChart += onObservedDataAddedToChart; _context = context; - _entitiesInSimulationRetriever = entitiesInSimulationRetriever; + _entitiesInSimulationRetriever = entitiesInSimulationRetriever; } public string CreateResultTabCaption(string chartName) @@ -154,6 +157,7 @@ public override void Edit(object subject) } public override object Subject => _simulation; + private void loadChart() { if (_simulationPredictedVsObservedChartPresenter.Chart == null) @@ -329,7 +333,6 @@ private void onObservedDataAddedToChart(object sender, ObservedDataAddedToChartE if (newOutputMapping.Output != null) _simulation.OutputMappings.Add(newOutputMapping); _context.PublishEvent(new ObservedDataAddedToAnalysableEvent(_simulation, dataRepository, false)); - } } @@ -376,6 +379,5 @@ private IMoBiSimulation findSimulation(DataRepository dataRepository) return _context.CurrentProject.Simulations .FirstOrDefault(simulation => Equals(simulation.ResultsDataRepository, dataRepository)); } - } } \ No newline at end of file diff --git a/src/MoBi.Presentation/Presenter/SimulationChartPresenter.cs b/src/MoBi.Presentation/Presenter/SimulationChartPresenter.cs index c496e2c87..57a7ef622 100644 --- a/src/MoBi.Presentation/Presenter/SimulationChartPresenter.cs +++ b/src/MoBi.Presentation/Presenter/SimulationChartPresenter.cs @@ -19,8 +19,8 @@ public class SimulationChartPresenter : ChartPresenter, ISimulationChartPresente { private readonly ICurveNamer _curveNamer; - public SimulationChartPresenter(IChartView chartView, IMoBiContext context, IUserSettings userSettings, IChartTemplatingTask chartTemplatingTask, ICurveNamer curveNamer, IChartUpdater chartUpdater, ChartPresenterContext chartPresenterContext, IEntitiesInSimulationRetriever entitiesInSimulationRetriever) - : base(chartView, chartPresenterContext, context, userSettings, chartTemplatingTask, chartUpdater, entitiesInSimulationRetriever) + public SimulationChartPresenter(IChartView chartView, IMoBiContext context, IUserSettings userSettings, IChartTemplatingTask chartTemplatingTask, ICurveNamer curveNamer, IChartUpdater chartUpdater, ChartPresenterContext chartPresenterContext, IOutputMappingMatchingService outputMappingMatchingService) + : base(chartView, chartPresenterContext, context, userSettings, chartTemplatingTask, chartUpdater, outputMappingMatchingService) { _curveNamer = curveNamer; } diff --git a/src/MoBi.UI/MoBi.UI.csproj b/src/MoBi.UI/MoBi.UI.csproj index 1e5a79c7f..77132100f 100644 --- a/src/MoBi.UI/MoBi.UI.csproj +++ b/src/MoBi.UI/MoBi.UI.csproj @@ -27,12 +27,12 @@ - - - - + + + + - + diff --git a/src/MoBi.UI/Views/SimulationView/EditSimulationView.cs b/src/MoBi.UI/Views/SimulationView/EditSimulationView.cs index bc0b37481..7e6b1afb8 100644 --- a/src/MoBi.UI/Views/SimulationView/EditSimulationView.cs +++ b/src/MoBi.UI/Views/SimulationView/EditSimulationView.cs @@ -39,8 +39,8 @@ public override void InitializeResources() tabSimulation.InitWith(AppConstants.Captions.SimulationParameters, ApplicationIcons.Parameter); tabResults.InitWith(AppConstants.Captions.Results, ApplicationIcons.TimeProfileAnalysis); tabData.InitWith(AppConstants.Captions.SimulationData, ApplicationIcons.PKSim); - tabPredVsObs.InitWith(AppConstants.Captions.PredictedVsObserved, ApplicationIcons.PredictedVsObservedAnalysis); - tabResidVsTime.InitWith(AppConstants.Captions.ResidualsVsTime, ApplicationIcons.ResidualVsTimeAnalysis); + tabPredVsObs.InitWith(Captions.SimulationUI.PredictedVsObservedSimulation, ApplicationIcons.PredictedVsObservedAnalysis); + tabResidVsTime.InitWith(Captions.SimulationUI.ResidualsVsTimeSimulation, ApplicationIcons.ResidualVsTimeAnalysis); tabsNavigation.SelectedPageChanging += (o, e) => OnEvent(tabSelectionChanged, e); tabs.SelectedPageChanging += (o, e) => OnEvent(tabSelectionChanged, e); diff --git a/src/MoBi/MoBi.csproj b/src/MoBi/MoBi.csproj index 7a8736ac5..5fe7f113a 100644 --- a/src/MoBi/MoBi.csproj +++ b/src/MoBi/MoBi.csproj @@ -71,13 +71,13 @@ - + - + diff --git a/tests/MoBi.Tests/MoBi.Tests.csproj b/tests/MoBi.Tests/MoBi.Tests.csproj index 90d00bca4..70527b648 100644 --- a/tests/MoBi.Tests/MoBi.Tests.csproj +++ b/tests/MoBi.Tests/MoBi.Tests.csproj @@ -45,10 +45,10 @@ - - - - + + + + diff --git a/tests/MoBi.UI.Tests/MoBi.UI.Tests.csproj b/tests/MoBi.UI.Tests/MoBi.UI.Tests.csproj index 52a12a4ba..20b0dacd2 100644 --- a/tests/MoBi.UI.Tests/MoBi.UI.Tests.csproj +++ b/tests/MoBi.UI.Tests/MoBi.UI.Tests.csproj @@ -17,8 +17,8 @@ - - + + From b764191faf89685fb8747b2305c5765107062379 Mon Sep 17 00:00:00 2001 From: georgeDaskalakis <37107428+georgeDaskalakis@users.noreply.github.com> Date: Sun, 23 Oct 2022 23:14:46 +0200 Subject: [PATCH 12/18] plugging in new Core --- src/MoBi.Assets/MoBi.Assets.csproj | 6 +++--- src/MoBi.BatchTool/MoBi.BatchTool.csproj | 2 +- src/MoBi.Core/MoBi.Core.csproj | 14 +++++++------- src/MoBi.Engine/MoBi.Engine.csproj | 4 ++-- src/MoBi.Presentation/MoBi.Presentation.csproj | 6 +++--- src/MoBi.Presentation/Presenter/ChartPresenter.cs | 8 ++++---- .../Presenter/ComparisonChartPresenter.cs | 4 ++-- .../Presenter/SimulationChartPresenter.cs | 4 ++-- src/MoBi.UI/MoBi.UI.csproj | 10 +++++----- src/MoBi/MoBi.csproj | 4 ++-- tests/MoBi.Tests/MoBi.Tests.csproj | 8 ++++---- tests/MoBi.UI.Tests/MoBi.UI.Tests.csproj | 4 ++-- 12 files changed, 37 insertions(+), 37 deletions(-) diff --git a/src/MoBi.Assets/MoBi.Assets.csproj b/src/MoBi.Assets/MoBi.Assets.csproj index c9b0fc7ca..224d27402 100644 --- a/src/MoBi.Assets/MoBi.Assets.csproj +++ b/src/MoBi.Assets/MoBi.Assets.csproj @@ -26,9 +26,9 @@ - - - + + + diff --git a/src/MoBi.BatchTool/MoBi.BatchTool.csproj b/src/MoBi.BatchTool/MoBi.BatchTool.csproj index 432ca7dda..8dfaa8621 100644 --- a/src/MoBi.BatchTool/MoBi.BatchTool.csproj +++ b/src/MoBi.BatchTool/MoBi.BatchTool.csproj @@ -60,7 +60,7 @@ - + diff --git a/src/MoBi.Core/MoBi.Core.csproj b/src/MoBi.Core/MoBi.Core.csproj index 49bc82920..d68158409 100644 --- a/src/MoBi.Core/MoBi.Core.csproj +++ b/src/MoBi.Core/MoBi.Core.csproj @@ -32,13 +32,13 @@ - - - - - - - + + + + + + + diff --git a/src/MoBi.Engine/MoBi.Engine.csproj b/src/MoBi.Engine/MoBi.Engine.csproj index 68f4ca163..327ae76a7 100644 --- a/src/MoBi.Engine/MoBi.Engine.csproj +++ b/src/MoBi.Engine/MoBi.Engine.csproj @@ -32,8 +32,8 @@ - - + + diff --git a/src/MoBi.Presentation/MoBi.Presentation.csproj b/src/MoBi.Presentation/MoBi.Presentation.csproj index 32e2e6a00..8b78f2912 100644 --- a/src/MoBi.Presentation/MoBi.Presentation.csproj +++ b/src/MoBi.Presentation/MoBi.Presentation.csproj @@ -28,9 +28,9 @@ - - - + + + diff --git a/src/MoBi.Presentation/Presenter/ChartPresenter.cs b/src/MoBi.Presentation/Presenter/ChartPresenter.cs index d4d1f46aa..d486c7bdc 100644 --- a/src/MoBi.Presentation/Presenter/ChartPresenter.cs +++ b/src/MoBi.Presentation/Presenter/ChartPresenter.cs @@ -71,7 +71,7 @@ public abstract class ChartPresenter : ChartPresenter _dataRepositoryCache; - private readonly IOutputMappingMatchingService _outputMappingMatchingService; + private readonly IOutputMappingMatchingTask _OutputMappingMatchingTask; private readonly ObservedDataDragDropBinder _observedDataDragDropBinder; private bool _initialized; @@ -79,7 +79,7 @@ public abstract class ChartPresenter : ChartPresenter _chartPresenterContext.EditorPresenter; protected ChartPresenter(IChartView chartView, ChartPresenterContext chartPresenterContext, IMoBiContext context, IUserSettings userSettings, - IChartTemplatingTask chartTemplatingTask, IChartUpdater chartUpdater, IOutputMappingMatchingService outputMappingMatchingService) : + IChartTemplatingTask chartTemplatingTask, IChartUpdater chartUpdater, IOutputMappingMatchingTask OutputMappingMatchingTask) : base(chartView, chartPresenterContext) { _chartUpdater = chartUpdater; @@ -88,7 +88,7 @@ protected ChartPresenter(IChartView chartView, ChartPresenterContext chartPresen _chartTemplatingTask = chartTemplatingTask; _dataRepositoryCache = new Cache(onMissingKey: x => null); - _outputMappingMatchingService = outputMappingMatchingService; + _OutputMappingMatchingTask = OutputMappingMatchingTask; _userSettings = userSettings; _context = context; @@ -302,7 +302,7 @@ private void addDataRepositoriesToDataRepositoryCache(IReadOnlyCollection - - - - + + + + - + diff --git a/src/MoBi/MoBi.csproj b/src/MoBi/MoBi.csproj index 5fe7f113a..daea513a9 100644 --- a/src/MoBi/MoBi.csproj +++ b/src/MoBi/MoBi.csproj @@ -71,13 +71,13 @@ - + - + diff --git a/tests/MoBi.Tests/MoBi.Tests.csproj b/tests/MoBi.Tests/MoBi.Tests.csproj index 70527b648..653394a50 100644 --- a/tests/MoBi.Tests/MoBi.Tests.csproj +++ b/tests/MoBi.Tests/MoBi.Tests.csproj @@ -45,10 +45,10 @@ - - - - + + + + diff --git a/tests/MoBi.UI.Tests/MoBi.UI.Tests.csproj b/tests/MoBi.UI.Tests/MoBi.UI.Tests.csproj index 20b0dacd2..199140403 100644 --- a/tests/MoBi.UI.Tests/MoBi.UI.Tests.csproj +++ b/tests/MoBi.UI.Tests/MoBi.UI.Tests.csproj @@ -17,8 +17,8 @@ - - + + From a89637a2d452962b3a16c60aa11190b81449cece Mon Sep 17 00:00:00 2001 From: georgeDaskalakis <37107428+georgeDaskalakis@users.noreply.github.com> Date: Sun, 23 Oct 2022 23:29:16 +0200 Subject: [PATCH 13/18] corrections --- src/MoBi.Core/Reporting/Constants.cs | 4 +- .../Presenter/ChartPresenter.cs | 3 - .../Presenter/ComparisonChartPresenter.cs | 5 +- .../Presenter/EditSimulationPresenter.cs | 57 ++----------------- .../Tasks/SimulationRunner.cs | 1 - .../EditSimulationPresenterSpecs.cs | 8 +-- 6 files changed, 13 insertions(+), 65 deletions(-) diff --git a/src/MoBi.Core/Reporting/Constants.cs b/src/MoBi.Core/Reporting/Constants.cs index 918b4349d..7a3a46344 100644 --- a/src/MoBi.Core/Reporting/Constants.cs +++ b/src/MoBi.Core/Reporting/Constants.cs @@ -25,12 +25,12 @@ class Constants public const string SIMULATION_SETTINGS = "Simulation Settings"; public const string SIMULATIONS = "Simulations"; public const string SIMULATION = "Simulation"; - public const string RESULTS = "ResultsDataRepository"; + public const string RESULTS = "Results"; public const string CHARTS = "Charts"; public const string CHART = "Chart"; public const string DATA = "Data"; public const string OBSERVED_DATA = "Observed Data"; - public const string HISTORIC_RESULTS = "Historic ResultsDataRepository"; + public const string HISTORIC_RESULTS = "Historic Results"; public const string DIMENSION = "Dimension"; public const string ID = "ID"; diff --git a/src/MoBi.Presentation/Presenter/ChartPresenter.cs b/src/MoBi.Presentation/Presenter/ChartPresenter.cs index d486c7bdc..65779a9aa 100644 --- a/src/MoBi.Presentation/Presenter/ChartPresenter.cs +++ b/src/MoBi.Presentation/Presenter/ChartPresenter.cs @@ -11,8 +11,6 @@ using OSPSuite.Core.Chart; using OSPSuite.Core.Domain; using OSPSuite.Core.Domain.Data; -using OSPSuite.Core.Domain.ParameterIdentifications; -using OSPSuite.Core.Domain.Services; using OSPSuite.Core.Events; using OSPSuite.Core.Services; using OSPSuite.Presentation.Binders; @@ -306,7 +304,6 @@ private void addDataRepositoriesToDataRepositoryCache(IReadOnlyCollection { OnMissingKey = x => null }; _chartPresenter.OnObservedDataAddedToChart += onObservedDataAddedToChart; _context = context; - _entitiesInSimulationRetriever = entitiesInSimulationRetriever; + _outputMappingMatchingTask = outputMappingMatchingTask; } public string CreateResultTabCaption(string chartName) @@ -328,56 +326,9 @@ private void onObservedDataAddedToChart(object sender, ObservedDataAddedToChartE { foreach (var dataRepository in e.AddedDataRepositories) { - var newOutputMapping = mapMatchingOutput(dataRepository, _simulation); - - if (newOutputMapping.Output != null) - _simulation.OutputMappings.Add(newOutputMapping); + _outputMappingMatchingTask.AddMatchingOutputMapping(dataRepository, _simulation); _context.PublishEvent(new ObservedDataAddedToAnalysableEvent(_simulation, dataRepository, false)); } } - - private OutputMapping mapMatchingOutput(DataRepository observedData, ISimulation simulation) - { - var newOutputMapping = new OutputMapping(); - var pathCache = _entitiesInSimulationRetriever.OutputsFrom(simulation); - var matchingOutputPath = pathCache.Keys.FirstOrDefault(x => observedDataMatchesOutput(observedData, x)); - - if (matchingOutputPath == null) - { - newOutputMapping.WeightedObservedData = new WeightedObservedData(observedData); - return newOutputMapping; - } - - var matchingOutput = pathCache[matchingOutputPath]; - - newOutputMapping.OutputSelection = - new SimulationQuantitySelection(simulation, new QuantitySelection(matchingOutputPath, matchingOutput.QuantityType)); - newOutputMapping.WeightedObservedData = new WeightedObservedData(observedData); - newOutputMapping.Scaling = defaultScalingFor(matchingOutput); - return newOutputMapping; - } - - private Scalings defaultScalingFor(IQuantity output) - { - return output.IsFraction() ? Scalings.Linear : Scalings.Log; - } - - private bool observedDataMatchesOutput(DataRepository observedData, string outputPath) - { - var organ = observedData.ExtendedPropertyValueFor(Constants.ObservedData.ORGAN); - var compartment = observedData.ExtendedPropertyValueFor(Constants.ObservedData.COMPARTMENT); - var molecule = observedData.ExtendedPropertyValueFor(Constants.ObservedData.MOLECULE); - - if (organ == null || compartment == null || molecule == null) - return false; - - return outputPath.Contains(organ) && outputPath.Contains(compartment) && outputPath.Contains(molecule); - } - - private IMoBiSimulation findSimulation(DataRepository dataRepository) - { - return _context.CurrentProject.Simulations - .FirstOrDefault(simulation => Equals(simulation.ResultsDataRepository, dataRepository)); - } } } \ No newline at end of file diff --git a/src/MoBi.Presentation/Tasks/SimulationRunner.cs b/src/MoBi.Presentation/Tasks/SimulationRunner.cs index b33ca7bc9..9080917e6 100644 --- a/src/MoBi.Presentation/Tasks/SimulationRunner.cs +++ b/src/MoBi.Presentation/Tasks/SimulationRunner.cs @@ -170,7 +170,6 @@ private void copyResultsToSimulation(SimulationRunResults results, IMoBiSimulati setMolecularWeight(simulation, resultsResults); simulation.ResultsDataRepository = resultsResults; - //so theoretically we could add here the calculation of the individual results... } private void setMolecularWeight(IMoBiSimulation simulation, IEnumerable results) diff --git a/tests/MoBi.Tests/Presentation/EditSimulationPresenterSpecs.cs b/tests/MoBi.Tests/Presentation/EditSimulationPresenterSpecs.cs index 0bcdd32eb..3d051d19b 100644 --- a/tests/MoBi.Tests/Presentation/EditSimulationPresenterSpecs.cs +++ b/tests/MoBi.Tests/Presentation/EditSimulationPresenterSpecs.cs @@ -12,8 +12,8 @@ using OSPSuite.Core.Chart; using OSPSuite.Core.Domain; using OSPSuite.Core.Domain.Data; -using OSPSuite.Core.Domain.Services; using OSPSuite.Core.Domain.UnitSystem; +using OSPSuite.Core.Services; using OSPSuite.Presentation.Presenters; using OSPSuite.Presentation.Views; @@ -35,7 +35,7 @@ public abstract class concern_for_EditSimulationPresenter : ContextSpecification protected IUserDefinedParametersPresenter _userDefinedParametersPresenter; protected ISimulationOutputMappingPresenter _simulationOutputMappingPresenter; protected IMoBiContext _context; - protected IEntitiesInSimulationRetriever _entitiesInSimulationRetriever; + protected IOutputMappingMatchingTask _outputMappingMatchingTask; protected override void Context() { @@ -53,12 +53,12 @@ protected override void Context() _simulationOutputMappingPresenter = A.Fake(); _userDefinedParametersPresenter = A.Fake(); _context = A.Fake(); - _entitiesInSimulationRetriever = A.Fake(); + _outputMappingMatchingTask = A.Fake(); sut = new EditSimulationPresenter(_view, _chartPresenter, _hierarchicalSimulationPresenter, _diagramPresenter, _solverSettings, _outputSchemaPresenter, _presenterFactory, new HeavyWorkManagerForSpecs(), A.Fake(), _editFavoritePresenter, _chartTasks, _userDefinedParametersPresenter, _simulationOutputMappingPresenter, - _simulationPredictedVsObservedChartPresenter, _simulationResidualVsTimeChartPresenter, _context, _entitiesInSimulationRetriever); + _simulationPredictedVsObservedChartPresenter, _simulationResidualVsTimeChartPresenter, _context, _outputMappingMatchingTask); } } From e32057e0fda3012abf3f0471ec8018e8971bec49 Mon Sep 17 00:00:00 2001 From: georgeDaskalakis <37107428+georgeDaskalakis@users.noreply.github.com> Date: Mon, 24 Oct 2022 12:18:19 +0200 Subject: [PATCH 14/18] correcting naming --- src/MoBi.Presentation/Presenter/ChartPresenter.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/MoBi.Presentation/Presenter/ChartPresenter.cs b/src/MoBi.Presentation/Presenter/ChartPresenter.cs index 65779a9aa..8d6ef1cf7 100644 --- a/src/MoBi.Presentation/Presenter/ChartPresenter.cs +++ b/src/MoBi.Presentation/Presenter/ChartPresenter.cs @@ -69,7 +69,7 @@ public abstract class ChartPresenter : ChartPresenter _dataRepositoryCache; - private readonly IOutputMappingMatchingTask _OutputMappingMatchingTask; + private readonly IOutputMappingMatchingTask _outputMappingMatchingTask; private readonly ObservedDataDragDropBinder _observedDataDragDropBinder; private bool _initialized; @@ -77,7 +77,7 @@ public abstract class ChartPresenter : ChartPresenter _chartPresenterContext.EditorPresenter; protected ChartPresenter(IChartView chartView, ChartPresenterContext chartPresenterContext, IMoBiContext context, IUserSettings userSettings, - IChartTemplatingTask chartTemplatingTask, IChartUpdater chartUpdater, IOutputMappingMatchingTask OutputMappingMatchingTask) : + IChartTemplatingTask chartTemplatingTask, IChartUpdater chartUpdater, IOutputMappingMatchingTask outputMappingMatchingTask) : base(chartView, chartPresenterContext) { _chartUpdater = chartUpdater; @@ -86,7 +86,7 @@ protected ChartPresenter(IChartView chartView, ChartPresenterContext chartPresen _chartTemplatingTask = chartTemplatingTask; _dataRepositoryCache = new Cache(onMissingKey: x => null); - _OutputMappingMatchingTask = OutputMappingMatchingTask; + _outputMappingMatchingTask = outputMappingMatchingTask; _userSettings = userSettings; _context = context; @@ -300,7 +300,7 @@ private void addDataRepositoriesToDataRepositoryCache(IReadOnlyCollection Date: Mon, 24 Oct 2022 14:40:10 +0200 Subject: [PATCH 15/18] plugging in HasChanged --- src/MoBi.Assets/MoBi.Assets.csproj | 6 +++--- src/MoBi.BatchTool/MoBi.BatchTool.csproj | 2 +- src/MoBi.Core/Domain/Model/MoBiSimulation.cs | 2 -- src/MoBi.Core/MoBi.Core.csproj | 14 +++++++------- src/MoBi.Engine/MoBi.Engine.csproj | 4 ++-- src/MoBi.Presentation/MoBi.Presentation.csproj | 6 +++--- src/MoBi.UI/MoBi.UI.csproj | 10 +++++----- src/MoBi/MoBi.csproj | 4 ++-- tests/MoBi.Tests/MoBi.Tests.csproj | 8 ++++---- tests/MoBi.UI.Tests/MoBi.UI.Tests.csproj | 4 ++-- 10 files changed, 29 insertions(+), 31 deletions(-) diff --git a/src/MoBi.Assets/MoBi.Assets.csproj b/src/MoBi.Assets/MoBi.Assets.csproj index 224d27402..f9380c4ca 100644 --- a/src/MoBi.Assets/MoBi.Assets.csproj +++ b/src/MoBi.Assets/MoBi.Assets.csproj @@ -26,9 +26,9 @@ - - - + + + diff --git a/src/MoBi.BatchTool/MoBi.BatchTool.csproj b/src/MoBi.BatchTool/MoBi.BatchTool.csproj index 8dfaa8621..a8758688b 100644 --- a/src/MoBi.BatchTool/MoBi.BatchTool.csproj +++ b/src/MoBi.BatchTool/MoBi.BatchTool.csproj @@ -60,7 +60,7 @@ - + diff --git a/src/MoBi.Core/Domain/Model/MoBiSimulation.cs b/src/MoBi.Core/Domain/Model/MoBiSimulation.cs index 01da5dfcf..bef4fc8da 100644 --- a/src/MoBi.Core/Domain/Model/MoBiSimulation.cs +++ b/src/MoBi.Core/Domain/Model/MoBiSimulation.cs @@ -19,8 +19,6 @@ public interface IMoBiSimulation : IWithDiagramFor, ISimulation IMoBiBuildConfiguration MoBiBuildConfiguration { get; } string ParameterIdentificationWorkingDirectory { get; set; } void Update(IMoBiBuildConfiguration buildConfiguration, IModel model); - bool HasChanged { get; set; } - SolverSettings Solver { get; } OutputSchema OutputSchema { get; } diff --git a/src/MoBi.Core/MoBi.Core.csproj b/src/MoBi.Core/MoBi.Core.csproj index d68158409..9f937515c 100644 --- a/src/MoBi.Core/MoBi.Core.csproj +++ b/src/MoBi.Core/MoBi.Core.csproj @@ -32,13 +32,13 @@ - - - - - - - + + + + + + + diff --git a/src/MoBi.Engine/MoBi.Engine.csproj b/src/MoBi.Engine/MoBi.Engine.csproj index 327ae76a7..447232f8d 100644 --- a/src/MoBi.Engine/MoBi.Engine.csproj +++ b/src/MoBi.Engine/MoBi.Engine.csproj @@ -32,8 +32,8 @@ - - + + diff --git a/src/MoBi.Presentation/MoBi.Presentation.csproj b/src/MoBi.Presentation/MoBi.Presentation.csproj index 8b78f2912..4fe8a4dc8 100644 --- a/src/MoBi.Presentation/MoBi.Presentation.csproj +++ b/src/MoBi.Presentation/MoBi.Presentation.csproj @@ -28,9 +28,9 @@ - - - + + + diff --git a/src/MoBi.UI/MoBi.UI.csproj b/src/MoBi.UI/MoBi.UI.csproj index 9a20efcde..60961bff8 100644 --- a/src/MoBi.UI/MoBi.UI.csproj +++ b/src/MoBi.UI/MoBi.UI.csproj @@ -27,12 +27,12 @@ - - - - + + + + - + diff --git a/src/MoBi/MoBi.csproj b/src/MoBi/MoBi.csproj index daea513a9..3ae95d351 100644 --- a/src/MoBi/MoBi.csproj +++ b/src/MoBi/MoBi.csproj @@ -71,13 +71,13 @@ - + - + diff --git a/tests/MoBi.Tests/MoBi.Tests.csproj b/tests/MoBi.Tests/MoBi.Tests.csproj index 653394a50..9deabbead 100644 --- a/tests/MoBi.Tests/MoBi.Tests.csproj +++ b/tests/MoBi.Tests/MoBi.Tests.csproj @@ -45,10 +45,10 @@ - - - - + + + + diff --git a/tests/MoBi.UI.Tests/MoBi.UI.Tests.csproj b/tests/MoBi.UI.Tests/MoBi.UI.Tests.csproj index 199140403..bd835756c 100644 --- a/tests/MoBi.UI.Tests/MoBi.UI.Tests.csproj +++ b/tests/MoBi.UI.Tests/MoBi.UI.Tests.csproj @@ -17,8 +17,8 @@ - - + + From b0694885e502b56f6a8a7cdf27f5c7f060b8650d Mon Sep 17 00:00:00 2001 From: georgeDaskalakis <37107428+georgeDaskalakis@users.noreply.github.com> Date: Mon, 24 Oct 2022 15:14:47 +0200 Subject: [PATCH 16/18] fixing deserializing --- .../Xml/Serializer/MoBiSimulationXmlSerializer.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/MoBi.Core/Serialization/Xml/Serializer/MoBiSimulationXmlSerializer.cs b/src/MoBi.Core/Serialization/Xml/Serializer/MoBiSimulationXmlSerializer.cs index 41ccaac9d..ca0604de9 100644 --- a/src/MoBi.Core/Serialization/Xml/Serializer/MoBiSimulationXmlSerializer.cs +++ b/src/MoBi.Core/Serialization/Xml/Serializer/MoBiSimulationXmlSerializer.cs @@ -4,6 +4,7 @@ using OSPSuite.Core.Chart; using OSPSuite.Core.Serialization.Diagram; using OSPSuite.Core.Serialization.Xml; +using OSPSuite.Serializer; namespace MoBi.Core.Serialization.Xml.Serializer { @@ -16,7 +17,8 @@ public MoBiSimulationXmlSerializer() : base(SerializationConstants.MoBiSimulatio public override void PerformMapping() { base.PerformMapping(); - Map(x => x.ResultsDataRepository); + //for compatibility with older versions before renaming of "Results" to "ResultsDataRepository" + Map(x => x.ResultsDataRepository).WithMappingName(SerializationConstants.MoBiResults); Map(x => x.ParameterIdentificationWorkingDirectory); Map(x => x.HasUpToDateResults); } From 9c086d0ede985db894b12054f885405f7e4770b9 Mon Sep 17 00:00:00 2001 From: georgeDaskalakis <37107428+georgeDaskalakis@users.noreply.github.com> Date: Mon, 24 Oct 2022 15:15:38 +0200 Subject: [PATCH 17/18] fixing build --- src/MoBi.Core/Serialization/Xml/SerializationConstants.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/MoBi.Core/Serialization/Xml/SerializationConstants.cs b/src/MoBi.Core/Serialization/Xml/SerializationConstants.cs index 4b21d2fc5..e1fb6afd5 100644 --- a/src/MoBi.Core/Serialization/Xml/SerializationConstants.cs +++ b/src/MoBi.Core/Serialization/Xml/SerializationConstants.cs @@ -17,5 +17,6 @@ public static class SerializationConstants public static string MoBiSimulation = "MoBiSimulation"; public static string MoBiReactionBuildingBlock = "ReactionBuildingBlock"; public static string MoBiSpatialStructure = "SpatialStructure"; + public static string MoBiResults = "Results"; } } \ No newline at end of file From 81c88d57d9abf881e48b6568b41f04093404273c Mon Sep 17 00:00:00 2001 From: georgeDaskalakis <37107428+georgeDaskalakis@users.noreply.github.com> Date: Mon, 24 Oct 2022 17:30:37 +0200 Subject: [PATCH 18/18] renaming --- src/MoBi.Assets/AppConstants.cs | 2 +- src/MoBi.UI/Views/SimulationView/EditSimulationView.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MoBi.Assets/AppConstants.cs b/src/MoBi.Assets/AppConstants.cs index 1d3948366..6bc3931b7 100644 --- a/src/MoBi.Assets/AppConstants.cs +++ b/src/MoBi.Assets/AppConstants.cs @@ -1424,7 +1424,7 @@ public static class Captions public static readonly string SimulationParameters = "Parameters"; public static readonly string Results = "Results"; public static readonly string TimeProfile = "Time Profile"; - public static readonly string SimulationData = "Data"; + public static readonly string SimulationObservedData = "Observed Data"; public static readonly string IsStationary = "Stationary"; public static readonly string DefaultStartAmount = "Amount"; public static readonly string MoleculeType = "Molecule Type"; diff --git a/src/MoBi.UI/Views/SimulationView/EditSimulationView.cs b/src/MoBi.UI/Views/SimulationView/EditSimulationView.cs index 7e6b1afb8..aef2b5d6c 100644 --- a/src/MoBi.UI/Views/SimulationView/EditSimulationView.cs +++ b/src/MoBi.UI/Views/SimulationView/EditSimulationView.cs @@ -38,7 +38,7 @@ public override void InitializeResources() tabTree.InitWith(AppConstants.Captions.Tree, ApplicationIcons.Tree); tabSimulation.InitWith(AppConstants.Captions.SimulationParameters, ApplicationIcons.Parameter); tabResults.InitWith(AppConstants.Captions.Results, ApplicationIcons.TimeProfileAnalysis); - tabData.InitWith(AppConstants.Captions.SimulationData, ApplicationIcons.PKSim); + tabData.InitWith(AppConstants.Captions.SimulationObservedData, ApplicationIcons.ObservedData); tabPredVsObs.InitWith(Captions.SimulationUI.PredictedVsObservedSimulation, ApplicationIcons.PredictedVsObservedAnalysis); tabResidVsTime.InitWith(Captions.SimulationUI.ResidualsVsTimeSimulation, ApplicationIcons.ResidualVsTimeAnalysis);