visualdynamics.gui.object_tables¶
object_tables
¶
Table models for Visual Dynamics objects.
Each model is a list of columns over an existing object. It reads its cells from the object and, where editing makes sense, writes an edit straight back to it. In a mode table, the frequency and damping a fit produced are read-only, while the description beside them is free text to fill in.
Classes:
| Name | Description |
|---|---|
ComplianceRows |
The comparison of a specification with a measurement, one row |
ReplicationRows |
Waveform error as a grid: one control channel per row, one |
ComplianceGrid |
How far each control channel is from its specification, one |
Functions:
| Name | Description |
|---|---|
shape_table_model |
A mode set as a table: each mode's frequency, damping and modal |
shape_values_model |
A mode set's values as a table, read-only: at every DOF of the |
transformation_model |
A control loop's transformation as a table, read-only |
matched_modes_model |
A MatchedModes object as a table, in the mode table's format. |
channel_table_model |
A channel table, with an editor of the right type for each |
modal_fit_table_model |
The modes fitted so far, plus the one the cursor is placing. |
units_table_model |
A table with one row per item of |
frf_units_models |
Two unit tables for an FRF: its response channels and its |
id_runs_text |
Ids as sorted runs, without repeats: |
parse_id_runs |
The inverse of |
group_label |
An element group's label in a list: its name, or |
element_group_table_model |
The element groups, which divide the mesh into parts. |
specification_model |
A specification's channels, one row each: the channel's name |
replication_model |
A table of a |
compliance_grid_model |
A table of a |
sweep_rate_rows |
The sweep-rate table's rows: one per pass of the tone through a |
sweep_rate_model |
A table of |
Classes¶
ComplianceRows
¶
The comparison of a specification with a measurement, one row per channel.
rows is a list of (channel, result), computed once when the
selection changes rather than once per cell. unit_label is the
level's unit for the column heading. plotted is the index of the
row the plot is drawing, so the table can mark the channel on
screen.
Methods:
| Name | Description |
|---|---|
row_of |
The row of the channel named |
Source code in src/visualdynamics/gui/object_tables.py
ReplicationRows
¶
ReplicationRows(channels: Sequence[str], events: Sequence[int], values: Mapping[tuple[str, int], float | str], plotted: Sequence[tuple[str, int]] | None = None)
Waveform error as a grid: one control channel per row, one playing of the waveform (an event) per column.
A transient record holds many attempts at one target, so its errors have two dimensions. The plot draws only what is picked and the bar chart reduces them to one value, so this grid is the one place that shows both. In it, a channel that is poor in every event and an event that was poor on every channel are easy to tell apart.
values maps (channel, event) to the error, or to a sentence
saying why that pair has none. plotted is the set
of (channel, event) pairs on screen, because picking a cell picks
both at once.
Methods:
| Name | Description |
|---|---|
value |
The value at a row and an event's column (counted from zero, |
pairs_at |
The |
Source code in src/visualdynamics/gui/object_tables.py
Methods:¶
value
¶
The value at a row and an event's column (counted from zero, without the channel column), the words for why it was not scored, or None where there is no value for that channel and event.
Source code in src/visualdynamics/gui/object_tables.py
pairs_at
¶
The (channel, event) pairs one selected cell picks.
Column zero holds the channel's name, so picking it picks that channel in every event, the whole row.
Source code in src/visualdynamics/gui/object_tables.py
ComplianceGrid
¶
How far each control channel is from its specification, one row per channel.
It does for a PSD comparison what ReplicationRows does for a
transient, with one set of numbers per channel instead of a grid,
because a PSD is already an average over the repeats.
rows is a list of (DOF pair, RMS error in dB, percent of the
band outside the abort limits). plotted is the set of DOF pairs
on screen.
Methods:
| Name | Description |
|---|---|
pair_at |
The DOF pair a row names, or None. |
Source code in src/visualdynamics/gui/object_tables.py
Functions:¶
shape_table_model
¶
shape_table_model(shapes: ShapeSet, parent: QObject | None = None) -> TableModel
A mode set as a table: each mode's frequency, damping and modal mass, read-only, and a description to fill in.
Source code in src/visualdynamics/gui/object_tables.py
shape_values_model
¶
shape_values_model(shapes: ShapeSet, parent: QObject | None = None, dofs: Sequence[str] | None = None, form: str = 'shapes') -> TableModel
A mode set's values as a table, read-only: at every DOF of the
set or at dofs, as the shapes (a row per DOF, a column per mode,
M1, M2, ...) or one of the transformations through them (a row per
mode, a column per DOF). The matrix is transform.matrix_at's and
the text core.tables', which a script's Project.table(...,
values=True) reads too; a complex mode's value shows its real and
imaginary parts. Raises ValueError where matrix_at does.
Source code in src/visualdynamics/gui/object_tables.py
transformation_model
¶
transformation_model(table: ChannelTable, environment: str, form: str = 'response', parent: QObject | None = None) -> TableModel
A control loop's transformation as a table, read-only
(ChannelTable.transformation): a row per row of the matrix,
numbered from 1, and a column per control (or drive) channel headed
by its DOF, in the controller's order. The text is core.tables',
which a script's Project.table(..., environment=, form=) reads
too. Raises ValueError where transformation does.
Source code in src/visualdynamics/gui/object_tables.py
matched_modes_model
¶
matched_modes_model(matched: MatchedModes, objects: Mapping[str, Any], parent: QObject | None = None) -> TableModel
A MatchedModes object as a table, in the mode table's format.
The frequencies and damping are read by name from the mode sets in
objects when the model is built, so they show the sets as they
are now. The MAC is the value stored on the object, as the
comparison computed it (possibly from projected shapes). A set
missing from the project, or a mode index past its end, shows
dashes.
Source code in src/visualdynamics/gui/object_tables.py
channel_table_model
¶
channel_table_model(table: ChannelTable, parent: QObject | None = None, rows: Sequence[int] | None = None, geometry: Geometry | None = None, set_role: Callable | None = None, environment: str | None = None) -> TableModel
A channel table, with an editor of the right type for each column.
The columns come from the table's own COLUMNS spec, so a schema
change reaches the interface without a second edit. A choice column
gets a drop-down, a date a calendar, a flag a check box, and the
unit column offers only the units that fit what the channel says it
measures.
With a geometry, derived columns are added after the table's own:
each channel's measured direction as a unit vector in the
geometry's global system, the nearest global axis, and the angle to
it. They are computed from the geometry each time they are shown,
and again whenever the node or the direction in that row is edited,
so they always agree with it. They are not editable, because the
table does not store them.
rows, when given, shows only those channels, so the table shows
the rows picked in the tree's grid and nothing else.
set_role(row, role), when given, receives the Role column's edits
in place of the table. A table linked with the time data it
describes shows that data's roles, and a change made here goes to
the data (Project.set_channel_role), which journals it.
environment, when given, is one of the table's control loops: the
Control column shows that loop's control channels and an edit sets
them (ChannelTable.set_control). A table with environments is
always shown with one picked, since its column is theirs.
Source code in src/visualdynamics/gui/object_tables.py
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 330 331 332 333 334 335 | |
modal_fit_table_model
¶
modal_fit_table_model(session: ModalFitSession, parent: QObject | None = None) -> TableModel
The modes fitted so far, plus the one the cursor is placing.
The last row, labeled "new", is the pending mode. Its frequency is the cursor's on the CMIF, its damping is the half-power estimate until a value is typed, and Confirm Mode makes it a fitted row. A fitted mode's damping stays editable, in percent between 0 and 100 (exclusive), and the synthesis uses the new value. The description is free text.
Source code in src/visualdynamics/gui/object_tables.py
units_table_model
¶
units_table_model(obj: Any, records: Sequence[int] | None = None, parent: QObject | None = None) -> TableModel
A table with one row per item of obj that needs a unit.
A geometry has one row, for its coordinates, and a mode set one,
for its shapes. A data object has one row per channel among the
records in records (all of them when None); for a PSD with cross
records, a cross term's unit follows from its two channels'.
It is a table rather than a dialog so the plot or the model stays on screen beside it, and units copy, paste and clear like any other column.
Source code in src/visualdynamics/gui/object_tables.py
frf_units_models
¶
frf_units_models(data: DataArray, records: Sequence[int] | None = None, parent: QObject | None = None) -> tuple[TableModel, TableModel]
Two unit tables for an FRF: its response channels and its reference channels.
An FRF matrix of N x M records has only N + M physical channels, and a unit belongs to a channel, so each channel's unit is declared once and every record converts as soon as both of its channels have one. The two sides stay separate even where the DOF labels are the same: a drive point's accelerometer and its force gauge share a label and are two different channels.
Source code in src/visualdynamics/gui/object_tables.py
737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 | |
id_runs_text
¶
Ids as sorted runs, without repeats: [1,2,3,7,9,10] ->
'1-3 7 9-10'.
An element group can hold hundreds of elements (478 in one group of the demonstration drone), and they come in runs because a mesh is built one part at a time. Written out one by one, the drone's 22 element groups take 21 731 characters; as runs they take 595, which fits in a cell a person can read.
Source code in src/visualdynamics/gui/object_tables.py
parse_id_runs
¶
The inverse of id_runs_text: '1-3, 7 9-10' ->
[1, 2, 3, 7, 9, 10].
Runs are separated by commas or spaces, and a run can be written
either way round: 10-7 is the same four elements as 7-10.
Source code in src/visualdynamics/gui/object_tables.py
group_label
¶
group_label(geometry: Geometry, row: int) -> str
An element group's label in a list: its name, or
'element group N' when it has none.
Exodus files often have unnamed element groups, and "element group 3" is what a person calls one. A made-up name would claim something the file does not say.
Source code in src/visualdynamics/gui/object_tables.py
element_group_table_model
¶
element_group_table_model(geometry: Geometry, unit_system: UnitSystem | None = None, parent: QObject | None = None) -> TableModel
The element groups, which divide the mesh into parts.
Every column is editable: the group's number, its name, its
elements, and the properties a model built from the geometry needs
(a material, and a thickness, section or mass by element type, shown
in the display units and blank until set). A property the group's
elements do not use, a thickness on beams or a section on bricks, is
blank there and takes no value, and says why on hover. The elements are listed as runs
(1-36 156-245), and naming an element here moves it into this
group. A node can be in no element at all, but an element is always
in exactly one element group, so an edit can add and move elements,
and one that would leave an element in no group is refused with the
reason (see _set_group_elements). The Element group column of the
elements table moves elements one at a time; this one moves many at
once.
Source code in src/visualdynamics/gui/object_tables.py
1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 | |
specification_model
¶
specification_model(rows: Any, parent: QObject | None = None) -> TableModel
A specification's channels, one row each: the channel's name and its RMS level.
The plot draws one channel at a time, because six targets and their limits drawn together cannot be read, so this table lists every channel, and picking a row plots that one.
The level is the specification's own, integrated from its own breakpoints over its own band, so it does not change with the measurement compared against it.
Source code in src/visualdynamics/gui/object_tables.py
replication_model
¶
replication_model(rows: Any, parent: QObject | None = None, units: str = '%') -> TableModel
A table of a ReplicationRows: channels down, events across.
Two comparisons have this shape and share it: the waveform error
against a target time history, in percent, and the RMS deviation in
dB of a shock spectrum from the one it had to meet. Only units, in
each column heading, differs.
A cell with no value is blank, not zero, because a zero would read as a channel that matched its target exactly.
Source code in src/visualdynamics/gui/object_tables.py
compliance_grid_model
¶
compliance_grid_model(rows: Any, parent: QObject | None = None) -> TableModel
A table of a ComplianceGrid: each channel, its RMS error in
dB, and the percent of its band outside the abort limits.
Both values are shown because they often disagree: a channel can have exactly the right level and still be outside the limits across half its band, and one that is 2 dB low everywhere may never cross an abort limit.
Source code in src/visualdynamics/gui/object_tables.py
sweep_rate_rows
¶
sweep_rate_rows(tone: str, checks: Sequence[Any], swept: Sequence[tuple[str, float, float, Any]] = ()) -> list[dict[str, Any]]
The sweep-rate table's rows: one per pass of the tone through a
mode (core.sweep_rate.SweepRateCheck), then one per Q read off a
tracked level at a mode, swept holding (DOF, frequency, Q,
SweptQ).
The two kinds share the columns: a level's row names the level's DOF where a pass names its direction, gives the rate at the level's peak and the rule's rate for the Q the reading implies, and leaves the time in the band empty, since a level is a reading of the sweep rather than a pass of it.
Source code in src/visualdynamics/gui/object_tables.py
sweep_rate_model
¶
sweep_rate_model(rows: Sequence[dict[str, Any]], parent: QObject | None = None) -> TableModel
A table of sweep_rate_rows: each pass of a sine tone through a
mode, with the time and the cycles it spends in the mode's
half-power band, its rate against the rule's, what a mode of that Q
reads at that rate, and the verdict; then each Q read off a tracked
level, judged against its sweep. Read-only: the modes are set in the
panel beside the plot.