| | |
| | | import com.hdl.photovoltaic.R; |
| | | import com.hdl.photovoltaic.base.CustomBaseFragment; |
| | | import com.hdl.photovoltaic.config.ConstantManage; |
| | | import com.hdl.photovoltaic.config.UserConfigManage; |
| | | import com.hdl.photovoltaic.databinding.FragmentHomePageBinding; |
| | | import com.hdl.photovoltaic.enums.HomepageTitleTabSwitch; |
| | | import com.hdl.photovoltaic.enums.PowerStationStatus; |
| | | import com.hdl.photovoltaic.enums.PowerStationStatusType; |
| | | import com.hdl.photovoltaic.enums.TimeType; |
| | | import com.hdl.photovoltaic.enums.UnitType; |
| | | import com.hdl.photovoltaic.listener.CloudCallBeak; |
| | | import com.hdl.photovoltaic.other.HdlCommonLogic; |
| | | import com.hdl.photovoltaic.other.HdlDeviceLogic; |
| | | import com.hdl.photovoltaic.other.HdlLogLogic; |
| | | import com.hdl.photovoltaic.other.HdlPowerStationDataStatisticsLogic; |
| | | import com.hdl.photovoltaic.other.HdlResidenceLogic; |
| | |
| | | |
| | | @Override |
| | | public void onBindView(Bundle savedInstanceState) { |
| | | |
| | | //初始化 |
| | | initView(); |
| | | //初始化界面监听器 |
| | |
| | | @Override |
| | | public void onClick(View v) { |
| | | HdlUniLogic.getInstance().openUniMP(HDLUniMP.UNI_EVENT_OPEN_HOME_CREATION, null); |
| | | } |
| | | }); |
| | | |
| | | //全部 |
| | | viewBinding.homeAllIl.parentLl.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | HdlCommonLogic.getInstance().postEventBus(ConstantManage.station_status, PowerStationStatus.All); |
| | | |
| | | } |
| | | }); |
| | | //故障 |
| | | viewBinding.homeFaultsIl.parentLl.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | HdlCommonLogic.getInstance().postEventBus(ConstantManage.station_status, PowerStationStatus.malfunction); |
| | | } |
| | | }); |
| | | //离线 |
| | | viewBinding.homeOfflineIl.parentLl.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | HdlCommonLogic.getInstance().postEventBus(ConstantManage.station_status, PowerStationStatus.off); |
| | | } |
| | | }); |
| | | //待接入 |
| | | viewBinding.homeConnectedIl.parentLl.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | HdlCommonLogic.getInstance().postEventBus(ConstantManage.station_status, PowerStationStatus.connecting); |
| | | } |
| | | }); |
| | | //时间选择器 |
| | |
| | | String timeDateFormat = TimeUtils.getTimeDateFormat(timeType); |
| | | Calendar calendar = TimeUtils.stringToCalendar(currDate, timeDateFormat); |
| | | String time = TimeUtils.subtractDayMonthYearFromDate(calendar, 1, timeDateFormat, timeType); |
| | | //不需要限制最小日期,因为是查询账号下所有电站,无法知道最小建站日期 |
| | | viewBinding.yearMonthDayTv.setText(time); |
| | | getStatistics(); |
| | | |
| | |
| | | aaChartView.callBack = this; |
| | | if (TimeType.day.equals(timeType)) { |
| | | aaChartModel = BasicChartComposer.configureAreaChart(getString(R.string.pv_power), fieldNames, fieldValues); |
| | | } else if (TimeType.month.equals(timeType) |
| | | || TimeType.year.equals(timeType) |
| | | || TimeType.all.equals(timeType)) { |
| | | } else if (TimeType.month.equals(timeType) || TimeType.year.equals(timeType) || TimeType.all.equals(timeType)) { |
| | | aaChartModel = configureColorfulColumnChart(getString(R.string.pv_power), fieldNames, fieldValues); |
| | | } |
| | | aaChartView.aa_drawChartWithChartModel(aaChartModel); |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 电站状态概览 |
| | | */ |