| | |
| | | import com.google.gson.Gson; |
| | | import com.hdl.photovoltaic.HDLApp; |
| | | import com.hdl.photovoltaic.enums.Languages; |
| | | import com.hdl.photovoltaic.enums.PowerStationType; |
| | | import com.hdl.photovoltaic.other.HdlFileLogic; |
| | | import com.hdl.photovoltaic.other.HdlLogLogic; |
| | | import com.hdl.photovoltaic.other.HdlResidenceLogic; |
| | |
| | | private String agentUrl; |
| | | //当前会话ID |
| | | private String conversationId; |
| | | //电站类型(INV = 逆变器电站;BMS = BMS电站) |
| | | private String powerStationType = PowerStationType.INV; |
| | | |
| | | public String getAgentUrl() { |
| | | return agentUrl == null ? "" : agentUrl; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 电站类型(INV = 逆变器电站;BMS = BMS电站) |
| | | * @return 电站类型(INV = 逆变器电站;BMS = BMS电站) |
| | | */ |
| | | public String getPowerStationType() { |
| | | return powerStationType; |
| | | } |
| | | |
| | | public void setPowerStationType(String powerStationType) { |
| | | this.powerStationType = powerStationType; |
| | | } |
| | | |
| | | /** |
| | | * uni一级界面的安全距离背景颜色(0=电站详情界面,1=添加电站界面,2=设备调测界面) |
| | | * |
| | | * @return 值 |
| New file |
| | |
| | | package com.hdl.photovoltaic.enums; |
| | | |
| | | public @interface PowerStationType { |
| | | String All = "";//全部 |
| | | String INV = "INV";//逆变器电站 |
| | | String BMS = "BMS";//BMS电站 |
| | | } |
| | |
| | | * @param installedCapacityMax 最大组串容量(装机容量) |
| | | * @param debugStatus 调试状态(全部;调试中;调试完成;已交付;授权调试) |
| | | * @param powerStationStatus 电站状态 (全部 :"";1 : 正常;2 : 离线; 3 : 待接入;4 : 故障) |
| | | * @param powerStationType 电站类型(INV = 逆变器电站;BMS = BMS电站) |
| | | * @param pageNo 页码 |
| | | * @param pageSize 页数(一页多少数据) |
| | | */ |
| | | public void getResidenceIdList(String key, String keyValue, String installedCapacityMin, String installedCapacityMax, String debugStatus, String powerStationStatus, long pageNo, long pageSize, CloudCallBeak<HouseBeanClass> cloudCallBeak) { |
| | | public void getResidenceIdList(String key, String keyValue, String installedCapacityMin, String installedCapacityMax, String debugStatus, String powerStationStatus, String powerStationType, long pageNo, long pageSize, CloudCallBeak<HouseBeanClass> cloudCallBeak) { |
| | | |
| | | String requestUrl = HttpApi.POST_PowerStation_List; |
| | | JsonObject json = new JsonObject(); |
| | |
| | | try { |
| | | int value = Integer.parseInt(powerStationStatus); |
| | | json.addProperty("powerStationStatus", value); |
| | | } catch (Exception ignored) { |
| | | } |
| | | } |
| | | if (!TextUtils.isEmpty(powerStationType)) { |
| | | try { |
| | | json.addProperty("powerStationType", powerStationType); |
| | | } catch (Exception ignored) { |
| | | } |
| | | } |
| | |
| | | * @param debugStatus (调试状态:Debugging = 调试中,WAIT_DELIVERED = 调试完成,Delivered = 已交付,SECONDARY_DEBUGGIN = 授权调试) |
| | | * @param installedCapacityMin 最小组串容量(装机容量) |
| | | * @param installedCapacityMax 最大组串容量(装机容量) |
| | | * @param powerStationType 电站类型(逆变器,BMS) |
| | | */ |
| | | public void getStatusOverview(String debugStatus, String installedCapacityMin, String installedCapacityMax, CloudCallBeak<StatusOverviewBean> cloudCallBeak) { |
| | | public void getStatusOverview(String debugStatus, String installedCapacityMin, String installedCapacityMax,String powerStationType, CloudCallBeak<StatusOverviewBean> cloudCallBeak) { |
| | | String requestUrl = HttpApi.POST_statusOverview; |
| | | JsonObject json = new JsonObject(); |
| | | if (!TextUtils.isEmpty(installedCapacityMin)) { |
| | |
| | | } |
| | | if (!TextUtils.isEmpty(debugStatus)) { |
| | | json.addProperty("debugStatus", debugStatus); |
| | | } |
| | | |
| | | if (!TextUtils.isEmpty(powerStationType)) { |
| | | json.addProperty("powerStationType", powerStationType); |
| | | } |
| | | |
| | | |
| | |
| | | // HdlFileLogic.getInstance().deleteDirectory(HdlFileLogic.getInstance().getCurrentHomeRootPath()); |
| | | //重新设置住宅id |
| | | UserConfigManage.getInstance().setHomeId(houseIdBean.getHomeId()); |
| | | UserConfigManage.getInstance().setPowerStationType(houseIdBean.getPowerStationType()); |
| | | UserConfigManage.getInstance().setHomeName(houseIdBean.getHomeName()); |
| | | //重新设置本地通讯秘钥 |
| | | UserConfigManage.getInstance().setLocalSecret(houseIdBean.getLocalSecret()); |
| | |
| | | }); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | public static class HouseBeanClass { |
| | |
| | | import com.hdl.photovoltaic.enums.DebugStatus; |
| | | import com.hdl.photovoltaic.enums.DeliverStatus; |
| | | import com.hdl.photovoltaic.enums.PowerStationStatus; |
| | | import com.hdl.photovoltaic.enums.PowerStationType; |
| | | import com.hdl.photovoltaic.enums.UnitType; |
| | | import com.hdl.photovoltaic.other.HdlCommonLogic; |
| | | import com.hdl.photovoltaic.ui.bean.HouseIdBean; |
| | |
| | | |
| | | |
| | | public class HouseInfoAdapter extends RecyclerView.Adapter<HouseInfoAdapter.MyViewHolder> { |
| | | |
| | | // 定义不同的 viewType 常量 |
| | | public static final int VIEW_TYPE_NORMAL = 1; // 普通电站详情 |
| | | public static final int VIEW_TYPE_BMS = 2; // BMS数据卡片 |
| | | private List<HouseIdBean> mList; |
| | | private final Context mContext; |
| | | private OnclickListener noOnclickListener;//点击了的监听器 |
| | |
| | | this.mContext = context; |
| | | } |
| | | |
| | | @Override |
| | | public int getItemViewType(int position) { |
| | | HouseIdBean item = this.mList.get(position); |
| | | if (item.getPowerStationType().equals(PowerStationType.BMS)) { |
| | | return VIEW_TYPE_BMS; |
| | | } else { |
| | | return VIEW_TYPE_NORMAL; |
| | | } |
| | | } |
| | | |
| | | @NonNull |
| | | @Override |
| | | public MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { |
| | | View contentItem = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_plant_details, parent, false); |
| | | View contentItem; |
| | | // 根据 viewType 加载不同的布局文件 |
| | | if (viewType == VIEW_TYPE_BMS) { |
| | | contentItem = LayoutInflater.from(parent.getContext()) |
| | | .inflate(R.layout.item_plant_bms_details, parent, false); |
| | | } else { |
| | | contentItem = LayoutInflater.from(parent.getContext()) |
| | | .inflate(R.layout.item_plant_details, parent, false); |
| | | } |
| | | return new MyViewHolder(contentItem); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void onBindViewHolder(@NonNull MyViewHolder holder, int position) { |
| | | |
| | | HouseIdBean houseIdBean = this.mList.get(position); |
| | | holder.homeNameTv.setText(houseIdBean.getHomeName().trim()); |
| | | //组串容量(创建电站时输入的组串容量) |
| | | holder.pv_value_tv.setText(HdlCommonLogic.convertDoubleValue(houseIdBean.getInstalledCapacity(), UnitType.kWp)); |
| | | holder.pv_kw_unit.setText(HdlCommonLogic.convertKWPUnit(houseIdBean.getInstalledCapacity())); |
| | | //当日发电 |
| | | holder.generation_today_value_tv.setText(HdlCommonLogic.convertDoubleValue(houseIdBean.getTodayElectricity(), UnitType.kWh)); |
| | | holder.generation_today_kw_unit.setText(HdlCommonLogic.convertKWHUnit(houseIdBean.getTodayElectricity())); |
| | | //逆变器额定功率(单个逆变器额定功率*逆变器数量) |
| | | holder.output_value_tv.setText(HdlCommonLogic.convertDoubleValue(houseIdBean.getInvPower(), UnitType.kW)); |
| | | holder.output_kw_unit.setText(HdlCommonLogic.convertKWUnit(houseIdBean.getInvPower())); |
| | | //电池能量(容量*电池数量) |
| | | holder.battery_storage_value_tv.setText(HdlCommonLogic.convertDoubleValue(houseIdBean.getBatteryCapacity(), UnitType.kWh)); |
| | | holder.battery_storage_kw_unit.setText(HdlCommonLogic.convertKWHUnit(houseIdBean.getBatteryCapacity())); |
| | | int viewType = getItemViewType(position); |
| | | if (viewType == VIEW_TYPE_BMS) { |
| | | holder.setText(R.id.bms_home_name_tv, houseIdBean.getHomeName().trim()); |
| | | //电池能量(容量*电池数量) |
| | | holder.setText(R.id.bms_battery_storage_value_tv, HdlCommonLogic.convertDoubleValue(houseIdBean.getBatteryCapacity(), UnitType.kWh)); |
| | | holder.setText(R.id.bms_battery_storage_kw_unit, HdlCommonLogic.convertKWHUnit(houseIdBean.getBatteryCapacity())); |
| | | holder.setText(R.id.bms_home_location_tv, houseIdBean.getHomeAddress()); |
| | | holder.getView(R.id.bms_item_parent_rl).setTag(position); |
| | | setHomeStateTextViewStyle(holder.getView(R.id.bms_home_state_tv), houseIdBean.getPowerStationStatus()); |
| | | setHomeDebugStateTextViewStyle(holder.getView(R.id.bms_home_debug_state_tv), holder.getView(R.id.bms_home_debug_state_iv), houseIdBean.getDebugStatus()); |
| | | GlideUtils.getRoundedCornersImage(mContext, houseIdBean.getPowerStationImage(), holder.getView(R.id.bms_home_image_iv), 6); |
| | | holder.getView(R.id.bms_item_parent_rl).setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | try { |
| | | if (noOnclickListener != null) { |
| | | noOnclickListener.onClick((int) holder.getView(R.id.bms_item_parent_rl).getTag(), houseIdBean); |
| | | } |
| | | } catch (Exception ignored) { |
| | | } |
| | | } |
| | | }); |
| | | //移动电站位置 |
| | | holder.getView(R.id.bms_move_ll).setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | try { |
| | | if (noOnclickListener != null) { |
| | | noOnclickListener.onMoveClick((int) holder.getView(R.id.bms_item_parent_rl).getTag(), houseIdBean); |
| | | } |
| | | } catch (Exception ignored) { |
| | | } |
| | | } |
| | | }); |
| | | holder.getView(R.id.bms_del_ll).setVisibility(View.GONE); |
| | | if (houseIdBean.getDebugStatus().equals(DebugStatus.Debugging)) { |
| | | //未交付完要显示删除按钮 |
| | | holder.getView(R.id.bms_del_ll).setVisibility(View.VISIBLE); |
| | | holder.setImageResource(R.id.bms_del_home_iv, R.drawable.del_home); |
| | | } |
| | | if (houseIdBean.getDebugStatus().equals(DebugStatus.WAIT_DELIVERED)) { |
| | | //更改成回滚图标 |
| | | holder.getView(R.id.bms_del_ll).setVisibility(View.VISIBLE); |
| | | holder.setImageResource(R.id.bms_del_home_iv, R.drawable.roll_back); |
| | | } |
| | | |
| | | holder.home_location_tv.setText(houseIdBean.getHomeAddress()); |
| | | holder.item_parent_rl.setTag(position); |
| | | setHomeStateTextViewStyle(holder.home_state_tv, houseIdBean.getPowerStationStatus()); |
| | | setHomeDebugStateTextViewStyle(holder.home_debug_state_tv, holder.home_debug_state_iv, houseIdBean.getDebugStatus()); |
| | | GlideUtils.getRoundedCornersImage(mContext, houseIdBean.getPowerStationImage(), holder.homeIconIv, 6); |
| | | //删除电站 |
| | | holder.getView(R.id.bms_del_ll).setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | try { |
| | | if (noOnclickListener != null) { |
| | | noOnclickListener.onDelClick((int) holder.item_parent_rl.getTag(), houseIdBean); |
| | | } |
| | | } catch (Exception ignored) { |
| | | } |
| | | } |
| | | }); |
| | | if (UserConfigManage.getInstance().isTourist_mode()) { |
| | | holder.getView(R.id.bms_del_ll).setVisibility(View.GONE); |
| | | } |
| | | } else { |
| | | holder.homeNameTv.setText(houseIdBean.getHomeName().trim()); |
| | | //组串容量(创建电站时输入的组串容量) |
| | | holder.pv_value_tv.setText(HdlCommonLogic.convertDoubleValue(houseIdBean.getInstalledCapacity(), UnitType.kWp)); |
| | | holder.pv_kw_unit.setText(HdlCommonLogic.convertKWPUnit(houseIdBean.getInstalledCapacity())); |
| | | //当日发电 |
| | | holder.generation_today_value_tv.setText(HdlCommonLogic.convertDoubleValue(houseIdBean.getTodayElectricity(), UnitType.kWh)); |
| | | holder.generation_today_kw_unit.setText(HdlCommonLogic.convertKWHUnit(houseIdBean.getTodayElectricity())); |
| | | //逆变器额定功率(单个逆变器额定功率*逆变器数量) |
| | | holder.output_value_tv.setText(HdlCommonLogic.convertDoubleValue(houseIdBean.getInvPower(), UnitType.kW)); |
| | | holder.output_kw_unit.setText(HdlCommonLogic.convertKWUnit(houseIdBean.getInvPower())); |
| | | //电池能量(容量*电池数量) |
| | | holder.battery_storage_value_tv.setText(HdlCommonLogic.convertDoubleValue(houseIdBean.getBatteryCapacity(), UnitType.kWh)); |
| | | holder.battery_storage_kw_unit.setText(HdlCommonLogic.convertKWHUnit(houseIdBean.getBatteryCapacity())); |
| | | |
| | | holder.home_location_tv.setText(houseIdBean.getHomeAddress()); |
| | | holder.item_parent_rl.setTag(position); |
| | | setHomeStateTextViewStyle(holder.home_state_tv, houseIdBean.getPowerStationStatus()); |
| | | setHomeDebugStateTextViewStyle(holder.home_debug_state_tv, holder.home_debug_state_iv, houseIdBean.getDebugStatus()); |
| | | GlideUtils.getRoundedCornersImage(mContext, houseIdBean.getPowerStationImage(), holder.homeIconIv, 6); |
| | | // HdlLogLogic.print("---电站名称:" + houseIdBean.getHomeName() + "---图片url:" + houseIdBean.getPowerStationImage(), false); |
| | | holder.item_parent_rl.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | try { |
| | | if (noOnclickListener != null) { |
| | | noOnclickListener.onClick((int) holder.item_parent_rl.getTag(), houseIdBean); |
| | | holder.item_parent_rl.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | try { |
| | | if (noOnclickListener != null) { |
| | | noOnclickListener.onClick((int) holder.item_parent_rl.getTag(), houseIdBean); |
| | | } |
| | | } catch (Exception ignored) { |
| | | } |
| | | } catch (Exception ignored) { |
| | | } |
| | | } |
| | | }); |
| | | //移动电站位置 |
| | | holder.home_move_ll.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | try { |
| | | if (noOnclickListener != null) { |
| | | noOnclickListener.onMoveClick((int) holder.item_parent_rl.getTag(), houseIdBean); |
| | | }); |
| | | //移动电站位置 |
| | | holder.home_move_ll.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | try { |
| | | if (noOnclickListener != null) { |
| | | noOnclickListener.onMoveClick((int) holder.item_parent_rl.getTag(), houseIdBean); |
| | | } |
| | | } catch (Exception ignored) { |
| | | } |
| | | } catch (Exception ignored) { |
| | | } |
| | | } |
| | | }); |
| | | holder.home_del_ll.setVisibility(View.GONE); |
| | | |
| | | if (houseIdBean.getDebugStatus().equals(DebugStatus.Debugging)) { |
| | | //未交付完要显示删除按钮 |
| | | holder.home_del_ll.setVisibility(View.VISIBLE); |
| | | holder.del_home_iv.setImageResource(R.drawable.del_home); |
| | | } |
| | | if (houseIdBean.getDebugStatus().equals(DebugStatus.WAIT_DELIVERED)) { |
| | | //更改成回滚图标 |
| | | holder.home_del_ll.setVisibility(View.VISIBLE); |
| | | holder.del_home_iv.setImageResource(R.drawable.roll_back); |
| | | } |
| | | |
| | | //删除电站 |
| | | holder.home_del_ll.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | try { |
| | | if (noOnclickListener != null) { |
| | | noOnclickListener.onDelClick((int) holder.item_parent_rl.getTag(), houseIdBean); |
| | | } |
| | | } catch (Exception ignored) { |
| | | } |
| | | } |
| | | }); |
| | | |
| | | if (UserConfigManage.getInstance().isTourist_mode()) { |
| | | }); |
| | | holder.home_del_ll.setVisibility(View.GONE); |
| | | } |
| | | |
| | | if (houseIdBean.getDebugStatus().equals(DebugStatus.Debugging)) { |
| | | //未交付完要显示删除按钮 |
| | | holder.home_del_ll.setVisibility(View.VISIBLE); |
| | | holder.del_home_iv.setImageResource(R.drawable.del_home); |
| | | } |
| | | if (houseIdBean.getDebugStatus().equals(DebugStatus.WAIT_DELIVERED)) { |
| | | //更改成回滚图标 |
| | | holder.home_del_ll.setVisibility(View.VISIBLE); |
| | | holder.del_home_iv.setImageResource(R.drawable.roll_back); |
| | | } |
| | | |
| | | //删除电站 |
| | | holder.home_del_ll.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | try { |
| | | if (noOnclickListener != null) { |
| | | noOnclickListener.onDelClick((int) holder.item_parent_rl.getTag(), houseIdBean); |
| | | } |
| | | } catch (Exception ignored) { |
| | | } |
| | | } |
| | | }); |
| | | |
| | | if (UserConfigManage.getInstance().isTourist_mode()) { |
| | | holder.home_del_ll.setVisibility(View.GONE); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | home_location_tv = itemView.findViewById(R.id.home_location_tv); |
| | | item_parent_swipeLayout = itemView.findViewById(R.id.item_parent_swipeLayout); |
| | | } |
| | | |
| | | /** |
| | | * 设置文本 |
| | | */ |
| | | public void setText(int viewId, String text) { |
| | | TextView textView = getView(viewId); |
| | | if (textView != null) { |
| | | textView.setText(text); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 设置图片资源 |
| | | */ |
| | | public void setImageResource(int viewId, int resId) { |
| | | ImageView imageView = getView(viewId); |
| | | if (imageView != null) { |
| | | imageView.setImageResource(resId); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 设置文本颜色 |
| | | */ |
| | | public void setTextColor(int viewId, int color) { |
| | | TextView textView = getView(viewId); |
| | | if (textView != null) { |
| | | textView.setTextColor(color); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 设置点击事件 |
| | | */ |
| | | public void setOnClickListener(int viewId, View.OnClickListener listener) { |
| | | View view = getView(viewId); |
| | | if (view != null) { |
| | | view.setOnClickListener(listener); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取 View |
| | | */ |
| | | @SuppressWarnings("unchecked") |
| | | public <T extends View> T getView(int viewId) { |
| | | return (T) itemView.findViewById(viewId); |
| | | } |
| | | } |
| | | |
| | | public interface OnclickListener { |
| | |
| | | private HouseInfoBean.Location location;//电站地址 |
| | | private String localSecret;//所属电站的本地密钥 |
| | | |
| | | private List<FwVersionBean> fwVersion = new ArrayList<>();//BMS设备才有的固件版本 |
| | | public List<FwVersionBean> getFwVersion() { |
| | | return fwVersion; |
| | | } |
| | | |
| | | public void setFwVersion(List<FwVersionBean> fwVersion) { |
| | | this.fwVersion = fwVersion; |
| | | } |
| | | |
| | | public boolean isActivate() { |
| | | return activate; |
| | | } |
| | |
| | | |
| | | private boolean activate;//是否激活设备(true:激活;false:未激活) |
| | | |
| | | private boolean popUpgrade;//改设备是否有弹窗升级 |
| | | private boolean subPopUpgrade;//下挂设备是否有弹窗升级 |
| | | private boolean popUpgrade;//改设备是否有弹窗升级 |
| | | private boolean subPopUpgrade;//下挂设备是否有弹窗升级 |
| | | |
| | | public boolean isSubPopUpgrade() { |
| | | return subPopUpgrade; |
| | |
| | | } |
| | | |
| | | public String getWorkStatusDesc() { |
| | | return workStatusDesc==null?"":this.workStatusDesc; |
| | | return workStatusDesc == null ? "" : this.workStatusDesc; |
| | | } |
| | | |
| | | public void setWorkStatusDesc(String workStatusDesc) { |
| New file |
| | |
| | | package com.hdl.photovoltaic.ui.bean; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * BMS设备固件版本 |
| | | */ |
| | | public class FwVersionBean implements Serializable { |
| | | private String fwModule; |
| | | private String version; |
| | | private boolean upgrade;//是否需要升级 |
| | | private boolean popUpgrade;//该设备是否有弹窗升级 |
| | | private String versionNew;//新版本号 |
| | | private String versionNewDesc;//新版本描述 |
| | | private long versionNewId;//新版本号id |
| | | private String versionNewFileUrl;//新版本下载地址(加密过的) |
| | | |
| | | public String getFwModule() { |
| | | return fwModule == null ? "" : fwModule; |
| | | } |
| | | |
| | | public void setFwModule(String module) { |
| | | this.fwModule = module; |
| | | } |
| | | |
| | | public String getVersion() { |
| | | return version == null ? "" : version; |
| | | } |
| | | |
| | | public void setVersion(String version) { |
| | | this.version = version; |
| | | } |
| | | |
| | | public boolean isUpgrade() { |
| | | return upgrade; |
| | | } |
| | | |
| | | public void setUpgrade(boolean upgrade) { |
| | | this.upgrade = upgrade; |
| | | } |
| | | |
| | | public boolean isPopUpgrade() { |
| | | return popUpgrade; |
| | | } |
| | | |
| | | public void setPopUpgrade(boolean popUpgrade) { |
| | | this.popUpgrade = popUpgrade; |
| | | } |
| | | |
| | | public String getVersionNew() { |
| | | return versionNew == null ? "" : versionNew; |
| | | } |
| | | |
| | | public void setVersionNew(String versionNew) { |
| | | this.versionNew = versionNew; |
| | | } |
| | | |
| | | public String getVersionNewDesc() { |
| | | return versionNewDesc == null ? "" : versionNewDesc; |
| | | } |
| | | |
| | | public void setVersionNewDesc(String versionNewDesc) { |
| | | this.versionNewDesc = versionNewDesc; |
| | | } |
| | | |
| | | public long getVersionNewId() { |
| | | return versionNewId == 0 ? 0 : versionNewId; |
| | | } |
| | | |
| | | public void setVersionNewId(long versionNewId) { |
| | | this.versionNewId = versionNewId; |
| | | } |
| | | |
| | | public String getVersionNewFileUrl() { |
| | | return versionNewFileUrl == null ? "" : versionNewFileUrl; |
| | | } |
| | | |
| | | public void setVersionNewFileUrl(String versionNewFileUrl) { |
| | | this.versionNewFileUrl = versionNewFileUrl; |
| | | } |
| | | } |
| | |
| | | */ |
| | | public class HouseIdBean implements Serializable { |
| | | private String homeId;//电站id |
| | | private String debugType="NORMAL";//调试类型(NORMAL =常规调试;SIMPLE =简易调试) |
| | | private String communityId="";//项目id |
| | | private String flowRecordContent="";//流转记录内容 |
| | | private String debugType = "NORMAL";//调试类型(NORMAL =常规调试;SIMPLE =简易调试) |
| | | private String communityId = "";//项目id |
| | | private String flowRecordContent = "";//流转记录内容 |
| | | private String powerStationImage;//电站图片 |
| | | private String homeName;//电站名称 |
| | | private String installedCapacity;//组串容量(创建电站时输入的组串容量) |
| | |
| | | * SECONDARY_DEBUGGIN = 授权调试 |
| | | */ |
| | | private String debugStatus; |
| | | /** |
| | | * 电站类型 |
| | | * INV = 逆变器电站 |
| | | * BMS = BMS电站 |
| | | */ |
| | | private String powerStationType = "INV"; |
| | | |
| | | public String getPowerStationType() { |
| | | return powerStationType; |
| | | } |
| | | |
| | | public void setPowerStationType(String powerStationType) { |
| | | this.powerStationType = powerStationType; |
| | | } |
| | | |
| | | public String getDebugType() { |
| | | return debugType; |
| | | } |
| | |
| | | public void setFlowRecordContent(String flowRecordContent) { |
| | | this.flowRecordContent = flowRecordContent; |
| | | } |
| | | |
| | | public String getDebugStatus() { |
| | | return debugStatus == null ? "" : debugStatus; |
| | | } |
| | |
| | | if (this.location == null) { |
| | | return this.getAddress(); |
| | | } |
| | | return this.location.getNationName() +" "+ this.location.getProvinceName() +" "+ this.location.getCityName() +" "+ this.getAddress(); |
| | | return this.location.getNationName() + " " + this.location.getProvinceName() + " " + this.location.getCityName() + " " + this.getAddress(); |
| | | } |
| | | } |
| | |
| | | private String latitude;//纬度 |
| | | private String longitude;//经度 |
| | | private String timezone;//时区 |
| | | private String powerStationType;//电站类型(DOMESTIC_ROOF:家用屋顶,COMMERCIAL_ROOF:商业用屋顶,INDUSTRIAL_ROOF:工业用屋顶,SURFACE_POWER_STATION:地面电站) |
| | | private String workMode;//工作模式(self_use:自发自用,peak_load_shifting:削峰填谷,battery_priority:电池优先,auto:智能模式) |
| | | private long productionTime;//投产日志 |
| | | private String monetaryUnit;//货币单位 |
| | |
| | | |
| | | public void setTimezone(String timezone) { |
| | | this.timezone = timezone; |
| | | } |
| | | |
| | | public String getPowerStationType() { |
| | | return powerStationType == null ? "" : powerStationType; |
| | | } |
| | | |
| | | public void setPowerStationType(String powerStationType) { |
| | | this.powerStationType = powerStationType; |
| | | } |
| | | |
| | | public String getWorkMode() { |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | * 电站状态概览 |
| | | */ |
| | | private void getStatusOverview() { |
| | | HdlResidenceLogic.getInstance().getStatusOverview("", "", "", new CloudCallBeak<StatusOverviewBean>() { |
| | | HdlResidenceLogic.getInstance().getStatusOverview("", "", "", "",new CloudCallBeak<StatusOverviewBean>() { |
| | | @Override |
| | | public void onSuccess(StatusOverviewBean statusOverviewBean) { |
| | | if (statusOverviewBean == null) { |
| | |
| | | import com.hdl.photovoltaic.enums.LogoutType; |
| | | import com.hdl.photovoltaic.enums.LowerTagType; |
| | | import com.hdl.photovoltaic.enums.PowerStationStatus; |
| | | import com.hdl.photovoltaic.enums.PowerStationType; |
| | | import com.hdl.photovoltaic.enums.ProjectOperation; |
| | | import com.hdl.photovoltaic.enums.ShowErrorMode; |
| | | import com.hdl.photovoltaic.enums.SortType; |
| | |
| | | private String installedCapacityMaxValue = "";//最大组串容量(装机容量) |
| | | private String screeningConditionStatus = DebugStatus.All;//筛选条件状态 |
| | | private String powerStationStatusValue = PowerStationStatus.All;//电站状态(全部 不传该过滤参数,1:正常(运行),2:离线,3:待接入,4:故障) |
| | | private String powerStationTypeValue = PowerStationType.All;//电站类型(INV = 逆变器电站;BMS = BMS电站) |
| | | |
| | | private final long pageSize = 100;//一页大小 |
| | | |
| | |
| | | installedCapacityMaxValue = ""; |
| | | screeningConditionStatus = DebugStatus.All; |
| | | powerStationStatusValue = PowerStationStatus.All; |
| | | powerStationTypeValue = PowerStationType.All; |
| | | } |
| | | |
| | | @Override |
| | |
| | | selectedTitleLabelStyle(); |
| | | initializationState(); |
| | | getStatusOverview(); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, powerStationTypeValue, 1, true); |
| | | |
| | | } |
| | | }); |
| | |
| | | powerStationStatusValue = PowerStationStatus.All; |
| | | stationStatusStyle(viewBinding.allLl, viewBinding.allDesTv); |
| | | getStatusOverview(); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, powerStationTypeValue, 1, true); |
| | | } |
| | | }); |
| | | //故障 |
| | |
| | | powerStationStatusValue = PowerStationStatus.malfunction; |
| | | stationStatusStyle(viewBinding.faultsLl, viewBinding.faultsDesTv); |
| | | getStatusOverview(); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, powerStationTypeValue, 1, true); |
| | | } |
| | | }); |
| | | //离线 |
| | |
| | | powerStationStatusValue = PowerStationStatus.off; |
| | | stationStatusStyle(viewBinding.offlineLl, viewBinding.offlineDesTv); |
| | | getStatusOverview(); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, powerStationTypeValue, 1, true); |
| | | } |
| | | }); |
| | | //待接入 |
| | |
| | | powerStationStatusValue = PowerStationStatus.connecting; |
| | | stationStatusStyle(viewBinding.connectedLl, viewBinding.connectedDesTv); |
| | | getStatusOverview(); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, powerStationTypeValue, 1, true); |
| | | } |
| | | }); |
| | | |
| | |
| | | public void onClick(View v) { |
| | | DefaultFilteringDialog defaultFilteringDialog = new DefaultFilteringDialog(_mActivity); |
| | | defaultFilteringDialog.show(); |
| | | defaultFilteringDialog.initState(installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus); |
| | | defaultFilteringDialog.initState(installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationTypeValue); |
| | | defaultFilteringDialog.setOnClickListener(new DefaultFilteringDialog.OnClickListener() { |
| | | @Override |
| | | public void confirm(String min, String max, String state) { |
| | | public void confirm(String min, String max, String state, String powerStationType) { |
| | | installedCapacityMinValue = min;//最小组串容量(装机容量) |
| | | installedCapacityMaxValue = max;//最大组串容量(装机容量) |
| | | screeningConditionStatus = state;//调试状态(全部;调试中;调试完成;已交付;授权调试) |
| | | powerStationTypeValue = powerStationType;//电站类型(INV = 逆变器电站;BMS = BMS电站) |
| | | getStatusOverview(); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, powerStationTypeValue, 1, true); |
| | | } |
| | | }); |
| | | } |
| | |
| | | // if (houseIdBean.getDebugType().equals(DebugType.NORMAL)) { |
| | | //【常规方式】发起删除电站指令(搜索网关是考到网关没有连接到云端,使用本地发送初始化指令) |
| | | // 硬件那边叫新固件也发初始化 2025年10月14日10:55:18 |
| | | HdlDeviceLogic.getInstance().getCurrentHomeLocalAndCloudGatewayList(houseIdBean.getHomeId(), new CloudCallBeak<List<GatewayBean>>() { |
| | | HdlDeviceLogic.getInstance().getCurrentHomeLocalAndCloudGatewayList(houseIdBean.getHomeId(), houseIdBean.getPowerStationType(), new CloudCallBeak<List<GatewayBean>>() { |
| | | @Override |
| | | public void onSuccess(List<GatewayBean> list) { |
| | | //发起删除电站指令 |
| | |
| | | key = SortType.installedCapacitySort; |
| | | value = isSelected ? SortValue.ascending : SortValue.descending; |
| | | getStatusOverview(); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, powerStationTypeValue, 1, true); |
| | | } |
| | | }); |
| | | //额定功率筛选 |
| | |
| | | key = SortType.invPowerSort; |
| | | value = isSelected ? SortValue.ascending : SortValue.descending; |
| | | getStatusOverview(); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, powerStationTypeValue, 1, true); |
| | | } |
| | | }); |
| | | //电站电池容量筛选 |
| | |
| | | key = SortType.batteryCapacitySort; |
| | | value = isSelected ? SortValue.ascending : SortValue.descending; |
| | | getStatusOverview(); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, powerStationTypeValue, 1, true); |
| | | } |
| | | }); |
| | | //电站当日发电量筛选 |
| | |
| | | key = SortType.todayElectricitySort; |
| | | value = isSelected ? SortValue.ascending : SortValue.descending; |
| | | getStatusOverview(); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, powerStationTypeValue, 1, true); |
| | | } |
| | | }); |
| | | //设备点击 |
| | |
| | | List<CloudInverterDeviceBean> newList = new ArrayList<>(); |
| | | newList.add(deviceBean); |
| | | //目的是为了获取拿到网关ID,mqtt通讯秘钥等信息,拿到后缓存到本地逆变器列表里面,发送数据数据时自动去缓存列表里面去查找; |
| | | HdlDeviceLogic.getInstance().setDeviceRemoteInfo(newList, deviceBean.getHomeId(), new CloudCallBeak<List<GatewayBean>>() { |
| | | HdlDeviceLogic.getInstance().setDeviceRemoteInfo(newList, deviceBean.getHomeId(), PowerStationType.All, new CloudCallBeak<List<GatewayBean>>() { |
| | | @Override |
| | | public void onSuccess(List<GatewayBean> obj) { |
| | | |
| | |
| | | // MqttRecvClient.getInstance().removeAllTopic(); |
| | | // } |
| | | |
| | | loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); |
| | | loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, powerStationTypeValue, 1, true); |
| | | } |
| | | } else if (HDLUniMP.UNI_EVENT_REPLY_DEVICE_LIST.equals(eventBus.getType())) { |
| | | // 取消粘性事件 |
| | |
| | | } |
| | | String homeId = eventBus.getData().toString(); |
| | | //进去住宅详情uni读取逆变器列表成功后通知 |
| | | for (int i = 0; i < HdlDeviceLogic.getInstance().getCurrentHomeGatewayList(homeId).size(); i++) { |
| | | String gatewayId = HdlDeviceLogic.getInstance().getCurrentHomeGatewayList(homeId).get(i).getGatewayId(); |
| | | for (int i = 0; i < HdlDeviceLogic.getInstance().getCurrentHomeGatewayList(homeId,PowerStationType.All).size(); i++) { |
| | | String gatewayId = HdlDeviceLogic.getInstance().getCurrentHomeGatewayList(homeId,PowerStationType.All).get(i).getGatewayId(); |
| | | //字符串是自己按规则拼接的,里面注册主题时会解析字符串,只拿getGatewayId()值; |
| | | String topic = "/user/" + gatewayId + "/#"; |
| | | //进去住宅详情开始订阅主题 |
| | |
| | | initializationState(); |
| | | stationStatusStyle(viewBinding.allLl, viewBinding.allDesTv); |
| | | getStatusOverview(); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, powerStationTypeValue, 1, true); |
| | | } else if (eventBus.getType().equals(ConstantManage.station_page)) { |
| | | // 取消粘性事件 |
| | | EventBus.getDefault().removeStickyEvent(eventBus); |
| | |
| | | stationStatusStyle(viewBinding.connectedLl, viewBinding.connectedDesTv); |
| | | } |
| | | getStatusOverview(); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); |
| | | loadNextPageHouseList(true, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, powerStationTypeValue, 1, true); |
| | | } else if (eventBus.getType().equals(ConstantManage.station_edit)) { |
| | | //编辑后更新一下住宅列表 |
| | | //loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, gridTypeValue, powerStationStatusValue, 1, true); |
| | |
| | | * 电站状态概览 |
| | | */ |
| | | private void getStatusOverview() { |
| | | HdlResidenceLogic.getInstance().getStatusOverview(screeningConditionStatus, installedCapacityMinValue, installedCapacityMaxValue, new CloudCallBeak<StatusOverviewBean>() { |
| | | HdlResidenceLogic.getInstance().getStatusOverview(screeningConditionStatus, installedCapacityMinValue, installedCapacityMaxValue, powerStationTypeValue, new CloudCallBeak<StatusOverviewBean>() { |
| | | @Override |
| | | public void onSuccess(StatusOverviewBean statusOverviewBean) { |
| | | if (statusOverviewBean == null) { |
| | |
| | | * @param installedCapacityMax 最大组串容量(装机容量) |
| | | * @param gridType 调试状态(全部;调试中;调试完成;已交付;授权调试) |
| | | * @param powerStationStatus 电站状态 (全部 :"";1 : 正常;2 : 离线; 3 : 待接入;4 : 故障) |
| | | * @param powerStationType 电站类型(INV = 逆变器电站;BMS = BMS电站) |
| | | * @param pageNo 页码 |
| | | * @param isClear 是否清除数据 |
| | | */ |
| | | private void loadNextPageHouseList(boolean isRefreshing, String key, String keyValue, String installedCapacityMin, String installedCapacityMax, String gridType, String powerStationStatus, long pageNo, boolean isClear) { |
| | | private void loadNextPageHouseList(boolean isRefreshing, String key, String keyValue, String installedCapacityMin, String installedCapacityMax, String gridType, String powerStationStatus, String powerStationType, long pageNo, boolean isClear) { |
| | | isReadData = true; |
| | | if (isClear) { |
| | | clearData(); |
| | |
| | | } |
| | | |
| | | //获取住宅(电站)ID列表 |
| | | HdlResidenceLogic.getInstance().getResidenceIdList(key, keyValue, installedCapacityMin, installedCapacityMax, gridType, powerStationStatus, pageNo, pageSize, new CloudCallBeak<HdlResidenceLogic.HouseBeanClass>() { |
| | | HdlResidenceLogic.getInstance().getResidenceIdList(key, keyValue, installedCapacityMin, installedCapacityMax, gridType, powerStationStatus, powerStationType, pageNo, pageSize, new CloudCallBeak<HdlResidenceLogic.HouseBeanClass>() { |
| | | @Override |
| | | public void onSuccess(HdlResidenceLogic.HouseBeanClass houseBeanClass) { |
| | | HdlThreadLogic.runMainThread(new Runnable() { |
| | |
| | | // 执行任务(如更新UI、跳转等) |
| | | viewBinding.fragmentHouseSrl.endRefreshing(); |
| | | //加载最新数据完成 |
| | | loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, 1, true); |
| | | loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, powerStationTypeValue, 1, true); |
| | | getStatusOverview(); |
| | | } |
| | | }.execute(); |
| | |
| | | viewBinding.fragmentHouseSrl.endLoadingMore(); |
| | | if (!isHouseLoadingMore) { |
| | | // 滑动到了底部,执行相应的操作 |
| | | loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, ++currentHouseListPage, false); |
| | | loadNextPageHouseList(false, key, value, installedCapacityMinValue, installedCapacityMaxValue, screeningConditionStatus, powerStationStatusValue, powerStationTypeValue, ++currentHouseListPage, false); |
| | | } |
| | | } |
| | | }.execute(); |
| | |
| | | |
| | | //获取住宅(电站)ID列表 |
| | | HdlResidenceLogic.getInstance().getResidenceIdList(SortType.homeName, currSearchText, |
| | | "", "", "", "", |
| | | "", "", "", "","", |
| | | pageNo, 20, new CloudCallBeak<HdlResidenceLogic.HouseBeanClass>() { |
| | | @Override |
| | | public void onSuccess(HdlResidenceLogic.HouseBeanClass houseBeanClass) { |
| | |
| | | showLoading(getString(R.string.device_loading)); |
| | | } |
| | | //获取住宅(电站)ID列表 |
| | | HdlResidenceLogic.getInstance().getResidenceIdList("", "", "", "", "", "", 1, 200, new CloudCallBeak<HdlResidenceLogic.HouseBeanClass>() { |
| | | HdlResidenceLogic.getInstance().getResidenceIdList("", "", "", "", "", "","", 1, 200, new CloudCallBeak<HdlResidenceLogic.HouseBeanClass>() { |
| | | @Override |
| | | public void onSuccess(HdlResidenceLogic.HouseBeanClass houseBeanClass) { |
| | | HdlThreadLogic.runMainThread(new Runnable() { |
| | |
| | | import com.hdl.photovoltaic.databinding.DialogDefaultFilteringBinding; |
| | | import com.hdl.photovoltaic.enums.DebugStatus; |
| | | import com.hdl.photovoltaic.enums.GridType; |
| | | import com.hdl.photovoltaic.enums.PowerStationType; |
| | | import com.hdl.photovoltaic.enums.UnitType; |
| | | import com.hdl.photovoltaic.other.HdlThreadLogic; |
| | | |
| | |
| | | final String text8 = "500+"; |
| | | |
| | | |
| | | private String mStateValue = GridType.All; |
| | | private String mGridType = GridType.All; |
| | | /** |
| | | * 电站类型(INV = 逆变器电站;BMS = BMS电站) |
| | | */ |
| | | private String mPowerStationType = PowerStationType.All; |
| | | |
| | | public DefaultFilteringDialog(@NonNull Context context) { |
| | | super(context, R.style.Custom_Dialog); |
| | |
| | | if (Integer.parseInt(minValue) > Integer.parseInt(maxValue)) { |
| | | //最小值在前面 |
| | | if (mOnClickListener != null) { |
| | | mOnClickListener.confirm(maxValue, minValue, mStateValue); |
| | | mOnClickListener.confirm(maxValue, minValue, mGridType, mPowerStationType); |
| | | } |
| | | } else { |
| | | if (mOnClickListener != null) { |
| | | mOnClickListener.confirm(minValue, maxValue, mStateValue); |
| | | mOnClickListener.confirm(minValue, maxValue, mGridType, mPowerStationType); |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | |
| | | |
| | | } else { |
| | | if (mOnClickListener != null) { |
| | | mOnClickListener.confirm(minValue, maxValue, mStateValue); |
| | | mOnClickListener.confirm(minValue, maxValue, mGridType, mPowerStationType); |
| | | } |
| | | } |
| | | dismiss(); |
| | |
| | | setBackgroundColor(null, TitleType.string_capacity); |
| | | setSelectedText(""); |
| | | setBackgroundColor(viewBinding.allTv, TitleType.debuggingState); |
| | | mStateValue = DebugStatus.All; |
| | | setBackgroundColor(viewBinding.powerStationTypeAllTv, TitleType.powerStationType); |
| | | mGridType = DebugStatus.All; |
| | | mPowerStationType = PowerStationType.All; |
| | | } |
| | | }); |
| | | viewBinding.text1Tv.setOnClickListener(new View.OnClickListener() { |
| | |
| | | @Override |
| | | public void onClick(View v) { |
| | | setBackgroundColor(viewBinding.allTv, TitleType.debuggingState); |
| | | mStateValue = DebugStatus.All; |
| | | mGridType = DebugStatus.All; |
| | | } |
| | | }); |
| | | //调试中 |
| | |
| | | @Override |
| | | public void onClick(View v) { |
| | | setBackgroundColor(viewBinding.beDebuggingTv, TitleType.debuggingState); |
| | | mStateValue = DebugStatus.Debugging; |
| | | mGridType = DebugStatus.Debugging; |
| | | } |
| | | }); |
| | | //调试完成 |
| | |
| | | @Override |
| | | public void onClick(View v) { |
| | | setBackgroundColor(viewBinding.debuggingcOmpletedTv, TitleType.debuggingState); |
| | | mStateValue = DebugStatus.WAIT_DELIVERED; |
| | | mGridType = DebugStatus.WAIT_DELIVERED; |
| | | } |
| | | }); |
| | | //已交付 |
| | |
| | | @Override |
| | | public void onClick(View v) { |
| | | setBackgroundColor(viewBinding.deliveredTv, TitleType.debuggingState); |
| | | mStateValue = DebugStatus.Delivered; |
| | | mGridType = DebugStatus.Delivered; |
| | | } |
| | | }); |
| | | //授权调试 |
| | |
| | | @Override |
| | | public void onClick(View v) { |
| | | setBackgroundColor(viewBinding.authorizationDebuggingTv, TitleType.debuggingState); |
| | | mStateValue = DebugStatus.SECONDARY_DEBUGGIN; |
| | | mGridType = DebugStatus.SECONDARY_DEBUGGIN; |
| | | } |
| | | }); |
| | | //电站类型--全部 |
| | | viewBinding.powerStationTypeAllTv.setOnClickListener(new View.OnClickListener() { |
| | | |
| | | @Override |
| | | public void onClick(View v) { |
| | | setBackgroundColor(viewBinding.powerStationTypeAllTv, TitleType.powerStationType); |
| | | mPowerStationType = PowerStationType.All; |
| | | } |
| | | }); |
| | | |
| | | //电站类型--逆变器 |
| | | viewBinding.powerStationTypeInvTv.setOnClickListener(new View.OnClickListener() { |
| | | |
| | | @Override |
| | | public void onClick(View v) { |
| | | setBackgroundColor(viewBinding.powerStationTypeInvTv, TitleType.powerStationType); |
| | | mPowerStationType = PowerStationType.INV; |
| | | } |
| | | }); |
| | | |
| | | //电站类型--BMS |
| | | viewBinding.powerStationTypeBmsTv.setOnClickListener(new View.OnClickListener() { |
| | | |
| | | @Override |
| | | public void onClick(View v) { |
| | | setBackgroundColor(viewBinding.powerStationTypeBmsTv, TitleType.powerStationType); |
| | | mPowerStationType = PowerStationType.BMS; |
| | | } |
| | | }); |
| | | |
| | |
| | | viewBinding.text6Tv.setBackground(AppCompatResources.getDrawable(mContext, R.drawable.config_129)); |
| | | viewBinding.text7Tv.setBackground(AppCompatResources.getDrawable(mContext, R.drawable.config_129)); |
| | | viewBinding.text8Tv.setBackground(AppCompatResources.getDrawable(mContext, R.drawable.config_129)); |
| | | } else if (titleType == TitleType.powerStationType) { |
| | | viewBinding.powerStationTypeAllTv.setBackground(AppCompatResources.getDrawable(mContext, R.drawable.config_129)); |
| | | viewBinding.powerStationTypeInvTv.setBackground(AppCompatResources.getDrawable(mContext, R.drawable.config_129)); |
| | | viewBinding.powerStationTypeBmsTv.setBackground(AppCompatResources.getDrawable(mContext, R.drawable.config_129)); |
| | | } else { |
| | | viewBinding.allTv.setBackground(AppCompatResources.getDrawable(mContext, R.drawable.config_129)); |
| | | viewBinding.beDebuggingTv.setBackground(AppCompatResources.getDrawable(mContext, R.drawable.config_129)); |
| | |
| | | |
| | | } |
| | | |
| | | public void initState(String min, String max, String stateValue) { |
| | | public void initState(String min, String max, String stateValue, String powerStationTypeValue) { |
| | | try { |
| | | mStateValue = stateValue; |
| | | mPowerStationType = powerStationTypeValue; |
| | | mGridType = stateValue; |
| | | viewBinding.minEt.setText(min); |
| | | viewBinding.maxEt.setText(max); |
| | | |
| | |
| | | break; |
| | | } |
| | | } |
| | | switch (powerStationTypeValue) { |
| | | case PowerStationType.All: |
| | | setBackgroundColor(viewBinding.powerStationTypeAllTv, TitleType.powerStationType); |
| | | break; |
| | | case PowerStationType.INV: |
| | | setBackgroundColor(viewBinding.powerStationTypeInvTv, TitleType.powerStationType); |
| | | break; |
| | | case PowerStationType.BMS: |
| | | setBackgroundColor(viewBinding.powerStationTypeBmsTv, TitleType.powerStationType); |
| | | break; |
| | | default: { |
| | | setBackgroundColor(viewBinding.powerStationTypeAllTv, TitleType.powerStationType); |
| | | break; |
| | | } |
| | | } |
| | | } catch (Exception ignored) { |
| | | } |
| | | |
| | |
| | | viewBinding.authorizationDebuggingTv.setTag(DebugStatus.SECONDARY_DEBUGGIN); |
| | | setBackgroundColor(null, TitleType.string_capacity); |
| | | setBackgroundColor(viewBinding.allTv, TitleType.debuggingState); |
| | | setBackgroundColor(viewBinding.powerStationTypeAllTv, TitleType.powerStationType); |
| | | } |
| | | |
| | | public void setOnClickListener(OnClickListener onClickListener) { |
| | |
| | | |
| | | |
| | | public interface OnClickListener { |
| | | void confirm(String min, String max, String state); |
| | | void confirm(String min, String max, String state, String powerStationType); |
| | | } |
| | | |
| | | public enum TitleType { |
| | | string_capacity,//组串容量 |
| | | debuggingState//调试状态 |
| | | debuggingState,//调试状态 |
| | | powerStationType//电站类型 |
| | | |
| | | } |
| | | |
| | |
| | | android:layout_height="match_parent" /> |
| | | </LinearLayout> |
| | | |
| | | <TextView |
| | | android:id="@+id/powerStationType_title_tv" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="@dimen/dp_23" |
| | | android:layout_marginStart="@dimen/dp_20" |
| | | android:layout_marginTop="37dp" |
| | | android:text="@string/power_station_type" |
| | | android:textColor="@color/text_FFACACAC" |
| | | android:textSize="@dimen/text_14" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@+id/line5_ll" /> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/line6_ll" |
| | | android:layout_width="0dp" |
| | | android:layout_height="@dimen/dp_35" |
| | | android:layout_marginStart="@dimen/dp_20" |
| | | android:layout_marginTop="@dimen/dp_8" |
| | | android:layout_marginEnd="@dimen/dp_20" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@+id/powerStationType_title_tv"> |
| | | |
| | | <!--全部--> |
| | | <TextView |
| | | android:id="@+id/powerStationType_all_tv" |
| | | android:layout_width="102dp" |
| | | android:layout_height="match_parent" |
| | | android:background="@drawable/config_129" |
| | | android:gravity="center" |
| | | android:text="@string/message_all" |
| | | android:textColor="@color/text_FFACACAC" |
| | | android:textSize="@dimen/text_12" /> |
| | | |
| | | <View |
| | | android:layout_width="0dp" |
| | | android:layout_height="match_parent" |
| | | android:layout_weight="1" /> |
| | | <!--逆变器--> |
| | | <TextView |
| | | android:id="@+id/powerStationType_inv_tv" |
| | | android:layout_width="102dp" |
| | | android:layout_height="match_parent" |
| | | android:background="@drawable/config_129" |
| | | android:gravity="center" |
| | | android:text="@string/alarm_all_device_inverter" |
| | | android:textColor="@color/text_FFACACAC" |
| | | android:textSize="@dimen/text_12" /> |
| | | |
| | | <View |
| | | android:layout_width="0dp" |
| | | android:layout_height="match_parent" |
| | | android:layout_weight="1" /> |
| | | <!--BMS--> |
| | | <TextView |
| | | android:id="@+id/powerStationType_bms_tv" |
| | | android:layout_width="102dp" |
| | | android:layout_height="match_parent" |
| | | android:background="@drawable/config_129" |
| | | android:gravity="center" |
| | | android:text="@string/bms" |
| | | android:textColor="@color/text_FFACACAC" |
| | | android:textSize="@dimen/text_12" /> |
| | | |
| | | </LinearLayout> |
| | | |
| | | <RelativeLayout |
| | | android:id="@+id/reset_rl" |
| | | android:layout_width="0dp" |
| | |
| | | android:background="@color/text_FF39383D" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@+id/line5_ll"> |
| | | app:layout_constraintTop_toBottomOf="@+id/line6_ll"> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="wrap_content" |
| New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | |
| | | <com.hdl.photovoltaic.widget.SwipeLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | android:id="@+id/bms_item_parent_swipeLayout" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content"> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/bms_swipe_layout_il" |
| | | android:layout_width="66dp" |
| | | android:layout_height="124.5dp" |
| | | android:layout_marginTop="@dimen/dp_0" |
| | | android:orientation="vertical"> |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="@dimen/dp_10" /> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/bms_move_ll" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0dp" |
| | | android:layout_weight="1" |
| | | android:gravity="center_vertical" |
| | | android:orientation="vertical"> |
| | | |
| | | <ImageView |
| | | android:id="@+id/bms_move_home_iv" |
| | | android:layout_width="@dimen/dp_36" |
| | | android:layout_height="@dimen/dp_36" |
| | | android:src="@drawable/move_house" /> |
| | | |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/bms_del_ll" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0dp" |
| | | android:layout_weight="1" |
| | | android:gravity="center_vertical" |
| | | android:orientation="vertical"> |
| | | |
| | | |
| | | <ImageView |
| | | android:id="@+id/bms_del_home_iv" |
| | | android:layout_width="@dimen/dp_36" |
| | | android:layout_height="@dimen/dp_36" |
| | | android:src="@drawable/del_home" /> |
| | | |
| | | |
| | | </LinearLayout> |
| | | |
| | | |
| | | </LinearLayout> |
| | | |
| | | <RelativeLayout |
| | | android:id="@+id/bms_item_parent_rl" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="134.5dp"> |
| | | |
| | | <RelativeLayout |
| | | android:id="@+id/bms_device_details_info_rl" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="124.5dp" |
| | | android:layout_marginStart="@dimen/dp_16" |
| | | android:layout_marginTop="@dimen/dp_10" |
| | | android:layout_marginEnd="@dimen/dp_16" |
| | | android:background="@drawable/bj_ff1c1c1e"> |
| | | <!--电站图片--> |
| | | <ImageView |
| | | android:id="@+id/bms_home_image_iv" |
| | | android:layout_width="44dp" |
| | | android:layout_height="42dp" |
| | | android:layout_marginStart="@dimen/dp_16" |
| | | android:layout_marginTop="@dimen/dp_13" |
| | | android:scaleType="centerCrop" /> |
| | | <!--电站名称以及地址--> |
| | | <LinearLayout |
| | | android:id="@+id/bms_home_name_ll" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="@dimen/dp_20" |
| | | android:layout_marginStart="@dimen/dp_5" |
| | | android:layout_marginTop="13.5dp" |
| | | android:layout_toStartOf="@+id/bms_home_debug_state_ll" |
| | | android:layout_toEndOf="@+id/bms_home_image_iv" |
| | | android:gravity="center_vertical" |
| | | android:orientation="horizontal"> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="@dimen/dp_19" |
| | | android:layout_height="@dimen/dp_19" |
| | | android:gravity="center"> |
| | | |
| | | <TextView |
| | | android:id="@+id/bms_home_state_tv" |
| | | android:layout_width="7dp" |
| | | android:layout_height="7dp" |
| | | android:background="@drawable/device_state_ff38c494" /> |
| | | </LinearLayout> |
| | | |
| | | <TextView |
| | | android:id="@+id/bms_home_name_tv" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:ellipsize="end" |
| | | android:gravity="center_vertical|start" |
| | | android:paddingStart="0dp" |
| | | android:paddingEnd="@dimen/dp_5" |
| | | android:singleLine="true" |
| | | android:text="@string/power_station" |
| | | android:textColor="@color/text_FFACACAC" |
| | | android:textSize="@dimen/text_14" /> |
| | | </LinearLayout> |
| | | <!--电站状态--> |
| | | <LinearLayout |
| | | android:id="@+id/bms_home_debug_state_ll" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="@dimen/dp_18" |
| | | android:layout_alignParentTop="true" |
| | | android:layout_alignParentEnd="true" |
| | | android:layout_marginTop="@dimen/dp_15" |
| | | android:orientation="horizontal"> |
| | | |
| | | <ImageView |
| | | android:id="@+id/bms_home_debug_state_iv" |
| | | android:layout_width="@dimen/dp_18" |
| | | android:layout_height="@dimen/dp_18" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/bms_home_debug_state_tv" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="match_parent" |
| | | android:paddingStart="0dp" |
| | | android:paddingEnd="@dimen/dp_16" |
| | | android:textColor="@color/text_FFACACAC" |
| | | android:textSize="@dimen/text_12" /> |
| | | </LinearLayout> |
| | | <!--电站地址--> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="@dimen/dp_19" |
| | | android:layout_below="@+id/bms_home_name_ll" |
| | | android:layout_alignStart="@+id/bms_home_name_ll"> |
| | | |
| | | <ImageView |
| | | android:layout_width="@dimen/dp_19" |
| | | android:layout_height="@dimen/dp_19" |
| | | android:src="@drawable/location" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/bms_home_location_tv" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:ellipsize="end" |
| | | android:gravity="center_vertical|start" |
| | | android:paddingStart="0dp" |
| | | android:paddingEnd="@dimen/dp_5" |
| | | android:singleLine="true" |
| | | android:text="@string/power_station" |
| | | android:textColor="@color/text_FF5B5B5B" |
| | | android:textSize="@dimen/text_12" /> |
| | | </LinearLayout> |
| | | |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_below="@+id/bms_home_image_iv" |
| | | android:layout_alignStart="@+id/bms_home_image_iv" |
| | | android:layout_marginTop="@dimen/dp_16" |
| | | android:layout_marginEnd="@dimen/dp_16" |
| | | android:orientation="vertical"> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="39dp" |
| | | android:orientation="horizontal"> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="0dp" |
| | | android:layout_height="match_parent" |
| | | android:layout_weight="1"> |
| | | |
| | | <ImageView |
| | | android:layout_width="37.5dp" |
| | | android:layout_height="37.5dp" |
| | | android:layout_marginEnd="@dimen/dp_12" |
| | | android:src="@drawable/battery_storage" /> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/battery_storage_ll" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="match_parent" |
| | | android:orientation="vertical"> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="@dimen/dp_20"> |
| | | |
| | | <TextView |
| | | android:id="@+id/bms_battery_storage_value_tv" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="match_parent" |
| | | android:gravity="center_vertical|start" |
| | | android:text="0" |
| | | android:textColor="@color/text_FFACACAC" |
| | | android:textSize="@dimen/text_14" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/bms_battery_storage_kw_unit" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="match_parent" |
| | | android:layout_marginStart="3dp" |
| | | android:gravity="bottom" |
| | | android:text="kWh" |
| | | android:textColor="@color/text_FF5B5B5B" |
| | | android:textSize="@dimen/text_10" /> |
| | | </LinearLayout> |
| | | |
| | | <TextView |
| | | android:id="@+id/bms_attery_storage_type_tv" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="@dimen/dp_17" |
| | | android:layout_marginTop="3dp" |
| | | android:gravity="center_vertical|start" |
| | | android:text="@string/battery_capacity_indicator" |
| | | android:textColor="@color/text_FF5B5B5B" |
| | | android:textSize="@dimen/text_12" /> |
| | | |
| | | </LinearLayout> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="0dp" |
| | | android:layout_height="match_parent" |
| | | android:layout_weight="1"> |
| | | |
| | | <ImageView |
| | | android:layout_width="37.5dp" |
| | | android:layout_height="37.5dp" |
| | | android:layout_marginEnd="@dimen/dp_12" |
| | | android:src="@drawable/bms" /> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="match_parent" |
| | | android:gravity="center_vertical|start" |
| | | android:text="BMS" |
| | | android:textColor="@color/text_FFACACAC" |
| | | android:textSize="@dimen/text_14" /> |
| | | </LinearLayout> |
| | | </LinearLayout> |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="@dimen/dp_16" /> |
| | | |
| | | </LinearLayout> |
| | | |
| | | |
| | | </RelativeLayout> |
| | | |
| | | |
| | | </RelativeLayout> |
| | | |
| | | </com.hdl.photovoltaic.widget.SwipeLayout> |
| | | |
| | |
| | | <string name="exit">خروج</string> |
| | | <string name="bluetooth_not_enabled">البلوتوث لا يعمل</string> |
| | | <string name="write_failed">فشل في الكتابة</string> |
| | | <string name="power_station_type">نوع محطة الطاقة</string> |
| | | <string name="bms">BMS</string> |
| | | </resources> |
| | |
| | | <string name="exit">Exit</string> |
| | | <string name="bluetooth_not_enabled">Bluetooth is not enabled</string> |
| | | <string name="write_failed">Write failed</string> |
| | | <string name="power_station_type">Power station type</string> |
| | | <string name="bms">BMS</string> |
| | | |
| | | </resources> |
| | |
| | | <string name="exit">退出</string> |
| | | <string name="bluetooth_not_enabled">蓝牙没开启</string> |
| | | <string name="write_failed">写入失败</string> |
| | | <string name="power_station_type">电站类型</string> |
| | | <string name="bms">BMS</string> |
| | | </resources> |
| | |
| | | <string name="exit">Exit</string> |
| | | <string name="bluetooth_not_enabled">Bluetooth is not enabled</string> |
| | | <string name="write_failed">Write failed</string> |
| | | <string name="power_station_type">Power station type</string> |
| | | <string name="bms">BMS</string> |
| | | </resources> |