Exemple #1
0
        internal NativeSimplifiedTracker(int width, int height, List <TrackedObjectConfig> measuringStars, bool isFullDisappearance)
        {
            NativeTracking.ConfigureNativeTracker();

            var dataRange = PSFFittingDataRange.DataRange8Bit;

            switch (LightCurveReductionContext.Instance.BitPix)
            {
            case 8:
                dataRange = PSFFittingDataRange.DataRange8Bit;
                break;

            case 12:
                dataRange = PSFFittingDataRange.DataRange12Bit;
                break;

            case 14:
                dataRange = PSFFittingDataRange.DataRange14Bit;
                break;

            case 16:
                dataRange = PSFFittingDataRange.DataRange16Bit;
                break;

            default:
                dataRange = PSFFittingDataRange.DataRange16Bit;
                break;
            }

            NativeTracking.InitNewTracker(
                width,
                height,
                measuringStars.Count,
                LightCurveReductionContext.Instance.FullDisappearance,
                dataRange,
                (ushort)LightCurveReductionContext.Instance.MaxPixelValue);

            for (int i = 0; i < measuringStars.Count; i++)
            {
                TrackedObjectConfig obj = measuringStars[i];
                NativeTracking.ConfigureTrackedObject(i, obj);
                var nativeObj = new NativeTrackedObject(i, LightCurveReductionContext.Instance.BitPix, obj, isFullDisappearance);
                m_NativeTrackedObject.Add(nativeObj);
                m_TrackedObjects.Add(nativeObj);
            }

            m_OccultedStarConfig = measuringStars.Single(x => x.TrackingType == TrackingType.OccultedStar);
        }
Exemple #2
0
        public void DoManualFrameCorrection(int targetId, int deltaX, int deltaY)
        {
            foreach (ITrackedObject trackedObject in TrackedObjects)
            {
                if (trackedObject.TargetNo == targetId)
                {
                    trackedObject.SetIsTracked(
                        true,
                        NotMeasuredReasons.TrackedSuccessfully,
                        new ImagePixel(trackedObject.Center.Brightness, trackedObject.Center.XDouble + deltaX, trackedObject.Center.YDouble + deltaY),
                        1);

                    NativeTracking.DoManualFrameCorrection(targetId, deltaX, deltaY);

                    break;
                }
            }
        }