3.9 KiB
Sensor Bench EXE Build
This folder contains Windows PyInstaller build setups for:
- Public exhibition app →
dist/SensorBench/ - Private operator app →
dist/SensorBenchOperator/(internal use only)
Requirements
- Windows x64
- Anaconda or Miniconda available as
conda - Python 3.10 build environment
- Internet access to install
orisysfrom PyPI
The build installs orisys from PyPI. Do not use PYTHONPATH or an editable
orisys-sdk checkout for release builds.
Build
From the repository root (cmd or PowerShell):
.\build\create_env.bat
.\build\build_exe.bat
The .bat wrappers bypass the local PowerShell execution policy. If you prefer
calling PowerShell directly:
powershell -NoProfile -ExecutionPolicy Bypass -File .\build\create_env.ps1
powershell -NoProfile -ExecutionPolicy Bypass -File .\build\build_exe.ps1
Output:
dist/SensorBench/SensorBench.exe
After installing/upgrading orisys, the build syncs wheel sensor *.json into
repo config/ via build/sync_wheel_configs.py (for example ddjx01.json)
before PyInstaller, never touching locales/. The helper reads from the
installed wheel's bundled orisys/configs/ directory instead of
orisys.configs.CONFIG_DIR, which can point at the repo's local config/
during builds. PyInstaller bundles that config/, then the script copies repo
config/ beside the EXE so operators can edit sensor JSON and locales.
The public build intentionally excludes:
internal/(private operator UI)steps/workflow JSONconfig/options.jsonlab component metadatasensor_bench_operator/ formersensor_bench.appmodules
The build is onedir rather than onefile so startup is faster and bundled
DLL/resource issues are easier to diagnose.
Validation
The build script runs:
python tests/test_smoke.py
python build/verify_dist.py
verify_dist.py checks the expected public layout and fails if internal
paths, operator modules, workflow locale keys, or private workflow text appear
in the dist tree.
Manual hardware check:
- Run
dist\SensorBench\SensorBench.exe. - Confirm the exhibition UI opens without setting
PYTHONPATH. - Confirm the UI defaults to Simplified Chinese and can switch to English.
- Confirm Orisys status is available, the config dropdown lists local editable
sensor configs (for example
ddjx01), and Start uses DDJX01. - Confirm Search finds cameras (or logs none) and Camera still opens a video-file picker. There is no Cal (.npy) field; Reset resets the Orisys tracker while preview is running.
- Start preview with camera index
0(or a searched index / video file). - Confirm the image panel and FN/FX/FY plots update.
- Toggle processed/raw view and start/stop recording under
dist\SensorBench\recordings.
Locale files are bundled under _internal/config/locales/ (and can also be
placed beside the EXE under config/locales/ for overrides). Edit those JSON
files to change exhibition-facing text without rebuilding.
Private operator EXE (internal only)
Do not ship SensorBenchOperator to customers. It includes workflow steps,
lab options.json, and operator locale copy.
.\build\create_env.bat
.\build\build_operator_exe.bat
Or:
powershell -NoProfile -ExecutionPolicy Bypass -File .\build\build_operator_exe.ps1
Output:
dist/SensorBenchOperator/SensorBenchOperator.exe
Validation:
python tests/test_smoke.py
python internal/tests/test_operator_smoke.py
python build/verify_operator_dist.py
Manual check:
- Run
dist\SensorBenchOperator\SensorBenchOperator.exe. - Confirm the workflow/steps panel and component options appear.
- Confirm Start Preview / record / force curves still work with a camera.
- Confirm
config/options.jsonandsteps/default.jsonbeside the EXE are editable.
Source-level operator docs: ../internal/README.md.