there are some very fast routines that you can draw an arc but you must use "int PlotPoint (int Panel_Handle, int Control_ID,
double X_Coordinate, double Y_Coordinate,
int Point_Style, int Color);" for every point and im not very sure if this is fast..
(i'm new with cvi..) maybe plotXY can do the job..
what i mean with the precision, is that the routine PlotArc uses integer for theta and beginangle, multiplied by 10. that means that the accuracy is limited to tenths of degrees. e.g you cant draw an arc with theta=0.05' degrees..
no this error occurs with two set of graph data that i have (i have only these for now..)
i'm zooming using the build in fuction (Ctrl+LeftClick)..
this is a part of my code..
variables starting with "g_" are globals. all variables are double.
g_x_old,g_y_old are the start point. g_x,g_y is the end point. g_i,g_j is the center of the arc relative to start point. g_r is the radious.
the strange thing is that i added the if (abs(theta)>220) and a breakpoint to see where my routine is wrong but the case is never happen(!). that means that theta is always <220. so it's not normal to see those circles..
(i've also tested my graph data to other simulators and they are correct..)
case 2 : case 3 :
beginangle=atan2(-g_j,-g_i)*180/pi;
if (beginangle<=0)
beginangle=360+beginangle;
endangle=atan2(g_y-(g_j+g_y_old),g_x-(g_i+g_x_old))*180/pi;
if (endangle<=0)
endangle=360+endangle;
theta = beginangle-endangle;
if (!theta)
{theta=360;}
else if (theta<0)
{
if (g_cmd==3)
{theta=-theta;}
else
{theta=-360-theta;}
}
else
{
if (g_cmd==3)
{theta=360-theta;}
else
{theta=-theta;}
}
if (abs(theta)>220)
theta=theta;
if (g_z<0)
{
PlotArc (panel, SERIAL_GRAPH,(g_i+g_x_old-g_r), (g_j+g_r+g_y_old) ,(g_i+g_r+g_x_old), (g_j-g_r+g_y_old), beginangle*10, (theta)*10, VAL_RED,VAL_TRANSPARENT);
}
else
{
PlotArc (panel, SERIAL_GRAPH, (g_i+g_x_old-g_r),
(g_j+g_r+g_y_old), (g_i+g_r+g_x_old),
(g_j-g_r+g_y_old), beginangle*10, (theta)*10,
VAL_TRANSPARENT, VAL_TRANSPARENT);
}
// ProcessDrawEvents ();
break;