Commit 04200fac authored by Adriaan de Groot's avatar Adriaan de Groot 💬
Browse files

Re-calibrate sensor if the range is set to auto-calibrate

When the range is set to 0-0 from the properties dialog,
re-calibrate the sensor like it would be when being
re-loaded from the settings file. Otherwise, the range
is set and kept and the sensor cannot display anything
until ksysguard is re-started (and it gets re-calibrated
on load).
parent b972e777
......@@ -120,6 +120,14 @@ void DancingBars::configureSettings()
removeSensor(deletedIds[i]);
}
// If the range has reset to "auto-range" then we need to ask for
// sensor info to re-calibrate. In answerReceived() there's a special-
// case recalibrating on sensor 0 (with id 100), so ask for that one.
if ( mPlotter->getMin() == 0.0 && mPlotter->getMax() == 0.0 && mBars > 0 ) {
const auto& sensor = sensors().at( 0 );
// The 100 is magic in answerReceived()
sendRequest( sensor->hostName(), sensor->name() + QLatin1Char('?'), 100 );
}
repaint();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment