from pygenie.init import _make_initialized _make_initialized() from pygenie.utils import extract_defines, hex_int from pygenie.init import S560_PATH pars = extract_defines(S560_PATH / 'CAMPDEF.H', prefix="CAM_", required_names=[], value_mapper=hex_int) print(len(pars))
import enum import re from pygenie.init import _make_initialized; _make_initialized() from pygenie.init import S560_PATH from pygenie.utils import extract_defines DEFINE_REGEXP = r"\#define\s+(?P<symbol>[^\s]+)\s+(?P<value>[^\s]+)\s+" # with rc.open() as f: # for m in re.finditer(DEFINE_REGEXP, f.read()): # print(m.group("symbol") + " " + m.group("value"))
import numpy as np from pygenie import init init._make_initialized() from pygenie.lib import check_for_error from pygenie.lib.params._par_type import PARAM_GENERATOR, Parameter, ParamAliasBase class ParamAlias(ParamAliasBase): NUMBER_OF_CHANNELS = "L_CHANNELS" TIME_LIVE = "X_ELIVE" TIME_REAL = "X_EREAL" class SampleDescription(ParamAliasBase): TITLE = "T_STITLE" ID = "T_SIDENT" DESCRIPTION = PARAM_GENERATOR.get_serial_parametr("T_SDESC{}") MEASURE_START_TIME = "X_ASTIME" class EnergyCalibration(ParamAliasBase): TYPE = "T_ECALTYPE" UNIT = "T_ECALUNITS"