internal void OnUnsuccessfulCalibration(CalibrationContext context, PlateCalibration plateCalibration) { m_PlateToReport = null; try { string tempFilename = Path.GetTempFileName(); plateCalibration.SaveContext(tempFilename); string zippedFileName = Path.GetFullPath(tempFilename + ".zip"); ZipUnzip.Zip(tempFilename, zippedFileName); m_PlateToReport = File.ReadAllBytes(zippedFileName); File.Delete(tempFilename); File.Delete(zippedFileName); } catch (Exception ex) { Trace.WriteLine(ex); } if (m_PlateToReport != null) { double mbSize = m_PlateToReport.Length * 1.0 / (1024 * 1024); btnSendProblemFit.Text = string.Format("Report Unsolved Plate ({0} Mb)", mbSize.ToString("0.00")); btnSendProblemFit.Visible = true; } }
internal void OnUnsuccessfulCalibration(CalibrationContext context, PlateCalibration plateCalibration) { m_PlateToReport = null; try { string tempFilename = Path.GetTempFileName(); plateCalibration.SaveContext(tempFilename); string zippedFileName = Path.GetFullPath(tempFilename + ".zip"); ZipUnzip.Zip(tempFilename, zippedFileName); m_PlateToReport = File.ReadAllBytes(zippedFileName); File.Delete(tempFilename); File.Delete(zippedFileName); } catch (Exception ex) { Trace.WriteLine(ex); } if (m_PlateToReport != null) { double mbSize = m_PlateToReport.Length * 1.0 / (1024 * 1024); btnSendProblemFit.Text = string.Format("Report Unsolved Plate ({0} Mb)", mbSize.ToString("0.00")); btnSendProblemFit.Visible = true; } }
private void CompleteActivation() { m_VideoController.SetPictureBoxCursor(CustomCursors.PanCursor); m_FieldSolveContext = AstrometryContext.Current.FieldSolveContext; m_Image = m_AstrometryController.GetCurrentAstroPlate(); m_Image.EffectiveFocalLength = m_FieldSolveContext.FocalLength; m_RADegCenter = m_FieldSolveContext.RADeg; m_DEDegCenter = m_FieldSolveContext.DEDeg; StarCatalogueFacade facade = new StarCatalogueFacade(TangraConfig.Settings.StarCatalogue); m_CatalogueStars = facade.GetStarsInRegion( m_FieldSolveContext.RADeg, m_FieldSolveContext.DEDeg, 2.5 * m_Image.GetMaxFOVInArcSec() / 3600.0, m_FieldSolveContext.LimitMagn, (float)m_FieldSolveContext.Epoch); m_Eta = GetUserCameraConfigParam("rotation", 0.0); m_FLength = m_FieldSolveContext.FocalLength; m_Aspect = GetUserCameraConfigParam("aspect", 1.0); m_LimitMag = (int)Math.Round(m_FieldSolveContext.LimitMagn); m_ShowLabels = GetUserCameraConfigParam("labels", 0) == 1; m_Grid = GetUserCameraConfigParam("grid", 0) == 1; m_ShowMagnitudes = GetUserCameraConfigParam("magnitudes", 0) == 1; UpdateControls(); InitStarMap(); m_SolvedPlate = new DirectTransRotAstrometry(m_Image, m_FieldSolveContext.RADeg, m_FieldSolveContext.DEDeg, m_Eta, m_Aspect); m_CalibrationContext = new CalibrationContext(); m_CalibrationContext.StarMap = AstrometryContext.Current.StarMap; m_CalibrationContext.PreliminaryFit = m_SolvedPlate; m_FieldSolveContext.CatalogueStars = m_CatalogueStars; m_CalibrationContext.FieldSolveContext = m_FieldSolveContext; m_CalibrationContext.PlateConfig = m_Image; TangraConfig.AstrometrySettings calibrationSettings = TangraConfig.Settings.Astrometry.Clone(); calibrationSettings.MaxResidualInPixels = CorePyramidConfig.Default.CalibrationMaxResidualInPixels; calibrationSettings.PyramidDistanceToleranceInPixels = CorePyramidConfig.Default.CalibrationPyramidDistanceToleranceInPixels; calibrationSettings.MinimumNumberOfStars = CorePyramidConfig.Default.CalibrationNumberOfStars; m_PlateCalibrator = new PlateCalibration(m_CalibrationContext, calibrationSettings, m_AstrometryController); UpdateToolControlDisplay(); m_PlatesolveController.SetupControls(); m_SolveState = -1; DrawCatalogStarsFit(); m_State = FittingsState.Activated; }