Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
laki_icu_app
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张宏
laki_icu_app
Commits
4dff6ccd
Commit
4dff6ccd
authored
Jun 27, 2026
by
张宏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
合并
parent
cb552db0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
23 deletions
+9
-23
monitoring_index_cubit.dart
lib/views/monitoring/index/cubit/monitoring_index_cubit.dart
+9
-23
No files found.
lib/views/monitoring/index/cubit/monitoring_index_cubit.dart
View file @
4dff6ccd
...
@@ -614,7 +614,7 @@ class MonitoringIndexCubit extends HydratedCubit<MonitoringIndexState> {
...
@@ -614,7 +614,7 @@ class MonitoringIndexCubit extends HydratedCubit<MonitoringIndexState> {
try
{
try
{
await
_bluetoothManager
.
scanForDevices
(
await
_bluetoothManager
.
scanForDevices
(
namePrefixes:
const
[
'CNA'
],
namePrefixes:
const
[],
timeout:
const
Duration
(
seconds:
10
),
timeout:
const
Duration
(
seconds:
10
),
);
);
}
catch
(
e
)
{
}
catch
(
e
)
{
...
@@ -925,20 +925,8 @@ class MonitoringIndexCubit extends HydratedCubit<MonitoringIndexState> {
...
@@ -925,20 +925,8 @@ class MonitoringIndexCubit extends HydratedCubit<MonitoringIndexState> {
alarmId:
alarm
.
alarmId
,
alarmId:
alarm
.
alarmId
,
);
);
// 按告警标题去重:相同标题 → 原地覆盖;不同标题 → 插入头部
// 摄像头告警只保留最新一条,新消息直接覆盖
final
existingIndex
=
emit
(
state
.
copyWith
(
cameraAlerts:
[
alert
]));
state
.
cameraAlerts
.
indexWhere
((
a
)
=>
a
.
title
==
title
);
if
(
existingIndex
>=
0
)
{
// 已存在相同标题 → 原地替换
final
updatedAlerts
=
List
<
AlertInfoBO
>.
from
(
state
.
cameraAlerts
);
updatedAlerts
[
existingIndex
]
=
alert
;
emit
(
state
.
copyWith
(
cameraAlerts:
updatedAlerts
));
}
else
{
// 不存在 → 插入头部
emit
(
state
.
copyWith
(
cameraAlerts:
[
alert
,
...
state
.
cameraAlerts
],
));
}
}
}
/// 处理 MQTT pet/bind 宠物绑定消息
/// 处理 MQTT pet/bind 宠物绑定消息
...
@@ -1113,12 +1101,14 @@ class MonitoringIndexCubit extends HydratedCubit<MonitoringIndexState> {
...
@@ -1113,12 +1101,14 @@ class MonitoringIndexCubit extends HydratedCubit<MonitoringIndexState> {
// TODO: 待确认 BLE identifier 后补充
// TODO: 待确认 BLE identifier 后补充
case
'redLightDuration'
:
case
'redLightDuration'
:
debugPrint
(
'[IcuCommand] redLightDuration=
$value
— 待确认 BLE identifier'
);
debugPrint
(
'[IcuCommand] redLightDuration=
$value
— 待确认 BLE identifier'
);
break
;
break
;
// TODO: 待确认 BLE identifier 后补充
// TODO: 待确认 BLE identifier 后补充
case
'redLightInterval'
:
case
'redLightInterval'
:
debugPrint
(
'[IcuCommand] redLightInterval=
$value
— 待确认 BLE identifier'
);
debugPrint
(
'[IcuCommand] redLightInterval=
$value
— 待确认 BLE identifier'
);
break
;
break
;
// TODO: 待确认 BLE identifier 后补充
// TODO: 待确认 BLE identifier 后补充
...
@@ -1552,12 +1542,8 @@ class MonitoringIndexCubit extends HydratedCubit<MonitoringIndexState> {
...
@@ -1552,12 +1542,8 @@ class MonitoringIndexCubit extends HydratedCubit<MonitoringIndexState> {
if
(
client
==
null
||
if
(
client
==
null
||
!
client
.
isConnected
||
!
client
.
isConnected
||
deviceSn
==
null
||
deviceSn
==
null
||
deviceSn
.
isEmpty
)
{
deviceSn
.
isEmpty
)
return
;
return
;
if
(
alert
.
alarmId
==
null
)
return
;
}
if
(
alert
.
alarmId
==
null
)
{
return
;
}
try
{
try
{
client
.
publishCameraAlarmResult
(
client
.
publishCameraAlarmResult
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment