Browse Source

Show PDP instead of number of PDOs

Assuming the power supply follows the Power Rules, it's a lot more
informative to show its PDP than the number of PDOs it advertises.  This
is the first step towards implementing the new design for showing the
Source_Capabilities.
Clara Hobbs 7 years ago
parent
commit
fa36360954
2 changed files with 2 additions and 2 deletions
  1. 1
    1
      README.md
  2. 1
    1
      pd-buddy-gtk.py

+ 1
- 1
README.md View File

10
 * GTK+ 3.22
10
 * GTK+ 3.22
11
 * Python 3.6
11
 * Python 3.6
12
 * python-gobject 3.22
12
 * python-gobject 3.22
13
-* pd-buddy-python 0.3.1
13
+* pd-buddy-python 0.4.0
14
 
14
 
15
 ## Usage
15
 ## Usage
16
 
16
 

+ 1
- 1
pd-buddy-gtk.py View File

235
             # TODO: do this repeatedly
235
             # TODO: do this repeatedly
236
             with pdbuddy.Sink(self.serial_port) as pdbs:
236
             with pdbuddy.Sink(self.serial_port) as pdbs:
237
                 caps = pdbs.get_source_cap()
237
                 caps = pdbs.get_source_cap()
238
-            cap_label.set_text('{} PDOs'.format(len(caps)))
238
+            cap_label.set_text('{:g} W'.format(pdbuddy.calculate_pdp(caps)))
239
 
239
 
240
         # Show the Sink page
240
         # Show the Sink page
241
         hst = self.builder.get_object("header-stack")
241
         hst = self.builder.get_object("header-stack")

Loading…
Cancel
Save