00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053 #ifndef p802_15_4nam_h
00054 #define p802_15_4nam_h
00055
00056 #define mac_oper_del 1
00057 #define mac_oper_est 2
00058
00059 class Mac802_15_4;
00060
00061 class MACLINK
00062 {
00063 public:
00064 Mac802_15_4 *mac;
00065 int addr;
00066 MACLINK *last;
00067 MACLINK *next;
00068 MACLINK(int ad,Mac802_15_4 *m)
00069 {
00070 addr = ad;
00071 mac = m;
00072 last = NULL;
00073 next = NULL;
00074 }
00075 };
00076
00077 int addMacLink(int ad,Mac802_15_4 *m);
00078 int updateMacLink(int oper,int ad);
00079 Mac802_15_4 *getMacLink(int ad);
00080 int chkAddMacLink(int ad,Mac802_15_4 *m);
00081
00082
00083
00084 #define at_oper_del 1
00085 #define at_oper_est 2
00086
00087 extern int ATTRIBUTE_SN;
00088
00089 class ATTRIBUTELINK
00090 {
00091 public:
00092 packet_t ptype;
00093 char color[21];
00094 int src,dst;
00095 int attribute;
00096 ATTRIBUTELINK *last;
00097 ATTRIBUTELINK *next;
00098 ATTRIBUTELINK(packet_t pt,char *clr,int s,int d)
00099 {
00100 ptype = pt;
00101 strncpy(color,clr,20);
00102 color[20] = 0;
00103 src = s;
00104 dst = d;
00105 attribute = ATTRIBUTE_SN++;
00106 last = NULL;
00107 next = NULL;
00108 }
00109 };
00110
00111 packet_t nam_pktName2Type(const char *name);
00112 int addAttrLink(packet_t pt,char *clr,int s = -2,int d = -2);
00113 int updateAttrLink(int oper,packet_t pt,int s = -2,int d = -2);
00114 int chkAddAttrLink(packet_t pt,char *clr,int s = -2,int d = -2);
00115 ATTRIBUTELINK *findAttrLink(packet_t pt,int s = -2,int d = -2);
00116
00117
00118
00119 class Nam802_15_4
00120 {
00121 friend class Mac802_15_4;
00122 friend class Phy802_15_4;
00123 public:
00124 Nam802_15_4(const char *ncolor,const char *mcolor,Mac802_15_4 *m);
00125
00126 static void flowAttribute(int clrID,const char *clrName);
00127 static void changePlaybackRate(double atTime,const char *stepLen);
00128
00129 protected:
00130 void changeNodeColor(double atTime,const char *newColor,bool save = true);
00131 void changeBackNodeColor(double atTime);
00132 void flashNodeColor(double atTime,const char *flashColor = "");
00133 void changeMarkColor(double atTime,const char *newColor);
00134 void flashNodeMark(double atTime);
00135 void changeLabel(double atTime,const char *lb);
00136 void flashLinkFail(double atTime,int dst,const char *flashColor = "");
00137 void annotate(double atTime,const char *note);
00138
00139 public:
00140 static bool Nam_Status;
00141 static bool emStatus;
00142 static bool emHandling;
00143 static char def_PANCoor_clr[21];
00144 static char def_Coor_clr[21];
00145 static char def_Dev_clr[21];
00146 static char def_Node_clr[21];
00147 static char def_Mark_clr[21];
00148 static char def_ColFlash_clr[21];
00149 static char def_NodeFail_clr[21];
00150 static char def_LinkFailFlash_clr[21];
00151
00152 protected:
00153 char nodePreColor[21];
00154 char nodeColor[21];
00155 char markColor[21];
00156 char label[81];
00157
00158 private:
00159 Mac802_15_4 *mac;
00160
00161 };
00162
00163 #endif
00164
00165