类似fluent的残差曲线的显示程序有哪位大虾做过请指导一下。
类似fluent的残差曲线的显示程序有哪位大虾做过请指导一下。<BR>我想用vc++做一个。<BR>但不知该如何下手。<BR>请指路。回复:(sr12501)类似fluent的残差曲线的显示程序有哪...
vc动态曲线源程序<BR><BR><P>定义一个数据结构去存储<BR>typedef struct _value{<BR> double dValue;<BR> CTime ValueTime;<BR>}myvalue;<BR>我设定屏幕显示20咯点</P>
<P>CString sSql,time;<BR>CTime Mytime=CTime::GetCurrentTime(); <BR>int Mytime_Second=Mytime.GetSecond();<BR>int Mytime_minute=Mytime.GetMinute();<BR>time.Format("0:%2d:%2d",Mytime_minute,Mytime_Second);<BR>CSheJiSet* m_recordset=new CSheJiSet(&m_database);<BR>sSql.Format("select * from steeltable1 where RealTime=#%s#",time);<BR>m_recordset->Open(AFX_DB_USE_DEFAULT_TYPE,sSql);<BR>double y1=m_recordset->m_5std_delivery_total_tension;<BR>CTimetime1=m_recordset->m_RealTime;<BR>//将点存入数组</P>
<P>m_pvalues = (myvalue*)malloc(20*sizeof(myvalue));<BR>m_pvalues.ValueTime = time1;<BR>m_pvalues.dValue = y1;<BR>m_lNoValues++;<BR>m_lend++;<BR>if(m_lend >= 20)<BR> m_lend=0;<BR> m_lNoValues=20;<BR> if(m_lbegin == m_lend){<BR> m_lbegin++;<BR> if(m_lbegin >=20)<BR> m_lbegin=0;}<BR>//将数据库里的点转化为图上的坐标;<BR>CPoint p;<BR>int ly=0;<BR>if(m_lNoValues<=20)<BR>{for(int i=m_lbegin;i<=m_lNoValues;i++)<BR>{p.x=int(((Mytime.GetMinute()-m_pvalues.ValueTime.GetMinute())*60+Mytime.GetSecond()-m_pvalues.ValueTime.GetSecond())*17.5);<BR>p.y=int(50+(200-y1)*4.5);<BR>pLineArray.x = p.x;<BR>pLineArray.y = p.y;<BR>ly++;}<BR>}<BR>else if(m_lNoValues>20)<BR>{<BR>for(int i=m_lbegin;i<=20;i++)<BR>{p.x=int(((Mytime.GetMinute()-m_pvalues.ValueTime.GetMinute())*60+Mytime.GetSecond()-m_pvalues.ValueTime.GetSecond())*17.5);<BR>p.y=int(50+(200-y1)*4.5);<BR>pLineArray.x = p.x;<BR>pLineArray.y = p.y; <BR>ly++;}<BR>for(int j=0;j<m_lbegin;j++)<BR>{p.x=int(((Mytime.GetMinute()-m_pvalues.ValueTime.GetMinute())*60+Mytime.GetSecond()-m_pvalues.ValueTime.GetSecond())*17.5);<BR>p.y=int(50+(200-y1)*4.5);<BR>pLineArray.x = p.x;<BR>pLineArray.y = p.y; <BR>ly++;}<BR>}<BR>DC->Polyline(pLineArray, ly);<BR>}</P>
页:
[1]