Skip to content

Commit

Permalink
Update Rhs2116StepSize automatically, and check zooming boundaries fo…
Browse files Browse the repository at this point in the history
…r waveforms

- Step size is no longer selectable; users enter a target amplitude, and the smallest possible step size is chosen automatically
  - Step size is now only updated during `Add Pulses`; existing amplitudes are preserved if possible, or removed if they are incompatible with the new step size
- Cathodic / anodic amplitudes are now processed correctly if `Biphasic Symmetric` is unchecked
- Added a parsing check for the data grid view in case the user tries to manually enter a value outside of the bounds of a byte
- Add icon to dialogs
- Reversed Y-axis orientation for waveforms
- The waveform now zooms in on the cursor, and has boundaries both zooming in and zooming out
  • Loading branch information
bparks13 committed Oct 8, 2024
1 parent 0cf1321 commit ef66b0a
Show file tree
Hide file tree
Showing 7 changed files with 2,089 additions and 160 deletions.
43 changes: 21 additions & 22 deletions OpenEphys.Onix1.Design/ChannelConfigurationDialog.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions OpenEphys.Onix1.Design/ChannelConfigurationDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ private void CenterAxesOnCursor(ZedGraphControl zedGraphControl)

var currentMousePosition = TransformPixelsToCoordinates(mouseClientPosition, zedGraphControl.GraphPane);

var centerX = CalculateScaleRange(zedGraphChannels.GraphPane.XAxis.Scale) / 2 +
var centerX = CalculateScaleRange(zedGraphControl.GraphPane.XAxis.Scale) / 2 +
zedGraphControl.GraphPane.XAxis.Scale.Min;

var centerY = CalculateScaleRange(zedGraphChannels.GraphPane.YAxis.Scale) / 2 +
var centerY = CalculateScaleRange(zedGraphControl.GraphPane.YAxis.Scale) / 2 +
zedGraphControl.GraphPane.YAxis.Scale.Min;

var diffX = centerX - currentMousePosition.X;
Expand Down
8 changes: 4 additions & 4 deletions OpenEphys.Onix1.Design/DesignHelper.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
Expand All @@ -13,10 +13,10 @@ static class DesignHelper
/// Given a string with a valid JSON structure, deserialize the string to the given type.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="channelLayout"></param>
/// <param name="jsonString"></param>
/// <returns></returns>
#nullable enable
public static T? DeserializeString<T>(string channelLayout)
public static T? DeserializeString<T>(string jsonString)
{
var errors = new List<string>();

Expand All @@ -29,7 +29,7 @@ static class DesignHelper
}
};

var obj = JsonConvert.DeserializeObject<T>(channelLayout, serializerSettings);
var obj = JsonConvert.DeserializeObject<T>(jsonString, serializerSettings);

if (errors.Count > 0)
{
Expand Down
Loading

0 comments on commit ef66b0a

Please sign in to comment.