Skip to content

Commit

Permalink
Upgrade Atik SDK to 2023.07.14.1456. (#817)
Browse files Browse the repository at this point in the history
  • Loading branch information
TallFurryMan authored Jul 31, 2023
1 parent 50dab60 commit 00a322d
Show file tree
Hide file tree
Showing 9 changed files with 116 additions and 36 deletions.
54 changes: 21 additions & 33 deletions libatik/AtikCameras.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ typedef int BOOL;
typedef void * HINSTANCE;
#endif

#include "AtikDefs.h"

#ifdef __cplusplus
extern "C" {
#else
Expand Down Expand Up @@ -56,11 +58,11 @@ extern "C" {
enum ARTEMISPRECHARGEMODE
{
/// Precharge ignored
PRECHARGE_NONE = 0,
PRECHARGE_NONE = 0,
/// In-camera precharge subtraction
PRECHARGE_ICPS,
PRECHARGE_ICPS,
/// Precharge sent with image data
PRECHARGE_FULL,
PRECHARGE_FULL,
};

/// @see ArtemisCameraState()
Expand Down Expand Up @@ -90,7 +92,7 @@ extern "C" {
enum ARTEMISPROCESSING
{
/// compensate for JFET nonlinearity
ARTEMIS_PROCESS_LINEARISE = 1,
ARTEMIS_PROCESS_LINEARISE = 1,
/// adjust for 'Venetian Blind effect'
ARTEMIS_PROCESS_VBE = 2,
};
Expand Down Expand Up @@ -216,7 +218,7 @@ extern "C" {

/// @brief DLL handle set by ArtemisLoadDLL().
/// This is irrelevant if you are linking at compile time
static HINSTANCE hArtemisDLL = NULL;
extern HINSTANCE hArtemisDLL;

//////////////////////////////////////////////////////////////////////////
//
Expand All @@ -229,7 +231,7 @@ extern "C" {
#define artfn extern

// ------------------- DLL --------------------------

/// @brief Get API version. This may be the same as the DLL version.
/// @return API version as an integer, such as: 20200904
artfn int ArtemisAPIVersion();
Expand Down Expand Up @@ -275,7 +277,7 @@ extern "C" {
artfn void ArtemisShutdown();

// ------------------- Device --------------------------

/// @brief Returns the number of connected and recognised devices.
/// The count does not include misconfigured devices (E.G. if drivers are missing).
/// @return The number of connected and recognised devices.
Expand Down Expand Up @@ -349,7 +351,7 @@ extern "C" {


// ------------------- Camera Info -----------------------------------

/// @brief Retrieves the serial number of the connected device.
/// @param handle the connected device handle.
/// @param flags a pointer to an integer which will be set to internal device flags.
Expand Down Expand Up @@ -663,7 +665,7 @@ extern "C" {
/// @see ARTEMISERROR
/// @return ARTEMIS_OK on success, or ARTEMISERROR enumeration on failure
artfn int ArtemisClearVReg( ArtemisHandle handle);

/// @brief Gets whether the device supports fast mode.
/// @param handle the connected Atik device handle.
/// @return TRUE if fast mode is supported, FALSE if not
Expand All @@ -682,29 +684,15 @@ extern "C" {
artfn BOOL ArtemisSetFastCallback( ArtemisHandle handle, void(*callback)(ArtemisHandle handle, int x, int y, int w, int h, int binx, int biny, void * imageBuffer));

/// @brief Set the callback that will be invoked when a fast mode exposure is completed. This extension provides
/// an array of info as the last arguments. The first char in the info array is always the length of the array
/// -1
/// a pointer to extra info passed to the function. See AtikDefs.h for a description of the structure
/// passed via the info parameter. Cast the unsigned char pointer to a FastCallbackInfo pointer to
/// access the information.
///
/// @param handle the connected Atik device handle.
/// @param callback a pointer to a function which will be invoked when fast mode is completed.
/// @return TRUE on success, FALSE on failure.
artfn BOOL ArtemisSetFastCallbackEx(ArtemisHandle handle, void(*callback)(ArtemisHandle handle, int x, int y, int w, int h, int binx, int biny, void * imageBuffer, unsigned char * info));

/// @brief Returns a pointer to the formatted last exposure start time while using the fast mode callback.
/// The buffer is internal to the SDK and is overwritten every time this function is called.
/// Only works with our Horizon II and ACIS/Apx series cameras
/// Does not include milliseconds.
/// @param handle the connected Atik device handle.
/// @see ArtemisLastStartTimeMilliseconds()
/// @return pointer to a null terminated buffer containing the formatted time exposure was started at.
artfn char* ArtemisLastFastModeStartTime(ArtemisHandle handle);

/// @brief Returns the last fast mode callback exposure start time millisecond component.
/// Only works with our Horizon II and ACIS/Apx series cameras
/// @param handle the connected Atik device handle.
/// @see ArtemisLastStartTime
/// @return millisecond component of the last exposure time.
artfn int ArtemisLastFastModeStartTimeMilliseconds(ArtemisHandle handle);

// ------------------- Amplifier -----------------------------------

/// @brief Enable/disable the device's amplifier.
Expand All @@ -727,7 +715,7 @@ extern "C" {
/// @see ARTEMISERROR, ArtemisAmplifier()
/// @return ARTEMIS_OK on success, or ARTEMISERROR enumeration on failure
artfn int ArtemisSetAmplifierSwitched(ArtemisHandle handle, bool bSwitched);

// ------------ Camera Specific Options -------------

/// @brief Returns whether the specified option is available
Expand Down Expand Up @@ -755,7 +743,7 @@ extern "C" {
/// @return ARTEMIS_OK on success, ARTEMIS_INVALID_PARAM if the opton is not available or ARTEMISERROR on failure
artfn int ArtemisCameraSpecificOptionSetData(ArtemisHandle handle, unsigned short id, unsigned char * data, int dataLength);

// ------------------- Column Repair ----------------------------------
// ------------------- Column Repair ----------------------------------

/// @brief Set the columns on which column repair post processing is performed.
/// @param handle the connected Atik device handle.
Expand Down Expand Up @@ -827,7 +815,7 @@ extern "C" {
/// @param password password required to interact with the device.
/// @param address address of EEPROM
/// @param length length of the data
/// @param data pointer to the buffer containing the data
/// @param data pointer to the buffer containing the data
/// @see ARTEMISERROR
/// @return ARTEMIS_OK on success, or ARTEMISERROR enumeration on failure
artfn int ArtemisReadFromEEPROM( ArtemisHandle handle, char * password, int address, int length, unsigned char * data);
Expand Down Expand Up @@ -909,7 +897,7 @@ extern "C" {
/// @return
artfn int ArtemisEFWGetPosition(ArtemisHandle handle, int * iPosition, bool * isMoving);

// ------------------- Firmware ----------------------------------------
// ------------------- Firmware ----------------------------------------

/// @brief Returns whether firmware can be uploaded to the device.
/// This API is for internal use.
Expand Down Expand Up @@ -1095,7 +1083,7 @@ extern "C" {
/// @return ARTEMIS_OK on success, ARTEMIS_INVALID_PARAMETER if value out of limits, ARTEMIS_NOT_INITIALIZED if lens not initialised, or ARTEMISERROR enumeration on failure
artfn int ArtemisSetLensFocus( ArtemisHandle handle, int focus);

// ------------------- Shutter ----------------------------------
// ------------------- Shutter ----------------------------------

/// @brief Checks whether the shutter can be opened and closed on the device.
/// @param handle the connected Atik device handle.
Expand Down Expand Up @@ -1197,7 +1185,7 @@ extern "C" {
/// @see ARTEMISERROR, ArtemisGetWindowHeaterPower()
/// @return ARTEMIS_OK on success, ARTEMARTEMIS_INVALID_PARAMETER if the device does not have a window heater, or ARTEMISERROR enumeration on failure
artfn int ArtemisSetWindowHeaterPower( ArtemisHandle handle, int windowHeaterPower);

/// @brief Dynamically loads the Atik implementation DLL.
/// This method is only needed if the DLL is linked dynamically.
/// This method is part of the DLL example code.
Expand Down
60 changes: 60 additions & 0 deletions libatik/AtikDefs.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#ifndef ATIK_DEFS_H
#define ATIK_DEFS_H

/// @file AtikDefs.h
/// @brief Atik SDK structure definitions.

#ifdef __cplusplus
extern "C"
{
#endif

///
/// @brief Structure of the data, a pointer to which is, passed to
/// the info parameter of FastCallbackEx function set by a call to
/// ArtemisSetFastCallbackEx.
///
/// @see ArtemisSetFastCallbackEx
///
struct FastCallbackInfo_
{
/// Set to the size of this structure minus 1.
unsigned char size;

/// Number of dropped frames since the previous callback.
unsigned char droppedFrames;

/// Number of dropped frames in software since the previous callback.
unsigned char softDroppedFrames;

/// Number of dropped frames in camera since the previous callback.
unsigned char hardDroppedFrames;

/// Start of exposure year.
int exposureStartTimeYear;

/// Start of exposure month.
int exposureStartTimeMonth;

/// Start of exposure day.
int exposureStartTimeDay;

/// Start of exposure hour (24 hour clock format) (UTC).
int exposureStartTimeHour;

/// Start of exposure minute (UTC).
int exposureStartTimeMinute;

/// Start of exposure second (UTC).
int exposureStartTimeSecond;

/// Start of exposure millisecond (UTC).
int exposureStartTimeMS;
};
typedef struct FastCallbackInfo_ FastCallbackInfo;

#ifdef __cplusplus
}
#endif

#endif // ATIK_DEFS_H
6 changes: 3 additions & 3 deletions libatik/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
cmake_minimum_required (VERSION 3.0)
project (libatik)

# Built November 11th, 2021 - SDK API 2021.11.02.862
set (ATIK_VERSION "2.2.10")
# Built with SDK API 2023.07.14.1456
set (ATIK_VERSION "2.2.11")
set (ATIK_SOVERSION "2")

set (FLYCAPTURE_VERSION "2.13.3.31")
Expand Down Expand Up @@ -54,4 +54,4 @@ elseif (UNIX AND NOT WIN32)
endif ()

# Install header files
install (FILES AtikCameras.h DESTINATION include/libatik)
install (FILES AtikCameras.h AtikDefs.h DESTINATION include/libatik)
Binary file modified libatik/arm64/libatikcameras.bin
Binary file not shown.
Binary file modified libatik/armhf/libatikcameras.bin
Binary file not shown.
Binary file modified libatik/mac/libatikcameras.bin
Binary file not shown.
32 changes: 32 additions & 0 deletions libatik/sdk2libatik.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

# The Atik SDK uncompresses as a list of files prefixed with Windows backslashes

if [ -z "${1:-}" -o ! -d "${1:-}" -o ! -f "${1:-}/include\\AtikCameras.h" ]
then
echo "Picks Atik libraries and headers from an extracted SDK and moves them here in ./libatik" >&2
echo "Usage: $0 <sdk folder>" >&2
exit 2
fi

archive="$1"

set -eux -o pipefail

copy_lib() {
find $archive -name "$1" | \
while read -r f
do
cp "$f" "./$2/$(basename "$f" | sed -e 's/.*\\//' -e 's/so$/bin/')"
done
}

copy_lib '*ARM\\64\\With*.so' 'arm64'
copy_lib '*ARM\\32\\With*.so' 'armhf'
copy_lib '*linux\\64\\With*.so' 'x64'
copy_lib '*linux\\32\\With*.so' 'x86'

cp "$1/lib\\macos\\libatikcameras.dylib" "./mac/libatikcameras.bin"

cp "$1/include\\AtikCameras.h" .
cp "$1/include\\AtikDefs.h" .
Binary file modified libatik/x64/libatikcameras.bin
Binary file not shown.
Binary file modified libatik/x86/libatikcameras.bin
Binary file not shown.

0 comments on commit 00a322d

Please sign in to comment.