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
68eb6bfe
Commit
68eb6bfe
authored
Jun 29, 2026
by
akari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加初始化下发功能
parent
0f9cb2e3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
116 additions
and
87 deletions
+116
-87
device_control_bloc.dart
lib/blocs/device_control/device_control_bloc.dart
+108
-84
device_control_oxygen_timer_panel.dart
...ce_control/widgets/device_control_oxygen_timer_panel.dart
+8
-3
No files found.
lib/blocs/device_control/device_control_bloc.dart
View file @
68eb6bfe
...
@@ -1071,23 +1071,24 @@ class DeviceControlBloc
...
@@ -1071,23 +1071,24 @@ class DeviceControlBloc
DeviceControlResetSettings
event
,
DeviceControlResetSettings
event
,
Emitter
<
DeviceControlState
>
emit
,
Emitter
<
DeviceControlState
>
emit
,
)
async
{
)
async
{
final
newData
=
state
.
data
.
copyWith
(
final
oldData
=
state
.
data
;
cabinTemp:
state
.
data
.
cabinTemp
.
copyWith
(
isOn:
false
),
final
newData
=
oldData
.
copyWith
(
cabinHumidity:
state
.
data
.
cabinHumidity
.
copyWith
(
isOn:
false
),
cabinTemp:
oldData
.
cabinTemp
.
copyWith
(
isOn:
false
),
oxygenConcentration:
state
.
data
.
oxygenConcentration
.
copyWith
(
cabinHumidity:
oldData
.
cabinHumidity
.
copyWith
(
isOn:
false
),
oxygenConcentration:
oldData
.
oxygenConcentration
.
copyWith
(
isOn:
false
,
isOn:
false
,
setValue:
_clampIntString
(
setValue:
_clampIntString
(
state
.
d
ata
.
oxygenConcentration
.
setValue
,
oldD
ata
.
oxygenConcentration
.
setValue
,
0
,
0
,
60
,
60
,
),
),
),
),
openOxygen:
state
.
d
ata
.
openOxygen
.
copyWith
(
isOn:
false
),
openOxygen:
oldD
ata
.
openOxygen
.
copyWith
(
isOn:
false
),
windSpeed:
state
.
d
ata
.
windSpeed
.
copyWith
(
currentMode:
WindSpeedMode
.
off
),
windSpeed:
oldD
ata
.
windSpeed
.
copyWith
(
currentMode:
WindSpeedMode
.
off
),
nebulizationTime:
state
.
d
ata
.
nebulizationTime
.
copyWith
(
setMinutes:
'0'
),
nebulizationTime:
oldD
ata
.
nebulizationTime
.
copyWith
(
setMinutes:
'0'
),
disinfectionTime:
state
.
d
ata
.
disinfectionTime
.
copyWith
(
setMinutes:
'0'
),
disinfectionTime:
oldD
ata
.
disinfectionTime
.
copyWith
(
setMinutes:
'0'
),
careLevel:
state
.
d
ata
.
careLevel
.
copyWith
(
currentLevel:
CareLevel
.
off
),
careLevel:
oldD
ata
.
careLevel
.
copyWith
(
currentLevel:
CareLevel
.
off
),
lightControl:
state
.
d
ata
.
lightControl
.
copyWith
(
lightControl:
oldD
ata
.
lightControl
.
copyWith
(
checkLightOn:
false
,
checkLightOn:
false
,
illuminationOn:
false
,
illuminationOn:
false
,
blueLightOn:
false
,
blueLightOn:
false
,
...
@@ -1115,79 +1116,102 @@ class DeviceControlBloc
...
@@ -1115,79 +1116,102 @@ class DeviceControlBloc
clearError:
true
,
clearError:
true
,
));
));
await
_writeResetCommandWithDelay
(
if
(
oldData
.
cabinTemp
.
isOn
)
{
identifier:
0x02
,
await
_writeResetCommandWithDelay
(
setValue:
'10'
,
identifier:
0x02
,
errorPrefix:
'舱内温度关闭'
,
setValue:
'10'
,
emit:
emit
,
errorPrefix:
'舱内温度关闭'
,
);
emit:
emit
,
await
_writeResetCommandWithDelay
(
);
identifier:
0x04
,
}
setValue:
'100'
,
if
(
oldData
.
cabinHumidity
.
isOn
)
{
errorPrefix:
'舱内湿度关闭'
,
await
_writeResetCommandWithDelay
(
emit:
emit
,
identifier:
0x04
,
);
setValue:
'100'
,
await
_writeResetCommandWithDelay
(
errorPrefix:
'舱内湿度关闭'
,
identifier:
0x05
,
emit:
emit
,
setValue:
'20'
,
);
errorPrefix:
'氧气浓度关闭'
,
}
emit:
emit
,
if
(
oldData
.
oxygenConcentration
.
isOn
)
{
);
await
_writeResetCommandWithDelay
(
await
_writeResetCommandWithDelay
(
identifier:
0x05
,
identifier:
0x26
,
setValue:
'20'
,
setValue:
'0'
,
errorPrefix:
'氧气浓度关闭'
,
errorPrefix:
'开放供氧关闭'
,
emit:
emit
,
emit:
emit
,
);
);
}
await
_writeResetCommandWithDelay
(
if
(
oldData
.
openOxygen
.
isOn
)
{
identifier:
0xB3
,
await
_writeResetCommandWithDelay
(
setValue:
'
${_windSpeedProtocolValue(WindSpeedMode.off)}
'
,
identifier:
0x26
,
errorPrefix:
'风速关闭'
,
setValue:
'0'
,
emit:
emit
,
errorPrefix:
'开放供氧关闭'
,
);
emit:
emit
,
await
_writeResetCommandWithDelay
(
);
identifier:
0x0C
,
}
setValue:
'0'
,
if
(
oldData
.
windSpeed
.
currentMode
!=
WindSpeedMode
.
off
)
{
errorPrefix:
'雾化关闭'
,
await
_writeResetCommandWithDelay
(
emit:
emit
,
identifier:
0xB3
,
);
setValue:
'
${_windSpeedProtocolValue(WindSpeedMode.off)}
'
,
await
_writeResetCommandWithDelay
(
errorPrefix:
'风速关闭'
,
identifier:
0x0D
,
emit:
emit
,
setValue:
'0'
,
);
errorPrefix:
'消毒关闭'
,
}
emit:
emit
,
if
(
oldData
.
nebulizationTime
.
setMinutes
!=
'0'
)
{
);
await
_writeResetCommandWithDelay
(
await
_writeResetCommandWithDelay
(
identifier:
0x0C
,
identifier:
0xA8
,
setValue:
'0'
,
setValue:
'
${_careLevelProtocolValue(CareLevel.off)}
'
,
errorPrefix:
'雾化关闭'
,
errorPrefix:
'护理等级关闭'
,
emit:
emit
,
emit:
emit
,
);
);
}
await
_writeResetCommandWithDelay
(
if
(
oldData
.
disinfectionTime
.
setMinutes
!=
'0'
)
{
identifier:
_lightIdentifier
(
_LightTarget
.
check
),
await
_writeResetCommandWithDelay
(
setValue:
'0'
,
identifier:
0x0D
,
errorPrefix:
'检查灯关闭'
,
setValue:
'0'
,
emit:
emit
,
errorPrefix:
'消毒关闭'
,
);
emit:
emit
,
await
_writeResetCommandWithDelay
(
);
identifier:
_lightIdentifier
(
_LightTarget
.
illumination
),
}
setValue:
'0'
,
if
(
oldData
.
careLevel
.
currentLevel
!=
CareLevel
.
off
)
{
errorPrefix:
'照明灯关闭'
,
await
_writeResetCommandWithDelay
(
emit:
emit
,
identifier:
0xA8
,
);
setValue:
'
${_careLevelProtocolValue(CareLevel.off)}
'
,
await
_writeResetCommandWithDelay
(
errorPrefix:
'护理等级关闭'
,
identifier:
_lightIdentifier
(
_LightTarget
.
blue
),
emit:
emit
,
setValue:
'0'
,
);
errorPrefix:
'蓝光关闭'
,
}
emit:
emit
,
if
(
oldData
.
lightControl
.
checkLightOn
)
{
);
await
_writeResetCommandWithDelay
(
await
_writeResetCommandWithDelay
(
identifier:
_lightIdentifier
(
_LightTarget
.
check
),
identifier:
_lightIdentifier
(
_LightTarget
.
red
),
setValue:
'0'
,
setValue:
'0'
,
errorPrefix:
'检查灯关闭'
,
errorPrefix:
'红光关闭'
,
emit:
emit
,
emit:
emit
,
);
delayAfter:
false
,
}
);
if
(
oldData
.
lightControl
.
illuminationOn
)
{
await
_writeResetCommandWithDelay
(
identifier:
_lightIdentifier
(
_LightTarget
.
illumination
),
setValue:
'0'
,
errorPrefix:
'照明灯关闭'
,
emit:
emit
,
);
}
if
(
oldData
.
lightControl
.
blueLightOn
)
{
await
_writeResetCommandWithDelay
(
identifier:
_lightIdentifier
(
_LightTarget
.
blue
),
setValue:
'0'
,
errorPrefix:
'蓝光关闭'
,
emit:
emit
,
);
}
if
(
oldData
.
lightControl
.
redLightOn
)
{
await
_writeResetCommandWithDelay
(
identifier:
_lightIdentifier
(
_LightTarget
.
red
),
setValue:
'0'
,
errorPrefix:
'红光关闭'
,
emit:
emit
,
);
}
}
}
int
get
_oxygenSetValueMax
=>
state
.
data
.
openOxygen
.
isOn
?
80
:
60
;
int
get
_oxygenSetValueMax
=>
state
.
data
.
openOxygen
.
isOn
?
80
:
60
;
...
...
lib/views/monitoring/device_control/widgets/device_control_oxygen_timer_panel.dart
View file @
68eb6bfe
...
@@ -6,6 +6,7 @@ import 'package:laki_icu_app/blocs/device_control/device_control_event.dart';
...
@@ -6,6 +6,7 @@ import 'package:laki_icu_app/blocs/device_control/device_control_event.dart';
import
'package:laki_icu_app/blocs/device_control/device_control_state.dart'
;
import
'package:laki_icu_app/blocs/device_control/device_control_state.dart'
;
import
'device_control_common.dart'
;
import
'device_control_common.dart'
;
import
'device_control_confirm_dialog.dart'
;
/// 供氧计时 + ICU重置面板
/// 供氧计时 + ICU重置面板
class
DeviceControlOxygenTimerPanel
extends
StatelessWidget
{
class
DeviceControlOxygenTimerPanel
extends
StatelessWidget
{
...
@@ -63,9 +64,13 @@ class DeviceControlOxygenTimerPanel extends StatelessWidget {
...
@@ -63,9 +64,13 @@ class DeviceControlOxygenTimerPanel extends StatelessWidget {
const
Spacer
(),
const
Spacer
(),
DeviceControlBigActionButton
(
DeviceControlBigActionButton
(
text:
'初始化设置'
,
text:
'初始化设置'
,
onTap:
()
=>
context
onTap:
()
=>
confirmDeviceControlChange
(
.
read
<
DeviceControlBloc
>()
context
,
.
add
(
const
DeviceControlResetSettings
()),
()
=>
context
.
read
<
DeviceControlBloc
>()
.
add
(
const
DeviceControlResetSettings
()),
message:
'确认初始化ICU舱设置'
,
),
),
),
],
],
),
),
...
...
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