Skip to content

Commit

Permalink
Corrected offsets for the pulse overlay
Browse files Browse the repository at this point in the history
- Modified the line widths so that the pulse overlay is more distinctive
  • Loading branch information
bparks13 committed Oct 22, 2024
1 parent 5bd48da commit f11c18b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions OpenEphys.Onix1.Design/Rhs2116StimulusSequenceDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ private void DrawStimulusWaveform()
var pulseCurve = zedGraphWaveform.GraphPane.AddCurve("", pulse, Color.Red, SymbolType.None);

pulseCurve.Label.IsVisible = false;
pulseCurve.Line.Width = 3;
pulseCurve.Line.Width = 4;
}

PointPairList pointPairs = CreateStimulusWaveform(stimuli[i], channelOffset, peakToPeak);
Expand All @@ -276,7 +276,7 @@ private void DrawStimulusWaveform()
var waveformCurve = zedGraphWaveform.GraphPane.AddCurve("", pointPairs, color, SymbolType.None);

waveformCurve.Label.IsVisible = false;
waveformCurve.Line.Width = 3;
waveformCurve.Line.Width = 2;

maxLength = pointPairs.Last().X > maxLength ? pointPairs.Last().X : maxLength;
}
Expand Down Expand Up @@ -383,14 +383,14 @@ private PointPairList CreateStimulusWaveform(Rhs2116Stimulus stimulus, double yO

points.AddRange(CreatePulse(points[points.Count - 1].X, amplitude, width, yOffset));

points.Add(points[points.Count - 1].X + stimulus.DwellSamples * SamplePeriodMilliSeconds, yOffset);
points.Add(points.Last().X + stimulus.DwellSamples * SamplePeriodMilliSeconds, yOffset);

amplitude = CalculateSecondPulseAmplitude(stimulus.AnodicFirst, stimulus.AnodicAmplitudeSteps, stimulus.CathodicAmplitudeSteps, peakToPeak, yOffset);
width = CalculateSecondPulseWidth(stimulus.AnodicFirst, stimulus.AnodicWidthSamples, stimulus.CathodicWidthSamples);

points.AddRange(CreatePulse(points[points.Count - 1].X, amplitude, width, yOffset));

points.Add(points[points.Count - 1].X + stimulus.InterStimulusIntervalSamples * SamplePeriodMilliSeconds, yOffset);
points.Add(points.Last().X + stimulus.InterStimulusIntervalSamples * SamplePeriodMilliSeconds, yOffset);
}

points.Add(Sequence.SequenceLengthSamples * SamplePeriodMilliSeconds, yOffset);
Expand Down Expand Up @@ -418,7 +418,7 @@ private List<PointPairList> CreatePulses(Rhs2116Stimulus stimulus, double yOffse
if (i == 0)
pulse.Add(stimulus.DelaySamples * SamplePeriodMilliSeconds, yOffset);
else
pulse.Add(pulses[pulses.Count - 1][0].X + stimulus.InterStimulusIntervalSamples * SamplePeriodMilliSeconds, yOffset);
pulse.Add(pulses.Last().Last().X + stimulus.InterStimulusIntervalSamples * SamplePeriodMilliSeconds, yOffset);

double amplitude = CalculateFirstPulseAmplitude(stimulus.AnodicFirst, stimulus.AnodicAmplitudeSteps, stimulus.CathodicAmplitudeSteps, peakToPeak, yOffset);
double width = CalculateFirstPulseWidth(stimulus.AnodicFirst, stimulus.AnodicWidthSamples, stimulus.CathodicWidthSamples);
Expand Down

0 comments on commit f11c18b

Please sign in to comment.