|
@@ -196,6 +196,8 @@ class PDOListRow(Gtk.ListBoxRow):
|
196
|
196
|
# Type label
|
197
|
197
|
if model.pdo.pdo_type == "fixed":
|
198
|
198
|
type_text = "Fixed"
|
|
199
|
+ elif model.pdo.pdo_type == "pps":
|
|
200
|
+ type_text = "Programmable"
|
199
|
201
|
elif model.pdo.pdo_type == "unknown":
|
200
|
202
|
type_text = "Unknown"
|
201
|
203
|
elif model.pdo.pdo_type == "typec_virtual":
|
|
@@ -205,11 +207,15 @@ class PDOListRow(Gtk.ListBoxRow):
|
205
|
207
|
box.pack_start(type_label, True, True, 0)
|
206
|
208
|
|
207
|
209
|
# Voltage label
|
208
|
|
- if (model.pdo.pdo_type != "unknown"
|
209
|
|
- and model.pdo.pdo_type != "typec_virtual"):
|
|
210
|
+ if model.pdo.pdo_type == "fixed":
|
210
|
211
|
voltage_label = Gtk.Label("{:g} V".format(model.pdo.v / 1000.0))
|
211
|
212
|
voltage_label.set_halign(Gtk.Align.END)
|
212
|
213
|
box.pack_start(voltage_label, True, True, 0)
|
|
214
|
+ elif model.pdo.pdo_type == "pps":
|
|
215
|
+ voltage_label = Gtk.Label("{:g}\u2013{:g} V".format(
|
|
216
|
+ model.pdo.vmin / 1000.0, model.pdo.vmax / 1000.0))
|
|
217
|
+ voltage_label.set_halign(Gtk.Align.END)
|
|
218
|
+ box.pack_start(voltage_label, True, True, 0)
|
213
|
219
|
|
214
|
220
|
# Right box
|
215
|
221
|
right_box = Gtk.Box(Gtk.Orientation.HORIZONTAL, 6)
|
|
@@ -229,7 +235,7 @@ class PDOListRow(Gtk.ListBoxRow):
|
229
|
235
|
PDOListRow.oc_tooltips[model.pdo.peak_i])
|
230
|
236
|
right_box.pack_end(oc_image, True, False, 0)
|
231
|
237
|
except AttributeError:
|
232
|
|
- # If this is a typec_virtual PDO, there's no peak_i attribute.
|
|
238
|
+ # If this isn't a fixed PDO, there's no peak_i attribute.
|
233
|
239
|
# Not a problem, so just ignore the error.
|
234
|
240
|
pass
|
235
|
241
|
else:
|
|
@@ -300,7 +306,8 @@ class Handler:
|
300
|
306
|
# do want to display no configuration though
|
301
|
307
|
self.cfg = pdbuddy.SinkConfig(
|
302
|
308
|
status=pdbuddy.SinkStatus.VALID,
|
303
|
|
- flags=pdbuddy.SinkFlags.NONE, v=0, i=0)
|
|
309
|
+ flags=pdbuddy.SinkFlags.NONE, v=0, vmin=0, vmax=0,
|
|
310
|
+ i=0, idim=pdbuddy.SinkDimension.CURRENT)
|
304
|
311
|
else:
|
305
|
312
|
self.cfg = pdbs.get_tmpcfg()
|
306
|
313
|
except OSError as e:
|