| | |
| | | } |
| | | |
| | | if (isBoolean) { |
| | | uniCallbackData(type, null, 0, "写入新驱动文件到内存成功", callback); |
| | | uniCallbackData(type, null, 0, HDLApp.getInstance().getString(R.string.writing_firmware_upgrade_memory_succeeded), callback); |
| | | } else { |
| | | uniCallbackData(type, null, -2, "下载固件升级文件失败", callback); |
| | | uniCallbackData(type, null, -2, HDLApp.getInstance().getString(R.string.download_firmware_upgrade_file_failed), callback); |
| | | } |
| | | } |
| | | }); |
| | |
| | | String firmwarePathFileName = HdlFileLogic.getInstance().getFirmwarePathFileName(oid, imageId, version); |
| | | byte[] data = HdlFileLogic.getInstance().readFileByte(firmwarePathFileName); |
| | | if (data == null || data.length == 0) { |
| | | uniCallbackData(type, null, -2, "本地找不到升级固件文件,请下载好固件文件,再重新升级.", callback); |
| | | uniCallbackData(type, null, -2, HDLApp.getInstance().getString(R.string.found_locally_firmware_upgrade_file), callback); |
| | | return; |
| | | } |
| | | String md5 = HDLMD5Utils.encodeMD5(data);//网关固件需要 |
| | |
| | | |
| | | @Override |
| | | public void onError(HDLLinkException e) { |
| | | uniCallbackData(type, null, -2, "通知给网关升级固件文件地址失败,无法升级,", callback); |
| | | uniCallbackData(type, null, -2, HDLApp.getInstance().getString(R.string.notify_gateway_firmware_upgrade_failed), callback); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | @Override |
| | | public void onServiceDisconnected(ComponentName name) { |
| | | uniCallbackData(type, null, -2, "本地服务有异常失败,无法升级,", callback); |
| | | uniCallbackData(type, null, -2, HDLApp.getInstance().getString(R.string.local_service_fails), callback); |
| | | } |
| | | }); |
| | | } else { |
| | |
| | | HdlFileLogic.getInstance().deleteFile(drivePathFileName);//下载失败,删除不完整驱动文件; |
| | | } |
| | | if (isBoolean) { |
| | | uniCallbackData(type, null, 0, "写入新驱动文件到内存成功", callback); |
| | | uniCallbackData(type, null, 0, HDLApp.getInstance().getString(R.string.writing_drive_memory_succeeded), callback); |
| | | } else { |
| | | uniCallbackData(type, null, -2, "下载驱动升级文件失败", callback); |
| | | uniCallbackData(type, null, -2, HDLApp.getInstance().getString(R.string.download_drive_file_failed), callback); |
| | | } |
| | | } |
| | | }); |
| | |
| | | String drivePathFileName = HdlFileLogic.getInstance().getDrivePathFileName(driverCode, version); |
| | | byte[] data = HdlFileLogic.getInstance().readFileByte(drivePathFileName); |
| | | if (data == null || data.length == 0) { |
| | | uniCallbackData(type, null, -2, "本地找不到升级驱动文件,请下载好驱动文件,再重新升级.", callback); |
| | | uniCallbackData(type, null, -2, HDLApp.getInstance().getString(R.string.found_locally_drive_file), callback); |
| | | return; |
| | | } |
| | | String md5 = HDLMD5Utils.encodeMD5(data);//网关驱动需要 |
| | |
| | | |
| | | @Override |
| | | public void onError(HDLLinkException e) { |
| | | uniCallbackData(type, null, -2, "通知给网关升级驱动文件地址失败,无法升级,", callback); |
| | | uniCallbackData(type, null, -2, HDLApp.getInstance().getString(R.string.notify_gateway_drive_failed), callback); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | @Override |
| | | public void onServiceDisconnected(ComponentName name) { |
| | | uniCallbackData(type, null, -2, "本地服务有异常失败,无法升级,", callback); |
| | | uniCallbackData(type, null, -2, HDLApp.getInstance().getString(R.string.local_service_fails), callback); |
| | | } |
| | | }); |
| | | } else { |
| | |
| | | */ |
| | | private void uniCancelDownloadingUpgradeFile(String type, Object data, DCUniMPJSCallback callback) { |
| | | HdlOtaLogic.getInstance().stopDownloadUpgradeFile(); |
| | | uniCallbackData(type, null, 0, "取消下载成功.", callback); |
| | | uniCallbackData(type, null, 0, HDLApp.getInstance().getString(R.string.cancel_download_successfully), callback); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | } |
| | | |
| | | public static AAChartModel configureColorfulColumnChart() { |
| | | public static AAChartModel configureColorfulColumnChart(String tipSuspendName, String[] categories, Object[] data) { |
| | | Object[][] stopsArr = { |
| | | {1.00, "#38C494"}, |
| | | };//颜色字符串设置支持十六进制类型和 rgba 类型 |
| | |
| | | .chartType(AAChartType.Column) |
| | | .backgroundColor("#EDEFF2") |
| | | .colorsTheme(new String[]{"#38C494",}) |
| | | .categories(new String[]{"一月", "二月", "三月", "四月", "五月", "六月", |
| | | "七月", "八月", "九月", "十月", "十一月", "十二月", "十二月", "十二月", "十二月", "十二月", "十二月", "十二月", "十二月", "十二月", "十二月", "十二月", "十二月", "十二月", "十二月", "十二月", "十二月", "十二月", "十二月", "十二月", "十二月", "十二月", "十二月", "十二月",}) |
| | | .categories(categories) |
| | | .xAxisLabelsEnabled(true) |
| | | .zoomType(AAChartZoomType.XY) |
| | | .legendEnabled(false) |
| | |
| | | new AASeriesElement() |
| | | // .color(linearGradientColor) |
| | | .name("东京") |
| | | .data(new Object[]{149.9, 171.5, 106.4, 129.2, 144.0, 176.0, 135.6, 188.5, 276.4, 214.1, 95.6, 54.4, 149.9, 171.5, 106.4, 129.2, 144.0, 176.0, 135.6, 188.5, 276.4, 214.1, 95.6, 149.9, 171.5, 106.4, 129.2, 144.0, 176.0, 135.6, 188.5, 276.4, 214.1, 95.6}) |
| | | .data(data) |
| | | // .colorByPoint(true) |
| | | .tooltip(new AATooltip().style(new AAStyle().backgroundColor("#FFFFFF").fontSize(25))) |
| | | |
| | |
| | | import android.text.TextUtils; |
| | | import android.view.View; |
| | | |
| | | import androidx.annotation.RequiresPermission; |
| | | |
| | | import androidx.appcompat.content.res.AppCompatResources; |
| | | |
| | | import com.bigkoo.pickerview.builder.TimePickerBuilder; |
| | |
| | | import com.github.AAChartModel.AAChartCore.AAChartCreator.AAChartView; |
| | | import com.github.AAChartModel.AAChartCore.AAChartCreator.AAMoveOverEventMessageModel; |
| | | import com.hdl.linkpm.sdk.core.exception.HDLException; |
| | | import com.hdl.photovoltaic.HDLApp; |
| | | import com.hdl.photovoltaic.R; |
| | | import com.hdl.photovoltaic.base.CustomBaseFragment; |
| | | import com.hdl.photovoltaic.config.ConstantManage; |
| | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 时间选择器 |
| | | */ |
| | |
| | | } else if (TimeType.month.equals(timeType) |
| | | || TimeType.year.equals(timeType) |
| | | || TimeType.all.equals(timeType)) { |
| | | aaChartModel = configureColorfulColumnChart(); |
| | | aaChartModel = configureColorfulColumnChart("Pv发电功率", fieldNames, fieldValues); |
| | | } |
| | | aaChartView.aa_drawChartWithChartModel(aaChartModel); |
| | | } |
| | |
| | | viewBinding.homePageStationSelectTimeLl.setVisibility(View.VISIBLE); |
| | | setUpAAChartView();//图表加载 |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | |
| | | <string name="port_conflict">应用冲突,需要关闭onpro或者其它版本的调试软件然后再重新启动这个软件试试</string> |
| | | |
| | | |
| | | |
| | | <string name="cancel_download_successfully">取消下载成功.</string> |
| | | <string name="writing_firmware_upgrade_memory_succeeded">写入新固件文件到内存成功.</string> |
| | | <string name="download_firmware_upgrade_file_failed">下载固件升级文件失败.</string> |
| | | <string name="found_locally_firmware_upgrade_file">本地找不到升级固件文件,请下载好固件文件,再重新升级.</string> |
| | | <string name="notify_gateway_firmware_upgrade_failed">通知给网关升级固件文件地址失败,无法升级.</string> |
| | | <string name="local_service_fails">本地服务有异常失败,无法升级.</string> |
| | | <string name="writing_drive_memory_succeeded">写入新驱动文件到内存成功.</string> |
| | | <string name="download_drive_file_failed">下载驱动升级文件失败.</string> |
| | | <string name="found_locally_drive_file">本地找不到升级驱动文件,请下载好驱动文件,再重新升级.</string> |
| | | <string name="notify_gateway_drive_failed">通知给网关升级驱动文件地址失败,无法升级.</string> |
| | | <string name="time_selectd">时间选择</string> |
| | | <string name="life_cycle">生命期</string> |
| | | <string name="year">年</string> |