|
MeteoTools::DrawSynData
void DrawSynData(CDC* pDC, LPRECT
rect, time_t reftime, int hour, int
details,
float xscale, float yscale,
float xoff, float yoff);
Parameters
pDC
Points to the printer device context
(see
CDC)
rect
Points to a
RECT structure that contains the logical coordinates of the
screen rectangle
to be filled with meteo data. You can also pass a
CRect object for this parameter
reftime
the meteo basis time reference
as type time_t (see
CTime)
hour
the hour step, will be added to the reftime
(hour * 3600)
if hour -1, that means you want synop data
details
A combination of Bonito
DetailFlags
xscale
X, longitude scale of the full world
x-resolution (21600 / X-screen-resolution)
360° x-resolution in minutes = 21600
yscale
Y, latitude scale of the full world
y-resolution (10800 / Y-Screen-resolution)
180° x-resolution in minutes = 10800
xoff
x offset of the cordinate rectangle,
in minutes
the max range is from -10800 to +10800
(180W-180E)
the refence point is the center of the
screen
yoff
y offset, in minutes (0 = -90° = 90N)
the max range is from -5400 to +5400
(90N-90S)
the refence point is the center of the
screen
Remarks
draw the last step, the synop symbols
in the screen area.
In the
SourceCodes you can find
DrawingTools.cpp for more details.
Note:
This initiates the internal data
structures for all the next data accesses.
Example
//see in
CView
the routine
OnDraw
(CDC *pDC)
//PlottWorldBorder, PlottChart(pDC) - is your own chart drawing
#include "MeteoTools.h"
#include "MeteoToolsDefs.h"
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// Bonito counted from
left/top to bottom/right
// all the transfomations see the refence point on the center of the screen
// the world cordinates system that Bonito use:
//
// in minutes = 180W to 180E --> -10800 to 10800
//
90N to 90S --> -5400 to 5400
void CDataView::DrawData(CDC* pDC)
{
//my time slider position = 0,1,2,3,....,74
int hour=TimePos;
//only for synop: if hour==-1, then we get synop
data
//synop have no time-step (hour) - it is only a single data set
if(synop) hour=-1;
DrawSeaData(pDC,rect,reftime,hour,details,xscale,yscale,xoff,yoff);
PlottChart(pDC);
DrawSfcData(pDC,rect,reftime,hour,details,xscale,yscale,xoff,yoff);
if(details&(LAY_PRESS|LAY_TEMP|LAY_RH|LAY_WTEMP|LAY_STEMP))
{
PlottWorldBorder(pDC); //draw the world border
}
if(hour == -1 && (synopdetails& SYNOP_ONOFF))
{
DrawSynData(pDC,rect,reftime,hour,synopdetails,xscale,yscale,xoff,yoff);
}
See Also DrawSeaData ,
DrawSfcData , LoadScreenField |