I really thank you for your kind answers for my recent questions.
Today, I would like to know how I can count the ignored(skipped) plots when I apply CNiGraph property, CNiGraph.ImmediateUpdates = FALSE.
I used this property for the program which plots a lot of data with very fast update rate. Therefore, my program does not shows all data. It skips some data when CPU performance is full. It is okay for me (it is actually what I want.) However, I still want to know how many plots are skipped.
I tried as follows:
- Header File
class CMyDlg : public CDialog
{
public:
m_SendCnt;
m_ReceiveCnt;
}
- Source File
BOOL CMyDlg::OnInitDialog(
{
m_SendCnt = 0;
m_ReceiveCnt = 0;
m_graph.ImmediateUpdates = FALSE;
....
}
void OnStartMyProgram()
{
....
AfxBeginThread(MyThreadProc,this)
....
}
UINT MyThreadProc(LPVOID lParam)
{
CMyDlg* pDlg = (CMyDlt*)lParam;
....
while(iRun) {
Sleep(SMALL_INTERVAL);
....
pDlg->PostMyMessage(WM_MYMESSAGE,0,0);
m_SentCnt++;
}
return (UINT)0;
}
LRESULT CMyDlg::OnMyMessage(WPARAM wParam, LPARAM lParam)
{
....
m_ReceiveCnt++;
....
m_graph.PlotY(tWaveMatrix);
CString sTr;
sTr.Format("SendCnt = %d, ReceiveCnt = %d",
m_SendCnt, m_ReceiveCnt);
m_graph.SetCaption(sTr);
return (LRESULT)0;
}
The results are ...
1) Data is skipped as I explained.
2) Caption changes as the following order..(for example)
SendCnt = 3, ReceiveCnt = 3
SendCnt = 6, ReceiveCnt = 6
SendCnt = 9, ReceiveCnt = 9
....
That is, two plots are skipped. However, I do not know how many plots are skipped in the program. The message is received all the time, but m_graph decide whether it display it or not by itself.
Summay of My Questions...
1) How can I count the ignored(skipped) plots
2) Is there any method to know the status of m_graph? I want to know whether it is drawing and it is waiting. (I tried CNiGraph.ReadyStatus, but it was not).