private void Application_Startup(object sender, StartupEventArgs e) { log.Info("Application Starting"); log.Info(String.Format("Using config file : {0}", configFile)); log.Info("----------------------------------------------------"); //Get the config file log.Debug("Setup configuration"); SystemConfig systemConfig = new SystemConfig(configFile); //Set up all the objects and delegates necesary to run the program log.Debug("Setup objects"); _physicalLayer = new PhysicalLayer(systemConfig.getDeviceConfig()); LogicalLayer logicalLayer = new LogicalLayer(_physicalLayer); _physicalLayer.setDelegate(logicalLayer); _uiHandle = new UIHandle_LLSL(logicalLayer); _sequencerLayer = new SequencerLayer(_uiHandle, logicalLayer, systemConfig.getSequencerConfig()); //Setup main window log.Debug("Setup main window"); MainWindow wnd = new MainWindow(); logicalLayer.setUIDelegate(wnd); _sequencerLayer.setUIDelegate(wnd); wnd.setDelegate(_uiHandle); wnd.Show(); }
/// <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(); }