Commit b79fc66
committed
station_server: provide history handlers
While the history handlers do need to match what has been saved on disk,
the project provides MfgEvent protobuffer writers out of the box, and
no-others, so at least let the out of box experience function as
expected, even if you would want to change this in your own
implementations.
To enable the (built in) writers, something like this is required in
your station server.
```
if __name__ == '__main__':
openhtf.util.conf.load(station_server_port='4444')
interface = mfg_inspector.MfgInspector()
interface.set_converter(mfg_event_from_test_record)
with station_server.StationServer(history_path="somepath") as server:
while 1:
test = .... #your tests here
test.add_output_callbacks(server.publish_final_state)
# explicitly match hardcoded pattern in HistoryListHandler
test.add_output_callbacks(interface.save_to_disk("somepath/mfg_event_{dut_id}_{start_time_millis}.pb"))
test.execute(test_start=user_input.prompt_for_test_start())
```
Signed-off-by: Karl Palsson <[email protected]>1 parent 4fa142e commit b79fc66
1 file changed
+40
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| |||
461 | 463 | | |
462 | 464 | | |
463 | 465 | | |
464 | | - | |
465 | | - | |
466 | | - | |
467 | | - | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
468 | 485 | | |
469 | 486 | | |
470 | 487 | | |
| |||
477 | 494 | | |
478 | 495 | | |
479 | 496 | | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | | - | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
484 | 516 | | |
485 | 517 | | |
486 | 518 | | |
| |||
0 commit comments