Пример #1
0
 /// <summary>
 /// Creates a new sequencer with a reference to the UIHandle and logicalLayer objects
 /// This object is responsible for organizing the timing of all events
 /// </summary>
 /// <param name="inUIHandler">Reference to the UIHandler</param>
 /// <param name="inLogicalLayer">Reference to the logical layer</param>
 public SequencerLayer(UIHandle_LLSL inUIHandler, LogicalLayer inLogicalLayer, SequencerConfig inSequencerConfig)
 {
     log.Debug(string.Format("Creating sequencer:{0} with logicalLayer:{1} and UIHandler:{2}", this, inLogicalLayer, inUIHandler));
     _uiHandler       = inUIHandler;
     _logicalLayer    = inLogicalLayer;
     _shouldStop      = false;
     _sequencerConfig = inSequencerConfig;
     startSequencerThreads();
 }
Пример #2
0
        /// <summary>
        /// Creates a new SystemConfig object to hold all the configuration
        /// objects for the entire system
        /// </summary>
        /// <param name="inCOnfigFilePath">Path to the systems configuration file</param>
        public SystemConfig(string inConfigFilePath)
        {
            log.Debug(String.Format("Entering SystemConfig with config file: {0}", inConfigFilePath));
            if (File.Exists(inConfigFilePath))
            {
                log.Debug(String.Format("Loading config file: {0}", inConfigFilePath));
                string  fileText         = File.ReadAllText(inConfigFilePath);
                JObject j                = JObject.Parse(fileText);
                string  deviceConfigJSON = j[JSONKeys.DEVICE_KEY].ToString();
                log.Debug(String.Format("Retrieved device json string : {0}", deviceConfigJSON));
                _deviceConfig = new DeviceConfig(deviceConfigJSON);

                string sequencerConfigJSON = j[JSONKeys.SEQUENCER_SEQUENCERS].ToString();
                log.Debug(string.Format("Retrieved sequencer json string {0}", sequencerConfigJSON));
                _sequencerConfig = new SequencerConfig(sequencerConfigJSON);
            }
            else
            {
                log.Fatal(String.Format("Could not open config file {0}.  Throwing exception", inConfigFilePath));
                throw new IOException();
            }
        }