2017-09-19 16:33:05 +02:00

208 lines
10 KiB
HTML

<!-- This comment will put IE 6, 7 and 8 in quirks mode -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>mainClient.cpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.6.1 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<img id="MSearchSelect" src="search/search.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</div>
</li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="contents">
<h1>mainClient.cpp File Reference</h1><code>#include &quot;<a class="el" href="slsDetectorUsers_8h_source.html">slsDetectorUsers.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="detectorData_8h_source.html">detectorData.h</a>&quot;</code><br/>
<code>#include &lt;iostream&gt;</code><br/>
<code>#include &lt;cstdlib&gt;</code><br/>
<p><a href="mainClient_8cpp_source.html">Go to the source code of this file.</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="mainClient_8cpp.html#abba369ecba2066d66cc8b3b74460e778">dataCallback</a> (<a class="el" href="classdetectorData.html">detectorData</a> *pData, int iframe, int isubframe, void *pArg)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="mainClient_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627">main</a> (int argc, char **argv)</td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>This file is an example of how to implement the <a class="el" href="classslsDetectorUsers.html" title="Class for detector functionalitiesto embed the detector controls in the users custom...">slsDetectorUsers</a> class You can compile it linking it to the slsDetector library</p>
<p>g++ <a class="el" href="mainClient_8cpp.html">mainClient.cpp</a> -L lib -lSlsDetector -L/usr/lib64/ -L lib2 -lzmq -pthread -lrt -lm -lstdc++</p>
<p>where,</p>
<p>lib is the location of libSlsDetector.so</p>
<p>lib2 is the location of the libzmq.a. [ libzmq.a is required only when using data call backs and enabling data streaming from receiver to client. It is linked in manual/manual-api from slsReceiverSoftware/include ] </p>
<p>Definition in file <a class="el" href="mainClient_8cpp_source.html">mainClient.cpp</a>.</p>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="abba369ecba2066d66cc8b3b74460e778"></a><!-- doxytag: member="mainClient.cpp::dataCallback" ref="abba369ecba2066d66cc8b3b74460e778" args="(detectorData *pData, int iframe, int isubframe, void *pArg)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int dataCallback </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classdetectorData.html">detectorData</a> *&nbsp;</td>
<td class="paramname"> <em>pData</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&nbsp;</td>
<td class="paramname"> <em>iframe</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&nbsp;</td>
<td class="paramname"> <em>isubframe</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void *&nbsp;</td>
<td class="paramname"> <em>pArg</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Data Call back function defined </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>pData</em>&nbsp;</td><td>pointer to data structure received from the call back </td></tr>
<tr><td valign="top"></td><td valign="top"><em>iframe</em>&nbsp;</td><td>frame number of data passed </td></tr>
<tr><td valign="top"></td><td valign="top"><em>isubframe</em>&nbsp;</td><td>sub frame number of data passed ( only valid for EIGER in 32 bit mode) </td></tr>
<tr><td valign="top"></td><td valign="top"><em>pArg</em>&nbsp;</td><td>pointer to object </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>integer that is currently ignored </dd></dl>
<p>Definition at line <a class="el" href="mainClient_8cpp_source.html#l00032">32</a> of file <a class="el" href="mainClient_8cpp_source.html">mainClient.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a3c04138a5bfe5d72780bb7e82a18e627"></a><!-- doxytag: member="mainClient.cpp::main" ref="a3c04138a5bfe5d72780bb7e82a18e627" args="(int argc, char **argv)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int main </td>
<td>(</td>
<td class="paramtype">int&nbsp;</td>
<td class="paramname"> <em>argc</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char **&nbsp;</td>
<td class="paramname"> <em>argv</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Example of a main program using the <a class="el" href="classslsDetectorUsers.html" title="Class for detector functionalitiesto embed the detector controls in the users custom...">slsDetectorUsers</a> class</p>
<ul>
<li>Arguments are optional<ul>
<li>argv[1] : Configuration File</li>
<li>argv[2] : Measurement Setup File</li>
<li>argv[3] : Detector Id (default is zero) </li>
</ul>
</li>
</ul>
<p><ul>
<li>if specified, set ID from argv[3]</li>
</ul>
<ul>
<li><a class="el" href="classslsDetectorUsers.html" title="Class for detector functionalitiesto embed the detector controls in the users custom...">slsDetectorUsers</a> Object is instantiated with appropriate ID</li>
</ul>
<ul>
<li>if specified, load configuration file (necessary at least the first time it is called to properly configure advanced settings in the shared memory)</li>
</ul>
<ul>
<li>registering data callback</li>
</ul>
<ul>
<li>if receiver exists, enable data streaming from receiver to get the data</li>
</ul>
<ul>
<li>ensuring detector status is idle before starting acquisition. exiting if not idle</li>
</ul>
<ul>
<li>if provided, load detector settings</li>
</ul>
<ul>
<li>start measurement</li>
</ul>
<ul>
<li>returning when acquisition is finished or data are avilable</li>
</ul>
<ul>
<li>delete <a class="el" href="classslsDetectorUsers.html" title="Class for detector functionalitiesto embed the detector controls in the users custom...">slsDetectorUsers</a> object </li>
</ul>
</p>
<p>Definition at line <a class="el" href="mainClient_8cpp_source.html#l00046">46</a> of file <a class="el" href="mainClient_8cpp_source.html">mainClient.cpp</a>.</p>
</div>
</div>
</div>
<!--- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&nbsp;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&nbsp;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&nbsp;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&nbsp;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&nbsp;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&nbsp;</span>Defines</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<hr size="1"/><address style="text-align: right;"><small>Generated on 19 Sep 2017 by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body>
</html>