#include <QGraphicsItem>
#include <QList>
#include <QTime>
#include <QFont>
#include <QPixmap>
#include <QBrush>
#include <QSound>
#include <qlcdnumber.h>
#include "edge.h"
#include "settingswindow.h"
class Edge;
class NetworkView;
class NodeDb;
{
public:
typedef enum{ACCESS_POINT, END_DEVICE}NODE_TYPE;
typedef struct
{
NODE_TYPE type;
int addr;
int xPos;
int yPos;
int strength;
float temp;
float voltage;
int re;
int t_time_on;
int fadeNumber;
int fadeTime;
int newNode;
int deletedNode;
}NODE_DATA;
Node(NetworkView *networkView);
NODE_DATA nodeData;
void addEdge(Edge *edge);
QList<Edge *> edges() const;
enum { Type = UserType + 1 };
int type() const { return Type; }
bool advance();
public slots:
void setLoops() const;
void setNodeData(int index);
void updateData(int index);
int getElapsedTime();
void removeEdge(int childAddr = 0);
int getAddr() { return nodeData.addr; }
float getTemp() { return nodeData.temp; }
int getType() { return nodeData.type; }
void setTempUnit();
void setColor(const NODE_TYPE type);
int Node::find_active_node();
void Node::current_updateData(int index);
int timerId () const;
/*struct colors{
int alpha;
int r;
int g;
int b;
int newnodeflag;
int delnodeflag;
};
struct colors node_colors[100];*/
protected:
// NODE_DATA nodeData;
private:
QList<Edge *> edgeList;
NetworkView *graph;
QPixmap pixmap,alpha_pix,back_pix,pixmap2,pix;
NodeDb *pNodeDb;
// Flag used to highlight node.
bool updated;
int updateTimerId,fade_speed,updateTimerId2,updateTimerId3;
bool celsius;
qreal arrowSize;
double nodeAlertTemp;
};
#endif
#include <QGraphicsItem>
#include <QList>
#include <QTime>
#include <QFont>
#include <QPixmap>
#include <QBrush>
#include <QSound>
#include <qlcdnumber.h>
#include "edge.h"
#include "settingswindow.h"
class Edge;
class NetworkView;
class QGraphicsSceneMouseEvent;
class NodeDb;
class Node : public QGraphicsItem, public QObject
{
public:
typedef enum{ACCESS_POINT, END_DEVICE}NODE_TYPE;
typedef struct
{
NODE_TYPE type;
int addr;
int xPos;
int yPos;
int strength;
float temp;
float voltage;
int re;
int t_time_on;
int fadeNumber;
int fadeTime;
int newNode;
int deletedNode;
}NODE_DATA;
QBrush fill[40];
Node(NetworkView *networkView);
NODE_DATA nodeData;
void addEdge(Edge *edge);
QList<Edge *> edges() const;
enum { Type = UserType + 1 };
int type() const { return Type; }
bool advance();
QRectF boundingRect() const;
QPainterPath shape() const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
public slots:
void setLoops() const;
void setNodeData(int index);
void updateData(int index);
int getElapsedTime();
void removeEdge(int childAddr = 0);
int getAddr() { return nodeData.addr; }
float getTemp() { return nodeData.temp; }
int getType() { return nodeData.type; }
void setTempUnit();
void setColor(const NODE_TYPE type);
int Node::find_active_node();
void Node::current_updateData(int index);
int timerId () const;
/*struct colors{
int alpha;
int r;
int g;
int b;
int newnodeflag;
int delnodeflag;
};
struct colors node_colors[100];*/
protected:
QVariant itemChange(GraphicsItemChange change, const QVariant &value);
void timerEvent(QTimerEvent *);
// NODE_DATA nodeData;
private:
QList<Edge *> edgeList;
QPointF newPos;
NetworkView *graph;
QPixmap pixmap,alpha_pix,back_pix,pixmap2,pix;
QColor nodeColor;
QColor nodeColorDark;
QColor nodeAlertColor;
QColor nodeAlertColorDark;
QFont modeFont;
QFont addrFont;
QFont tempFont;
QFont battFont;
QFont strengthFont;
QFont timeFont;
QFont end_deviceFont;
QFont keyFont;
QFont smallFont;
QFont txFont;
QTime timeStamp;
QDate dateStamp;
QLineEdit *nameLine;
NodeDb *pNodeDb;
// Flag used to highlight node.
bool updated;
int updateTimerId,fade_speed,updateTimerId2,updateTimerId3;
bool celsius;
qreal arrowSize;
double nodeAlertTemp;
};
#endif
To copy to clipboard, switch view to plain text mode
Bookmarks