Ejemplo n.º 1
0
        internal void ParseReportFile(MPCReportFile reportFile, IMPCReportFileManager manager)
        {
            m_ReportFile = reportFile;
            m_ReportFileManager = manager;

            LoadReportFileData();
        }
Ejemplo n.º 2
0
        public frmDisplayMPCReport(MPCReportFile reportFile, IMPCReportFileManager manager)
        {
            InitializeComponent();

            m_ReportFile = reportFile;
            m_ReportFileManager = manager;
        }
Ejemplo n.º 3
0
        internal void ParseReportFile(MPCReportFile reportFile, IMPCReportFileManager manager)
        {
            m_ReportFile        = reportFile;
            m_ReportFileManager = manager;

            LoadReportFileData();
        }
Ejemplo n.º 4
0
        public frmDisplayMPCReport(MPCReportFile reportFile, IMPCReportFileManager manager)
        {
            InitializeComponent();

            m_ReportFile        = reportFile;
            m_ReportFileManager = manager;
        }
Ejemplo n.º 5
0
        public ucAstrometryObjectInfo(AstrometryController astrometryController, VideoController videoController)
        {
            InitializeComponent();

            m_AstrometryController = astrometryController;
            m_VideoController = videoController;

            m_AstrometryController.Subscribe(this, typeof(OperationNotifications));

            pbPSFFit.Image = new Bitmap(pbPSFFit.Width, pbPSFFit.Height);
            m_FullRect = new Rectangle(0, 0, pbPSFFit.Width, pbPSFFit.Height);

            m_RAImage = new Bitmap(pnlRASeries.Width, pnlRASeries.Height);
            m_DEImage = new Bitmap(pnlDESeries.Width, pnlDESeries.Height);

            m_AstrometricState = AstrometricState.EnsureAstrometricState();

            m_CurrentReportFile = AstrometryContext.Current.CurrentReportFile;

            btnResolveObjects.Visible = false;
            btnSaveUnitTestData.Visible = false;

            #if GET_UNIT_TEST_DATA
            btnResolveObjects.Visible = true;
            btnSaveUnitTestData.Visible = true;
            #endif
        }
Ejemplo n.º 6
0
 public void CloseReportFile()
 {
     m_CurrentReportFile = null;
     AstrometryContext.Current.CurrentReportFile = null;
 }
Ejemplo n.º 7
0
        private void SaveToReportFile()
        {
            if (m_CurrentReportFile == null)
            {
                // Is there a report form currently opened?
                // If no then ask the user to append to an existing report or create a new one
                frmChooseReportFile reportFileForm = new frmChooseReportFile();
                if (reportFileForm.ShowDialog(this.ParentForm) != DialogResult.OK)
                    return;

                if (reportFileForm.IsNewReport)
                {
                    frmMPCObserver frmObserver = new frmMPCObserver(frmMPCObserver.MPCHeaderSettingsMode.NewMPCReport);
                    if (frmObserver.ShowDialog(ParentForm) == DialogResult.Cancel)
                        return;

                    if (saveFileDialog.ShowDialog(ParentForm) != DialogResult.OK)
                        return;

                    MPCObsHeader header = frmObserver.Header;
                    header.NET = m_MeasurementContext.StarCatalogueFacade.CatalogNETCode;
                    m_CurrentReportFile = new MPCReportFile(saveFileDialog.FileName, header);

                    TangraConfig.Settings.RecentFiles.NewRecentFile(RecentFileType.MPCReport, saveFileDialog.FileName);
                    TangraConfig.Settings.Save();
                }
                else
                {
                    m_CurrentReportFile = new MPCReportFile(reportFileForm.ReportFileName);

                    if (m_CurrentReportFile.Header.NET != m_MeasurementContext.StarCatalogueFacade.CatalogNETCode)
                    {
                        MessageBox.Show(
                            string.Format("The selected observation file uses {0} rather than {1}. Pelase select a different observation file or change the used catalog.",
                            m_CurrentReportFile.Header.NET, m_MeasurementContext.StarCatalogueFacade.CatalogNETCode), "Error", MessageBoxButtons.OK,  MessageBoxIcon.Error);

                        m_CurrentReportFile = null;
                        return;
                    }
                }
            }

            if (m_CurrentReportFile != null)
            {
                double? raUncertainty = m_MPCRAUncertainty;
                double? deUncertainty = m_MPCDEUncertainty;
                if (m_MPCRAUncertainty.HasValue && m_MPCDEUncertainty.HasValue)
                {
                    raUncertainty = m_MPCRAUncertainty.Value * Math.Cos(m_MPCDE * Math.PI / 180.0);
                }

                // Append the observation to the form
                if (!m_CurrentReportFile.AddObservation(
                        m_MPCObjectDesignation,
                        m_MPCRAHours,
                        m_MPCDE,
                        m_MPCTime,
                        m_MPCTimePrecission,
                        m_MPCMag,
                        m_MPCMagBand,
                        m_MPCIsVideoNormalPosition,
                        raUncertainty,
                        deUncertainty))
                    MessageBox.Show("Observation already added", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                else
                    m_CurrentReportFile.Save();

                m_CurrentReportFile.Present(this);

                AstrometryContext.Current.CurrentReportFile = m_CurrentReportFile;
            }
        }