Devices
Bases: type(ABC), type(QObject)
Metaclass enabling multiple inheritance of ABC and QObject.
Overview
Resolves metaclass conflicts so DeviceWorker can be both an ABC
and a Qt QObject.
- Combines behavior of
ABCandQtCore.QObjectmetatypes.
Usage Notes
Use this metaclass only for worker classes that inherit from QObject.
Source code in contracts\device_worker.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 | |
Bases: ABC, QObject
Abstract base for device worker objects that run in a Qt context.
Overview
Defines the required API for workers that accept a DataSet, run a task, and accept data/processor types.
- Required methods: set_data, run, set_data_type, set_processor_type.
- Provides a short
identifierused for run labelling.
Usage Notes
Concrete workers should implement thread-safe run logic and emit signals.
Source code in contracts\device_worker.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | |
Bases: DeviceWorker
Concrete worker base implementing common setup and progress handling.
Overview
Implements option handling, dataset instantiation and a simple run flow that prepares data processors, emits progress, and calls a plot.
- Manages
device,dataset,plot_type,options, anddata_processors. - Populates processors per-file and emits
progress/finishedsignals. set_data_type/set_processor_typeare simple setters.
Usage Notes
Subclasses provide plotting methods referenced by plot_type and may
extend run behaviour if needed.
Source code in contracts\device_worker.py
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | |