Пример #1
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     DyeListBLL.ReadInitDye();
     try
     {
         if (!OmniProvider.isSimulate)
         {
             if (OmniProvider.OpenSpectrometers() > 0)
             {
                 OmniProvider.OpenSerialPort();
                 OmniProvider.SendCommand("ZZ", false);
                 OmniProvider.GetWaveLengthsList();//获得波长
                 OmniProvider.GetParameters();
             }
             else
             {
                 MessageBox.Show("Connect fail.未找到光谱仪");
                 Functions.CommnucationLog("Connect fail.未找到光谱仪");
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Connect fail." + ex.Message);
         Functions.CommnucationLog("Connect fail." + ex.Message);
     }
 }
Пример #2
0
        private void btnMeasure_Click(object sender, RoutedEventArgs e)
        {
            if (mQCData != null)
            {
                OmniProvider.GetMeasureList(mGPIOMove);
                mQCData.Add(OmniProvider.GetAbs(350, mGPIOMove));
                txtCurrent.Text  = mQCData.Last().ToString(mFormatDouble);
                txtAverage.Text  = mAverage.ToString(mFormatDouble);
                txtMaximum.Text  = mMax.ToString(mFormatDouble);
                txtMinimum.Text  = mMin.ToString(mFormatDouble);
                txtErrorMax.Text = mErrorMax.ToString(mFormatDouble);
                txtSTD.Text      = mSD.ToString(mFormatDouble);

                DiagnosticsModel model = new DiagnosticsModel()
                {
                    Current  = txtCurrent.DoubleNumber,
                    Average  = txtAverage.DoubleNumber,
                    Maximum  = txtMaximum.DoubleNumber,
                    Minimum  = txtMinimum.DoubleNumber,
                    ErrorMax = txtErrorMax.DoubleNumber,
                    STD_DEV  = txtSTD.DoubleNumber,
                    Target   = txtTarget.DoubleNumber
                };
                mDataList.Add(model);
            }
        }
Пример #3
0
        public void Measure()
        {
            GlobalProvider.CurrentMove = MoveEnum.Move0_5mm;
            GlobalProvider.MarkOrder   = 0;
            Wavelength_AbsModel wave_abs = null;
            MeasureDataModel    model    = null;

            OmniProvider.GetMeasureList(GlobalProvider.CurrentMove);

            schart.ShowData(OmniProvider.GetWavelengths(200, 800), OmniProvider.CalcY(GlobalProvider.CurrentMove), 200, 0, 800, 2, true);

            mSampleTimes++;
            txtTimes.Text = mSampleTimes.ToString();
            if (dgdWavelength_Abs.SelectedItem != null)
            {
                wave_abs     = dgdWavelength_Abs.SelectedItem as Wavelength_AbsModel;
                wave_abs.Abs = OmniProvider.GetAbs(wave_abs.Wavelength, GlobalProvider.CurrentMove);
            }
            if (wave_abs != null)
            {
                model = new MeasureDataModel()
                {
                    SampleID        = txtSampleID.Text,
                    SampleTestTimes = mSampleTimes,
                    Wavelength      = wave_abs.Wavelength,
                    Abs             = wave_abs.Abs,
                    BlankList       = OmniProvider.BlankList[GlobalProvider.MarkOrder],
                    MeasureList     = OmniProvider.MeasureList[GlobalProvider.MarkOrder],
                    WaveList        = OmniProvider.WaveList
                };
                DataList.Add(model);
            }
        }
Пример #4
0
        public void Measure()
        {
            double k      = 2;
            double b      = txtTypeValue.DoubleNumber;
            double abs260 = 0;
            double abs280 = 0;

            GlobalProvider.CurrentMove = MoveEnum.Move0_5mm;
            GlobalProvider.MarkOrder   = 0;

            OmniProvider.GetMeasureList(GlobalProvider.CurrentMove);


            schart.ShowData(OmniProvider.GetWavelengths(220, 360), OmniProvider.CalcY(GlobalProvider.CurrentMove), 220, 0, 360, 2, true);


            mSampleTimes++;
            txtTimes.Text = mSampleTimes.ToString();
            abs260        = OmniProvider.GetAbs(260, GlobalProvider.CurrentMove);

            if (abs260 < 2)
            {
                txtConc.Text = (Math.Log10(abs260) * k * b).ToString();
            }
            else
            {
                GlobalProvider.CurrentMove = MoveEnum.Move0_2mm;
                GlobalProvider.MarkOrder   = 1;
                k = 5;
                OmniProvider.GetMeasureList(GlobalProvider.CurrentMove);
                abs260       = OmniProvider.GetAbs(260, GlobalProvider.CurrentMove);
                txtConc.Text = (Math.Log10(abs260) * k * b).ToString(GlobalProvider.ConcFormat);
            }
            txtSwAbs.Text   = OmniProvider.GetAbs(260, GlobalProvider.CurrentMove).ToString(GlobalProvider.AbsFormat);
            abs260          = OmniProvider.GetAbs(260, GlobalProvider.CurrentMove);
            abs280          = OmniProvider.GetAbs(280, GlobalProvider.CurrentMove);
            txt260Abs.Text  = abs260.ToString(GlobalProvider.AbsFormat);
            txt280Abs.Text  = abs280.ToString(GlobalProvider.AbsFormat);
            txt260_280.Text = (abs260 / abs280).ToString(GlobalProvider.AbsFormat);
            txt260_230.Text = (abs260 / OmniProvider.GetAbs(230, GlobalProvider.CurrentMove)).ToString(GlobalProvider.AbsFormat);

            MeasureDataModel model = new MeasureDataModel()
            {
                SampleID        = txtSampleID.Text,
                SampleTestTimes = mSampleTimes,
                SWnm            = double.Parse(txtSW.Text),
                A260            = OmniProvider.GetAbs(260, GlobalProvider.CurrentMove),
                A230            = OmniProvider.GetAbs(230, GlobalProvider.CurrentMove),
                A280            = OmniProvider.GetAbs(280, GlobalProvider.CurrentMove),
                BlankList       = OmniProvider.BlankList[GlobalProvider.MarkOrder],
                MeasureList     = OmniProvider.MeasureList[GlobalProvider.MarkOrder],
                Conc            = double.Parse(txtConc.Text),
                Unit            = "ng/ul",
                WaveList        = OmniProvider.WaveList
            };

            DataList.Add(model);
        }
Пример #5
0
 private void schart_ChangeSetWaveEvent(Point pointValue)
 {
     txtWaveLength.Text = pointValue.X.ToString();
     if (mLightList != null)
     {
         txtCurrentLight.Text = OmniProvider.GetMeasureLight(280, mLightList).ToString(GlobalProvider.FormatNumber);
         txtAverageLight.Text = mAverageLight.ToString("f2");
     }
 }
Пример #6
0
        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            txtMark1.Text = OmniProvider.GetMark(1).ToString();
            txtMark2.Text = OmniProvider.GetMark(2).ToString();
            txtMark3.Text = OmniProvider.GetMark(3).ToString();


            txtBoxcarWidth.Text      = OmniProvider.BoxcarWidth.ToString();
            txtScansToAverage.Text   = OmniProvider.ScansToAverage.ToString();
            txtIntergrationTime.Text = OmniProvider.InterationTime.ToString();
        }
Пример #7
0
 private void txtSW_TextChanged(object sender, TextChangedEventArgs e)
 {
     if (txtSW.Text != "" && txtSwAbs != null)
     {
         double bestWaveSet = OmniProvider.GetBestWaveLength(double.Parse(txtSW.Text));
         if (bestWaveSet > 0)
         {
             txtSwAbs.Text = OmniProvider.GetAbs(bestWaveSet, GlobalProvider.CurrentMove).ToString(GlobalProvider.AbsFormat);
             schart.SetWave(double.Parse(txtSW.Text));
         }
     }
 }
Пример #8
0
        public void Measure()
        {
            double k      = 2;
            double b      = (cboType.SelectedItem as NucleicAcidTypeModel).TypeValue;
            double abs260 = 0;
            double abs280 = 0;

            GlobalProvider.CurrentMove = MoveEnum.Move0_5mm;
            GlobalProvider.MarkOrder   = 0;

            OmniProvider.GetMeasureList(GlobalProvider.CurrentMove);

            schart.ShowData(OmniProvider.GetWavelengths(220, 340), OmniProvider.CalcY(GlobalProvider.CurrentMove), 220, 0, 340, 2, true);

            mSampleTimes++;
            txtTimes.Text = mSampleTimes.ToString();
            abs260        = OmniProvider.GetAbs(260, GlobalProvider.CurrentMove);

            if (abs260 < 2)
            {
                txtConc.Text = (Math.Log10(abs260) * k * b).ToString();
            }
            else
            {
                GlobalProvider.CurrentMove = MoveEnum.Move0_2mm;
                GlobalProvider.MarkOrder   = 1;
                k = 5;
                OmniProvider.GetMeasureList(GlobalProvider.CurrentMove);
                abs260       = OmniProvider.GetAbs(260, GlobalProvider.CurrentMove);
                txtConc.Text = (Math.Log10(abs260) * k * b).ToString();
            }
            abs260       = OmniProvider.GetAbs(260, GlobalProvider.CurrentMove);
            abs280       = OmniProvider.GetAbs(280, GlobalProvider.CurrentMove);
            txtA280.Text = abs280.ToString("f2");

            txt260_280Abs.Text = (abs260 / abs280).ToString("f2");

            MeasureDataModel model = new MeasureDataModel()
            {
                SampleID        = txtSampleID.Text,
                SampleTestTimes = mSampleTimes,
                A260            = OmniProvider.GetAbs(260, GlobalProvider.CurrentMove),
                A280            = OmniProvider.GetAbs(280, GlobalProvider.CurrentMove),
                BlankList       = OmniProvider.BlankList[GlobalProvider.MarkOrder],
                MeasureList     = OmniProvider.MeasureList[GlobalProvider.MarkOrder],
                Conc            = double.Parse(txtConc.Text),
                WaveList        = OmniProvider.WaveList
            };

            DataList.Add(model);
        }
Пример #9
0
        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                OmniProvider.GetParameters();
                schart.CreateCoordinate(100, 900, 0, 70000);
                datWave_Light.ItemsSource = mDataList;
                mSetWaveLength_LightList.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(mLightList_CollectionChanged);

                txtBoxcarWidth.Text      = OmniProvider.BoxcarWidth.ToString();
                txtScansToAverage.Text   = OmniProvider.ScansToAverage.ToString();
                txtIntergrationTime.Text = OmniProvider.InterationTime.ToString();
            }
            catch (Exception ex)
            {
                Functions.LOG("check load" + ex.Message);
            }
        }
Пример #10
0
        private void Mark_Click(object sender, RoutedEventArgs e)
        {
            Button btn = sender as Button;

            switch (btn.Content.ToString())
            {
            case "SaveMark1":
                OmniProvider.SaveMark(1, txtMark1.IntNumber);
                OmniProvider.GoMark(1);
                break;

            case "SaveMark2":
                OmniProvider.SaveMark(2, txtMark2.IntNumber);
                OmniProvider.GoMark(2);
                break;

            case "SaveMark3":
                OmniProvider.SaveMark(3, txtMark3.IntNumber);
                OmniProvider.GoMark(3);
                break;
            }
        }
Пример #11
0
        private void btnCheck_Click(object sender, RoutedEventArgs e)
        {
            if (txtWaveLength.Text != "")
            {
                OmniProvider.ScansToAverage = txtScansToAverage.IntNumber;
                OmniProvider.BoxcarWidth    = txtBoxcarWidth.IntNumber;
                OmniProvider.InterationTime = txtIntergrationTime.IntNumber;

                mLightList = OmniProvider.GetSpectrum();
                schart.ShowData(OmniProvider.GetWavelengths(100, 900), mLightList, 100, 200, 900, 10000, true);

                txtCurrentLight.Text = OmniProvider.GetMeasureLight(txtWaveLength.DoubleNumber, mLightList).ToString("f2");
                mSetWaveLength_LightList.Add(txtCurrentLight.DoubleNumber);
                txtAverageLight.Text = mAverageLight.ToString("f2");

                mDataList.Add(new CheckLightModel()
                {
                    WaveLength       = txtWaveLength.DoubleNumber,
                    CurrentLight     = txtCurrentLight.DoubleNumber,
                    AverageLight     = txtAverageLight.DoubleNumber,
                    ScansToAverage   = txtScansToAverage.DoubleNumber,
                    BoxcarWidth      = txtBoxcarWidth.DoubleNumber,
                    IntergrationTime = txtIntergrationTime.DoubleNumber,
                    A230             = OmniProvider.GetMeasureLight(230, mLightList),
                    A260             = OmniProvider.GetMeasureLight(260, mLightList),
                    A280             = OmniProvider.GetMeasureLight(280, mLightList),
                    A290             = OmniProvider.GetMeasureLight(290, mLightList),
                    A350             = OmniProvider.GetMeasureLight(350, mLightList),
                    A500             = OmniProvider.GetMeasureLight(500, mLightList),
                    A750             = OmniProvider.GetMeasureLight(750, mLightList)
                });
            }
            else
            {
                MessageBox.Show("no wavelength");
            }
        }
Пример #12
0
 public void Blank()
 {
     OmniProvider.GetBlankList(MoveEnum.Move0_5mm);
 }
Пример #13
0
 //保存参数
 private void btnSave_Click(object sender, RoutedEventArgs e)
 {
     OmniProvider.SetParameters(txtScansToAverage.IntNumber, txtBoxcarWidth.IntNumber, txtIntergrationTime.IntNumber);
 }
Пример #14
0
 private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     OmniProvider.CloseAllSpectrometers();
 }
Пример #15
0
 private void btnBlank_Click(object sender, RoutedEventArgs e)
 {
     OmniProvider.GetBlankList(mGPIOMove);
     ClearData();
 }