| | |
| | | import com.hdl.photovoltaic.other.HdlFileLogic; |
| | | import com.hdl.photovoltaic.other.HdlLogLogic; |
| | | import com.hdl.photovoltaic.other.HdlThreadLogic; |
| | | import com.hdl.photovoltaic.other.HdlUniLogic; |
| | | import com.hdl.photovoltaic.ui.adapter.DeviceInfoAdapter; |
| | | import com.hdl.photovoltaic.ui.adapter.SearchDeviceAdapter; |
| | | import com.hdl.photovoltaic.ui.adapter.SearchHistoryAdapter; |
| | | import com.hdl.photovoltaic.ui.bean.DeviceBean; |
| | | import com.hdl.photovoltaic.uni.HDLUniMP; |
| | | import com.hdl.photovoltaic.utils.URLEncodingUtils; |
| | | import com.hdl.sdk.link.core.bean.gateway.GatewayBean; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | |
| | | viewBinding.powerStationSearchEt.setText(title); |
| | | } |
| | | }); |
| | | //电站点击是事件 |
| | | //设备点击是事件 |
| | | searchDeviceAdapter.setOnclickListener(new DeviceInfoAdapter.OnClickListener() { |
| | | @Override |
| | | public void onClick(int position, DeviceBean deviceBean) { |
| | | |
| | | GatewayBean gatewayBean = new GatewayBean(); |
| | | gatewayBean.setCategorySecondName(deviceBean.getCategorySecondName()); |
| | | gatewayBean.setDevice_mac(deviceBean.getOsn()); |
| | | gatewayBean.setDevice_model(deviceBean.getOmodel()); |
| | | gatewayBean.setOid(deviceBean.getOid()); |
| | | gatewayBean.setGatewayId(deviceBean.getGatewayId()); |
| | | gatewayBean.setAddresses(deviceBean.getAddresses()); |
| | | gatewayBean.setSid(deviceBean.getSid()); |
| | | gatewayBean.setDeviceId(deviceBean.getDeviceId()); |
| | | gatewayBean.setDevice_name(deviceBean.getName()); |
| | | gatewayBean.setDeviceStatus(deviceBean.getDeviceStatus()); |
| | | gatewayBean.setHomeId(deviceBean.getHomeId()); |
| | | gatewayBean.setDeviceType(deviceBean.getDeviceType()); |
| | | String jsonEncryption = URLEncodingUtils.encodeURIComponent(new Gson().toJson(gatewayBean)); |
| | | String path = HDLUniMP.UNI_EVENT_OPEN_DEVICE_DETAILS + "?inverterInfo=" + jsonEncryption; |
| | | HdlUniLogic.getInstance().openUniMP(path, null); |
| | | } |
| | | }); |
| | | |
| | |
| | | } |
| | | boolean if_boolean = false; |
| | | for (int i = 0; i < deviceList.size(); i++) { |
| | | if (deviceList.get(i).getHomeId().equals(deviceBean.getHomeId())) { |
| | | if (deviceList.get(i).getOsn().equals(deviceBean.getOsn())) { |
| | | //存在替换 |
| | | deviceList.remove(i); |
| | | deviceList.add(i, deviceBean); |