Drawing red wireless link between serving eNB and UE in LTE with NetAnim

112 views
Skip to first unread message

William

unread,
Nov 18, 2015, 9:43:19 AM11/18/15
to ns-3-users
Hi, members.

I am looking for the way to draw red wireless link between serving eNB and UE in NetAnim 3.106. When UE is attached to serving eNB, red wireless link has been drawn by NetAnim. and then when handover is performed to new serving eNB, this red wireless link must be changed to new serving eNB in a run time. I do not find the way to edit the XML file generated during simulation around the <link> element.
Can you give me the right way to resolve this problem? 

Thanks in advance.

BR
William

William

unread,
Nov 19, 2015, 11:28:41 PM11/19/15
to ns-3-users
I hope to get red dash line between them.

John Abraham

unread,
Nov 20, 2015, 12:26:19 AM11/20/15
to ns-3-...@googlegroups.com
There is no API for such things. 
But NetAnim can be directly edited to draw lines. You would need knowledge of Qt.

Adding the following snippet in dispatchEvents in animatormode.cpp after  the line m_qLcdNumber->display (m_currentTime);


      static QGraphicsLineItem * line = 0;
      if (!line && m_currentTime > 0)
        {
          AnimNode * a = AnimNodeMgr::getInstance()->getNode(0);
          AnimNode * b = AnimNodeMgr::getInstance()->getNode(1);
          line = AnimatorScene::getInstance()->addLine(a->x(), a->y(),b->x(),b->y());
          QPen p;
          p.setColor(QColor(Qt::red));          
          line->setPen(p);
        }
      if (line && m_currentTime > 6)
        {
          line->setVisible(false);
        }


draws a red-line between node 0 and node 1 if the current time is > 0 and hides it if the current time > 6 


--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.

Screen Shot 2015-11-19 at 9.15.01 PM.png
Message has been deleted

William

unread,
Nov 26, 2015, 6:29:45 AM11/26/15
to ns-3-users
Thank you for your quick comments.

There are many UEs and eNBs. Moreover UEs move around quickly. The red dash line you commented between eNBs and UEs should chase UE mobility and add/remove repeatedly. How to remove the added previous line? I cannot find method about removing this line selectively...

BR


On Wednesday, November 18, 2015 at 11:43:19 PM UTC+9, William wrote:

John Abraham

unread,
Nov 26, 2015, 10:01:35 AM11/26/15
to ns-3-...@googlegroups.com
Well as an example I put  static QGraphicsLineItem * line = 0;


ideally you need to maintain a collection of such lines. (say a vector of QGraphicsLineItem *)
You should change the x, y co-ordinates of the line whenever needed


void QGraphicsLineItem::setLine(qreal x1qreal y1qreal x2qreal y2)





William

unread,
Nov 26, 2015, 10:15:53 AM11/26/15
to ns-3-users
Thanks....It looks like I need to study QT. ^^ I will try....
Reply all
Reply to author
Forward
0 new messages