visualdynamics.gui.run_log_dock¶
run_log_dock
¶
The Run Log window: a dock in the main window where the log keeper writes the run log while a test runs.
The log keeper is a named person who is not at the controller, so the
dock is built to be read across a room and typed into fast. It floats
to a second monitor and remembers where it was put, and
visualdynamics --run-log [file] opens the main window with the dock
filling it and the analysis panes hidden (MainWindow.set_log_only),
for a lab that analyzes its data elsewhere. Nothing here drives the
controller: every check is a reminder, never an interlock.
What it shows, in large type:
- The status strip: the current test, its axis, run and level, whether the run is running or stopped (in words), the time since the run started, and the holds, counted, with the list a click away. A log open read-only says who holds it, and a mirror that could not be written says so.
- The tests as a strip of tabs, the whole log first, so an earlier test is a click away.
- The day as a list in the order written, with a line for each date: a corrected entry is shown struck through with what corrected it beneath, and a late entry is marked with when it was entered.
- The owed lists, shown and never enforced.
What it takes:
- The level row: one entry per step, its level offered from the
header's step schedule, then the voltage, current and drive fraction
in tab order, the analyst's answer with answers by channel, and the
go; Enter writes it. The projection to full level (
run_log_model.project) is shown live as the row is typed, a check that cannot be made saying why. - The abort, one keystroke (Ctrl+Shift+A) that takes the event time at the key and opens a form needing only the kind of stop and the author's initials; Enter writes the run stop and the abort together, and what the first minute still owes is listed.
- Small forms for the rest: a new or opened log, a test closed or released, a clock check, a person in or out, a note, a run started or stopped, a cause found and a correction. Each takes its event time when it opens.
- The header and readings forms (
gui.run_log_forms): the test header in full for a test opened, the roll and the current test, with carried fields marked until confirmed; a sweep, a shot, a survey's result, a notch, a deviation, an anomaly and its disposition, a setting change and an opinion given, each computing what the log will judge as it is typed, and the predictions the window drew shown beside what is read.
Every read and write of the file, and every rebuild of the model from
it, runs on one worker thread of its own (LogWorker), in order, and
never gates input: the keeper keeps typing while an entry is synced, a
mirror is copied or a file is hashed. The window only ever shows a
Snapshot, which the worker builds after each change.
Classes:
| Name | Description |
|---|---|
Row |
One entry of the day: as corrected, as written, what each of its |
TestTab |
A test as the strip of tests names it: its number, title, kind and |
Status |
What the status strip reads: the current test (None when no test |
Snapshot |
A log as the window shows it, built on the worker after each |
LogWorker |
One worker thread for everything that touches a log's file: opening |
StatusStrip |
The strip across the top: the current test, its axis, run and |
EntryForm |
A small form for one act: its event time, taken when the form |
LevelRow |
The level row: one entry per step of the step-up. The level is |
RunLogPanel |
Everything inside the Run Log dock: the status strip, the holds, |
RunLogDock |
The Run Log dock: movable, floatable to a second monitor, and |
Functions:
| Name | Description |
|---|---|
snapshot |
The window's view of |
entry_line |
An entry on one line, as the day list shows it: its time, kind, |
next_level |
The level a level row offers: the first step of the header's step |
projection_text |
The projection of a level row's readings to full level, in words, |
channel_answers |
Answers by channel as typed in a level row: 'channel: answer' |
planned_notches |
A header's planned notches as typed: items separated by |
notches_text |
Planned notches as |
hashed |
Each file at |
event_time |
The event time a form gives: |
remember_place |
Store where |
restore_place |
Put |
log_argument |
Take |
Classes¶
Row
dataclass
¶
One entry of the day: as corrected, as written, what each of its corrections changed in words, and whether it was entered late.
Attributes:
| Name | Type | Description |
|---|---|---|
corrected |
bool
|
Whether a correction changed the entry. |
TestTab
dataclass
¶
A test as the strip of tests names it: its number, title, kind and state.
Status
dataclass
¶
Status(test: int | None = None, title: str = '', kind: str = '', axis: str | None = None, run: int | None = None, level_db: float | None = None, outcome: str = '', started: datetime | None = None, stopped: datetime | None = None)
What the status strip reads: the current test (None when no test is open to runs), its title and kind, the axis, run and level of its latest run, that run's outcome ('running', 'aborted', 'stopped', 'completed', or '' with no run yet), and when it started and stopped.
Snapshot
dataclass
¶
Snapshot(path: str, title: str, writable: bool, read_only: str, mirror: str | None, mirror_problem: str, problems: tuple[str, ...], rows: tuple[Row, ...], tests: tuple[TestTab, ...], status: Status, header: Mapping[str, Any], holds: tuple[Hold, ...], owed: tuple[OwedList, ...], run: int | None, levels: tuple[float, ...], open_aborts: tuple[int, ...], unreleased: tuple[int, ...], carried: tuple[str, ...] = (), sweeps: tuple[Mapping[str, Any], ...] = (), pulses: PulseCount | None = None, deviation_wanted: tuple[int, ...] = (), open_anomalies: tuple[str, ...] = ())
A log as the window shows it, built on the worker after each
change (snapshot), so nothing on the window's thread reads the
file or rebuilds the model.
writable is False for a log opened read-only, read_only saying
why (who holds it). rows is the corrected view with what each
correction changed; holds and owed are the whole log's; header
is the current test's header as it stands. run is the run a level
row goes into (the latest, while it runs, otherwise the next) and
levels the levels already written in it. open_aborts are the
aborts with no cause, unreleased the tests closed to runs and not
yet released.
For the readings forms: carried names the current header's fields
carried from the last test and not yet confirmed; sweeps are the
fields of the sweeps already written in the run a sweep goes into;
pulses is the current test's pulse count against its budget (None
with no test open); deviation_wanted are the entries whose hold a
deviation naming them answers (an unplanned notch, a change to the
test), and open_anomalies the numbers of the anomalies with no
disposition.
LogWorker
¶
One worker thread for everything that touches a log's file: opening and reading it, each entry written and synced, the mirror copied, files hashed, and the model rebuilt after each change. Jobs run one at a time in the order given, so entries are written in the order the keeper wrote them.
Unlike the analysis verbs' runner, it never gates input: the window keeps taking keys and clicks while a job runs, and each result comes back through a queued signal to the callback given with it. A job holds no Qt object and no callback, so nothing of Qt's is let go on the worker; the callbacks stay on the window's thread, by number.
Methods:
| Name | Description |
|---|---|
submit |
Run |
shut_down |
Run |
Attributes:
| Name | Type | Description |
|---|---|---|
pending |
int
|
How many jobs have not yet come back. |
Source code in src/visualdynamics/gui/run_log_dock.py
Attributes¶
Methods:¶
submit
¶
Run work on the worker; then(ok, value) is called on the
window's thread with its result, or with the exception it
raised.
Source code in src/visualdynamics/gui/run_log_dock.py
shut_down
¶
Run last after every job already given, wait for it, and take
no more. What comes back after this is not delivered.
Source code in src/visualdynamics/gui/run_log_dock.py
StatusStrip
¶
Bases: QFrame
The strip across the top: the current test, its axis, run and level, running or stopped in words, the time since the run started, the holds counted (the button shows their list), and a notice line for a log read-only or a mirror that could not be written.
Methods:
| Name | Description |
|---|---|
show_snapshot |
Read the strip off |
tick |
The time since the run started, to |
Source code in src/visualdynamics/gui/run_log_dock.py
Methods:¶
show_snapshot
¶
show_snapshot(seen: Snapshot | None, now: datetime) -> None
Read the strip off seen (None: no log open) at time now.
Source code in src/visualdynamics/gui/run_log_dock.py
tick
¶
The time since the run started, to now while it runs; once it
has stopped, how long it ran.
Source code in src/visualdynamics/gui/run_log_dock.py
EntryForm
¶
EntryForm(name: str, title: str, fields: Sequence[tuple[str, str, str, Any]], taken: datetime, *, required: Sequence[str] = (), text: str = 'Note', note: str = '', defaults: Mapping[str, Any] | None = None, with_time: bool = True, live: Callable[[EntryForm], str] | None = None)
Bases: QWidget
A small form for one act: its event time, taken when the form opened and editable for an event entered late, its fields, a line of free text, and Write and Cancel. Enter in any box writes; Esc cancels. What a box cannot hold is said on the form's message line, and nothing is written.
A field of kind 'heading' is a group's title, not a box. live, when
given, is read on every change to a box and shown under the boxes:
what the form computes from what is typed (a budget, a count, a
prediction), without writing anything.
Methods:
| Name | Description |
|---|---|
refresh |
Read |
box_text |
What box |
set_box |
Put |
value |
Box |
values |
Every box read as its field holds it, blank boxes left out. |
write |
Read the form and hand it to |
say |
Show |
focus_first |
Put the cursor in the first box after the time. |
Source code in src/visualdynamics/gui/run_log_dock.py
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 856 | |
Methods:¶
refresh
¶
Read live again from what the boxes hold now.
Source code in src/visualdynamics/gui/run_log_dock.py
box_text
¶
What box field holds, as text.
Source code in src/visualdynamics/gui/run_log_dock.py
set_box
¶
Put value in box field: typed into a text box, chosen in a
list.
Source code in src/visualdynamics/gui/run_log_dock.py
value
¶
Box field read as its field holds it, None when blank.
RunLogError naming the box for one that cannot be read.
Source code in src/visualdynamics/gui/run_log_dock.py
values
¶
Every box read as its field holds it, blank boxes left out.
RunLogError naming the box for one that cannot be read, or for
a required box left blank.
Source code in src/visualdynamics/gui/run_log_dock.py
write
¶
Read the form and hand it to on_write; say why on the form if
it cannot be read.
Source code in src/visualdynamics/gui/run_log_dock.py
say
¶
focus_first
¶
LevelRow
¶
Bases: QWidget
The level row: one entry per step of the step-up. The level is offered from the header's step schedule; the voltage, current and drive fraction follow in tab order, then the analyst's answer, the answers by channel, the go and who agreed it at a hold point. Enter in any box writes the row. The projection to full level is redrawn on every keystroke, and the event time is taken at the row's first keystroke.
Methods:
| Name | Description |
|---|---|
inputs |
The boxes in tab order. |
offer |
The test's header the projection is judged against, and the |
fields |
The row as a level row entry's fields; |
redraw |
The projection to full level of what the row holds now, and |
write |
Hand the row to |
clear |
Empty the row after it is written, ready for the next step. |
Source code in src/visualdynamics/gui/run_log_dock.py
1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 | |
Methods:¶
inputs
¶
The boxes in tab order.
offer
¶
The test's header the projection is judged against, and the level offered for the next row (left alone once typed into).
Source code in src/visualdynamics/gui/run_log_dock.py
fields
¶
The row as a level row entry's fields; RunLogError naming
the box that cannot be read.
Source code in src/visualdynamics/gui/run_log_dock.py
redraw
¶
The projection to full level of what the row holds now, and the drive predicted beside the drive read.
Source code in src/visualdynamics/gui/run_log_dock.py
write
¶
Hand the row to on_write with its event time.
Source code in src/visualdynamics/gui/run_log_dock.py
clear
¶
Empty the row after it is written, ready for the next step.
Source code in src/visualdynamics/gui/run_log_dock.py
RunLogPanel
¶
Bases: QWidget
Everything inside the Run Log dock: the status strip, the holds, the tests, the day, the owed lists and the entry.
clock gives the event time an act takes; log_clock and who are
handed to the log for its entered-at times and the login and machine
every entry records (each the computer's own unless set).
Methods:
| Name | Description |
|---|---|
show_layout |
Name the layout the toggle would switch to. |
new_log |
Create a log at |
open_log |
Open the log at |
ask_open_log |
Ask for a log to open. |
close_log |
Close the log and release its lock, on the worker. |
reload |
Read the log again: a log read-only shows what its writer has |
shut_down |
Close the log, releasing its lock, after every entry already |
settle |
Turn the event loop until every job given to the worker has |
write_level |
Write a level row to the current run of the current test. |
abort |
The abort: the event time is taken now, at the key, and the |
open_form |
Open the form |
offer_prediction |
Show |
focus_level_row |
Close any open form and put the cursor in the level row. |
say |
Show |
show_test |
Show test |
day_texts |
The day list's lines as shown, for a script or a test. |
owed_texts |
The owed lists' lines as shown, each list's title first. |
Source code in src/visualdynamics/gui/run_log_dock.py
1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 | |
Methods:¶
show_layout
¶
new_log
¶
Create a log at path and open it for writing, on the worker.
Source code in src/visualdynamics/gui/run_log_dock.py
open_log
¶
Open the log at path for writing, on the worker. One that
cannot be written here (another writer holds it, or it is of an
older format version) opens read-only, saying why.
Source code in src/visualdynamics/gui/run_log_dock.py
ask_open_log
¶
close_log
¶
Close the log and release its lock, on the worker.
Source code in src/visualdynamics/gui/run_log_dock.py
reload
¶
Read the log again: a log read-only shows what its writer has added since.
Source code in src/visualdynamics/gui/run_log_dock.py
shut_down
¶
Close the log, releasing its lock, after every entry already given is written; then stop the worker. The window calls this as it closes.
Source code in src/visualdynamics/gui/run_log_dock.py
settle
¶
Turn the event loop until every job given to the worker has
come back, or timeout seconds pass; whether it settled. For a
script or a test driving the dock.
Source code in src/visualdynamics/gui/run_log_dock.py
write_level
¶
Write a level row to the current run of the current test.
Source code in src/visualdynamics/gui/run_log_dock.py
abort
¶
abort() -> EntryForm | None
The abort: the event time is taken now, at the key, and the form needs only the kind of stop and the author; the rest of the first minute is offered and, left blank, owed.
Source code in src/visualdynamics/gui/run_log_dock.py
open_form
¶
open_form(name: str) -> EntryForm | None
Open the form name, its event time taken now: a small form
('note', 'clock check', 'person in', 'person out', 'run start',
'run stop', 'cause found', 'correct', 'close test', 'release' or
'new log'), a header form ('open test', 'roll' or 'header'), or a
readings form ('sweep', 'shot', 'result', 'notch', 'deviation',
'anomaly', 'disposition', 'setting change' or 'opinion').
Source code in src/visualdynamics/gui/run_log_dock.py
1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 | |
offer_prediction
¶
Show prediction beside what is read: a notch prediction
(kind 'limit', core.limit_prediction.LimitPrediction) beside
a notch entry, a drive prediction ('drive',
core.drive_prediction.DrivePrediction) beside the level row's
drive. source names the objects it was made from. The window
offers each prediction it draws; None takes it away.
Source code in src/visualdynamics/gui/run_log_dock.py
focus_level_row
¶
say
¶
show_test
¶
Show test test in the day and the owed lists (ALL for the
whole log).
Source code in src/visualdynamics/gui/run_log_dock.py
day_texts
¶
owed_texts
¶
The owed lists' lines as shown, each list's title first.
Source code in src/visualdynamics/gui/run_log_dock.py
RunLogDock
¶
Bases: QDockWidget
The Run Log dock: movable, floatable to a second monitor, and
closable, holding a RunLogPanel. Its place is remembered between
launches (remember_place, restore_place).
Source code in src/visualdynamics/gui/run_log_dock.py
Functions:¶
snapshot
¶
The window's view of log: its model read once (RunLogModel)
and everything the dock shows taken from it, in plain values.
Run on the log's worker, never on the window's thread: it reads the whole corrected view and every hold and owed rule.
Source code in src/visualdynamics/gui/run_log_dock.py
entry_line
¶
entry_line(entry: Entry) -> str
An entry on one line, as the day list shows it: its time, kind, place, fields as the plain text export writes them, free text and author.
Source code in src/visualdynamics/gui/run_log_dock.py
next_level
¶
The level a level row offers: the first step of the header's step schedule above the last level written in the run, the first step when none is, the last written when the schedule is used up or absent, and None with neither.
Source code in src/visualdynamics/gui/run_log_dock.py
projection_text
¶
projection_text(header: Mapping[str, Any], level: Any, *, voltage: Any = None, current: Any = None, drive_fraction: Any = None) -> str
The projection of a level row's readings to full level, in words,
against the test's header (run_log_model.project): the factor, the
verdict and every check, a check that cannot be made saying why.
Source code in src/visualdynamics/gui/run_log_dock.py
channel_answers
¶
Answers by channel as typed in a level row: 'channel: answer'
items separated by commas or semicolons, such as '12: not
explained, 4: as predicted'. None for nothing typed; RunLogError
naming the item for one without a colon or with an answer that is
not one of run_log.ANSWERS.
Source code in src/visualdynamics/gui/run_log_dock.py
planned_notches
¶
A header's planned notches as typed: items separated by
semicolons, each its band with the axis before a colon and the depth
after a comma where the plan gives them, such as 'Z: 180-220 Hz, 6
dB; 400-450 Hz'. None for nothing typed; RunLogError naming the
item for a band run_log.band_hz does not read or a depth that is
not a number of dB.
Source code in src/visualdynamics/gui/run_log_dock.py
notches_text
¶
Planned notches as planned_notches reads them back.
Source code in src/visualdynamics/gui/run_log_dock.py
hashed
¶
hashed(paths: Sequence[str]) -> list[FileRef]
Each file at paths as a FileRef, read and hashed now: called
on the log's worker as the entry naming them is written, never on
the window's thread. RunLogError naming a file that cannot be
read.
Source code in src/visualdynamics/gui/run_log_dock.py
event_time
¶
The event time a form gives: taken (the moment the form was
opened) while its box still reads that time, otherwise the time
typed (HH:MM or HH:MM:SS) on taken's date and zone, so a keeper
entering a late event writes when it happened.
Source code in src/visualdynamics/gui/run_log_dock.py
remember_place
¶
Store where dock is: floating, with its geometry, or docked in
area.
Source code in src/visualdynamics/gui/run_log_dock.py
restore_place
¶
Put dock where it was last remembered (remember_place): back to
its floating geometry, or into its dock area of window; the right
edge when nothing is remembered.
Source code in src/visualdynamics/gui/run_log_dock.py
log_argument
¶
Take --run-log [file] out of the command line: the arguments
left, whether the flag was given, and the log named after it (an
argument ending in .vdlog), or None.