/[gentoo-x86]/net-misc/multiimonc/files/UsagePlot-0.3.2.diff
Gentoo

Contents of /net-misc/multiimonc/files/UsagePlot-0.3.2.diff

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download) (as text)
Sun Mar 6 16:12:15 2005 UTC (14 years, 11 months ago) by hansmi
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
File MIME type: text/x-diff
FILE REMOVED
Cleanup, DEPEND fixed (bug 84007), stable on sparc and amd64.
(Portage version: 2.0.51.19)

1 Fix a divide-by-zero-error in UsagePlot.cpp. Will be
2 fixed in MultiImonC 0.3.3.
3
4 --- UsagePlot.cpp.orig 2004-06-02 21:59:34.973014648 +0200
5 +++ UsagePlot.cpp 2004-06-02 22:03:14.151694424 +0200
6 @@ -123,18 +123,23 @@
7 int iOldYOut = 0;
8 ChannelUsageData::const_iterator itData((*cli).begin());
9 while(itData != (*cli).end()) {
10 - wxCoord x(iElement * iHorizSpace);
11 - wxCoord iYIn(((iHeight - 6) * (*itData).in / (*cli).MaxRateIn) + 1);
12 - wxCoord iYOut(((iHeight - 6) * (*itData).out / (*cli).MaxRateOut) + 1);
13 -
14 - dc.SetPen((*cli).PenColorOut());
15 - dc.DrawLine(x - iHorizSpace, iOldYOut, x, iYOut);
16 -
17 - dc.SetPen((*cli).PenColorIn());
18 - dc.DrawLine(x - iHorizSpace, iOldYIn, x, iYIn);
19 -
20 - iOldYIn = iYIn;
21 - iOldYOut = iYOut;
22 + ChannelUsageData const& oUsage(*cli);
23 +
24 + if(oUsage.MaxRateIn && oUsage.MaxRateOut) {
25 + wxCoord x(iElement * iHorizSpace);
26 + wxCoord iYIn(((iHeight - 6) * (*itData).in / oUsage.MaxRateIn) + 1);
27 + wxCoord iYOut(((iHeight - 6) * (*itData).out / oUsage.MaxRateOut) + 1);
28 +
29 + dc.SetPen(oUsage.PenColorOut());
30 + dc.DrawLine(x - iHorizSpace, iOldYOut, x, iYOut);
31 +
32 + dc.SetPen(oUsage.PenColorIn());
33 + dc.DrawLine(x - iHorizSpace, iOldYIn, x, iYIn);
34 +
35 + iOldYIn = iYIn;
36 + iOldYOut = iYOut;
37 + }
38 +
39 iElement++;
40 itData++;
41 }

  ViewVC Help
Powered by ViewVC 1.1.20