Example #1
0
        internal void BeginConfiguration(LCStateMachine stateMachine, VideoController videoController)
        {
            m_StateMachine    = stateMachine;
            m_VideoController = videoController;

            UpdateState();
        }
Example #2
0
        internal frmAddOrEditSingleTarget(int objectId, ImagePixel center, PSFFit gaussian, LCStateMachine state, VideoController videoController)
        {
            InitializeComponent();

            m_VideoController = videoController;

            m_AutocenteredApertureAvailable = true;

            Text              = "Add Object";
            btnAdd.Text       = "Add";
            btnDontAdd.Text   = "Don't Add";
            btnDelete.Visible = false;
            m_IsEdit          = false;

            nudFitMatrixSize.Value   = 11;
            nudFitMatrixSize.Maximum = 15;

            m_ObjectId   = objectId;
            m_State      = state;
            m_AstroImage = m_State.VideoOperation.m_StackedAstroImage;

            ObjectToAdd = new TrackedObjectConfig();

            m_Center = new ImagePixel(center);

            Initialize();

            if (rbOccultedStar.Enabled)
            {
                SelectedObjectType = TrackingType.OccultedStar;
            }
            else
            {
                SelectedObjectType = TrackingType.GuidingStar;
            }

            // Apply filtering to the processing pixels according to the configured default filter value
            int matirxSize = (int)nudFitMatrixSize.Value;

            GetFitInMatrix(gaussian, ref matirxSize);

            nudFitMatrixSize.Maximum = matirxSize;

            if (SelectedObjectType != TrackingType.OccultedStar)
            {
                SetHeightAndType();
            }
        }
Example #3
0
        internal frmAddOrEditSingleTarget(int objectId, TrackedObjectConfig selectedObject, LCStateMachine state, VideoController videoController)
        {
            InitializeComponent();

            m_VideoController = videoController;

            m_AutocenteredApertureAvailable = true;

            Text = "Edit Object";

            btnAdd.Text       = "Save";
            btnDontAdd.Text   = "Cancel";
            btnDelete.Visible = true;
            m_IsEdit          = true;

            m_ObjectId   = objectId;
            m_State      = state;
            m_AstroImage = m_State.VideoOperation.m_StackedAstroImage;

            ObjectToAdd = selectedObject;

            if (selectedObject.TrackingType != TrackingType.ComparisonStar)
            {
                nudFitMatrixSize.SetNUDValue(selectedObject.PsfFitMatrixSize);
            }

            m_Center = new ImagePixel(
                selectedObject.OriginalFieldCenterX,
                selectedObject.OriginalFieldCenterY);

            if (ObjectToAdd.PositionTolerance > 0)
            {
                nudPositionTolerance.SetNUDValue((decimal)ObjectToAdd.PositionTolerance);
            }

            Initialize();

            if (!selectedObject.IsWeakSignalObject && !selectedObject.IsFixedAperture)
            {
                int matrixSize = selectedObject.PsfFitMatrixSize;
                GetFitInMatrix(selectedObject.Gaussian, ref matrixSize, selectedObject.ApertureInPixels);
                selectedObject.PsfFitMatrixSize = matrixSize;
            }
            else
            {
                m_ProcessingPixels = m_AstroImage.GetMeasurableAreaPixels(m_Center);
                m_DisplayPixels    = m_AstroImage.GetMeasurableAreaDisplayBitmapPixels(m_Center);

                m_FWHM     = 6;
                m_Gaussian = null;
                m_X0       = selectedObject.ApertureMatrixX0;
                m_Y0       = selectedObject.ApertureMatrixY0;
                dx         = selectedObject.ApertureDX;
                dy         = selectedObject.ApertureDY;

                PlotSingleTargetPixels();

                nudAperture1.SetNUDValue((decimal)Math.Round(ObjectToAdd.ApertureInPixels, 2));
            }

            SetHeightAndType();

            if (selectedObject.TrackingType == TrackingType.GuidingStar)
            {
                SelectedObjectType = TrackingType.GuidingStar;
            }
            else if (selectedObject.TrackingType == TrackingType.OccultedStar)
            {
                SelectedObjectType = TrackingType.OccultedStar;
            }
        }
Example #4
0
 internal LCStateViewingLightCurve(LCStateMachine context)
     : base(context)
 {
 }
        internal frmAddOrEditSingleTarget(int objectId, TrackedObjectConfig selectedObject, LCStateMachine state, VideoController videoController)
        {
            InitializeComponent();

            m_VideoController = videoController;

            m_AutocenteredApertureAvailable = true;

            Text = "Edit Object";

            btnAdd.Text = "Save";
            btnDontAdd.Text = "Cancel";
            btnDelete.Visible = true;
            m_IsEdit = true;

            m_ObjectId = objectId;
            m_State = state;
            m_AstroImage = m_State.VideoOperation.m_StackedAstroImage;

            ObjectToAdd = selectedObject;

            if (selectedObject.TrackingType != TrackingType.ComparisonStar)
                nudFitMatrixSize.SetNUDValue(selectedObject.PsfFitMatrixSize);

            m_Center = new ImagePixel(
                selectedObject.OriginalFieldCenterX,
                selectedObject.OriginalFieldCenterY);

            if (ObjectToAdd.PositionTolerance > 0)
                nudPositionTolerance.SetNUDValue((decimal)ObjectToAdd.PositionTolerance);

            Initialize();

            if (!selectedObject.IsWeakSignalObject && !selectedObject.IsFixedAperture)
            {
                int matrixSize = selectedObject.PsfFitMatrixSize;
                GetFitInMatrix(selectedObject.Gaussian, ref matrixSize, selectedObject.ApertureInPixels);
                selectedObject.PsfFitMatrixSize = matrixSize;
            }
            else
            {
                m_ProcessingPixels = m_AstroImage.GetMeasurableAreaPixels(m_Center);
                m_DisplayPixels = m_AstroImage.GetMeasurableAreaDisplayBitmapPixels(m_Center);

                m_FWHM = 6;
                m_Gaussian = null;
                m_X0 = selectedObject.ApertureMatrixX0;
                m_Y0 = selectedObject.ApertureMatrixY0;
                dx = selectedObject.ApertureDX;
                dy = selectedObject.ApertureDY;

                PlotSingleTargetPixels();

                nudAperture1.SetNUDValue((decimal) Math.Round(ObjectToAdd.ApertureInPixels, 2));
            }

            SetHeightAndType();

            if (selectedObject.TrackingType == TrackingType.GuidingStar)
                SelectedObjectType = TrackingType.GuidingStar;
            else if (selectedObject.TrackingType == TrackingType.OccultedStar)
                SelectedObjectType = TrackingType.OccultedStar;
        }
        internal frmAddOrEditSingleTarget(int objectId, ImagePixel center, PSFFit gaussian, LCStateMachine state, VideoController videoController)
        {
            InitializeComponent();

            m_VideoController = videoController;

            m_AutocenteredApertureAvailable = true;

            Text = "Add Object";
            btnAdd.Text = "Add";
            btnDontAdd.Text = "Don't Add";
            btnDelete.Visible = false;
            m_IsEdit = false;

            nudFitMatrixSize.Value = 11;
            nudFitMatrixSize.Maximum = 15;

            m_ObjectId = objectId;
            m_State = state;
            m_AstroImage = m_State.VideoOperation.m_StackedAstroImage;

            ObjectToAdd = new TrackedObjectConfig();

            m_Center = new ImagePixel(center);

            Initialize();

            if (rbOccultedStar.Enabled)
                SelectedObjectType = TrackingType.OccultedStar;
            else
                SelectedObjectType = TrackingType.GuidingStar;

            // Apply filtering to the processing pixels according to the configured default filter value
            int matirxSize = (int)nudFitMatrixSize.Value;

            GetFitInMatrix(gaussian, ref matirxSize);

            nudFitMatrixSize.Maximum = matirxSize;

            if (SelectedObjectType != TrackingType.OccultedStar)
                SetHeightAndType();
        }
Example #7
0
 internal LCStateRunning(LCStateMachine context)
     : base(context)
 {
 }
Example #8
0
 protected LCState(LCStateMachine context)
 {
     Context = context;
 }
Example #9
0
        internal void BeginConfiguration(LCStateMachine stateMachine, VideoController videoController)
        {
            m_StateMachine = stateMachine;
            m_VideoController = videoController;

            UpdateState();
        }
        public void BeginConfiguration()
        {
            m_MeasurementInterval = 1;
            m_CurrFrameNo = -1;
            m_CurrFileName = null;

            m_StateMachine = new LCStateMachine(this, m_VideoController);

            m_Measuring = false;
            m_Refining = false;
            m_ViewingLightCurve = false;
            m_Configuring = true;

            m_StateMachine.SelectedMeasuringStar = -1;
            m_StateMachine.SelectedObject = null;

            m_ControlPanel.BeginConfiguration(m_StateMachine, m_VideoController);

            m_VideoController.StatusChanged("Configuring");

            // Lunar reappearances are measured backwards
            bool isLunarR = LightCurveReductionContext.Instance.LightCurveReductionType == LightCurveReductionType.TotalLunarReppearance;
            if (isLunarR)
            {
                m_VideoController.ShowMessageBox(
                    "To help with the tracking of a Lunar Reappearance Tangra will run the video in reverse direction.\r\n\r\n " +
                    "Please select the already reapeared star that you would like to measure.",
                    "Information",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Information);
            }
            m_VideoController.InitializePlayingDirection(isLunarR);
        }
        internal void EnterViewLightCurveMode(LCFile lcFile, IVideoController videoController, Panel controlPanelHolder)
        {
            m_ControlPanelHolder = controlPanelHolder;

            m_VideoController = (VideoController)videoController;
            EnsureControlPanel(m_ControlPanelHolder);

            m_LightCurveController.SetLcFile(lcFile);

            m_Measuring = false;
            m_Refining = false;
            m_ViewingLightCurve = true;
            m_Configuring = false;

            m_StateMachine = new LCStateMachine(this, m_VideoController);
            m_StateMachine.ChangeState(LightCurvesState.Viewing);

            m_StateMachine.SelectedMeasuringStar = -1;
            m_StateMachine.SelectedObject = null;

            m_MeasurementInterval = 1;
            m_CurrFrameNo = -1;
            m_CurrFileName = null;

            m_ControlPanel.BeginConfiguration(m_StateMachine, m_VideoController);
            m_ControlPanel.SetupLCFileInfo(m_LightCurveController.LcFile);
            m_ControlPanel.UpdateState();
        }
 internal LCStateSelectMeasuringStars(LCStateMachine context)
     : base(context)
 {
 }
Example #13
0
 internal LCStateReadyToRun(LCStateMachine context)
     : base(context)
 {
 }
Example #14
0
 internal LCStateRunning(LCStateMachine context)
     : base(context)
 {
 }
Example #15
0
 protected LCState(LCStateMachine context)
 {
     Context = context;
 }
Example #16
0
 internal LCStateSelectMeasuringStars(LCStateMachine context)
     : base(context)
 {
 }
Example #17
0
 internal LCStateReadyToRun(LCStateMachine context)
     : base(context)
 {
 }
 internal LCStateViewingLightCurve(LCStateMachine context)
     : base(context)
 {
 }