[WIP] sync linux/win

parent 6d130c04
......@@ -501,6 +501,18 @@
RelativePath="..\..\..\..\src\PcoCamera.cpp"
>
</File>
<File
RelativePath="..\..\..\..\src\PcoCameraLin.cpp"
>
<FileConfiguration
Name="Release|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\..\..\src\PcoCameraSdk.cpp"
>
......@@ -521,6 +533,18 @@
RelativePath="..\..\..\..\src\PcoCameraUtils.cpp"
>
</File>
<File
RelativePath="..\..\..\..\src\PcoCameraWin.cpp"
>
<FileConfiguration
Name="Release|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\..\..\src\PcoDetInfoCtrlObj.cpp"
>
......
......@@ -80,9 +80,7 @@ DECLARE_HANDLE(HWND);
#define _stricmp strcasecmp
#define strcpy_s(d, l, s) strncpy( (d), (s), (l) )
#define strncpy_s(d, s, l) strncpy( (d), (s), (l) )
#define strncpy_s4(d, l , s , n) strncpy( (d), (s), (l) )
#define strncpy_s(d, l , s , n) strncpy( (d), (s), (l) )
#define VS_PLATFORM "osLinux"
#define VS_CONFIGURATION x64
......@@ -250,4 +248,4 @@ int _get_imageNr_from_imageTimestamp(void *buf,int shift);
int _get_time_from_imageTimestamp(void *buf,int shift,SYSTEMTIME *st);
#endif
#endif
#endif
\ No newline at end of file
......@@ -166,6 +166,10 @@ struct stcSegmentInfo
DWORD dwValidImageCnt;
DWORD dwMaxImageCnt;
};
//================================================================
// LINUX
//================================================================
#ifdef __linux__
typedef struct
{
......@@ -180,6 +184,8 @@ typedef struct
DWORD ZZdwReserved[11]; // 60
} PCO_SignalLinux;
#endif
//================================================================
//================================================================
#define LEN_TRACEACQ_MSG 512
#define LEN_ERROR_MSG (512-1)
......@@ -193,10 +199,13 @@ char DLL_EXPORT *_hex_dump_bytes(void *obj, size_t lenObj, char *buff, size_t le
long msElapsedTime(TIME_USEC &t0);
void msElapsedTimeSet(TIME_USEC &t0);
void usElapsedTimeSet(LARGE_INTEGER &tick0) ;
long long usElapsedTime(LARGE_INTEGER &tick0) ;
void usElapsedTimeSet(long long &us0) ;
long long usElapsedTime(long long &us0) ;
double usElapsedTimeTicsPerSec() ;
#define DIM_ACTION_TIMESTAMP 10
enum actionTimestamp {tsConstructor = 0, tsStartAcq, tsStopAcq, tsPrepareAcq, tsReset};
......@@ -279,6 +288,9 @@ struct stcPcoData
PCO_CameraType stcPcoCamType;
PCO_Sensor stcPcoSensor;
//================================================================
// LINUX / WIN
//================================================================
#ifndef __linux__
PCO_Description stcPcoDescription; /* camera description structure */
PCO_Signal stcPcoHWIOSignal[SIZEARR_stcPcoHWIOSignal];
......@@ -294,6 +306,8 @@ struct stcPcoData
SC2_Get_HW_IO_Signal_Descriptor_Response stcPcoHWIOSignalDesc[SIZEARR_stcPcoHWIOSignal];
char sPcoHWIOSignalDesc[SIZEARR_stcPcoHWIOSignal][SIZESTR_PcoHWIOSignal+1];
#endif
//================================================================
//================================================================
const char *sClTransferParameterSettings;
......@@ -614,6 +628,9 @@ namespace lima
void startAcq();
void reset(int reset_level);
//================================================================
// LINUX
//================================================================
#ifdef __linux__
CPco_com *camera;
CPco_grab_cl_me4* grabber;
......@@ -622,6 +639,8 @@ namespace lima
void stopAcq();
void _stopAcq(bool waitForThread);
#endif
//================================================================
//================================================================
// ----- BIN
void setBin(const Bin& aBin);
......@@ -676,9 +695,6 @@ namespace lima
void paramsInit(const char *str);
bool paramsGet(const char *key, char *&value);
#ifdef __linux
bool paramsGet(const char *key, unsigned long long &value);
#endif
time_t _getActionTimestamp(int action);
void _setActionTimestamp(int action);
......@@ -698,11 +714,16 @@ namespace lima
Cond m_cond;
//================================================================
// LINUX
//================================================================
#ifdef __linux__
class _AcqThread;
friend class _AcqThread;
_AcqThread* m_acq_thread;
#endif
//================================================================
//================================================================
volatile bool m_wait_flag;
volatile bool m_quit;
volatile bool m_thread_running;
......@@ -816,9 +837,14 @@ namespace lima
bool _getCameraState(long long flag);
void _setCameraState(long long flag, bool val);
//================================================================
// WIN
//================================================================
#ifndef __linux__
bool _isRunAfterAssign();
#endif
//================================================================
//================================================================
bool _isCapsDesc(int caps);
void _pco_GetAcqEnblSignalStatus(WORD &wAcquEnableState, int &err);
......@@ -829,6 +855,9 @@ namespace lima
void _pco_SetCameraToCurrentTime(int &error);
void _pco_SetCamLinkSetImageParameters(int &error);
//================================================================
// LINUX
//================================================================
#ifdef __linux__
void _pco_GetLut(int &err);
void _pco_Open_Cam(int &err);
......@@ -836,6 +865,8 @@ namespace lima
void _pco_GetCameraInfo(int &error);
void _pco_ResetSettingsToDefault(int &err);
#endif
//================================================================
//================================================================
void _pco_GetSizes( WORD *wXResActual, WORD *wYResActual, WORD *wXResMax,WORD *wYResMax, int &error);
void _pco_SetTransferParameter_SetActiveLookupTable_win(int &error);
......@@ -974,9 +1005,14 @@ namespace lima
void dummySip();
//================================================================
// LINUX
//================================================================
#ifdef __linux__
void _waitForRecording(int nrFrames, DWORD &_dwValidImageCnt, DWORD &_dwMaxImageCnt, int &error) ;
#endif
//================================================================
//================================================================
//----
void _pco_GetInfoString(int infotype, char *buf_in, int size_in, int &error);
void _pco_GetBinning(Bin &bin, int &err);
......@@ -1060,6 +1096,9 @@ void _pco_time2dwbase(double exp_time, DWORD &dwExp, WORD &wBase);
//================================================================
// LINUX
//================================================================
//--------------------- dummies for linux
#ifdef __linux__
......@@ -1070,16 +1109,13 @@ void _pco_time2dwbase(double exp_time, DWORD &dwExp, WORD &wBase);
long msElapsedTime(TIME_USEC &t0);
void msElapsedTimeSet(TIME_USEC &t0);
void usElapsedTimeSet(TIME_UTICKS &tick0) ;
long long usElapsedTime(TIME_UTICKS &tick0) ;
double usElapsedTimeTicsPerSec() ;
enum traceAcqId {traceAcq_execTimeTot, };
int image_nr_from_timestamp(void *buf,int shift, bool bDisable);
#endif
//================================================================
//================================================================
#endif
\ No newline at end of file
#endif
//-----------------------------------------------------------------//
// Name | Ccambuf.h | Type: ( ) source //
//-------------------------------------------| (*) header //
// Project | pco.camera | ( ) others //
//-----------------------------------------------------------------//
// Platform | Linux //
//-----------------------------------------------------------------//
// Environment | //
// | //
//-----------------------------------------------------------------//
// Purpose | pco.camera - buffer class functions //
//-----------------------------------------------------------------//
// Author | MBL, PCO AG //
//-----------------------------------------------------------------//
// Revision | rev. 1.03 //
//-----------------------------------------------------------------//
// Notes | class functions exported from Ccambuf library //
// | //
// | //
//-----------------------------------------------------------------//
// (c) 2010 - 2012 PCO AG //
// Donaupark 11 D-93309 Kelheim / Germany //
// Phone: +49 (0)9441 / 2005-0 Fax: +49 (0)9441 / 2005-20 //
// Email: info@pco.de //
//-----------------------------------------------------------------//
#ifndef Ccambuf_h
#define Ccambuf_h
#define OUT_BW 0x00
#define OUT_BGR 0x01
#define OUT_BGR0 0x02
#define OUT_PSEUDO 0x03
#define IN_BW 0x00 //input buffer is from BW-Camera
#define IN_COLOR 0x10 //input buffer is from COLOR-Camera
#define MASK_RGB 0x20
#define IN_RGB 0x20 //input buffer is from RGB-Camera
#define IN_RGB0 0x21 //input buffer is from RGB0-Camera
#define IN_BGR 0x22 //input buffer is from BGR-Camera
#define IN_BGR0 0x23 //input buffer is from BGR0-Camera
#define STATUS_INCONVERT 0x01
class Cambuf;
class CCambuf
{
//variables
public:
int status;
public:
CCambuf();
~CCambuf();
int Allocate(int width, int height,int bitpix,int align,int color_in);
int Allocate(int width, int height,int bitpix,int align);
int Allocate(int width, int height,int bitpix);
int Allocate(int size);
int Allocate();
int FreeBuffer();
int Get_Size();
int Get_actwidth();
int Get_actheight();
int Get_actbitpix();
int Get_actalign();
void* Get_actadr();
int SetCalculationRectangle(int firstline,int lastline,int firstrow,int lastrow);
void GetMinMax(int *min,int *max);
void GetMinMaxPos(int *min,int *min_pos_x,int *min_pos_y,int *max,int *max_pos_x,int *max_pos_y);
int CreateHistogramTable();
int CreateHistogramTable(int *min,int *max,double *mean,double *sigma);
int CreateHistogramTable(DWORD *histtab,int size,int *min,int *max,double *mean,double *sigma);
int CreateHistogramTables();
void Clearbuffer();
void Set_output_buffer(int mode);
void Set_output_buffer(int mode,void *bufadr);
void Set_output_lut(void *lut);
int GetColorinmode();
int convert();
int convert(void *out);
int convert(void *out,void *lut);
int convert_bw(void *out,void *lut);
int convert_col(void *out,void *lut);
void copy8to24(unsigned char *b8,unsigned char *out);
void copy8to32(unsigned char *b8,unsigned char *out);
int subtract(CCambuf *pic);
int subtract(CCambuf *pic,int offset);
int reduce(CCambuf *pic,int factor);
protected:
Cambuf *cambuf;
};
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
//-----------------------------------------------------------------//
// Name | Cpco_me4_GL.h | Type: ( ) source //
//-------------------------------------------| (*) header //
// Project | pco.camera | ( ) others //
//-----------------------------------------------------------------//
// Platform | Linux //
//-----------------------------------------------------------------//
// Environment | //
// | //
//-----------------------------------------------------------------//
// Purpose | pco.edge - CameraLink ME4 API //
//-----------------------------------------------------------------//
// Author | MBL, PCO AG //
//-----------------------------------------------------------------//
// Revision | rev. 1.03 //
//-----------------------------------------------------------------//
// Notes | In this file are all functions and definitions, //
// | for communication with CameraLink grabbers //
// | //
// | //
//-----------------------------------------------------------------//
// (c) 2010 - 2012 PCO AG //
// Donaupark 11 D-93309 Kelheim / Germany //
// Phone: +49 (0)9441 / 2005-0 Fax: +49 (0)9441 / 2005-20 //
// Email: info@pco.de //
//-----------------------------------------------------------------//
//-----------------------------------------------------------------//
// Revision History: //
// see Cpco_cl_me4_GL.cpp //
//-----------------------------------------------------------------//
#include "Cpco_grab_cl_me4.h"
#define HAP_VERSION_NOISE 12
///
/// \brief The class for a pco.edge global shutter
///
class CPco_grab_cl_me4_edge_GL : public CPco_grab_cl_me4
{
public:
CPco_grab_cl_me4_edge_GL(CPco_com_cl_me4* camera);
///
/// \brief Opens the grabber and retrieves the neccessary variables from the camera object.
///
/// \param board Set to zero if there is only one camera connected.
/// Open_Cam() on the appropriate class object \b must be called first or this will fail!
/// \return Error or 0 in case of success
///
DWORD Open_Grabber(int board);
///
/// \brief Sets the grabber size.
///
/// It is extremely important to set this before any images are transferred! If any of the settings are changed that influence the image size
/// Set_Grabber_Size \b must be called again before any images are transferred! If this is not done, memory or segmentation faults will occur!
///
/// \param width Actual width of the picture
/// \param height Actual height of the picture
/// \return Error or 0 in case of success
///
DWORD Set_Grabber_Size(DWORD width,DWORD height);
///
/// \brief Sets the data format for the grabber
/// \anchor Set_DataFormat
/// \param format The new data format.
/// \return always 0
///
DWORD Set_DataFormat(DWORD format);
///
/// \brief Reorders the image lines and copies the reordered image to the output buffer.
/// \anchor Extract_Image
/// \param bufout Output buffer. Must be large enough to hold the image!
/// \param bufin Input buffer.
/// \param width Image width.
/// \param height Image height.
/// \param line_width Unused.
///
void Extract_Image(void *bufout, void *bufin, int width, int height,int line_width ATTRIBUTE_UNUSED);
///
/// \overload Extract_Image(void*,void*,int,int,int)
///
void Extract_Image(void *bufout,void *bufin,int width,int height);
///
/// \brief Get a single image line
///
/// \param bufout Output buffer. Must be large enough to hold a single image line!
/// \param bufin Input buffer.
/// \param linenumber Line number to get.
/// \param width Image width.
/// \param height Image height.
///
void Get_Image_Line(void *bufout,void *bufin,int linenumber,int width,int height);
DWORD PostArm(int userset=0);
~CPco_grab_cl_me4_edge_GL(){Close_Grabber();}
protected:
DWORD set_actual_size_global_shutter(int width,int height,int xlen,int ylen,int xoff,int yoff,int doublemode);
DWORD set_actual_noisefilter(int noisefilter,int color);
DWORD set_actual_timestamp(int timestamp);
int act_sccmos_version;
};
//-----------------------------------------------------------------//
// Name | Cpco_log.h | Type: ( ) source //
//-------------------------------------------| (*) header //
// Project | pco.camera | ( ) others //
//-----------------------------------------------------------------//
// Platform | LINUX //
//-----------------------------------------------------------------//
// Environment | //
//-----------------------------------------------------------------//
// Purpose | pco.camera - Logging class //
//-----------------------------------------------------------------//
// Author | MBL, PCO AG //
//-----------------------------------------------------------------//
// Revision | rev. 1.03 //
//-----------------------------------------------------------------//
// Notes | Common functions //
// | //
// | //
//-----------------------------------------------------------------//
// (c) 2010 - 2012 PCO AG //
// Donaupark 11 D-93309 Kelheim / Germany //
// Phone: +49 (0)9441 / 2005-0 Fax: +49 (0)9441 / 2005-20 //
// Email: info@pco.de //
//-----------------------------------------------------------------//
//-----------------------------------------------------------------//
// Revision History: //
//-----------------------------------------------------------------//
// Rev.: | Date: | Changed: //
// --------- | ---------- | ---------------------------------------//
// 1.03 | 24.01.2012 | from Cpco_cl_com.cpp //
//-----------------------------------------------------------------//
// 0.0x | xx.xx.200x | //
//-----------------------------------------------------------------//
#ifndef CPCO_LOG_H
#define CPCO_LOG_H
#if !defined (MAX_PATH)
#define MAX_PATH 1024
#endif
#include "defs.h"
#ifndef WIN32
typedef struct SYSTEMTIME {
WORD wYear;
WORD wMonth;
WORD wDayOfWeek;
WORD wDay;
WORD wHour;
WORD wMinute;
WORD wSecond;
WORD wMilliseconds;
} SYSTEMTIME;
#endif
;
class CPco_Log
{
char logname[MAX_PATH];
public:
// CPco_Log(int logbits=0);
CPco_Log(const char *name=NULL);
~CPco_Log();
void writelog(DWORD lev,const char *str,...);
void writelog(DWORD lev,const char *str,va_list arg);
void writelog(DWORD lev,PCO_HANDLE hdriver,const char *str,...);
void writelog(DWORD lev,PCO_HANDLE hdriver,const char *str,va_list args);
void set_logbits(DWORD logbit);
DWORD get_logbits(void);
void start_time_mess(void);
double stop_time_mess(void);
#ifndef WIN32
void GetLocalTime(SYSTEMTIME* st);
void QueryPerformanceCounter(__int64* someint);
void QueryPerformanceFrequency(__int64* someint);
#endif
protected:
int hflog;
DWORD log_bits;
__int64 lpFrequency,lpPCount1,lpPCount2,lpPCount_p;
__int64 stamp1,stamp2;
};
//loglevels for interface dll
#define ERROR_M 0x0001
#define INIT_M 0x0002
#define BUFFER_M 0x0004
#define PROCESS_M 0x0008
#define COC_M 0x0010
#define INFO_M 0x0020
#define COMMAND_M 0x0040
#define PCI_M 0x0080
#define TIME_M 0x1000
#define TIME_MD 0x2000
#define NONE_M 0x01000000
#endif
//-----------------------------------------------------------------//
// Name | Cpcodisp.h | Type: ( ) source //
//-------------------------------------------| (*) header //
// Project | pco.camera | ( ) others //
//-----------------------------------------------------------------//
// Platform | Linux //
//-----------------------------------------------------------------//
// Environment | //
// | //
//-----------------------------------------------------------------//
// Purpose | pco.camera - display class functions //
//-----------------------------------------------------------------//
// Author | MBL, PCO AG //
//-----------------------------------------------------------------//
// Revision | rev. 1.03 //
//-----------------------------------------------------------------//
// Notes | class functions exported from Cpcodisp library //
// | //
// | //
//-----------------------------------------------------------------//
// (c) 2010 - 2012 PCO AG //
// Donaupark 11 D-93309 Kelheim / Germany //
// Phone: +49 (0)9441 / 2005-0 Fax: +49 (0)9441 / 2005-20 //
// Email: info@pco.de //
//-----------------------------------------------------------------//
#ifndef CPCODISP_H
#define CPCODISP_H
#include <X11/Xlib.h>
#include <X11/X.h>
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <X11/extensions/XShm.h>
#include "defs.h"
#include "PCO_err.h"
#include "Ccambuf.h"
#include "Cpco_log.h"
class PCODisp;
class CPCODisp
{
public:
CPCODisp();
~CPCODisp();
void start_log();
void start_log(DWORD level);
void stop_log();
int initialize();
int initialize(char *title);
int initialize(char *title,CCambuf *actpic);
// int open();
// int close();
void convert(void);
void Set_Actual_pic(CCambuf* actpic);
int SetConvert(int typ);
int SetConvert(double gamma);
int SetConvert(int min,int max);
int SetConvert(int min, int max,int typ,double gamma);
int SetConvert_Green(int min, int max);
int SetConvert_Red(int min, int max);
int SetConvert_Blue(int min, int max);
int SetConvert_Col(int rmin,int gmin,int bmin,int rmax,int gmax,int bmax);
int whitebalance(int low,int high);
void SetBitAlign(int align);
// void SetSize(int width,int height);
// void SetPosition(int xpos,int ypos);
// void SetZoom(double zoom);
// void GetZoom(double *zoom);
void displayfunc(void);
protected:
PCODisp *pcodisp;
};
#endif // CPCODISP_H
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#define PCO_SDK_VERSION "$Id: PCOSDK [pcoDev.1.1.14] $"
#define PCO_SDK_RELEASE "pcoDev.1.1.14"
This diff is collapsed.
This diff is collapsed.
/*
* SisoDisplay.h
*
* Copyright (c) 2002-2009 Silicon Software GmbH, All Rights Reserved.
*/
/**
* \file SisoDisplay.h
*
* \brief Header file for all display lib public functions.
*
* \author Silicon Software GmbH
*/
#ifndef __SISO_DISPLAY_H
#define __SISO_DISPLAY_H
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief Create Display
*
* The function CreateDisplay() creates a display window. I can display gray and color images.
*
* \param nDepth Color depth b/w: 1bit gray: 8bit, 16bit color: 24bit, 48bit Use the value 565 for 16Bit RGB 565
* \param nWidth Width of window in pixels.
* \param nHeight Height of window in pixels.
*
* \returns Display ID.
*/
int CreateDisplay(int nDepth, const unsigned int nWidth, const unsigned int nHeight);
/**
* \brief Sets a buffer width.
*
* The function SetBufferWidth() configures the size of the frame buffer. Hereby a window can be displayed, which is smaller than the frame buffer.
*
* \param nId ID of the display.
* \param nWidth Width of the window in pixels.
* \param nHeight Height of the window in pixels.
*/
void SetBufferWidth(int nId, const unsigned int nWidth, const unsigned int nHeight);
/**
* \brief Draw buffer.
*
* The function DrawBuffer() displays an image. The current pointer of an image will be returned by the function Fg_getImagePtr().
*
* \param nId ID of the created window.
* \param ulpBuf Pointer to the frame buffer, which is to be displayed.
* \param nNr Number of the image.
* \param cpStr A string, which is displayed in the windows bar.
*/
void DrawBuffer(int nId, const void *ulpBuf, const int nNr, const char *cpStr);