79 lines
2.2 KiB
Dart
Executable File

import 'package:get/get.dart';
import 'package:star_lock/main/lockDetail/lockSet/lockSet/lockSetInfo_entity.dart';
class CatEyeSetState {
CatEyeSetState() {
Map map = Get.arguments;
lockSetInfoData.value = map['lockSetInfoData'];
if (lockSetInfoData.value != null &&
lockSetInfoData.value.lockSettingInfo != null) {
selectBrightDuration.value =
'${lockSetInfoData.value.lockSettingInfo?.autoLightScreenTime} ${''.tr}';
if (lockSetInfoData.value.lockSettingInfo?.autoLightScreen == 1) {
isAutoBright.value = true;
} else {
isAutoBright.value = false;
}
if (lockSetInfoData.value.lockSettingInfo?.stayWarn == 1) {
isStayWarning.value = true;
} else {
isStayWarning.value = false;
}
if (lockSetInfoData.value.lockSettingInfo?.abnormalWarn == 1) {
isExceptionWarning.value = true;
} else {
isExceptionWarning.value = false;
}
}
}
RxList<String> brightDurationTimeList =
<String>['10${''.tr}', '15${''.tr}', '20${''.tr}'].obs;
RxString selectBrightDuration = '10 ${''.tr}'.obs; //选中的亮屏持续时间
RxBool isAutoBright = false.obs; //自动亮屏
RxBool isStayWarning = false.obs; //逗留警告
RxBool isExceptionWarning = false.obs; //异常警告
Rx<LockSetInfoData> lockSetInfoData = LockSetInfoData().obs;
RxString selectCatEyeWorkMode = ''.obs; //猫眼工作模式
final String settingSuccess = '设置成功'.tr;
/// 猫眼配置
Rx<CatEyeSetEntity> catEyeConfig = CatEyeSetEntity().obs;
}
class CatEyeSetEntity {
int? catEyeMode; // 猫眼工作模式
int? recordMode; // 自定义模式下录像时段,是否
int? recordTime; //
int? realTimeMode;
int? recordEndTime;
int? recordStartTime;
int? detectionDistance;
int? autoLightScreen;
int? autoLightScreenTime;
int? stayWarn;
int? abnormalWarn;
int? realTimePicture;
CatEyeSetEntity({
this.catEyeMode,
this.recordMode,
this.recordTime,
this.realTimeMode,
this.recordEndTime,
this.recordStartTime,
this.detectionDistance,
this.autoLightScreen,
this.autoLightScreenTime,
this.stayWarn,
this.abnormalWarn,
this.realTimePicture,
});
}