Skip to content

Commit e1744f2

Browse files
committed
Invert stimulus waveform channel ordering
1 parent 72617ac commit e1744f2

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

OpenEphys.Onix1.Design/Rhs2116StimulusSequenceDialog.cs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ private void DrawStimulusWaveform()
263263

264264
for (int i = 0; i < Sequence.Stimuli.Length; i++)
265265
{
266-
var channelOffset = peakToPeak * i;
266+
var channelOffset = -peakToPeak * i;
267267

268268
if (ChannelDialog.SelectedContacts[i] || plotAllContacts)
269269
{
@@ -289,7 +289,7 @@ private void DrawStimulusWaveform()
289289
}
290290

291291
zedGraphWaveform.GraphPane.YAxis.Scale.MajorStep = 1;
292-
zedGraphWaveform.GraphPane.YAxis.Scale.BaseTic = 0;
292+
zedGraphWaveform.GraphPane.YAxis.Scale.BaseTic = -Sequence.Stimuli.Length + 1;
293293

294294
HighlightInvalidContacts();
295295

@@ -298,8 +298,13 @@ private void DrawStimulusWaveform()
298298

299299
zedGraphWaveform.GraphPane.XAxis.Scale.Max = maxLength;
300300
zedGraphWaveform.GraphPane.XAxis.Scale.Min = -(maxLength * 0.02);
301-
zedGraphWaveform.GraphPane.YAxis.Scale.Min = -2;
302-
zedGraphWaveform.GraphPane.YAxis.Scale.Max = Sequence.Stimuli.Length - 0.2;
301+
zedGraphWaveform.GraphPane.YAxis.Scale.Min = -Sequence.Stimuli.Length - 2;
302+
zedGraphWaveform.GraphPane.YAxis.Scale.Max = 1;
303+
304+
zedGraphWaveform.GraphPane.YAxis.ScaleFormatEvent += (GraphPane gp, Axis axis, double val, int index) =>
305+
{
306+
return Math.Abs(val).ToString("0");
307+
};
303308

304309
DrawScale();
305310

@@ -1062,7 +1067,7 @@ private bool UpdateStepSizeFromAmplitude(double amplitude)
10621067
{
10631068
StepSize = validStepSizes.First();
10641069
textBoxStepSize.Text = GetStepSizeStringuA(StepSize);
1065-
1070+
10661071
return true;
10671072
}
10681073

0 commit comments

Comments
 (0)