void ShowPhosResults() { if (_camPhosResults.Images.Count > 0) { var ts = _timestamps.Pop(); var sm = _statusVM.Messages.Where(s => s.Timestamp == ts).First(); _statusVM.Messages.Remove(sm); _statusVM.Busy--; DateTime timestamp = DateTime.Now; var sts = new StatusMessage { Timestamp = timestamp, Message = "Phosphorescence measurement completed." }; _statusVM.Messages.Add(sts); _timestamps.Push(timestamp); imgs_PHOS = _camPhosResults.Images.Select(p => p.Image).ToList(); SaveData(imgs_PHOS, "_PHOS.bmp"); _analyzerVM.AddResults(ref imgs_PHOS, ResultsType.PHOS); _resultVM.LoadCameraImages(_camPhosResults); _mainVM.TabIndex = 1; } else { MessageBox.Show("Failed to collect all data", "Error"); } if (!Arduino.End()) { MessageBox.Show("Serial Port", "Error"); } }
void Close() { if (_ArduinoConnected) { Arduino.End(); } }
void DeepUVFluorescenceCompleteCallback(object sender, object result) { _measurementMode = MEASUREMENT_MODE.NONE; //MessageBox.Show("Please turn off the Deep UV", "Deep Off"); // TODO: arduino light off if (!Arduino.End()) { MessageBox.Show("Serial Port Error... You may have to reset the camera for next measurement.", "..."); } if (Object.ReferenceEquals(sender.GetType(), _cameraVM.GetType())) { _camPhosActive = false; _camPhosResults = (CamPhosResults)result; } if (!_camPhosActive) { ShowDeepUVFluorescenceResults(); } }