修复校准
This commit is contained in:
@@ -205,7 +205,7 @@ class _MHTBlueteethDevicePageState extends State<MHTBlueteethDevicePage> {
|
||||
}
|
||||
|
||||
void _startPeriodicScan() {
|
||||
_timer = Timer.periodic(Duration(seconds: 10), (timer) {
|
||||
_timer = Timer.periodic(Duration(seconds: 3), (timer) {
|
||||
if (mhtBlueToothController.shouldScan.value && !isScanning) {
|
||||
_removeOldDevices(); // 先清理老旧设备
|
||||
_startScanning();
|
||||
|
||||
@@ -734,7 +734,7 @@ class _MHTCalibrationPageState extends State<MHTCalibrationPage> {
|
||||
|
||||
void _startPollingProgress(
|
||||
String serviceAddress, String progressApi, bool isSecondStep) {
|
||||
_requestProgress(serviceAddress, progressApi, isSecondStep);
|
||||
// _requestProgress(serviceAddress, progressApi, isSecondStep);
|
||||
_pollingTimer = Timer.periodic(Duration(seconds: 1), (_) {
|
||||
_requestProgress(serviceAddress, progressApi, isSecondStep);
|
||||
});
|
||||
@@ -866,6 +866,14 @@ class _MHTCalibrationPageState extends State<MHTCalibrationPage> {
|
||||
|
||||
void _handleCalibrationFailure(String message) {
|
||||
_pollingTimer?.cancel();
|
||||
if (deviceCalibrationController.cd.value != 10000) {
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: message,
|
||||
textColor: themeController.currentColor.sc9,
|
||||
);
|
||||
}
|
||||
|
||||
deviceCalibrationController.statusContext.value = "";
|
||||
deviceCalibrationController.bed_calibration.value == 0;
|
||||
blueteethBindController.cid?.value = "";
|
||||
@@ -875,11 +883,6 @@ class _MHTCalibrationPageState extends State<MHTCalibrationPage> {
|
||||
deviceCalibrationController.cd.value = 10000;
|
||||
deviceCalibrationController.updateAll();
|
||||
failureNotifier.value = true;
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
text: message,
|
||||
textColor: themeController.currentColor.sc9,
|
||||
);
|
||||
}
|
||||
|
||||
void _startCalibration(bool isSecondStep) {
|
||||
@@ -904,7 +907,7 @@ class _MHTCalibrationPageState extends State<MHTCalibrationPage> {
|
||||
data["side"] = currentCalibrationStep.value == 1 ? "A" : "B";
|
||||
}
|
||||
}
|
||||
|
||||
data['cancel'] = true;
|
||||
requestWithLog(
|
||||
logTitle: "设备校准",
|
||||
method: MyHttpMethod.post,
|
||||
|
||||
Reference in New Issue
Block a user