diff --git a/lan/lan_hk.json b/lan/lan_hk.json index 101c334c..49b5232c 100644 --- a/lan/lan_hk.json +++ b/lan/lan_hk.json @@ -173,9 +173,9 @@ "接收人信息": "收件人", "转移网关": "傳輸網關", "锁屏": "屏幕鎖定", - "已关闭": "關閉", - "已开启": "上", - "开启": "開", + "已关闭": "已關閉", + "已开启": "已開啟", + "开启": "開啟", "确定要开启重置键?": "繼續啟用Reset掣?", "确定要关闭重置键?": "繼續禁用Reset掣?", "隐藏无效开锁权限": "隱藏無效訪問權限", diff --git a/lan/lan_tw.json b/lan/lan_tw.json index f1ed8445..7110352a 100644 --- a/lan/lan_tw.json +++ b/lan/lan_tw.json @@ -172,9 +172,9 @@ "接收人信息": "收件人", "转移网关": "傳輸網關", "锁屏": "屏幕鎖定", - "已关闭": "關", - "已开启": "開啟", - "开启": "打開", + "已关闭": "已關閉", + "已开启": "已開啟", + "开启": "開啟", "确定要开启重置键?": "是否繼續啟用重置按鈕?", "确定要关闭重置键?": "是否繼續禁用重置按鈕?", "隐藏无效开锁权限": "隱藏無效訪問", diff --git a/lib/flavors.dart b/lib/flavors.dart index 0d4fbe8f..f2c54c95 100755 --- a/lib/flavors.dart +++ b/lib/flavors.dart @@ -140,11 +140,11 @@ class F { case Flavor.dev: case Flavor.xhj_dev: case Flavor.sky_dev: - return 'https://dev.lock.star-lock.cn'; + return 'https://lock.dev.star-lock.cn'; case Flavor.pre: case Flavor.xhj_pre: case Flavor.sky_pre: - return 'https://pre.lock.star-lock.cn'; + return 'https://lock.pre.star-lock.cn'; case Flavor.sky: return 'https://lock.skychip.top'; case Flavor.xhj: diff --git a/lib/login/login/starLock_login_logic.dart b/lib/login/login/starLock_login_logic.dart index d7244068..d0f5d2cd 100755 --- a/lib/login/login/starLock_login_logic.dart +++ b/lib/login/login/starLock_login_logic.dart @@ -1,18 +1,17 @@ -import 'dart:io'; - import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:star_lock/apm/apm_helper.dart'; -import 'package:jverify/jverify.dart'; import 'package:star_lock/appRouters.dart'; import 'package:star_lock/app_settings/app_settings.dart'; import 'package:star_lock/blue/blue_manage.dart'; +import 'package:star_lock/blue/io_tool/manager_event_bus.dart'; import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart'; import 'package:star_lock/login/login/entity/LoginEntity.dart'; import 'package:star_lock/mine/mine/starLockMine_state.dart'; import 'package:star_lock/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_entity.dart'; import 'package:star_lock/network/start_chart_api.dart'; import 'package:star_lock/talk/starChart/entity/star_chart_register_node_entity.dart'; +import 'package:star_lock/tools/appFirstEnterHandle.dart'; import 'package:star_lock/tools/baseGetXController.dart'; import '../../main/lockMian/lockMain/lockMain_logic.dart'; @@ -143,7 +142,7 @@ class StarLockLoginLogic extends BaseGetXController { if (entity.errorCode!.codeIsSuccessful) { if (state.countryName != entity.data!.name) { ShowTipView().showSureAlertDialog( - '国家地区的选择将影响数据安全,你当前选择的是'+state.countryName+'请确认后再继续'.tr, + '国家地区的选择将影响数据安全,你当前选择的是' + state.countryName + '请确认后再继续'.tr, tipTitle: '确认国家或地区'.tr, sureStr: '我知道了'.tr); } @@ -175,11 +174,22 @@ class StarLockLoginLogic extends BaseGetXController { state.canNext.value = state.pwdIsOK && state.isEmailOrPhone; } + void _initEventListen() { + eventBus + .on() + .listen((AgreePrivacyAgreement event) async { + await JverifyOneClickLoginManage(); + oneClickLoginAction(); + state.isCheckVerifyEnable.value = + await JverifyOneClickLoginManage().checkVerifyEnable(); + AppLog.log('一键登录初始化认证结果:${state.isCheckVerifyEnable.value}'); + }); + } + @override Future onInit() async { + _initEventListen(); super.onInit(); - - } @override diff --git a/lib/main.dart b/lib/main.dart index 9e20bdd8..9e9f5927 100755 --- a/lib/main.dart +++ b/lib/main.dart @@ -18,6 +18,7 @@ import 'package:star_lock/talk/starChart/handle/impl/debug_Info_model.dart'; import 'package:star_lock/talk/starChart/status/appLifecycle_observer.dart'; import 'package:star_lock/tools/bugly/bugly_tool.dart'; import 'package:star_lock/tools/device_info_service.dart'; +import 'package:star_lock/tools/eventBusEventManage.dart'; import 'package:star_lock/tools/jverify_one_click_login.dart'; import 'package:star_lock/tools/platform_info_services.dart'; import 'package:star_lock/tools/push/notification_service.dart'; @@ -104,8 +105,9 @@ Future privacySDKInitialization() async { // 初始化一键登录服务 final StarLockLoginLogic loginLogic = Get.put(StarLockLoginLogic()); - JverifyOneClickLoginManage(); + await JverifyOneClickLoginManage(); loginLogic.oneClickLoginAction(); loginLogic.state.isCheckVerifyEnable.value = await JverifyOneClickLoginManage().checkVerifyEnable(); + eventBus.fire(AgreePrivacyAgreement()); } diff --git a/lib/main/lockDetail/face/faceList/faceList_logic.dart b/lib/main/lockDetail/face/faceList/faceList_logic.dart index debdc5ce..9781a916 100755 --- a/lib/main/lockDetail/face/faceList/faceList_logic.dart +++ b/lib/main/lockDetail/face/faceList/faceList_logic.dart @@ -22,6 +22,7 @@ class FaceListLogic extends BaseGetXController { // 获取解析后的数据 late StreamSubscription _replySubscription; + void _initReplySubscription() { _replySubscription = EventBusManager().eventBus!.on().listen((Reply reply) { @@ -77,11 +78,15 @@ class FaceListLogic extends BaseGetXController { userID: (await Storage.getUid())!, faceNo: state.deletFaceNo, useCountLimit: 0xffff, - operate: state.isDeletAll == true ? 3 : 2, // 0:注册 1:修改 2:删除 3:删除全部 + operate: state.isDeletAll == true ? 3 : 2, + // 0:注册 1:修改 2:删除 3:删除全部 isAdmin: 0, - isForce: 0, // 是否是胁迫 - isRound: 0, // 是否是循环 - weekRound: 0, // 周循环 + isForce: 0, + // 是否是胁迫 + isRound: 0, + // 是否是循环 + weekRound: 0, + // 周循环 startDate: 0x11223344, endDate: 0x11223344, startTime: '0', @@ -277,11 +282,15 @@ class FaceListLogic extends BaseGetXController { userID: (await Storage.getUid())!, faceNo: state.deletFaceNo, useCountLimit: 0xffff, - operate: state.isDeletAll == true ? 3 : 2, // 0:注册 1:修改 2:删除 3:删除全部 + operate: state.isDeletAll == true ? 3 : 2, + // 0:注册 1:修改 2:删除 3:删除全部 isAdmin: 0, - isForce: 0, // 是否是胁迫 - isRound: 0, // 是否是循环 - weekRound: 0, // 周循环 + isForce: 0, + // 是否是胁迫 + isRound: 0, + // 是否是循环 + weekRound: 0, + // 周循环 startDate: 0x11223344, endDate: 0x11223344, startTime: '0', @@ -348,8 +357,8 @@ class FaceListLogic extends BaseGetXController { lockId: state.lockId.value, ); if (entity.errorCode!.codeIsSuccessful) { - showToast('删除成功'.tr, something: () { - getFaceListData(isRefresh: true); + showToast('删除成功'.tr, something: () async { + await getFaceListData(isRefresh: true); }); } } @@ -366,8 +375,8 @@ class FaceListLogic extends BaseGetXController { lockId: state.lockId.value, ); if (entity.errorCode!.codeIsSuccessful) { - showToast('重置成功'.tr, something: () { - getFaceListData(isRefresh: true); + showToast('重置成功'.tr, something: () async{ + await getFaceListData(isRefresh: true); }); } } @@ -403,11 +412,12 @@ class FaceListLogic extends BaseGetXController { // 监听修改完详情之后刷新列表 late StreamSubscription _teamEvent; + void _initRefreshAction() { _teamEvent = eventBus .on() - .listen((OtherTypeRefreshListEvent event) { - getFaceListData(isRefresh: true); + .listen((OtherTypeRefreshListEvent event) async { + await getFaceListData(isRefresh: true); }); } @@ -434,6 +444,7 @@ class FaceListLogic extends BaseGetXController { // senderCheckingUserInfoCount(); } + getFaceListData(isRefresh: true); } @override diff --git a/lib/main/lockDetail/face/faceList/faceList_page.dart b/lib/main/lockDetail/face/faceList/faceList_page.dart index 5758785b..43248d26 100755 --- a/lib/main/lockDetail/face/faceList/faceList_page.dart +++ b/lib/main/lockDetail/face/faceList/faceList_page.dart @@ -1,4 +1,3 @@ - import 'package:flutter/material.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -31,24 +30,6 @@ class _FaceListPageState extends State with RouteAware { final FaceListLogic logic = Get.put(FaceListLogic()); final FaceListState state = Get.find().state; - Future getHttpData({required bool isRefresh}) async { - final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot); - if (isDemoMode == false) { - logic.getFaceListData(isRefresh: isRefresh).then((FingerprintListDataEntity value) { - if (mounted) { - setState(() {}); - } - }); - } - } - - @override - void initState() { - super.initState(); - - getHttpData(isRefresh: true); - } - @override Widget build(BuildContext context) { return Scaffold( @@ -92,17 +73,17 @@ class _FaceListPageState extends State with RouteAware { ), body: EasyRefreshTool( onRefresh: () { - getHttpData(isRefresh: true); + logic.getFaceListData(isRefresh: true); }, onLoad: () { - getHttpData(isRefresh: false); + logic.getFaceListData(isRefresh: false); }, child: Column( children: [ KeySearchWidget( editingController: state.searchController, onSubmittedAction: () { - getHttpData(isRefresh: true); + logic.getFaceListData(isRefresh: true); }, ), SizedBox( @@ -110,14 +91,15 @@ class _FaceListPageState extends State with RouteAware { ), Expanded(child: _buildMainUI()), AddBottomWhiteBtn( - btnName: - '添加人脸'.tr, + btnName: '添加人脸'.tr, onClick: () async { - await Get.toNamed(Routers.addFaceTypePage, arguments: { + await Get.toNamed(Routers.addFaceTypePage, + arguments: { 'lockId': state.lockId.value, 'fromType': 1 // 1从添加钥匙列表进入 2从考勤添加员工入口进入 - })!.then((value) { - getHttpData(isRefresh: true); + })! + .then((value) { + logic.getFaceListData(isRefresh: true); }); }, ), @@ -154,9 +136,11 @@ class _FaceListPageState extends State with RouteAware { logic.getKeyType(getFaceItemData), logic.getKeyDateType(getFaceItemData), () async { await Get.toNamed(Routers.faceDetailPage, - arguments: { + arguments: { 'faceItemData': getFaceItemData, - })!.then((value) => getHttpData(isRefresh: true)); + })! + .then((value) => + logic.getFaceListData(isRefresh: true)); }), ); } diff --git a/lib/main/lockDetail/fingerprint/addFingerprint/addFingerprint_logic.dart b/lib/main/lockDetail/fingerprint/addFingerprint/addFingerprint_logic.dart index c8507a3f..6bd97fb8 100755 --- a/lib/main/lockDetail/fingerprint/addFingerprint/addFingerprint_logic.dart +++ b/lib/main/lockDetail/fingerprint/addFingerprint/addFingerprint_logic.dart @@ -105,6 +105,13 @@ class AddFingerprintLogic extends BaseGetXController { token: token, isBeforeAddUser: false); break; + case 0xFE: + // 管理员已满 + state.ifAddState.value = false; + showToast('管理员已满'.tr, something: () { + Get.back(); + }); + break; default: //失败 state.ifAddState.value = false; diff --git a/lib/main/lockDetail/lockDetail/lockDetail_logic.dart b/lib/main/lockDetail/lockDetail/lockDetail_logic.dart index ee7ba5f8..80198af5 100755 --- a/lib/main/lockDetail/lockDetail/lockDetail_logic.dart +++ b/lib/main/lockDetail/lockDetail/lockDetail_logic.dart @@ -285,7 +285,7 @@ class LockDetailLogic extends BaseGetXController { final List publicKeyData = state.keyInfos.value.bluetooth!.publicKey!.cast(); final List saveStrList = changeIntListToStringList(publicKeyData); - await Storage.setStringList(saveBluePublicKey, saveStrList); + await Storage.setStringList(saveBluePublicKey, saveStrList); // 私钥 final List privateKeyData = @@ -298,7 +298,7 @@ class LockDetailLogic extends BaseGetXController { final List signKeyData = state.keyInfos.value.bluetooth!.signKey!.cast(); final List saveSignKeyList = changeIntListToStringList(signKeyData); - await Storage.setStringList(saveBlueSignKey, saveSignKeyList); + await Storage.setStringList(saveBlueSignKey, saveSignKeyList); final bool ifHaveKey = await Storage.ifHaveKey(saveBlueToken); if (!ifHaveKey) { @@ -838,5 +838,12 @@ class LockDetailLogic extends BaseGetXController { state.keyInfos.refresh(); } }); + + eventBus + .on() + .listen((SuccessfulDistributionNetwork event) { + // 配网成功获取一下配网信息 + requestDeviceNetworkInfo(); + }); } } diff --git a/lib/main/lockDetail/lockDetail/lockDetail_page.dart b/lib/main/lockDetail/lockDetail/lockDetail_page.dart index 4352d93d..1040b5ba 100755 --- a/lib/main/lockDetail/lockDetail/lockDetail_page.dart +++ b/lib/main/lockDetail/lockDetail/lockDetail_page.dart @@ -89,7 +89,6 @@ class _LockDetailPageState extends State AppRouteObserver().routeObserver.subscribe(this, ModalRoute.of(context)!); state.isOpenLockNeedOnline.refresh(); - logic.requestDeviceNetworkInfo(); } StreamSubscription? _lockRefreshLockDetailInfoDataEvent; @@ -1024,7 +1023,7 @@ class _LockDetailPageState extends State Widget widget = getBottomWidget()[index]; return widget; }, - physics: const NeverScrollableScrollPhysics(), + // physics: const NeverScrollableScrollPhysics(), shrinkWrap: true, ) diff --git a/lib/main/lockDetail/lockSet/configuringWifi/configuringWifi/configuringWifi_logic.dart b/lib/main/lockDetail/lockSet/configuringWifi/configuringWifi/configuringWifi_logic.dart index f4688019..9b25bf55 100755 --- a/lib/main/lockDetail/lockSet/configuringWifi/configuringWifi/configuringWifi_logic.dart +++ b/lib/main/lockDetail/lockSet/configuringWifi/configuringWifi/configuringWifi_logic.dart @@ -62,10 +62,8 @@ class ConfiguringWifiLogic extends BaseGetXController { peerId: peerId, ); if (entity.errorCode!.codeIsSuccessful) { - await _getUploadLockSet(); + showToast('配网成功'.tr, something: () async { - eventBus - .fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value)); // 设置锁的peerID StartChartManage().lockNetworkInfo = DeviceNetworkInfo( wifiName: wifiName, @@ -74,6 +72,7 @@ class ConfiguringWifiLogic extends BaseGetXController { peerId: peerId, ); }); + _getUploadLockSet(); } } @@ -135,7 +134,7 @@ class ConfiguringWifiLogic extends BaseGetXController { // 保存到缓存 await Storage.saveLockNetWorkInfo(jsonMap); // 上报服务器 - updateNetworkInfo( + updateNetworkInfo( peerId: peerId ?? '', wifiName: wifiName ?? '', secretKey: secretKey ?? '', @@ -231,6 +230,13 @@ class ConfiguringWifiLogic extends BaseGetXController { password: state.wifiPWDController.text, gatewayConfigurationStr: state.getGatewayConfigurationStr, ); + } else if (connectionState == BluetoothConnectionState.disconnected) { + dismissEasyLoading(); + cancelBlueConnetctToastTimer(); + state.sureBtnState.value = 0; + if (state.ifCurrentScreen.value == true) { + showBlueConnetctToast(); + } } }, isAddEquipment: true, @@ -391,10 +397,10 @@ class ConfiguringWifiLogic extends BaseGetXController { // 上传数据获取设置 Future _getUploadLockSet() async { - showEasyLoading(); - showBlueConnetctToastTimer(action: () { - dismissEasyLoading(); - }); + // showEasyLoading(); + // showBlueConnetctToastTimer(action: () { + // dismissEasyLoading(); + // }); BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState connectionState) async { if (connectionState == BluetoothConnectionState.connected) { @@ -476,6 +482,10 @@ class ConfiguringWifiLogic extends BaseGetXController { Get.offAllNamed(Routers.starLockMain); } dismissEasyLoading(); + eventBus + .fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value)); + eventBus + .fire(SuccessfulDistributionNetwork()); if (state.loadingTimer != null) { state.loadingTimer!.cancel(); state.loadingTimer = null; @@ -493,6 +503,5 @@ class ConfiguringWifiLogic extends BaseGetXController { state.loadingTimer!.cancel(); state.loadingTimer = null; } - } } diff --git a/lib/mine/mineSet/mineSet/mineSet_page.dart b/lib/mine/mineSet/mineSet/mineSet_page.dart index a098bb8b..a2926a55 100755 --- a/lib/mine/mineSet/mineSet/mineSet_page.dart +++ b/lib/mine/mineSet/mineSet/mineSet_page.dart @@ -456,10 +456,10 @@ class _MineSetPageState extends State // showLoginOutAlertTipDialog(); }), Container( - padding: EdgeInsets.only(right: 30.w, top: 30.h), + padding: EdgeInsets.only(left: 30.w, top: 30.h), // color: Colors.red, child: Row( - mainAxisAlignment: MainAxisAlignment.end, + mainAxisAlignment: MainAxisAlignment.start, children: [ TextButton( child: Text( diff --git a/lib/talk/starChart/handle/impl/udp_talk_request_handler.dart b/lib/talk/starChart/handle/impl/udp_talk_request_handler.dart index 06b79ad6..be2f4565 100644 --- a/lib/talk/starChart/handle/impl/udp_talk_request_handler.dart +++ b/lib/talk/starChart/handle/impl/udp_talk_request_handler.dart @@ -25,8 +25,24 @@ class UdpTalkRequestHandler extends ScpMessageBaseHandle RxString currentLanguage = CurrentLocaleTool.getCurrentLocaleString().obs; // 当前选择语言 + // 添加上次处理请求的时间戳 + int _lastRequestTime = 0; + @override void handleReq(ScpMessage scpMessage) async { + + final currentTime = DateTime.now().millisecondsSinceEpoch; + // 确保与上次请求间隔至少1秒 + if (currentTime - _lastRequestTime < 1000) { + // 如果间隔小于1秒,直接拒绝请求 + replyErrorMessage(scpMessage); + AppLog.log('对讲请求过于频繁,已拒绝'); + return; + } + + // 更新最后处理时间 + _lastRequestTime = currentTime; + // 判断是否登录账户 final loginData = await Storage.getLoginData(); @@ -47,6 +63,7 @@ class UdpTalkRequestHandler extends ScpMessageBaseHandle } else { // 拒绝接听,回复失败 replyErrorMessage(scpMessage); + AppLog.log('正在接听,回复拒绝'); } } diff --git a/lib/talk/starChart/status/appLifecycle_observer.dart b/lib/talk/starChart/status/appLifecycle_observer.dart index 03a0a37f..37b70152 100644 --- a/lib/talk/starChart/status/appLifecycle_observer.dart +++ b/lib/talk/starChart/status/appLifecycle_observer.dart @@ -28,17 +28,16 @@ class AppLifecycleObserver extends WidgetsBindingObserver { void onAppPaused() { // 处理应用程序进入后台的逻辑 - print('App has entered the background.'); - if (StartChartManage().talkStatus.status == - TalkStatus.passiveCallWaitingAnswer || - StartChartManage().talkStatus.status == - TalkStatus.proactivelyCallWaitingAnswer) { - StartChartManage().startTalkHangupMessageTimer(); - StartChartManage().startTalkRejectMessageTimer(); - // 如果是等待接听时就退出页面 + + final status = StartChartManage().talkStatus.status; + + if (status == TalkStatus.passiveCallWaitingAnswer || + status == TalkStatus.proactivelyCallWaitingAnswer || + status == TalkStatus.answeredSuccessfully || + status == TalkStatus.uninitialized) { + StartChartManage().destruction(); Get.back(); } - StartChartManage().destruction(); } void onAppResumed() async { diff --git a/lib/talk/starChart/views/talkView/talk_view_logic.dart b/lib/talk/starChart/views/talkView/talk_view_logic.dart index 8c0e3737..05d0636c 100644 --- a/lib/talk/starChart/views/talkView/talk_view_logic.dart +++ b/lib/talk/starChart/views/talkView/talk_view_logic.dart @@ -56,6 +56,9 @@ class TalkViewLogic extends BaseGetXController { final Map _imageCache = {}; + // 添加一个变量用于记录上一帧的时间戳 + int _lastFrameTimestamp = 0; // 初始值为 0 + // 添加帧率计算相关变量 int _frameCount = 0; int _lastFpsUpdateTime = 0; @@ -100,11 +103,11 @@ class TalkViewLogic extends BaseGetXController { // 判断数据类型,进行分发处理 switch (contentType) { case TalkData_ContentTypeE.G711: - // 第一帧到达时记录开始时间 - if (_isFirstAudioFrame) { - _startAudioTime = currentTime; - _isFirstAudioFrame = false; - } + // // 第一帧到达时记录开始时间 + // if (_isFirstAudioFrame) { + // _startAudioTime = currentTime; + // _isFirstAudioFrame = false; + // } // 计算音频延迟 final expectedTime = _startAudioTime + talkData.durationMs; @@ -130,15 +133,16 @@ class TalkViewLogic extends BaseGetXController { if (_isFirstFrame) { _startTime = currentTime; _isFirstFrame = false; - // AppLog.log('记录第一帧的时间戳${currentTime},${talkData.durationMs}'); + AppLog.log('第一帧帧的时间戳:${talkData.durationMs}'); } + // AppLog.log('其他帧的时间戳:${talkData.durationMs}'); + // 计算帧间间隔 + if (_lastFrameTimestamp != 0) { + final int frameInterval = talkData.durationMs - _lastFrameTimestamp; + _adjustBufferSize(frameInterval); // 根据帧间间隔调整缓冲区 + } + _lastFrameTimestamp = talkData.durationMs; // 更新上一帧时间戳 - // 计算实际延迟:当前时间 - 预期播放时间 - final expectedTime = _startTime + talkData.durationMs; - final videoDelay = currentTime - expectedTime; // 修改延迟计算方式 - - // 动态调整缓冲区 - _adjustBufferSize(videoDelay); // 然后添加到播放缓冲区 if (state.videoBuffer.length >= bufferSize) { state.videoBuffer.removeAt(0); @@ -257,19 +261,21 @@ class TalkViewLogic extends BaseGetXController { } // 新增:动态调整缓冲区大小的方法 - void _adjustBufferSize(int delay) { - const int delayThresholdHigh = 250; // 高延迟阈值(约3帧的时间) - const int delayThresholdLow = 166; // 低延迟阈值(约2帧的时间) + void _adjustBufferSize(int frameInterval) { + const int frameDuration = 83; // 假设每帧的时间间隔为 83ms(12fps) + const int delayThresholdHigh = frameDuration * 2; // 高延迟阈值(2帧时间) + const int delayThresholdLow = frameDuration; // 低延迟阈值(1帧时间) const int adjustInterval = 1; // 每次调整1帧 - if (delay > delayThresholdHigh && bufferSize < maxBufferSize) { - // 延迟较大,增加缓冲区 + if (frameInterval > delayThresholdHigh && bufferSize < maxBufferSize) { + // 帧间间隔较大,增加缓冲区 bufferSize = min(bufferSize + adjustInterval, maxBufferSize); - // AppLog.log('📈 增加缓冲区 - 当前大小: $bufferSize, 延迟: ${delay}ms'); - } else if (delay < delayThresholdLow && bufferSize > minBufferSize) { - // 延迟较小,减少缓冲区 + AppLog.log('📈 增加缓冲区 - 当前大小: $bufferSize, 帧间间隔: ${frameInterval}ms'); + } else if (frameInterval < delayThresholdLow && + bufferSize > minBufferSize) { + // 帧间间隔较小,减少缓冲区 bufferSize = max(bufferSize - adjustInterval, minBufferSize); - // AppLog.log('📉 减少缓冲区 - 当前大小: $bufferSize, 延迟: ${delay}ms'); + AppLog.log('📉 减少缓冲区 - 当前大小: $bufferSize, 帧间间隔: ${frameInterval}ms'); } } diff --git a/lib/tools/eventBusEventManage.dart b/lib/tools/eventBusEventManage.dart index 5d5e7416..810ad0a6 100755 --- a/lib/tools/eventBusEventManage.dart +++ b/lib/tools/eventBusEventManage.dart @@ -195,3 +195,12 @@ class RogerThatLockInfoDataEvent { class GetGatewayListRefreshUI { GetGatewayListRefreshUI(); } +/// 同意隐私协议 +class AgreePrivacyAgreement { + AgreePrivacyAgreement(); +} + +/// 配网成功 +class SuccessfulDistributionNetwork { + SuccessfulDistributionNetwork(); +}