How To Use the LabOne UI Logging Feature¶
This guide explains what the LabOne API Command Log is and how it can be used.
The LabOne User Interface (UI) replaces the knobs and displays on the device itself. It is based on the same underlying library than the LabOne API and therefore uses the same functionalities, e.g. subscribe and poll or LabOne Modules, to interact with the device.
In short, this means that most user interactions in the UI can be mapped to LabOne API commands. The Logger in the UI does exactly that. Located in the status bar (at the bottom of the screen) it shows the last command as a LabOne API command.
Complete Log¶
To view a complete log, the API Log
button opens a new tab with a complete History of all commands executed.
The Log is more or less ready to use and does not require further adaption.
Warning
The produced code does not connect the device. The reason is that the device is already connected, by the Session Dialog, when the LabOne UI is loaded.
Info
Although the produced code is fully functional it is not optimized.
Changing the API Language¶
By default, the log produces code for python. The language can be changed in the Config
tab under Config -> User Preferences -> System -> Log Format
. The following options are available:
- Python (Python Core API)
- Matlab
- .Net
- Telnet (Only applicable for HF2 devices.)
Info
The C API is not supported because of its more complicated syntax. It is however possible to translate the log output to it.
Conclusion¶
The LabOne API Command Log is a simple tool to understand what the UI is doing and how it can be reproduced in the LabOne API. The produced code is working out of the box, but should not be seen as a reference for best practice.