Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
AlvaroEzq committed Sep 30, 2024
1 parent 67c0ea3 commit 227939d
Showing 1 changed file with 22 additions and 14 deletions.
36 changes: 22 additions & 14 deletions gui/CAEN-N1471H/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,35 @@
## Overview
The `CaenHVPSGUI` is a graphical user interface (GUI) designed to control and monitor CAEN High Voltage Power Supply (HVPS) modules. The interface is built using Python's `tkinter` library, with threading to handle background tasks and maintain responsive interaction. The GUI supports various functionalities such as setting voltages, turning channels on or off, monitoring channel states, and handling alarms.

The communication with the CAEN HVPS is done by the [hvps](https://github.com/lobis/hvps.git) python library.

## Features
- **Real-time Monitoring**: Voltage (`vmon`), current (`imon`), and state indicators are updated in real-time.
- **Multi-Channel Support**: The GUI can handle modules with multiple channels, providing individual control and monitoring for each channel.
- **Alarm and Interlock Management**: Visual indicators and tooltips provide status information on the module alarms and interlock.
- **Threaded Background Processing**: Ensures the GUI remains responsive during long-running operations.
- **Tooltips**: Interactive tooltips provide additional information when hovering over various GUI elements.

## How to Use
### Requirements
Make sure to have tkinter installed in your system (check [this](https://stackoverflow.com/a/74607246) if you don't) and the hvps python library (check [hvps installation guide](https://github.com/lobis/hvps?tab=readme-ov-file#installation-%EF%B8%8F)).

Download the [gui.py](gui.py) script or clone the repository.
### Usage
At the directory where this [gui.py](gui.py) is found, run
``` bash
python3 gui.py --port /dev/ttyUSB0
```
Note that you may need to change the port. To show available ports run
``` bash
python -m hvps --ports
```
#### Test mode
If you want to test the GUI without having the hardware available, copy the [caen_simulator.py](caen_simulator.py) module to the same directory where the [gui.py](gui.py) script is found and just run
``` bash
python3 gui.py --test
```

## Code Structure

### Main Classes
Expand All @@ -30,17 +52,3 @@ The `CaenHVPSGUI` is a graphical user interface (GUI) designed to control and mo
- **Alarm Frame**: Displays alarm and interlock indicators with buttons to clear signals.
- **Channels Frame**: Lists all available channels with options to set voltages, monitor values, and toggle states.
- **Multichannel Frame**: Provides batch operations on multiple channels.

## How to Use

### Real Usage
1. Ensure you have the `hvps` library installed and the CAEN HVPS connected to your system.
2. Instantiate the `CaenHVPSGUI` class with a valid `module` object from the `hvps` library.

Example:
```python
import hvps
caen = hvps.Caen(port='/dev/ttyUSB0')
m = caen.module(0)
CaenHVPSGUI(module=m)
```

0 comments on commit 227939d

Please sign in to comment.