Selaa lähdekoodia

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 6 vuotta sitten
vanhempi
commit
fa36360954
2 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 1
    1
      README.md
  2. 1
    1
      pd-buddy-gtk.py

+ 1
- 1
README.md Näytä tiedosto

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 Näytä tiedosto

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…
Peruuta
Tallenna