| | |
| | | private ActivityTestMainBinding viewBinding; |
| | | private TestTitleAdapter testTitleAdapter; |
| | | |
| | | private List<HouseIdBean> mHouseIdBeanList = new ArrayList<>(); |
| | | private List<OidBean> mOidList; |
| | | |
| | | private GatewayBean mGatewayBean; |
| | |
| | | viewBinding.listItemRl.setAdapter(testTitleAdapter); |
| | | initView(); |
| | | initEvent(); |
| | | readData(); |
| | | |
| | | } |
| | | |
| | | private void readData() { |
| | | loadNextPageHouseList(true); |
| | | } |
| | | |
| | | /** |
| | |
| | | private void initView() { |
| | | this.mHomeId = UserConfigManage.getInstance().getHomeId(); |
| | | this.mHomeName = UserConfigManage.getInstance().getHomeName(); |
| | | String homeId = "电站Id=" + this.mHomeId; |
| | | String homeName = "电站名称=" + this.mHomeName; |
| | | String homeId = "测试电站Id=" + this.mHomeId; |
| | | String homeName = "测试电站名称=" + this.mHomeName; |
| | | viewBinding.homeIdTv.setText(homeId); |
| | | viewBinding.homeNameTv.setText(homeName); |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 刷新UI(设备) |
| | | * 刷新UI(电站) |
| | | * |
| | | * @param isRefreshing 表示是下拉刷新的 |
| | | */ |
| | | private void loadNextPageDeviceList(boolean isRefreshing) { |
| | | private void loadNextPageHouseList(boolean isRefreshing) { |
| | | |
| | | showLoading(); |
| | | if (isRefreshing) { |
| | | showLoading(getString(R.string.device_loading)); |
| | | } |
| | | //获取住宅(电站)ID列表 |
| | | HdlDeviceLogic.getInstance().getPowerStationDeviceList("", 1, 200, new CloudCallBeak<PageNumberObject<CloudInverterDeviceBean>>() { |
| | | HdlResidenceLogic.getInstance().getResidenceIdList("", "", "", "", "", "", 1, 200, new CloudCallBeak<HdlResidenceLogic.HouseBeanClass>() { |
| | | @Override |
| | | public void onSuccess(PageNumberObject<CloudInverterDeviceBean> pageNumberObject) { |
| | | public void onSuccess(HdlResidenceLogic.HouseBeanClass houseBeanClass) { |
| | | HdlThreadLogic.runMainThread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if (isRefreshing) { |
| | | hideLoading(); |
| | | } |
| | | mHouseIdBeanList.clear(); |
| | | //更新缓存 |
| | | mHouseIdBeanList.addAll(houseBeanClass.getList()); |
| | | } |
| | | }, _mActivity, ShowErrorMode.YES); |
| | | }, _mActivity, ShowErrorMode.NO); |
| | | |
| | | } |
| | | |
| | |
| | | if (isRefreshing) { |
| | | hideLoading(); |
| | | } |
| | | |
| | | } |
| | | }, _mActivity, ShowErrorMode.YES); |
| | | }, _mActivity, ShowErrorMode.NO); |
| | | } |
| | | }); |
| | | } |
| | |
| | | * 选择电站调试 |
| | | */ |
| | | public void selectHome() { |
| | | List<HouseIdBean> list = HdlResidenceLogic.getInstance().getHouseIdList(); |
| | | // List<HouseIdBean> list = HdlResidenceLogic.getInstance().getHouseIdList(); |
| | | List<HouseIdBean> list = this.mHouseIdBeanList; |
| | | DialogHomeList dialogHomeList = new DialogHomeList(_mActivity, list); |
| | | dialogHomeList.show(); |
| | | dialogHomeList.DeviceOnclickListener(new HomeAdapter.OnclickListener() { |