mac
2024-06-25 9695405b73d4de40135a0ec05e4ae9d18ae4d344
app/src/main/java/com/hdl/photovoltaic/ui/CPowerStationActivity.java
@@ -5,10 +5,7 @@
import android.os.Process;
import android.os.SystemClock;
import android.text.TextUtils;
import android.util.Log;
import androidx.annotation.Nullable;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
@@ -36,8 +33,6 @@
import com.hdl.photovoltaic.uni.HDLUniMP;
import com.hdl.photovoltaic.uni.HDLUniMPSDKManager;
import com.hdl.photovoltaic.utils.AppManagerUtils;
import com.hdl.photovoltaic.widget.ConfirmationCancelDialog;
import com.hdl.photovoltaic.widget.ConfirmationTipDialog;
import com.hdl.sdk.link.HDLLinkLocalSdk;
import com.hdl.sdk.link.common.event.EventListener;
import com.hdl.sdk.link.core.bean.LinkResponse;
@@ -45,7 +40,6 @@
import com.hdl.sdk.link.core.bean.eventbus.BaseEventBus;
import com.hdl.sdk.link.core.bean.gateway.GatewayBean;
import com.hdl.sdk.link.core.config.HDLLinkConfig;
import com.hdl.sdk.link.core.connect.HDLUdpConnect;
import com.hdl.sdk.link.core.utils.mqtt.MqttRecvClient;
import org.greenrobot.eventbus.Subscribe;
@@ -199,6 +193,9 @@
        } else if (event.getTopic().contains(HDLUniMP.UNI_EVENT_REPLY_OTHER_MODEL) && event.getType().contains(HDLUniMP.UNI_EVENT_REPLY_OTHER_BACK)) {
            //物理按键返回事件(包括左滑移除事件)
            killProcessApp();
        } else if (event.getTopic().contains(HDLUniMP.UNI_EVENT_REPLY_HOME_MODEL) && event.getType().contains(HDLUniMP.UNI_EVENT_REPLY_HOME_DEl)) {
            //C端电站详情里面删除后,会跑来这里;
            startAppAutomaticallyOpenUni(false);
        }
    }
@@ -214,7 +211,11 @@
        List<HouseIdBean> HouseIdList = HdlResidenceLogic.getInstance().getHouseIdList();
        if (HouseIdList.size() == 0) {
            String path = HDLUniMP.UNI_EVENT_OPEN_HOME_Null_C;
            HdlUniLogic.getInstance().openUniMP(path, null);
            if (delay) {
                HdlUniLogic.getInstance().openUniMPDelay(path, null);
            } else {
                HdlUniLogic.getInstance().openUniMP(path, null);
            }
        } else {
            int select_home = 0;
            for (int i = 0; i < HouseIdList.size(); i++) {
@@ -226,7 +227,11 @@
            HouseIdBean houseIdBean = HouseIdList.get(select_home);
            HdlResidenceLogic.getInstance().switchHouse(houseIdBean);
            String path = HDLUniMP.UNI_EVENT_OPEN_HOME_DETAILS_C + "?homeId=" + houseIdBean.getHomeId() + "&homeName=" + houseIdBean.getHomeName() + "&powerStationStatus=" + houseIdBean.getPowerStationStatus();
            HdlUniLogic.getInstance().openUniMP(path, null);
            if (delay) {
                HdlUniLogic.getInstance().openUniMPDelay(path, null);
            } else {
                HdlUniLogic.getInstance().openUniMP(path, null);
            }
        }
    }
@@ -338,8 +343,8 @@
     * 初始化mqtt客户端
     */
    public void initMqttClient() {
        if (MqttRecvClient.getInstance().isConnected()) {
            //检查断开连接
        //检查断开状态
        if (!MqttRecvClient.getInstance().isConnected()) {
            MqttRecvClient.getInstance().reConnect();
        }
        if (!MqttRecvClient.getInstance().isInit()) {