visualdynamics.gui.object_tables¶
object_tables
¶
Table models for visualdynamics objects.
Each is a list of columns over an existing object — reading straight from it and, where editing makes sense, writing straight back. Results that a fit produced (frequency, damping) are read-only; the free-text description beside them is not.
Classes:
| Name | Description |
|---|---|
ComplianceRows |
The comparison of a specification with a measurement, per channel. |
ReplicationRows |
Waveform error as a grid: a control channel per row, a playing of |
ComplianceGrid |
A control channel per row: how far it is from its specification. |
Functions:
| Name | Description |
|---|---|
shape_table_model |
Modes with their frequency, damping and a description to fill in. |
matched_modes_model |
A MatchedModes object as a table, in the mode table's format. |
channel_table_model |
A channel table: every column editable, every column typed. |
modal_fit_table_model |
The modes fitted so far, plus the one the cursor is placing. |
units_table_model |
One row per thing that needs a unit, whatever kind of object it is. |
frf_units_models |
Two tables for an FRF: response channels and reference channels. |
id_runs_text |
Sorted ids as runs: |
parse_id_runs |
The inverse: |
block_label |
How a block reads in a list: its name, or its id when unnamed. |
block_table_model |
The element blocks: what the mesh is divided into. |
specification_model |
A row per channel a specification carries: its name and its level. |
replication_model |
A grid of channels down and repeats across. |
compliance_grid_model |
Channel, how far its level is out, and how much of its band is. |
Classes¶
ComplianceRows
¶
ComplianceRows(
rows: Sequence[tuple[str, Any]],
unit_label: str = "",
plotted: int | None = None,
)
The comparison of a specification with a measurement, per channel.
A plain holder so the table model has something to read: the rows are computed once, when the selection settles, rather than per cell.
plotted is the row the plot is currently drawing, so the table can
say which of its channels is the one on screen.
Methods:
| Name | Description |
|---|---|
row_of |
Which row is this channel, or None. |
Source code in src/visualdynamics/gui/object_tables.py
ReplicationRows
¶
ReplicationRows(
channels: Sequence[str],
events: Sequence[int],
values: Mapping[tuple[str, int], float],
plotted: Sequence[tuple[str, int]] | None = None,
)
Waveform error as a grid: a control channel per row, a playing of the waveform per column.
A transient record is many attempts at one target, so the numbers are two-dimensional and the table is the only place that shows them that way — the plot draws what is picked and the bar chart reduces to one reading. Laid out this way a channel that is bad everywhere and a repeat that was bad for everything look different at a glance, which is the comparison a single column cannot make.
plotted is the set of (channel, event) pairs on screen, because
picking a cell picks both at once.
Methods:
| Name | Description |
|---|---|
value |
The cell at (row, column-of-events), or None where the |
pairs_at |
The (channel, event) pairs one selected cell stands for. |
Source code in src/visualdynamics/gui/object_tables.py
Methods:¶
value
¶
The cell at (row, column-of-events), or None where the channel cannot be scored against its target.
Source code in src/visualdynamics/gui/object_tables.py
pairs_at
¶
The (channel, event) pairs one selected cell stands for.
Column zero is the channel's name rather than a reading of it, so picking there asks for that channel across every playing — the row as a whole, which is what clicking a name should mean.
Source code in src/visualdynamics/gui/object_tables.py
ComplianceGrid
¶
A control channel per row: how far it is from its specification.
The same job the transient's grid does, for a comparison that has no repeats to spread across — a PSD is already an average over them, so there is one column of numbers and not a grid of them.
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
Modes with their frequency, damping and a description to fill in.
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 referenced sets are read live by name — frequencies and damping restate themselves as the sets change — while the MAC is the object's own stored value (it came from the comparison as displayed, possibly projected). A set gone from the project, or a mode index past its end, shows dashes rather than guessing.
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,
) -> TableModel
A channel table: every column editable, every column typed.
The columns come from the table's own COLUMNS spec rather than
being listed again here, so a schema change reaches the interface
without a second edit — a choice column gets its drop-down, a date
gets a calendar, a flag gets a check box, and the unit column is
narrowed by what the channel says it measures.
rows shows only those channels — picking cells in the tree's grid
is picking rows here too, so the table beside the model shows what
the selection says and nothing else.
Source code in src/visualdynamics/gui/object_tables.py
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 is the pending mode: its frequency mirrors the cursor on the CMIF, its damping is the half-power estimate until the user types one, and Confirm Mode turns it into a fitted row. A fitted mode's damping stays editable — the synthesis restates itself — and its 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
One row per thing that needs a unit, whatever kind of object 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 tables for an FRF: response channels and reference channels.
An FRF matrix is N x M records but only N + M physical channels, and a channel's unit is the channel's property — so each side is declared once, and every record converts as soon as both of its channels are named. The sides stay separate even where the DOF labels collide: 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
530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 | |
id_runs_text
¶
Sorted ids as runs: [1,2,3,7,9,10] -> '1-3 7 9-10'.
A block's elements are not a handful like an element's nodes — the demonstration drone puts 478 in one — and they come in runs, because a mesh is built a part at a time. Written out one by one the drone's 22 blocks need 21 731 characters; as runs they need 595, which is the difference between a cell you can read and one you cannot.
Source code in src/visualdynamics/gui/object_tables.py
parse_id_runs
¶
The inverse: '1-3, 7 9-10' -> [1, 2, 3, 7, 9, 10].
Commas or spaces, and a run either way round — 10-7 is the same
six elements as 7-10, because someone typing a range backwards
means the range.
Source code in src/visualdynamics/gui/object_tables.py
block_label
¶
block_label(geometry: Geometry, row: int) -> str
How a block reads in a list: its name, or its id when unnamed.
Exodus files often carry unnamed blocks, and 'block 3' is what a person calls that one — inventing a name for it would be putting words in the file's mouth.
Source code in src/visualdynamics/gui/object_tables.py
block_table_model
¶
block_table_model(
geometry: Geometry,
unit_system: UnitSystem | None = None,
parent: QObject | None = None,
) -> TableModel
The element blocks: what the mesh is divided into.
Three columns, all editable. The elements are listed as runs
(1-36 156-245) and naming one here claims it for this block —
the same gesture as typing a node into a traceline, with one
difference the model forces: a node can be in no traceline at all,
while an element is always in exactly one block. So the list adds
and moves, and a removal that would orphan an element is refused
with the reason (see _set_block_elements). The Elements column
in the elements table moves them one at a time; this one moves
them by the hundred.
Source code in src/visualdynamics/gui/object_tables.py
specification_model
¶
specification_model(
rows: Any, parent: QObject | None = None
) -> TableModel
A row per channel a specification carries: its name and its level.
What a specification says, in one number per channel. The plot draws one channel at a time — six targets and their limits stacked together are unreadable — so the table is where every channel is still accounted for, and picking a row is how you get to one.
The level is the specification's own, integrated from its own breakpoints over its own band, so it does not move with whatever happens to be measured 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 grid of channels down and repeats across.
Two comparisons share it, because they have the same shape: the waveform error against a target time history, in percent, and the RMS dB deviation of a shock spectrum against the one it had to meet. Only the unit in the heading differs.
Blank rather than zero for a channel whose target asks for nothing. A zero would read as a channel that matched perfectly, which is the opposite of what is known about it.
Source code in src/visualdynamics/gui/object_tables.py
compliance_grid_model
¶
compliance_grid_model(
rows: Any, parent: QObject | None = None
) -> TableModel
Channel, how far its level is out, and how much of its band is.
Two readings and not one, because they disagree often enough to be worth seeing together: a channel can sit at exactly the right level and still be out of tolerance across half its band, and one that is 2 dB low everywhere may never cross an abort limit at all.