public SpectraLibraryList( SpectrumLibrary sl)
        {
            InitializeComponent();

            init();

            SetSpectrumLibrary(sl);
        }
        public SpectrumLibraryTVPanel(SpectrumLibrary specLib_)
        {
            InitializeComponent();

            init();

            SetSpectrumLibrary(specLib_);
        }
        public SpectrumEditorTabPage(SpectrumLibrary specLib_)
        {
            InitializeComponent();

            init();

            SetSpectrumLibrary(specLib_);
        }
        public SpectraListListView(SpectrumLibrary spectrumLib_)
            : base()
        {
            InitializeComponent();

            init();

            SetSpectrumLibrary(spectrumLib_);
        }
        public SpectraListListView(SpectrumLibrary spectrumLib_, String category_)
            : base()
        {
            InitializeComponent();

            init();

            SetSpectrumLibrary(spectrumLib_);
            SetCategory(category_);
        }
        private void SetSpectrumLibrary(SpectrumLibrary sl)
        {
            spectrumLib = sl;
            if (sl != null)
            {
                SmallImageList = spectrumLib.ImagesSmall;
                LargeImageList = spectrumLib.ImagesLarge;

                category = "";

                sl.OnSpectrumModified += new SpectrumLibrary.SpectrumModified(sl_OnSpectrumModified);
                sl.OnCategorySpectrumAdded += new SpectrumLibrary.CategorySpectrumAdded(sl_OnCategorySpectrumAdded);

                InvalidateSpectrumLibrary();
            }
            /*
            spectra = sl;

            spectra.OnSpectrumAdded += new SpectrumList.SpectrumAdded(spectra_OnSpectrumAdded);
            spectra.OnSpectrumDeleted += new SpectrumList.SpectrumDeleted(spectra_OnSpectrumDeleted);
            spectra.OnSpectrumModified += new SpectrumList.SpectrumModified(spectra_OnSpectrumModified);
            */
        }
        public void SetLibraryCategory(SpectrumLibrary sl, String category)
        {
            init();

            SetSpectrumLibrary(sl);
            SetCategory(category);
        }
        public void SetSpectrumLibrary(SpectrumLibrary sl)
        {
            tabControl1.TabPages.Clear();

            spectrumLib = sl;
        }
Exemplo n.º 9
0
 public SpectrumLibraryEnumerator(SpectrumLibrary specLib_)
 {
     specLib = specLib_;
     enumCategories = specLib.Categories.Keys.GetEnumerator();
 }
        private void SetSpectrumLibrary(SpectrumLibrary specLib_)
        {
            specLib = specLib_;
            if (specLib != null)
            {
                this.ImageList = specLib.ImagesSmall;

                InvalidateSpectrumLib();

                specLib.OnSpectrumModified += new SpectrumLibrary.SpectrumModified(specLib_OnSpectrumModified);
                specLib.OnSpectrumRemoved += new SpectrumLibrary.SpectrumRemoved(specLib_OnSpectrumRemoved);
                specLib.OnCategorySpectrumAdded += new SpectrumLibrary.CategorySpectrumAdded(specLib_OnCategorySpectrumAdded);
            }
        }
 private void SetSpectrumLibrary(SpectrumLibrary specLib_)
 {
     specLib = specLib_;
     if (specLib != null)
     {
         specLib.OnEditSpectrum += new SpectrumLibrary.EditSpectrum(specLib_OnEditSpectrum);
     }
 }
Exemplo n.º 12
0
        private void SetSpectrumLibrary(SpectrumLibrary specLib)
        {
            spectrumLibrary = specLib;
            sLibTVP.SpectrumLibrary = specLib;

            tcMain.TabPages.Clear();
            AddEditor("[Editor]");
            foreach (String category in specLib.Categories.Keys)
                AddPage(category);
        }
Exemplo n.º 13
0
 private void LibraryOpen()
 {
     ofDlg.Filter = spectraXMLIO.Extensions + "|" + spectraBinIO.Extensions;
     SpectraDiskIO Reader = null;
     if (ofDlg.ShowDialog() == DialogResult.OK)
     {
         if (ofDlg.FilterIndex == 1)
             Reader = spectraXMLIO;
         if (ofDlg.FilterIndex == 2)
             Reader = spectraBinIO;
         if (Reader != null)
         {
             Reader.FileName = ofDlg.FileName;
             Reader.ReadFromDisk();
             SpectrumLibrary specLib = new SpectrumLibrary();
             foreach (Spectrum spec in Reader.Spectra.Spectra)
             {
                 specLib.AddSpectrum(spec);
             }
             SetSpectrumLibrary(specLib);
         }
     }
 }
Exemplo n.º 14
0
 private void LibraryNew()
 {
     SpectrumLibrary specLib = new SpectrumLibrary();
     SetSpectrumLibrary(specLib);
 }
Exemplo n.º 15
0
        private void GenerateTestData()
        {
            SpectrumLibrary specLib = new SpectrumLibrary();
            for (int i = 0; i < 15; i++)
            {
                Spectrum spec = new Spectrum(ESpectrumTemplate.ExtendedVisible);
                spec.AddSpectralPoint(630, 1);
                spec.Name = "Laser: " + (i);
                spec.Interpolation = ESpectralInterpolation.Peak;
                spec.Clear();
                specLib.AddSpectrum(spec, "Laser");
            }

            for (int i = 0; i < 15; i++)
            {
                Spectrum spec = new Spectrum(ESpectrumTemplate.ExtendedVisible);
                spec.AddSpectralPoint(580, 0);
                spec.Name = "Light: " + (i);
                specLib.AddSpectrum(spec, "Light");
            }

            for (int i = 0; i < 15; i++)
            {
                Spectrum spec = new Spectrum(ESpectrumTemplate.ExtendedVisible);
                spec.AddSpectralPoint(580, 0);
                spec.Name = "Material: " + (i);
                specLib.AddSpectrum(spec, "Materials");
            }

            SetSpectrumLibrary(specLib);
        }