Scale the diagnostics bars differently for FSRs.

master
Glenn Maynard 6 years ago
parent a2eb0c7591
commit f806ad8a00
  1. 8
      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;
}

Loading…
Cancel
Save