# {{ module_name | pascal_case }} Instrument Module

{{ module_description }}

Generated by MADSci template: `module/instrument` v{{ template_version }}

## Overview

This module provides a MADSci instrument node for controlling the {{ module_name }} measurement
instrument with calibration and data acquisition capabilities.

### Instrument Capabilities

- **Measure** - Take readings from the instrument
- **Calibrate** - Perform instrument calibration
- **Status** - Query instrument state and health
- **Reset** - Return instrument to initial state

## Project Structure

```
{{ module_name }}_module/
├── src/
│   ├── {{ module_name }}_rest_node.py       # MADSci REST node server with @action methods
│   ├── {{ module_name }}_interface.py       # Real hardware interface
│   ├── {{ module_name }}_fake_interface.py  # Fake interface for testing
│   └── {{ module_name }}_types.py           # Type definitions and config
├── tests/
│   └── test_{{ module_name }}_interface.py  # Interface tests
├── Dockerfile
├── pyproject.toml
└── README.md
```

## Quick Start

### Running with Fake Interface (Testing)

```bash
pip install -e ".[dev]"
python src/{{ module_name }}_rest_node.py --fake
curl http://localhost:{{ port }}/health
```

### Available Actions

| Action | Description |
|--------|-------------|
| `measure` | Take a measurement reading |
| `calibrate` | Calibrate the instrument |
| `get_instrument_status` | Get current instrument status |
| `reset_instrument` | Reset to initial state |

### Using the Interface Directly

```python
from {{ module_name }}_interface import {{ module_name | pascal_case }}Interface

interface = {{ module_name | pascal_case }}Interface()
interface.connect()
interface.initialize()

reading = interface.measure(channel="ch1")
print(f"Value: {reading.value} {reading.units}")

interface.shutdown()
interface.disconnect()
```

## Testing

```bash
pytest
pytest --cov=src
```

## Documentation

For more information, see the [MADSci documentation](https://ad-sdl.github.io/MADSci/).
