Skip to content

Commit 4dfe93c

Browse files
Multi-layer grib.
1 parent c5b7719 commit 4dfe93c

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

plugins/grib_pi/src/GribOverlayFactory.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ class GRIBOverlayFactory : public wxEvtHandler {
206206
}
207207

208208
GribTimelineRecordSet *m_pGribTimelineRecordSet;
209+
GRIBLayerSet *m_pGribLayerSet;
209210

210211
void DrawMessageZoomOut(PlugIn_ViewPort *vp);
211212
void GetGraphicColor(int settings, double val, unsigned char &r,

plugins/grib_pi/src/grib_layer_set.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,5 +443,11 @@ bool GRIBLayerSet::getTimeInterpolatedValues(double& M, double& A, int idx1,
443443

444444
// TODO: refactor and remove.
445445
GribTimelineRecordSet* GRIBLayerSet::GetTimeLineRecordSet(wxDateTime time) {
446+
for (auto& pair : m_layers) {
447+
if (pair.second && pair.second->IsEnabled()) {
448+
// Return the first valid timeline record set for backwards compatibility.
449+
return pair.second->GetTimeLineRecordSet(time);
450+
}
451+
}
446452
return nullptr;
447453
}

plugins/grib_pi/src/grib_layer_set.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,16 @@ class DECL_EXP GRIBLayerSet {
201201
/** Get smallest time interval between records in minutes. */
202202
int GetSmallestInterval() const;
203203

204-
// TODO: refactor and remove.
204+
/**
205+
* Get the weather parameter values at a specific time.
206+
*
207+
* @param time The target datetime for which to interpolate GRIB records.
208+
* @return Pointer to GribTimelineRecordSet containing temporally interpolated
209+
* data, or NULL if no valid data.
210+
*
211+
* @note Return the values from the first layer that has data.
212+
* @todo Refactor to use the merge strategy.
213+
*/
205214
GribTimelineRecordSet* GetTimeLineRecordSet(wxDateTime time);
206215

207216
double getTimeInterpolatedValue(int idx, double lon, double lat,

0 commit comments

Comments
 (0)