From 80e26fe514300cf6f1084f5bcee485ff8aec6f0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Go=C5=82=C4=99biowski?= Date: Sat, 19 Oct 2024 15:00:51 +0200 Subject: [PATCH 1/2] Fix missing implementation for .PLOT --- .../Spice/Readers/Controls/PlotControl.cs | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/SpiceSharpParser/ModelReaders/Netlist/Spice/Readers/Controls/PlotControl.cs b/src/SpiceSharpParser/ModelReaders/Netlist/Spice/Readers/Controls/PlotControl.cs index 9c80af9f..c40792c5 100644 --- a/src/SpiceSharpParser/ModelReaders/Netlist/Spice/Readers/Controls/PlotControl.cs +++ b/src/SpiceSharpParser/ModelReaders/Netlist/Spice/Readers/Controls/PlotControl.cs @@ -155,7 +155,7 @@ private void AddPlotToResultIfValid(string plotImage, IReadingContext context, X } else { - context.Result.ValidationResult.AddError(ValidationEntrySource.Reader, $"{plotImage} is not valid for: {simulation.Name}"); + context.Result.ValidationResult.AddError(ValidationEntrySource.Reader, $"{plotImage} is not valid for: {simulation.Name}"); } } @@ -163,7 +163,25 @@ private void CreatePointForSeries(ISimulationWithEvents simulation, IReadingCont { double x = 0; - //TODO + if (simulation is Transient transient) + { + x = transient.Time; + } + + if (simulation is AC frequency) + { + x = frequency.Frequency; + } + + if (simulation is Noise noise) + { + x = noise.Frequency; + } + + if (simulation is DC dc) + { + x = dc.GetCurrentSweepValue().FirstOrDefault(); + } for (var i = 0; i < exports.Count; i++) { From 910aa0acedc36c350ef0b8210e97144a2d142e06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Go=C5=82=C4=99biowski?= Date: Sat, 19 Oct 2024 15:01:35 +0200 Subject: [PATCH 2/2] Update version --- src/SpiceSharpParser/SpiceSharpParser.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SpiceSharpParser/SpiceSharpParser.csproj b/src/SpiceSharpParser/SpiceSharpParser.csproj index 49d4ddce..47045676 100644 --- a/src/SpiceSharpParser/SpiceSharpParser.csproj +++ b/src/SpiceSharpParser/SpiceSharpParser.csproj @@ -22,7 +22,7 @@ MIT latest - 3.2.0 + 3.2.1