Пример #1
0
        private Orientation UpdatePositionsToNow()
        {
            DateTime CoordinatedEvaluationTime = DateTime.UtcNow;

            Orientation NewPosition = new Orientation(
                ActiveObjectiveAzimuthProfile.InterpretDegreesAt(AzEncoder, ActiveObjectiveOrientationMoveStart, CoordinatedEvaluationTime),
                ActiveObjectiveElevationProfile.InterpretDegreesAt(ElEncoder, ActiveObjectiveOrientationMoveStart, CoordinatedEvaluationTime)
                );

            AzEncoder.SetPositionFromDegrees(NewPosition.Azimuth);
            ElEncoder.SetPositionFromDegrees(NewPosition.Elevation);

            return(NewPosition);
        }
Пример #2
0
        public void TestGoodSetters()
        {
            Assert.AreEqual(0, Encoder0.CurrentPositionTicks);
            Encoder0.SetPositionFromEncoderTicks(750);
            Assert.AreEqual(750, Encoder0.CurrentPositionTicks);
            Encoder0.SetPositionFromDegrees(45.0);
            Assert.AreEqual(128, Encoder0.CurrentPositionTicks);
            Encoder0.SetPositionFromDegrees(405.0);
            Assert.AreEqual(128, Encoder0.CurrentPositionTicks);
            Encoder0.SetPositionFromDegrees(-315.0);
            Assert.AreEqual(128, Encoder0.CurrentPositionTicks);

            Assert.AreEqual(540, Encoder1.CurrentPositionTicks);
            Encoder1.SetPositionFromEncoderTicks(1024);
            Assert.AreEqual(1024, Encoder1.CurrentPositionTicks);
            Encoder1.SetPositionFromDegrees(36.0);
            Assert.AreEqual(409, Encoder1.CurrentPositionTicks);
            Encoder1.SetPositionFromDegrees(370.0);
            Assert.AreEqual(113, Encoder1.CurrentPositionTicks);
            Encoder1.SetPositionFromDegrees(-10.0);
            Assert.AreEqual(3982, Encoder1.CurrentPositionTicks);

            Reset();
        }