-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspot.cpp
75 lines (60 loc) · 1.01 KB
/
spot.cpp
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
#include "spot.h"
#include "block.h"
Spot::Spot(const QStringList & data, Block *parent) :
QObject(parent)
{
_data = data;
_block = parent;
if(id() == "empty")
_isEmpty=TRUE;
else
_isEmpty=FALSE;
}
int Spot::diameter()
{
return _block->diameter();
}
int Spot::xPos()
{
return (value("Column").toInt()-1)*_block->xSpacing();
}
int Spot::yPos()
{
return (value("Row").toInt()-1)*_block->ySpacing();
}
QString Spot::value(QString column)
{
return _data[_block->columnNames().indexOf(column)];
}
QString Spot::id()
{
return value("ID");
}
bool Spot::isEmpty()
{
return _isEmpty;
}
int Spot::row()
{
return value("Row").toInt();
}
int Spot::column()
{
return value("Column").toInt();
}
int Spot::blockNumber()
{
return value("Block").toInt();
}
QString Spot::name()
{
return value("Name");
}
QString Spot::dataAsString() const
{
return _data.join(";");
}
QString Spot::dataNamesAsString() const
{
return _block->columnNames().join(";");
}