KatanaNativeInterface $VERSION$
kmlSctBase.h
Go to the documentation of this file.
1//
2// C++ Interface: SctBase
3//
4// Description:
5//
6//
7// Author: Tiziano Müller <tiziano.mueller@neuronics.ch>, (C) 2006
8//
9// Copyright: See COPYING file that comes with this distribution
10//
11//
12
13
14#ifndef KMLSCTBASE_H
15#define KMLSCTBASE_H
16
17#include "common/dllexport.h"
18
19#include "KNI/kmlCommon.h"
20#include "KNI/cplBase.h"
21
22
23class CKatBase; //forward declaration
24class CSctBase; //forward declaration
25
26
27/****************************************************************************/
28// CSctBase ----------------------------------------------------------------//
29/****************************************************************************/
30
33struct TSctDesc {
34 byte ctrlID;
35 short sens_res;
36 short sens_count;
37};
38
41struct TKatSCT {
42 short cnt;
45};
46
49struct TSctGNL {
51 byte SID;
52 short res;
53};
54
57struct TSctDAT {
58 short cnt;
59 short* arr;
60};
61
62//--------------------------------------------------------------------------//
63
73
74 friend class CKatBase;
75
76protected:
79
80public:
81 const TSctGNL* GetGNL() { return &gnl; }
82 const TSctDAT* GetDAT() { return &dat; }
83
84protected:
86
87public:
88 virtual ~CSctBase() {} //destructor
89
90 bool init(CKatBase* _own, const TSctDesc _sctDesc, CCplBase* protocol);
91
94 void recvDAT();
95};
96
97
98
99
100
101
102
103
104
105
106
107#endif
Abstract base class for protocol definiton.
Definition: cplBase.h:47
Base Katana class.
Definition: kmlBase.h:132
Sensor Controller class.
Definition: kmlSctBase.h:72
bool init(CKatBase *_own, const TSctDesc _sctDesc, CCplBase *protocol)
virtual ~CSctBase()
Definition: kmlSctBase.h:88
const TSctDAT * GetDAT()
Definition: kmlSctBase.h:82
TSctDAT dat
sensor data
Definition: kmlSctBase.h:78
TSctGNL gnl
controller generals
Definition: kmlSctBase.h:77
const TSctGNL * GetGNL()
Definition: kmlSctBase.h:81
CCplBase * protocol
protocol interface
Definition: kmlSctBase.h:85
void recvDAT()
receive data
#define DLLDIR
Definition: dllexport.h:30
[SCT] every sens ctrl's attributes
Definition: kmlSctBase.h:41
short cnt
count of sens ctrl's
Definition: kmlSctBase.h:42
CSctBase * arr
array of sens ctrl's
Definition: kmlSctBase.h:43
TSctDesc * desc
description[]
Definition: kmlSctBase.h:44
[DAT] sensor data
Definition: kmlSctBase.h:57
short cnt
count of sensors
Definition: kmlSctBase.h:58
short * arr
sensor data
Definition: kmlSctBase.h:59
sensor controller description (partly)
Definition: kmlSctBase.h:33
byte ctrlID
controller number (ID)
Definition: kmlSctBase.h:34
short sens_count
count of sensors
Definition: kmlSctBase.h:36
short sens_res
resolution: 8/12 bit
Definition: kmlSctBase.h:35
[GNL] controller generals
Definition: kmlSctBase.h:49
short res
resolution: 8/12 bit
Definition: kmlSctBase.h:52
byte SID
slave ID
Definition: kmlSctBase.h:51
CKatBase * own
parent robot
Definition: kmlSctBase.h:50