Skip to content

File ManagedInterface.h

File List > SpinnakerNET > ManagedInterface.h

Go to the documentation of this file

//=============================================================================
// Copyright (c) 2026 FLIR Integrated Imaging Solutions, Inc. All Rights Reserved.
//
// This software is the confidential and proprietary information of FLIR
// Integrated Imaging Solutions, Inc. ("Confidential Information"). You
// shall not disclose such Confidential Information and shall use it only in
// accordance with the terms of the license agreement you entered into
// with FLIR Integrated Imaging Solutions, Inc. (FLIR).
//
// FLIR MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
// SOFTWARE, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE, OR NON-INFRINGEMENT. FLIR SHALL NOT BE LIABLE FOR ANY DAMAGES
// SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
// THIS SOFTWARE OR ITS DERIVATIVES.
//=============================================================================

#ifndef FLIR_SPINNAKER_MANAGED_INTERFACE_H
#define FLIR_SPINNAKER_MANAGED_INTERFACE_H

#include "IManagedInterface.h"
#include "ManagedTransportLayerInterface.h"

#pragma make_public(Spinnaker::InterfacePtr)
using namespace ::System;
using namespace ::System::Collections::Generic;

namespace SpinnakerNET
{
    public ref class ManagedInterface : IManagedInterface
    {
    public:
        ManagedInterface();
        ManagedInterface(Spinnaker::InterfacePtr* pInterface);
        ~ManagedInterface();
        !ManagedInterface();

        virtual ManagedCameraList^ GetCameras();

        virtual ManagedCameraList^ GetCameras(bool updateCameras);

        virtual bool UpdateCameras();

        /*
         * Get a nodemap.  This nodemap is generated from a GenICam
         * XML file for the GenTL interface Module.
         *
         * @return  A handle to a NodeMap object.
         */
        virtual SpinnakerNET::GenApi::INodeMap^ GetTLNodeMap();

        /*
         * Registers an event handler for the interface.
         *
         * @see ManagedInterfaceEventHandler
         * 
         * @param event The event handler to register for the interface
         *
         */
        virtual void RegisterEventHandler(ManagedEventHandler^ eventHandler);

        /*
         * Unregisters an event handler for the interface.
         *
         * @see ManagedInterfaceEventHandler
         *
         * @param event The event handler to unregister from the interface
         */
        virtual void UnregisterEventHandler(ManagedEventHandler^ eventHandler);

        /*
         * Retrieves a boolean indicating whether or not the interface is in use.
         *
         */
        virtual bool IsCameraInUse(void);

        /*
        * Broadcast an Action Command to all devices on interface
        *
        * @param deviceKey The Action Command's device key
        * @param groupKey The Action Command's group key
        * @param groupMask The Action Command's group mask
        * @param actionTime (Optional) Time when to assert a future action. Zero means immediate action.
        * @param requestAck Whether to request an ACK from the camera for the action command.
        *
        * @return  A list of ActionCommandResult received following Action Command. An empty list means no devices responded to Action Command
        */
        virtual List<ActionCommandResult^>^ SendActionCommand
        (unsigned int deviceKey, 
            unsigned int groupKey, 
            unsigned int groupMask, 
            [Optional] Nullable<unsigned long long> actionTime,
            bool requestAck
            );

        virtual Spinnaker::InterfacePtr* GetNativeInterfacePtr();

        virtual bool IsValid();

    private:

        SpinnakerNET::GenApi::NodeMap^ m_pNodeMap;
        Spinnaker::InterfacePtr* m_pNativeInterface;
        Spinnaker::SystemPtr* m_pNativeSystemPtr;
        bool m_bFirstIteration;

        ManagedTransportLayerInterface^ m_genTLInterfaceInfo;

    public:
        virtual property SpinnakerNET::ManagedTransportLayerInterface^ TLInterface
        {
            SpinnakerNET::ManagedTransportLayerInterface^ get()
            {
                return m_genTLInterfaceInfo;
            }
        }

    };
}

#endif // FLIR_SPINNAKER_MANAGED_INTERFACE_H