Skip to content

Commit

Permalink
1796 serializer for residual vs time chart missing (#1797)
Browse files Browse the repository at this point in the history
* Fixes #1796 and also #1789

* Fixes #1796 and also #1789
  • Loading branch information
msevestre authored and rwmcintosh committed Nov 29, 2022
1 parent b13a918 commit 12641e5
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 18 deletions.
9 changes: 8 additions & 1 deletion src/OSPSuite.Core/Chart/CurveOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@ public enum Symbols
Circle,
Diamond,
Triangle,
Square
Square,
InvertedTriangle,
Plus,
Cross,
Star,
Pentagon,
Hexagon,
ThinCross,
}

public enum InterpolationModes
Expand Down
17 changes: 15 additions & 2 deletions src/OSPSuite.Core/Serialization/Chart/CurveChartXmlSerializer.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
using System.Xml.Linq;
using OSPSuite.Core.Chart;
using OSPSuite.Core.Chart.Simulations;
using OSPSuite.Core.Serialization.Xml;

namespace OSPSuite.Core.Serialization.Chart
{
public abstract class CurveChartXmlSerializer<TCurveChart> : OSPSuiteXmlSerializer<TCurveChart> where TCurveChart: CurveChart
public abstract class CurveChartXmlSerializer<TCurveChart> : OSPSuiteXmlSerializer<TCurveChart> where TCurveChart : CurveChart
{
public override void PerformMapping()
{
Expand All @@ -31,6 +32,18 @@ protected override void TypedDeserialize(TCurveChart curveChart, XElement output

public class CurveChartXmlSerializer : CurveChartXmlSerializer<CurveChart>
{

}

public class SimulationPredictedVsObservedChartXmlSerializer : CurveChartXmlSerializer<SimulationPredictedVsObservedChart>
{
public override void PerformMapping()
{
base.PerformMapping();
Map(x => x.DeviationFoldValues);
}
}

public class SimulationResidualVsTimeChartSerializer : CurveChartXmlSerializer<SimulationResidualVsTimeChart>
{
}
}

This file was deleted.

16 changes: 16 additions & 0 deletions src/OSPSuite.UI/Binders/CurveBinder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,7 @@ private static MarkerKind mapFrom(Symbols symbol)
switch (symbol)
{
case Symbols.None:
//We return an arbitrary symbol for none as it does not exist in DevExpress
return MarkerKind.Square;
case Symbols.Circle:
return MarkerKind.Circle;
Expand All @@ -497,6 +498,21 @@ private static MarkerKind mapFrom(Symbols symbol)
return MarkerKind.Triangle;
case Symbols.Square:
return MarkerKind.Square;
case Symbols.InvertedTriangle:
return MarkerKind.InvertedTriangle;
case Symbols.Plus:
return MarkerKind.Plus;
case Symbols.Cross:
return MarkerKind.Cross;
case Symbols.Star:
return MarkerKind.Star;
case Symbols.Pentagon:
return MarkerKind.Pentagon;
case Symbols.Hexagon:
return MarkerKind.Hexagon;
case Symbols.ThinCross:
return MarkerKind.ThinCross;

default:
throw new ArgumentOutOfRangeException(nameof(symbol));
}
Expand Down

0 comments on commit 12641e5

Please sign in to comment.