KatanaNativeInterface $VERSION$
kmlFactories.h
Go to the documentation of this file.
1
2#ifndef KMLFACTORIES_H
3#define KMLFACTORIES_H
4
5#include "common/exception.h"
6
7#include "KNI/kmlBase.h"
8#include "KNI/kmlMotBase.h"
9#include "KNI/kmlSctBase.h"
10
11#include <string>
12#include <fstream>
13
18
23public:
25 Exception("ConfigFile is not open or other failure", -41) {}
26};
27
32public:
33 ConfigFileSectionNotFoundException(const std::string & attribute) throw ():
34 Exception("Could not find section '" + attribute + "' in configfile", -42) {}
35};
36
41public:
42 ConfigFileSubsectionNotFoundException(const std::string & attribute) throw ():
43 Exception("Could not find subsection '" + attribute + "' in configfile", -43) {}
44};
45
50public:
51 ConfigFileEntryNotFoundException(const std::string & attribute) throw ():
52 Exception("Could not find entry '" + attribute + "' in configfile", -44) {}
53};
54
59public:
60 ConfigFileSyntaxErrorException(const std::string & line) throw ():
61 Exception("Syntax error in this line: '" + line + "'", -45) {}
62};
63
67
68
69namespace KNI {
70
76 private:
77 std::ifstream _configfile;
78 void _readEntry(char* dest, int destsz, const char* section, const char* subsection, const char* entry);
79 public:
80
82
83 bool openFile(const char* filepath) {
84 _configfile.open(filepath);
85 return _configfile.fail() ? false : true;
86 }
87#ifdef _UNICODE
88 bool openFile(const wchar_t* filepath) {
89 _configfile.open(filepath);
90 return _configfile.fail() ? false : true;
91 }
92#endif
93
98 TMotDesc* getMotDesc(short count);
99 TSctDesc* getSctDesc(short count);
100
101 TMotCLB getMotCLB(short number);
102 TMotSCP getMotSCP(short number);
103 TMotDYL getMotDYL(short number);
106 int getType();
107
108 TMotInit getMotInit(short number);
109
110 void getGripperParameters(bool& isPresent, int& openEncoders, int& closeEncoders);
111 };
112
113
114
115}
116
117#endif
The requested entry could not be found.
Definition: kmlFactories.h:49
ConfigFileEntryNotFoundException(const std::string &attribute)
Definition: kmlFactories.h:51
The requested section could not be found.
Definition: kmlFactories.h:31
ConfigFileSectionNotFoundException(const std::string &attribute)
Definition: kmlFactories.h:33
The state of the configuration file wasn't "good".
Definition: kmlFactories.h:22
The requested subsection could not be found.
Definition: kmlFactories.h:40
ConfigFileSubsectionNotFoundException(const std::string &attribute)
Definition: kmlFactories.h:42
There was a syntax error in the configuration file.
Definition: kmlFactories.h:58
ConfigFileSyntaxErrorException(const std::string &line)
Definition: kmlFactories.h:60
This class is for internal use only It may change at any time It shields the configuration file parsi...
Definition: kmlFactories.h:75
TKatMOT getMOT()
void _readEntry(char *dest, int destsz, const char *section, const char *subsection, const char *entry)
TMotCLB getMotCLB(short number)
std::ifstream _configfile
Definition: kmlFactories.h:77
TKatGNL getGNL()
TSctDesc * getSctDesc(short count)
void getGripperParameters(bool &isPresent, int &openEncoders, int &closeEncoders)
TKatEFF getEFF()
bool openFile(const char *filepath)
Definition: kmlFactories.h:83
TMotInit getMotInit(short number)
TMotDesc * getMotDesc(short count)
TMotSCP getMotSCP(short number)
TMotDYL getMotDYL(short number)
TKatSCT getSCT()
int getType()
returns the Katana type
#define DLLDIR
Definition: dllexport.h:30
Definition: Timer.h:30
Inverse Kinematics structure of the endeffektor.
Definition: kmlBase.h:113
[GNL] general robot attributes
Definition: kmlBase.h:67
[MOT] every motor's attributes
Definition: kmlMotBase.h:40
[SCT] every sens ctrl's attributes
Definition: kmlSctBase.h:41
Calibration structure for single motors.
Definition: kmlMotBase.h:181
[DYL] dynamic limits
Definition: kmlMotBase.h:137
motor description (partly)
Definition: kmlMotBase.h:34
Initial motor parameters.
Definition: kmlMotBase.h:198
[SCP] static controller parameters
Definition: kmlMotBase.h:109
sensor controller description (partly)
Definition: kmlSctBase.h:33