Beispiel #1
0
        private void AddOpPointToSeries(Context.Sweeps.ParameterSweep firstParameterSweep, Export export, ICircuitContext context, Series series)
        {
            export.Simulation.ExportSimulationData += (object sender, ExportDataEventArgs e) =>
            {
                var expressionContext            = context.Evaluator.GetEvaluationContext(export.Simulation);
                var firstParameterSweepParameter = expressionContext.Parameters[firstParameterSweep.Parameter.Image];

                var value = context.Evaluator.GetEvaluationContext(export.Simulation).Evaluate(firstParameterSweepParameter);
                series.Points.Add(new Point()
                {
                    X = value, Y = export.Extract()
                });
            };
        }
Beispiel #2
0
        private void CreateOpSweepPlot(Context.Sweeps.ParameterSweep firstParameterSweep, string variableName, List <Export> exports, ICircuitContext context)
        {
            var plot = new XyPlot("OP - Parameter sweep: " + variableName);

            foreach (var export in exports)
            {
                var series = new Series(export.Simulation.Name)
                {
                    XUnit = firstParameterSweep.Parameter.Image,
                    YUnit = export.QuantityUnit,
                };
                AddOpPointToSeries(firstParameterSweep, export, context, series);

                plot.Series.Add(series);
            }

            context.Result.AddPlot(plot);
        }