SDHLibrary-CPP 0.0.2.10SCHUNK GmbH & Co. KG
C++ access library for SCHUNK Dextrous Hand SDH

cSDHOptions Class Reference

class for command line option parsing holding option parsing results More...

#include <sdhoptions.h>

List of all members.

Public Member Functions

 cSDHOptions (char const *option_selection="general sdhcom_serial sdhcom_common sdhcom_esdcan sdhcom_peakcan sdhcom_cancommon sdhcom_tcp")
 ~cSDHOptions ()
 destructor, clean up
int Parse (int argc, char **argv, char const *helptext, char const *progname, char const *version, char const *libname, char const *librelease)
void OpenCommunication (NS_SDH cSDH &hand)

Public Attributes

std::string usage
int debug_level
std::ostream * debuglog
int sdhport
char sdh_rs_device [MAX_DEV_LENGTH]
double timeout
unsigned long rs232_baudrate
bool use_can_esd
int net
bool use_can_peak
char sdh_canpeak_device [MAX_DEV_LENGTH]
unsigned long can_baudrate
unsigned int id_read
unsigned int id_write
bool use_radians
bool use_fahrenheit
double period
int dsaport
char dsa_rs_device [MAX_DEV_LENGTH]
bool do_RLE
int framerate
bool fullframe
bool sensorinfo
bool controllerinfo
int matrixinfo [6]
double sensitivity [6]
unsigned int threshold [6]
bool reset_to_default
bool persistent
bool showdsasettings
bool use_tcp
std::string tcp_adr
int tcp_port
bool dsa_use_tcp
int dsa_tcp_port

Static Public Attributes

static int const MAX_DEV_LENGTH = 32

Detailed Description

class for command line option parsing holding option parsing results


Constructor & Destructor Documentation

cSDHOptions::cSDHOptions ( char const *  option_selection = "general sdhcom_serial sdhcom_common sdhcom_esdcan sdhcom_peakcan sdhcom_cancommon sdhcom_tcp")

constructor: init members to their default values

Parameters:
option_selection- string that names the options to include in helptext for online help. With a text including one of the following keywords the corresponding helptext is added to the usage helptext

  • "general" see sdhusage_general
  • "sdhcom_serial" see sdhusage_sdhcom_serial
  • "sdhcom_common" see sdhusage_sdhcom_common
  • "sdhcom_esdcan" see sdhusage_sdhcom_esdcan
  • "sdhcom_peakcan" see sdhusage_sdhcom_peakcan
  • "sdhcom_cancommon" see sdhusage_sdhcom_cancommon
  • "sdhcom_tcp" see sdhusage_sdhcom_tcp
  • "sdhother" see sdhusage_sdhother
  • "dsacom" see sdhusage_dsacom
  • "dsaother" see sdhusage_dsaother
cSDHOptions::~cSDHOptions ( )

destructor, clean up


Member Function Documentation

void cSDHOptions::OpenCommunication ( NS_SDH cSDH &  hand)

convenience function to open the communication of the given hand object according to the parsed parameters.

Parameters:
hand- reference to a cSDH object to open
int cSDHOptions::Parse ( int  argc,
char **  argv,
char const *  helptext,
char const *  progname,
char const *  version,
char const *  libname,
char const *  librelease 
)

parse the command line parameters argc, argv into members. helptext, progname, version, libname and librelease are used when printing online help. start parsing at option with index *p_option_index parse all options if parse_all is true, else only one option is parsed

Returns:
the optind index of the first non option argument in argv

Member Data Documentation

std::ostream* cSDHOptions::debuglog
unsigned int cSDHOptions::id_read
unsigned int cSDHOptions::id_write
int const cSDHOptions::MAX_DEV_LENGTH = 32 [static]
std::string cSDHOptions::tcp_adr
unsigned int cSDHOptions::threshold[6]
std::string cSDHOptions::usage

The documentation for this class was generated from the following files: