Skip to content

Commit

Permalink
Merge pull request #163 from SpiceSharp/fix_plot
Browse files Browse the repository at this point in the history
Fix .PLOT directive
  • Loading branch information
marcin-golebiowski authored Oct 19, 2024
2 parents 074807d + 910aa0a commit da694c4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,33 @@ 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}");
}
}

private void CreatePointForSeries(ISimulationWithEvents simulation, IReadingContext context, object eventArgs, List<Export> exports, List<Series> series)
{
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++)
{
Expand Down
2 changes: 1 addition & 1 deletion src/SpiceSharpParser/SpiceSharpParser.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<StartupObject />
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<LangVersion>latest</LangVersion>
<Version>3.2.0</Version>
<Version>3.2.1</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|netstandard1.5|AnyCPU'">
Expand Down

0 comments on commit da694c4

Please sign in to comment.