stylus¶
Source code: stylus.py
Test stylus functionality.
Description¶
Verifies if stylus is functional by asking operator to draw specified lines or shapes using stylus.
For EMR stylus, drawing a diagonal line from left-bottom to right-top corner should be sufficient to validate all scan lines. But for clamshells with hall sensor, the magnet may cause EMR stylus to be non-functional in particular area. To test that, set argument endpoints_ratio to build the lines for operator to draw.
Test Procedure¶
When started, a diagonal line is displayed on screen.
Operator must use stylus to draw and follow the displayed line.
If the stylus moved too far (specified in argument error_margin) from the requested path, test will fail.
Dependency¶
Based on Linux evdev.
Examples¶
To check stylus functionality by drawing a diagonal line, add this in test list:
{
"pytest_name": "stylus",
"label": "Stylus",
"run_if": "not constants.has_device_data or device.component.has_stylus",
"related_components": [
"test_tags.TestCategory.EMR_IC",
"test_tags.TestCategory.USI_CONTROLLER"
]
}
To check if the magnet in left side will cause problems, add this in test list to draw a line from left-top to left-bottom:
{
"pytest_name": "stylus",
"label": "Stylus Top Left To Bottom Left",
"run_if": "not constants.has_device_data or device.component.has_stylus",
"related_components": [
"test_tags.TestCategory.EMR_IC",
"test_tags.TestCategory.USI_CONTROLLER"
],
"args": {
"endpoints_ratio": [
[
0,
0
],
[
0,
1
]
]
}
}
Test Arguments¶
Name |
Type |
Description |
---|---|---|
device_filter |
int, str, list, None |
(optional; default: |
error_margin |
int |
(optional; default: |
begin_ratio |
float |
(optional; default: |
end_ratio |
float |
(optional; default: |
step_ratio |
float |
(optional; default: |
endpoints_ratio |
list |
(optional; default: |
autostart |
bool |
(optional; default: |
flush_interval |
float |
(optional; default: |
angle_compensation |
[‘angle_0’, ‘angle_180’, ‘angle_270’, ‘angle_90’] |
(optional; default: |