From f806ad8a00ab8c45af2aa7045b8e3dce91bcd802 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 1 Jan 2019 18:57:35 -0600 Subject: [PATCH] Scale the diagnostics bars differently for FSRs. --- smx-config/DiagnosticsWidgets.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/smx-config/DiagnosticsWidgets.cs b/smx-config/DiagnosticsWidgets.cs index 64c4486..4f20460 100644 --- a/smx-config/DiagnosticsWidgets.cs +++ b/smx-config/DiagnosticsWidgets.cs @@ -254,7 +254,8 @@ namespace smx_config // Update the level bar from the test mode data for the selected panel. for(int sensor = 0; sensor < 4; ++sensor) { - Int16 value = args.controller[SelectedPad].test_data.sensorLevel[PanelIndex*4+sensor]; + var controllerData = args.controller[SelectedPad]; + Int16 value = controllerData.test_data.sensorLevel[PanelIndex*4+sensor]; if(GetTestMode() == SMX.SMX.SensorTestMode.Noise) { @@ -286,7 +287,10 @@ namespace smx_config if(value < 0 && value >= -10) value = 0; - LevelBars[sensor].Value = value / 500.0; + // Scale differently depending on if this is an FSR panel or a load cell panel. + bool isFSR = controllerData.config.masterVersion >= 4 && controllerData.test_data.bFSRPerPanel[PanelIndex*4+sensor]; + float maxValue = isFSR? 1023:500; + LevelBars[sensor].Value = value / maxValue; LevelBarText[sensor].Content = value; LevelBars[sensor].Error = false; }