| 216 | } |
| 217 | |
| 218 | void MainWindow::updateData() { |
| 219 | if (!isUpdateDataError && (operate.isMsiEcLoaded() || operate.isEcSysModuleLoaded())) { |
| 220 | if (!isActive) { |
| 221 | operate.doProbe(); |
| 222 | setTabsEnabled(true); |
| 223 | loadConfigs(); |
| 224 | isActive = true; |
| 225 | } |
| 226 | updateBatteryCharge(); |
| 227 | updateChargingStatus(); |
| 228 | updateCpuTemp(); |
| 229 | updateGpuTemp(); |
| 230 | updateFanMode(); |
| 231 | updateFan1Speed(); |
| 232 | updateFan2Speed(); |
| 233 | updateKeyboardBrightness(); |
| 234 | updateWebCamState(); |
| 235 | |
| 236 | if (operate.isMsiEcLoaded()) { |
| 237 | ui->MsiEcStatusLabel->setText(tr("Loaded")); |
| 238 | } else { |
| 239 | ui->MsiEcStatusLabel->setText(tr("Fallback: Only ec_sys is loaded")); |
| 240 | } |
| 241 | } else { |
| 242 | setTabsEnabled(false); |
| 243 | ui->MsiEcStatusLabel->setText(tr("Failed to load both msi-ec/ec_sys")); |
| 244 | isActive = false; |
| 245 | } |
| 246 | } |
| 247 | |
| 248 | void MainWindow::loadConfigs() { |
| 249 | ui->ecVersionValueLabel->setText(QString::fromStdString(operate.getEcVersion())); |
nothing calls this directly
no test coverage detected