Metadata-Version: 2.5
Name: plesty-cam-dmk-37aux290
Version: 0.1.0
Summary: A plesty cam dmk 37aux290 device.
Author-email: Yunshuang Yuan <yunshuang.yuan@fkp.uni-hannover.de>
Maintainer-email: Plesty Development Team <plesty.dev@example.com>
License-Expression: LGPL-3.0-or-later
License-File: COPYING
License-File: LICENSE
Requires-Python: >=3.12
Requires-Dist: pillow
Requires-Dist: plesty-lib>=0.5.0
Requires-Dist: pyyaml>=6.0
Provides-Extra: gui
Requires-Dist: plesty-lib[gui]>=0.5.0; extra == 'gui'
Description-Content-Type: text/markdown

# Plesty Cam Dmk 37aux290 Device

A plesty device for cam dmk 37aux290 using the Plesty standard.


## Installation

```bash
git clone https://gitlab.com/plesty/hub/devices/others/cam_dmk_37aux290.git
cd cam_dmk_37aux290
uv sync
```

This project depends on the legacy The Imaging Source Windows stack, not IC4.
It needs both:

- `Cam33U_setup_6.0.0.2811.exe` for 33U/37U/38U/39U/32U cameras
- `TISGrabberSetup_3.4.0.51.exe` for `tisgrabber_x64.dll`

You can download and install them with:

```powershell
powershell -ExecutionPolicy Bypass -File .\scripts\install-tis-legacy.ps1
```

Or only download the installers with:

```powershell
powershell -ExecutionPolicy Bypass -File .\scripts\install-tis-legacy.ps1 -OnlyDownload
```


## Run As TCP Server

Make sure the device is connected and powered on.

Machine-specific paths come from `.env` (see `.env.example`): `DMK_DRIVERPATH`
(folder containing `tisgrabber_x64.dll` if it is not on `PATH`), `DMK_CONFIG`
(device-state XML), and `DMK_DATA_PATH` (image output directory). Server
tuning (TCP port, threading) lives in `config/server.yaml`; CLI flags
override both.

```bash
cp .env.example .env   # fill in the machine-specific paths
uv run python -m plesty.cam_dmk_37aux290 --tcp-port 5555
```

The server loads `config/camera-state.xml` automatically (device selection,
video format, frame rate — committed for the lab camera, serial 0x11220398);
precedence: `--config` > `DMK_CONFIG` > `config/camera-state.xml`. Without any
of them the server opens the first connected DMK 37AUX290 silently, as 8-bit
mono at 1920x1080 with the camera's power-on settings — no window asks
anything, so a remote bench starts unattended.
Camera parameters listed under `startup:` in `config/server.yaml` (e.g. the
flips) are written through the parameter system right after connecting. To
regenerate the state file from the camera:
`dev.save_config("config/camera-state.xml")`.

`--gui` opens the camera's control panel instead of serving it (needs
`uv sync --extra gui`). `--driverpath mock` runs the server or the panel on an
in-memory simulator, with no camera and no IC Imaging Control installed.

At start-up the preflight prints the `.env` in effect, the server port and the
installed version. It cannot check the camera itself — the DLL finds a camera
only by opening it — so it reports it as not checked and never stops the
server. `--skip-preflight` leaves the report out.

### Where images go

Frames are saved under the data path: `DMK_DATA_PATH`, else `DEVICE_DATA_PATH`
(what a bench hands the device: its view of the shared disk), else the current
directory. A client can redirect captures inside it with `set_data_path()` —
an experiment routes them into its run directory this way — but never outside
it.


## Legacy Downloads

- Driver: https://www.theimagingsource.com/en-de/support/download/icwdmuvccamtis33u-6.0.0.2811/
- TIS Grabber: https://www.theimagingsource.com/en-de/support/download/tisgrabberdll-3.4.0.51/


## Linux

The DMK 37AUX290 camera has Linux-capable vendor SDK options, but this
repository does not currently run on Linux as-is.

Why not:

- the transport layer in `plesty/cam_dmk_37aux290/traffic.py` explicitly loads
  `tisgrabber_x64.dll` or `tisgrabber.dll`
- the current implementation is built around the Windows-only IC Imaging
  Control 3.x / DirectShow API

Viable Linux paths:

1. For new development, use The Imaging Source IC Imaging Control 4 on Linux.
   The vendor documents Ubuntu 20.04+ support on amd64 and arm64, and lists the
   37U family under USB3 Vision support.
2. For legacy Linux integration, use `tiscamera`, which The Imaging Source
   positions as its legacy Linux image acquisition SDK built on GStreamer.

Relevant vendor pages:

- IC Imaging Control 4: https://www.theimagingsource.com/en-de/product/software/icimagingcontrol/
- tiscamera: https://www.theimagingsource.com/en-de/product/software/tiscamera/
- Linux downloads overview: https://www.theimagingsource.com/en-de/support/download/
- Ubuntu 20.04 tiscamera package page: https://www.theimagingsource.com/en-de/support/download/tiscamera2004-1.1.1.4142/

Implication for this repo:

- running this code on Linux would require a new traffic layer that talks to
  IC4 or tiscamera instead of `tisgrabber`
- the current Windows installer helper does not apply on Linux
