Update Web app startup

This commit is contained in:
arrell_c 2025-02-12 22:32:36 +01:00
parent 66f6423653
commit cfeca59bde

View File

@ -1,10 +1,10 @@
# Startup Options on the Web Server
# Startup options on the web server
Several tools are available on the web server to **initialize and restore camera and spectrometer settings efficiently**. These tools ensure that **EPICS settings match the configurations stored in the camera server**, preventing data acquisition issues due to misconfigurations.
---
## Save and Restore for Camera Settings
## Save and restore for camera settings
SwissFEL cameras **do not** have a built-in save-and-restore function for settings. This tool allows **Basler** and **PCO edge** cameras to be **configured with predefined settings stored in the camera server**.
@ -25,7 +25,7 @@ The tool uses the **`group` field** in the camera configuration to organize came
Other groups **can be added** by modifying the camera configurations.
### Database and Configuration Structure
### Database and configuration structure
The tool retrieves camera settings from configuration files stored on the **camera server**, accessible via **CSM or API**. Settings are stored in a dictionary called **`"hardware_configuration"`**, which contains key-value pairs corresponding to **EPICS process variables (PVs)**.
@ -46,46 +46,46 @@ Each key in `"hardware_configuration"` corresponds to a **PV suffix** for the re
SARFE10-PSSS059:EXPOSURE → 9.9
```
> **Adding New Settings:**
> **Adding new settings:**
To include additional settings for a camera, **edit its configuration file** in the camera server, ensure the `"hardware_configuration"` dictionary is present, and add the required EPICS parameters.
---
## Spectrometer Setup Panel
## Spectrometer setup panel
The **Spectrometer Setup Panel** ensures that **spectrometers operate with the correct EPICS settings** and that the **energy axis is calibrated** to match the cameras current image dimensions.
The **Spectrometer setup panel** ensures that **spectrometers operate with the correct EPICS settings** and that the **energy axis is calibrated** to match the cameras current image dimensions.
### What Happens When a Setup Button is Pressed?
### What happens when a setup button is pressed?
When a **Setup** button is pressed for a spectrometer, the following process takes place:
1. **Retrieve Stored Configuration**
1. **Retrieve stored configuration**
- The system **loads the predefined EPICS settings** from the camera server.
- **Key parameters such as exposure time, binning, and trigger settings are retrieved**.
2. **Prepare the Camera for Update**
2. **Prepare the camera for update**
- The camera is **set to idle mode (`CAMERASTATUS = 1`)** to allow safe modifications.
- The system **waits for the camera to stop acquiring data** before proceeding.
3. **Apply Configuration Settings to EPICS**
3. **Apply configuration settings to EPICS**
- Each stored setting is **written to the corresponding EPICS PV**.
4. **Apply Settings Using `SET_PARAM`**
4. **Apply settings using `SET_PARAM`**
- Once all values are updated, the system **triggers `SET_PARAM`**, instructing the camera to apply the new settings.
5. **Update the Energy Axis Calibration**
5. **Update the energy axis calibration**
- The system **determines the correct energy axis length** based on **camera image width or height**.
- A new **energy axis array** is generated and written to **`SPECTRUM_X`**.
6. **Restore Camera Status**
6. **Restore camera status**
- The system **returns the camera to its original state (`CAMERASTATUS` is restored)** after updating.
7. **User Feedback**
7. **User feedback**
- A **status message** below each button confirms whether the update was **successful** or if an **error occurred**.
---
### When Should These Buttons Be Used?
### When should these buttons be used?
Use these buttons in the following cases:
@ -96,7 +96,7 @@ Use these buttons in the following cases:
---
## Example: Camera and Spectrometer Configuration Process
## Example: Camera and spectrometer configuration process
This example illustrates how settings are applied to an EPICS-controlled camera and spectrometer.
@ -124,7 +124,7 @@ The system then applies `SET_PARAM`, recalibrates the **energy axis**, and **res
---
## User Interface Overview
## User interface overview
Below is a preview of the interface, showing the Camera Settings Panel and Spectrometer Setup Panel: