From 29705929cb9baf2cacc7416689a2b487fe5d6856 Mon Sep 17 00:00:00 2001 From: Daisy <> Date: Thu, 28 Mar 2024 14:43:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=8C=AB=E7=9C=BC=E8=AF=BB?= =?UTF-8?q?=E5=8F=96=E9=85=8D=E7=BD=AE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../catEyeSet/catEyeSet/catEyeSet_state.dart | 23 ++ .../catEyeWorkMode/catEyeWorkMode_logic.dart | 1 + .../lockSet/lockSet/lockSetInfo_entity.dart | 330 ++++++++++++------ 3 files changed, 249 insertions(+), 105 deletions(-) diff --git a/star_lock/lib/main/lockDetail/lockSet/catEyeSet/catEyeSet/catEyeSet_state.dart b/star_lock/lib/main/lockDetail/lockSet/catEyeSet/catEyeSet/catEyeSet_state.dart index d60fc960..2173b8f6 100644 --- a/star_lock/lib/main/lockDetail/lockSet/catEyeSet/catEyeSet/catEyeSet_state.dart +++ b/star_lock/lib/main/lockDetail/lockSet/catEyeSet/catEyeSet/catEyeSet_state.dart @@ -13,5 +13,28 @@ 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} 秒'; + 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; + } + } } } diff --git a/star_lock/lib/main/lockDetail/lockSet/catEyeSet/catEyeWorkMode/catEyeWorkMode_logic.dart b/star_lock/lib/main/lockDetail/lockSet/catEyeSet/catEyeWorkMode/catEyeWorkMode_logic.dart index 22af4d71..8001f7cc 100644 --- a/star_lock/lib/main/lockDetail/lockSet/catEyeSet/catEyeWorkMode/catEyeWorkMode_logic.dart +++ b/star_lock/lib/main/lockDetail/lockSet/catEyeSet/catEyeWorkMode/catEyeWorkMode_logic.dart @@ -15,6 +15,7 @@ class CatEyeWorkModeLogic extends BaseGetXController { 'recordMode': state.recordMode.value, 'recordStartTime': state.recordStartTime.value, 'recordEndTime': state.recordEndTime.value, + 'recordTime': state.recordTime.value, 'detectionDistance': state.detectionDistance.value, 'realTimeMode': state.realTimeMode.value, } diff --git a/star_lock/lib/main/lockDetail/lockSet/lockSet/lockSetInfo_entity.dart b/star_lock/lib/main/lockDetail/lockSet/lockSet/lockSetInfo_entity.dart index 2e55d9b9..a341a000 100644 --- a/star_lock/lib/main/lockDetail/lockSet/lockSet/lockSetInfo_entity.dart +++ b/star_lock/lib/main/lockDetail/lockSet/lockSet/lockSetInfo_entity.dart @@ -33,12 +33,12 @@ class LockSetInfoData { LockBasicInfo? lockBasicInfo; LockSettingInfo? lockSettingInfo; - LockSetInfoData({ - this.lockId, - this.lockStatus, - this.lockFeature, - this.lockBasicInfo, - this.lockSettingInfo}); + LockSetInfoData( + {this.lockId, + this.lockStatus, + this.lockFeature, + this.lockBasicInfo, + this.lockSettingInfo}); LockSetInfoData.fromJson(Map json) { lockId = json['lockId']; @@ -145,59 +145,60 @@ class LockFeature { int? stayWarn; int? abnormalWarn; - LockFeature( - {this.password, - this.icCard, - this.fingerprint, - this.fingerVein, - this.palmVein, - this.d3Face, - this.qrCode, - this.bluetoothRemoteControl, - this.wirelessKey, - this.gatewayUnlock, - this.lockCommand, - this.firmwareUpgrade, - this.passwordIssue, - this.cardIssue, - this.fingerprintIssue, - this.fingerVeinIssue, - this.palmVeinIssue, - this.d3FaceIssue, - this.lockFreeze, - this.readAdminPassword, - this.passwordManagement, - this.passwordWithDelete, - this.remoteUnlock, - this.autoLock, - this.antiPrySwitch, - this.resetSwitch, - this.lockSwitch, - this.lockSound, - this.languageSetting, - this.realTimeClock, - this.wifi, - this.videoIntercom, - this.cyclePassword, - this.cycleFingerprintCard, - this.doubleAuthentication, - this.openDirection, - this.proximitySensing, - this.doorStatus, - this.wiredDoorMagnet, - this.wirelessDoorMagnet, - this.doorNotClosedAlarm, - this.unlockReminder, - this.wirelessKeyboard, - this.lightingTime, - this.passageMode, - this.hotelLockCardSystem, - this.appUnlockOnline, - this.bluetoothBroadcast, - this.attendance, - this.motorTorsion, - this.stayWarn, - this.abnormalWarn,}); + LockFeature({ + this.password, + this.icCard, + this.fingerprint, + this.fingerVein, + this.palmVein, + this.d3Face, + this.qrCode, + this.bluetoothRemoteControl, + this.wirelessKey, + this.gatewayUnlock, + this.lockCommand, + this.firmwareUpgrade, + this.passwordIssue, + this.cardIssue, + this.fingerprintIssue, + this.fingerVeinIssue, + this.palmVeinIssue, + this.d3FaceIssue, + this.lockFreeze, + this.readAdminPassword, + this.passwordManagement, + this.passwordWithDelete, + this.remoteUnlock, + this.autoLock, + this.antiPrySwitch, + this.resetSwitch, + this.lockSwitch, + this.lockSound, + this.languageSetting, + this.realTimeClock, + this.wifi, + this.videoIntercom, + this.cyclePassword, + this.cycleFingerprintCard, + this.doubleAuthentication, + this.openDirection, + this.proximitySensing, + this.doorStatus, + this.wiredDoorMagnet, + this.wirelessDoorMagnet, + this.doorNotClosedAlarm, + this.unlockReminder, + this.wirelessKeyboard, + this.lightingTime, + this.passageMode, + this.hotelLockCardSystem, + this.appUnlockOnline, + this.bluetoothBroadcast, + this.attendance, + this.motorTorsion, + this.stayWarn, + this.abnormalWarn, + }); LockFeature.fromJson(Map json) { password = json['password']; @@ -335,26 +336,25 @@ class LockBasicInfo { int? lockUserNo; LockBasicInfo( - { - this.lockId, - this.electricQuantityDate, - this.keyId, - this.model, - this.electricQuantity, - this.indate, - this.isLockOwner, - this.lockAlias, - this.lockName, - this.groupId, - this.groupName, - this.groupData, - this.adminPwd, - this.keyType, - this.startDate, - this.endDate, - this.mac, - this.keyRight, - this.senderUserId, + {this.lockId, + this.electricQuantityDate, + this.keyId, + this.model, + this.electricQuantity, + this.indate, + this.isLockOwner, + this.lockAlias, + this.lockName, + this.groupId, + this.groupName, + this.groupData, + this.adminPwd, + this.keyType, + this.startDate, + this.endDate, + this.mac, + this.keyRight, + this.senderUserId, this.lockUserNo}); LockBasicInfo.fromJson(Map json) { @@ -458,33 +458,60 @@ class LockSettingInfo { int? motorTorsion; int? stayWarn; int? abnormalWarn; + List? catEyeConfig; + int? faceSwitch; //人脸开关 0:关闭 1:开启 + int? faceAutoLightScreen; //人脸自动亮屏开关 0:关闭 1:开启 + int? faceInductionDistance; //人脸感应距离 + int? faceAntiMistakeOpen; //人脸防误开门 0:关闭 1:开启 + int? autoLightScreen; //猫眼-自动亮屏开关 0:关闭 1:开启 + int? autoLightScreenTime; //猫眼-自动亮屏时间 + int? dayNotOpenDoorSwitch; //N天未开门开关 (启用/禁用) + int? dayNotOpenDoorValue; //N天未开门值 + int? doorNotCloseSwitch; //门未关闭开关 (启用/禁用) + int? lowElecNoticeSwitch; //低电量开关 (启用/禁用) + int? doorbellNoticeSwitch; //有人按门铃开关 (启用/禁用) + int? someoneAtDoorSwitch; //有人出现在门口开关 (启用/禁用)// - LockSettingInfo( - {this.remoteUnlock, - this.autoLock, - this.autoLockSecond, - this.antiPrySwitch, - this.resetSwitch, - this.lockSwitch, - this.lockSound, - this.lockSoundVolume, - this.languageSettingLang, - this.openDirectionValue, - this.doorNotClosedAlarm, - this.unlockReminder, - this.lightingTime, - this.lightingSecond, - this.passageMode, - this.passageModeConfig, - this.attendance, - this.appUnlockOnline, - this.bluetoothBroadcast, - this.adminPwd, - this.unlockReminderPush, - this.languageSettingLangText, - this.motorTorsion, - this.stayWarn, - this.abnormalWarn,}); + LockSettingInfo({ + this.remoteUnlock, + this.autoLock, + this.autoLockSecond, + this.antiPrySwitch, + this.resetSwitch, + this.lockSwitch, + this.lockSound, + this.lockSoundVolume, + this.languageSettingLang, + this.openDirectionValue, + this.doorNotClosedAlarm, + this.unlockReminder, + this.lightingTime, + this.lightingSecond, + this.passageMode, + this.passageModeConfig, + this.attendance, + this.appUnlockOnline, + this.bluetoothBroadcast, + this.adminPwd, + this.unlockReminderPush, + this.languageSettingLangText, + this.motorTorsion, + this.stayWarn, + this.abnormalWarn, + this.catEyeConfig, + this.faceSwitch, + this.faceAutoLightScreen, + this.faceInductionDistance, + this.faceAntiMistakeOpen, + this.autoLightScreen, + this.autoLightScreenTime, + this.dayNotOpenDoorSwitch, + this.dayNotOpenDoorValue, + this.doorNotCloseSwitch, + this.lowElecNoticeSwitch, + this.doorbellNoticeSwitch, + this.someoneAtDoorSwitch, + }); LockSettingInfo.fromJson(Map json) { remoteUnlock = json['remoteUnlock']; @@ -517,6 +544,24 @@ class LockSettingInfo { motorTorsion = json['motorTorsion']; stayWarn = json['stayWarn']; abnormalWarn = json['abnormalWarn']; + if (json['catEyeConfig'] != null) { + catEyeConfig = []; + json['catEyeConfig'].forEach((v) { + catEyeConfig!.add(CatEyeModeConfig.fromJson(v)); + }); + } + faceSwitch = json['faceSwitch']; + faceAutoLightScreen = json['faceAutoLightScreen']; + faceInductionDistance = json['faceInductionDistance']; + faceAntiMistakeOpen = json['faceAntiMistakeOpen']; + autoLightScreen = json['autoLightScreen']; + autoLightScreenTime = json['autoLightScreenTime']; + dayNotOpenDoorSwitch = json['dayNotOpenDoorSwitch']; + dayNotOpenDoorValue = json['dayNotOpenDoorValue']; + doorNotCloseSwitch = json['doorNotCloseSwitch']; + lowElecNoticeSwitch = json['lowElecNoticeSwitch']; + doorbellNoticeSwitch = json['doorbellNoticeSwitch']; + someoneAtDoorSwitch = json['someoneAtDoorSwitch']; } Map toJson() { @@ -549,6 +594,22 @@ class LockSettingInfo { data['motorTorsion'] = motorTorsion; data['stayWarn'] = stayWarn; data['abnormalWarn'] = abnormalWarn; + if (catEyeConfig != null) { + data['catEyeConfig'] = catEyeConfig!.map((v) => v.toJson()).toList(); + } + data['faceSwitch'] = faceSwitch; + data['faceAutoLightScreen'] = faceAutoLightScreen; + data['faceInductionDistance'] = faceInductionDistance; + data['faceAntiMistakeOpen'] = faceAntiMistakeOpen; + data['autoLightScreen'] = autoLightScreen; + data['autoLightScreenTime'] = autoLightScreenTime; + data['dayNotOpenDoorSwitch'] = dayNotOpenDoorSwitch; + data['dayNotOpenDoorValue'] = dayNotOpenDoorValue; + data['doorNotCloseSwitch'] = doorNotCloseSwitch; + data['lowElecNoticeSwitch'] = lowElecNoticeSwitch; + data['doorbellNoticeSwitch'] = doorbellNoticeSwitch; + data['someoneAtDoorSwitch'] = someoneAtDoorSwitch; + return data; } } @@ -579,3 +640,62 @@ class PassageModeConfig { } } +class CatEyeConfig { + int? catEyeMode; + CatEyeModeConfig? catEyeModeConfig; + + CatEyeConfig({this.catEyeMode, this.catEyeModeConfig}); + + CatEyeConfig.fromJson(Map json) { + catEyeMode = json['catEyeMode']; + catEyeModeConfig = json['catEyeModeConfig'] != null + ? CatEyeModeConfig.fromJson(json['catEyeModeConfig']) + : null; + } + + Map toJson() { + final Map data = {}; + data['catEyeMode'] = catEyeMode; + if (catEyeModeConfig != null) { + data['catEyeModeConfig'] = catEyeModeConfig!.toJson(); + } + return data; + } +} + +class CatEyeModeConfig { + int? recordMode; + String? recordTime; + int? realTimeMode; + int? recordEndTime; + int? recordStartTime; + double? detectionDistance; + + CatEyeModeConfig( + {this.recordMode, + this.recordTime, + this.realTimeMode, + this.recordEndTime, + this.recordStartTime, + this.detectionDistance}); + + CatEyeModeConfig.fromJson(Map json) { + recordMode = json['recordMode']; + recordTime = json['recordTime']; + realTimeMode = json['realTimeMode']; + recordEndTime = json['recordEndTime']; + recordStartTime = json['recordStartTime']; + detectionDistance = json['detectionDistance']; + } + + Map toJson() { + final Map data = {}; + data['recordMode'] = recordMode; + data['recordTime'] = recordTime; + data['realTimeMode'] = realTimeMode; + data['recordEndTime'] = recordEndTime; + data['recordStartTime'] = recordStartTime; + data['detectionDistance'] = detectionDistance; + return data; + } +}