Ejemplo n.º 1
0
        /// <summary>
        /// Initialize the whole system
        /// </summary>
        internal void Initialize()
        {
            //Load configuration


            var ptzManager = SimpleIoc.Default.GetInstance <IPTZManager>();

            //Create and connect connection to ATEM
            var atemHandler = new AtemSwitcherHandler();

            ptzManager.SetAtemHandler(atemHandler);

            //Create How many Camera
            var cam       = new CameraHandler();
            var camParser = new CameraPTC140Parser();
            var socket    = new SocketAutoConnectParser();

            socket.Initialize("CAM 1", "192.168.1.131", 5002, camParser);
            camParser.Initialize(socket);
            cam.Initialize(camParser);
            ptzManager.AddCcameraHandler(cam);

            cam       = new CameraHandler();
            camParser = new CameraPTC140Parser();
            socket    = new SocketAutoConnectParser();
            socket.Initialize("CAM 2", "192.168.1.132", 5002, camParser);
            camParser.Initialize(socket);
            cam.Initialize(camParser);
            ptzManager.AddCcameraHandler(cam);

            cam       = new CameraHandler();
            camParser = new CameraPTC140Parser();
            socket    = new SocketAutoConnectParser();
            socket.Initialize("CAM 3", "192.168.1.133", 5002, camParser);
            camParser.Initialize(socket);
            cam.Initialize(camParser);
            ptzManager.AddCcameraHandler(cam);

            //Create and connect to pad


            //Startup the whole system
            ptzManager.StartUp();
        }
Ejemplo n.º 2
0
        public void TestTally()
        {
            ISocketParser socket = new MockISocketParser(); //Substitute.For<ISocketParser>();

            CameraPTC140Parser camera = new CameraPTC140Parser();

            camera.Initialize(socket);

            camera.Connect();

            (socket as MockISocketParser).SetTestValue(0x02, 0x03);
            camera.Tally(true, false);

            (socket as MockISocketParser).SetTestValue(0x03, 0x02);
            camera.Tally(false, true);

            (socket as MockISocketParser).SetTestValue(0x03, 0x03);
            camera.Tally(false, false);

            (socket as MockISocketParser).SetTestValue(0x02, 0x03);
            camera.Tally(true, true);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Initialize the whole system
        /// </summary>
        internal void Initialize()
        {
            //Load configuration
            var cfg = ConfigurationFileParser.LoadConfigurationFile("Configuration.json");

            var ptzManager = SimpleIoc.Default.GetInstance <IPTZManager>();

            ptzManager.InitSeetings(cfg);

            //Create and connect connection to ATEM
            var atemHandler = new AtemSwitcherHandler();
            var atemParser  = new AtemSwitcherParser(cfg.AtemHost);

            atemHandler.Initialize(atemParser);
            ptzManager.SetSwitcherHandler(atemHandler);

            //Create How many Camera
            foreach (var camcfg in cfg.Cameras)
            {
                var cam       = new CameraHandler();
                var camParser = new CameraPTC140Parser();
                var socket    = new SocketAutoConnectParser();
                socket.Initialize(camcfg.CameraName, camcfg.CameraHost, camcfg.CameraPort, camParser);
                camParser.Initialize(socket);
                cam.Initialize(camParser);
                ptzManager.AddCameraHandler(cam);
            }

            //Create pad
            var pad       = new GamePadHandler();
            var hidParser = new HIDParser();

            hidParser.Initialize(cfg.GamePads, pad);
            pad.Initialize(hidParser, ptzManager, cfg.CamSpeed);
            ptzManager.AddGamePad(pad);
        }