public FusionBridge(string debugMzML, string logDir, bool showConsoleLogs) { Logs = new List <string>(); LogDir = logDir; ShowConsoleLogs = showConsoleLogs; IFusionInstrumentAccessContainer fusionContainer = null; if (!String.IsNullOrEmpty(debugMzML)) // create fake Fusion container that reads from mzML file { WriteLog("FusionBridge constructor called in debug mode"); WriteLog(string.Format("Reading scans from {0}", debugMzML)); fusionContainer = new MzMLFusionContainer(debugMzML); } else // needs license to connect to the real instrument { //// Use the Factory creation method to create a Fusion Access Container WriteLog("FusionBridge constructor called"); fusionContainer = getIFusionInstrumentAccessContainer(); } // Connect to the service by going 'online' fusionContainer.StartOnlineAccess(); // Wait until the service is connected // (better through the event, but this is nice and simple) while (!fusionContainer.ServiceConnected) { ; } // From the instrument container, get access to a particular instrument InstrumentAccess = fusionContainer.Get(1); ScanContainer = InstrumentAccess.GetMsScanContainer(0); WriteLog("Detector class: " + ScanContainer.DetectorClass); // Dump key-value pairs in cs.Values WriteLog("Custom scan parameters: "); InstrumentControl = InstrumentAccess.Control; ScanControl = InstrumentControl.GetScans(false); ICustomScan cs = ScanControl.CreateCustomScan(); foreach (KeyValuePair <string, string> kvp in cs.Values) { string kvpString = string.Format("- cs.Values\tKey = {0}, Value = {1}", kvp.Key, kvp.Value); WriteLog(kvpString); } // Print instrument state WriteLog("FusionBridge constructor initialised"); IState state = InstrumentControl.Acquisition.State; string msg = string.Format("System mode = {0}, system state = {1}", state.SystemMode, state.SystemState); WriteLog(msg); }
private void cbxStudentID_SelectedIndexChanged(object sender, EventArgs e) { Student s = new Student(); s = rentingStudents[cbxStudentID.SelectedIndex]; InstrumentAccess iDb = new InstrumentAccess(Db); List <Instrument> instruments = new List <Instrument>(); instruments = iDb.getInstrumentsByType(s.StudentInstrument); foreach (Instrument i in instruments) { cbxInstrumentID.Items.Add(i.InstrumentID + " - " + i.InstrumentName); } }