update plot to force units

This commit is contained in:
ykcheungab
2026-09-01 16:24:12 +08:00
parent 8cacb12abc
commit e7789c86cb
31 changed files with 767 additions and 77 deletions
+5 -1
View File
@@ -9,6 +9,7 @@ $DistDir = Join-Path $RepoRoot "dist"
$WorkDir = Join-Path $RepoRoot "build\pyinstaller_work"
$SpecPath = Join-Path $PSScriptRoot "sensor_bench.spec"
$RepoConfig = Join-Path $RepoRoot "config"
$RepoSensors = Join-Path $RepoRoot "sensors"
if (-not (Get-Command conda -ErrorAction SilentlyContinue)) {
throw "conda was not found on PATH. Open an Anaconda Prompt or initialize conda for PowerShell."
@@ -42,8 +43,11 @@ try {
conda run -n $EnvName python -m PyInstaller --noconfirm --clean --distpath "$DistDir" --workpath "$WorkDir" "$SpecPath"
if ($LASTEXITCODE -ne 0) { throw "PyInstaller failed." }
# Public package only: copy exhibition config/. Never ship internal/ operator assets.
# Public package only: copy exhibition config/ and sensors/. Never ship internal/ operator assets.
Copy-Item -Recurse -Force $RepoConfig (Join-Path $DistDir "SensorBench")
if (Test-Path $RepoSensors) {
Copy-Item -Recurse -Force $RepoSensors (Join-Path $DistDir "SensorBench")
}
$InternalLeak = Join-Path $DistDir "SensorBench\internal"
if (Test-Path $InternalLeak) {
throw "Public dist must not contain internal/: $InternalLeak"
+1
View File
@@ -11,6 +11,7 @@ work_dir = repo_root / "build" / "pyinstaller_work"
datas = [
(str(repo_root / "config"), "config"),
(str(repo_root / "sensors"), "sensors"),
]
binaries = []
hiddenimports = [
+36 -2
View File
@@ -1,4 +1,4 @@
"""Copy Orisys wheel sensor JSON configs into repo config/ (exclude options.json)."""
"""Copy Orisys wheel sensor JSON configs and sensors/ bundles into the repo."""
from __future__ import annotations
@@ -17,6 +17,16 @@ def wheel_config_dir() -> Path:
return inner_pkg.parent / "configs"
def wheel_sensors_dir() -> Path | None:
import orisys
inner_pkg = Path(orisys.__file__).resolve().parent
for candidate in (inner_pkg / "sensors", inner_pkg.parent / "sensors"):
if candidate.is_dir() and any(candidate.iterdir()):
return candidate
return None
def sync_configs(repo_root: Path) -> int:
src = wheel_config_dir()
if not src.is_dir():
@@ -37,9 +47,33 @@ def sync_configs(repo_root: Path) -> int:
return 0
def sync_sensor_bundles(repo_root: Path) -> int:
src = wheel_sensors_dir()
if src is None or not src.is_dir():
print("Orisys wheel sensors/ directory not found; skipping bundle sync")
return 0
dst = repo_root / "sensors"
dst.mkdir(parents=True, exist_ok=True)
copied = 0
for bundle_dir in sorted(p for p in src.iterdir() if p.is_dir()):
target = dst / bundle_dir.name
if target.exists():
shutil.rmtree(target)
shutil.copytree(bundle_dir, target)
copied += 1
print(f"Synced {copied} sensor bundle(s) from {src} to {dst}")
return 0
def main() -> int:
repo_root = Path(__file__).resolve().parents[1]
return sync_configs(repo_root)
code = sync_configs(repo_root)
if code != 0:
return code
return sync_sensor_bundles(repo_root)
if __name__ == "__main__":
+2
View File
@@ -99,6 +99,8 @@ def main() -> int:
require(DIST / "config" / "locales" / "zh_CN.json")
require(DIST / "config" / "locales" / "en_US.json")
require(DIST / "config" / "ddjx01.json")
require(DIST / "sensors" / "box" / "sensor.json")
require(DIST / "sensors" / "box" / "force_calibration.json")
require(DIST / "_internal")
for rel in FORBIDDEN_RELATIVE_PATHS: