新增猫眼读取配置接口

This commit is contained in:
Daisy 2024-03-28 14:43:55 +08:00
parent 48033eecb6
commit 29705929cb
3 changed files with 249 additions and 105 deletions

View File

@ -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;
}
}
}
}

View File

@ -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,
}

View File

@ -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<String, dynamic> 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<String, dynamic> 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<String, dynamic> json) {
@ -458,33 +458,60 @@ class LockSettingInfo {
int? motorTorsion;
int? stayWarn;
int? abnormalWarn;
List<CatEyeModeConfig>? 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<String, dynamic> json) {
remoteUnlock = json['remoteUnlock'];
@ -517,6 +544,24 @@ class LockSettingInfo {
motorTorsion = json['motorTorsion'];
stayWarn = json['stayWarn'];
abnormalWarn = json['abnormalWarn'];
if (json['catEyeConfig'] != null) {
catEyeConfig = <CatEyeModeConfig>[];
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<String, dynamic> 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<String, dynamic> json) {
catEyeMode = json['catEyeMode'];
catEyeModeConfig = json['catEyeModeConfig'] != null
? CatEyeModeConfig.fromJson(json['catEyeModeConfig'])
: null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
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<String, dynamic> json) {
recordMode = json['recordMode'];
recordTime = json['recordTime'];
realTimeMode = json['realTimeMode'];
recordEndTime = json['recordEndTime'];
recordStartTime = json['recordStartTime'];
detectionDistance = json['detectionDistance'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['recordMode'] = recordMode;
data['recordTime'] = recordTime;
data['realTimeMode'] = realTimeMode;
data['recordEndTime'] = recordEndTime;
data['recordStartTime'] = recordStartTime;
data['detectionDistance'] = detectionDistance;
return data;
}
}