43 lines
1.3 KiB
Dart
43 lines
1.3 KiB
Dart
import 'package:ef/ef.dart';
|
||
import 'package:json_annotation/json_annotation.dart';
|
||
|
||
part 'device_calibration_controller.g.dart'; // 由json_serializable自动生成的部分
|
||
|
||
@JsonSerializable()
|
||
class DeviceCalibrationModel {
|
||
DeviceCalibrationModel();
|
||
|
||
factory DeviceCalibrationModel.fromJson(Map<String, dynamic> json) {
|
||
try {
|
||
return _$DeviceCalibrationModelFromJson(json);
|
||
} catch (e) {
|
||
return DeviceCalibrationModel(); // 或者返回一个带有错误信息的特定DeviceInfoModel实例
|
||
}
|
||
}
|
||
|
||
// 序列化为JSON时的异常处理
|
||
Map<String, dynamic> toJson() => _$DeviceCalibrationModelToJson(this);
|
||
}
|
||
|
||
class DeviceCalibrationController
|
||
extends GetControllerEx<DeviceCalibrationModel> {
|
||
DeviceCalibrationController() {
|
||
attr = GetModel(DeviceCalibrationModel()).obs;
|
||
}
|
||
|
||
RxInt process = 0.obs; //校准流程 0.离床校准 1.位置校准
|
||
RxInt bed_calibration = 0.obs; //0.未完成 1.完成
|
||
RxInt position_calibration = 0.obs; //0.未完成 1.完成
|
||
RxInt bed_type = 0.obs; //0.单人 1.双人
|
||
RxString tips = "".obs;
|
||
RxInt flag = 0.obs; //0没有开始 1:校准中 2.校准完成 3.校准失败
|
||
RxString statusContext = "".obs;
|
||
|
||
|
||
RxInt cd = 10000.obs;
|
||
bool forceStart = false;
|
||
|
||
RxInt motionTips = 0.obs;//体动提示
|
||
RxInt inBedTips = 0.obs;//在床提示
|
||
}
|