cameraCommand method
Implementation
Future<void> cameraCommand(StatusResult result) async {
if (result.haveMotor == "1" && motorCommand == null) {
motorCommand = MotorCommand(this);
}
int? supportMode = int.tryParse(result.hardwareTestFunc ?? "");
if (supportMode != null &&
supportMode & 0x04 != 0 &&
lightCommand == null) {
lightCommand = LightCommand(this);
}
//预置位巡航计划、巡航线
if (result.support_presetCruise == "1" && presetCruiseCommand == null) {
presetCruiseCommand = PresetCruiseCommand(this);
}
//红蓝灯
if (supportMode != null &&
supportMode & 0x0A != 0 &&
redBlueLightCommand == null) {
redBlueLightCommand = RedBlueLightCommand(this);
}
if (supportMode != null &&
supportMode & 0x08 != 0 &&
sirenCommand == null) {
sirenCommand = SirenCommand(this);
}
if (result.haveWifi == "1" && wifiCommand == null) {
wifiCommand = WifiCommand(this);
}
if (result.support_led_hidden_mode == "1" && ledCommand == null) {
ledCommand = LedCommand(this);
}
if (result.support_low_power != null &&
result.support_low_power != "0" &&
powerCommand == null) {
powerCommand = PowerCommand(this);
}
if (((result.support_mode_switch != null &&
result.support_mode_switch != "0") ||
["3", "4", "5", "6"].contains(result.support_low_power)) &&
dvrCommand == null) {
dvrCommand = DVRCommand(this);
}
if (result.support_4G_module != null &&
result.support_4G_module != "0" &&
mobileCommand == null) {
mobileCommand = MobileCommand(this);
mobileCommand!.getMobileInfo();
}
if (passwordCommand == null) {
passwordCommand = PasswordCommand(this, result);
}
if (multipleZoomCommand == null) {
multipleZoomCommand = MultipleZoomCommand(this);
}
if (result.support_privacy_pos != null &&
int.tryParse(result.support_privacy_pos!)! > 0 &&
privacyPositionCommand == null) {
privacyPositionCommand = PrivacyPositionCommand(this);
}
if (result.support_Remote_PowerOnOff_Switch != null &&
int.tryParse(result.support_Remote_PowerOnOff_Switch!)! > 0 &&
powerSwitchCommand == null) {
powerSwitchCommand = PowerSwitchCommand(this);
}
if (result.support_WiFi_Enhanced_Mode != null &&
int.tryParse(result.support_WiFi_Enhanced_Mode!)! > 0 &&
wifiEnhancedModeCommand == null) {
wifiEnhancedModeCommand = WifiEnhancedModeCommand(this);
}
//支持新的定时白光灯/红外灯控制
if (result.support_WhiteLed_Ctrl != null &&
int.tryParse(result.support_WhiteLed_Ctrl!)! > 0 &&
whiteLedCommand == null) {
whiteLedCommand = WhiteLedCommand(this);
}
//检测间隔
if (result.support_SleepCheckInterval != null &&
int.tryParse(result.support_SleepCheckInterval!)! > 0 &&
checkIntervalCommand == null) {
checkIntervalCommand = CheckIntervalCommand(this);
}
//徘徊检测
if (result.support_LingerCheck != null &&
int.tryParse(result.support_LingerCheck!)! > 0 &&
checkIntervalCommand == null) {
checkIntervalCommand = CheckIntervalCommand(this);
}
//门铃解除防拆报警
if (result.support_tamper_setting != null &&
int.tryParse(result.support_tamper_setting!)! > 0 &&
dismantleCommand == null) {
dismantleCommand = DismantleCommand(this);
}
//tf录像分辨率切换
if (result.support_record_resolution_switch != null &&
int.tryParse(result.support_record_resolution_switch!)! > 0 &&
recordResolutionCommand == null) {
recordResolutionCommand = RecordResolutionCommand(this);
}
if ((result.support_pininpic != null &&
int.tryParse(result.support_pininpic!)! > 0 ||
result.support_mutil_sensor_stream != null &&
int.tryParse(result.support_mutil_sensor_stream!)! > 0) &&
qiangQiuCommand == null) {
qiangQiuCommand = QiangQiuCommand(this);
}
}