mainClient.cpp File Reference

#include <iostream>
#include "slsDetectorUsers.h"
#include "detectorData.h"
#include <cstdlib>

Go to the source code of this file.

Functions

int dataCallback (detectorData *pData, int iframe, int isubframe, void *pArg)
int main (int argc, char **argv)

Detailed Description

This file is an example of how to implement the slsDetectorUsers class You can compile it linking it to the slsDetector library

gcc mainClient.cpp -L lib -l SlsDetector -lm -pthread

where lib is the location of libSlsDetector.so gcc mainClient.cpp -L . -l SlsDetector -lm -pthread -o users

Definition in file mainClient.cpp.


Function Documentation

int dataCallback ( detectorData pData,
int  iframe,
int  isubframe,
void *  pArg 
)

Definition of the data callback which simply prints out the number of points received and teh frame number

Definition at line 20 of file mainClient.cpp.

int main ( int  argc,
char **  argv 
)

example of a main program using the slsDetectorUsers class

if specified, argv[3] is used as detector ID (default is 0)

slsDetectorUsers is instantiated

if specified, argv[1] is used as detector config file (necessary at least the first time it is called to properly configure advanced settings in the shared memory)

registering data callback

checking detector status and exiting if not idle

load detector settings

start measurement

returning when acquisition is finished or data are avilable

Definition at line 27 of file mainClient.cpp.

 All Classes Files Functions Variables Defines

Generated on 24 Aug 2017 by  doxygen 1.6.1