/// <summary>Initializes a new instance of the <see cref="InstrumentDataList"/> class.</summary> public InstrumentDataList(IInstrumentInfo instrumentInfo, long instrumentsMap) { if (instrumentInfo == null) { throw new ArgumentNullException("instrumentInfo"); } Init(instrumentInfo.GetInstrumentName, instrumentsMap); }
/// <summary>Initializes the data with all instruments available ordered by name.</summary> public void Init(IInstrumentInfo instrumentInfo) { if (instrumentInfo == null) { throw new ArgumentNullException("instrumentInfo"); } long instrumentsMap = instrumentInfo.InstrumentMap; Init(instrumentInfo.GetInstrumentName, instrumentsMap); SortByName(); }
public string GetReportText(IInstrumentInfo instrumentInfo, long instrumentsMap) { if (instrumentInfo == null) { throw new ArgumentNullException("instrumentInfo"); } const string sprt = "\t"; StringBuilder sb = new StringBuilder(); sb.AppendLine("Driver " + sprt + Id); sb.AppendLine("Description" + sprt + Description); sb.AppendLine("IsSimulated" + sprt + Demo.IsSimulated.ToString()); sb.AppendLine("Firmware Version" + sprt + Demo.FirmwareVersion); sb.AppendLine("Serial Number" + sprt + Demo.SerialNo); sb.AppendLine("USB Address" + sprt + Demo.FirmwareUsbAddress); sb.AppendLine(); AddReportDevice(sb, sprt, Demo); sb.AppendLine("Name" + sprt + Demo.Name); sb.AppendLine(); AddReportDevice(sb, sprt, Heater); sb.AppendLine("Product Description" + sprt + Heater.ProductDescription); sb.AppendLine(); AddReportDevice(sb, sprt, Detector); sb.AppendLine("Property B" + sprt + Detector.ChannelsNumber.ToString(CultureInfo.InvariantCulture)); InstrumentDataList instruments = new InstrumentDataList(instrumentInfo, instrumentsMap); if (instruments.Count > 1) { string instrumentsText = instruments.GetNames(); AddReportParam(sb, sprt, "Shared in instruments", instrumentsText); } sb.AppendLine(); string result = sb.ToString(); return(result); }
public void Init(IInstrumentInfo instrumentInfo, string userText = null, int minInstruments = 0, int maxInstruments = 2) { if (instrumentInfo == null) { throw new ArgumentNullException("instrumentInfo"); } if (minInstruments < 0) { throw new ArgumentException("minInstruments cannot be < 0"); } if (maxInstruments > InstrumentData.MaxInstrumentCount) { throw new ArgumentException("maxInstruments cannot be > " + InstrumentData.MaxInstrumentCount.ToString()); } m_InstrumentInfo = instrumentInfo; m_LabelUserText.Text = userText; m_RequiredMinInstruments = minInstruments; m_RequiredMaxInstruments = maxInstruments; m_Instruments.Init(m_InstrumentInfo); }
private async void AcquireClick(object sender, RoutedEventArgs e) { if (_clientContext == null) { await ConnectAsync(); } ICollectionResult <IInstrumentInfo> instruments = await _clientContext.GetInstrumentsAsync(); IInstrumentInfo instrument = instruments.Items.First(); ISampleInfo sampleInfo = await _clientContext.AcquireSampleAsync(instrument.Id, new ExtendedSampleAcquisitionOptions { DarkSampleOptions = DarkSampleOptions.NewDark, IntegrationTime = TimeSpan.Parse(IntegrationTimeTextBox.Text), LaserPower = int.Parse((string)((ComboBoxItem)LaserPowerComboBox.SelectedItem).Content), SampleAverageCount = int.Parse(AverageSamplesText.Text) }); _computationDependencies = await _clientContext.GetComputationDependencyInfoAsync(instrument.Id, sampleInfo); UpdatePlot(); }
/// <summary>Initializes a new instance of the <see cref="InstrumentDataList"/> class. Adds all instruments available ordered by name.</summary> public InstrumentDataList(IInstrumentInfo instrumentInfo) { Init(instrumentInfo); }