From f9e7fa82f23e8c62835df5acf6ab089be33755ce Mon Sep 17 00:00:00 2001
From: mac <user@users-MacBook-Pro.local>
Date: 星期三, 14 八月 2024 12:41:10 +0800
Subject: [PATCH] 2024年08月14日12:41:08
---
app/src/main/java/com/hdl/photovoltaic/ui/powerstation/HouseAndDeviceFragment.java | 25 ++++++++++++++-----------
1 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/app/src/main/java/com/hdl/photovoltaic/ui/powerstation/HouseAndDeviceFragment.java b/app/src/main/java/com/hdl/photovoltaic/ui/powerstation/HouseAndDeviceFragment.java
index 4c33f55..c1c7ad4 100644
--- a/app/src/main/java/com/hdl/photovoltaic/ui/powerstation/HouseAndDeviceFragment.java
+++ b/app/src/main/java/com/hdl/photovoltaic/ui/powerstation/HouseAndDeviceFragment.java
@@ -516,7 +516,6 @@
viewBinding.fragmentDeviceSrlListRc.setAdapter(deviceInfoAdapter);
this.nullDataUpdateUi();
-
}
/**
@@ -526,7 +525,7 @@
if (isClickPowerStationLabel) {
viewBinding.powerStationLabel.setTextAppearance(R.style.Text20Style);
viewBinding.deviceLabel.setTextAppearance(R.style.Text16Style);
- viewBinding.editIv.setVisibility(View.VISIBLE);//缂栬緫鍥炬爣闅愯棌
+// viewBinding.editIv.setVisibility(View.VISIBLE);//缂栬緫鍥炬爣闅愯棌
viewBinding.addIv.setVisibility(View.VISIBLE);//娣诲姞鍥炬爣闅愯棌
viewBinding.powerStationLabelParent.setVisibility(View.VISIBLE);//鐢电珯鏍囩銆愮埗瀹瑰櫒銆戞樉绀�
viewBinding.deviceLabelParent.setVisibility(View.GONE);//璁惧鏍囩銆愮埗瀹瑰櫒銆戦殣钘�
@@ -536,7 +535,7 @@
} else {
viewBinding.deviceLabel.setTextAppearance(R.style.Text20Style);
viewBinding.powerStationLabel.setTextAppearance(R.style.Text16Style);
- viewBinding.editIv.setVisibility(View.GONE);//缂栬緫鍥炬爣闅愯棌
+// viewBinding.editIv.setVisibility(View.GONE);//缂栬緫鍥炬爣闅愯棌
viewBinding.addIv.setVisibility(View.GONE);//娣诲姞鍥炬爣闅愯棌
viewBinding.powerStationLabelParent.setVisibility(View.GONE);//鐢电珯鏍囩銆愮埗瀹瑰櫒銆戦殣钘�
viewBinding.deviceLabelParent.setVisibility(View.VISIBLE);//璁惧鏍囩銆愮埗瀹瑰櫒銆戞樉绀�
@@ -647,10 +646,10 @@
EventBus.getDefault().removeStickyEvent(eventBus);
//鏄湪锛堢數绔欙級妯″潡涓斿湪锛堢數绔欙級鏍囩椤垫墠杩涙潵杩欓噷
if (HdlCommonLogic.lowerTagType == LowerTagType.power_station && isClickPowerStationLabel) {
- //uin鍏抽棴浣忓畢璇︽儏鐣岄潰閫氱煡
- if (MqttRecvClient.getInstance() != null) {
- MqttRecvClient.getInstance().removeAllTopic();
- }
+// //uin鍏抽棴浣忓畢璇︽儏鐣岄潰閫氱煡
+// if (MqttRecvClient.getInstance() != null) {
+// MqttRecvClient.getInstance().removeAllTopic();
+// }
loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, gridTypeValue, powerStationStatusValue, 1, true);
}
} else if (HDLUniMP.UNI_EVENT_REPLY_DEVICE_LIST.equals(eventBus.getType())) {
@@ -659,16 +658,20 @@
// if (!isClickPowerStationLabel) {
// return;
// }
+ //鍏堟竻绌鸿闃呬富棰�
+ if (MqttRecvClient.getInstance() != null) {
+ MqttRecvClient.getInstance().removeAllTopic();
+ }
+ String homeId = eventBus.getData().toString();
//杩涘幓浣忓畢璇︽儏uni璇诲彇閫嗗彉鍣ㄥ垪琛ㄦ垚鍔熷悗閫氱煡
- for (int i = 0; i < HdlDeviceLogic.getInstance().getCurrentHomeGatewayList(UserConfigManage.getInstance().getHomeId()).size(); i++) {
- String gatewayId = HdlDeviceLogic.getInstance().getCurrentHomeGatewayList(UserConfigManage.getInstance().getHomeId()).get(i).getGatewayId();
+ for (int i = 0; i < HdlDeviceLogic.getInstance().getCurrentHomeGatewayList(homeId).size(); i++) {
+ String gatewayId = HdlDeviceLogic.getInstance().getCurrentHomeGatewayList(homeId).get(i).getGatewayId();
//瀛楃涓叉槸鑷繁鎸夎鍒欐嫾鎺ョ殑,閲岄潰娉ㄥ唽涓婚鏃朵細瑙f瀽瀛楃涓�,鍙嬁getGatewayId()鍊�;
String topic = "/user/" + gatewayId + "/#";
//杩涘幓浣忓畢璇︽儏寮�濮嬭闃呬富棰�
MqttRecvClient.getInstance().checkAndsubscribeAllTopics(topic);//璁㈤槄銆愰�嗗彉鍣ㄣ�戞秷鎭�
-
}
- String topicHome = "/user/" + UserConfigManage.getInstance().getHomeId() + "/#";
+ String topicHome = "/user/" + homeId + "/#";
MqttRecvClient.getInstance().checkAndsubscribeAllTopics(topicHome);//璁㈤槄銆愮數绔欍�戞秷鎭�
--
Gitblit v1.8.0