re-enabled spreadsheet

This commit is contained in:
2024-05-27 16:21:58 +02:00
parent 90e12fc814
commit 96802c13d3

View File

@ -147,43 +147,43 @@ dilution = Dilution()
################# Stand setup ################## ################# Stand setup ##################
# TODO: requires the stand client, need small howto how to start and configure or let it run all the time # TODO: requires the stand client, need small howto how to start and configure or let it run all the time
#from slic.core.acquisition.spreadsheet import Spreadsheet from slic.core.acquisition.spreadsheet import Spreadsheet
# setup spreadsheet for transmission to stand # setup spreadsheet for transmission to stand
#spreadsheet = Spreadsheet( spreadsheet = Spreadsheet(
# { {
# "Transmission" : attenuator.trans1st, "Transmission" : attenuator.trans1st,
# "Upstream Transmission": upstream_attenuator.trans1st, "Upstream Transmission": upstream_attenuator.trans1st,
# "Energy_setpoint" : undulators, "Energy_setpoint" : undulators,
# "Energy_offset": undulator.energy_offset, "Energy_offset": undulator.energy_offset,
# "TD": diffractometer.td, "TD": diffractometer.td,
# "TRX": diffractometer.tr_x, "TRX": diffractometer.tr_x,
# "TRY": diffractometer.tr_y, "TRY": diffractometer.tr_y,
# "TRXBASE": diffractometer.trx_base, "TRXBASE": diffractometer.trx_base,
# "TRYBASE": diffractometer.try_base, "TRYBASE": diffractometer.try_base,
# "THETA": diffractometer.theta, "THETA": diffractometer.theta,
# "TWOTHETA": diffractometer.twotheta, "TWOTHETA": diffractometer.twotheta,
# "Magnet_X": dilution.x, "Magnet_X": dilution.x,
# "Magnet_Y": dilution.y, "Magnet_Y": dilution.y,
# "Magnet_Z": dilution.z, "Magnet_Z": dilution.z,
# "DilSc_T_plato": dilution.T_plato, "DilSc_T_plato": dilution.T_plato,
# "DilSc_T_pucksensor": dilution.T_pucksensor, "DilSc_T_pucksensor": dilution.T_pucksensor,
# }, },
#
# placeholders=("comment", "sample", "run_usable"), placeholders=("comment", "sample", "run_usable"),
# host="saresc-vcons-02.psi.ch", host="saresc-vcons-02.psi.ch",
# port=9090, port=9090,
#) )
try: try:
from stand.stand_client import Client from stand.client import Client
stand_host = "saresc-vcons-02.psi.ch" stand_host = "saresc-vcons-02.psi.ch"
stand_client = Client(host=stand_host, port=9090) stand_client = Client(host=stand_host, port=9090)
response = stand_client.get() response = stand_client.get()
logger.info("Connected to stand server") logger.info("Connected to stand server")
except Exception as error: except Exception as error:
# catching with a broad net because different connection errors can occur. # catching excpetions with a broad net because different connection errors can occur.
logger.warning(f"Cannot connect to stand server on {stand_host}. Disabling spreadsheet.") logger.warning(f"Cannot connect to stand server on {stand_host}. Disabling spreadsheet.")
spreadsheet = None spreadsheet = None
@ -205,7 +205,7 @@ daq = SFAcquisition(
default_pvs=pvs, default_pvs=pvs,
default_detectors=detectors, default_detectors=detectors,
rate_multiplicator=1, rate_multiplicator=1,
spreadsheet=None, spreadsheet=spreadsheet,
) )