add everything from https://storage.kayainstruments.com/s/vision-point except for archived software versions
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,808 @@
|
||||
/*****************************************************************//**
|
||||
* \file Deinterlacing_factor_four.cpp
|
||||
* \brief
|
||||
*
|
||||
* \date November 2024
|
||||
*********************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#include <conio.h>
|
||||
#include "tchar.h"
|
||||
#else
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "KYFGLib.h"
|
||||
|
||||
|
||||
#if !defined(_countof)
|
||||
#define _countof(_Array) (sizeof(_Array) / sizeof(_Array[0]))
|
||||
#endif
|
||||
|
||||
#define KY_MAX_BOARDS 4
|
||||
FGHANDLE m_FgHandles[KY_MAX_BOARDS];
|
||||
unsigned int currentGrabberIndex;
|
||||
int printCxp2Events = 0;
|
||||
int printHeartbeats = 0;
|
||||
|
||||
|
||||
typedef struct _Arguments
|
||||
{
|
||||
uint32_t uWidth;
|
||||
uint32_t uHeight;
|
||||
std::string sPixelFormat;
|
||||
float fps;
|
||||
KYBOOL isHelp;
|
||||
} Arguments;
|
||||
|
||||
Arguments arguments;
|
||||
|
||||
#ifdef __linux__ // _aligned_malloc() implementation for __linux__
|
||||
#include <signal.h>
|
||||
void* _aligned_malloc(size_t size, size_t alignment)
|
||||
{
|
||||
size_t pageAlign = size % 4096;
|
||||
if (pageAlign)
|
||||
{
|
||||
size += 4096 - pageAlign;
|
||||
}
|
||||
|
||||
#if(GCC_VERSION <= 40407)
|
||||
void * memptr = 0;
|
||||
posix_memalign(&memptr, alignment, size);
|
||||
return memptr;
|
||||
#else
|
||||
return aligned_alloc(alignment, size);
|
||||
#endif
|
||||
}
|
||||
#define _aligned_free free
|
||||
#endif // #ifdef __linux__
|
||||
|
||||
#ifndef _MSC_VER
|
||||
#define scanf_s scanf
|
||||
#endif
|
||||
|
||||
// Helper functions to get user input
|
||||
char BlockingInput()
|
||||
{
|
||||
char c = -1;
|
||||
#ifdef _MSC_VER
|
||||
while (scanf_s(" %c", &c, (unsigned int)(sizeof(char))) == -1);
|
||||
#else
|
||||
while ((c == -1) || (c == '\n'))
|
||||
{
|
||||
c = getc(stdin);
|
||||
}
|
||||
#endif
|
||||
return c;
|
||||
}
|
||||
|
||||
void CharInput(char expected_char, const char* error_str)
|
||||
{
|
||||
int valid = 0;
|
||||
char c;
|
||||
|
||||
while (!valid)
|
||||
{
|
||||
c = BlockingInput();
|
||||
|
||||
valid = expected_char == c;
|
||||
|
||||
if (!valid)
|
||||
{
|
||||
printf("%s", error_str);
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void NumberInRangeInput(int min, int max, int* value, const char* error_str)
|
||||
{
|
||||
int valid = 0;
|
||||
char c;
|
||||
|
||||
while (!valid)
|
||||
{
|
||||
c = BlockingInput();
|
||||
|
||||
*value = c - '0';
|
||||
|
||||
valid = *value >= min && *value <= max;
|
||||
|
||||
if (!valid)
|
||||
{
|
||||
printf("%s", error_str);
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//#define FGLIB_ALLOCATED_BUFFERS // Uncomment this #definition to use buffers allocated by KYFGLib
|
||||
#define MINIMAL_CALLBACK
|
||||
|
||||
#define MAXBOARDS 4
|
||||
CAMHANDLE camHandleArray[KY_MAX_BOARDS][KY_MAX_CAMERAS]; // There are maximum KY_MAX_CAMERAS cameras
|
||||
STREAM_HANDLE cameraStreamHandle = INVALID_STREAMHANDLE;
|
||||
int nKayaDevicesCount = 0;
|
||||
int64_t dmaImageIdCapable = 0;
|
||||
int grabberIndex = 0, cameraIndex = 0;
|
||||
|
||||
void Stream_callback_func(STREAM_BUFFER_HANDLE streamBufferHandle, void* userContext)
|
||||
{
|
||||
unsigned char* pFrameMemory = 0;
|
||||
uint32_t frameId = 0;
|
||||
#ifndef MINIMAL_CALLBACK
|
||||
uint64_t imageId = 0;
|
||||
size_t bufferSize = 0;
|
||||
void* pUserContext;
|
||||
uint64_t timeStamp;
|
||||
double instantFps;
|
||||
#endif
|
||||
userContext; // Suppress warning
|
||||
|
||||
if (NULL_STREAM_BUFFER_HANDLE == streamBufferHandle)
|
||||
{
|
||||
// This callback indicates that acquisition has stopped
|
||||
return;
|
||||
}
|
||||
|
||||
// As a minimum, application needs to get pointer to current frame memory
|
||||
KYFG_BufferGetInfo(streamBufferHandle,
|
||||
KY_STREAM_BUFFER_INFO_BASE,
|
||||
&pFrameMemory,
|
||||
NULL,
|
||||
NULL);
|
||||
|
||||
|
||||
// Additionaly the following information can be obtained:
|
||||
#ifndef MINIMAL_CALLBACK
|
||||
if (1 == dmaImageIdCapable)
|
||||
{
|
||||
KYFG_BufferGetInfo(streamBufferHandle,
|
||||
KY_STREAM_BUFFER_INFO_IMAGEID,
|
||||
&imageId,
|
||||
NULL,
|
||||
NULL);
|
||||
}
|
||||
|
||||
KYFG_BufferGetInfo(streamBufferHandle,
|
||||
KY_STREAM_BUFFER_INFO_ID,
|
||||
&frameId,
|
||||
NULL,
|
||||
NULL);
|
||||
|
||||
KYFG_BufferGetInfo(streamBufferHandle,
|
||||
KY_STREAM_BUFFER_INFO_SIZE,
|
||||
&bufferSize,
|
||||
NULL,
|
||||
NULL);
|
||||
|
||||
KYFG_BufferGetInfo(streamBufferHandle,
|
||||
KY_STREAM_BUFFER_INFO_USER_PTR,
|
||||
&pUserContext,
|
||||
NULL,
|
||||
NULL);
|
||||
|
||||
KYFG_BufferGetInfo(streamBufferHandle,
|
||||
KY_STREAM_BUFFER_INFO_TIMESTAMP,
|
||||
&timeStamp,
|
||||
NULL,
|
||||
NULL);
|
||||
|
||||
KYFG_BufferGetInfo(streamBufferHandle,
|
||||
KY_STREAM_BUFFER_INFO_INSTANTFPS,
|
||||
&instantFps,
|
||||
NULL,
|
||||
NULL);
|
||||
|
||||
#endif
|
||||
printf(//"\n" // Uncomment to print on new line each time
|
||||
"\rGood callback stream's buffer handle:%" PRISTREAM_BUFFER_HANDLE ", ID:%d", streamBufferHandle, frameId);
|
||||
|
||||
// Return stream buffer to input queue
|
||||
KYFG_BufferToQueue(streamBufferHandle, KY_ACQ_QUEUE_INPUT);
|
||||
}
|
||||
|
||||
void ProcessHeartbeatEvent(KYDEVICE_EVENT_CXP2_HEARTBEAT* pEventHeartbeat)
|
||||
{
|
||||
if (!printHeartbeats)
|
||||
{
|
||||
return;
|
||||
}
|
||||
printf(//"\n" // Uncomment to print on new line each time
|
||||
"\rReceived KYDEVICE_EVENT_CXP2_HEARTBEAT: cameraTime=%" PRIu64, pEventHeartbeat->heartBeat.cameraTime);
|
||||
}
|
||||
|
||||
void ProcessCxp2Event(KYDEVICE_EVENT_CXP2_EVENT* pEventCXP2Event)
|
||||
{
|
||||
if (!printCxp2Events)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
printf("Received KYDEVICE_EVENT_CXP2_EVENT: tag=0x%" PRIu8 "\n", pEventCXP2Event->cxp2Event.tag);
|
||||
}
|
||||
|
||||
void KYDeviceEventCallBackImpl(void* userContext, KYDEVICE_EVENT* pEvent)
|
||||
{
|
||||
userContext; // Suppress warning
|
||||
switch (pEvent->eventId)
|
||||
{
|
||||
// Please note that the following events will be recieved only if camera is working in CXP 2 mode. For details please reffer CXP 2 standards
|
||||
case KYDEVICE_EVENT_CXP2_HEARTBEAT_ID:
|
||||
ProcessHeartbeatEvent((KYDEVICE_EVENT_CXP2_HEARTBEAT*)pEvent);
|
||||
break;
|
||||
|
||||
case KYDEVICE_EVENT_CXP2_EVENT_ID:
|
||||
ProcessCxp2Event((KYDEVICE_EVENT_CXP2_EVENT*)pEvent);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int ConnectToGrabber(unsigned int _grabberIndex)
|
||||
{
|
||||
int64_t dmaQueuedBufferCapable;
|
||||
int64_t interprocessSharingCapable;
|
||||
|
||||
if ((m_FgHandles[_grabberIndex] = KYFG_Open(_grabberIndex)) != -1) // Connect to selected device
|
||||
{
|
||||
printf("Good connection to grabber #%d, m_FgHandles=%X\n", _grabberIndex, m_FgHandles[_grabberIndex]);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Could not connect to grabber #%d\n", _grabberIndex);
|
||||
BlockingInput();
|
||||
return 0;
|
||||
}
|
||||
|
||||
dmaQueuedBufferCapable = KYFG_GetGrabberValueInt(m_FgHandles[_grabberIndex], DEVICE_QUEUED_BUFFERS_SUPPORTED);
|
||||
interprocessSharingCapable = KYFG_GetGrabberValueInt(m_FgHandles[_grabberIndex], DEVICE_INTERPROCESS_SHARING_SUPPORTED);
|
||||
|
||||
if (1 != dmaQueuedBufferCapable)
|
||||
{
|
||||
printf("Grabber #%d does not support queued buffers\n", _grabberIndex);
|
||||
BlockingInput();
|
||||
return 0;
|
||||
}
|
||||
|
||||
dmaImageIdCapable = KYFG_GetGrabberValueInt(m_FgHandles[_grabberIndex], DEVICE_IMAGEID_SUPPORTED);
|
||||
|
||||
printf("Grabber #%d, KY_STREAM_BUFFER_INFO_IMAGEID %ssupported\n", _grabberIndex, dmaImageIdCapable ? "" : "not ");
|
||||
|
||||
currentGrabberIndex = _grabberIndex;
|
||||
|
||||
// OPTIONALY register grabber's event callback function
|
||||
if (FGSTATUS_OK != KYDeviceEventCallBackRegister(m_FgHandles[_grabberIndex], KYDeviceEventCallBackImpl, 0))
|
||||
{
|
||||
printf("Warning: KYDeviceEventCallBackRegister() failed\n");
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int StartCamera(unsigned int _grabberIndex, unsigned int _cameraIndex)
|
||||
{
|
||||
// Put all buffers to input queue
|
||||
KYFG_BufferQueueAll(cameraStreamHandle, KY_ACQ_QUEUE_UNQUEUED, KY_ACQ_QUEUE_INPUT);
|
||||
|
||||
// Start acquisition
|
||||
KYFG_CameraStart(camHandleArray[_grabberIndex][_cameraIndex], cameraStreamHandle, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void CloseGrabbers()
|
||||
{
|
||||
for (int i = 0; i < nKayaDevicesCount; i++)
|
||||
{
|
||||
if (INVALID_FGHANDLE != m_FgHandles[i])
|
||||
{
|
||||
if (FGSTATUS_OK != KYFG_Close(m_FgHandles[i])) // Close the selected device and unregisters all associated routines
|
||||
{
|
||||
printf("Wasn't able to close grabber #%d\n", i);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Grabber #%d closed\n", i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Close(int returnCode)
|
||||
{
|
||||
printf("Input any char to exit\n");
|
||||
BlockingInput();
|
||||
exit(returnCode);
|
||||
}
|
||||
|
||||
void stopStream()
|
||||
{
|
||||
if (camHandleArray[grabberIndex][cameraIndex] != INVALID_CAMHANDLE)
|
||||
{
|
||||
if (FGSTATUS_OK == KYFG_CameraStop(camHandleArray[grabberIndex][cameraIndex]))
|
||||
{
|
||||
printf("\nCamera successfully stoped\n");
|
||||
}
|
||||
}
|
||||
if (cameraStreamHandle != INVALID_STREAMHANDLE)
|
||||
{
|
||||
if (FGSTATUS_OK == KYFG_StreamDelete(cameraStreamHandle))
|
||||
{
|
||||
printf("Stream successfully deleted\n");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
#ifdef __linux__
|
||||
void crash_handler(int signum)
|
||||
{
|
||||
switch (signum)
|
||||
/// from https://pubs.opengroup.org/onlinepubs/009695399/basedefs/signal.h.html
|
||||
{
|
||||
case SIGABRT:
|
||||
case SIGFPE:
|
||||
case SIGTERM:
|
||||
{
|
||||
stopStream();
|
||||
Close(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void printArgs()
|
||||
{
|
||||
printf("\n===================== Script starts with arguments: ========================\n\n");
|
||||
printf("--width %d\n", arguments.uWidth);
|
||||
printf("--height %d\n", arguments.uHeight);
|
||||
printf("--pixelFormat %s\n", arguments.sPixelFormat.c_str());
|
||||
printf("--frameRate %f\n", arguments.fps);
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
void printHelp()
|
||||
{
|
||||
printf("\n============================ AVAILABLE OPTIONS ============================\n\n");
|
||||
printf("--width Image Width\n");
|
||||
printf("--height Image Height\n");
|
||||
printf("--pixelFormat Image Pixel Format\n");
|
||||
printf("--frameRate Acquisition frame rate\n");
|
||||
}
|
||||
|
||||
Arguments parseArguments(int argc, char* argv[])
|
||||
{
|
||||
Arguments args;
|
||||
args.fps = 200.00;
|
||||
args.isHelp = KYFALSE;
|
||||
args.sPixelFormat = "Mono16";
|
||||
args.uWidth = 1040;
|
||||
args.uHeight = 5376;
|
||||
|
||||
for (int i = 0; i < argc; i++)
|
||||
{
|
||||
if (strcmp(argv[i], "--frameRate") == 0)
|
||||
{
|
||||
const char* sFps = argv[i + 1];
|
||||
char* end;
|
||||
args.fps = std::strtof(sFps, &end);
|
||||
|
||||
if (*end != '\0')
|
||||
{
|
||||
std::cout << "Wrong --frameRate value" << std::endl;
|
||||
Close(-1);
|
||||
}
|
||||
}
|
||||
if (strcmp(argv[i], "--width") == 0)
|
||||
{
|
||||
char* endptr;
|
||||
args.uWidth = (int)strtol(argv[i + 1], &endptr, 10);
|
||||
if (*endptr != '\0')
|
||||
{
|
||||
printf("--width Conversion error, non-convertible part: %s\n", endptr);
|
||||
}
|
||||
}
|
||||
if (strcmp(argv[i], "--height") == 0)
|
||||
{
|
||||
char* endptr;
|
||||
args.uHeight = (int)strtol(argv[i + 1], &endptr, 10);
|
||||
if (*endptr != '\0')
|
||||
{
|
||||
printf("--height Conversion error, non-convertible part: %s\n", endptr);
|
||||
}
|
||||
}
|
||||
if (strcmp(argv[i], "--pixelFormat") == 0)
|
||||
{
|
||||
args.sPixelFormat = argv[i+1];
|
||||
}
|
||||
if (strcmp(argv[i], "--help") == 0)
|
||||
{
|
||||
args.isHelp = KYTRUE;
|
||||
}
|
||||
}
|
||||
return args;
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
size_t frameDataSize, frameDataAligment;
|
||||
int detectedCameras[KY_MAX_BOARDS];
|
||||
char c = 0;
|
||||
KYFGLib_InitParameters kyInit;
|
||||
KY_DEVICE_INFO* grabbersInfoArray = NULL;
|
||||
KYFGCAMERA_INFO2* cameraInfoArray = NULL;
|
||||
KYBOOL streamRunning = KYFALSE;
|
||||
// Register Signals
|
||||
#ifdef __linux__
|
||||
signal(SIGABRT, crash_handler);
|
||||
signal(SIGFPE, crash_handler);
|
||||
signal(SIGTERM, crash_handler);
|
||||
#endif
|
||||
// Initialize library
|
||||
|
||||
arguments = parseArguments(argc, argv);
|
||||
if (arguments.isHelp)
|
||||
{
|
||||
printHelp();
|
||||
Close(0);
|
||||
}
|
||||
printArgs();
|
||||
|
||||
STREAM_BUFFER_HANDLE streamBufferHandle[16] = { 0 };
|
||||
void *pBuffer[_countof(streamBufferHandle)] = { NULL };
|
||||
memset(&kyInit, 0, sizeof(kyInit));
|
||||
kyInit.version = 2;
|
||||
kyInit.concurrency_mode = 0;
|
||||
kyInit.logging_mode = 0;
|
||||
kyInit.noVideoStreamProcess = KYFALSE;
|
||||
|
||||
if (FGSTATUS_OK != KYFGLib_Initialize(&kyInit))
|
||||
{
|
||||
printf("Library initialization failed \n ");
|
||||
Close(-1);
|
||||
}
|
||||
|
||||
for (int i = 0; i < KY_MAX_BOARDS; i++)
|
||||
{
|
||||
m_FgHandles[i] = INVALID_FGHANDLE;
|
||||
}
|
||||
|
||||
// Scan for grabbers
|
||||
|
||||
KY_DeviceScan(&nKayaDevicesCount); // Retrieve the number of virtual and hardware devices connected to PC
|
||||
|
||||
if (!nKayaDevicesCount)
|
||||
{
|
||||
printf("No PCI devices found\n");
|
||||
Close(0);
|
||||
}
|
||||
|
||||
grabbersInfoArray = (KY_DEVICE_INFO*)malloc(nKayaDevicesCount * sizeof(KY_DEVICE_INFO));
|
||||
|
||||
for (int i = 0; i < nKayaDevicesCount; i++)
|
||||
{
|
||||
grabbersInfoArray[i].version = KY_MAX_DEVICE_INFO_VERSION;
|
||||
if (FGSTATUS_OK != KY_DeviceInfo(i, &grabbersInfoArray[i]))
|
||||
{
|
||||
printf("Wasn't able to retrive information from device #%d\n", i);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Select and open grabber
|
||||
|
||||
KYBOOL grabberReady = KYFALSE;
|
||||
|
||||
while (!grabberReady)
|
||||
{
|
||||
// Select framegrabber
|
||||
|
||||
printf("Select and open grabber:\n");
|
||||
for (int i = 0; i < nKayaDevicesCount; i++)
|
||||
{
|
||||
printf("[%d] %s on PCI slot {%d:%d:%d}: Protocol 0x%X, Generation %d\n",
|
||||
i,
|
||||
grabbersInfoArray[i].szDeviceDisplayName,
|
||||
grabbersInfoArray[i].nBus,
|
||||
grabbersInfoArray[i].nSlot,
|
||||
grabbersInfoArray[i].nFunction,
|
||||
grabbersInfoArray[i].m_Protocol,
|
||||
grabbersInfoArray[i].DeviceGeneration);
|
||||
}
|
||||
|
||||
KYBOOL inputValid = KYFALSE;
|
||||
|
||||
while (!inputValid)
|
||||
{
|
||||
NumberInRangeInput(0, nKayaDevicesCount - 1, &grabberIndex, "Invalid index\n");
|
||||
|
||||
printf("Selected grabber #%d\n", grabberIndex);
|
||||
inputValid = KYTRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
// Connect to framegrabber
|
||||
|
||||
if (ConnectToGrabber(grabberIndex))
|
||||
{
|
||||
grabberReady = KYTRUE;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Detect and connect camera
|
||||
|
||||
KYBOOL cameraReady = KYFALSE;
|
||||
|
||||
while (!cameraReady)
|
||||
{
|
||||
KYBOOL cameraScaned = KYFALSE;
|
||||
|
||||
while (!cameraScaned)
|
||||
{
|
||||
printf("\nPress [d] to detect cameras\n");
|
||||
|
||||
CharInput('d', "Invalid input\n");
|
||||
|
||||
int nDetectedCameras = _countof(camHandleArray[0]);
|
||||
|
||||
if (FGSTATUS_OK != KYFG_UpdateCameraList(m_FgHandles[grabberIndex], camHandleArray[grabberIndex], &nDetectedCameras))
|
||||
{
|
||||
printf("Camera detect error. Please try again\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!nDetectedCameras)
|
||||
{
|
||||
printf("No cameras detected. Please connect at least one camera\n");
|
||||
continue; // No cameras were detected
|
||||
}
|
||||
|
||||
printf("Number of cameras connected to the PCI device #%d: %d\n", grabberIndex, nDetectedCameras);
|
||||
|
||||
detectedCameras[grabberIndex] = nDetectedCameras;
|
||||
|
||||
if (cameraInfoArray)
|
||||
{
|
||||
free(cameraInfoArray);
|
||||
}
|
||||
|
||||
cameraInfoArray = (KYFGCAMERA_INFO2*)malloc(nDetectedCameras * sizeof(KYFGCAMERA_INFO2));
|
||||
|
||||
for (int i = 0; i < nDetectedCameras; i++)
|
||||
{
|
||||
cameraInfoArray[i].version = 1;
|
||||
KYFG_CameraInfo2(camHandleArray[grabberIndex][i], &cameraInfoArray[i]);
|
||||
}
|
||||
|
||||
cameraScaned = KYTRUE;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
KYBOOL cameraConnected = KYFALSE;
|
||||
|
||||
while (!cameraConnected)
|
||||
{
|
||||
printf("\nSelect and connect camera:\n");
|
||||
for (cameraIndex = 0; cameraIndex < detectedCameras[grabberIndex]; cameraIndex++)
|
||||
{
|
||||
printf("[%d] %s: Firmware %s\n",
|
||||
cameraIndex,
|
||||
cameraInfoArray[cameraIndex].deviceModelName,
|
||||
cameraInfoArray[cameraIndex].deviceFirmwareVersion);
|
||||
}
|
||||
|
||||
NumberInRangeInput(0, detectedCameras[grabberIndex] - 1, &cameraIndex, "Invalid index\n");
|
||||
|
||||
// Open a connection to the chosen camera
|
||||
if (FGSTATUS_OK == KYFG_CameraOpen2(camHandleArray[grabberIndex][cameraIndex], NULL))
|
||||
{
|
||||
printf("Camera #%d was connected successfully\n", cameraIndex);
|
||||
|
||||
// Update camera/grabber buffer dimensions parameters before stream creation
|
||||
KYFG_SetCameraValueInt(camHandleArray[grabberIndex][cameraIndex], "Width", arguments.uWidth); // set camera width
|
||||
KYFG_SetCameraValueInt(camHandleArray[grabberIndex][cameraIndex], "Height", arguments.uHeight); // set camera height
|
||||
KYFG_SetCameraValueEnum_ByValueName(camHandleArray[grabberIndex][cameraIndex], "PixelFormat", arguments.sPixelFormat.c_str()); // set camera pixel format
|
||||
KYFG_SetCameraValueFloat(camHandleArray[grabberIndex][cameraIndex], "AcquisitionFrameRate", arguments.fps);
|
||||
|
||||
// Create stream and assign appropriate runtime acquisition callback function
|
||||
KYFG_StreamCreate(camHandleArray[grabberIndex][cameraIndex], &cameraStreamHandle, 0);
|
||||
KYFG_StreamBufferCallbackRegister(cameraStreamHandle, Stream_callback_func, NULL);
|
||||
|
||||
// Retrieve information about required frame buffer size and alignment
|
||||
KYFG_StreamGetInfo(cameraStreamHandle,
|
||||
KY_STREAM_INFO_PAYLOAD_SIZE,
|
||||
&frameDataSize,
|
||||
NULL, NULL);
|
||||
|
||||
KYFG_StreamGetInfo(cameraStreamHandle,
|
||||
KY_STREAM_INFO_BUF_ALIGNMENT,
|
||||
&frameDataAligment,
|
||||
NULL, NULL);
|
||||
|
||||
const size_t nGrameQuarterHeight = arguments.uHeight / 4;
|
||||
const size_t nFrameQuarterSize = frameDataSize / 4;
|
||||
const size_t nPixelWidth = 2; // NOTE this sample assumes PixelFormat Mono16, i.e. each pixel occupates 2 bytes in the memory
|
||||
const size_t nChunkSize = arguments.uWidth * nPixelWidth; // each chunk will hold memory for one line
|
||||
|
||||
// Allocate memory for desired number of frame buffers
|
||||
for (int iFrame = 0; iFrame < _countof(streamBufferHandle); iFrame++)
|
||||
{
|
||||
pBuffer[iFrame] = _aligned_malloc(frameDataSize, frameDataAligment);
|
||||
|
||||
// Regilarly we are using KYFG_BufferAnnounce() to announce allocated frame buffer to the library:
|
||||
//KYFG_BufferAnnounce(cameraStreamHandle,
|
||||
// pBuffer[iFrame],
|
||||
// frameDataSize,
|
||||
// NULL,
|
||||
// &streamBufferHandle[iFrame]);
|
||||
|
||||
// But in this case we want to split this buffer into chunks, one chunk per line,
|
||||
// and re-order them so that each line will be delivered to another address within this buffer
|
||||
// instead of filling the buffer sequentialy one after another:
|
||||
|
||||
// Acquired stream data: Original lines redistributed within destination buffer:
|
||||
// 00000000000000000000 00000000000000000000
|
||||
// 11111111111111111111 00000000000000000000
|
||||
// 22222222222222222222 11111111111111111111
|
||||
// 33333333333333333333 11111111111111111111
|
||||
// 00000000000000000000 22222222222222222222
|
||||
// 11111111111111111111 22222222222222222222
|
||||
// 22222222222222222222 33333333333333333333
|
||||
// 33333333333333333333 33333333333333333333
|
||||
|
||||
// This is achieved by using KYFG_BufferAnnounceChunks() instead of KYFG_BufferAnnounce():
|
||||
|
||||
// Create vector of chunks reserving one chunk per each line
|
||||
std::vector<BUFFER_DATA_CHUNK> dataChunks(arguments.uHeight);
|
||||
|
||||
for (size_t iRow = 0; iRow < nGrameQuarterHeight; iRow++)
|
||||
{
|
||||
uint8_t* chunkBufferPointer_0 = (uint8_t*)pBuffer[iFrame] + (iRow * nChunkSize) + (nFrameQuarterSize * 0);
|
||||
uint8_t* chunkBufferPointer_1 = (uint8_t*)pBuffer[iFrame] + (iRow * nChunkSize) + (nFrameQuarterSize * 1);
|
||||
uint8_t* chunkBufferPointer_2 = (uint8_t*)pBuffer[iFrame] + (iRow * nChunkSize) + (nFrameQuarterSize * 2);
|
||||
uint8_t* chunkBufferPointer_3 = (uint8_t*)pBuffer[iFrame] + (iRow * nChunkSize) + (nFrameQuarterSize * 3);
|
||||
|
||||
BUFFER_DATA_CHUNK &dataChunk_0 = dataChunks[iRow * 4 + 0];
|
||||
BUFFER_DATA_CHUNK &dataChunk_1 = dataChunks[iRow * 4 + 1];
|
||||
BUFFER_DATA_CHUNK &dataChunk_2 = dataChunks[iRow * 4 + 2];
|
||||
BUFFER_DATA_CHUNK &dataChunk_3 = dataChunks[iRow * 4 + 3];
|
||||
|
||||
dataChunk_0 = { chunkBufferPointer_0, nChunkSize };
|
||||
dataChunk_1 = { chunkBufferPointer_1, nChunkSize };
|
||||
dataChunk_2 = { chunkBufferPointer_2, nChunkSize };
|
||||
dataChunk_3 = { chunkBufferPointer_3, nChunkSize };
|
||||
}
|
||||
|
||||
FGSTATUS status = KYFG_BufferAnnounceChunks(cameraStreamHandle, // STREAM_HANDLE streamHandle
|
||||
dataChunks.data(),// BUFFER_DATA_CHUNK* pDataChunkArr,
|
||||
dataChunks.size(),// size_t nChunks,
|
||||
NULL,// void * pPrivate
|
||||
&streamBufferHandle[iFrame]);
|
||||
}
|
||||
|
||||
cameraConnected = KYTRUE;
|
||||
cameraReady = KYTRUE;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Camera isn't connected\n");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Start/Stop stream
|
||||
|
||||
while (c != 'e')
|
||||
{
|
||||
printf("\nSelect option:\n");
|
||||
printf("[s] %s stream\n", streamRunning ? "Stop" : "Start");
|
||||
printf("[v] CXP events %s\n", printCxp2Events ? "off" : "on");
|
||||
printf("[h] Heartbeats %s\n", printHeartbeats ? "off" : "on");
|
||||
#ifdef __linux__
|
||||
printf("[f] Generate SIGFPE signal (Devision by zero)\n");
|
||||
printf("[a] Generate SIGABRT signal (call abort() func)\n");
|
||||
#endif
|
||||
printf("[e] Exit\n");
|
||||
|
||||
c = BlockingInput();
|
||||
|
||||
if ('s' == c)
|
||||
{
|
||||
streamRunning = 1 - streamRunning;
|
||||
|
||||
if (streamRunning)
|
||||
{
|
||||
StartCamera(grabberIndex, cameraIndex);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Optional: collect some statistic before stopping
|
||||
int64_t RXFrameCounter = KYFG_GetGrabberValueInt(camHandleArray[grabberIndex][cameraIndex], "RXFrameCounter");
|
||||
int64_t DropFrameCounter = KYFG_GetGrabberValueInt(camHandleArray[grabberIndex][cameraIndex], "DropFrameCounter");
|
||||
int64_t RXPacketCounter = KYFG_GetGrabberValueInt(camHandleArray[grabberIndex][cameraIndex], "RXPacketCounter");
|
||||
int64_t DropPacketCounter = KYFG_GetGrabberValueInt(camHandleArray[grabberIndex][cameraIndex], "DropPacketCounter");
|
||||
|
||||
printf("\nStream statistic:\n");
|
||||
printf("RXFrameCounter: %" PRId64 "\n", RXFrameCounter);
|
||||
printf("DropFrameCounter: %" PRId64 "\n", DropFrameCounter);
|
||||
printf("RXPacketCounter: %" PRId64 "\n", RXPacketCounter);
|
||||
printf("DropPacketCounter: %" PRId64 "\n", DropPacketCounter);
|
||||
|
||||
KYFG_CameraStop(camHandleArray[grabberIndex][cameraIndex]);
|
||||
}
|
||||
}
|
||||
|
||||
if ('h' == c)
|
||||
{
|
||||
printHeartbeats = 1 - printHeartbeats; // Toggle 'printHeartbeats' between 0 and 1
|
||||
}
|
||||
|
||||
if ('v' == c)
|
||||
{
|
||||
printCxp2Events = 1 - printCxp2Events; // Toggle 'printCxp2Events' between 0 and 1
|
||||
}
|
||||
#ifdef __linux__
|
||||
if ('a' == c)
|
||||
{
|
||||
abort();
|
||||
}
|
||||
if ('f' == c)
|
||||
{
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wdiv-by-zero"
|
||||
int fail = 5 / 0;
|
||||
#pragma GCC diagnostic pop
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// Close grabbers
|
||||
|
||||
CloseGrabbers();
|
||||
|
||||
// Clean-up all open resources
|
||||
|
||||
if (grabbersInfoArray)
|
||||
{
|
||||
free(grabbersInfoArray); // Release grabbers info
|
||||
}
|
||||
|
||||
if (cameraInfoArray)
|
||||
{
|
||||
free(cameraInfoArray); // Release cameras info
|
||||
}
|
||||
|
||||
// Release pBuffer
|
||||
|
||||
for (int iFrame = 0; iFrame < _countof(streamBufferHandle); iFrame++)
|
||||
{
|
||||
if (pBuffer[iFrame])
|
||||
{
|
||||
_aligned_free(pBuffer[iFrame]);
|
||||
pBuffer[iFrame] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
Close(0);
|
||||
}
|
@@ -0,0 +1,168 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>15.0</VCProjectVersion>
|
||||
<ProjectGuid>{FF9E0F2E-C244-47BE-826F-F653429CE4A5}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>Deinterlacingfactorfour</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0.20348.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(KAYA_DEVENV_ROOT_DIR)\src\KYGlobal\KYGlobal.props" Condition="exists('$(KAYA_DEVENV_ROOT_DIR)\src\KYGlobal\KYGlobal.props')" />
|
||||
</ImportGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalIncludeDirectories>$(KAYA_VISION_POINT_INCLUDE_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>KYFGLib_vc141.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(KAYA_VISION_POINT_LIB_PATH);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<AdditionalIncludeDirectories>$(KAYA_VISION_POINT_INCLUDE_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>KYFGLibD_vc141.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(KAYA_VISION_POINT_LIB_PATH);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Deinterlacing_factor_four.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
@@ -0,0 +1,760 @@
|
||||
// GenTLCheck.cpp : Defines the entry point for the console application.
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#define SIZE_WIDTH 1920
|
||||
#define SIZE_HEIGHT 1080
|
||||
#define CAMERA_XML_ACQUISITION_START_REG 0x1005C
|
||||
#define CAMERA_XML_ACQUISITION_STOP_REG 0x1005C
|
||||
|
||||
|
||||
#define BUFFER_AMOUNT 16
|
||||
|
||||
#define STREAM_CALLBACK_COUNT 0 // 0- infinate
|
||||
// #define BLOCK_STREAM
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "windows.h"
|
||||
#include <conio.h>
|
||||
#else
|
||||
#define MAX_PATH 256
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <string.h>
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <termios.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#include <thread>
|
||||
#include <unistd.h>
|
||||
#define Sleep(ms) usleep(ms * 1000)
|
||||
|
||||
|
||||
|
||||
|
||||
int _kbhit (void)
|
||||
{
|
||||
struct timeval tv;
|
||||
fd_set rdfs;
|
||||
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 0;
|
||||
|
||||
FD_ZERO(&rdfs);
|
||||
FD_SET (STDIN_FILENO, &rdfs);
|
||||
|
||||
select(STDIN_FILENO+1, &rdfs, NULL, NULL, &tv);
|
||||
return FD_ISSET(STDIN_FILENO, &rdfs);
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#include "GenTL_v1_5.h"
|
||||
#include "hwcti.h"
|
||||
#include "ky_os.h"
|
||||
|
||||
ky_lib hcti = NULL;
|
||||
tl_calls tl;
|
||||
|
||||
using namespace GenTL;
|
||||
|
||||
#define MAX_INTERFACES 8
|
||||
|
||||
struct EventDataStruct
|
||||
{
|
||||
DS_HANDLE m_hStream;
|
||||
EVENT_HANDLE m_Hevent;
|
||||
};
|
||||
|
||||
TL_HANDLE hTL = nullptr;
|
||||
uint32_t interfaceIndex = 0;
|
||||
|
||||
struct InterfaceInfo
|
||||
{
|
||||
// Inderface device
|
||||
IF_HANDLE hIface = GENTL_INVALID_HANDLE;
|
||||
DEV_HANDLE hDev = GENTL_INVALID_HANDLE;
|
||||
// Camera port
|
||||
PORT_HANDLE hDevice = GENTL_INVALID_HANDLE;
|
||||
// Stream
|
||||
DS_HANDLE hStream = GENTL_INVALID_HANDLE;
|
||||
// Event
|
||||
EVENT_HANDLE hEvent = GENTL_INVALID_HANDLE; // new buffer event
|
||||
std::thread eventThread;
|
||||
EventDataStruct eventDataStruct;
|
||||
// Buffers
|
||||
BUFFER_HANDLE buffHandleArr[BUFFER_AMOUNT] = { GENTL_INVALID_HANDLE };
|
||||
unsigned char* buffArrPtr[BUFFER_AMOUNT] = { 0 };
|
||||
};
|
||||
|
||||
InterfaceInfo g_intefaceInfo;
|
||||
|
||||
|
||||
void PrintHelp(void)
|
||||
{
|
||||
printf("\n\r=============================================\n\r"
|
||||
"? - help\n\r"
|
||||
"[0-7]-select and open interface\n\r"
|
||||
"l - close interface\n\r"
|
||||
#ifndef BLOCK_STREAM
|
||||
"s - start\n\r"
|
||||
"t - stop\n\r"
|
||||
"k - test event kill\n\r"
|
||||
#endif
|
||||
"r <address> - read camera register\n\r"
|
||||
"w <address> <value> - write camera register\n\r"
|
||||
"x - extract camera xml file\n\r"
|
||||
"g - extract grabber xml file\n\r"
|
||||
|
||||
"e - exit\n\r"
|
||||
"=============================================\n\r"
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
bool InitLib( void )
|
||||
{
|
||||
#ifdef _WIN32
|
||||
static const char* szKayaLibFolderEnv = "KAYA_VISION_POINT_BIN_PATH";
|
||||
static const char chPatSep = '\\';
|
||||
static const std::string sKayaLibCtiFile = "KYFGLibGenTL_vc141.cti";
|
||||
#elif defined(__linux__)
|
||||
static const char* szKayaLibFolderEnv = "KAYA_VISION_POINT_LIB_PATH";
|
||||
static const char chPatSep = '/';
|
||||
static const std::string sKayaLibCtiFile = "libKYFGLibGenTL.cti";
|
||||
#endif
|
||||
|
||||
char* kayaLibEnv = getenv(szKayaLibFolderEnv);
|
||||
std::string sKayaLibEnv(kayaLibEnv);
|
||||
std::string cti = sKayaLibEnv + chPatSep + sKayaLibCtiFile;
|
||||
|
||||
ky_load_lib(cti.c_str(), hcti);
|
||||
if (!hcti)
|
||||
{
|
||||
printf("The cti file %s failed to load\n\r", cti.c_str());
|
||||
getchar();
|
||||
return false;
|
||||
}
|
||||
|
||||
LOAD_SYMBOLS(tl, hcti);
|
||||
|
||||
// Initiate GenTL library
|
||||
tl.GCInitLib();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
//3.8.3 OpenTL
|
||||
//Retrieve TL Handle
|
||||
TL_HANDLE OpenTL( void )
|
||||
{
|
||||
tl.TLOpen( &hTL );
|
||||
return hTL;
|
||||
}
|
||||
|
||||
//3.8.4 OpenInterface
|
||||
//Retrieve first Interface Handle
|
||||
IF_HANDLE OpenInterface(TL_HANDLE hTL )
|
||||
{
|
||||
bool8_t changed;
|
||||
uint32_t NumInterfaces = 0;
|
||||
char IfaceID[20];
|
||||
size_t bufferSize = MAX_PATH;
|
||||
IF_HANDLE hNewIface;
|
||||
INFO_DATATYPE piType;
|
||||
char buffer[MAX_PATH];
|
||||
|
||||
tl.TLGetInfo(hTL,TL_INFO_PATHNAME, &piType, buffer, &bufferSize);
|
||||
// printf("dll path: %s\n", buffer);
|
||||
|
||||
bufferSize = 20;
|
||||
|
||||
tl.TLUpdateInterfaceList( hTL , &changed, 0);
|
||||
tl.TLGetNumInterfaces( hTL, &NumInterfaces );
|
||||
if ( NumInterfaces > interfaceIndex)
|
||||
{
|
||||
// Get inteface id string
|
||||
tl.TLGetInterfaceID( hTL, interfaceIndex, IfaceID, &bufferSize );
|
||||
// Open interface with index 0
|
||||
tl.TLOpenInterface( hTL, IfaceID, &hNewIface );
|
||||
/*bufferSize = MAX_PATH;
|
||||
tl.GCGetPortInfo(hNewIface,PORT_INFO_MODULE, &piType, buffer, &bufferSize);
|
||||
printf("module name: %s\n", buffer);*/
|
||||
|
||||
return hNewIface;
|
||||
}
|
||||
else
|
||||
{
|
||||
return GENTL_INVALID_HANDLE;
|
||||
}
|
||||
}
|
||||
|
||||
//3.8.5 OpenFirstDevice
|
||||
//Retrieve first Device Handle
|
||||
PORT_HANDLE OpenFirstDevice( IF_HANDLE hIF )
|
||||
{
|
||||
bool8_t changed;
|
||||
uint32_t NumDevices = 0;
|
||||
char DeviceID[20];
|
||||
size_t bufferSize = 20;
|
||||
DEV_HANDLE hNewDevice;
|
||||
//PORT_HANDLE phRemoteDevice;
|
||||
|
||||
tl.IFUpdateDeviceList( hIF , &changed, 0 );
|
||||
tl.IFGetNumDevices( hIF, &NumDevices );
|
||||
|
||||
if ( NumDevices > 0 )
|
||||
{
|
||||
// First query the buffer size
|
||||
tl.IFGetDeviceID( hIF, 0, DeviceID, &bufferSize );
|
||||
long result = 0;
|
||||
INFO_DATATYPE piType;
|
||||
size_t pSize = 20;
|
||||
tl.IFGetDeviceInfo( hIF, DeviceID, DEVICE_INFO_ACCESS_STATUS, &piType, &result , &pSize);
|
||||
// Open interface with index 0
|
||||
tl.IFOpenDevice( hIF, DeviceID, DEVICE_ACCESS_CONTROL , &hNewDevice );
|
||||
|
||||
return hNewDevice;
|
||||
}
|
||||
else
|
||||
{
|
||||
return GENTL_INVALID_HANDLE;
|
||||
}
|
||||
}
|
||||
|
||||
//3.8.6 OpenFirstDataStream
|
||||
//Retrieve first data Stream
|
||||
DS_HANDLE OpenFirstDataStream( DEV_HANDLE hDev )
|
||||
{
|
||||
uint32_t NumStreams = 0;
|
||||
char StreamID[20];
|
||||
size_t buffersize = 20;
|
||||
DS_HANDLE hNewStream;
|
||||
GC_ERROR errorResult;
|
||||
|
||||
// Retrieve the number of Data Stream
|
||||
tl.DevGetNumDataStreams( hDev, &NumStreams );
|
||||
if ( NumStreams > 0 )
|
||||
{
|
||||
// Get ID of first stream using
|
||||
errorResult = tl.DevGetDataStreamID( hDev, 0, StreamID, &buffersize );
|
||||
// Instantiate Data Stream
|
||||
errorResult = tl.DevOpenDataStream( hDev, StreamID, &hNewStream );
|
||||
return hNewStream;
|
||||
}
|
||||
else
|
||||
{
|
||||
return GENTL_INVALID_HANDLE;
|
||||
}
|
||||
}
|
||||
|
||||
void OpenDataBuffer(InterfaceInfo* pInterfaceInfo)
|
||||
{
|
||||
size_t dataStreamPayloadSize = 0;
|
||||
size_t iSize = sizeof(dataStreamPayloadSize);
|
||||
INFO_DATATYPE iType;
|
||||
tl.DSGetInfo(pInterfaceInfo->hStream, STREAM_INFO_PAYLOAD_SIZE, &iType, &dataStreamPayloadSize, &iSize );
|
||||
|
||||
for(size_t i = 0 ; i < BUFFER_AMOUNT; ++i)
|
||||
{
|
||||
pInterfaceInfo->buffArrPtr[i] = (unsigned char*)_aligned_malloc(dataStreamPayloadSize, 4096);
|
||||
tl.DSAnnounceBuffer(pInterfaceInfo->hStream, pInterfaceInfo->buffArrPtr[i], dataStreamPayloadSize, nullptr, &pInterfaceInfo->buffHandleArr[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CloseDataBuffer(InterfaceInfo* pInterfaceInfo)
|
||||
{
|
||||
if (!pInterfaceInfo->hStream)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < BUFFER_AMOUNT; ++i)
|
||||
{
|
||||
if (pInterfaceInfo->buffArrPtr[i])
|
||||
{
|
||||
_aligned_free(pInterfaceInfo->buffArrPtr[i]);
|
||||
pInterfaceInfo->buffArrPtr[i] = nullptr;
|
||||
pInterfaceInfo->buffHandleArr[i] = GENTL_INVALID_HANDLE;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
EVENT_HANDLE OpenBufferEvent(DS_HANDLE hStream)
|
||||
{
|
||||
EVENT_HANDLE eventHand;
|
||||
tl.GCRegisterEvent(hStream, EVENT_NEW_BUFFER, &eventHand);
|
||||
//DSStartAcquisition(hStream, 0, GENTL_INFINITE);
|
||||
return eventHand;
|
||||
}
|
||||
|
||||
void CloseBufferEvent(DS_HANDLE hStream)
|
||||
{
|
||||
tl.GCUnregisterEvent(hStream, EVENT_NEW_BUFFER);
|
||||
}
|
||||
|
||||
void CloseDataStream (DS_HANDLE hStream )
|
||||
{
|
||||
if (GENTL_INVALID_HANDLE == hStream)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
tl.DSClose( hStream );
|
||||
}
|
||||
|
||||
void CloseDevice(DEV_HANDLE hDevice )
|
||||
{
|
||||
if (GENTL_INVALID_HANDLE == hDevice)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
tl.DevClose( hDevice );
|
||||
}
|
||||
|
||||
void CloseInterface(IF_HANDLE hIface )
|
||||
{
|
||||
if (GENTL_INVALID_HANDLE == hIface)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
tl.IFClose( hIface );
|
||||
}
|
||||
|
||||
void CloseTL(TL_HANDLE hTL )
|
||||
{
|
||||
if (GENTL_INVALID_HANDLE == hTL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
tl.TLClose( hTL );
|
||||
}
|
||||
|
||||
void CloseLib( void )
|
||||
{
|
||||
tl.GCCloseLib( );
|
||||
}
|
||||
|
||||
int32_t ReadGenTLValue(PORT_HANDLE hDev, uint64_t address, uint32_t* value)
|
||||
{
|
||||
size_t size = sizeof(uint32_t);
|
||||
*value = 0;
|
||||
GC_ERROR err = tl.GCReadPort(hDev, address, value, &size);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
int32_t WriteGenTLValue(PORT_HANDLE hDev, uint64_t address, uint32_t value)
|
||||
{
|
||||
size_t size = sizeof(uint32_t);
|
||||
GC_ERROR err = tl.GCWritePort(hDev, address, &value, &size);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
void splitString(const std::string &s, const char delim, std::vector<std::string> &elems)
|
||||
{
|
||||
std::stringstream ss(s);
|
||||
std::string item;
|
||||
while (std::getline(ss, item, delim))
|
||||
{
|
||||
elems.push_back(item);
|
||||
}
|
||||
}
|
||||
|
||||
void Test_XML(PORT_HANDLE hDev)
|
||||
{
|
||||
const uint32_t MAX_CAM_XML_STRING_LENGTH = 256;
|
||||
const uint32_t DEVICE_XMLURL_REG = 0x00000018;
|
||||
|
||||
size_t size = 4;
|
||||
size_t size2 = 4;
|
||||
|
||||
|
||||
uint32_t maxStrLength = MAX_CAM_XML_STRING_LENGTH;
|
||||
char xmlAddrString[MAX_CAM_XML_STRING_LENGTH] = {0};
|
||||
char xmlAddrString2[MAX_CAM_XML_STRING_LENGTH] = {0};
|
||||
|
||||
size = MAX_CAM_XML_STRING_LENGTH;
|
||||
GC_ERROR err = tl.GCGetPortURL(hDev, xmlAddrString, &size);
|
||||
|
||||
// size2 = MAX_CAM_XML_STRING_LENGTH;
|
||||
// INFO_DATATYPE iType;
|
||||
// GC_ERROR err2 = tl.GCGetPortURLInfo(hDev, 0, URL_INFO_URL, &iType, xmlAddrString2, &size2);
|
||||
|
||||
if(err != GC_ERR_SUCCESS)
|
||||
{
|
||||
printf("Cann't read URL\n");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("URL: %s\n", xmlAddrString);
|
||||
}
|
||||
|
||||
std::string xmlUrl(xmlAddrString);
|
||||
|
||||
std::vector<std::string> xmlUrlSplit;
|
||||
splitString(xmlUrl, ';', xmlUrlSplit);
|
||||
|
||||
uint64_t xmlFileSize = 0, xmlFileLocation = 0;
|
||||
|
||||
sscanf_s(xmlUrlSplit.at(1).c_str(), "%llx", &xmlFileLocation); // read xml file address
|
||||
sscanf_s(xmlUrlSplit.at(2).c_str(), "%llx", &xmlFileSize); // read xml file size
|
||||
|
||||
|
||||
static const char* xmlExtXml = ".xml";
|
||||
static const char* xmlExtZip = ".zip";
|
||||
|
||||
#ifdef _WIN32
|
||||
static const char* sXmlOutputFilePath = "C:/Temp/GenTLTestXML";
|
||||
#elif defined(__linux__)
|
||||
static const char* sXmlOutputFilePath = "/tmp/GenTLTestXML";
|
||||
#endif
|
||||
|
||||
std::string xmlOutFileName(sXmlOutputFilePath);
|
||||
if (std::string::npos != xmlUrlSplit.at(0).find(xmlExtXml))
|
||||
{
|
||||
xmlOutFileName += std::string(xmlExtXml);
|
||||
}
|
||||
else if(std::string::npos != xmlUrlSplit.at(0).find(xmlExtZip))
|
||||
{
|
||||
xmlOutFileName += std::string(xmlExtZip);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Failed to find xml file extension\n\r");
|
||||
return;
|
||||
}
|
||||
|
||||
char* xmlString = new char[xmlFileSize + 1];
|
||||
|
||||
GC_ERROR err3 = tl.GCReadPort(hDev, xmlFileLocation, xmlString, &xmlFileSize);
|
||||
|
||||
FILE* outFile = NULL;
|
||||
outFile = fopen(xmlOutFileName.c_str(), "wb");
|
||||
if (outFile) // write to file only if it was opened
|
||||
{
|
||||
fwrite(xmlString, 1, xmlFileSize, outFile);
|
||||
fclose(outFile);
|
||||
}
|
||||
|
||||
delete [] xmlString;
|
||||
}
|
||||
|
||||
void Test_EventKill(EVENT_HANDLE eventHandle)
|
||||
{
|
||||
tl.EventKill(eventHandle);
|
||||
}
|
||||
|
||||
unsigned int event_thread_impl(void * pData)
|
||||
{
|
||||
EventDataStruct* eventDataStruct = (EventDataStruct*)pData;
|
||||
EVENT_HANDLE eHandle = eventDataStruct->m_Hevent;
|
||||
|
||||
uint8_t buffer[100];
|
||||
size_t bufferSize = sizeof(buffer);
|
||||
int counter = STREAM_CALLBACK_COUNT;
|
||||
|
||||
GC_ERROR error;
|
||||
do {
|
||||
error = tl.EventGetData(eHandle, buffer, &bufferSize, GENTL_INFINITE);
|
||||
BUFFER_HANDLE bufferHandle = ((EVENT_NEW_BUFFER_DATA*)buffer)->BufferHandle;
|
||||
printf("Event ended for buffer 0x%p with error=%d\n\r", bufferHandle, error);
|
||||
|
||||
tl.DSQueueBuffer(eventDataStruct->m_hStream, bufferHandle);
|
||||
|
||||
} while (
|
||||
(error == GC_ERR_SUCCESS)
|
||||
&&
|
||||
|
||||
#if (0==STREAM_CALLBACK_COUNT)
|
||||
(1)
|
||||
#else
|
||||
(--counter > 0)
|
||||
#endif
|
||||
);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void Test_AcquisitionStart(InterfaceInfo* pInterfaceInfo)
|
||||
{
|
||||
if (pInterfaceInfo->hStream != GENTL_INVALID_HANDLE)
|
||||
{
|
||||
// data stream already allocated, first delete data stream
|
||||
return;
|
||||
}
|
||||
|
||||
// create data stream
|
||||
pInterfaceInfo->hStream = OpenFirstDataStream(pInterfaceInfo->hDev);
|
||||
|
||||
// allocated stream buffers
|
||||
OpenDataBuffer(pInterfaceInfo);
|
||||
|
||||
// create stream event and thread
|
||||
pInterfaceInfo->hEvent = OpenBufferEvent(pInterfaceInfo->hStream);
|
||||
pInterfaceInfo->eventDataStruct.m_Hevent = pInterfaceInfo->hEvent;
|
||||
pInterfaceInfo->eventDataStruct.m_hStream = pInterfaceInfo->hStream;
|
||||
pInterfaceInfo->eventThread = std::thread(event_thread_impl, &pInterfaceInfo->eventDataStruct);
|
||||
|
||||
|
||||
tl.DSFlushQueue(pInterfaceInfo->hStream, ACQ_QUEUE_ALL_TO_INPUT);
|
||||
|
||||
tl.DSStartAcquisition(pInterfaceInfo->hStream, 0, GENTL_INFINITE);
|
||||
|
||||
// send "AcquisitionStart" to camera
|
||||
const uint32_t startAcquisitionReg = 1;
|
||||
size_t startAcquisitionRegSize = sizeof(startAcquisitionReg);
|
||||
const uint64_t startAcquisitionRegAddr = CAMERA_XML_ACQUISITION_START_REG;
|
||||
|
||||
|
||||
tl.GCWritePort(pInterfaceInfo->hDevice, startAcquisitionRegAddr, &startAcquisitionReg, &startAcquisitionRegSize); // start acquisition
|
||||
}
|
||||
|
||||
void Test_AcquisitionStop(InterfaceInfo* pInterfaceInfo)
|
||||
{
|
||||
if (pInterfaceInfo->hStream == GENTL_INVALID_HANDLE)
|
||||
{
|
||||
// No data stream available
|
||||
return;
|
||||
}
|
||||
|
||||
// send "AcquisitionStop" to camera
|
||||
const uint32_t stopAcquisitionReg = 0;
|
||||
size_t stopAcquisitionRegSize = sizeof(stopAcquisitionReg);
|
||||
const uint64_t stopAcquisitionRegAddr = CAMERA_XML_ACQUISITION_STOP_REG;
|
||||
|
||||
tl.GCWritePort(pInterfaceInfo->hDevice, stopAcquisitionRegAddr, &stopAcquisitionReg, &stopAcquisitionRegSize); // stop acquisition
|
||||
|
||||
tl.DSStopAcquisition(pInterfaceInfo->hStream, 0);
|
||||
// tl.GCUnregisterEvent(newEvent, 1);
|
||||
tl.DSFlushQueue(pInterfaceInfo->hStream, ACQ_QUEUE_ALL_DISCARD);
|
||||
|
||||
|
||||
CloseBufferEvent(pInterfaceInfo->hStream);
|
||||
pInterfaceInfo->hEvent = GENTL_INVALID_HANDLE;
|
||||
|
||||
// wait for eventThread to terminate
|
||||
std::cout << "eventThread's id: " << pInterfaceInfo->eventThread.get_id() << '\n';
|
||||
if (pInterfaceInfo->eventThread.joinable())
|
||||
{
|
||||
pInterfaceInfo->eventThread.join();
|
||||
}
|
||||
|
||||
CloseDataBuffer(pInterfaceInfo);
|
||||
CloseDataStream(pInterfaceInfo->hStream);
|
||||
pInterfaceInfo->hStream = GENTL_INVALID_HANDLE;
|
||||
}
|
||||
|
||||
struct ResourceReleaser
|
||||
{
|
||||
ResourceReleaser(InterfaceInfo* pInterfaceInfo)
|
||||
: m_interfaceInfo(pInterfaceInfo)
|
||||
{
|
||||
}
|
||||
~ResourceReleaser()
|
||||
{
|
||||
ReleaseInterface();
|
||||
|
||||
CloseTL(hTL);
|
||||
hTL = GENTL_INVALID_HANDLE;
|
||||
|
||||
CloseLib();
|
||||
ky_free_lib(hcti);
|
||||
}
|
||||
void ReleaseInterface()
|
||||
{
|
||||
Test_AcquisitionStop(m_interfaceInfo);
|
||||
|
||||
CloseDevice(m_interfaceInfo->hDevice);
|
||||
m_interfaceInfo->hDevice = GENTL_INVALID_HANDLE;
|
||||
|
||||
CloseInterface(m_interfaceInfo->hIface);
|
||||
m_interfaceInfo->hIface = GENTL_INVALID_HANDLE;
|
||||
}
|
||||
|
||||
InterfaceInfo* m_interfaceInfo;
|
||||
|
||||
}; // struct ResourceReleaser
|
||||
|
||||
struct OpenScopeQuard
|
||||
{
|
||||
OpenScopeQuard(ResourceReleaser& handlesReleaser)
|
||||
: m_refHandlesReleaser(handlesReleaser)
|
||||
, m_ScopeSucceeded(false)
|
||||
{ }
|
||||
|
||||
~OpenScopeQuard()
|
||||
{
|
||||
if (!m_ScopeSucceeded)
|
||||
{
|
||||
m_refHandlesReleaser.ReleaseInterface();
|
||||
}
|
||||
}
|
||||
|
||||
ResourceReleaser& m_refHandlesReleaser;
|
||||
bool m_ScopeSucceeded;
|
||||
};
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
GC_ERROR ret_code;
|
||||
char choice = 0;
|
||||
|
||||
// Automatically release resources when this scope exits:
|
||||
ResourceReleaser resourceReleaser(&g_intefaceInfo);
|
||||
|
||||
if (!InitLib())
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
hTL = OpenTL();
|
||||
|
||||
PrintHelp();
|
||||
while(choice != 'e')
|
||||
{
|
||||
Sleep(1);
|
||||
if(_kbhit())
|
||||
{
|
||||
choice=getchar();
|
||||
printf("\nGenTL>%c\n", choice);
|
||||
if (choice >= '0' && choice <= '7') // Open selected interface
|
||||
{
|
||||
resourceReleaser.ReleaseInterface(); // release old interface
|
||||
|
||||
OpenScopeQuard openScopeQuard(resourceReleaser);
|
||||
|
||||
interfaceIndex = choice - '0';
|
||||
printf("Openning interface #%d\n", interfaceIndex);
|
||||
|
||||
g_intefaceInfo.hIface = OpenInterface(hTL);
|
||||
if (!g_intefaceInfo.hIface)
|
||||
{
|
||||
printf("Failed to find Frame Grabber\n");
|
||||
|
||||
getchar();
|
||||
continue;
|
||||
}
|
||||
printf("Successfully found Frame Grabber\n");
|
||||
|
||||
g_intefaceInfo.hDev = OpenFirstDevice(g_intefaceInfo.hIface);
|
||||
if (!g_intefaceInfo.hDev)
|
||||
{
|
||||
printf("Failed to find remote device\n");
|
||||
|
||||
getchar();
|
||||
continue;
|
||||
}
|
||||
|
||||
tl.DevGetPort(g_intefaceInfo.hDev, &g_intefaceInfo.hDevice);
|
||||
if (!g_intefaceInfo.hDevice)
|
||||
{
|
||||
printf("Failed to find Camera\n");
|
||||
|
||||
getchar();
|
||||
continue;
|
||||
}
|
||||
printf("Successfully found Camera\n");
|
||||
|
||||
openScopeQuard.m_ScopeSucceeded = true;
|
||||
|
||||
}//if (choice >= '0' && choice <= '7')
|
||||
else
|
||||
switch (choice)
|
||||
{
|
||||
case '?':
|
||||
PrintHelp();
|
||||
break;
|
||||
case 'l': // Close interface
|
||||
resourceReleaser.ReleaseInterface();
|
||||
break;
|
||||
case 'g': // Test_XML(hIface) (grabber)
|
||||
Test_XML(g_intefaceInfo.hIface);
|
||||
break;
|
||||
case 'x': // Test_XML(hDevice) (camera)
|
||||
Test_XML(g_intefaceInfo.hDevice);
|
||||
break;
|
||||
case 'r': // ReadGenTLValue
|
||||
{
|
||||
uint64_t address = 0;
|
||||
uint32_t value = 0;
|
||||
size_t size = 0;
|
||||
|
||||
printf("Address(hex): ");
|
||||
std::cin >> std::hex >> address;
|
||||
ret_code = ReadGenTLValue(g_intefaceInfo.hDevice, address, &value);
|
||||
if (ret_code == GC_ERR_SUCCESS)
|
||||
{
|
||||
printf("Successfully reg read value(dec) = %d\n", value);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Reg read error = %d\n", ret_code);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'w': // WriteGenTLValue
|
||||
{
|
||||
uint64_t address = 0;
|
||||
uint32_t value = 0;
|
||||
size_t size = 0;
|
||||
|
||||
printf("Address(hex): ");
|
||||
std::cin >> std::hex >> address;
|
||||
printf("value(dec): ");
|
||||
std::cin >> std::dec >> value;
|
||||
ret_code = WriteGenTLValue(g_intefaceInfo.hDevice, address, value);
|
||||
if (ret_code == GC_ERR_SUCCESS)
|
||||
{
|
||||
printf("Successfully reg write value(dec) = %d\n", value);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Reg write error = %d\n", ret_code);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
#ifndef BLOCK_STREAM
|
||||
case 'k': // Test_EventKill
|
||||
Test_EventKill(g_intefaceInfo.hEvent);
|
||||
break;
|
||||
|
||||
case 't': // "AcquisitionStop"
|
||||
{
|
||||
Test_AcquisitionStop(&g_intefaceInfo);
|
||||
break;
|
||||
}
|
||||
case 's': // "AcquisitionStart"
|
||||
{
|
||||
Test_AcquisitionStart(&g_intefaceInfo);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}//switch (choice)
|
||||
|
||||
}//if(_kbhit())
|
||||
}//while(choice != 'e')
|
||||
|
||||
// resourceReleaser will release all opened handles upon exiting
|
||||
|
||||
return 0;
|
||||
}
|
@@ -0,0 +1,169 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{CCCE30E1-6EE7-44BC-B339-E5C9EFED70C8}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>GenTLCheck</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
|
||||
<ProjectName>GenTLSimpleTest</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(KAYA_DEVENV_ROOT_DIR)\src\KYGlobal\KYGlobal.props" Condition="exists('$(KAYA_DEVENV_ROOT_DIR)\src\KYGlobal\KYGlobal.props')" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<CompileAs>CompileAsCpp</CompileAs>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>
|
||||
</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>rem xcopy "$(ProjectDir)..\KYFGLibGenTL\Release_vc14164\KYFGLibGenTL_vc141.dll" "$(ProjectDir)..\..\TESTDIR\$(Platform)\Common\Bin\" /Y /I /D</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<CompileAs>CompileAsCpp</CompileAs>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<Text Include="ReadMe.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="GenTL_v1_5.h" />
|
||||
<ClInclude Include="hwcti.h" />
|
||||
<ClInclude Include="ky_os.h" />
|
||||
<ClInclude Include="stdafx.h" />
|
||||
<ClInclude Include="targetver.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="GenTLCheck.cpp" />
|
||||
<ClCompile Include="stdafx.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
@@ -0,0 +1,791 @@
|
||||
/****************************************************************************
|
||||
(c) 2004-2015 by GenICam GenTL Subcommittee
|
||||
|
||||
License: This file is published under the license of the EMVA GenICam Standard Group.
|
||||
A text file describing the legal terms is included in your installation as 'license.txt'.
|
||||
If for some reason you are missing this file please contact the EMVA or visit the website
|
||||
(http://www.genicam.org) for a full copy.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP
|
||||
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
/* \file GenTL.h
|
||||
* \brief GenICam Transport Layer Client Interface
|
||||
* \version 1.5
|
||||
* \author GenTL Subcommittee
|
||||
* \date 2015
|
||||
*
|
||||
* \par Version history
|
||||
* \li Version 0.1.0 First official version from the meeting in Pilsen
|
||||
* \li Version 0.1.1 rst (SI) 0.4.160
|
||||
* - added _E_INTERFACE_INFO_CMD_LIST_T_ enum name
|
||||
* - added _E_DEVICE_ACCCESS_STATUS_TYPE_T_ to be used
|
||||
* with the /a IFGetDeviceInfo and DevGetInfo
|
||||
* - rename of the enum value DEVICE_INFO_ACCESSMODE to
|
||||
* DEVICE_INFO_ACCESS_STATUS which now refers to
|
||||
* _E_DEVICE_ACCCESS_STATUS_TYPE_T_
|
||||
* - added Timeout parameter to update interface list and
|
||||
* device list.
|
||||
* \li Version 0.1.2 - change datatype of timeout parameter of
|
||||
* TLUpdateInterfaceList and IFUpdateDeviceList to
|
||||
* uint64_t to match with the timeout in the event object.
|
||||
* - changed all enums to have a typedef to uint32_t
|
||||
* with them to allow custom ids
|
||||
* - changed type of string constants to be char * instead
|
||||
* of gcstring
|
||||
* \li Version 0.1.3 rst (SI), cbi (IDS) 0.4.163
|
||||
* - adjusted parameter names to be closer aligned with
|
||||
* the standard text
|
||||
* - changed typedefs for enums from uint32_t to int32_t
|
||||
* - removed default parameter
|
||||
* - added parameter name to DevGetPort function
|
||||
* \li Version 0.1.4 jb (LV)
|
||||
* - fixes to align the file with standard text
|
||||
* - make the file self-contained, independent on GenApi
|
||||
* \li Version 0.1.5 rst (SI) cbi (IDS) jb (LV) tho (MVTec)
|
||||
* - Adjust it for Linux
|
||||
* - Cosmetics
|
||||
* \li Version 1.0 rst (SI) cbi (IDS) jb (LV) tho (MVTec)
|
||||
* - Adjust for Standard 1.0
|
||||
* - Make it plain C compliant
|
||||
* - Cosmetics
|
||||
* \li Version 1.2 rst (SI) jb (LV) tho (MVTec)
|
||||
* - Adjust for Standard 1.2
|
||||
* - adjust packing
|
||||
* - Cosmetics
|
||||
* \li Version 1.3 (Stemmer, Leutron, Matrix Vision, MVTec, MathWorks)
|
||||
* - Adjust for Standard 1.3
|
||||
* - added chunk handling
|
||||
* - added Mac OS X
|
||||
* - Cosmetics
|
||||
* \li Version 1.3.1 (MathWorks)
|
||||
* - Spelling corrections in comments
|
||||
* \li Version 1.4 GenTL Subcommittee
|
||||
* \li Version 1.5 GenTL Subcommittee
|
||||
* - Changed namespace to GenTL
|
||||
* - Changes for GenTL 1.5, Please refer to the GenTL spec
|
||||
* for a list of changes.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef GC_TLI_CLIENT_H_
|
||||
#define GC_TLI_CLIENT_H_ 1
|
||||
|
||||
#ifndef GC_USER_DEFINED_TYPES
|
||||
/* The types should be the same as defined in GCTypes.h from GenApi. But in
|
||||
* case you do not have this header the necessary types are defined here. */
|
||||
# if defined(_WIN32)
|
||||
# if defined(_MSC_VER) && _MSC_VER >= 1600 /* VS2010 provides stdint.h */
|
||||
# include <stdint.h>
|
||||
# elif !defined _STDINT_H && !defined _STDINT
|
||||
/* stdint.h is usually not available under Windows */
|
||||
typedef unsigned char uint8_t;
|
||||
typedef __int32 int32_t;
|
||||
typedef unsigned __int32 uint32_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
# endif
|
||||
# else
|
||||
# include <stdint.h>
|
||||
# endif
|
||||
|
||||
# ifdef __cplusplus
|
||||
typedef bool bool8_t;
|
||||
# else
|
||||
typedef uint8_t bool8_t;
|
||||
# endif
|
||||
#endif /* GC_DEFINE_TYPES */
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
/* Function declaration modifiers */
|
||||
#if defined (_WIN32)
|
||||
# ifndef GCTLI_NO_DECLSPEC_STATEMENTS
|
||||
# ifdef GCTLIDLL
|
||||
# define GC_IMPORT_EXPORT __declspec(dllexport)
|
||||
# else
|
||||
# define GC_IMPORT_EXPORT __declspec(dllimport)
|
||||
# endif
|
||||
# else
|
||||
# define GC_IMPORT_EXPORT
|
||||
# endif /* # ifndef GCTLI_NO_DECLSPEC_STATEMENTS */
|
||||
# if defined (_M_IX86) || defined (__i386__)
|
||||
# define GC_CALLTYPE __stdcall
|
||||
# else
|
||||
# define GC_CALLTYPE /* default */
|
||||
# endif
|
||||
# ifndef EXTERN_C
|
||||
# define EXTERN_C extern "C"
|
||||
# endif
|
||||
|
||||
#elif defined (__GNUC__) && (__GNUC__ >= 4) && (defined (__linux__) || defined (__APPLE__))
|
||||
# define GC_IMPORT_EXPORT __attribute__((visibility("default")))
|
||||
# if defined (__i386__)
|
||||
# define GC_CALLTYPE __attribute__((stdcall))
|
||||
# else
|
||||
# define GC_CALLTYPE /* default */
|
||||
# endif
|
||||
# ifndef EXTERN_C
|
||||
# define EXTERN_C extern "C"
|
||||
# endif
|
||||
|
||||
#else
|
||||
# error Unknown platform, file needs adaption
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
namespace GenTL {
|
||||
#endif
|
||||
|
||||
/* Errors */
|
||||
enum GC_ERROR_LIST
|
||||
{
|
||||
GC_ERR_SUCCESS = 0,
|
||||
GC_ERR_ERROR = -1001,
|
||||
GC_ERR_NOT_INITIALIZED = -1002,
|
||||
GC_ERR_NOT_IMPLEMENTED = -1003,
|
||||
GC_ERR_RESOURCE_IN_USE = -1004,
|
||||
GC_ERR_ACCESS_DENIED = -1005,
|
||||
GC_ERR_INVALID_HANDLE = -1006,
|
||||
GC_ERR_INVALID_ID = -1007,
|
||||
GC_ERR_NO_DATA = -1008,
|
||||
GC_ERR_INVALID_PARAMETER = -1009,
|
||||
GC_ERR_IO = -1010,
|
||||
GC_ERR_TIMEOUT = -1011,
|
||||
GC_ERR_ABORT = -1012, /* GenTL v1.1 */
|
||||
GC_ERR_INVALID_BUFFER = -1013, /* GenTL v1.1 */
|
||||
GC_ERR_NOT_AVAILABLE = -1014, /* GenTL v1.2 */
|
||||
GC_ERR_INVALID_ADDRESS = -1015, /* GenTL v1.3 */
|
||||
GC_ERR_BUFFER_TOO_SMALL = -1016, /* GenTL v1.4 */
|
||||
GC_ERR_INVALID_INDEX = -1017, /* GenTL v1.4 */
|
||||
GC_ERR_PARSING_CHUNK_DATA = -1018, /* GenTL v1.4 */
|
||||
GC_ERR_INVALID_VALUE = -1019, /* GenTL v1.4 */
|
||||
GC_ERR_RESOURCE_EXHAUSTED = -1020, /* GenTL v1.4 */
|
||||
GC_ERR_OUT_OF_MEMORY = -1021, /* GenTL v1.4 */
|
||||
GC_ERR_BUSY = -1022, /* GenTL v1.5 */
|
||||
|
||||
GC_ERR_CUSTOM_ID = -10000
|
||||
};
|
||||
typedef int32_t GC_ERROR;
|
||||
|
||||
# ifndef GC_GENTL_HEADER_VERSION
|
||||
|
||||
# define GenTLMajorVersion 1 /* defines the major version of the GenICam GenTL standard version this header is based on */
|
||||
# define GenTLMinorVersion 5 /* defines the minor version of the GenICam GenTL standard version this header is based on */
|
||||
# define GenTLSubMinorVersion 0 /* defines the sub minor version of the GenICam GenTL standard version this header is based on */
|
||||
|
||||
# define GC_GENTL_HEADER_VERSION_CODE(major,minor,subminor) (((major)<<24)+((minor)<<16)+(subminor))
|
||||
# define GC_GENTL_HEADER_VERSION GC_GENTL_HEADER_VERSION_CODE(GenTLMajorVersion,GenTLMinorVersion,GenTLSubMinorVersion)
|
||||
|
||||
# endif /* GC_GENTL_HEADER_VERSION */
|
||||
|
||||
# ifndef GC_GENTL_DONT_USE_TYPE_DEFINITIONS
|
||||
# define TLTypeMixedName "Mixed" /* Type to use for several supported technologies */
|
||||
# define TLTypeCustomName "Custom" /* Type to use for custom technologies */
|
||||
# define TLTypeGEVName "GEV" /* Type to use for GigE Vision technology */
|
||||
# define TLTypeCLName "CL" /* Type to use for Camera Link technology */
|
||||
# define TLTypeIIDCName "IIDC" /* Type to use for IIDC 1394 technology */
|
||||
# define TLTypeUVCName "UVC" /* Type to use for USB video class devices */
|
||||
# define TLTypeCXPName "CXP" /* Type to use for CoaXPress, V1.3 */
|
||||
# define TLTypeCLHSName "CLHS" /* Type to use for Camera Link HS, V1.3 */
|
||||
# define TLTypeU3VName "U3V" /* Type to use for USB3 Vision Standard, V1.4 */
|
||||
# define TLTypeETHERNETName "Ethernet" /* Type to use for Ethernet devices, V1.3 */
|
||||
# define TLTypePCIName "PCI" /* Type to use for PCI/PCIe devices, V1.3 */
|
||||
# endif /* GC_GENTL_DONT_USE_TYPE_DEFINITIONS */
|
||||
|
||||
# ifndef GC_GENTL_DONT_USE_MODULE_NAMES
|
||||
# define TLSystemModuleName "TLSystem" /* Name to identify a system module */
|
||||
# define TLInterfaceModuleName "TLInterface" /* Name to identify a interface module */
|
||||
# define TLDeviceModuleName "TLDevice" /* Name to identify a device module */
|
||||
# define TLDataStreamModuleName "TLDataStream" /* Name to identify a data stream module */
|
||||
# define TLBufferModuleName "TLBuffer" /* Name to identify a buffer module */
|
||||
# define TLRemoteDeviceModuleName "Device" /* Name to identify a remote device module */
|
||||
# endif /* GC_GENTL_DONT_USE_MODULE_NAMES */
|
||||
|
||||
/* Handles */
|
||||
typedef void * TL_HANDLE; /* Transport Layer handle, obtained through the TLOpen */
|
||||
typedef void * IF_HANDLE; /* Interface handle, obtained through ::TLOpenInterface */
|
||||
typedef void * DEV_HANDLE; /* Device Handle, obtained through the ::IFOpenDevice */
|
||||
typedef void * DS_HANDLE; /* Handle to an image stream object, obtained through DevOpenDataStream */
|
||||
typedef void * PORT_HANDLE; /* A Port handle is used to access the register space of a port */
|
||||
/* a PORT_HANDLE can be one of the following TL_HANDLE, IF_HANDLE, */
|
||||
/* DEV_HANDLE, handle to a device port, obtained through ::DevGetPort, */
|
||||
/* DS_HANDLE, BUFFER_HANDLE */
|
||||
|
||||
typedef void * BUFFER_HANDLE; /* BufferHandle, obtained through the ::DSAnnounceBuffer function */
|
||||
typedef void * EVENTSRC_HANDLE; /* A Event source handle is used to register a OS Event and to retrieve a GenTL event handle */
|
||||
/* a EVENTSRC_HANDLE can be on of the following TL_HANDLE, */
|
||||
/* IF_HANDLE, DEV_HANDLE, A handle to a device port, obtained through ::DevGetPort */
|
||||
/* DS_HANDLE, BUFFER_HANDLE */
|
||||
typedef void * EVENT_HANDLE; /* Event Handle */
|
||||
|
||||
# define GENTL_INVALID_HANDLE NULL /* Invalid handle value, V1.4 */
|
||||
# define GENTL_INFINITE 0xFFFFFFFFFFFFFFFFULL /* Infinite value to be used in various function calls, V1.4 */
|
||||
|
||||
/* Defines the data type possible for the various Info functions. */
|
||||
enum INFO_DATATYPE_LIST
|
||||
{
|
||||
INFO_DATATYPE_UNKNOWN = 0, /* Unknown data type */
|
||||
INFO_DATATYPE_STRING = 1, /* NULL-terminated C string (ASCII encoded). */
|
||||
INFO_DATATYPE_STRINGLIST = 2, /* Concatenated INFO_DATATYPE_STRING list. End of list is signaled with an additional NULL. */
|
||||
INFO_DATATYPE_INT16 = 3, /* Signed 16 bit integer. */
|
||||
INFO_DATATYPE_UINT16 = 4, /* Unsigned 16 bit integer */
|
||||
INFO_DATATYPE_INT32 = 5, /* Signed 32 bit integer */
|
||||
INFO_DATATYPE_UINT32 = 6, /* Unsigned 32 bit integer */
|
||||
INFO_DATATYPE_INT64 = 7, /* Signed 64 bit integer */
|
||||
INFO_DATATYPE_UINT64 = 8, /* Unsigned 64 bit integer */
|
||||
INFO_DATATYPE_FLOAT64 = 9, /* Signed 64 bit floating point number. */
|
||||
INFO_DATATYPE_PTR = 10, /* Pointer type (void*). Size is platform dependent (32 bit on 32 bit platforms). */
|
||||
INFO_DATATYPE_BOOL8 = 11, /* Boolean value occupying 8 bit. 0 for false and anything for true. */
|
||||
INFO_DATATYPE_SIZET = 12, /* Platform dependent unsigned integer (32 bit on 32 bit platforms). */
|
||||
INFO_DATATYPE_BUFFER = 13, /* Like a INFO_DATATYPE_STRING but with arbitrary data and no NULL termination. */
|
||||
INFO_DATATYPE_PTRDIFF = 14, /* Platform dependent signed integer (32 bit on 32 bit platforms). GenTL v1.3 */
|
||||
|
||||
INFO_DATATYPE_CUSTOM_ID = 1000 /* Starting value for custom IDs. */
|
||||
};
|
||||
typedef int32_t INFO_DATATYPE;
|
||||
|
||||
/* Defines char encoding schemes used by the producer, GenTL v1.4 */
|
||||
enum TL_CHAR_ENCODING_LIST
|
||||
{
|
||||
TL_CHAR_ENCODING_ASCII = 0,
|
||||
TL_CHAR_ENCODING_UTF8 = 1
|
||||
};
|
||||
typedef int32_t TL_CHAR_ENCODING; /* GenTL v1.4 */
|
||||
|
||||
/* System module information commands for the GenICam::TL::Client::TLGetInfo and GenICam::TL::Client::GCGetInfo functions. */
|
||||
enum TL_INFO_CMD_LIST
|
||||
{
|
||||
TL_INFO_ID = 0, /* STRING Transport layer ID. */
|
||||
TL_INFO_VENDOR = 1, /* STRING Transport layer vendor name. */
|
||||
TL_INFO_MODEL = 2, /* STRING Transport layer model name. */
|
||||
TL_INFO_VERSION = 3, /* STRING Transport layer version. */
|
||||
TL_INFO_TLTYPE = 4, /* STRING Transport layer technology that is supported. */
|
||||
TL_INFO_NAME = 5, /* STRING File name including extension of the library. */
|
||||
TL_INFO_PATHNAME = 6, /* STRING Full path including file name and extension of the library. */
|
||||
TL_INFO_DISPLAYNAME = 7, /* STRING User readable name of the device. If this is not defined in the device this should be VENDOR MODEL (ID). */
|
||||
TL_INFO_CHAR_ENCODING = 8, /* INT32 Reporting the char encoding used by this Producer, GenTL v1.4 */
|
||||
TL_INFO_GENTL_VER_MAJOR = 9, /* UINT32 Major number of the GenTL spec this producer complies with, GenTL v1.5 */
|
||||
TL_INFO_GENTL_VER_MINOR = 10, /* UINT32 Minor number of the GenTL spec this producer complies with, GenTL v1.5 */
|
||||
TL_INFO_CUSTOM_ID = 1000 /* Starting value for custom IDs. */
|
||||
};
|
||||
typedef int32_t TL_INFO_CMD;
|
||||
|
||||
/* This enumeration defines commands to retrieve information with the GenICam::TL::Client::IFGetInfo function from the Interface module. */
|
||||
enum INTERFACE_INFO_CMD_LIST
|
||||
{
|
||||
INTERFACE_INFO_ID = 0, /* STRING Unique ID of the interface. */
|
||||
INTERFACE_INFO_DISPLAYNAME = 1, /* STRING User readable name of the interface. */
|
||||
INTERFACE_INFO_TLTYPE = 2, /* STRING Transport layer technology that is supported. */
|
||||
|
||||
INTERFACE_INFO_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */
|
||||
};
|
||||
typedef int32_t INTERFACE_INFO_CMD;
|
||||
|
||||
/* This enumeration defines flags of how a device is to be opened with the GenICam::TL::Client::IFOpenDevice function. */
|
||||
enum DEVICE_ACCESS_FLAGS_LIST
|
||||
{
|
||||
DEVICE_ACCESS_UNKNOWN = 0, /* Not used in a command. Can be used to initialize a variable to query that information. */
|
||||
DEVICE_ACCESS_NONE = 1, /* This either means that the device is not open because it was not opened before or the access to it was denied. */
|
||||
DEVICE_ACCESS_READONLY = 2, /* Open the device read only. All Port functions can only read from the device. */
|
||||
DEVICE_ACCESS_CONTROL = 3, /* Open the device in a way that other hosts/processes can have read only access to the device. Device access level is read/write for this process. */
|
||||
DEVICE_ACCESS_EXCLUSIVE = 4, /* Open the device in a way that only this host/process can have access to the device. Device access level is read/write for this process. */
|
||||
|
||||
DEVICE_ACCESS_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */
|
||||
};
|
||||
typedef int32_t DEVICE_ACCESS_FLAGS;
|
||||
|
||||
/* This enumeration defines values for the accessibility of the device to be returned in the GenICam::TL::Client::DevGetInfo function on a device handle. */
|
||||
enum DEVICE_ACCESS_STATUS_LIST
|
||||
{
|
||||
DEVICE_ACCESS_STATUS_UNKNOWN = 0, /* The device accessibility is not known. */
|
||||
DEVICE_ACCESS_STATUS_READWRITE = 1, /* The device is available for read/write access. */
|
||||
DEVICE_ACCESS_STATUS_READONLY = 2, /* The device is available for read only access. */
|
||||
DEVICE_ACCESS_STATUS_NOACCESS = 3, /* The device is not accessible. */
|
||||
DEVICE_ACCESS_STATUS_BUSY = 4, /* The device has already been opened by another process/host. GenTL v1.5 */
|
||||
DEVICE_ACCESS_STATUS_OPEN_READWRITE = 5, /* The device has already been opened by this process. GenTL v1.5 */
|
||||
DEVICE_ACCESS_STATUS_OPEN_READONLY = 6, /* The device has already been opened by this process. GenTL v1.5 */
|
||||
|
||||
DEVICE_ACCESS_STATUS_CUSTOM_ID = 1000 /* Starting value for custom IDs. */
|
||||
};
|
||||
typedef int32_t DEVICE_ACCESS_STATUS;
|
||||
|
||||
/* This enumeration defines commands to retrieve information with the GenICam::TL::Client::DevGetInfo function on a device handle. */
|
||||
enum DEVICE_INFO_CMD_LIST
|
||||
{
|
||||
DEVICE_INFO_ID = 0, /* STRING Unique ID of the device. */
|
||||
DEVICE_INFO_VENDOR = 1, /* STRING Device vendor name. */
|
||||
DEVICE_INFO_MODEL = 2, /* STRING Device model name. */
|
||||
DEVICE_INFO_TLTYPE = 3, /* STRING Transport layer technology that is supported. */
|
||||
DEVICE_INFO_DISPLAYNAME = 4, /* STRING String containing a display name for the device ( including a unique id ) */
|
||||
DEVICE_INFO_ACCESS_STATUS = 5, /* INT32 Gets the access mode the GenTL Producer has on the opened device. (DEVICE_ACCESS_STATUS enumeration value). */
|
||||
DEVICE_INFO_USER_DEFINED_NAME = 6, /* STRING String containing the user defined name, GenTL v1.4 */
|
||||
DEVICE_INFO_SERIAL_NUMBER = 7, /* STRING String containing the device's serial number, GenTL v1.4 */
|
||||
DEVICE_INFO_VERSION = 8, /* STRING String containing the device version, GenTL v1.4 */
|
||||
DEVICE_INFO_TIMESTAMP_FREQUENCY = 9, /* UINT64 Tick-frequency of the time stamp clock, GenTL v1.4 */
|
||||
|
||||
DEVICE_INFO_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */
|
||||
};
|
||||
typedef int32_t DEVICE_INFO_CMD;
|
||||
|
||||
/* This enumeration defines special stop flags for the acquisition engine. The function used is GenICam::TL::Client::DSStopAcquisition. */
|
||||
enum ACQ_STOP_FLAGS_LIST
|
||||
{
|
||||
ACQ_STOP_FLAGS_DEFAULT = 0, /* Stop the acquisition engine when the currently running tasks like filling a buffer are completed (default behavior). */
|
||||
ACQ_STOP_FLAGS_KILL = 1, /* Stop the acquisition engine immediately and leave buffers currently being filled in the Input Buffer Pool. */
|
||||
|
||||
ACQ_STOP_FLAGS_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */
|
||||
};
|
||||
typedef int32_t ACQ_STOP_FLAGS;
|
||||
|
||||
/* This enumeration defines special start flags for the acquisition engine. The function used is GenICam::TL::Client::DSStartAcquisition. */
|
||||
enum ACQ_START_FLAGS_LIST
|
||||
{
|
||||
ACQ_START_FLAGS_DEFAULT = 0, /* Default behavior. */
|
||||
|
||||
ACQ_START_FLAGS_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */
|
||||
};
|
||||
typedef int32_t ACQ_START_FLAGS;
|
||||
|
||||
/* This enumeration commands from which to which queue/pool buffers are flushed with the GenICam::TL::Client::DSFlushQueue function. */
|
||||
enum ACQ_QUEUE_TYPE_LIST
|
||||
{
|
||||
ACQ_QUEUE_INPUT_TO_OUTPUT = 0, /* Flushes the input pool to the output queue and if necessary adds entries in the New Buffer event data queue. */
|
||||
ACQ_QUEUE_OUTPUT_DISCARD = 1, /* Discards all buffers in the output queue and if necessary remove the entries from the event data queue. */
|
||||
ACQ_QUEUE_ALL_TO_INPUT = 2, /* Puts all buffers in the input pool. Even those in the output queue and discard entries in the event data queue. */
|
||||
ACQ_QUEUE_UNQUEUED_TO_INPUT = 3, /* Puts all buffers that are not in the input pool or the output queue in the input pool. */
|
||||
ACQ_QUEUE_ALL_DISCARD = 4, /* Discards all buffers in the input pool and output queue. */
|
||||
|
||||
ACQ_QUEUE_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */
|
||||
};
|
||||
typedef int32_t ACQ_QUEUE_TYPE;
|
||||
|
||||
/* This enumeration defines commands to retrieve information with the GenICam::TL::Client::DSGetInfo function on a data stream handle */
|
||||
enum STREAM_INFO_CMD_LIST
|
||||
{
|
||||
STREAM_INFO_ID = 0, /* STRING Unique ID of the data stream. */
|
||||
STREAM_INFO_NUM_DELIVERED = 1, /* UINT64 Number of delivered buffers since last acquisition start. */
|
||||
STREAM_INFO_NUM_UNDERRUN = 2, /* UINT64 Number of lost buffers due to queue underrun. */
|
||||
STREAM_INFO_NUM_ANNOUNCED = 3, /* SIZET Number of announced buffers. */
|
||||
STREAM_INFO_NUM_QUEUED = 4, /* SIZET Number of buffers in the input pool. */
|
||||
STREAM_INFO_NUM_AWAIT_DELIVERY = 5, /* SIZET Number of buffers in the output queue. */
|
||||
STREAM_INFO_NUM_STARTED = 6, /* UINT64 Number of buffers started in the acquisition engine. */
|
||||
STREAM_INFO_PAYLOAD_SIZE = 7, /* SIZET Size of the expected data in bytes. */
|
||||
STREAM_INFO_IS_GRABBING = 8, /* BOOL8 Flag indicating whether the acquisition engine is started or not. */
|
||||
STREAM_INFO_DEFINES_PAYLOADSIZE = 9, /* BOOL8 Flag that indicated that this data stream defines a payload size independent from the remote device. */
|
||||
STREAM_INFO_TLTYPE = 10, /* STRING Transport layer technology that is supported. */
|
||||
STREAM_INFO_NUM_CHUNKS_MAX = 11, /* SIZET Max number of chunks in a buffer, if known. GenTL v1.3 */
|
||||
STREAM_INFO_BUF_ANNOUNCE_MIN = 12, /* SIZET Min number of buffers to announce before acq can start, if known. GenTL v1.3 */
|
||||
STREAM_INFO_BUF_ALIGNMENT = 13, /* SIZET Buffer alignment in bytes. GenTL v1.3 */
|
||||
|
||||
STREAM_INFO_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */
|
||||
};
|
||||
typedef int32_t STREAM_INFO_CMD;
|
||||
|
||||
/* This enumeration defines commands to retrieve information with the GenICam::TL::Client::DSGetBufferInfo function on a buffer handle. */
|
||||
enum BUFFER_INFO_CMD_LIST
|
||||
{
|
||||
BUFFER_INFO_BASE = 0, /* PTR Base address of the buffer memory. */
|
||||
BUFFER_INFO_SIZE = 1, /* SIZET Size of the buffer in bytes. */
|
||||
BUFFER_INFO_USER_PTR = 2, /* PTR Private data pointer of the GenTL Consumer. */
|
||||
BUFFER_INFO_TIMESTAMP = 3, /* UINT64 Timestamp the buffer was acquired. */
|
||||
BUFFER_INFO_NEW_DATA = 4, /* BOOL8 Flag to indicate that the buffer contains new data since the last call. */
|
||||
BUFFER_INFO_IS_QUEUED = 5, /* BOOL8 Flag to indicate if the buffer is in the input pool or output queue. */
|
||||
BUFFER_INFO_IS_ACQUIRING = 6, /* BOOL8 Flag to indicate that the buffer is currently being filled with data. */
|
||||
BUFFER_INFO_IS_INCOMPLETE = 7, /* BOOL8 Flag to indicate that a buffer was filled but an error occurred during that process. */
|
||||
BUFFER_INFO_TLTYPE = 8, /* STRING Transport layer technology that is supported. */
|
||||
BUFFER_INFO_SIZE_FILLED = 9, /* SIZET Number of bytes written into the buffer last time it has been filled. This value is reset to 0 when the buffer is placed into the Input Buffer Pool. */
|
||||
BUFFER_INFO_WIDTH = 10, /* SIZET GenTL v1.2 */
|
||||
BUFFER_INFO_HEIGHT = 11, /* SIZET GenTL v1.2 */
|
||||
BUFFER_INFO_XOFFSET = 12, /* SIZET GenTL v1.2 */
|
||||
BUFFER_INFO_YOFFSET = 13, /* SIZET GenTL v1.2 */
|
||||
BUFFER_INFO_XPADDING = 14, /* SIZET GenTL v1.2 */
|
||||
BUFFER_INFO_YPADDING = 15, /* SIZET GenTL v1.2 */
|
||||
BUFFER_INFO_FRAMEID = 16, /* UINT64 GenTL v1.2 */
|
||||
BUFFER_INFO_IMAGEPRESENT = 17, /* BOOL8 GenTL v1.2 */
|
||||
BUFFER_INFO_IMAGEOFFSET = 18, /* SIZET GenTL v1.2 */
|
||||
BUFFER_INFO_PAYLOADTYPE = 19, /* SIZET GenTL v1.2 */
|
||||
BUFFER_INFO_PIXELFORMAT = 20, /* UINT64 GenTL v1.2 */
|
||||
BUFFER_INFO_PIXELFORMAT_NAMESPACE = 21, /* UINT64 GenTL v1.2 */
|
||||
BUFFER_INFO_DELIVERED_IMAGEHEIGHT = 22, /* SIZET GenTL v1.2 */
|
||||
BUFFER_INFO_DELIVERED_CHUNKPAYLOADSIZE = 23, /* SIZET GenTL v1.2 */
|
||||
BUFFER_INFO_CHUNKLAYOUTID = 24, /* UINT64 GenTL v1.2 */
|
||||
BUFFER_INFO_FILENAME = 25, /* STRING GenTL v1.2 */
|
||||
BUFFER_INFO_PIXEL_ENDIANNESS = 26, /* INT32 GenTL v1.4 */
|
||||
BUFFER_INFO_DATA_SIZE = 27, /* SIZET GenTL v1.4 */
|
||||
BUFFER_INFO_TIMESTAMP_NS = 28, /* UINT64 GenTL v1.4 */
|
||||
BUFFER_INFO_DATA_LARGER_THAN_BUFFER = 29, /* BOOL8 GenTL v1.4 */
|
||||
BUFFER_INFO_CONTAINS_CHUNKDATA = 30, /* BOOL8 GenTL v1.4 */
|
||||
|
||||
BUFFER_INFO_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */
|
||||
};
|
||||
typedef int32_t BUFFER_INFO_CMD;
|
||||
|
||||
/* This enumeration defines commands to retrieve information about individual data parts in a multi-part buffer
|
||||
using the GenICam::TL::Client::DSGetBufferPartInfo function. Introduced in GenTL v1.5. */
|
||||
enum BUFFER_PART_INFO_CMD_LIST
|
||||
{
|
||||
BUFFER_PART_INFO_BASE = 0, /* PTR Base address of the buffer part memory. */
|
||||
BUFFER_PART_INFO_DATA_SIZE = 1, /* SIZET Size of the buffer part in bytes. */
|
||||
BUFFER_PART_INFO_DATA_TYPE = 2, /* SIZET Type of the data in given part (PARTDATATYPE_ID enumeration value). */
|
||||
BUFFER_PART_INFO_DATA_FORMAT = 3, /* UINT64 Format of individual items (such as pixels) in the buffer part. */
|
||||
BUFFER_PART_INFO_DATA_FORMAT_NAMESPACE = 4, /* UINT64 Allows interpretation of BUFFER_PART_INFO_DATA_FORMAT (PIXELFORMAT_NAMESPACE_ID enumeration value). */
|
||||
BUFFER_PART_INFO_WIDTH = 5, /* SIZET Width of data in the buffer part in pixels. */
|
||||
BUFFER_PART_INFO_HEIGHT = 6, /* SIZET Expected height of data in the buffer part in pixels . */
|
||||
BUFFER_PART_INFO_XOFFSET = 7, /* SIZET Horizontal offset of data in the buffer part in pixels. */
|
||||
BUFFER_PART_INFO_YOFFSET = 8, /* SIZET Vertical offset of data in the buffer part in pixels. */
|
||||
BUFFER_PART_INFO_XPADDING = 9, /* SIZET Horizontal padding of data in the buffer part in pixels. */
|
||||
BUFFER_PART_INFO_SOURCE_ID = 10, /* UINT64 Identifier allowing to group data parts belonging to the same source. */
|
||||
BUFFER_PART_INFO_DELIVERED_IMAGEHEIGHT = 11, /* SIZET Height of the data currently in the buffer part in pixels*/
|
||||
BUFFER_PART_INFO_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */
|
||||
};
|
||||
typedef int32_t BUFFER_PART_INFO_CMD; /* GenTL v1.5 */
|
||||
|
||||
/* Enumeration of TLType dependent payload types. Introduced in GenTL v1.2 */
|
||||
enum PAYLOADTYPE_INFO_IDS
|
||||
{
|
||||
PAYLOAD_TYPE_UNKNOWN = 0, /* GenTL v1.2 */
|
||||
PAYLOAD_TYPE_IMAGE = 1, /* GenTL v1.2 */
|
||||
PAYLOAD_TYPE_RAW_DATA = 2, /* GenTL v1.2 */
|
||||
PAYLOAD_TYPE_FILE = 3, /* GenTL v1.2 */
|
||||
PAYLOAD_TYPE_CHUNK_DATA = 4, /* GenTL v1.2, Deprecated in GenTL 1.5*/
|
||||
PAYLOAD_TYPE_JPEG = 5, /* GenTL v1.4 */
|
||||
PAYLOAD_TYPE_JPEG2000 = 6, /* GenTL v1.4 */
|
||||
PAYLOAD_TYPE_H264 = 7, /* GenTL v1.4 */
|
||||
PAYLOAD_TYPE_CHUNK_ONLY = 8, /* GenTL v1.4 */
|
||||
PAYLOAD_TYPE_DEVICE_SPECIFIC = 9, /* GenTL v1.4 */
|
||||
PAYLOAD_TYPE_MULTI_PART = 10, /* GenTL v1.5 */
|
||||
|
||||
PAYLOAD_TYPE_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */
|
||||
};
|
||||
typedef int32_t PAYLOADTYPE_INFO_ID;
|
||||
|
||||
/* Enumeration of TLType dependent pixel format namespaces introduced GenTL v1.2 */
|
||||
enum PIXELFORMAT_NAMESPACE_IDS
|
||||
{
|
||||
PIXELFORMAT_NAMESPACE_UNKNOWN = 0, /* GenTL v1.2 */
|
||||
PIXELFORMAT_NAMESPACE_GEV = 1, /* GenTL v1.2 */
|
||||
PIXELFORMAT_NAMESPACE_IIDC = 2, /* GenTL v1.2 */
|
||||
PIXELFORMAT_NAMESPACE_PFNC_16BIT = 3, /* GenTL v1.4 */
|
||||
PIXELFORMAT_NAMESPACE_PFNC_32BIT = 4, /* GenTL v1.4 */
|
||||
|
||||
PIXELFORMAT_NAMESPACE_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */
|
||||
};
|
||||
typedef int32_t PIXELFORMAT_NAMESPACE_ID; /* GenTL v1.2 */
|
||||
|
||||
/* Enumeration of pixel endianness values. Introduced in GenTL v1.4 */
|
||||
enum PIXELENDIANNESS_IDS
|
||||
{
|
||||
PIXELENDIANNESS_UNKNOWN = 0, /* Unknown pixel endianness. GenTL v1.4 */
|
||||
PIXELENDIANNESS_LITTLE = 1, /* Little endian pixel data. GenTL v1.4 */
|
||||
PIXELENDIANNESS_BIG = 2 /* Big endian pixel data. GenTL v1.4 */
|
||||
};
|
||||
typedef int32_t PIXELENDIANNESS_ID; /* GenTL v1.4*/
|
||||
|
||||
/* Enumeration describing which data type is present in given buffer part. Introduced in GenTL v1.5 */
|
||||
enum PARTDATATYPE_IDS
|
||||
{
|
||||
PART_DATATYPE_UNKNOWN = 0, /* Unknown data type */
|
||||
PART_DATATYPE_2D_IMAGE = 1, /* Color or monochrome 2D image. */
|
||||
PART_DATATYPE_2D_PLANE_BIPLANAR = 2, /* Single color plane of a planar 2D image consisting of 2 planes. */
|
||||
PART_DATATYPE_2D_PLANE_TRIPLANAR = 3, /* Single color plane of a planar 2D image consisting of 3 planes. */
|
||||
PART_DATATYPE_2D_PLANE_QUADPLANAR = 4, /* Single color plane of a planar 2D image consisting of 4 planes. */
|
||||
PART_DATATYPE_3D_IMAGE = 5, /* 3D image (pixel coordinates). */
|
||||
PART_DATATYPE_3D_PLANE_BIPLANAR = 6, /* Single plane of a planar 3D image consisting of 2 planes. */
|
||||
PART_DATATYPE_3D_PLANE_TRIPLANAR = 7, /* Single plane of a planar 3D image consisting of 3 planes. */
|
||||
PART_DATATYPE_3D_PLANE_QUADPLANAR = 8, /* Single plane of a planar 3D image consisting of 4 planes. */
|
||||
PART_DATATYPE_CONFIDENCE_MAP = 9, /* Confidence of the individual pixel values. */
|
||||
|
||||
PART_DATATYPE_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */
|
||||
};
|
||||
typedef int32_t PARTDATATYPE_ID; /* GenTL v1.5*/
|
||||
|
||||
/* This enumeration defines commands to retrieve information with the GenICam::TL::Client::GCGetPortInfo function on a module or remote device handle. */
|
||||
enum PORT_INFO_CMD_LIST
|
||||
{
|
||||
PORT_INFO_ID = 0, /* STRING Unique ID of the port. */
|
||||
PORT_INFO_VENDOR = 1, /* STRING Port vendor name. */
|
||||
PORT_INFO_MODEL = 2, /* STRING Port model name. */
|
||||
PORT_INFO_TLTYPE = 3, /* STRING Transport layer technology that is supported. */
|
||||
PORT_INFO_MODULE = 4, /* STRING GenTL Module the port refers to. */
|
||||
PORT_INFO_LITTLE_ENDIAN = 5, /* BOOL8 Flag indicating that the port data is little endian. */
|
||||
PORT_INFO_BIG_ENDIAN = 6, /* BOOL8 Flag indicating that the port data is big endian. */
|
||||
PORT_INFO_ACCESS_READ = 7, /* BOOL8 Port has read access. */
|
||||
PORT_INFO_ACCESS_WRITE = 8, /* BOOL8 Port has write access. */
|
||||
PORT_INFO_ACCESS_NA = 9, /* BOOL8 Port is not accessible. */
|
||||
PORT_INFO_ACCESS_NI = 10, /* BOOL8 Port is not implemented. */
|
||||
PORT_INFO_VERSION = 11, /* STRING Version of the port. */
|
||||
PORT_INFO_PORTNAME = 12, /* STRING Name of the port as referenced in the XML description. */
|
||||
|
||||
PORT_INFO_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */
|
||||
};
|
||||
typedef int32_t PORT_INFO_CMD;
|
||||
|
||||
/* This enumeration defines enum values returned by the URL_INFO_SCHEME command.
|
||||
introduced in GenTL v1.5 */
|
||||
enum URL_SCHEME_IDS
|
||||
{
|
||||
URL_SCHEME_LOCAL = 0, /* The XML can be read from the local register map */
|
||||
URL_SCHEME_HTTP = 1, /* The XML can be downloaded from a http server */
|
||||
URL_SCHEME_FILE = 2, /* The XML can be read from the local hard drive */
|
||||
|
||||
URL_SCHEME_CUSTOM_ID = 1000 /* Starting value for custom scheme locations */
|
||||
};
|
||||
typedef int32_t URL_SCHEME_ID;
|
||||
|
||||
/* This enumeration defines commands to retrieve information with the GenICam::TL::Client::GCGetPortURLInfo
|
||||
function on a module or remote device handle. Introduced in GenTL v1.1 */
|
||||
enum URL_INFO_CMD_LIST
|
||||
{
|
||||
URL_INFO_URL = 0, /* STRING URL as defined in chapter 4.1.2 GenTL v1.1 */
|
||||
URL_INFO_SCHEMA_VER_MAJOR = 1, /* INT32 Major version of the schema this URL refers to. GenTL v1.1 */
|
||||
URL_INFO_SCHEMA_VER_MINOR = 2, /* INT32 Minor version of the schema this URL refers to. GenTL v1.1 */
|
||||
URL_INFO_FILE_VER_MAJOR = 3, /* INT32 Major version of the XML-file this URL refers to. GenTL v1.1 */
|
||||
URL_INFO_FILE_VER_MINOR = 4, /* INT32 Minor version of the XML-file this URL refers to. GenTL v1.1 */
|
||||
URL_INFO_FILE_VER_SUBMINOR = 5, /* INT32 Subminor version of the XML-file this URL refers to. GenTL v1.1 */
|
||||
URL_INFO_FILE_SHA1_HASH = 6, /* BUFFER 160-bit SHA1 Hash code of XML-file. GenTL v1.4 */
|
||||
URL_INFO_FILE_REGISTER_ADDRESS = 7, /* UINT64 Register address in the device's register map. GenTL v1.5 */
|
||||
URL_INFO_FILE_SIZE = 8, /* UINT64 File size in bytes. GenTL v1.5 */
|
||||
URL_INFO_SCHEME = 9, /* INT32 Scheme of the URL as defined in URL_SCHEME_IDS. GenTL v1.5 */
|
||||
URL_INFO_FILENAME = 10, /* STRING File name if the scheme of the URL is file. GenTL v1.5 */
|
||||
|
||||
URL_INFO_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */
|
||||
};
|
||||
typedef int32_t URL_INFO_CMD; /* GenTL v1.1 */
|
||||
|
||||
/* Known event types that can be registered on certain modules with the GenICam::TL::Client::GCRegisterEvent function. */
|
||||
enum EVENT_TYPE_LIST
|
||||
{
|
||||
EVENT_ERROR = 0, /* Notification on module errors. */
|
||||
EVENT_NEW_BUFFER = 1, /* Notification on newly filled buffers. */
|
||||
EVENT_FEATURE_INVALIDATE = 2, /* Notification if a feature was changed by the GenTL Producer library and thus needs to be invalidated in the GenICam GenApi instance using the module. */
|
||||
EVENT_FEATURE_CHANGE = 3, /* Notification if the GenTL Producer library wants to manually set a feature in the GenICam GenApi instance using the module. */
|
||||
EVENT_REMOTE_DEVICE = 4, /* Notification if the GenTL Producer wants to inform the GenICam GenApi instance of the remote device that a GenApi compatible event was fired. */
|
||||
EVENT_MODULE = 5, /* Notification if the GenTL Producer wants to inform the GenICam GenApi instance of the module that a GenApi compatible event was fired. GenTL v1.4 */
|
||||
|
||||
EVENT_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */
|
||||
};
|
||||
typedef int32_t EVENT_TYPE;
|
||||
|
||||
/* Event info command */
|
||||
enum EVENT_INFO_CMD_LIST
|
||||
{
|
||||
EVENT_EVENT_TYPE = 0, /* INT32 The event type of the event handle (EVENT_TYPE enum value). */
|
||||
EVENT_NUM_IN_QUEUE = 1, /* SIZET Number of events in the event data queue. */
|
||||
EVENT_NUM_FIRED = 2, /* UINT64 Number of events that were fired since the creation of the module. */
|
||||
EVENT_SIZE_MAX = 3, /* SIZET Max size of data carried with an event in bytes. GenTL v1.2 */
|
||||
EVENT_INFO_DATA_SIZE_MAX = 4, /* SIZET Max size of data provided through EventGetDataInfo in bytes. GenTL v1.2 */
|
||||
|
||||
EVENT_INFO_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */
|
||||
};
|
||||
typedef int32_t EVENT_INFO_CMD;
|
||||
|
||||
/* Event data info command */
|
||||
enum EVENT_DATA_INFO_CMD_LIST
|
||||
{
|
||||
EVENT_DATA_ID = 0, /* Event specific Unique Event ID (String or Number)*/
|
||||
EVENT_DATA_VALUE = 1, /* Event specific Data */
|
||||
EVENT_DATA_NUMID = 2, /* UINT64 Numeric representation of the unique Event ID, GenTL v1.3. */
|
||||
|
||||
EVENT_DATA_CUSTOM_ID = 1000 /* Starting value for GenTL Producer custom IDs. */
|
||||
};
|
||||
typedef int32_t EVENT_DATA_INFO_CMD;
|
||||
|
||||
/* Structure of the data returned from a signaled "New Buffer" event. */
|
||||
# pragma pack (push, 1)
|
||||
typedef struct S_EVENT_NEW_BUFFER
|
||||
{
|
||||
BUFFER_HANDLE BufferHandle; /* Buffer handle which contains new data. */
|
||||
void* pUserPointer; /* User pointer provided at announcement of the buffer. */
|
||||
} EVENT_NEW_BUFFER_DATA;
|
||||
# pragma pack (pop)
|
||||
|
||||
/* Structure to be use with GCWritePortStacked and GCReadPortStacked. */
|
||||
# pragma pack (push, 1)
|
||||
typedef struct S_PORT_REGISTER_STACK_ENTRY
|
||||
{
|
||||
uint64_t Address; /* Address of the register. */
|
||||
void* pBuffer; /* Pointer to the buffer containing the data. */
|
||||
size_t Size; /* Number of bytes to read write. */
|
||||
} PORT_REGISTER_STACK_ENTRY;
|
||||
# pragma pack (pop)
|
||||
|
||||
# pragma pack (push, 1)
|
||||
/* Structure carrying information about a single chunk in the buffer, V1.3 */
|
||||
typedef struct S_SINGLE_CHUNK_DATA
|
||||
{
|
||||
uint64_t ChunkID; /* Numeric representation of ChunkID */
|
||||
ptrdiff_t ChunkOffset; /* Chunk offset in the buffer */
|
||||
size_t ChunkLength; /* Size of the chunk data */
|
||||
} SINGLE_CHUNK_DATA;
|
||||
# pragma pack (pop)
|
||||
|
||||
|
||||
/* C API Interface Functions */
|
||||
# define GC_API GC_IMPORT_EXPORT GC_ERROR GC_CALLTYPE
|
||||
GC_API GCGetInfo ( TL_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
|
||||
|
||||
GC_API GCGetLastError ( GC_ERROR *piErrorCode, char *sErrText, size_t *piSize );
|
||||
|
||||
GC_API GCInitLib ( void );
|
||||
GC_API GCCloseLib ( void );
|
||||
|
||||
GC_API GCReadPort ( PORT_HANDLE hPort, uint64_t iAddress, void *pBuffer, size_t *piSize );
|
||||
GC_API GCWritePort ( PORT_HANDLE hPort, uint64_t iAddress, const void *pBuffer, size_t *piSize );
|
||||
GC_API GCGetPortURL ( PORT_HANDLE hPort, char *sURL, size_t *piSize );
|
||||
|
||||
GC_API GCGetPortInfo ( PORT_HANDLE hPort, PORT_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
|
||||
|
||||
GC_API GCRegisterEvent ( EVENTSRC_HANDLE hEventSrc, EVENT_TYPE iEventID, EVENT_HANDLE *phEvent );
|
||||
GC_API GCUnregisterEvent ( EVENTSRC_HANDLE hEventSrc, EVENT_TYPE iEventID );
|
||||
|
||||
GC_API EventGetData ( EVENT_HANDLE hEvent, void *pBuffer, size_t *piSize, uint64_t iTimeout );
|
||||
GC_API EventGetDataInfo ( EVENT_HANDLE hEvent, const void *pInBuffer, size_t iInSize, EVENT_DATA_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pOutBuffer, size_t *piOutSize );
|
||||
GC_API EventGetInfo ( EVENT_HANDLE hEvent, EVENT_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
|
||||
GC_API EventFlush ( EVENT_HANDLE hEvent );
|
||||
GC_API EventKill ( EVENT_HANDLE hEvent );
|
||||
|
||||
GC_API TLOpen ( TL_HANDLE *phTL );
|
||||
GC_API TLClose ( TL_HANDLE hTL );
|
||||
GC_API TLGetInfo ( TL_HANDLE hTL, TL_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
|
||||
|
||||
GC_API TLGetNumInterfaces ( TL_HANDLE hTL, uint32_t *piNumIfaces );
|
||||
GC_API TLGetInterfaceID ( TL_HANDLE hTL, uint32_t iIndex, char *sID, size_t *piSize );
|
||||
GC_API TLGetInterfaceInfo ( TL_HANDLE hTL, const char *sIfaceID, INTERFACE_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
|
||||
GC_API TLOpenInterface ( TL_HANDLE hTL, const char *sIfaceID, IF_HANDLE *phIface );
|
||||
GC_API TLUpdateInterfaceList ( TL_HANDLE hTL, bool8_t *pbChanged, uint64_t iTimeout );
|
||||
|
||||
GC_API IFClose ( IF_HANDLE hIface );
|
||||
GC_API IFGetInfo ( IF_HANDLE hIface, INTERFACE_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
|
||||
|
||||
GC_API IFGetNumDevices ( IF_HANDLE hIface, uint32_t *piNumDevices );
|
||||
GC_API IFGetDeviceID ( IF_HANDLE hIface, uint32_t iIndex, char *sIDeviceID, size_t *piSize );
|
||||
GC_API IFUpdateDeviceList ( IF_HANDLE hIface, bool8_t *pbChanged, uint64_t iTimeout );
|
||||
GC_API IFGetDeviceInfo ( IF_HANDLE hIface, const char *sDeviceID, DEVICE_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
|
||||
GC_API IFOpenDevice ( IF_HANDLE hIface, const char *sDeviceID, DEVICE_ACCESS_FLAGS iOpenFlags, DEV_HANDLE *phDevice );
|
||||
|
||||
GC_API DevGetPort ( DEV_HANDLE hDevice, PORT_HANDLE *phRemoteDevice );
|
||||
GC_API DevGetNumDataStreams ( DEV_HANDLE hDevice, uint32_t *piNumDataStreams );
|
||||
GC_API DevGetDataStreamID ( DEV_HANDLE hDevice, uint32_t iIndex, char *sDataStreamID, size_t *piSize );
|
||||
GC_API DevOpenDataStream ( DEV_HANDLE hDevice, const char *sDataStreamID, DS_HANDLE *phDataStream );
|
||||
GC_API DevGetInfo ( DEV_HANDLE hDevice, DEVICE_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
|
||||
GC_API DevClose ( DEV_HANDLE hDevice );
|
||||
|
||||
GC_API DSAnnounceBuffer ( DS_HANDLE hDataStream, void *pBuffer, size_t iSize, void *pPrivate, BUFFER_HANDLE *phBuffer );
|
||||
GC_API DSAllocAndAnnounceBuffer( DS_HANDLE hDataStream, size_t iSize, void *pPrivate, BUFFER_HANDLE *phBuffer );
|
||||
GC_API DSFlushQueue ( DS_HANDLE hDataStream, ACQ_QUEUE_TYPE iOperation );
|
||||
GC_API DSStartAcquisition ( DS_HANDLE hDataStream, ACQ_START_FLAGS iStartFlags, uint64_t iNumToAcquire );
|
||||
GC_API DSStopAcquisition ( DS_HANDLE hDataStream, ACQ_STOP_FLAGS iStopFlags );
|
||||
GC_API DSGetInfo ( DS_HANDLE hDataStream, STREAM_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
|
||||
GC_API DSGetBufferID ( DS_HANDLE hDataStream, uint32_t iIndex, BUFFER_HANDLE *phBuffer );
|
||||
GC_API DSClose ( DS_HANDLE hDataStream );
|
||||
|
||||
GC_API DSRevokeBuffer ( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, void **pBuffer, void **pPrivate );
|
||||
GC_API DSQueueBuffer ( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer );
|
||||
GC_API DSGetBufferInfo ( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, BUFFER_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
|
||||
|
||||
/* GenTL v1.1 */
|
||||
GC_API GCGetNumPortURLs ( PORT_HANDLE hPort, uint32_t *piNumURLs );
|
||||
GC_API GCGetPortURLInfo ( PORT_HANDLE hPort, uint32_t iURLIndex, URL_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
|
||||
GC_API GCReadPortStacked ( PORT_HANDLE hPort, PORT_REGISTER_STACK_ENTRY *pEntries, size_t *piNumEntries );
|
||||
GC_API GCWritePortStacked ( PORT_HANDLE hPort, PORT_REGISTER_STACK_ENTRY *pEntries, size_t *piNumEntries );
|
||||
|
||||
/* GenTL v1.3 */
|
||||
GC_API DSGetBufferChunkData ( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, SINGLE_CHUNK_DATA *pChunkData, size_t *piNumChunks );
|
||||
|
||||
/* GenTL v1.4 */
|
||||
GC_API IFGetParentTL ( IF_HANDLE hIface, TL_HANDLE *phSystem );
|
||||
GC_API DevGetParentIF ( DEV_HANDLE hDevice, IF_HANDLE *phIface );
|
||||
GC_API DSGetParentDev ( DS_HANDLE hDataStream, DEV_HANDLE *phDevice );
|
||||
|
||||
/* GenTL v1.5 */
|
||||
GC_API DSGetNumBufferParts ( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, uint32_t *piNumParts );
|
||||
GC_API DSGetBufferPartInfo ( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, uint32_t iPartIndex, BUFFER_PART_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
|
||||
|
||||
/* typedefs for dynamic loading */
|
||||
# define GC_API_P(function) typedef GC_ERROR( GC_CALLTYPE *function )
|
||||
GC_API_P(PGCGetInfo )( TL_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
|
||||
GC_API_P(PGCGetLastError )( GC_ERROR *piErrorCode, char *sErrText, size_t *piSize );
|
||||
GC_API_P(PGCInitLib )( void );
|
||||
GC_API_P(PGCCloseLib )( void );
|
||||
GC_API_P(PGCReadPort )( PORT_HANDLE hPort, uint64_t iAddress, void *pBuffer, size_t *piSize );
|
||||
GC_API_P(PGCWritePort )( PORT_HANDLE hPort, uint64_t iAddress, const void *pBuffer, size_t *piSize );
|
||||
GC_API_P(PGCGetPortURL )( PORT_HANDLE hPort, char *sURL, size_t *piSize );
|
||||
GC_API_P(PGCGetPortInfo )( PORT_HANDLE hPort, PORT_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
|
||||
|
||||
GC_API_P(PGCRegisterEvent )( EVENTSRC_HANDLE hEventSrc, EVENT_TYPE iEventID, EVENT_HANDLE *phEvent );
|
||||
GC_API_P(PGCUnregisterEvent )( EVENTSRC_HANDLE hEventSrc, EVENT_TYPE iEventID );
|
||||
GC_API_P(PEventGetData )( EVENT_HANDLE hEvent, void *pBuffer, size_t *piSize, uint64_t iTimeout );
|
||||
GC_API_P(PEventGetDataInfo )( EVENT_HANDLE hEvent, const void *pInBuffer, size_t iInSize, EVENT_DATA_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pOutBuffer, size_t *piOutSize );
|
||||
GC_API_P(PEventGetInfo )( EVENT_HANDLE hEvent, EVENT_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
|
||||
GC_API_P(PEventFlush )( EVENT_HANDLE hEvent );
|
||||
GC_API_P(PEventKill )( EVENT_HANDLE hEvent );
|
||||
GC_API_P(PTLOpen )( TL_HANDLE *phTL );
|
||||
GC_API_P(PTLClose )( TL_HANDLE hTL );
|
||||
GC_API_P(PTLGetInfo )( TL_HANDLE hTL, TL_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
|
||||
GC_API_P(PTLGetNumInterfaces )( TL_HANDLE hTL, uint32_t *piNumIfaces );
|
||||
GC_API_P(PTLGetInterfaceID )( TL_HANDLE hTL, uint32_t iIndex, char *sID, size_t *piSize );
|
||||
GC_API_P(PTLGetInterfaceInfo )( TL_HANDLE hTL, const char *sIfaceID, INTERFACE_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
|
||||
GC_API_P(PTLOpenInterface )( TL_HANDLE hTL, const char *sIfaceID, IF_HANDLE *phIface );
|
||||
GC_API_P(PTLUpdateInterfaceList )( TL_HANDLE hTL, bool8_t *pbChanged, uint64_t iTimeout );
|
||||
GC_API_P(PIFClose )( IF_HANDLE hIface );
|
||||
GC_API_P(PIFGetInfo )( IF_HANDLE hIface, INTERFACE_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
|
||||
GC_API_P(PIFGetNumDevices )( IF_HANDLE hIface, uint32_t *piNumDevices );
|
||||
GC_API_P(PIFGetDeviceID )( IF_HANDLE hIface, uint32_t iIndex, char *sIDeviceID, size_t *piSize );
|
||||
GC_API_P(PIFUpdateDeviceList )( IF_HANDLE hIface, bool8_t *pbChanged, uint64_t iTimeout );
|
||||
GC_API_P(PIFGetDeviceInfo )( IF_HANDLE hIface, const char *sDeviceID, DEVICE_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
|
||||
GC_API_P(PIFOpenDevice )( IF_HANDLE hIface, const char *sDeviceID, DEVICE_ACCESS_FLAGS iOpenFlags, DEV_HANDLE *phDevice );
|
||||
|
||||
GC_API_P(PDevGetPort )( DEV_HANDLE hDevice, PORT_HANDLE *phRemoteDevice );
|
||||
GC_API_P(PDevGetNumDataStreams )( DEV_HANDLE hDevice, uint32_t *piNumDataStreams );
|
||||
GC_API_P(PDevGetDataStreamID )( DEV_HANDLE hDevice, uint32_t iIndex, char *sDataStreamID, size_t *piSize );
|
||||
GC_API_P(PDevOpenDataStream )( DEV_HANDLE hDevice, const char *sDataStreamID, DS_HANDLE *phDataStream );
|
||||
GC_API_P(PDevGetInfo )( DEV_HANDLE hDevice, DEVICE_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
|
||||
GC_API_P(PDevClose )( DEV_HANDLE hDevice );
|
||||
|
||||
GC_API_P(PDSAnnounceBuffer )( DS_HANDLE hDataStream, void *pBuffer, size_t iSize, void *pPrivate, BUFFER_HANDLE *phBuffer );
|
||||
GC_API_P(PDSAllocAndAnnounceBuffer)( DS_HANDLE hDataStream, size_t iSize, void *pPrivate, BUFFER_HANDLE *phBuffer );
|
||||
GC_API_P(PDSFlushQueue )( DS_HANDLE hDataStream, ACQ_QUEUE_TYPE iOperation );
|
||||
GC_API_P(PDSStartAcquisition )( DS_HANDLE hDataStream, ACQ_START_FLAGS iStartFlags, uint64_t iNumToAcquire );
|
||||
GC_API_P(PDSStopAcquisition )( DS_HANDLE hDataStream, ACQ_STOP_FLAGS iStopFlags );
|
||||
GC_API_P(PDSGetInfo )( DS_HANDLE hDataStream, STREAM_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
|
||||
GC_API_P(PDSGetBufferID )( DS_HANDLE hDataStream, uint32_t iIndex, BUFFER_HANDLE *phBuffer );
|
||||
GC_API_P(PDSClose )( DS_HANDLE hDataStream );
|
||||
GC_API_P(PDSRevokeBuffer )( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, void **pBuffer, void **pPrivate );
|
||||
GC_API_P(PDSQueueBuffer )( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer );
|
||||
GC_API_P(PDSGetBufferInfo )( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, BUFFER_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
|
||||
|
||||
/* GenTL v1.1 */
|
||||
GC_API_P(PGCGetNumPortURLs )( PORT_HANDLE hPort, uint32_t *iNumURLs );
|
||||
GC_API_P(PGCGetPortURLInfo )( PORT_HANDLE hPort, uint32_t iURLIndex, URL_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
|
||||
GC_API_P(PGCReadPortStacked )( PORT_HANDLE hPort, PORT_REGISTER_STACK_ENTRY *pEntries, size_t *piNumEntries );
|
||||
GC_API_P(PGCWritePortStacked )( PORT_HANDLE hPort, PORT_REGISTER_STACK_ENTRY *pEntries, size_t *piNumEntries );
|
||||
|
||||
/* GenTL v1.3 */
|
||||
GC_API_P(PDSGetBufferChunkData )( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, SINGLE_CHUNK_DATA *pChunkData, size_t *piNumChunks );
|
||||
|
||||
/* GenTL v1.4 */
|
||||
GC_API_P(PIFGetParentTL )( IF_HANDLE hIface, TL_HANDLE *phSystem );
|
||||
GC_API_P(PDevGetParentIF )( DEV_HANDLE hDevice, IF_HANDLE *phIface );
|
||||
GC_API_P(PDSGetParentDev )( DS_HANDLE hDataStream, DEV_HANDLE *phDevice );
|
||||
|
||||
/* GenTL v1.5 */
|
||||
GC_API_P(PDSGetNumBufferParts )( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, uint32_t *piNumParts );
|
||||
GC_API_P(PDSGetBufferPartInfo )( DS_HANDLE hDataStream, BUFFER_HANDLE hBuffer, uint32_t iPartIndex, BUFFER_PART_INFO_CMD iInfoCmd, INFO_DATATYPE *piType, void *pBuffer, size_t *piSize );
|
||||
#ifdef __cplusplus
|
||||
} /* end of namespace GenTL */
|
||||
} /* end of extern "C" */
|
||||
#endif
|
||||
#endif /* GC_TLI_CLIENT_H_ */
|
@@ -0,0 +1,135 @@
|
||||
#ifndef KY_DRIVER_GENTL_H_
|
||||
#define KY_DRIVER_GENTL_H_
|
||||
#include "ky_os.h"
|
||||
#include "GenTL_v1_5.h"
|
||||
using namespace GenTL;
|
||||
|
||||
struct tl_calls
|
||||
{
|
||||
ky_fn_declare(GCGetInfo)
|
||||
ky_fn_declare(GCGetLastError)
|
||||
ky_fn_declare(GCInitLib)
|
||||
ky_fn_declare(GCCloseLib)
|
||||
ky_fn_declare(GCReadPort)
|
||||
ky_fn_declare(GCWritePort)
|
||||
ky_fn_declare(GCGetPortURL)
|
||||
ky_fn_declare(GCGetPortInfo)
|
||||
ky_fn_declare(GCRegisterEvent)
|
||||
ky_fn_declare(GCUnregisterEvent)
|
||||
ky_fn_declare(EventGetData)
|
||||
ky_fn_declare(EventGetDataInfo)
|
||||
ky_fn_declare(EventGetInfo)
|
||||
ky_fn_declare(EventFlush)
|
||||
ky_fn_declare(EventKill)
|
||||
ky_fn_declare(TLOpen)
|
||||
ky_fn_declare(TLClose)
|
||||
ky_fn_declare(TLGetInfo)
|
||||
ky_fn_declare(TLGetNumInterfaces)
|
||||
ky_fn_declare(TLGetInterfaceID)
|
||||
ky_fn_declare(TLGetInterfaceInfo)
|
||||
ky_fn_declare(TLOpenInterface)
|
||||
ky_fn_declare(TLUpdateInterfaceList)
|
||||
ky_fn_declare(IFClose)
|
||||
ky_fn_declare(IFGetInfo)
|
||||
ky_fn_declare(IFGetNumDevices)
|
||||
ky_fn_declare(IFGetDeviceID)
|
||||
ky_fn_declare(IFUpdateDeviceList)
|
||||
ky_fn_declare(IFGetDeviceInfo)
|
||||
ky_fn_declare(IFOpenDevice)
|
||||
ky_fn_declare(DevGetPort)
|
||||
ky_fn_declare(DevGetNumDataStreams)
|
||||
ky_fn_declare(DevGetDataStreamID)
|
||||
ky_fn_declare(DevOpenDataStream)
|
||||
ky_fn_declare(DevGetInfo)
|
||||
ky_fn_declare(DevClose)
|
||||
ky_fn_declare(DSAnnounceBuffer)
|
||||
ky_fn_declare(DSAllocAndAnnounceBuffer)
|
||||
ky_fn_declare(DSFlushQueue)
|
||||
ky_fn_declare(DSStartAcquisition)
|
||||
ky_fn_declare(DSStopAcquisition)
|
||||
ky_fn_declare(DSGetInfo)
|
||||
ky_fn_declare(DSGetBufferID)
|
||||
ky_fn_declare(DSClose)
|
||||
ky_fn_declare(DSRevokeBuffer)
|
||||
ky_fn_declare(DSQueueBuffer)
|
||||
ky_fn_declare(DSGetBufferInfo)
|
||||
ky_fn_declare(GCGetNumPortURLs)
|
||||
ky_fn_declare(GCGetPortURLInfo)
|
||||
ky_fn_declare(GCReadPortStacked)
|
||||
ky_fn_declare(GCWritePortStacked)
|
||||
ky_fn_declare(DSGetBufferChunkData)
|
||||
ky_fn_declare(IFGetParentTL)
|
||||
ky_fn_declare(DevGetParentIF)
|
||||
ky_fn_declare(DSGetParentDev)
|
||||
ky_fn_declare(DSGetNumBufferParts)
|
||||
ky_fn_declare(DSGetBufferPartInfo)
|
||||
};
|
||||
/* Structure to hold function pointers for GenTL API calls */
|
||||
|
||||
|
||||
/* Helper to load all GenTL API call symbols from the cti - needed for reuse.
|
||||
* Macro rather than function because of the side-effects (includes test
|
||||
* statements expected to be executed within the test procedure. */
|
||||
#define LOAD_SYMBOLS(_tl_, _hcti_) \
|
||||
ky_fn_load (_tl_, _hcti_, GCGetInfo) \
|
||||
ky_fn_load (_tl_, _hcti_, GCGetLastError) \
|
||||
ky_fn_load (_tl_, _hcti_, GCInitLib) \
|
||||
ky_fn_load (_tl_, _hcti_, GCCloseLib) \
|
||||
ky_fn_load (_tl_, _hcti_, GCReadPort) \
|
||||
ky_fn_load (_tl_, _hcti_, GCWritePort) \
|
||||
ky_fn_load (_tl_, _hcti_, GCGetPortURL) \
|
||||
ky_fn_load (_tl_, _hcti_, GCGetPortInfo) \
|
||||
ky_fn_load (_tl_, _hcti_, GCRegisterEvent) \
|
||||
ky_fn_load (_tl_, _hcti_, GCUnregisterEvent) \
|
||||
ky_fn_load (_tl_, _hcti_, EventGetData) \
|
||||
ky_fn_load (_tl_, _hcti_, EventGetDataInfo) \
|
||||
ky_fn_load (_tl_, _hcti_, EventGetInfo) \
|
||||
ky_fn_load (_tl_, _hcti_, EventFlush) \
|
||||
ky_fn_load (_tl_, _hcti_, EventKill) \
|
||||
ky_fn_load (_tl_, _hcti_, TLOpen) \
|
||||
ky_fn_load (_tl_, _hcti_, TLClose) \
|
||||
ky_fn_load (_tl_, _hcti_, TLGetInfo) \
|
||||
ky_fn_load (_tl_, _hcti_, TLGetNumInterfaces) \
|
||||
ky_fn_load (_tl_, _hcti_, TLGetInterfaceID) \
|
||||
ky_fn_load (_tl_, _hcti_, TLGetInterfaceInfo) \
|
||||
ky_fn_load (_tl_, _hcti_, TLOpenInterface) \
|
||||
ky_fn_load (_tl_, _hcti_, TLUpdateInterfaceList) \
|
||||
ky_fn_load (_tl_, _hcti_, IFClose) \
|
||||
ky_fn_load (_tl_, _hcti_, IFGetInfo) \
|
||||
ky_fn_load (_tl_, _hcti_, IFGetNumDevices) \
|
||||
ky_fn_load (_tl_, _hcti_, IFGetDeviceID) \
|
||||
ky_fn_load (_tl_, _hcti_, IFUpdateDeviceList) \
|
||||
ky_fn_load (_tl_, _hcti_, IFGetDeviceInfo) \
|
||||
ky_fn_load (_tl_, _hcti_, IFOpenDevice) \
|
||||
ky_fn_load (_tl_, _hcti_, DevGetPort) \
|
||||
ky_fn_load (_tl_, _hcti_, DevGetNumDataStreams) \
|
||||
ky_fn_load (_tl_, _hcti_, DevGetDataStreamID) \
|
||||
ky_fn_load (_tl_, _hcti_, DevOpenDataStream) \
|
||||
ky_fn_load (_tl_, _hcti_, DevGetInfo) \
|
||||
ky_fn_load (_tl_, _hcti_, DevClose) \
|
||||
ky_fn_load (_tl_, _hcti_, DSAnnounceBuffer) \
|
||||
ky_fn_load (_tl_, _hcti_, DSAllocAndAnnounceBuffer) \
|
||||
ky_fn_load (_tl_, _hcti_, DSFlushQueue) \
|
||||
ky_fn_load (_tl_, _hcti_, DSStartAcquisition) \
|
||||
ky_fn_load (_tl_, _hcti_, DSStopAcquisition) \
|
||||
ky_fn_load (_tl_, _hcti_, DSGetInfo) \
|
||||
ky_fn_load (_tl_, _hcti_, DSGetBufferID) \
|
||||
ky_fn_load (_tl_, _hcti_, DSClose) \
|
||||
ky_fn_load (_tl_, _hcti_, DSRevokeBuffer) \
|
||||
ky_fn_load (_tl_, _hcti_, DSQueueBuffer) \
|
||||
ky_fn_load (_tl_, _hcti_, DSGetBufferInfo) \
|
||||
ky_fn_load (_tl_, _hcti_, GCGetNumPortURLs) \
|
||||
ky_fn_load (_tl_, _hcti_, GCGetPortURLInfo) \
|
||||
ky_fn_load (_tl_, _hcti_, GCReadPortStacked) \
|
||||
ky_fn_load (_tl_, _hcti_, GCWritePortStacked) \
|
||||
ky_fn_load (_tl_, _hcti_, DSGetBufferChunkData) \
|
||||
ky_fn_load (_tl_, _hcti_, IFGetParentTL) \
|
||||
ky_fn_load (_tl_, _hcti_, DevGetParentIF) \
|
||||
ky_fn_load (_tl_, _hcti_, DSGetParentDev) \
|
||||
ky_fn_load (_tl_, _hcti_, DSGetNumBufferParts) \
|
||||
ky_fn_load (_tl_, _hcti_, DSGetBufferPartInfo)
|
||||
|
||||
/* Its counterpart for symmetry */
|
||||
#define FREE_SYMBOLS(_tl_) memset (&_tl_, 0, sizeof(_tl_));
|
||||
|
||||
#endif //KY_DRIVER_GENTL_H_
|
@@ -0,0 +1,34 @@
|
||||
#ifndef KY_OS_H__
|
||||
#define KY_OS_H__
|
||||
|
||||
/* Some ad-hoc OS abstractions */
|
||||
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||
#include <Windows.h>
|
||||
//#include <winioctl.h>
|
||||
//#include <initguid.h>
|
||||
#include <process.h>
|
||||
|
||||
// library
|
||||
#define ky_lib HMODULE
|
||||
#define ky_load_lib(_LIB_, _H_) _H_ = LoadLibraryA(_LIB_)
|
||||
#define ky_fn_declare(_FN_) P##_FN_ _FN_;
|
||||
#define ky_fn_load(_TL_,_H_,_FN_) _TL_._FN_ = (P##_FN_)GetProcAddress(_H_, #_FN_);
|
||||
#define ky_free_lib(_H_) FreeLibrary(_H_); _H_ = NULL;
|
||||
|
||||
|
||||
#elif defined(__linux) || defined(__APPLE__)
|
||||
#include <dlfcn.h>
|
||||
|
||||
|
||||
// library
|
||||
#define ky_lib void*
|
||||
#define ky_load_lib(_LIB_, _H_) _H_ = dlopen (_LIB_, RTLD_LAZY)
|
||||
#define ky_fn_declare(_FN_) P##_FN_ _FN_;
|
||||
#define ky_fn_load(_TL_,_H_,_FN_) _TL_._FN_ = (P##_FN_)dlsym(_H_, #_FN_);
|
||||
#define ky_free_lib(_H_) dlclose (_H_); _H_ = NULL;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif // KY_OS_H__
|
@@ -0,0 +1,8 @@
|
||||
// stdafx.cpp : source file that includes just the standard includes
|
||||
// GenTLCheck.pch will be the pre-compiled header
|
||||
// stdafx.obj will contain the pre-compiled type information
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
// TODO: reference any additional headers you need in STDAFX.H
|
||||
// and not in this file
|
@@ -0,0 +1,28 @@
|
||||
// stdafx.h : include file for standard system include files,
|
||||
// or project specific include files that are used frequently, but
|
||||
// are changed infrequently
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "targetver.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <string.h>
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <sys/types.h>
|
||||
#include <thread>
|
||||
#include <vector>
|
||||
|
||||
#include <sstream>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <tchar.h>
|
||||
#endif
|
||||
|
||||
|
||||
// TODO: reference additional headers your program requires here
|
@@ -0,0 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
// Including SDKDDKVer.h defines the highest available Windows platform.
|
||||
|
||||
// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
|
||||
// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
|
||||
|
||||
// #include <SDKDDKVer.h>
|
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,24 @@
|
||||
// The following ifdef block is the standard way of creating macros which make exporting
|
||||
// from a DLL simpler. All files within this DLL are compiled with the KYFGLIBPLUGIN_EXPORTS
|
||||
// symbol defined on the command line. This symbol should not be defined on any project
|
||||
// that uses this DLL. This way any other project whose source files include this file see
|
||||
// KYFGLIBPLUGIN_API functions as being imported from a DLL, whereas this DLL sees symbols
|
||||
// defined with this macro as being exported.
|
||||
#ifdef KYFGLIBPLUGIN_EXPORTS
|
||||
#define KYFGLIBPLUGIN_API extern "C" __declspec(dllexport)
|
||||
#else
|
||||
#define KYFGLIBPLUGIN_API extern "C" __declspec(dllimport)
|
||||
#endif
|
||||
|
||||
|
||||
KYFGLIBPLUGIN_API KYBOOL __cdecl KYFGCAMERA_INFO2_Update(KYFGCAMERA_INFO2* pCameraUpdateInfo);
|
||||
KYFGLIBPLUGIN_API KYBOOL __cdecl KYFGCAMERA_XML_Path_Update(const KYFGCAMERA_INFO2* pCameraInfo, char* pszXmlPath, size_t nBufferSize);
|
||||
KYFGLIBPLUGIN_API KYBOOL __cdecl KYFGCAMERA_XML_Content_Update(const KYFGCAMERA_INFO2* pCameraInfo,
|
||||
const char* pXmlOriginalcontent, size_t originalSize, KYBOOL isOriginalZipFile,
|
||||
char* pXmlNewContent, size_t* pNewSize, KYBOOL* pisNewZipFile);
|
||||
|
||||
KYFGLIBPLUGIN_API KYBOOL __cdecl KYFG_BufferAnnounce_Hook(STREAM_HANDLE streamHandle,
|
||||
void * pFrameMemory,
|
||||
size_t iSize,
|
||||
void * pPrivate,
|
||||
STREAM_BUFFER_HANDLE * pBufferHandle);
|
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"X": 1 // Just first dummy entry - no meaning
|
||||
,
|
||||
"Q-4A180-Dc/CXP-6": {
|
||||
"KYFGCAMERA_INFO2_Update": {
|
||||
"X": 1 // Just first dummy entry - no meaning
|
||||
,
|
||||
"deviceVendorName": "Ernst Leitz",
|
||||
"deviceModelName": "Ur-Leica",
|
||||
"deviceManufacturerInfo": "Ernst Leitz Wetzlar"
|
||||
}
|
||||
},
|
||||
|
||||
"KYFG_BufferAnnounce_Hook": {"active" : true}
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,294 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="DebugKY|Win32">
|
||||
<Configuration>DebugKY</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="DebugKY|x64">
|
||||
<Configuration>DebugKY</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>15.0</VCProjectVersion>
|
||||
<ProjectGuid>{28A9F782-D7C0-4D33-9879-09673A971090}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>KYFGLibPlugin</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(KAYA_DEVENV_ROOT_DIR)\src\KYGlobal\KYGlobal.props" Condition="exists('$(KAYA_DEVENV_ROOT_DIR)\src\KYGlobal\KYGlobal.props')" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugKY|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugKY|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugKY|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugKY|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<TargetName>KYFGLib_Plugin</TargetName>
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugKY|x64'">
|
||||
<TargetName>KYFGLib_Plugin</TargetName>
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<TargetName>KYFGLib_Plugin</TargetName>
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugKY|Win32'">
|
||||
<TargetName>KYFGLib_Plugin</TargetName>
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<TargetName>KYFGLib_Plugin</TargetName>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<TargetName>KYFGLib_Plugin</TargetName>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
<LocalDebuggerCommand>$(KAYA_VISION_POINT_APP_PATH)\VisionPoint.exe</LocalDebuggerCommand>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
<LocalDebuggerCommand>$(KAYA_VISION_POINT_APP_PATH)\VisionPointD.exe</LocalDebuggerCommand>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugKY|x64'">
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
<LocalDebuggerCommand>$(KAYA_VISION_POINT_APP_PATH)\VisionPointD.exe</LocalDebuggerCommand>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;JSON_IS_AMALGAMATION;_DEBUG;KYFGLIBPLUGIN_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(KAYA_VISION_POINT_INCLUDE_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableUAC>false</EnableUAC>
|
||||
<AdditionalDependencies>KYFGLib_vc141.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(KAYA_VISION_POINT_LIB_PATH);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>xcopy "$(ProjectDir)\$(OutDir)\$(TargetName)$(TargetExt)" "$(KAYA_VISION_POINT_BIN_PATH)\__Plugins\" /Y /I /D
|
||||
xcopy "$(ProjectDir)KYFGLib_Plugin.json" "$(KAYA_VISION_POINT_BIN_PATH)\__Plugins\" /Y /I /D</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugKY|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;JSON_IS_AMALGAMATION;_DEBUG;KYFGLIBPLUGIN_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(KAYA_VISION_POINT_INCLUDE_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableUAC>false</EnableUAC>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>xcopy "$(ProjectDir)\$(OutDir)\$(TargetName)$(TargetExt)" "$(KAYA_VISION_POINT_BIN_PATH)\__Plugins\" /Y /I /D
|
||||
xcopy "$(ProjectDir)KYFGLib_Plugin.json" "$(KAYA_VISION_POINT_BIN_PATH)\__Plugins\" /Y /I /D</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;JSON_IS_AMALGAMATION;WIN32;_DEBUG;KYFGLIBPLUGIN_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(KAYA_VISION_POINT_INCLUDE_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableUAC>false</EnableUAC>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>xcopy "$(ProjectDir)\$(OutDir)\$(TargetName)$(TargetExt)" "$(KAYA_VISION_POINT_BIN_PATH)\__Plugins\" /Y /I /D</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugKY|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;JSON_IS_AMALGAMATION;WIN32;_DEBUG;KYFGLIBPLUGIN_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(KAYA_VISION_POINT_INCLUDE_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableUAC>false</EnableUAC>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>xcopy "$(ProjectDir)\$(OutDir)\$(TargetName)$(TargetExt)" "$(KAYA_VISION_POINT_BIN_PATH)\__Plugins\" /Y /I /D</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;JSON_IS_AMALGAMATION;WIN32;NDEBUG;KYFGLIBPLUGIN_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(KAYA_VISION_POINT_INCLUDE_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableUAC>false</EnableUAC>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>xcopy "$(ProjectDir)\$(OutDir)\$(TargetName)$(TargetExt)" "$(KAYA_VISION_POINT_BIN_PATH)\__Plugins\" /Y /I /D</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;JSON_IS_AMALGAMATION;NDEBUG;KYFGLIBPLUGIN_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>$(KAYA_VISION_POINT_INCLUDE_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableUAC>false</EnableUAC>
|
||||
<AdditionalDependencies>KYFGLib_vc141.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(KAYA_VISION_POINT_LIB_PATH);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>IF EXIST $(KAYA_DEVENV_ROOT_DIR) xcopy "$(TargetPath)" "$(KAYA_VISION_POINT_BIN_PATH)\__Plugins\" /Y /I /D
|
||||
IF EXIST $(KAYA_DEVENV_ROOT_DIR) xcopy "$(ProjectDir)KYFGLib_Plugin.json" "$(KAYA_VISION_POINT_BIN_PATH)\__Plugins\" /Y /I /D</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<None Include="KYFGLib_Plugin.json" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="KYFGLib_Plugin.h" />
|
||||
<ClInclude Include="pch.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="jsoncpp.cpp" />
|
||||
<ClCompile Include="KYFGLib_Plugin.cpp" />
|
||||
<ClCompile Include="pch.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='DebugKY|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='DebugKY|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
@@ -0,0 +1,4 @@
|
||||
Pay attention that this is the sample for YOUR plugin. Do NOT use it as is in production!!!!
|
||||
1. Build with the Release x64 configuration
|
||||
2. Copy the built KYFGLib_Plugin.dll and KYFGLib_Plugin.json from the source folder to the {KAYA instruments root folder}\Common\bin\__Plugins (e.g. C:\Program Files\KAYA Instruments\Common\bin\__Plugins)
|
||||
3. Start the Vision Point application and check that your changes work
|
@@ -0,0 +1,249 @@
|
||||
/// Json-cpp amalgated forward header (http://jsoncpp.sourceforge.net/).
|
||||
/// It is intented to be used with #include <json/json-forwards.h>
|
||||
/// This header provides forward declaration for all JsonCpp types.
|
||||
|
||||
// //////////////////////////////////////////////////////////////////////
|
||||
// Beginning of content of file: LICENSE
|
||||
// //////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*
|
||||
The JsonCpp library's source code, including accompanying documentation,
|
||||
tests and demonstration applications, are licensed under the following
|
||||
conditions...
|
||||
|
||||
The author (Baptiste Lepilleur) explicitly disclaims copyright in all
|
||||
jurisdictions which recognize such a disclaimer. In such jurisdictions,
|
||||
this software is released into the Public Domain.
|
||||
|
||||
In jurisdictions which do not recognize Public Domain property (e.g. Germany as of
|
||||
2010), this software is Copyright (c) 2007-2010 by Baptiste Lepilleur, and is
|
||||
released under the terms of the MIT License (see below).
|
||||
|
||||
In jurisdictions which recognize Public Domain property, the user of this
|
||||
software may choose to accept it either as 1) Public Domain, 2) under the
|
||||
conditions of the MIT License (see below), or 3) under the terms of dual
|
||||
Public Domain/MIT License conditions described here, as they choose.
|
||||
|
||||
The MIT License is about as close to Public Domain as a license can get, and is
|
||||
described in clear, concise terms at:
|
||||
|
||||
http://en.wikipedia.org/wiki/MIT_License
|
||||
|
||||
The full text of the MIT License follows:
|
||||
|
||||
========================================================================
|
||||
Copyright (c) 2007-2010 Baptiste Lepilleur
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
files (the "Software"), to deal in the Software without
|
||||
restriction, including without limitation the rights to use, copy,
|
||||
modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
========================================================================
|
||||
(END LICENSE TEXT)
|
||||
|
||||
The MIT license is compatible with both the GPL and commercial
|
||||
software, affording one all of the rights of Public Domain with the
|
||||
minor nuisance of being required to keep the above copyright notice
|
||||
and license text in the source code. Note also that by accepting the
|
||||
Public Domain "license" you can re-license your copy using whatever
|
||||
license you like.
|
||||
|
||||
*/
|
||||
|
||||
// //////////////////////////////////////////////////////////////////////
|
||||
// End of content of file: LICENSE
|
||||
// //////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#ifndef JSON_FORWARD_AMALGATED_H_INCLUDED
|
||||
# define JSON_FORWARD_AMALGATED_H_INCLUDED
|
||||
/// If defined, indicates that the source file is amalgated
|
||||
/// to prevent private header inclusion.
|
||||
#define JSON_IS_AMALGATED
|
||||
|
||||
// //////////////////////////////////////////////////////////////////////
|
||||
// Beginning of content of file: include/json/config.h
|
||||
// //////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Copyright 2007-2010 Baptiste Lepilleur
|
||||
// Distributed under MIT license, or public domain if desired and
|
||||
// recognized in your jurisdiction.
|
||||
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
|
||||
|
||||
#ifndef JSON_CONFIG_H_INCLUDED
|
||||
# define JSON_CONFIG_H_INCLUDED
|
||||
|
||||
/// If defined, indicates that json library is embedded in CppTL library.
|
||||
//# define JSON_IN_CPPTL 1
|
||||
|
||||
/// If defined, indicates that json may leverage CppTL library
|
||||
//# define JSON_USE_CPPTL 1
|
||||
/// If defined, indicates that cpptl vector based map should be used instead of std::map
|
||||
/// as Value container.
|
||||
//# define JSON_USE_CPPTL_SMALLMAP 1
|
||||
/// If defined, indicates that Json specific container should be used
|
||||
/// (hash table & simple deque container with customizable allocator).
|
||||
/// THIS FEATURE IS STILL EXPERIMENTAL! There is know bugs: See #3177332
|
||||
//# define JSON_VALUE_USE_INTERNAL_MAP 1
|
||||
/// Force usage of standard new/malloc based allocator instead of memory pool based allocator.
|
||||
/// The memory pools allocator used optimization (initializing Value and ValueInternalLink
|
||||
/// as if it was a POD) that may cause some validation tool to report errors.
|
||||
/// Only has effects if JSON_VALUE_USE_INTERNAL_MAP is defined.
|
||||
//# define JSON_USE_SIMPLE_INTERNAL_ALLOCATOR 1
|
||||
|
||||
/// If defined, indicates that Json use exception to report invalid type manipulation
|
||||
/// instead of C assert macro.
|
||||
# define JSON_USE_EXCEPTION 1
|
||||
|
||||
/// If defined, indicates that the source file is amalgated
|
||||
/// to prevent private header inclusion.
|
||||
/// Remarks: it is automatically defined in the generated amalgated header.
|
||||
// #define JSON_IS_AMALGAMATION
|
||||
|
||||
|
||||
# ifdef JSON_IN_CPPTL
|
||||
# include <cpptl/config.h>
|
||||
# ifndef JSON_USE_CPPTL
|
||||
# define JSON_USE_CPPTL 1
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# ifdef JSON_IN_CPPTL
|
||||
# define JSON_API CPPTL_API
|
||||
# elif defined(JSON_DLL_BUILD)
|
||||
# define JSON_API __declspec(dllexport)
|
||||
# elif defined(JSON_DLL)
|
||||
# define JSON_API __declspec(dllimport)
|
||||
# else
|
||||
# define JSON_API
|
||||
# endif
|
||||
|
||||
// If JSON_NO_INT64 is defined, then Json only support C++ "int" type for integer
|
||||
// Storages, and 64 bits integer support is disabled.
|
||||
// #define JSON_NO_INT64 1
|
||||
|
||||
#if defined(_MSC_VER) && _MSC_VER <= 1200 // MSVC 6
|
||||
// Microsoft Visual Studio 6 only support conversion from __int64 to double
|
||||
// (no conversion from unsigned __int64).
|
||||
#define JSON_USE_INT64_DOUBLE_CONVERSION 1
|
||||
#endif // if defined(_MSC_VER) && _MSC_VER < 1200 // MSVC 6
|
||||
|
||||
#if defined(_MSC_VER) && _MSC_VER >= 1500 // MSVC 2008
|
||||
/// Indicates that the following function is deprecated.
|
||||
# define JSONCPP_DEPRECATED(message) __declspec(deprecated(message))
|
||||
#endif
|
||||
|
||||
#if !defined(JSONCPP_DEPRECATED)
|
||||
# define JSONCPP_DEPRECATED(message)
|
||||
#endif // if !defined(JSONCPP_DEPRECATED)
|
||||
|
||||
namespace Json {
|
||||
typedef int Int;
|
||||
typedef unsigned int UInt;
|
||||
# if defined(JSON_NO_INT64)
|
||||
typedef int LargestInt;
|
||||
typedef unsigned int LargestUInt;
|
||||
# undef JSON_HAS_INT64
|
||||
# else // if defined(JSON_NO_INT64)
|
||||
// For Microsoft Visual use specific types as long long is not supported
|
||||
# if defined(_MSC_VER) // Microsoft Visual Studio
|
||||
typedef __int64 Int64;
|
||||
typedef unsigned __int64 UInt64;
|
||||
# else // if defined(_MSC_VER) // Other platforms, use long long
|
||||
typedef long long int Int64;
|
||||
typedef unsigned long long int UInt64;
|
||||
# endif // if defined(_MSC_VER)
|
||||
typedef Int64 LargestInt;
|
||||
typedef UInt64 LargestUInt;
|
||||
# define JSON_HAS_INT64
|
||||
# endif // if defined(JSON_NO_INT64)
|
||||
} // end namespace Json
|
||||
|
||||
|
||||
#endif // JSON_CONFIG_H_INCLUDED
|
||||
|
||||
// //////////////////////////////////////////////////////////////////////
|
||||
// End of content of file: include/json/config.h
|
||||
// //////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// //////////////////////////////////////////////////////////////////////
|
||||
// Beginning of content of file: include/json/forwards.h
|
||||
// //////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Copyright 2007-2010 Baptiste Lepilleur
|
||||
// Distributed under MIT license, or public domain if desired and
|
||||
// recognized in your jurisdiction.
|
||||
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
|
||||
|
||||
#ifndef JSON_FORWARDS_H_INCLUDED
|
||||
# define JSON_FORWARDS_H_INCLUDED
|
||||
|
||||
#if !defined(JSON_IS_AMALGAMATION)
|
||||
# include "config.h"
|
||||
#endif // if !defined(JSON_IS_AMALGAMATION)
|
||||
|
||||
namespace Json {
|
||||
|
||||
// writer.h
|
||||
class FastWriter;
|
||||
class StyledWriter;
|
||||
|
||||
// reader.h
|
||||
class Reader;
|
||||
|
||||
// features.h
|
||||
class Features;
|
||||
|
||||
// value.h
|
||||
typedef unsigned int ArrayIndex;
|
||||
class StaticString;
|
||||
class Path;
|
||||
class PathArgument;
|
||||
class Value;
|
||||
class ValueIteratorBase;
|
||||
class ValueIterator;
|
||||
class ValueConstIterator;
|
||||
#ifdef JSON_VALUE_USE_INTERNAL_MAP
|
||||
class ValueMapAllocator;
|
||||
class ValueInternalLink;
|
||||
class ValueInternalArray;
|
||||
class ValueInternalMap;
|
||||
#endif // #ifdef JSON_VALUE_USE_INTERNAL_MAP
|
||||
|
||||
} // namespace Json
|
||||
|
||||
|
||||
#endif // JSON_FORWARDS_H_INCLUDED
|
||||
|
||||
// //////////////////////////////////////////////////////////////////////
|
||||
// End of content of file: include/json/forwards.h
|
||||
// //////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif //ifndef JSON_FORWARD_AMALGATED_H_INCLUDED
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,5 @@
|
||||
// pch.cpp: source file corresponding to the pre-compiled header
|
||||
|
||||
#include "pch.h"
|
||||
|
||||
// When you are using pre-compiled headers, this source file is necessary for compilation to succeed.
|
@@ -0,0 +1,24 @@
|
||||
// pch.h: This is a precompiled header file.
|
||||
// Files listed below are compiled only once, improving build performance for future builds.
|
||||
// This also affects IntelliSense performance, including code completion and many code browsing features.
|
||||
// However, files listed here are ALL re-compiled if any one of them is updated between builds.
|
||||
// Do not add files here that you will be updating frequently as this negates the performance advantage.
|
||||
|
||||
#ifndef PCH_H
|
||||
#define PCH_H
|
||||
|
||||
#ifdef _WIN32
|
||||
struct IUnknown; // Workaround for "combaseapi.h(229): error C2187: syntax error: 'identifier' was unexpected here" when using /permissive- (https://developercommunity.visualstudio.com/t/error-c2760-in-combaseapih-with-windows-sdk-81-and/185399)
|
||||
#include "Windows.h"
|
||||
#endif // #ifdef _WIN32
|
||||
|
||||
// add headers that you want to pre-compile here
|
||||
#include "KYFGLib.h"
|
||||
|
||||
#include <string>
|
||||
#include <string.h>
|
||||
|
||||
// #define JSON_IS_AMALGAMATION // note that this is #defined in the project settings
|
||||
#include "json.h"
|
||||
|
||||
#endif //PCH_H
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user