新增猫眼读取配置接口

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() { CatEyeSetState() {
Map map = Get.arguments; Map map = Get.arguments;
lockSetInfoData.value = map["lockSetInfoData"]; 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, 'recordMode': state.recordMode.value,
'recordStartTime': state.recordStartTime.value, 'recordStartTime': state.recordStartTime.value,
'recordEndTime': state.recordEndTime.value, 'recordEndTime': state.recordEndTime.value,
'recordTime': state.recordTime.value,
'detectionDistance': state.detectionDistance.value, 'detectionDistance': state.detectionDistance.value,
'realTimeMode': state.realTimeMode.value, 'realTimeMode': state.realTimeMode.value,
} }

View File

@ -33,8 +33,8 @@ class LockSetInfoData {
LockBasicInfo? lockBasicInfo; LockBasicInfo? lockBasicInfo;
LockSettingInfo? lockSettingInfo; LockSettingInfo? lockSettingInfo;
LockSetInfoData({ LockSetInfoData(
this.lockId, {this.lockId,
this.lockStatus, this.lockStatus,
this.lockFeature, this.lockFeature,
this.lockBasicInfo, this.lockBasicInfo,
@ -145,8 +145,8 @@ class LockFeature {
int? stayWarn; int? stayWarn;
int? abnormalWarn; int? abnormalWarn;
LockFeature( LockFeature({
{this.password, this.password,
this.icCard, this.icCard,
this.fingerprint, this.fingerprint,
this.fingerVein, this.fingerVein,
@ -197,7 +197,8 @@ class LockFeature {
this.attendance, this.attendance,
this.motorTorsion, this.motorTorsion,
this.stayWarn, this.stayWarn,
this.abnormalWarn,}); this.abnormalWarn,
});
LockFeature.fromJson(Map<String, dynamic> json) { LockFeature.fromJson(Map<String, dynamic> json) {
password = json['password']; password = json['password'];
@ -335,8 +336,7 @@ class LockBasicInfo {
int? lockUserNo; int? lockUserNo;
LockBasicInfo( LockBasicInfo(
{ {this.lockId,
this.lockId,
this.electricQuantityDate, this.electricQuantityDate,
this.keyId, this.keyId,
this.model, this.model,
@ -458,9 +458,22 @@ class LockSettingInfo {
int? motorTorsion; int? motorTorsion;
int? stayWarn; int? stayWarn;
int? abnormalWarn; 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( LockSettingInfo({
{this.remoteUnlock, this.remoteUnlock,
this.autoLock, this.autoLock,
this.autoLockSecond, this.autoLockSecond,
this.antiPrySwitch, this.antiPrySwitch,
@ -484,7 +497,21 @@ class LockSettingInfo {
this.languageSettingLangText, this.languageSettingLangText,
this.motorTorsion, this.motorTorsion,
this.stayWarn, this.stayWarn,
this.abnormalWarn,}); 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) { LockSettingInfo.fromJson(Map<String, dynamic> json) {
remoteUnlock = json['remoteUnlock']; remoteUnlock = json['remoteUnlock'];
@ -517,6 +544,24 @@ class LockSettingInfo {
motorTorsion = json['motorTorsion']; motorTorsion = json['motorTorsion'];
stayWarn = json['stayWarn']; stayWarn = json['stayWarn'];
abnormalWarn = json['abnormalWarn']; 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() { Map<String, dynamic> toJson() {
@ -549,6 +594,22 @@ class LockSettingInfo {
data['motorTorsion'] = motorTorsion; data['motorTorsion'] = motorTorsion;
data['stayWarn'] = stayWarn; data['stayWarn'] = stayWarn;
data['abnormalWarn'] = abnormalWarn; 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; 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;
}
}