Skip to content

Commit

Permalink
Initial commit of Aravis camera adapter. Add to build system.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hazen Babcock authored and Hazen Babcock committed Feb 10, 2024
1 parent 85867ae commit 23ba384
Show file tree
Hide file tree
Showing 5 changed files with 110 additions and 0 deletions.
53 changes: 53 additions & 0 deletions DeviceAdapters/Aravis/AravisCamera.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// #pragma warning(push)
// #pragma warning(disable : 4482)
// #pragma warning(disable : 4251) // Note: need to have a C++ interface, i.e., compiler versions need to match!

#include "AravisCamera.h"
#include "ModuleInterface.h"
#include <vector>
#include <string>
#include <algorithm>


/*
* Module functions.
*/
MODULE_API void InitializeModuleData()
{
}

MODULE_API MM::Device* CreateDevice(const char* deviceName)
{
return new AravisCamera(deviceName);
}

MODULE_API void DeleteDevice(MM::Device* pDevice)
{
}


/*
* Camera class and methods.
*/

AravisCamera::AravisCamera(const char *name) : CCameraBase<AravisCamera>()
{
}

AravisCamera::~AravisCamera()
{
}


/*
* Acquistion thread class and methods.
*/
AravisAcquisitionThread::AravisAcquisitionThread(AravisCamera * aCam)
{
}

AravisAcquisitionThread::~AravisAcquisitionThread()
{
}

// #pragma warning(pop)
29 changes: 29 additions & 0 deletions DeviceAdapters/Aravis/AravisCamera.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#ifndef _ARAVIS_CAMERA_H_
#define _ARAVIS_CAMERA_H_

#include "DeviceBase.h"
#include "ImgBuffer.h"
#include "DeviceThreads.h"
#include "arv.h"


class AravisAcquisitionThread;


class AravisCamera : public CCameraBase<AravisCamera>
{
public:
AravisCamera(const char *serialNumber);
~AravisCamera();
};


class AravisAcquisitionThread : public MMDeviceThreadBase
{
public:
AravisAcquisitionThread(AravisCamera *aCam);
~AravisAcquisitionThread();
};

#endif // !_ARAVIS_CAMERA_H_

14 changes: 14 additions & 0 deletions DeviceAdapters/Aravis/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

AM_CXXFLAGS=$(MMDEVAPI_CXXFLAGS)

# Linux, use output from from pkg-config (aravis-0.10).
ARAVISCPPFLAGS = -I/usr/local/include/aravis-0.10 -I/usr/include/libxml2 -I/usr/include/libusb-1.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
ARAVISLDFLAGS = -Wl,--enable-new-dtags -Wl,-rpath,/usr/local/lib/x86_64-linux-gnu,-L/usr/local/lib/x86_64-linux-gnu
ARAVISLDLIBS = -laravis-0.10 -lgio-2.0 -lgobject-2.0 -lglib-2.0

deviceadapter_LTLIBRARIES=libmmgr_dal_AravisCamera.la
libmmgr_dal_AravisCamera_la_SOURCES=AravisCamera.cpp AravisCamera.h
libmmgr_dal_AravisCamera_la_CPPFLAGS=$(ARAVISCPPFLAGS)
libmmgr_dal_AravisCamera_la_LIBADD=$(MMDEVAPI_LIBADD) $(ARAVISLDLIBS)
libmmgr_dal_AravisCamera_la_LDFLAGS=$(MMDEVAPI_LDFLAGS) $(ARAVISLDLIBS) $(ARAVISLDFLAGS)

4 changes: 4 additions & 0 deletions DeviceAdapters/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ endif
if BUILD_ANDORSDK3
ANDORSDK3 = AndorSDK3
endif
if BUILD_ARAVIS_LINUX
ARAVIS = Aravis
endif
if BUILD_BASLER_LINUX
BASLER = Basler
endif
Expand Down Expand Up @@ -81,6 +84,7 @@ SUBDIRS = \
$(ANDOR) \
$(ANDORLASERCOMBINER) \
$(ANDORSDK3) \
$(ARAVIS) \
$(BASLER) \
$(DC1394) \
$(FAKECAMERA) \
Expand Down
10 changes: 10 additions & 0 deletions DeviceAdapters/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,15 @@ else
AC_MSG_RESULT([not found])
fi

# Aravis (v0.10).
AC_MSG_CHECKING(for Aravis_Linux)
AM_CONDITIONAL([BUILD_ARAVIS_LINUX],[test -f "/usr/local/include/aravis-0.10/arv.h"])
if test -f "/usr/local/include/aravis-0.10/arv.h"; then
AC_MSG_RESULT([found])
else
AC_MSG_RESULT([not found])
fi

# BaslerPylon
AC_MSG_CHECKING(for Basler_Linux)
AM_CONDITIONAL([BUILD_BASLER_LINUX],[test -f "/opt/pylon/include/pylon/PylonIncludes.h"])
Expand Down Expand Up @@ -538,6 +547,7 @@ m4_define([device_adapter_dirs], [m4_strip([
AndorLaserCombiner
AndorSDK3
Aquinas
Aravis
Arduino
Arduino32bitBoards
Basler
Expand Down

0 comments on commit 23ba384

Please sign in to comment.