Traces Table
FormulaDialog
Bases: QDialog
Formula Dialog - when a user right clicks on a row in the list of curves, they have the option to input a formula. They could opt to type it instead, but this opens a box that is a nicer UI for inputting a formula.
Source code in trace/mixins/traces_table.py
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 |
|
accept_formula()
Set the curve in the curve model to use the entered formula. If the formula is invalid, then the dialog box is closed.
Source code in trace/mixins/traces_table.py
314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 |
|
exec_()
When the formula dialog is opened, get the latest information from the curve model. If a formula already exists for the selected index, then populate the text box with the existing formula.
Source code in trace/mixins/traces_table.py
297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 |
|
keyPressEvent(e)
Special key press tracker. If enter or return is pressed the formula dialog submits the formula.
Source code in trace/mixins/traces_table.py
280 281 282 283 284 285 286 |
|
showPVList()
Hide or show the PV list on PVButton click.
Source code in trace/mixins/traces_table.py
288 289 290 291 292 293 294 295 |
|
PVContextMenu
Bases: QMenu
Right clicking on the curves table opens 3 options - to open a PV search tool, Open a formula dialogue, or import a csv. Importing a csv seems to have not yet been implemented, but Formulae and PV search are.
Source code in trace/mixins/traces_table.py
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 |
|
selected_index: QModelIndex
property
writable
Get the table's selected index.
TracesTableMixin
Mixins class for the Traces tab of the settings section.
Source code in trace/mixins/traces_table.py
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 63 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 146 147 148 149 150 151 152 153 154 155 156 157 |
|
curve_delegates_init()
Set column delegates for the Traces table to display widgets.
Source code in trace/mixins/traces_table.py
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 86 87 88 89 90 |
|
custom_context_menu(pos)
Open a custom context menu for the Traces table where the user right-clicks. If the ColorButton is right-clicked, then do not open a context menu.
Parameters
pos : QPoint The position where the context menu should appear
Source code in trace/mixins/traces_table.py
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
|
dragEnterEvent(e)
Handle something (like PV names) being dragged into the table
Source code in trace/mixins/traces_table.py
92 93 94 |
|
dragMoveEvent(e)
Handle something (like PV names) being dragged through the table
Source code in trace/mixins/traces_table.py
96 97 98 |
|
dropEvent(e)
Handle something (like PV names) being dropped into the table
Source code in trace/mixins/traces_table.py
100 101 102 103 |
|
insertPVs(data)
Parse the incoming PV name data One by one, add them to the end of the curves model Resize the table to match the longest PV name/label
Parameters
data: str The list of pvs in string format with any white space or comma separation
Source code in trace/mixins/traces_table.py
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
|
traces_table_init()
Initialize the Traces table model and section.
Source code in trace/mixins/traces_table.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
|
update_index(index)
Update the given index in the model and clear the selection model.
Parameters
index : QModelIndex The index in the table view to update
Source code in trace/mixins/traces_table.py
122 123 124 125 126 127 128 129 130 131 132 |
|