sdhoptions.h
Go to the documentation of this file.
1 //======================================================================
29 //======================================================================
30 
31 #ifndef SDHOPTIONS_h
32 #define SDHOPTIONS_h
33 
34 //----------------------------------------------------------------------
35 // System Includes - include with <>
36 //----------------------------------------------------------------------
37 
38 #include <getopt.h>
39 #include <assert.h>
40 
41 #include <iostream>
42 #include <string>
43 
44 //----------------------------------------------------------------------
45 // Project Includes - include with ""
46 //---------------------------------------------------------------------
47 
48 #include <sdh/sdh.h>
49 
50 //----------------------------------------------------------------------
51 // Defines, enums, unions, structs,
52 //----------------------------------------------------------------------
53 
64 #define SDHUSAGE_DEFAULT "general sdhcom_serial sdhcom_common sdhcom_esdcan sdhcom_peakcan sdhcom_cancommon sdhcom_tcp"
65 
66 #define SDH_DEFAULT_TCP_ADR "192.168.1.42"
67 #define SDH_DEFAULT_TCP_PORT 23
68 #define DSA_DEFAULT_TCP_PORT 13000
69 
70 //----------------------------------------------------------------------
71 // Global variables
72 //----------------------------------------------------------------------
73 
74 
79 {
80 public:
81  static int const MAX_DEV_LENGTH = 32;
82 
83  std::string usage;
84 
86  std::ostream* debuglog;
87 
88  int sdhport;
90  double timeout;
91  unsigned long rs232_baudrate;
92 
94  int net;
95 
98 
99  unsigned long can_baudrate;
100  unsigned int id_read;
101  unsigned int id_write;
102 
105  double period;
106 
107  int dsaport;
109  bool do_RLE;
110 
112  bool fullframe;
115  int matrixinfo[6];
116 
117  double sensitivity[6];
118  unsigned int threshold[6];
122 
123  bool use_tcp;
124  std::string tcp_adr;
125  int tcp_port;
126 
129 
148  cSDHOptions( char const* option_selection = SDHUSAGE_DEFAULT );
149 
151  ~cSDHOptions();
152 
159  int Parse( int argc, char** argv,
160  char const* helptext, char const* progname, char const* version, char const* libname, char const* librelease );
161 
168  void OpenCommunication( NS_SDH cSDH &hand );
169 };
170 
171 #endif
172 
173 //======================================================================
174 /*
175  Here are some settings for the emacs/xemacs editor (and can be safely ignored):
176  (e.g. to explicitely set C++ mode for *.h header files)
177 
178  Local Variables:
179  mode:C++
180  mode:ELSE
181  End:
182 */
183 //======================================================================
#SDH::cSDH is the end user interface class to control a SDH (SCHUNK Dexterous Hand).
Definition: sdh.h:172
unsigned long can_baudrate
Definition: sdhoptions.h:99
int Parse(int argc, char **argv, char const *helptext, char const *progname, char const *version, char const *libname, char const *librelease)
Definition: sdhoptions.cpp:464
std::string tcp_adr
Definition: sdhoptions.h:124
This file contains the interface to class #SDH::cSDH, the end user class to access the SDH from a PC...
bool use_fahrenheit
Definition: sdhoptions.h:104
char sdh_canpeak_device[MAX_DEV_LENGTH]
Definition: sdhoptions.h:97
bool use_can_peak
Definition: sdhoptions.h:96
bool use_radians
Definition: sdhoptions.h:103
unsigned int id_write
Definition: sdhoptions.h:101
unsigned int id_read
Definition: sdhoptions.h:100
bool dsa_use_tcp
Definition: sdhoptions.h:127
bool reset_to_default
Definition: sdhoptions.h:119
std::ostream * debuglog
Definition: sdhoptions.h:86
int debug_level
Definition: sdhoptions.h:85
bool controllerinfo
Definition: sdhoptions.h:114
#define SDHUSAGE_DEFAULT
Definition: sdhoptions.h:64
double period
Definition: sdhoptions.h:105
double sensitivity[6]
Definition: sdhoptions.h:117
static int const MAX_DEV_LENGTH
Definition: sdhoptions.h:81
int dsa_tcp_port
Definition: sdhoptions.h:128
cSDHOptions(char const *option_selection=SDHUSAGE_DEFAULT)
Definition: sdhoptions.cpp:380
std::string usage
Definition: sdhoptions.h:83
bool use_tcp
Definition: sdhoptions.h:123
void OpenCommunication(NS_SDH cSDH &hand)
Definition: sdhoptions.cpp:865
#define NS_SDH
bool persistent
Definition: sdhoptions.h:120
bool fullframe
Definition: sdhoptions.h:112
int matrixinfo[6]
Definition: sdhoptions.h:115
bool use_can_esd
Definition: sdhoptions.h:93
bool sensorinfo
Definition: sdhoptions.h:113
~cSDHOptions()
destructor, clean up
Definition: sdhoptions.cpp:457
char dsa_rs_device[MAX_DEV_LENGTH]
Definition: sdhoptions.h:108
char sdh_rs_device[MAX_DEV_LENGTH]
Definition: sdhoptions.h:89
bool showdsasettings
Definition: sdhoptions.h:121
class for command line option parsing holding option parsing results
Definition: sdhoptions.h:78
unsigned int threshold[6]
Definition: sdhoptions.h:118
unsigned long rs232_baudrate
Definition: sdhoptions.h:91
double timeout
Definition: sdhoptions.h:90


sdhlibrary_cpp
Author(s): Dirk Osswald
autogenerated on Mon Feb 28 2022 23:41:51