Program the control the fischertechnik robo interface or intelligent interface via tcp socket or via a java gui.
Diff: myconfig.h
- Revision:
- 0:7f26f0680202
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/myconfig.h Fri Dec 31 14:01:14 2010 +0000 @@ -0,0 +1,29 @@ +#ifndef MYCONFIG_H +#define MYCONFIG_H +#include "ConfigFile.h" +#include <string.h> + +class myConfig: public ConfigFile { +public: + static const int MAXLEN_VALUE = 128;//redeclared because inaccessible + int getInt(char *key, int dflt=0) { + char value[MAXLEN_VALUE]; + if (getValue(key, value, sizeof(value))) { + int val=dflt; + sscanf(value,"%d", &val); + return val; + } + return dflt; + } + int getLookup(char *key, char*names[], int n) { + char value[MAXLEN_VALUE]; + if (getValue(key, value, sizeof(value))) { + for (int i = 0; i < n; i++) + if (strcmp(value, names[i])==0) + return i; + } + return n; + } +}; + +#endif \ No newline at end of file