示例#1
0
        private void UpdateSpectrometerList()               // update combobox with available sepctrometers
        {
            string[] specs = new string[100];               // generate helper string, lenght 100 check for better solution

            wrapper.closeAllSpectrometers();                // close all spectrometer has to be called befor open, see API Docs
            wrapper.openAllSpectrometers();
            numberOfSpectrometers = wrapper.getNumberOfSpectrometersFound();

            if (numberOfSpectrometers != 0)                 // populate combobox
            {
                for (int i = 0; i < numberOfSpectrometers; i++)
                {
                    specs[i] = wrapper.getFirmwareModel(i);
                }
                comboBoxSpectrometer.DataSource    = specs;
                comboBoxSpectrometer.SelectedIndex = 0;
                selectedSpectrometer = 0;
            }
            else
            {
                MessageBox.Show("No Spectrometers attached");
            }
        }