Metadata-Version: 2.5
Name: plesty-k10cr1
Version: 0.2.0
Summary: Plesty device for the Thorlabs K10CR1 cage rotation stage (APT protocol).
Author-email: Yunshuang Yuan <yuanyunshuang@gmail.com>
Maintainer-email: Plesty Development Team <plesty.dev@example.com>
License-Expression: LGPL-3.0-or-later
License-File: LICENSE
License-File: LICENSES/LGPL-3.0-or-later.txt
Requires-Python: >=3.12
Requires-Dist: plesty-lib>=0.3.5
Requires-Dist: pyyaml>=6.0
Description-Content-Type: text/markdown

# Plesty K10CR1 Device

Plesty device for the Thorlabs K10CR1 motorized 360° cage rotation stage,
driven over USB serial with the binary APT protocol (no Kinesis/.NET runtime
required, works on Windows and Linux).

Device constants (unit scaling, software limits, stage defaults, runtime
defaults) live in `plesty/k10cr1/config.yaml`; the parameter set is defined in
`plesty/k10cr1/schema_param.json`.

## Installation

```bash
git clone https://gitlab.com/plesty/hub/devices/thorlab/plesty-k10cr1.git
cd plesty-k10cr1
uv sync
```

## Run As TCP Server

Connect the stage via USB and set `DEVICE_PORT` in `.env` (or `--port`, or
`running.port` in `config.yaml`) — either the serial port (`COM3`,
`/dev/ttyUSB0`) or, better, the controller's serial number from the unit's
label (`55001327`), which stays valid when replugging moves the COM name.
Then:

```bash
uv run python -m plesty.k10cr1 --tcp-port 5555
```

Pass `--mock` to serve the in-memory APT motor simulator instead of real
hardware.

## Run pytest

All tests run against the simulator; set `DEVICE_PORT` in `.env` to also run
the real-device test.

```bash
uv run pytest
```
