From e88890c05cfda11bf2eb31afc21fc3f030e22249 Mon Sep 17 00:00:00 2001 From: RememBerBer Date: Mon, 22 Nov 2021 13:51:08 +0800 Subject: [PATCH] power source first step --- .../com/luoboduner/moo/info/ui/form/PowerSourceForm.java | 5 +++++ src/main/resources/icons/Charging.svg | 1 + 2 files changed, 6 insertions(+) create mode 100644 src/main/resources/icons/Charging.svg diff --git a/src/main/java/com/luoboduner/moo/info/ui/form/PowerSourceForm.java b/src/main/java/com/luoboduner/moo/info/ui/form/PowerSourceForm.java index 4f1f5f8..cf9ac5f 100644 --- a/src/main/java/com/luoboduner/moo/info/ui/form/PowerSourceForm.java +++ b/src/main/java/com/luoboduner/moo/info/ui/form/PowerSourceForm.java @@ -92,6 +92,11 @@ public class PowerSourceForm { powerPanel.add(capacityLabel, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); JLabel temperatureLabel = new JLabel(); + double powerUsageRate = powerSource.getPowerUsageRate(); + double amperage = powerSource.getAmperage(); + double voltage = powerSource.getVoltage(); + boolean charging = powerSource.isCharging(); + int cycleCount = powerSource.getCycleCount(); temperatureLabel.setText(String.valueOf(String.format("Temperature: %.1f°C", powerSource.getTemperature()))); powerPanel.add(temperatureLabel, new GridConstraints(2, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); diff --git a/src/main/resources/icons/Charging.svg b/src/main/resources/icons/Charging.svg new file mode 100644 index 0000000..807bd56 --- /dev/null +++ b/src/main/resources/icons/Charging.svg @@ -0,0 +1 @@ + \ No newline at end of file