public SelectionDataPresenter(SelectAreaActionPresenter presenter, int imgsNumberInNormalization) { m_actionPresenter = presenter; m_pixelsFormat = m_actionPresenter.PixFormat; m_counterB = 0; m_counterCO = 0; m_counterEx = 0; m_numberOfImagesInNormalization = imgsNumberInNormalization; m_bckgroundBytes = new List <byte[]>(m_numberOfImagesInNormalization); m_coBytes = new List <byte[]>(m_numberOfImagesInNormalization); m_experDataBytes = new List <byte[]>(m_numberOfImagesInNormalization); m_experDataShutter = new List <float>(m_numberOfImagesInNormalization); m_coShutter = new List <float>(m_numberOfImagesInNormalization); m_bckgroundShutter = new List <float>(m_numberOfImagesInNormalization); m_correctRaio = m_etalonConcentration = m_currentConcentration = 0; m_areCODataFilling = false; m_areBckGroundDataFilling = false; }
public void AddSelectAction(Point cursorPosition, double videoStreamAreaActualHeight, double videoStreamActualWidth, int imagesNumberInNormalization) { SelectAreaActionPresenter ap = new SelectAreaActionPresenter(PossibleActionPresenters.AreaSelection.ToString(), cursorPosition, videoStreamAreaActualHeight, videoStreamActualWidth); InitializeActionPresenter(ap); m_selectDataPresenter = new SelectionDataPresenter(ap, imagesNumberInNormalization); m_selectDataPresenter.CurrentConcentrationChanged += (sender, e) => { SelectionDataPresenter dp = sender as SelectionDataPresenter; if (dp != null) { m_calculationsViewModel.CurrentCancentrationValue = Math.Round(dp.CurrentConcentration, 3); } }; }
private void GetBckGroundDataFromPresenter(object sender, EventArgs e) { SelectAreaActionPresenter presenter = sender as SelectAreaActionPresenter; if (m_counterB < m_numberOfImagesInNormalization) { m_bckgroundBytes.Add(presenter.CurrentBytes); m_bckgroundShutter.Add(presenter.CurrentShutter); m_counterB++; } else { presenter.CurrentBytesUpdated -= GetBckGroundDataFromPresenter; m_counterB = 0; m_areBckGroundDataFilling = false; } }
private void GetExperimentalDataFromPresenter(object sender, EventArgs e) { SelectAreaActionPresenter presenter = sender as SelectAreaActionPresenter; if (m_counterEx < m_numberOfImagesInNormalization) { m_experDataBytes.Add(presenter.CurrentBytes); m_experDataShutter.Add(presenter.CurrentShutter); m_counterEx++; } else { //presenter.CurrentBytesUpdated -= GetExperimentalDataFromPresenter; m_counterEx = 0; CalcCurrentConc(); m_experDataBytes.Clear(); m_experDataShutter.Clear(); } }
private void GetCODataFromPresenter(object sender, EventArgs e) { SelectAreaActionPresenter presenter = sender as SelectAreaActionPresenter; if (m_counterCO < m_numberOfImagesInNormalization) { m_coBytes.Add(presenter.CurrentBytes); m_coShutter.Add(presenter.CurrentShutter); m_counterCO++; } else { presenter.CurrentBytesUpdated -= GetCODataFromPresenter; m_counterCO = 0; m_areCODataFilling = false; CalcCorrectRatio(); DoExperCalculation(); } }