Home > Software engineering >  MFC has used ProEssentials v7 drawing which controls the great god
MFC has used ProEssentials v7 drawing which controls the great god

Time:10-10


I want to use the plug-in in Real - Time4 draw a voltage - time curve, after inserting the plug-in can normal background map form, but the curve has been drawn out, and saw many times application feel do not have what problem, solve the great god,,,

This is the initialization function:
BOOL CCurveCanvasDlg: : OnInitDialog ()
{
CDialog: : OnInitDialog ();

The RECT the RECT.
GetClientRect (& amp; The rect);
M_hCanvas=PEcreate (PECONTROL_SGRAPH, WS_VISIBLE | WS_VSCROLL | WS_HSCROLL, & amp; The rect, m_hWnd, 1001);
//set the number of lines
PEnset (m_hCanvas PEP_nSUBSETS, 1);
PEnset (m_hCanvas PEP_nPOINTS, 2000);

PEnset (m_hCanvas PEP_nDATETIMEMODE, PEDTM_VB);//Date/Time Mode
PEnset (m_hCanvas PEP_bUSINGXDATAII, TRUE);//Using Double Precision XDataII

//Some functional attributes//is 1440 minutes in a day
ZoomInterval=(F/1440.0 3.0 F);//3 minute scale zoom interval
ZoomSmallInterval=(F/1440.0 0.5 F);//30 second scale adjustment

//Determine the current date and time in VB 's format//
M_time=CTime: : GetCurrentTime ();

M_petm. NDay=m_time. GetDay ();
M_petm. NMonth=m_time. GetMonth ();
M_petm. NYear=m_time. GetYear () - 1900;
M_petm. NHour=m_time. GetHour ();
M_petm. NMinute=m_time. GetMinute ();
M_petm. NSecond=m_time. GetSecond ();
M_petm. NMilliSecond=0;
PEcreateserialdate (& amp; StartTime, & amp; M_petm PEDTM_VB);

//Extents to show all the data points
Double manmaxx;
PEnset (m_hCanvas PEP_nMANUALSCALECONTROLX, PEMSC_MINMAX);
PEvset (m_hCanvas PEP_fMANUALMINX, & amp; StartTime, 1);
Manmaxx=StartTime + ZoomInterval;
PEvset (m_hCanvas PEP_fMANUALMAXX, & amp; Manmaxx, 1);

PEnset (m_hCanvas PEP_nMANUALSCALECONTROLY, PEMSC_MINMAX);
Double d=1.0 F;
PEvset (m_hCanvas PEP_fMANUALMINY, & amp; D, 1);
D=100.0 F;
PEvset (m_hCanvas PEP_fMANUALMAXY, & amp; D, 1);

//Set Zoomed partial Range of X Scale//
ZoomStart=StartTime;
ZoomEnd=ZoomStart + ZoomInterval;

PEvset (m_hCanvas PEP_fZOOMMINX, & amp; ZoomStart, 1);
PEvset (m_hCanvas PEP_fZOOMMAXX, & amp; ZoomEnd, 1);
D=1.0 F;
PEvset (m_hCanvas PEP_fZOOMMINY, & amp; D, 1);
D=100.0 F;
PEvset (m_hCanvas PEP_fZOOMMAXY, & amp; D, 1);

PEnset (m_hCanvas PEP_bZOOMMODE, TRUE);
//If ZoomMode is True, you will see 3 minutes of data//
//If ZoomMode is False, you will see all the data in the object//

//the Clear out the default data '
//No need to clear out XData since using XDataII '
Float f=0.0 f;
PEvsetcellEx (m_hCanvas PEP_faYDATA, 0, 0, & amp; F);
PEvsetcellEx (m_hCanvas PEP_faYDATA, 0, 1, & amp; F);
PEvsetcellEx (m_hCanvas PEP_faYDATA, 0, 2, & amp; F);
PEvsetcellEx (m_hCanvas PEP_faYDATA, 0, 3, & amp; F);

//Set Various Other Properties///
PEnset (m_hCanvas PEP_bBITMAPGRADIENTMODE, FALSE);
PEnset (m_hCanvas PEP_nQUICKSTYLE, PEQS_DARK_INSET);

PEszset (m_hCanvas PEP_szMAINTITLE, (char *) TEXT (" Scientific Real - Time Example "));
PEszset (m_hCanvas PEP_szSUBTITLE, (char *) TEXT (" "));
PEnset (m_hCanvas PEP_bNORANDOMPOINTSTOEXPORT, TRUE);
PEnset (m_hCanvas PEP_bFOCALRECT, FALSE);
PEnset (m_hCanvas PEP_bALLOWBAR, FALSE);
PEnset (m_hCanvas PEP_bALLOWPOPUP, FALSE);
PEnset (m_hCanvas PEP_bPREPAREIMAGES, TRUE);
PEnset (m_hCanvas PEP_bCACHEBMP, TRUE);
PEnset (m_hCanvas PEP_bFIXEDFONTS, TRUE);

DWORD col=RGB (0, 255, 0);
PEvsetcell (m_hCanvas PEP_dwaSUBSETCOLORS, 0, & amp; Col);

PEnset (m_hCanvas PEP_nGRADIENTBARS, 8);
PEnset (m_hCanvas PEP_nTEXTSHADOWS, PETS_BOLD_TEXT);
PEnset (m_hCanvas PEP_bMAINTITLEBOLD, TRUE);
PEnset (m_hCanvas PEP_bSUBTITLEBOLD, TRUE);
PEnset (m_hCanvas PEP_bLABELBOLD, TRUE);
PEnset (m_hCanvas PEP_bLINESHADOWS, TRUE);
PEnset (m_hCanvas PEP_nFONTSIZE, PEFS_MEDIUM);

//little metafile export//
//PEnset (m_hCanvas PEP_nDPIX, 600);
//PEnset (m_hCanvas PEP_nDPIY, 600);

PEreinitialize (m_hCanvas);
PEresetimage (m_hCanvas, 0, 0);
: : InvalidateRect (m_hCanvas, NULL, FALSE);

//Set the Demo 's RenderEngine to Hybrid//
CMDIFrameWnd * pWnd=(CMDIFrameWnd *) AfxGetApp () - & gt; GetMainWnd ();
PWnd - & gt; SendMessage (WM_CHANGE_METAFILE PEPLAYMETAFILE);

//Initialize Counters and Timer//
M_nRealTimeCounter=1;
//m_nSinCounter=1;
//SetTimer (2, 500, NULL);


return TRUE;//return TRUE unless you set the focus to a control
//exception: OCX property page should return FALSE
}

This is a function in the framework of the timer response function of the program:

//update the drawing window
M_dlgCanvas. Newy=50 + I;
M_dlgCanvas. M_time=CTime: : GetCurrentTime ();
M_dlgCanvas. M_petm. NDay=m_dlgCanvas. M_time. GetDay ();
M_dlgCanvas. M_petm. NMonth=m_dlgCanvas. M_time. GetMonth ();
M_dlgCanvas. M_petm. NYear=m_dlgCanvas. M_time. GetYear () - 1900;
M_dlgCanvas. M_petm. NHour=m_dlgCanvas. M_time. GetHour ();
M_dlgCanvas. M_petm. NMinute=m_dlgCanvas. M_time. GetMinute (); nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related