fix:修复设置电机功率出现错误的问题
This commit is contained in:
parent
c9ba5aa769
commit
9cf186dab5
@ -500,7 +500,10 @@ class _LockSetPageState extends State<LockSetPage>
|
|||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
Get.toNamed(Routers.motorPowerPage);
|
Get.toNamed(Routers.motorPowerPage,
|
||||||
|
arguments: <String, LockSetInfoData>{
|
||||||
|
'lockSetInfoData': state.lockSetInfoData.value
|
||||||
|
});
|
||||||
})),
|
})),
|
||||||
// 蓝牙广播(关闭则不能使用蓝牙主动开锁)
|
// 蓝牙广播(关闭则不能使用蓝牙主动开锁)
|
||||||
/* 2024-01-12 会议确定去掉“蓝牙广播” by DaisyWu
|
/* 2024-01-12 会议确定去掉“蓝牙广播” by DaisyWu
|
||||||
|
|||||||
@ -2,6 +2,7 @@ import 'dart:async';
|
|||||||
|
|
||||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/blue/io_protocol/io_setSupportFunctionsWithParameters.dart';
|
||||||
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||||
|
|
||||||
import '../../../../blue/blue_manage.dart';
|
import '../../../../blue/blue_manage.dart';
|
||||||
@ -28,6 +29,7 @@ class MotorPowerLogic extends BaseGetXController {
|
|||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
state.lockSetInfoData.value.lockSettingInfo!.openDirectionValue =
|
state.lockSetInfoData.value.lockSettingInfo!.openDirectionValue =
|
||||||
state.motorTorsion.value;
|
state.motorTorsion.value;
|
||||||
|
|
||||||
eventBus
|
eventBus
|
||||||
.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
|
.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
|
||||||
showToast('操作成功'.tr);
|
showToast('操作成功'.tr);
|
||||||
@ -36,6 +38,7 @@ class MotorPowerLogic extends BaseGetXController {
|
|||||||
|
|
||||||
// 获取解析后的数据
|
// 获取解析后的数据
|
||||||
late StreamSubscription<Reply> _replySubscription;
|
late StreamSubscription<Reply> _replySubscription;
|
||||||
|
|
||||||
void _initReplySubscription() {
|
void _initReplySubscription() {
|
||||||
_replySubscription =
|
_replySubscription =
|
||||||
EventBusManager().eventBus!.on<Reply>().listen((Reply reply) {
|
EventBusManager().eventBus!.on<Reply>().listen((Reply reply) {
|
||||||
@ -43,6 +46,10 @@ class MotorPowerLogic extends BaseGetXController {
|
|||||||
_replySetSupportFunctionsWithParameters(reply);
|
_replySetSupportFunctionsWithParameters(reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (reply is SetSupportFunctionsWithParametersReply) {
|
||||||
|
_replySetSupportFunctionsWithParameters(reply);
|
||||||
|
}
|
||||||
|
|
||||||
// 读取支持功能(带参数)
|
// 读取支持功能(带参数)
|
||||||
// if(reply is ReadSupportFunctionsNoParametersReply) {
|
// if(reply is ReadSupportFunctionsNoParametersReply) {
|
||||||
// _readSupportFunctionsWithParametersReply(reply);
|
// _readSupportFunctionsWithParametersReply(reply);
|
||||||
|
|||||||
@ -21,53 +21,60 @@ class _MotorPowerPageState extends State<MotorPowerPage> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
appBar: TitleAppBar(
|
appBar: TitleAppBar(
|
||||||
barTitle: '电机功率设置'.tr,
|
barTitle: '电机功率设置'.tr,
|
||||||
haveBack: true,
|
haveBack: true,
|
||||||
backgroundColor: AppColors.mainColor),
|
backgroundColor: AppColors.mainColor),
|
||||||
body: Column(
|
body: Column(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 40.h,
|
height: 40.h,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(left: 40.w),
|
||||||
|
alignment: Alignment.centerLeft,
|
||||||
|
child: Text(
|
||||||
|
'请根据门锁实际情况,请谨慎选择电机功率:'.tr,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 24.sp,
|
||||||
|
color: Colors.black,
|
||||||
|
fontWeight: FontWeight.w500),
|
||||||
),
|
),
|
||||||
Container(
|
),
|
||||||
margin: EdgeInsets.only(left: 40.w),
|
SizedBox(
|
||||||
alignment: Alignment.centerLeft,
|
height: 40.h,
|
||||||
child: Text(
|
),
|
||||||
'请根据门锁实际情况,请谨慎选择电机功率:'.tr,
|
Obx(
|
||||||
style: TextStyle(
|
() => _buildTipsView(
|
||||||
fontSize: 24.sp,
|
|
||||||
color: Colors.black,
|
|
||||||
fontWeight: FontWeight.w500),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
height: 40.h,
|
|
||||||
),
|
|
||||||
_buildTipsView(
|
|
||||||
'${'小功率:'.tr}\n', '耗电少'.tr, state.motorTorsion.value == 1, () {
|
'${'小功率:'.tr}\n', '耗电少'.tr, state.motorTorsion.value == 1, () {
|
||||||
state.motorTorsion.value = 1;
|
state.motorTorsion.value = 1;
|
||||||
logic.sendOpenDoorDirection();
|
logic.sendOpenDoorDirection();
|
||||||
}),
|
}),
|
||||||
SizedBox(
|
),
|
||||||
height: 20.h,
|
SizedBox(
|
||||||
),
|
height: 20.h,
|
||||||
_buildTipsView(
|
),
|
||||||
|
Obx(
|
||||||
|
() => _buildTipsView(
|
||||||
'${'中功率'.tr}\n', '常规使用'.tr, state.motorTorsion.value == 2, () {
|
'${'中功率'.tr}\n', '常规使用'.tr, state.motorTorsion.value == 2, () {
|
||||||
state.motorTorsion.value = 2;
|
state.motorTorsion.value = 2;
|
||||||
logic.sendOpenDoorDirection();
|
logic.sendOpenDoorDirection();
|
||||||
}),
|
}),
|
||||||
SizedBox(
|
),
|
||||||
height: 20.h,
|
SizedBox(
|
||||||
),
|
height: 20.h,
|
||||||
_buildTipsView(
|
),
|
||||||
|
Obx(
|
||||||
|
() => _buildTipsView(
|
||||||
'${'大功率'.tr}\n', '大功率提示'.tr, state.motorTorsion.value == 3, () {
|
'${'大功率'.tr}\n', '大功率提示'.tr, state.motorTorsion.value == 3, () {
|
||||||
state.motorTorsion.value = 3;
|
state.motorTorsion.value = 3;
|
||||||
logic.sendOpenDoorDirection();
|
logic.sendOpenDoorDirection();
|
||||||
}),
|
}),
|
||||||
],
|
)
|
||||||
));
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildTipsView(
|
Widget _buildTipsView(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user