[go: up one dir, main page]

Menu

[88fba7]: / src / kukavar.h  Maximize  Restore  History

Download this file

77 lines (62 with data), 3.1 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/***************************************************************************
* Copyright (C) 2007 by Massimiliano Fago *
* massimiliano.fago@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef KUKAVAR_H
#define KUKAVAR_H
#include <QByteArray>
#include <QList>
#include <QObject>
#include <QHash>
#include <QDebug>
#include "showvarconst.h"
class KukaVar : public QObject
{
Q_OBJECT
friend class RobotVarEdit;
public:
KukaVar(const QByteArray& varname, const QByteArray& varvalue);
KukaVar(const QByteArray varname);
~KukaVar();
int getVarType();
int getElementsNumber();
QByteArray getVarName();
QByteArray getStructureName();
QByteArray getStructureValue(const int &fieldposition,int &datatype);
QByteArray getStructureValue(const QByteArray *fieldname, int &datatype);
QByteArray getStructureValue();
QByteArray getStructureMember(const int &fieldposition);
QByteArray getStructureElement(const int &fieldposition);
QByteArray getNewValue();
QByteArray getVarTypeName();
QByteArray createStructure();
void setFieldValue(const QByteArray &value, const int &fieldposition);
QByteArray getValue();
static const char ERRTYPE=0,STRUCTURE=1,INT=2,REAL=3,BOOL=4,CHAR=5;
static const long int MAXINTVALUE=0x80000000-1,MININTVALUE=-0x80000000; //32 bit con segno robot
static const double MAXREALVALUE=3.4e+10,MINREALVALUE=-3.4e+10;
protected:
void setValue(QByteArray varvalue);
private:
int elementsnumber, intvartype;
QByteArray vartype,value,varname,varvalue,structurename,newvarvalue,structurevalue;
QList<QByteArray> arrayvalue,newarrayvalue;
QHash<QByteArray, QByteArray> elements;
int VarType(const QByteArray variabile);
};
#endif