void GRIBUIDialog::OnRequest( wxCommandEvent& event ) { double lonmax=m_vp->lon_max; double lonmin=m_vp->lon_min; if( ( fabs( m_vp->lat_max ) < 90. ) && ( fabs( lonmax ) < 360. ) ) { if( lonmax < -180. ) lonmax += 360.; if( lonmax > 180. ) lonmax -= 360.; } if( ( fabs( m_vp->lat_min ) < 90. ) && ( fabs( lonmin ) < 360. ) ) { if( lonmin < -180. ) lonmin += 360.; if( lonmin > 180. ) lonmin -= 360.; } wxString zone( toSAILDOC( 1, 1, m_vp->lat_max ) + wxT(",") + toSAILDOC( 1, 2, m_vp->lat_min ) + wxT(",") + toSAILDOC( 2, 2, lonmin ) + wxT(",") + toSAILDOC( 2, 1, lonmax ) ); GribRequestSetting *req_Dialog = new GribRequestSetting( this, pPlugIn->GetRequestConfig(), zone, pPlugIn->GetMailAdresse() ); if( req_Dialog->ShowModal() == wxID_SAVE ) { req_Dialog->m_RequestConfigBase.SetChar( 2, (char) ( req_Dialog->m_pModel->GetCurrentSelection() + '0' ) ); if( req_Dialog->m_pModel->GetCurrentSelection() == 0 ) { req_Dialog->m_RequestConfigBase.SetChar( 3, (char) ( req_Dialog->m_pResolution->GetCurrentSelection() + '0' ) ); req_Dialog->m_pWaves->IsChecked() ? req_Dialog->m_RequestConfigBase.SetChar( 8, 'X' ) : req_Dialog->m_RequestConfigBase.SetChar( 8, '.' ); req_Dialog->m_pRainfall->IsChecked() ? req_Dialog->m_RequestConfigBase.SetChar( 9, 'X' ) : req_Dialog->m_RequestConfigBase.SetChar( 9, '.' ); req_Dialog->m_pCloudCover->IsChecked() ? req_Dialog->m_RequestConfigBase.SetChar( 10, 'X' ) : req_Dialog->m_RequestConfigBase.SetChar( 10, '.' ); req_Dialog->m_pAirTemp->IsChecked() ? req_Dialog->m_RequestConfigBase.SetChar( 11, 'X' ) : req_Dialog->m_RequestConfigBase.SetChar( 11, '.' ); req_Dialog->m_pSeaTemp->IsChecked() ? req_Dialog->m_RequestConfigBase.SetChar( 12, 'X' ) : req_Dialog->m_RequestConfigBase.SetChar( 12, '.' ); req_Dialog->m_pCurrent->IsChecked() ? req_Dialog->m_RequestConfigBase.SetChar( 13, 'X' ) : req_Dialog->m_RequestConfigBase.SetChar( 13, '.' ); } else if( req_Dialog->m_pModel->GetCurrentSelection() == 1 ) req_Dialog->m_RequestConfigBase.SetChar( 3, (char) ( req_Dialog->m_pResolution->GetCurrentSelection() + '0' ) ); req_Dialog->m_RequestConfigBase.SetChar( 6, 'X' ); //must be always selected req_Dialog->m_RequestConfigBase.SetChar( 7, 'X' ); req_Dialog->m_RequestConfigBase.SetChar( 4, (char) ( req_Dialog->m_pInterval->GetCurrentSelection() + '0' ) ); req_Dialog->m_RequestConfigBase.SetChar( 5, (char) ( req_Dialog->m_pTimeRange->GetCurrentSelection() + '0' ) ); pPlugIn->SetRequestConfig( req_Dialog->m_RequestConfigBase ); } req_Dialog->Destroy(); }
void GRIBUIDialog::OnRequest( wxCommandEvent& event ) { double lonmax=m_vp->lon_max; double lonmin=m_vp->lon_min; if( ( fabs( m_vp->lat_max ) < 90. ) && ( fabs( lonmax ) < 360. ) ) { if( lonmax < -180. ) lonmax += 360.; if( lonmax > 180. ) lonmax -= 360.; } if( ( fabs( m_vp->lat_min ) < 90. ) && ( fabs( lonmin ) < 360. ) ) { if( lonmin < -180. ) lonmin += 360.; if( lonmin > 180. ) lonmin -= 360.; } wxString zone( toSAILDOC( 1, 1, m_vp->lat_max ) + wxT(",") + toSAILDOC( 1, 2, m_vp->lat_min ) + wxT(",") + toSAILDOC( 2, 2, lonmin ) + wxT(",") + toSAILDOC( 2, 1, lonmax ) ); ShowSendRequest( zone ); }