Skip to content

Install and config

Dardo edited this page Mar 31, 2025 · 1 revision

Installation Guide

Prerequisites

Before installing, ensure you have the following dependencies installed:

  • Python 3.12 or later
  • Git
  • Virtualenv or Conda (recommended)

Cloning the Repository

To install the project, clone the repository using:

git clone https://github.com/darderik/WASIC.git
cd WASIC

Setting Up the Environment

It is recommended to use a virtual environment to manage dependencies. You can set it up using either virtualenv or conda:

Using Virtualenv

python3 -m venv venv
source venv/bin/activate  # On Windows use: venv\Scripts\activate
pip install -r requirements.txt

Using Conda

conda create --name wasic_env python=3.8
conda activate wasic_env
pip install -r requirements.txt

Configuration

The software relies on a config.json file to define the main settings for instrument handling, data storage, and logging. Below is an explanation of each key present in the configuration file:

instr_aliases

This key holds a list of alias keywords that are used to filter the instruments being added to the system. If an instrument’s identifier does not match any of the aliases, it will not be considered. This mechanism prevents unwanted or unknown instruments from being included in the system. Note that these aliases do not uniquely identify a device, nor do they control its connection parameters.

Example:

"instr_aliases": [
    "Raspberry",
    "Model 2000",
    "Relay Matrix"
]

communication_mode

Defines the communication method used to interact with instruments. The system primarily supports pyvisa, while serial is available for backward compatibility. The pyvisa mode has been extensively tested, while serial has limited testing.

Allowed values:

  • pyvisa (recommended, fully supported)
  • serial (legacy, limited testing)

Example:

"communication_mode": "pyvisa"

instrument_connections_datapath

Specifies the file path where instrument connection data is stored. This file is dynamically updated by the user interface to persist instrument connections, avoiding the need to fetch and add all instruments again manually after restarting the application.

Example:

"instrument_connections_datapath": "data/instr/instruments.json"

data_charts_path

Indicates the directory where chart data is stored. This path is static and cannot be modified at runtime. Graphs generated from instrument data are saved in this location.

Example:

"data_charts_path": "data/charts"

default_timeout

Sets the default timeout (in seconds) for serial and SCPI operations. This value determines the maximum waiting time before a communication attempt fails.

Example:

"default_timeout": 0.5

init_properties_types

Defines the list of instrument classes that expose properties accessible through the web interface. If an instrument's type is included in this list, the web app will allow users to view and modify its properties. If a type is missing from this list, the instrument’s properties will not be displayed.

Example:

"init_properties_types": [
    "NV34420",
    "K2000",
    "RaspberrySIM"
]

log_level

Specifies the logging level for the application. This setting follows standard Python logging levels and can be adjusted to control the verbosity of logs.

Allowed values:

  • DEBUG
  • INFO
  • WARNING
  • ERROR
  • CRITICAL

Example:

"log_level": "INFO"

By properly configuring the config.json file, users can tailor the system’s behavior to match their needs, ensuring efficient instrument control, data persistence, and logging management.

Running the Application

Once installed, you can launch the application using:

python3 main.py

If using a virtual environment, make sure it is activated before running the command.

Clone this wiki locally