| | |
| | | return sHdlDeviceLogic; |
| | | } |
| | | |
| | | public static final String kWp = "kWp"; |
| | | public static final String kWh = "kW.h"; |
| | | |
| | | public static final String kW = "kW"; |
| | | public static final String noValue = "0.00"; |
| | | |
| | | private List<DeviceBean> mListDevice = new ArrayList<>(); |
| | | |
| | | public static String getConvertDoubleUnit(String value) { |
| | | if (TextUtils.isEmpty(value)) { |
| | | return noValue + kWh; |
| | | } |
| | | BigDecimal formattedValue = getBigDecimal(value); |
| | | return formattedValue + kWh; |
| | | |
| | | } |
| | | |
| | | public static String getConvertDoubleUnit(int value) { |
| | | if (value == 0) { |
| | | return noValue + kWh; |
| | | } |
| | | BigDecimal formattedValue = getBigDecimal(value + ""); |
| | | return formattedValue + kWh; |
| | | } |
| | | |
| | | private static BigDecimal getBigDecimal(String value) { |
| | | if (TextUtils.isEmpty(value)) { |
| | | return new BigDecimal(0); |
| | | } |
| | | double doubleValue = Double.parseDouble(value); |
| | | return BigDecimal.valueOf(doubleValue).setScale(2, RoundingMode.HALF_UP); |
| | | } |
| | | |
| | | public void clearDeviceList() { |
| | | if (mListDevice == null) { |
| | |
| | | gatewayBean.setSystemStatusDesc(cloudInverterDeviceBean.getSystemStatusDesc());//设备状态 |
| | | gatewayBean.setHwVersion(cloudInverterDeviceBean.getHwVersion());//软件版本号 |
| | | gatewayBean.setCategorySecondName(cloudInverterDeviceBean.getCategorySecondName());//设备类型(产品二级分类名称 |
| | | gatewayBean.setDeviceType(cloudInverterDeviceBean.getDeviceType());//设备类型(INV:逆变器;BMS:BMS控制盒;BATTERY:电池单元) |
| | | gatewayBean.setAddresses(cloudInverterDeviceBean.getAddresses());//子网号/设备号,逆变器地址 |
| | | gatewayBean.setPowerPvNow(cloudInverterDeviceBean.getPowerPvNow());//发电功率 |
| | | gatewayBean.setTotalElectricityPvToday(cloudInverterDeviceBean.getTotalElectricityPvToday());//今日发电量 |