本文整理汇总了C++中GetOCPNConfigObject函数的典型用法代码示例。如果您正苦于以下问题:C++ GetOCPNConfigObject函数的具体用法?C++ GetOCPNConfigObject怎么用?C++ GetOCPNConfigObject使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetOCPNConfigObject函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddLocaleCatalog
int vdr_pi::Init(void)
{
AddLocaleCatalog( _T("opencpn-vdr_pi") );
// Get a pointer to the opencpn configuration object
m_pconfig = GetOCPNConfigObject();
m_pauimgr = GetFrameAuiManager();
m_pvdrcontrol = NULL;
// And load the configuration items
LoadConfig();
// This PlugIn needs two toolbar icons
m_tb_item_id_record = InsertPlugInTool(_T(""), _img_vdr_record, _img_vdr_record, wxITEM_CHECK,
_("Record"), _T(""), NULL, VDR_TOOL_POSITION, 0, this);
m_tb_item_id_play = InsertPlugInTool(_T(""), _img_vdr_play, _img_vdr_play, wxITEM_CHECK,
_("Play"), _T(""), NULL, VDR_TOOL_POSITION, 0, this);
m_recording = false;
return (
WANTS_TOOLBAR_CALLBACK |
INSTALLS_TOOLBAR_TOOL |
WANTS_CONFIG |
WANTS_NMEA_SENTENCES |
WANTS_AIS_SENTENCES
);
}
示例2: PreferencesDialogBase
PreferencesDialog::PreferencesDialog(wxWindow* parent)
: PreferencesDialogBase(parent)
{
wxFileConfig *pConf = GetOCPNConfigObject();
pConf->SetPath ( _T ( "/Settings/Plots" ) );
if(!pConf)
return;
bool bvalue;
int ivalue;
pConf->Read(_T("PlotCount"), &ivalue, 1);
m_sPlotCount->SetValue(ivalue);
pConf->Read(_T("CoursePrediction"), &bvalue, false);
m_cbCoursePrediction->SetValue(bvalue);
pConf->Read(_T("CoursePredictionBlended"), &bvalue, false);
m_cbCoursePredictionBlended->SetValue(bvalue);
pConf->Read(_T("CoursePredictionLength"), &ivalue, 10);
m_sCoursePredictionLength->SetValue(ivalue);
pConf->Read(_T("CoursePredictionSeconds"), &ivalue, 10);
m_sCoursePredictionSeconds->SetValue(ivalue);
}
示例3: GetOCPNConfigObject
void DecoderOptionsDialog::OnDone( wxCommandEvent& event )
{
wxFileConfig *pConf = GetOCPNConfigObject();
pConf->SetPath ( _T ( "/Settings/WeatherFax/Audio" ) );
bool spin_options_changed =
m_sBitsPerPixel->GetValue() != pConf->Read ( _T ( "BitsPerPixel" ), 8L ) ||
m_sCarrier->GetValue() != pConf->Read ( _T ( "Carrier" ), 1900L ) ||
m_sDeviation->GetValue() != pConf->Read ( _T ( "Deviation" ), 400L ) ||
m_sMinusSaturationThreshold->GetValue() != pConf->Read ( _T ( "MinusSaturationThreshold" ), 15L );
pConf->Write ( _T ( "ImageWidth" ), m_sImageWidth->GetValue());
pConf->Write ( _T ( "BitsPerPixel" ), m_sBitsPerPixel->GetValue());
pConf->Write ( _T ( "Carrier" ), m_sCarrier->GetValue());
pConf->Write ( _T ( "Deviation" ), m_sDeviation->GetValue());
pConf->Write ( _T ( "MinusSaturationThreshold" ), m_sMinusSaturationThreshold->GetValue());
pConf->Write ( _T ( "Filter" ), m_cFilter->GetSelection());
pConf->Write ( _T ( "SkipHeaderDetection" ), m_cbSkip->GetValue());
pConf->Write ( _T ( "IncludeHeadersInImage" ), m_cbInclude->GetValue());
FaxDecoder &decoder = m_wizard.m_decoder;
bool capture = decoder.m_CaptureSettings.type == FaxDecoderCaptureSettings::AUDIO ||
decoder.m_CaptureSettings.type == FaxDecoderCaptureSettings::RTLSDR;
// Hide();
EndModal(wxID_OK);
if(origwidth != m_sImageWidth->GetValue() ||
(!capture && spin_options_changed)) {
origwidth = m_sImageWidth->GetValue();
ResetDecoder();
}
}
示例4: GetOCPNConfigObject
GRIBUIDialog::~GRIBUIDialog()
{
wxFileConfig *pConf = GetOCPNConfigObject();;
if(pConf) {
pConf->SetPath ( _T ( "/Settings/GRIB" ) );
pConf->Write( _T ( "WindPlot" ), m_cbWind->GetValue());
pConf->Write( _T ( "WindGustPlot" ), m_cbWindGust->GetValue());
pConf->Write( _T ( "PressurePlot" ), m_cbPressure->GetValue());
pConf->Write( _T ( "WavePlot" ), m_cbWave->GetValue());
pConf->Write( _T ( "CurrentPlot" ), m_cbCurrent->GetValue());
pConf->Write( _T ( "PrecipitationPlot" ), m_cbPrecipitation->GetValue());
pConf->Write( _T ( "CloudPlot" ), m_cbCloud->GetValue());
pConf->Write( _T ( "AirTemperaturePlot" ), m_cbAirTemperature->GetValue());
pConf->Write( _T ( "SeaTemperaturePlot" ), m_cbSeaTemperature->GetValue());
pConf->Write( _T ( "lastdatatype" ), m_lastdatatype);
pConf->Write ( _T ( "Filename" ), m_file_name );
pConf->SetPath ( _T ( "/Directories" ) );
pConf->Write ( _T ( "GRIBDirectory" ), m_grib_dir );
}
delete m_pTimelineSet;
}
示例5: AddLocaleCatalog
int calculator_pi::Init(void)
{
AddLocaleCatalog( _T("opencpn-calculator_pi") );
// Set some default private member parameters
m_calculator_dialog_x = 0;
m_calculator_dialog_y = 0;
m_calculator_dialog_width = 20;
m_calculator_dialog_height = 20;
::wxDisplaySize(&m_display_width, &m_display_height);
// Get a pointer to the opencpn display canvas, to use as a parent for the POI Manager dialog
m_parent_window = GetOCPNCanvasWindow();
// Get a pointer to the opencpn configuration object
m_pconfig = GetOCPNConfigObject();
// And load the configuration items
LoadConfig();
// This PlugIn needs a toolbar icon, so request its insertion
m_leftclick_tool_id = InsertPlugInTool(_T(""), _img_calc, _img_calc, wxITEM_NORMAL,
_("Calculator"), _T(""), NULL,
CALCULATOR_TOOL_POSITION, 0, this);
m_pDialog = NULL;
return (WANTS_TOOLBAR_CALLBACK |
INSTALLS_TOOLBAR_TOOL |
WANTS_PREFERENCES |
WANTS_CONFIG
);
}
示例6: GetOCPNConfigObject
void GribOverlaySettings::Write()
{
/* save settings here */
wxFileConfig *pConf = GetOCPNConfigObject();
if(!pConf)
return;
pConf->SetPath ( _T( "/PlugIns/GRIB" ) );
pConf->Write ( _T ( "Interpolate" ), m_bInterpolate);
pConf->Write ( _T ( "LoopMode" ), m_bLoopMode );
pConf->Write ( _T ( "SlicesPerUpdate" ), m_SlicesPerUpdate);
pConf->Write ( _T ( "UpdatesPerSecond" ), m_UpdatesPerSecond);
pConf->Write ( _T ( "HourDivider" ), m_HourDivider);
for(int i=0; i<SETTINGS_COUNT; i++) {
wxString Name=name_from_index[i];
pConf->Write ( Name + _T ( "Units" ), (int)Settings[i].m_Units);
pConf->Write ( Name + _T ( "BarbedArrows" ), Settings[i].m_bBarbedArrows);
pConf->Write ( Name + _T ( "BarbedRange" ), Settings[i].m_iBarbedRange);
pConf->Write ( Name + _T ( "IsoBars" ), Settings[i].m_bIsoBars);
pConf->Write ( Name + _T ( "IsoBarSpacing" ), Settings[i].m_iIsoBarSpacing);
pConf->Write ( Name + _T ( "DirectionArrows" ), Settings[i].m_bDirectionArrows);
pConf->Write ( Name + _T ( "DirectionArrowSize" ), Settings[i].m_iDirectionArrowSize);
pConf->Write ( Name + _T ( "OverlayMap" ), Settings[i].m_bOverlayMap);
pConf->Write ( Name + _T ( "OverlayMapColors" ), Settings[i].m_iOverlayMapColors);
pConf->Write ( Name + _T ( "Numbers" ), Settings[i].m_bNumbers);
pConf->Write ( Name + _T ( "NumbersSpacing" ), Settings[i].m_iNumbersSpacing);
}
}
示例7: AddLocaleCatalog
int locapi_pi::Init ( void )
{
AddLocaleCatalog ( _T ( "opencpn-locapi_pi" ) );
m_pconfig = GetOCPNConfigObject();
LoadConfig();
status = REPORT_NOT_SUPPORTED;
if (SUCCEEDED(spLoc.CoCreateInstance(CLSID_Location))) // Create the Location object
{
wxLogMessage(_T("LOCAPI: Instance created"));
// Array of report types of interest. Other ones include IID_ICivicAddressReport
IID REPORT_TYPES[] = { IID_ILatLongReport };
// Request permissions for this user account to receive location data for all the
// types defined in REPORT_TYPES (which is currently just one report)
if (FAILED(spLoc->RequestPermissions(NULL, REPORT_TYPES, ARRAYSIZE(REPORT_TYPES), TRUE))) // TRUE means a synchronous request
{
wxMessageBox( _("Warning: Unable to request permissions to receive location updates.") );
}
}
else
{
wxLogMessage(_T("LOCAPI: Instance creation failed"));
}
Start( m_interval, wxTIMER_CONTINUOUS );
return (
WANTS_CONFIG
);
}
示例8: SelectedPolar
void BoatDialog::OnSaveFile ( wxCommandEvent& event )
{
long index = SelectedPolar();
if(index < 0)
return;
wxFileConfig *pConf = GetOCPNConfigObject();
pConf->SetPath ( _T( "/PlugIns/WeatherRouting/BoatDialog" ) );
wxString path;
pConf->Read ( _T ( "FilePath" ), &path, weather_routing_pi::StandardPath());
wxFileDialog saveDialog( this, _( "Select Polar" ), path, wxT ( "" ),
wxT ( "Boat Polar files (*.file)|*.FILE;*.file|All files (*.*)|*.*" ), wxFD_SAVE );
if( saveDialog.ShowModal() == wxID_OK ) {
wxString filename = saveDialog.GetPath();
pConf->SetPath ( _T( "/PlugIns/WeatherRouting/BoatDialog" ) );
pConf->Write ( _T ( "FILEPath" ), wxFileName(filename).GetPath() );
Polar &polar = m_Boat.Polars[index];
if(!polar.Save(saveDialog.GetPath().mb_str())) {
wxMessageDialog md(this, _("Failed saving boat polar to file"), _("OpenCPN Weather Routing Plugin"),
wxICON_ERROR | wxOK );
md.ShowModal();
}
}
}
示例9: AddLocaleCatalog
int findit_pi::Init(void)
{
AddLocaleCatalog( _T("opencpn-findit_pi") );
m_pFindItWindow = NULL;
isLogbookReady = FALSE;;
isLogbookWindowShown = FALSE;
// Get a pointer to the opencpn display canvas, to use as a parent for windows created
m_parent_window = GetOCPNCanvasWindow();
m_pconfig = GetOCPNConfigObject();
LoadConfig();
// Create the Context Menu Items
// In order to avoid an ASSERT on msw debug builds,
// we need to create a dummy menu to act as a surrogate parent of the created MenuItems
// The Items will be re-parented when added to the real context meenu
wxMenu dummy_menu;
m_bFINDITShowIcon = true;
if(m_bFINDITShowIcon)
m_leftclick_tool_id = InsertPlugInTool(_T(""), _img_findit, _img_findit, wxITEM_NORMAL,
_("FindIt"), _T(""), NULL,
FINDIT_TOOL_POSITION, 0, this);
return (
WANTS_TOOLBAR_CALLBACK |
WANTS_PREFERENCES |
WANTS_PLUGIN_MESSAGING
);
}
示例10: GetOCPNConfigObject
void BoatDialog::OnOpenBoat ( wxCommandEvent& event )
{
wxFileConfig *pConf = GetOCPNConfigObject();
pConf->SetPath ( _T( "/PlugIns/WeatherRouting/BoatDialog" ) );
wxString path;
pConf->Read ( _T ( "Path" ), &path, weather_routing_pi::StandardPath());
wxFileDialog openDialog
( this, _( "Select Boat" ), path, wxT ( "" ),
wxT ( "Boat polar (*.xml)|*.XML;*.xml|All files (*.*)|*.*" ),
wxFD_OPEN );
if( openDialog.ShowModal() == wxID_OK ) {
wxString filename = openDialog.GetPath();
pConf->SetPath ( _T( "/PlugIns/WeatherRouting/BoatDialog" ) );
pConf->Write ( _T ( "Path" ), wxFileName(filename).GetPath() );
wxString error = m_Boat.OpenXML(filename);
if(error.empty()) {
RepopulatePolars();
} else {
wxMessageDialog md(this, error, _("OpenCPN Weather Routing Plugin"),
wxICON_ERROR | wxOK );
md.ShowModal();
return;
}
UpdateVMG();
RefreshPlots();
}
}
示例11: AddLocaleCatalog
int kmloverlay_pi::Init(void)
{
m_puserinput = NULL;
AddLocaleCatalog( _T("opencpn-kmloverlay_pi") );
m_toolbar_item_id = InsertPlugInTool( _T(""), _img_kmloverlay, _img_kmloverlay, wxITEM_NORMAL,
_("KML overlay"), _T(""), NULL, KMLOVERLAY_TOOL_POSITION, 0, this );
m_pauimgr = GetFrameAuiManager();
m_puserinput = new KMLOverlayUI( GetOCPNCanvasWindow(), wxID_ANY, _T("") );
wxAuiPaneInfo pane = wxAuiPaneInfo().Name(_T("KMLOverlay")).Caption(_("KML overlay")).CaptionVisible(true).Float().FloatingPosition(50,150).Dockable(false).Resizable().CloseButton(true).Show(false);
m_pauimgr->AddPane( m_puserinput, pane );
m_pauimgr->Update();
// Get a pointer to the opencpn configuration object
m_pconfig = GetOCPNConfigObject();
// And load the configuration items
LoadConfig();
ApplyConfig();
return (
WANTS_OVERLAY_CALLBACK |
WANTS_OPENGL_OVERLAY_CALLBACK |
WANTS_TOOLBAR_CALLBACK |
INSTALLS_TOOLBAR_TOOL |
// nothing yet // WANTS_PREFERENCES |
WANTS_CONFIG
);
}
示例12: DecoderOptionsDialogBase
DecoderOptionsDialog::DecoderOptionsDialog(WeatherFaxWizard &wizard)
#ifndef __WXOSX__
: DecoderOptionsDialogBase(&wizard),
#else
: DecoderOptionsDialogBase(&wizard, wxID_ANY, _("Fax Decoding Options"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxSTAY_ON_TOP),
#endif
m_wizard(wizard)
{
Hide();
wxFileConfig *pConf = GetOCPNConfigObject();
pConf->SetPath ( _T ( "/Settings/WeatherFax/Audio" ) );
m_sImageWidth->SetValue(pConf->Read ( _T ( "ImageWidth" ), 1024L ));
m_sBitsPerPixel->SetValue(pConf->Read ( _T ( "BitsPerPixel" ), 8L ));
m_sCarrier->SetValue(pConf->Read ( _T ( "Carrier" ), 1900L ));
m_sDeviation->SetValue(pConf->Read ( _T ( "Deviation" ), 400L ));
m_sMinusSaturationThreshold->SetValue(pConf->Read ( _T ( "MinusSaturationThreshold" ), 15L ));
m_cFilter->SetSelection(pConf->Read ( _T ( "Filter" ), FaxDecoder::firfilter::MIDDLE ));
m_cbSkip->SetValue((bool)pConf->Read ( _T ( "SkipHeaderDetection" ), 0L ));
m_cbInclude->SetValue((bool)pConf->Read ( _T ( "IncludeHeadersInImage" ), 0L ));
origwidth = m_sImageWidth->GetValue();
// FaxDecoder &decoder = m_wizard.m_decoder;
ConfigureDecoder(true);
}
示例13: GetOCPNConfigObject
PlotConfigurationDialog::~PlotConfigurationDialog()
{
wxFileConfig *pConf = GetOCPNConfigObject();
if(!pConf)
return;
pConf->SetPath ( wxString::Format( "/Settings/Plots/%d", m_index ) );
for(std::list<cbState>::iterator it = m_cbStates.begin(); it != m_cbStates.end(); it++)
pConf->Write(_T("Plot ") + it->name, it->cb->GetValue());
double vmgcourse;
m_tVMGCourse->GetValue().ToDouble(&vmgcourse);
pConf->Write(_T("VMGCourse"), vmgcourse);
#if wxCHECK_VERSION(3,0,0)
pConf->Write(_T("PlotFont"), m_fpPlotFont->GetSelectedFont());
#endif
pConf->Write(_T("PlotMinHeight"), m_sPlotMinHeight->GetValue());
pConf->Write(_T("PlotColors"), m_cColors->GetSelection());
pConf->Write(_T("PlotTransparency"), m_sPlotTransparency->GetValue());
pConf->Write(_T("PlotStyle"), m_cPlotStyle->GetSelection());
pConf->Write(_T("PlotShowTitleBar"), m_cbShowTitleBar->GetValue());
}
示例14: AddLocaleCatalog
int gecomapi_pi::Init(void)
{
m_bshuttingDown = false;
mPriPosition = 99;
m_pgecomapi_window = NULL;
AddLocaleCatalog( _T("opencpn-gecomapi_pi") );
// Get a pointer to the opencpn display canvas, to use as a parent for the POI Manager dialog
m_parent_window = GetOCPNCanvasWindow();
m_pauimgr = GetFrameAuiManager();
// Get a pointer to the opencpn configuration object
m_pconfig = GetOCPNConfigObject();
// And load the configuration items
LoadConfig();
// This PlugIn needs a toolbar icon
#ifdef GECOMAPI_USE_SVG
m_toolbar_item_id = InsertPlugInToolSVG(_T("GoogleEarth"), _svg_gecomapi, _svg_gecomapi_rollover, _svg_gecomapi_toggled, wxITEM_CHECK,
_T("GoogleEarth"), _T(""), NULL, GECOMAPI_TOOL_POSITION, 0, this);
#else
m_toolbar_item_id = InsertPlugInTool(_T("GoogleEarth"), _img_gecomapi, _img_gecomapi, wxITEM_CHECK,
_T("GoogleEarth"), _T(""), NULL, GECOMAPI_TOOL_POSITION, 0, this);
#endif
m_pgecomapi_window = new GEUIDialog(GetOCPNCanvasWindow(), wxID_ANY, m_pauimgr, m_toolbar_item_id, this);
wxAuiPaneInfo pane = wxAuiPaneInfo().Name(_T("GoogleEarth")).Caption(_T("GoogleEarth")).CaptionVisible(true).Float().FloatingPosition(0,0).Show(!m_bstartHidden).TopDockable(false).BottomDockable(false).LeftDockable(true).RightDockable(true).CaptionVisible(true).CloseButton(false).MinSize(300,300);
m_pauimgr->AddPane(m_pgecomapi_window, pane);
if(m_pgecomapi_window)
{
m_pgecomapi_window->SetCameraParameters(m_iCameraAzimuth, m_iCameraTilt, m_iCameraRange);
}
ApplyConfig();
m_pauimgr->Update();
//m_pauimgr->Connect( wxEVT_AUI_RENDER, wxAuiManagerEventHandler( gecomapi_pi::OnAuiRender ), NULL, this );
return (WANTS_OVERLAY_CALLBACK |
WANTS_CURSOR_LATLON |
WANTS_TOOLBAR_CALLBACK |
INSTALLS_TOOLBAR_TOOL |
WANTS_PREFERENCES |
WANTS_CONFIG |
WANTS_NMEA_EVENTS |
WANTS_NMEA_SENTENCES |
USES_AUI_MANAGER |
WANTS_ONPAINT_VIEWPORT
);
}
示例15: GetOCPNConfigObject
ConfigurationDialog::~ConfigurationDialog( )
{
wxFileConfig *pConf = GetOCPNConfigObject();
pConf->SetPath ( _T( "/PlugIns/WeatherRouting" ) );
wxPoint p = GetPosition();
pConf->Write ( _T ( "ConfigurationX" ), p.x);
pConf->Write ( _T ( "ConfigurationY" ), p.y);
}