--- a/src/netanim/model/animation-interface.cc Mon Jan 13 09:01:22 2014 -0800
+++ b/src/netanim/model/animation-interface.cc Tue Jan 14 06:59:59 2014 -0800
@@ -747,6 +747,7 @@
}
if (!restart)
ConnectCallbacks ();
+ m_remainingEnergyCounterId = AddNodeCounter ("RemainingEnergy", AnimationInterface::DOUBLE_COUNTER);
}
void AnimationInterface::AddToIpv4AddressNodeIdTable (std::string ipv4Address, uint32_t nodeId)
@@ -1162,7 +1163,14 @@
NS_LOG_INFO ("Total energy fraction on node " << nodeId << ": " << energyFraction);
m_nodeEnergyFraction[nodeId] = energyFraction;
- WriteNodeUpdate (nodeId);
+ if (!m_enable3105)
+ {
+ WriteNodeUpdate (nodeId);
+ }
+ else
+ {
+ UpdateNodeCounter (m_remainingEnergyCounterId, nodeId, energyFraction);
+ }
}
void AnimationInterface::WifiPhyTxBeginTrace (std::string context,
--- a/src/netanim/model/animation-interface.h Mon Jan 13 09:01:22 2014 -0800
+++ b/src/netanim/model/animation-interface.h Tue Jan 14 06:59:59 2014 -0800
@@ -721,6 +721,7 @@
static Rectangle * userBoundary;
bool m_enable3105;
+ uint32_t m_remainingEnergyCounterId;
std::string GetPacketMetadata (Ptr<const Packet> p);
std::string GetXMLOpen_anim (uint32_t lp);