Esempio n. 1
0
        public OryxCamera(int camNumber, IManagedCamera managedCamera, CamStreamManager manager, Util.OryxSetupInfo setupInfo)
        {
            this.camNumber     = camNumber;
            this.managedCamera = managedCamera;
            this.manager       = manager;
            this.setupInfo     = setupInfo;
            messageQueue       = this.manager.messageQueue;
            sessionPath        = this.manager.sessionPath;

            GetNodeMapsAndInitialize();
            LoadCameraSettings();

            StreamController.BasicStreamController controller = new StreamController.BasicStreamController(oryxCamera: this);
            Console.WriteLine("BasicStreamController set to Run");
            controller.Run();
        }
Esempio n. 2
0
        public Form1()
        {
            InitializeComponent();

            system = new ManagedSystem();

            // Print current Spinnaker library version info:
            LibraryVersion spinVersion = system.GetLibraryVersion();

            Console.WriteLine(
                "Spinnaker library version: {0}.{1}.{2}.{3}\n\n",
                spinVersion.major,
                spinVersion.minor,
                spinVersion.type,
                spinVersion.build);

            // Find all Flir cameras on the system:
            managedCameras = system.GetCameras();

            // Assert that exactly two cameras are found:
            int nCamsFound = managedCameras.Count;

            if (nCamsFound != nCameras)
            {
                Console.WriteLine("Need exactly two cameras, but {0} cameras were found. Disposing system.", nCamsFound.ToString());
                managedCameras.Clear();
                system.Dispose();
            }

            // Create or select folder to write video data:
            sessionPaths = Util.SetDataWritePaths(animalName: Util.AnimalName.Charlie);

            // Initialize OryxSetupInfo Object to pass to camera constructors upon initialization:
            oryxSetupInfos = new Util.OryxSetupInfo[nCameras];
            for (int i = 0; i < nCameras; i++)
            {
                oryxSetupInfos[i] = new Util.OryxSetupInfo();
            }

            bool areAllCamSettingsIdentical = true;

            if (areAllCamSettingsIdentical)
            {
                Console.WriteLine("\n\n");
                Console.WriteLine("Cameras have identical settings, shown here:");
                oryxSetupInfos[0].PrintSettingsToLoad();
                Console.WriteLine("\n\n");
            }

            StreamArchitecture architecture = StreamArchitecture.ThreeLevelBasic;

            threadManager = new ThreadManager(architecture: architecture, sessionPaths: sessionPaths,
                                              managedCameras: managedCameras, oryxSetups: oryxSetupInfos);

            xBoxController = new XBoxController(mainForm: this,
                                                messageQueues: threadManager.managerBundle.messageQueues, streamGraph: threadManager.streamGraph);

            displayTimer          = new System.Windows.Forms.Timer();
            displayTimer.Interval = 2;
            displayTimer.Tick    += DisplayTimerEventProcessor;
            displayTimer.Enabled  = true;

            displayQueue = threadManager.managerBundle.mergeStreamsManager.output.displayQueue;
            threadManager.StartThreads();
        }