コード例 #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();
        }
コード例 #2
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);
        }