naneos.gui.model
What the tray menu says about the devices, without Qt.
The tray asks the manager for the connected devices and remembers when each of them last delivered a data point, so the menu can show
P2 Pro SN8764 USB 1 s
P2 SN8123 BLE 2 s
DeviceLike
Bases: Protocol
The part of PartectorDevice the menu needs.
Source code in src/naneos/gui/model.py
27 28 29 30 31 32 33 34 35 36 37 | |
LastSeen
When each serial number last delivered a data point (monotonic clock).
The arrival time is used, not the timestamp in the data point, so a device with a wrong clock still shows how long it has been silent.
Source code in src/naneos/gui/model.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | |
age(serial_number)
Seconds since the last point, None if there was none yet.
Source code in src/naneos/gui/model.py
76 77 78 79 80 | |
drain(points)
Take every waiting point off the live queue. Returns how many.
Source code in src/naneos/gui/model.py
64 65 66 67 68 69 70 71 72 73 74 | |
forget_except(serial_numbers)
Drop devices that are gone, so a device that comes back starts at "–".
Source code in src/naneos/gui/model.py
82 83 84 85 | |
sort_devices(devices)
By serial number; a device that has not told its number yet goes last.
Source code in src/naneos/gui/model.py
105 106 107 108 109 110 | |