InstrumentShowcase.ned 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. //
  2. // This program is free software: you can redistribute it and/or modify
  3. // it under the terms of the GNU Lesser General Public License as published by
  4. // the Free Software Foundation, either version 3 of the License, or
  5. // (at your option) any later version.
  6. //
  7. // This program is distributed in the hope that it will be useful,
  8. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. // GNU Lesser General Public License for more details.
  11. //
  12. // You should have received a copy of the GNU Lesser General Public License
  13. // along with this program. If not, see http://www.gnu.org/licenses/.
  14. //
  15. package inet.showcases.visualizer.instrument;
  16. import inet.networklayer.configurator.ipv4.IPv4NetworkConfigurator;
  17. import inet.node.inet.AdhocHost;
  18. import inet.node.inet.WirelessHost;
  19. import inet.physicallayer.ieee80211.packetlevel.Ieee80211ScalarRadioMedium;
  20. import inet.visualizer.integrated.IntegratedVisualizer;
  21. network InstrumentShowcase
  22. {
  23. @display("bgb=840,400");
  24. @figure[throughputGauge](type=gauge; pos=190,30; size=100,100; minValue=0; maxValue=25; tickSize=5; label="Application level throughput [Mbps]");
  25. @statistic[throughput](source=throughput(client.tcpApp[0].rcvdPk)/1000000; record=figure; targetFigure=throughputGauge);
  26. @figure[bitrateLinearGauge](type=linearGauge; pos=385,108; size=250,30; minValue=0; maxValue=54; tickSize=6; label="Wifi bit rate [Mbps]");
  27. @statistic[bitrate1](source=server.wlan[0].mac.dcf.rateControl.datarate/1000000; record=figure; targetFigure=bitrateLinearGauge);
  28. @figure[progressMeter](type=progressMeter; pos=65,330; size=300,20; text="%.4g%%"; label="Download progress");
  29. @statistic[progress](source=100 * sum(packetBytes(client.tcpApp[0].rcvdPk)) / 1048576; record=figure; targetFigure=progressMeter);
  30. @figure[numRcvdPkCounter](type=counter; pos=413,327; label="Packets received"; decimalPlaces=4);
  31. @statistic[numRcvdPk](source=count(client.tcpApp[0].rcvdPk); record=figure; targetFigure=numRcvdPkCounter);
  32. @figure[perThermometer](type=thermometer; pos=710,45; size=30,180; minValue=0; maxValue=1; tickSize=0.2; label="Packet error rate");
  33. @statistic[per1](source=client.wlan[0].radio.packetErrorRate; record=figure; targetFigure=perThermometer);
  34. @figure[ctnIndexedImage](type=indexedImage; pos=570,338; size=32,32; images=misc/idle,misc/listen,misc/clock; label="contention state"; labelOffset=0,25; interpolation=best);
  35. @statistic[ctn](source=server.wlan[0].mac.dcf.channelAccess.contention.stateChanged; record=figure; targetFigure=ctnIndexedImage); // note: indexedImage takes the value modulo the number of images
  36. @figure[perPlot](type=plot; pos=647,260; size=150,90; timeWindow=3; maxValue=1; valueTickSize=1; label="Packet Error Rate");
  37. @statistic[per2](source=client.wlan[0].radio.packetErrorRate; record=figure; targetFigure=perPlot);
  38. @figure[bitratePlot](type=plot; pos=385,25; size=250,40; timeWindow=3; maxValue=55; valueTickSize=54; label="Wifi bit rate [Mbps]"; numberSizeFactor=2.5);
  39. @statistic[bitrate2](source=server.wlan[0].mac.dcf.rateControl.datarate/1000000; record=figure; targetFigure=bitratePlot);
  40. submodules:
  41. configurator: IPv4NetworkConfigurator {
  42. @display("p=62,41");
  43. }
  44. radioMedium: Ieee80211ScalarRadioMedium {
  45. @display("p=61,110");
  46. }
  47. visualizer: IntegratedVisualizer {
  48. @display("p=62,170");
  49. }
  50. client: AdhocHost {
  51. @display("p=300,250");
  52. }
  53. server: WirelessHost {
  54. @display("p=250,250");
  55. }
  56. }