MeteoTools::LoadAllMSDFiles
time_t LoadAllMSDFiles();
Return Value
Nonzero if successful; otherwise 0 = no
files or error.
Remarks
For a selction of exit meteosets you can use
the MSDFile list.
A
MSDFile is a
CArray-Objekt
and is defined in
BMSD_Defs.h
This is a list of all exist meteo files with the extension .msd
in the meteodata directory.
But before you use these must you load it.
Example
// resfresh the
list of exist files
// NowDate = GetCurrentMSDFile()
= set of last selected file
// ExistDates = GetMSDFileList()
= the complet file list
// FirstSynopDate =
GetFirstSynopMSDFile()
= set
of the first synop file
//
MeteoDataSelection = list count of the
last selected meteo view
Note: All synop files will stand
above in the list. The first meteo file will come after the last synop file.
ON_MESSAGE(WM_METEOCOM_DAT_CHANGE,MeteoDataChanged)
void CMainFrame::DataChanged()
{
LoadAllMSDFiles();
int i,x=FirstSynopDate.stepswidth;
// if MeteoDataSelection==1, then was synop
selected
// FirstSynopDate.stepswidth is the count of all synop files
// if a synop file selected, then find them
in the list
if(FirstSynopDate.stepswidth &&
MeteoDataSelection==1)
{
for(i=0;
i<FirstSynopDate.stepswidth; i++)
{
if(ExistDates[i].validtime == NowDate.validtime) goto set;
}
}
else
{
//no, then find them
after the last synop poisition
MeteoDataSelection=1;
for(i=x;
i<ExistDates.GetSize(); i++)
{
if(ExistDates[i].validtime == NowDate.validtime
&& !strcmp(ExistDates[i].regstr,NowDate.regstr))
{
if(ExistDates[i].type==2)
//if MeteoPack/EmailBulletins
{
if(NowDate.hour != ExistDates[i].hour)
continue;
}
MeteoDataSelection=i-x+1;
goto set;
}
}
}
i=0; //maybe the last one was deleted
set:
//now refresh your view
m_wndTimeToolBar.SetTimeInfo(i);
m_wndDlgBar.m_Details.SetButtonConditions();
myBMS_Para.refresch=-1;
//this force the redraw in the DrawingTools
m_wndDlgBar.m_Details.Refresh();
myMeteoView->Invalidate();
}
//select an item of the
list of exist files
void CMeteoView::SetDate(int item)
{
myBMS_Para.refresch=-1;//force the redraw in
the DrawingTools
MeteoDataSelection=0;
if(ExistDates.GetSize() && item!=-1)
{
SetCurrentMSDFile(item);
//this set the new NowDate
if(NowDate.type==2)
NowDate.validtime=NowDate.validtime;
// the basis time
have +6 hours offset
else
NowDate.validtime=ExistDates[item].validtime-21600;
MeteoDataSelection=1+item;
}
else NowDate.validtime=0;
myMainFrm->m_wndTimeToolBar.SetTimeInfo(0);
myMainFrm->m_wndDlgBar.m_Details.Refresh();
Invalidate();
}
See Also GetCurrentMSDFile, GetFirstSynopMSDFile,
GetMSDFileList,
SetCurrentMSDFile
|