Ejemplo n.º 1
0
 def __init__(self):
     "sets up the configuration and the logger"
     self.logger = logging.getLogger("server")
     self.config = config.Config()
     self.config.parse_cmd_line()
     self.server = None
     self.setup_server()
     self.chandler = handle_commands.CommandHandler()
     self.variable_dict = {}
     ttl_conf_file = self.config.get_str("SERVER", "DIO_configuration_file")
     self.dds_count = self.config.get_int("SERVER", "DDS_count")
     # Extracts the channel names and numbers from the configuration file written by QFP
     self.ttl_dict = self.config.get_digital_channels(ttl_conf_file)
     self.setup_dac()  # DAC
     self.segfalle = None
Ejemplo n.º 2
0
def set_transition(transition_name, name_str="729"):
    """Sets the frequency modifiers of the transition
    For configuration see config/rf_setup.py

    DOES not generate a new transition"""
    global transitions
    assert type(transition_name)==str, \
        "set_transition needs string identifier for transition"
    my_config = config.Config()
    [offset, multiplier] = my_config.get_rf_settings(name_str)
    try:
        transitions[transition_name].set_freq_modifier(multiplier, offset)
        logger.debug("setting transition: " +
                     str(transitions[transition_name]))
    except KeyError:
        raise RuntimeError("Error while setting transition" +
                           str(transition_name))
Ejemplo n.º 3
0
    def __init__(self, chandler, dds_count=1, ttl_dict=None):

        # The command handler
        self.chandler = chandler
        # The sequencer and the API
        self.sequencer = sequencer.sequencer()
        self.api = api.api(self.sequencer, ttl_dict)
        # Load the configuration
        self.config = config.Config()
        self.logger = logging.getLogger("server")
        self.seq_directory = self.config.get_str("SERVER", "sequence_dir")
        self.is_nonet = self.config.is_nonet()
        # Instnciate the IncludeHandler
        include_dir = self.config.get_str("SERVER", "include_dir")
        self.include_handler = IncludeHandler(include_dir)
        # The Return string
        global return_str
        return_str = ""
        # Configure the DDS devices
        self.api.dds_list = []
        ref_freq = self.config.get_float("SERVER", "reference_frequency")
        clk_div = self.config.get_float("SERVER", "clk_divider")
        for dds_addr in range(dds_count):
            self.api.dds_list.append(ad9910.AD9910(dds_addr, ref_freq,
                                                   clk_div))
        # Set the parameters for the
        self.pulse_program_name = ""
        self.final_array = []
        self.busy_ttl_channel = self.config.get_str("SERVER",
                                                    "busy_ttl_channel")
        self.qfp_trigger_value = self.config.get_int("SERVER",
                                                     "qfp_trigger_value")
        self.line_trigger_value = self.config.get_int("SERVER",
                                                      "line_trigger_value")

        self.sequence_parser = sequence_parser.parse_sequence
Ejemplo n.º 4
0
# -*- mode: Python; coding: latin-1 -*-
# Time-stamp: "12-Jan-2010 12:13:17 c704215"

#  file       instruction_handler.py
#  copyright  (c) Philipp Schindler 2008
#  url        http://pulse-sequencer.sf.net
"""Defines the high level instructions which are used by
functions in user_fucntion.py"""

from transitions import ShapeForms
from sequencer2 import config

import logging
import copy

GLOBAL_CONFIG = config.Config()
GLOBAL_REFERENCE = GLOBAL_CONFIG.get_float("SERVER", "reference_frequency")
GLOBAL_CLK_DIVIDER = GLOBAL_CONFIG.get_float("SERVER", "clk_divider")

GLOBAL_CONFIG.get_all_dict("Durations")
GLOBAL_GET_DURATION = GLOBAL_CONFIG.get_float_dict_val


class SeqInstruction:
    "Base class used for all intructions"
    duration = 0.0
    start_time = 0.0
    cycle_time = 1 / GLOBAL_REFERENCE * GLOBAL_CLK_DIVIDER
    get_hardware_duration = GLOBAL_GET_DURATION
    is_last = False
    is_added = False
Ejemplo n.º 5
0
    def open_last(self):
        my_config = config.Config()
        filename = my_config.get_str("LOGGING", "log_filename")

        filename = filename.strip() + "_all.log.1"
        self.get_file(filename)