Home » Developing U++ » UppHub » Scatter Control
Re: Scatter Control [message #26232 is a reply to message #6350] |
Fri, 16 April 2010 02:35   |
ktj9
Messages: 17 Registered: April 2010
|
Promising Member |
|
|
Hello,
I tried to run TestScatter2, but it is stuck in infinite loops in Scatter::SetRange and Scatter::SetMajorUnits. Callers are scatter2.SetRange(12,60) and scatter2.SetMajorUnits(2,10) in Tab2::Tab2().
I am using UPP2232, MSC8, on XP.
I use magic numbers to solve the problem, but I bet there are better solutions, if I understand the meaning of those members.
After the hack, the example looks great! Thanks!
Scatter &Scatter::SetRange(double rx, double ry, double ry2)
{
xRange=rx;
yRange=ry;
yRange2=ry2;
xMajorUnit=xRange/10;
int count=0;
while (xMinUnit > xMajorUnit && count < 1000){
xMinUnit -= xMajorUnit;
++count;
}
yMajorUnit=yRange/10;
count = 0;
while (yMinUnit > yMajorUnit && count < 1000){
yMinUnit -= yMajorUnit;
++count;
}
yMajorUnit2=yRange2/10;
count = 0;
while (yMinUnit2 > yMajorUnit2 && count < 1000) {
yMinUnit2 -= yMajorUnit2;
++count;
}
return *this;
}
Scatter &Scatter::SetMajorUnits(double ux, double uy)
{
//if (ux > xRange) throw (Exc(t_("Invalid X major units!")));
//if (uy > yRange) throw (Exc(t_("Invalid Y major units!")));
xMajorUnit=ux;
yMajorUnit=uy;
yMajorUnit2=yRange2*yMajorUnit/yRange;
int count=0;
while (xMinUnit > xMajorUnit && count < 1000){
xMinUnit -= xMajorUnit;
++count;
}
count = 0;
while (yMinUnit > yMajorUnit && count < 1000){
yMinUnit -= yMajorUnit;
++count;
}
count = 0;
while (yMinUnit2 > yMajorUnit2 && count < 1000){
yMinUnit2 -= yMajorUnit2;
++count;
}
return *this;
}
|
|
|
 |
|
Scatter Control
|
 |
|
Re: Scatter Control-Screenshot
|
 |
|
Re: Scatter Control-Screenshot
By: zsolt on Wed, 08 November 2006 12:03
|
 |
|
Re: Scatter Control-Screenshot
By: forlano on Wed, 08 November 2006 12:34
|
 |
|
Re: Scatter Control-Screenshot
By: mirek on Mon, 13 November 2006 17:14
|
 |
|
Re: Scatter Control-Screenshot
|
 |
|
Scatter v0.2
|
 |
|
Re: Scatter v0.2
By: Ulti on Fri, 17 November 2006 01:27
|
 |
|
Scatter v0.3
|
 |
|
Re: Scatter v0.3
By: masu on Fri, 01 December 2006 11:16
|
 |
|
Re: Scatter v0.3
|
 |
|
Re: Scatter v0.3
By: masu on Fri, 01 December 2006 12:29
|
 |
|
Re: Scatter v0.3
|
 |
|
Re: Scatter v0.3
By: masu on Fri, 01 December 2006 14:28
|
 |
|
Re: Scatter v0.3
|
 |
|
Re: Scatter v0.3
By: masu on Fri, 01 December 2006 15:29
|
 |
|
Re: Scatter v0.3
By: mirek on Sat, 02 December 2006 17:42
|
 |
|
Re: Scatter v0.3
By: mirek on Sat, 02 December 2006 17:52
|
 |
|
Re: Scatter v0.3
|
 |
|
Re: Scatter v0.3
By: mirek on Sun, 03 December 2006 13:34
|
 |
|
Re: Scatter v0.3
|
 |
|
Scatter v0.3, PieChart v0.1
|
 |
|
Scatter-new version
|
 |
|
Re: Scatter-new version
By: ebojd on Thu, 19 April 2007 22:12
|
 |
|
Re: Scatter-new version
By: guido on Thu, 19 April 2007 23:35
|
 |
|
Re: Scatter-new version
|
 |
|
Re: Scatter-new version
By: ebojd on Fri, 20 April 2007 17:44
|
 |
|
Re: Scatter-new version
|
 |
|
Re: Scatter-new version
|
 |
|
Re: Scatter-new version
|
 |
|
Re: Scatter-new version
|
 |
|
Re: Scatter-new version
By: forlano on Thu, 20 September 2007 13:51
|
 |
|
Re: Scatter-new version
|
 |
|
Re: Scatter-new version
By: forlano on Fri, 21 September 2007 13:31
|
 |
|
Re: Scatter-new version
|
 |
|
Re: Scatter-new version
By: forlano on Mon, 24 September 2007 16:14
|
 |
|
Re: Scatter-new version
|
 |
|
Re: Scatter-new version
|
 |
|
Re: Scatter-new version
|
 |
|
Re: Scatter-new version
|
 |
|
Re: Scatter-new version
|
 |
|
Re: Scatter Control
By: mr_ped on Tue, 08 April 2008 17:13
|
 |
|
Re: Scatter Control
|
 |
|
Re: Scatter Control
|
 |
|
Re: Scatter Control
By: koldo on Fri, 29 May 2009 23:41
|
 |
|
Re: Scatter Control
By: koldo on Fri, 17 July 2009 22:29
|
 |
|
Re: Scatter Control
|
 |
|
Re: Scatter Control
|
 |
|
Re: Scatter Control
By: koldo on Sun, 19 July 2009 21:50
|
 |
|
Re: Scatter Control
|
 |
|
Re: Scatter Control
By: tojocky on Mon, 20 July 2009 21:35
|
 |
|
Re: Scatter Control
By: koldo on Mon, 20 July 2009 22:23
|
 |
|
Re: Scatter Control
|
 |
|
Re: Scatter Control
By: tojocky on Sun, 27 December 2009 18:21
|
 |
|
Re: Scatter Control
By: ktj9 on Fri, 16 April 2010 02:35
|
 |
|
Re: Scatter Control
By: koldo on Fri, 16 April 2010 06:50
|
 |
|
Re: Scatter Control
By: ktj9 on Sat, 17 April 2010 03:26
|
Goto Forum:
Current Time: Mon May 12 15:19:28 CEST 2025
Total time taken to generate the page: 0.03342 seconds
|