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 //<tfromm date="22.05.2009">
12 #include <cstdlib>
13 //</tfromm>
14 #include <string>
15 #include <fstream>
16 
21 
26 public:
28  Exception("ConfigFile is not open or other failure", -41) {}
29 };
30 
35 public:
36  ConfigFileSectionNotFoundException(const std::string & attribute) throw ():
37  Exception("Could not find section '" + attribute + "' in configfile", -42) {}
38 };
39 
44 public:
45  ConfigFileSubsectionNotFoundException(const std::string & attribute) throw ():
46  Exception("Could not find subsection '" + attribute + "' in configfile", -43) {}
47 };
48 
53 public:
54  ConfigFileEntryNotFoundException(const std::string & attribute) throw ():
55  Exception("Could not find entry '" + attribute + "' in configfile", -44) {}
56 };
57 
62 public:
63  ConfigFileSyntaxErrorException(const std::string & line) throw ():
64  Exception("Syntax error in this line: '" + line + "'", -45) {}
65 };
66 
70 
71 
72 namespace KNI {
73 
79  private:
80  std::ifstream _configfile;
81  void _readEntry(char* dest, int destsz, const char* section, const char* subsection, const char* entry);
82  public:
83 
84  kmlFactory();
85 
86  bool openFile(const char* filepath) {
87  _configfile.open(filepath);
88  return _configfile.fail() ? false : true;
89  }
90 #ifdef _UNICODE
91  bool openFile(const wchar_t* filepath) {
92  _configfile.open(filepath);
93  return _configfile.fail() ? false : true;
94  }
95 #endif
96 
97  TKatGNL getGNL();
98  TKatMOT getMOT();
99  TKatSCT getSCT();
100  TKatEFF getEFF();
101  TMotDesc* getMotDesc(short count);
102  TSctDesc* getSctDesc(short count);
103 
104  TMotCLB getMotCLB(short number);
105  TMotSCP getMotSCP(short number);
106  TMotDYL getMotDYL(short number);
107 
110  int getType();
113  int getKinematics();
114 
115  TMotInit getMotInit(short number);
116 
117  void getGripperParameters(bool& isPresent, int& openEncoders, int& closeEncoders);
118  };
119 
120 
121 
122 }
123 
124 #endif
bool openFile(const char *filepath)
Definition: kmlFactories.h:86
[SCT] every sens ctrl&#39;s attributes
Definition: kmlSctBase.h:41
#define DLLDIR
Definition: dllexport.h:30
Initial motor parameters.
Definition: kmlMotBase.h:199
Exception(const std::string &message, const int error_number)
std::ifstream _configfile
Definition: kmlFactories.h:80
ConfigFileEntryNotFoundException(const std::string &attribute)
Definition: kmlFactories.h:54
[DYL] dynamic limits
Definition: kmlMotBase.h:138
Calibration structure for single motors.
Definition: kmlMotBase.h:182
Inverse Kinematics structure of the endeffektor.
Definition: kmlBase.h:113
[MOT] every motor&#39;s attributes
Definition: kmlMotBase.h:40
ConfigFileSubsectionNotFoundException(const std::string &attribute)
Definition: kmlFactories.h:45
sensor controller description (partly)
Definition: kmlSctBase.h:33
[SCP] static controller parameters
Definition: kmlMotBase.h:110
ConfigFileSectionNotFoundException(const std::string &attribute)
Definition: kmlFactories.h:36
[GNL] general robot attributes
Definition: kmlBase.h:67
motor description (partly)
Definition: kmlMotBase.h:34
ConfigFileSyntaxErrorException(const std::string &line)
Definition: kmlFactories.h:63
Definition: Timer.h:30


kni
Author(s): Martin Günther
autogenerated on Fri Jun 7 2019 22:06:44