Exemplo n.º 1
0
        public override Object Attend()
        {
            if (path != null)
            {
                TISCameraDriver driver = TISCameraManager.GetReference().getDriver(camera);

                if (!Double.IsNaN(this.exposure))
                {
                    double expValue = this.exposure;
                    driver.GetProperty(PropertyType.EXPOSURE).Auto  = false;
                    driver.GetProperty(PropertyType.EXPOSURE).Value = expValue;
                }

                if (quality < 0)
                {
                    driver.TakeImage(path, image);
                }
                else
                {
                    driver.TakeImage(path, image, quality);
                }

                return(null);
            }
            else
            {
                throw new Exception("The path is not defined.");
            }
        }
        public override Object Attend()
        {
            if (this.camera != null)
            {
                TISCameraDriver driver = TISCameraManager.GetReference().getDriver(camera);
                double          min    = driver.GetProperty(this.property).MinValue;
                double          max    = driver.GetProperty(this.property).MaxValue;

                return(new Double[] { min, max });
            }
            else
            {
                throw new Exception("The property does not exist.");
            }
        }
Exemplo n.º 3
0
        public static int Main(String[] args)
        {
            ConsoleColor preColor = Console.ForegroundColor;

            Console.ForegroundColor = ConsoleColor.Green;

            Console.WriteLine("Astronomy Cameras Socket Server, v0.8.11");
            Console.WriteLine("Developed by Fernando Serena, Ciclope Group. UPM");
            Console.WriteLine("Copyleft @ 2012 - All wrongs reserved.");

            Console.ForegroundColor = preColor;

            int port = 11000;

            if (args.Length > 0)
            {
                foreach (String arg in args)
                {
                    if (arg.StartsWith("logpath="))
                    {
                        Log.LogPath = arg.Replace("logpath=", String.Empty);
                    }
                    else if (arg.StartsWith("port="))
                    {
                        port = Int32.Parse(arg.Replace("port=", String.Empty));
                    }
                }
            }

            //////////////Program fails looking for DBx if not connected////////////

            /*TISCameraDriver driverDBK = TISCameraManager.GetReference().getDriver("DBx 41AU02.AS");
             *
             * driverDBK.GetProperty(Properties.PropertyType.GAIN).Value = 300;
             * driverDBK.GetProperty(Properties.PropertyType.GAMMA).Value = 50;
             * driverDBK.GetProperty(Properties.PropertyType.EXPOSURE).Value = 0.00219;
             *
             * driverDBK.ImageQuality = 700;
             *
             * Console.WriteLine("DBx 41AU02.AS Gamma set to " + driverDBK.GetProperty(Properties.PropertyType.GAMMA).Value);
             * Console.WriteLine("DBx 41AU02.AS Exposure set to " + driverDBK.GetProperty(Properties.PropertyType.EXPOSURE).Value);
             * Console.WriteLine("DBx 41AU02.AS Gain set to " + driverDBK.GetProperty(Properties.PropertyType.GAIN).Value);*/

            TISCameraDriver driverDMK = TISCameraManager.GetReference().getDriver("DMx 41AU02.AS");

            driverDMK.GetProperty(Properties.PropertyType.EXPOSURE).Value = 0.003;
            driverDMK.GetProperty(Properties.PropertyType.GAIN).Value     = 300;
            driverDMK.GetProperty(Properties.PropertyType.GAMMA).Value    = 50;

            Console.WriteLine("DMx 41AU02.AS Exposure set to " + driverDMK.GetProperty(Properties.PropertyType.EXPOSURE).Value);
            Console.WriteLine("DMx 41AU02.AS Gamma set to " + driverDMK.GetProperty(Properties.PropertyType.GAMMA).Value);
            Console.WriteLine("DMx 41AU02.AS Gain set to " + driverDMK.GetProperty(Properties.PropertyType.GAIN).Value);

            Log.LogFilterLevel = 10;
            SocketServer server = new CameraSocketServer();

            server.StartListening(port);

            return(0);
        }
Exemplo n.º 4
0
        public override Object Attend()
        {
            if (this.camera != null)
            {
                TISCameraDriver driver = TISCameraManager.GetReference().getDriver(camera);
                driver.GetProperty(this.property).Auto = this.mode;

                return(null);
            }
            else
            {
                throw new Exception("The property does not exist.");
            }
        }
        public override Object Attend()
        {
            if (this.camera != null)
            {
                Console.WriteLine("Property value requested: " + this.property);
                TISCameraDriver driver = TISCameraManager.GetReference().getDriver(camera);
                double          value  = driver.GetProperty(this.property).Value;

                return(value);
            }
            else
            {
                throw new Exception("The property does not exist.");
            }
        }
Exemplo n.º 6
0
        public override Object Attend()
        {
            if (this.camera != null)
            {
                TISCameraDriver driver = TISCameraManager.GetReference().getDriver(camera);
                driver.GetProperty(this.property).Value = value;

                Console.WriteLine("Property " + this.property + " value modified: " + value);

                return(null);
            }
            else
            {
                throw new Exception("The property does not exist.");
            }
        }