NetAnim: Remove obsolete functionalities
This commit is contained in:
@@ -170,7 +170,6 @@ main (int argc, char *argv[])
|
||||
AnimationInterface::SetNodeColor (wifiApNode, 0, 255, 0); // Optional
|
||||
AnimationInterface::SetNodeColor (wifiStaNodes, 255, 0, 0); // Optional
|
||||
AnimationInterface::SetNodeColor (csmaNodes, 0, 0, 255); // Optional
|
||||
AnimationInterface::SetBoundary (0, 0, 35, 35); // Optional
|
||||
|
||||
AnimationInterface anim ("wireless-animation.xml"); // Mandatory
|
||||
|
||||
|
||||
@@ -61,7 +61,6 @@ static bool initialized = false;
|
||||
std::map <uint32_t, std::string> AnimationInterface::nodeDescriptions;
|
||||
std::map <uint32_t, Rgb> AnimationInterface::nodeColors;
|
||||
std::map <P2pLinkNodeIdPair, LinkProperties, LinkPairCompare> AnimationInterface::linkProperties;
|
||||
Rectangle * AnimationInterface::userBoundary = 0;
|
||||
|
||||
|
||||
AnimationInterface::AnimationInterface (const std::string fn, bool enable3105, uint64_t maxPktsPerFile)
|
||||
@@ -82,10 +81,6 @@ AnimationInterface::AnimationInterface (const std::string fn, bool enable3105, u
|
||||
|
||||
AnimationInterface::~AnimationInterface ()
|
||||
{
|
||||
if (userBoundary)
|
||||
{
|
||||
delete userBoundary;
|
||||
}
|
||||
StopAnimation ();
|
||||
}
|
||||
|
||||
@@ -664,8 +659,6 @@ void AnimationInterface::StartAnimation (bool restart)
|
||||
|
||||
std::ostringstream oss;
|
||||
oss << GetXMLOpen_anim (0);
|
||||
oss << GetPreamble ();
|
||||
oss << GetXMLOpen_topology (m_topoMinX, m_topoMinY, m_topoMaxX, m_topoMaxY);
|
||||
WriteN (oss.str (), m_f);
|
||||
NS_LOG_INFO ("Setting topology for "<<NodeList::GetNNodes ()<<" Nodes");
|
||||
// Dump the topology
|
||||
@@ -748,7 +741,6 @@ void AnimationInterface::StartAnimation (bool restart)
|
||||
}
|
||||
if (!restart)
|
||||
{
|
||||
WriteN (GetXMLClose ("topology"), m_f);
|
||||
Simulator::Schedule (m_mobilityPollInterval, &AnimationInterface::MobilityAutoCheck, this);
|
||||
}
|
||||
if (!restart)
|
||||
@@ -1596,9 +1588,7 @@ void AnimationInterface::MobilityCourseChangeTrace (Ptr <const MobilityModel> mo
|
||||
std::ostringstream oss;
|
||||
if (!m_enable3105)
|
||||
{
|
||||
oss << GetXMLOpen_topology (m_topoMinX, m_topoMinY, m_topoMaxX, m_topoMaxY);
|
||||
oss << GetXMLOpenClose_node (0, n->GetId (), v.x, v.y, nodeColors[n->GetId ()]);
|
||||
oss << GetXMLClose ("topology");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1629,10 +1619,6 @@ void AnimationInterface::MobilityAutoCheck ()
|
||||
return;
|
||||
std::vector <Ptr <Node> > MovedNodes = RecalcTopoBounds ();
|
||||
std::ostringstream oss;
|
||||
if (!m_enable3105)
|
||||
{
|
||||
oss << GetXMLOpen_topology (m_topoMinX, m_topoMinY, m_topoMaxX, m_topoMaxY);
|
||||
}
|
||||
for (uint32_t i = 0; i < MovedNodes.size (); i++)
|
||||
{
|
||||
Ptr <Node> n = MovedNodes [i];
|
||||
@@ -1649,8 +1635,6 @@ void AnimationInterface::MobilityAutoCheck ()
|
||||
}
|
||||
if (!m_enable3105)
|
||||
{
|
||||
oss << GetXMLClose ("topology");
|
||||
WriteN (oss.str (), m_f);
|
||||
WriteDummyPacket ();
|
||||
}
|
||||
else
|
||||
@@ -1834,22 +1818,6 @@ void AnimationInterface::SetConstantPosition (Ptr <Node> n, double x, double y,
|
||||
|
||||
}
|
||||
|
||||
void AnimationInterface::SetBoundary (double minX, double minY, double maxX, double maxY)
|
||||
{
|
||||
if (initialized)
|
||||
NS_FATAL_ERROR ("SetBoundary must be used prior to creating the AnimationInterface object");
|
||||
NS_ASSERT (minX < maxX);
|
||||
NS_ASSERT (minY < maxY);
|
||||
if (!userBoundary)
|
||||
{
|
||||
userBoundary = new Rectangle;
|
||||
}
|
||||
userBoundary->xMax = maxX;
|
||||
userBoundary->yMax = maxY;
|
||||
userBoundary->xMin = minX;
|
||||
userBoundary->yMin = minY;
|
||||
}
|
||||
|
||||
void AnimationInterface::UpdateNodeCounter (uint32_t nodeCounterId, uint32_t nodeId, double counter)
|
||||
{
|
||||
if (nodeCounterId > (m_nodeCounters.size ()-1))
|
||||
@@ -2053,22 +2021,6 @@ std::string AnimationInterface::GetXMLOpen_anim (uint32_t lp)
|
||||
oss <<"<anim ver=\"" << GetNetAnimVersion () << "\">\n";
|
||||
return oss.str ();
|
||||
}
|
||||
std::string AnimationInterface::GetXMLOpen_topology (double minX, double minY, double maxX, double maxY)
|
||||
{
|
||||
if (userBoundary)
|
||||
{
|
||||
minX = userBoundary->xMin;
|
||||
minY = userBoundary->yMin;
|
||||
maxX = userBoundary->xMax;
|
||||
maxY = userBoundary->yMax;
|
||||
}
|
||||
std::ostringstream oss;
|
||||
oss << "<topology minX = \"" << minX << "\" minY = \"" << minY
|
||||
<< "\" maxX = \"" << maxX << "\" maxY = \"" << maxY
|
||||
<< "\">" << std::endl;
|
||||
return oss.str ();
|
||||
|
||||
}
|
||||
|
||||
std::string AnimationInterface::GetXMLOpenClose_nodeupdate (uint32_t id, bool visible)
|
||||
{
|
||||
|
||||
@@ -240,16 +240,6 @@ public:
|
||||
*/
|
||||
static void SetConstantPosition (Ptr <Node> n, double x, double y, double z=0);
|
||||
|
||||
/**
|
||||
* \brief Helper function to set the topology boundary rectangle
|
||||
* \param minX X value of the lower left corner
|
||||
* \param minY Y value of the lower left corner
|
||||
* \param maxX X value of the upper right corner
|
||||
* \param maxY Y value of the upper right corner
|
||||
*
|
||||
*/
|
||||
static void SetBoundary (double minX, double minY, double maxX, double maxY);
|
||||
|
||||
/**
|
||||
* \brief Helper function to set a brief description for a given node
|
||||
* \param n Ptr to the node
|
||||
@@ -724,7 +714,6 @@ private:
|
||||
double m_topoMinY;
|
||||
double m_topoMaxX;
|
||||
double m_topoMaxY;
|
||||
static Rectangle * userBoundary;
|
||||
|
||||
bool m_enable3105;
|
||||
bool m_trackPackets;
|
||||
|
||||
Reference in New Issue
Block a user