Esempio n. 1
0
        public void FromCameraInfoNotConnectedTest()
        {
            var cameraInfo = new CameraInfo()
            {
                Connected           = false,
                Temperature         = 20.5,
                Gain                = 139,
                Offset              = 10,
                TemperatureSetPoint = -10,
                BinX                = 3,
                BinY                = 2,
                ElectronsPerADU     = 2.43,
                PixelSize           = 12
            };

            var sut = new ImageMetaData();

            sut.FromCameraInfo(cameraInfo);

            Assert.AreEqual(string.Empty, sut.Camera.Name);
            Assert.AreEqual("1x1", sut.Camera.Binning);
            Assert.AreEqual(1, sut.Camera.BinX);
            Assert.AreEqual(1, sut.Camera.BinY);
            Assert.AreEqual(double.NaN, sut.Camera.PixelSize);
            Assert.AreEqual(double.NaN, sut.Camera.Temperature);
            Assert.AreEqual(-1, sut.Camera.Gain);
            Assert.AreEqual(-1, sut.Camera.Offset);
            Assert.AreEqual(double.NaN, sut.Camera.ElectronsPerADU);
            Assert.AreEqual(double.NaN, sut.Camera.SetPoint);
        }
Esempio n. 2
0
        public void FromCameraInfoConnectedTest()
        {
            var cameraInfo = new CameraInfo()
            {
                Connected           = true,
                Name                = "TEST",
                Temperature         = 20.5,
                Gain                = 139,
                Offset              = 10,
                TemperatureSetPoint = -10,
                BinX                = 3,
                BinY                = 2,
                ElectronsPerADU     = 2.43,
                PixelSize           = 12,
                ReadoutMode         = 1,
                ReadoutModes        = new List <string> {
                    "mode1", "mode2"
                }
            };

            var sut = new ImageMetaData();

            sut.FromCameraInfo(cameraInfo);

            Assert.AreEqual("TEST", sut.Camera.Name);
            Assert.AreEqual("3x2", sut.Camera.Binning);
            Assert.AreEqual(3, sut.Camera.BinX);
            Assert.AreEqual(2, sut.Camera.BinY);
            Assert.AreEqual(12, sut.Camera.PixelSize);
            Assert.AreEqual(20.5, sut.Camera.Temperature);
            Assert.AreEqual(139, sut.Camera.Gain);
            Assert.AreEqual(10, sut.Camera.Offset);
            Assert.AreEqual(2.43, sut.Camera.ElectronsPerADU);
            Assert.AreEqual(-10, sut.Camera.SetPoint);
            Assert.That(sut.Camera.ReadoutModeName, Is.EqualTo("mode2"));
        }