summaryrefslogtreecommitdiff
path: root/grapher/Models/Options/LUT
diff options
context:
space:
mode:
authora1xd <[email protected]>2021-09-06 23:24:51 -0400
committera1xd <[email protected]>2021-09-07 05:08:25 -0400
commit404b272a558b0bb915e182b01849c9631f829619 (patch)
tree5479599472ed0d88561f12677898febcce6fe4d7 /grapher/Models/Options/LUT
parentincrease lut points capacity to 257 (diff)
downloadrawaccel-404b272a558b0bb915e182b01849c9631f829619.tar.xz
rawaccel-404b272a558b0bb915e182b01849c9631f829619.zip
get grapher building
Diffstat (limited to 'grapher/Models/Options/LUT')
-rw-r--r--grapher/Models/Options/LUT/LUTPanelOptions.cs21
1 files changed, 16 insertions, 5 deletions
diff --git a/grapher/Models/Options/LUT/LUTPanelOptions.cs b/grapher/Models/Options/LUT/LUTPanelOptions.cs
index 0d244b4..1d9905f 100644
--- a/grapher/Models/Options/LUT/LUTPanelOptions.cs
+++ b/grapher/Models/Options/LUT/LUTPanelOptions.cs
@@ -111,15 +111,26 @@ namespace grapher.Models.Options.LUT
// Nothing to do here.
}
- public void SetActiveValues(IEnumerable<Vec2<float>> activePoints, int length)
+ public void SetActiveValues(IEnumerable<float> rawData, int length, AccelMode mode)
{
- if (length > 0 && activePoints.First().x != 0)
+ if (mode == AccelMode.lut && length > 1 && rawData.First() != 0)
{
- ActiveValuesTextBox.Text = PointsToActiveValuesText(activePoints, length);
+ var pointsLen = length / 2;
+ var points = new Vec2<float>[pointsLen];
+ for (int i = 0; i < pointsLen; i++)
+ {
+ var data_idx = i * 2;
+ points[i] = new Vec2<float>
+ {
+ x = rawData.ElementAt(data_idx),
+ y = rawData.ElementAt(data_idx + 1)
+ };
+ }
+ ActiveValuesTextBox.Text = PointsToActiveValuesText(points, length);
if (string.IsNullOrWhiteSpace(PointsTextBox.Text))
{
- PointsTextBox.Text = PointsToEntryTextBoxText(activePoints, length);
+ PointsTextBox.Text = PointsToEntryTextBoxText(points, length);
}
}
else
@@ -140,7 +151,7 @@ namespace grapher.Models.Options.LUT
throw new Exception("Text must be entered in text box to fill Look Up Table.");
}
- Vec2<float>[] points = new Vec2<float>[256];
+ Vec2<float>[] points = new Vec2<float>[AccelArgs.MaxLutPoints];
var userTextSplit = userText.Trim().Trim(';').Split(';');
int index = 0;