23 serialNumber =
new QString(sn);
32 serialNumber =
new QString(*other.serialNumber);
40 void ControlCubeGraphNode::nullify() {
87 QString msg =
"Attempted to add Control Measure with Cube Serial Number ";
89 msg +=
"Number [" + *serialNumber +
"]";
94 ASSERT(!
measures->contains(measure->Parent()));
95 (*measures)[measure->Parent()] = measure;
99 void ControlCubeGraphNode::removeMeasure(
ControlMeasure *measure) {
101 if (
measures->remove(measure->Parent()) != 1) {
109 void ControlCubeGraphNode::addConnection(ControlCubeGraphNode *node,
110 ControlPoint *point) {
120 newConnectionList.append(point);
121 (*connections)[node] = newConnectionList;
126 void ControlCubeGraphNode::removeConnection(ControlCubeGraphNode *node,
127 ControlPoint *point) {
134 (*connections)[node].removeOne(point);
142 int ControlCubeGraphNode::getMeasureCount()
const {
147 QString ControlCubeGraphNode::getSerialNumber()
const {
148 return *serialNumber;
161 foreach(ControlMeasure * measure, measureList) {
162 if (!measure->IsIgnored())
163 validMeasures.append(measure);
166 return validMeasures;
175 bool ControlCubeGraphNode::isConnected(ControlCubeGraphNode *other)
const {
180 ControlMeasure *ControlCubeGraphNode::getMeasure(ControlPoint *point) {
182 QString msg =
"point [";
183 msg += (QString) point->GetId();
184 msg +=
"] not found in the ControlCubeGraphNode";
192 const ControlMeasure *ControlCubeGraphNode::getMeasure(
193 ControlPoint *point)
const {
195 QString msg =
"point [";
196 msg += (QString) point->GetId();
197 msg +=
"] not found in the ControlCubeGraphNode";
205 ControlMeasure *ControlCubeGraphNode::operator[](ControlPoint *point) {
206 return getMeasure(point);
210 const ControlMeasure *ControlCubeGraphNode::operator[](
211 ControlPoint *point)
const {
212 return getMeasure(point);
216 const ControlCubeGraphNode &ControlCubeGraphNode::operator=(
217 ControlCubeGraphNode other) {
236 serialNumber =
new QString;
240 *serialNumber = *other.serialNumber;
248 QString ControlCubeGraphNode::connectionsToString()
const {
249 QHashIterator< ControlCubeGraphNode *, QList< ControlPoint * > > i(
253 while (i.hasNext()) {
255 QString line =
" " + (QString) i.key()->getSerialNumber();
257 for (
int j = 0; j < i.value().size(); j++) {
258 line += (QString) i.value()[j]->GetId();
259 if (j != i.value().size() - 1)
266 return serials.join(
"\n");
Serial Number with added functionality for Control Networks.
ControlCubeGraphNode * associatedCSN
Pointer to the Serial Number.
This error is for when a programmer made an API call that was illegal.
QHash< ControlCubeGraphNode *, QList< ControlPoint * > > * connections
Stores a list of ControlPoints which establish a conection to the ControlCubeGraphNode that the list ...
QHash< ControlPoint *, ControlMeasure * > * measures
ControlMeasures hashed by ControlPoint.
bool contains(ControlPoint *point) const
#define _FILEINFO_
Macro for the filename and line number.
A type of error that could only have occurred due to a mistake on the user's part (e...
void addMeasure(ControlMeasure *measure)
Adds a measure.
QString GetCubeSerialNumber() const
Return the serial number of the cube containing the coordinate.
virtual ~ControlCubeGraphNode()
Destroy a SerialNumber object.
ControlCubeGraphNode(QString sn)
Create an empty SerialNumber object.