Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:OrbitalRio:branches:Application:Geo:OpenCPN:head
OpenCPN_celestial_navigation_pi
OpenCPN_Celestial_Navigation_pi.devel-include.p...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File OpenCPN_Celestial_Navigation_pi.devel-include.patch of Package OpenCPN_celestial_navigation_pi
diff -Pdpru OpenCPN_Celestial_Navigation_pi.orig/CMakeLists.txt OpenCPN_Celestial_Navigation_pi/CMakeLists.txt --- OpenCPN_Celestial_Navigation_pi.orig/CMakeLists.txt 2013-07-09 15:51:15.144539582 +0200 +++ OpenCPN_Celestial_Navigation_pi/CMakeLists.txt 2013-07-23 15:31:54.650312637 +0200 @@ -1,9 +1,9 @@ ##--------------------------------------------------------------------------- ## Author: Sean D'Epagnier -## Copyright: +## Copyright: ## License: GPLv3 ##--------------------------------------------------------------------------- - + # define minimum cmake version CMAKE_MINIMUM_REQUIRED(VERSION 2.6.2) @@ -14,7 +14,7 @@ IF (COMMAND cmake_policy) CMAKE_POLICY(SET CMP0011 OLD) ENDIF (COMMAND cmake_policy) -PROJECT(celestial_navigation_pi) +PROJECT(OpenCPN_celestial_navigation_pi) SET(PACKAGE_NAME celestial_navigation_pi) SET(PLUGIN_SOURCE_DIR .) @@ -24,66 +24,74 @@ MESSAGE (STATUS "*** Staging to build ${ #SET(CMAKE_BUILD_TYPE Debug) SET(PREFIX_PARENTDATA ${PREFIX_DATA}/${PARENT}) -INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) +INCLUDE_DIRECTORIES( + ${CMAKE_SOURCE_DIR}/include + ${CMAKE_SOURCE_DIR}/src + ) # require proper c++ #ADD_DEFINITIONS( "-Wall -ansi -pedantic -Wno-variadic-macros" ) # IF NOT DEBUGGING CFLAGS="-O2 -march=native" IF(NOT WIN32) - ADD_DEFINITIONS( "-Wall -g -fexceptions" ) + ADD_DEFINITIONS( "-Wall -g -fexceptions" ) - IF(NOT APPLE) - SET(CMAKE_SHARED_LINKER_FLAGS "-Wl,-Bsymbolic") - ELSE(NOT APPLE) - SET(CMAKE_SHARED_LINKER_FLAGS "-Wl") - ENDIF(NOT APPLE) + IF(NOT APPLE) + SET(CMAKE_SHARED_LINKER_FLAGS "-Wl,-Bsymbolic") + ELSE(NOT APPLE) + SET(CMAKE_SHARED_LINKER_FLAGS "-Wl") + ENDIF(NOT APPLE) ENDIF(NOT WIN32) # Add some definitions to satisfy MS IF(WIN32) - ADD_DEFINITIONS(-D__MSVC__) - ADD_DEFINITIONS(-D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_SECURE_NO_DEPRECATE) + ADD_DEFINITIONS(-D__MSVC__) + ADD_DEFINITIONS(-D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_SECURE_NO_DEPRECATE) ENDIF(WIN32) +IF(NOT DEFINED wxWidgets_USE_FILE) + SET(wxWidgets_USE_LIBS base core net xml html adv aui) + FIND_PACKAGE(wxWidgets REQUIRED) +ENDIF(NOT DEFINED wxWidgets_USE_FILE) + INCLUDE(${wxWidgets_USE_FILE}) FIND_PACKAGE(Gettext REQUIRED) -# For convenience we define the sources as a variable. You can add +# For convenience we define the sources as a variable. You can add # header files and cpp/c files and CMake will sort them out SET(SRC_CELESTIAL_NAVIGATION - src/astrolabe/calendar.cpp - src/astrolabe/dicts.cpp - src/astrolabe/dynamical.cpp - src/astrolabe/elp2000.cpp - src/astrolabe/equinox.cpp - src/astrolabe/globals.cpp - src/astrolabe/nutation.cpp - src/astrolabe/riseset.cpp - src/astrolabe/sun.cpp - src/astrolabe/util.cpp - src/astrolabe/vsop87d.cpp - src/geomag/geomag.c - src/CelestialNavigationDialog.cpp - src/CelestialNavigationDialog.h - src/CelestialNavigationUI.cpp - src/CelestialNavigationUI.h - src/SightDialog.cpp - src/SightDialog.h - src/Sight.cpp - src/Sight.h - src/icons.cpp - src/icons.h - src/FindBodyDialog.cpp - src/FindBodyDialog.h - src/geodesic.c - src/geodesic.h - src/celestial_navigation_pi.cpp - src/celestial_navigation_pi.h - ) + src/astrolabe/calendar.cpp + src/astrolabe/dicts.cpp + src/astrolabe/dynamical.cpp + src/astrolabe/elp2000.cpp + src/astrolabe/equinox.cpp + src/astrolabe/globals.cpp + src/astrolabe/nutation.cpp + src/astrolabe/riseset.cpp + src/astrolabe/sun.cpp + src/astrolabe/util.cpp + src/astrolabe/vsop87d.cpp + src/geomag/geomag.c + src/CelestialNavigationDialog.cpp + src/CelestialNavigationDialog.h + src/CelestialNavigationUI.cpp + src/CelestialNavigationUI.h + src/SightDialog.cpp + src/SightDialog.h + src/Sight.cpp + src/Sight.h + src/icons.cpp + src/icons.h + src/FindBodyDialog.cpp + src/FindBodyDialog.h + src/geodesic.c + src/geodesic.h + src/celestial_navigation_pi.cpp + src/celestial_navigation_pi.h + ) ADD_LIBRARY(${PACKAGE_NAME} SHARED ${SRC_CELESTIAL_NAVIGATION}) @@ -96,91 +104,98 @@ ENDIF(WIN32) TARGET_LINK_LIBRARIES( ${PACKAGE_NAME} ${wxWidgets_LIBRARIES} ) IF(APPLE) - INSTALL(TARGETS ${PACKAGE_NAME} BUNDLE LIBRARY DESTINATION ${CMAKE_BINARY_DIR}/OpenCPN.app/Contents/PlugIns) + INSTALL(TARGETS ${PACKAGE_NAME} BUNDLE LIBRARY DESTINATION ${CMAKE_BINARY_DIR}/OpenCPN.app/Contents/PlugIns) ENDIF(APPLE) IF(UNIX AND NOT APPLE) -INSTALL(TARGETS ${PACKAGE_NAME} RUNTIME LIBRARY DESTINATION ${PREFIX_PLUGINS}) + IF(NOT DEFINED PREFIX_PLUGINS) + SET(PREFIX_PLUGINS /usr/lib/opencpn) + ENDIF(NOT DEFINED PREFIX_PLUGINS) + IF(NOT DEFINED PREFIX_DATA) + SET(PREFIX_DATA /usr/share) + ENDIF(NOT DEFINED PREFIX_DATA) + + INSTALL(TARGETS ${PACKAGE_NAME} RUNTIME LIBRARY DESTINATION ${PREFIX_PLUGINS}) ENDIF(UNIX AND NOT APPLE) IF(WIN32) -INSTALL(TARGETS ${PACKAGE_NAME} RUNTIME DESTINATION "plugins") + INSTALL(TARGETS ${PACKAGE_NAME} RUNTIME DESTINATION "plugins") ENDIF(WIN32) - + IF(WIN32) INSTALL(DIRECTORY data DESTINATION "plugins\\\\celestial_navigation") ELSE(WIN32) - INSTALL(DIRECTORY data DESTINATION ${PREFIX_PARENTDATA}/plugins/celestial_navigation) + INSTALL(DIRECTORY data DESTINATION ${PREFIX_DATA}/opencpn/plugins/celestial_navigation/) ENDIF(WIN32) # find src/ -name \*.cpp -or -name \*.c -or -name \*.h -or -name \*.hpp >po/POTFILES.in FIND_PROGRAM(GETTEXT_XGETTEXT_EXECUTABLE xgettext) IF (GETTEXT_XGETTEXT_EXECUTABLE) -ADD_CUSTOM_COMMAND( - OUTPUT po/${PACKAGE_NAME}.pot.dummy - COMMAND ${GETTEXT_XGETTEXT_EXECUTABLE} --force-po --package-name=${PACKAGE_NAME} --package-version="${PACKAGE_VERSION}" --output=po/${PACKAGE_NAME}.pot --keyword=_ --width=80 --files-from=${CMAKE_CURRENT_SOURCE_DIR}/po/POTFILES.in - DEPENDS po/POTFILES.in po/${PACKAGE_NAME}.pot - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - COMMENT "celestial_navigation-pot-update [${PACKAGE_NAME}]: Generated pot file." -) -ADD_CUSTOM_TARGET(celestial_navigation-pot-update COMMENT "celestial_navigation-pot-update: Done." DEPENDS po/${PACKAGE_NAME}.pot.dummy) + ADD_CUSTOM_COMMAND( + OUTPUT po/${PACKAGE_NAME}.pot.dummy + COMMAND ${GETTEXT_XGETTEXT_EXECUTABLE} --force-po --package-name=${PACKAGE_NAME} --package-version="${PACKAGE_VERSION}" --output=po/${PACKAGE_NAME}.pot --keyword=_ --width=80 --files-from=${CMAKE_CURRENT_SOURCE_DIR}/po/POTFILES.in + DEPENDS po/POTFILES.in po/${PACKAGE_NAME}.pot + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMENT "celestial_navigation-pot-update [${PACKAGE_NAME}]: Generated pot file." + ) + ADD_CUSTOM_TARGET(celestial_navigation-pot-update COMMENT "celestial_navigation-pot-update: Done." DEPENDS po/${PACKAGE_NAME}.pot.dummy) ENDIF(GETTEXT_XGETTEXT_EXECUTABLE ) MACRO(GETTEXT_UPDATE_PO _potFile) - SET(_poFiles ${_potFile}) - GET_FILENAME_COMPONENT(_absPotFile ${_potFile} ABSOLUTE) + SET(_poFiles ${_potFile}) + GET_FILENAME_COMPONENT(_absPotFile ${_potFile} ABSOLUTE) - FOREACH (_currentPoFile ${ARGN}) - GET_FILENAME_COMPONENT(_absFile ${_currentPoFile} ABSOLUTE) - GET_FILENAME_COMPONENT(_poBasename ${_absFile} NAME_WE) + FOREACH (_currentPoFile ${ARGN}) + GET_FILENAME_COMPONENT(_absFile ${_currentPoFile} ABSOLUTE) + GET_FILENAME_COMPONENT(_poBasename ${_absFile} NAME_WE) - ADD_CUSTOM_COMMAND( - OUTPUT ${_absFile}.dummy - COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --width=80 --strict --quiet --update --backup=none --no-location -s ${_absFile} ${_absPotFile} - DEPENDS ${_absPotFile} ${_absFile} - COMMENT "celestial_navigation-po-update [${_poBasename}]: Updated po file." + ADD_CUSTOM_COMMAND( + OUTPUT ${_absFile}.dummy + COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --width=80 --strict --quiet --update --backup=none --no-location -s ${_absFile} ${_absPotFile} + DEPENDS ${_absPotFile} ${_absFile} + COMMENT "celestial_navigation-po-update [${_poBasename}]: Updated po file." ) - SET(_poFiles ${_poFiles} ${_absFile}.dummy) + SET(_poFiles ${_poFiles} ${_absFile}.dummy) - ENDFOREACH (_currentPoFile ) + ENDFOREACH (_currentPoFile ) - ADD_CUSTOM_TARGET(celestial_navigation-po-update COMMENT "celestial_navigation-po-update: Done." DEPENDS ${_poFiles}) + ADD_CUSTOM_TARGET(celestial_navigation-po-update COMMENT "celestial_navigation-po-update: Done." DEPENDS ${_poFiles}) ENDMACRO(GETTEXT_UPDATE_PO) IF (GETTEXT_MSGMERGE_EXECUTABLE) -FILE(GLOB PACKAGE_PO_FILES po/*.po) -GETTEXT_UPDATE_PO(po/${PACKAGE_NAME}.pot ${PACKAGE_PO_FILES}) + FILE(GLOB PACKAGE_PO_FILES po/*.po) + GETTEXT_UPDATE_PO(po/${PACKAGE_NAME}.pot ${PACKAGE_PO_FILES}) ENDIF(GETTEXT_MSGMERGE_EXECUTABLE) SET(_gmoFiles) MACRO(GETTEXT_BUILD_MO) - FOREACH (_poFile ${ARGN}) - GET_FILENAME_COMPONENT(_absFile ${_poFile} ABSOLUTE) - GET_FILENAME_COMPONENT(_poBasename ${_absFile} NAME_WE) - SET(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_poBasename}.mo) + FOREACH (_poFile ${ARGN}) + GET_FILENAME_COMPONENT(_absFile ${_poFile} ABSOLUTE) + GET_FILENAME_COMPONENT(_poBasename ${_absFile} NAME_WE) + SET(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_poBasename}.mo) - ADD_CUSTOM_COMMAND( - OUTPUT ${_gmoFile} - COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} --check -o ${_gmoFile} ${_absFile} - DEPENDS ${_absFile} - COMMENT "celestial_navigation-i18n [${_poBasename}]: Created mo file." + ADD_CUSTOM_COMMAND( + OUTPUT ${_gmoFile} + COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} --check -o ${_gmoFile} ${_absFile} + DEPENDS ${_absFile} + COMMENT "celestial_navigation-i18n [${_poBasename}]: Created mo file." ) -If(APPLE) + If(APPLE) INSTALL(FILES ${_gmoFile} DESTINATION ${CMAKE_BINARY_DIR}/OpenCPN.app/Contents/Resources/${_poBasename}.lproj RENAME opencpn-${PACKAGE_NAME}.mo ) -ELSE(APPLE) + ELSE(APPLE) INSTALL(FILES ${_gmoFile} DESTINATION ${PREFIX_DATA}/locale/${_poBasename}/LC_MESSAGES RENAME opencpn-${PACKAGE_NAME}.mo ) -ENDIF(APPLE) - SET(_gmoFiles ${_gmoFiles} ${_gmoFile}) - ENDFOREACH (_poFile ) + ENDIF(APPLE) + SET(_gmoFiles ${_gmoFiles} ${_gmoFile}) + ENDFOREACH (_poFile ) ENDMACRO(GETTEXT_BUILD_MO) if(GETTEXT_MSGFMT_EXECUTABLE) - FILE(GLOB PACKAGE_PO_FILES po/*.po) - GETTEXT_BUILD_MO(${PACKAGE_PO_FILES}) - ADD_CUSTOM_TARGET(celestial_navigation-i18n COMMENT "celestial_navigation-i18n: Done." DEPENDS ${_gmoFiles}) - #ADD_DEPENDENCIES(celestial_navigation-i18n ${PACKAGE_PO_FILES}) - ADD_DEPENDENCIES(${PACKAGE_NAME} celestial_navigation-i18n) + FILE(GLOB PACKAGE_PO_FILES po/*.po) + GETTEXT_BUILD_MO(${PACKAGE_PO_FILES}) + ADD_CUSTOM_TARGET(celestial_navigation-i18n COMMENT "celestial_navigation-i18n: Done." DEPENDS ${_gmoFiles}) + #ADD_DEPENDENCIES(celestial_navigation-i18n ${PACKAGE_PO_FILES}) + ADD_DEPENDENCIES(${PACKAGE_NAME} celestial_navigation-i18n) ENDIF(GETTEXT_MSGFMT_EXECUTABLE) diff -Pdpru OpenCPN_Celestial_Navigation_pi.orig/src/CelestialNavigationDialog.cpp OpenCPN_Celestial_Navigation_pi/src/CelestialNavigationDialog.cpp --- OpenCPN_Celestial_Navigation_pi.orig/src/CelestialNavigationDialog.cpp 2013-07-09 15:51:15.158539776 +0200 +++ OpenCPN_Celestial_Navigation_pi/src/CelestialNavigationDialog.cpp 2013-05-10 18:46:16.789338945 +0200 @@ -27,19 +27,20 @@ // For compilers that support precompilation, includes "wx/wx.h". -#include <wx/wxprec.h> -#ifndef WX_PRECOMP -#include <wx/wx.h> -#endif #include <wx/filename.h> +#include "wx/wxprec.h" #include <wx/stdpaths.h> #include <wx/imaglist.h> +#ifndef WX_PRECOMP + #include <wx/wx.h> +#endif + #include <iostream> -#include "../../../include/ocpn_plugin.h" +#include "opencpn/ocpn_plugin.h" #include "Sight.h" #include "SightDialog.h" @@ -83,20 +84,20 @@ enum { rmVISIBLE = 0, rmTYPE, rmBODY, rm int wxCALLBACK SortSights(long item1, long item2, wxIntPtr list) #else int wxCALLBACK SortSights(long item1, long item2, long list) -#endif +#endif { wxListCtrl *lc = (wxListCtrl*)list; wxListItem it1, it2; it1.SetId(lc->FindItem(-1, item1)); it1.SetColumn(1); - + it2.SetId(lc->FindItem(-1, item2)); it2.SetColumn(1); - + lc->GetItem(it1); lc->GetItem(it2); - + return it1.GetText().Cmp(it2.GetText()); } @@ -116,7 +117,7 @@ CelestialNavigationDialog::CelestialNavi m_lSights->InsertColumn(rmTIME, _("Time")); m_lSights->InsertColumn(rmMEASUREMENT, _("Measurement")); m_lSights->InsertColumn(rmCOLOR, _("Color")); - + UpdateSights(); } @@ -145,32 +146,32 @@ void CelestialNavigationDialog::UpdateSi item.SetId(index); item.SetImage((*it)->IsVisible() ? 0 : -1); item.SetData(index); - + long idx = m_lSights->InsertItem(item); m_lSights->SetItemImage(index, (*it)->IsVisible() ? 0 : -1); m_lSights->SetItem(idx, rmTYPE, (*it)->m_Type ? _("Azimuth") : _("Altitude")); m_lSights->SetItem(idx, rmBODY, (*it)->m_Body); m_lSights->SetItem(idx, rmTIME, (*it)->m_DateTime.Format()); m_lSights->SetItem(idx, rmMEASUREMENT, wxString::Format(_T("%.4f"), (*it)->m_Measurement)); - + m_lSights->SetItem(idx, rmCOLOR, wxString::Format(_T("0x%hhx%hhx%hhx"), (*it)->m_Colour.Red(), (*it)->m_Colour.Green(), (*it)->m_Colour.Blue())); } - + m_lSights->SetColumnWidth(1, wxLIST_AUTOSIZE); m_lSights->SetColumnWidth(2, wxLIST_AUTOSIZE); - + if(m_lSights->GetColumnWidth(1) < 20) m_lSights->SetColumnWidth(1, 50); if(m_lSights->GetColumnWidth(2) < 20) m_lSights->SetColumnWidth(2, 50); - + m_lSights->SortItems(SortSights, (long)m_lSights); - + // restore selection if possible // NOTE this will select a different item, if one is deleted // (the next sight will get that index). @@ -179,7 +180,7 @@ void CelestialNavigationDialog::UpdateSi selected_index = m_lSights->FindItem(-1, selected_id); m_lSights->SetItemState(selected_index, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED); } - + UpdateButtons(); UpdateFix(); } @@ -189,7 +190,7 @@ void CelestialNavigationDialog::UpdateBu // enable/disable buttons long selected_index_index = m_lSights->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); bool enable = !(selected_index_index < 0); - + m_bEditSight->Enable(enable); m_bDeleteSight->Enable(enable); m_bDeleteAllSights->Enable(m_SightList.GetCount() > 0); @@ -336,7 +337,7 @@ again: Sight *s = *it; if(!s->IsVisible() || s->m_Type != Sight::ALTITUDE) continue; - + if(s->m_ShiftNm) { static bool seenwarning = false; if(!seenwarning) { @@ -461,7 +462,7 @@ determine fix visually instead.\n"), wxS /* normalize */ X[0] /= d, X[1] /= d, X[2] /= d; - + m_fixlat = rad2deg(asin(X[2])); m_fixlon = rad2deg(atan2(X[1], X[0])); @@ -497,7 +498,7 @@ void CelestialNavigationDialog::OnNew(wx Sight s(Sight::ALTITUDE, _("Sun"), Sight::LOWER, now, 1, 0, .25); SightDialog dialog(GetParent(), s); - + if( dialog.ShowModal() == wxID_OK ) { Sight *ns = new Sight(s); @@ -517,9 +518,9 @@ void CelestialNavigationDialog::OnEdit(w Sight *psight = m_SightList.Item(m_lSights->GetItemData(selected_index))->GetData(); Sight originalsight = *psight; /* in case of cancel */ - + SightDialog dialog(GetParent(), *psight); - + if( dialog.ShowModal() == wxID_OK ) { psight->RebuildPolygons(); UpdateSights(); @@ -533,7 +534,7 @@ void CelestialNavigationDialog::OnDelete // Delete selected_index sight/track long selected_index = m_lSights->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); if (selected_index < 0) return; - + Sight *psight_to_delete = m_SightList.Item(m_lSights->GetItemData(selected_index))->GetData(); m_SightList.DeleteObject(psight_to_delete); @@ -547,7 +548,7 @@ void CelestialNavigationDialog::OnDelete _("Celestial Navigation"), wxYES_NO); if(mdlg.ShowModal() == wxID_YES) { m_SightList.Clear(); - + UpdateSights(); RequestRefresh( GetParent() ); } @@ -571,7 +572,7 @@ void CelestialNavigationDialog::OnSightL wxPoint pos = event.GetPosition(); int flags = 0; long clicked_index = m_lSights->HitTest(pos, flags); - + // Clicking Visibility column? if (clicked_index > -1 && event.GetX() < m_lSights->GetColumnWidth(0)) { diff -Pdpru OpenCPN_Celestial_Navigation_pi.orig/src/celestial_navigation_pi.cpp OpenCPN_Celestial_Navigation_pi/src/celestial_navigation_pi.cpp --- OpenCPN_Celestial_Navigation_pi.orig/src/celestial_navigation_pi.cpp 2013-07-09 15:51:15.159539790 +0200 +++ OpenCPN_Celestial_Navigation_pi/src/celestial_navigation_pi.cpp 2013-05-03 15:47:26.352535161 +0200 @@ -31,7 +31,7 @@ #include "wx/wx.h" #endif //precompiled headers -#include "../../../include/ocpn_plugin.h" +#include <opencpn/ocpn_plugin.h> #include "Sight.h" #include "celestial_navigation_pi.h" @@ -197,7 +197,7 @@ bool celestial_navigation_pi::RenderOver bool celestial_navigation_pi::RenderGLOverlay(wxGLContext *pcontext, PlugIn_ViewPort *vp) { return RenderOverlayAll(NULL, vp); -} +} bool celestial_navigation_pi::RenderOverlayAll(wxDC *dc, PlugIn_ViewPort *vp) { @@ -211,7 +211,7 @@ bool celestial_navigation_pi::RenderOver Sight *pSightRender = node->GetData(); if ( pSightRender ) pSightRender->Render ( dc, *vp ); - + node = node->GetNext(); } diff -Pdpru OpenCPN_Celestial_Navigation_pi.orig/src/celestial_navigation_pi.h OpenCPN_Celestial_Navigation_pi/src/celestial_navigation_pi.h --- OpenCPN_Celestial_Navigation_pi.orig/src/celestial_navigation_pi.h 2013-07-09 15:51:15.159539790 +0200 +++ OpenCPN_Celestial_Navigation_pi/src/celestial_navigation_pi.h 2013-05-03 15:48:12.476538158 +0200 @@ -40,7 +40,7 @@ #define MY_API_VERSION_MINOR 8 -#include "../../../include/ocpn_plugin.h" +#include <opencpn/ocpn_plugin.h> #include "CelestialNavigationDialog.h" diff -Pdpru OpenCPN_Celestial_Navigation_pi.orig/src/FindBodyDialog.cpp OpenCPN_Celestial_Navigation_pi/src/FindBodyDialog.cpp --- OpenCPN_Celestial_Navigation_pi.orig/src/FindBodyDialog.cpp 2013-07-09 15:51:15.158539776 +0200 +++ OpenCPN_Celestial_Navigation_pi/src/FindBodyDialog.cpp 2013-05-03 15:47:06.944533898 +0200 @@ -43,7 +43,7 @@ #include "FindBodyDialog.h" -#include "../../../include/ocpn_plugin.h" +#include <opencpn/ocpn_plugin.h> #include "Sight.h" #include "celestial_navigation_pi.h" @@ -89,7 +89,7 @@ void FindBodyDialog::Update() double lat1, lon1, lat2, lon2, bearing, dist; m_tLatitude->GetValue().ToDouble(&lat1); m_tLongitude->GetValue().ToDouble(&lon1); - + m_Sight.BodyLocation(m_Sight.m_DateTime, &lat2, &lon2, 0, 0); ll_gc_ll_reverse(lat1, lon1, lat2, lon2, &bearing, &dist); @@ -98,13 +98,13 @@ void FindBodyDialog::Update() if(m_cbMagneticAzimuth->GetValue()) { double results[14]; - + geomag_calc(lat1, lon1, m_Sight.m_EyeHeight, m_Sight.m_DateTime.GetDay(), m_Sight.m_DateTime.GetMonth(), m_Sight.m_DateTime.GetYear(), results); bearing -= results[0]; } - + m_stAltitude->SetLabel(wxString::Format(_T("%f"), dist)); m_stAzimuth->SetLabel(wxString::Format(_T("%f"), bearing)); } diff -Pdpru OpenCPN_Celestial_Navigation_pi.orig/src/Sight.cpp OpenCPN_Celestial_Navigation_pi/src/Sight.cpp --- OpenCPN_Celestial_Navigation_pi.orig/src/Sight.cpp 2013-07-09 15:51:15.158539776 +0200 +++ OpenCPN_Celestial_Navigation_pi/src/Sight.cpp 2013-05-03 15:48:54.711540903 +0200 @@ -40,7 +40,7 @@ #include <wx/listimpl.cpp> -#include "../../../include/ocpn_plugin.h" +#include <opencpn/ocpn_plugin.h> #include "Sight.h" @@ -134,7 +134,7 @@ using namespace astrolabe::sun; using namespace astrolabe::util; using namespace astrolabe::vsop87d; -/* calculate what position the body for this sight is directly over at a given time */ +/* calculate what position the body for this sight is directly over at a given time */ void Sight::BodyLocation(wxDateTime time, double *lat, double *lon, double *ghaast, double *rad) { astrolabe::globals::vsop87d_text_path = (const char *)GetpSharedDataLocation()->mb_str(); @@ -144,13 +144,13 @@ void Sight::BodyLocation(wxDateTime time time.MakeFromUTC(); double jdu = time.GetJulianDayNumber(); // julian day dynamic - double jdd = ut_to_dt(jdu); - + double jdd = ut_to_dt(jdu); + double l, b, r; double ra, dec; // nutation in longitude const double deltaPsi = nut_in_lon(jdd); - + // apparent obliquity const double eps = obliquity(jdd) + nut_in_obl(jdd); @@ -173,12 +173,12 @@ void Sight::BodyLocation(wxDateTime time return; } - // correct vsop coordinates + // correct vsop coordinates vsop_to_fk5(jdd, l, b); - + // nutation in longitude l += deltaPsi; - + // aberration l += aberration_low(r); @@ -285,7 +285,7 @@ void Sight::BodyLocation(wxDateTime time double eoe = deltaPsi * cos(eps); double gast = gmst + eoe; ra = ra - gast; - + if(lat) *lat = r_to_d(dec); if(lon) @@ -449,25 +449,25 @@ void Sight::Render( wxDC *dc, PlugIn_Vie return; m_dc = dc; - + if(dc) { dc->SetPen ( wxPen(m_Colour, 1) ); dc->SetBrush ( wxBrush(m_Colour) ); } else { glColor4ub(m_Colour.Red(), m_Colour.Green(), m_Colour.Blue(), m_Colour.Alpha()); glPushAttrib(GL_COLOR_BUFFER_BIT | GL_POLYGON_BIT); //Save state - + glEnable(GL_POLYGON_SMOOTH); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); } - + std::list<wxRealPointList*>::iterator it = polygons.begin(); while(it != polygons.end()) { DrawPolygon(VP, **it); ++it; } - + if(!m_dc) glPopAttrib(); // restore state } @@ -510,7 +510,7 @@ void Sight::RebuildPolygons() } void Sight::RecomputeAltitude() -{ +{ m_CalcStr.clear(); m_CalcStr+=_("Formulas used to calculate sight\n\n"); @@ -605,7 +605,7 @@ ObservedAltitude = %.5f\n"), m_Measureme m_CalcStr+=wxString::Format(_("\nSun selected, parallax correction\n\ rad = %.3f, HP = 0.002442/rad = %.3f\n"), rad, HP); } - + /* earth radius: 6357 km distance to moon: 384400 km NOTE: could replace with a routine that finds the distance based on time */ @@ -670,7 +670,7 @@ HP = %.3f'\n\n"), lat, lon, } void Sight::RecomputeAzimuth() -{ +{ m_CalcStr.clear(); m_Measurement = resolve_heading_positive(m_Measurement); } @@ -698,8 +698,8 @@ void Sight::RebuildPolygonsAltitude() and trace angle */ wxRealPoint Sight::DistancePoint( double altitude, double trace, double lat, double lon) { - double rlat, rlon, y, x; - + double rlat, rlon, y, x; + double dang_r = d_to_r(90-altitude); double trace_r = d_to_r(trace); double lat_r = d_to_r(lat); @@ -710,13 +710,13 @@ wxRealPoint Sight::DistancePoint( double y = sin(trace_r)*sin(dang_r)*cos(lat_r); x = cos(dang_r)-sin(lat_r)*sin(rlat_r); rlon_r = lon_r + atan2(y,x); - + rlat = r_to_d(rlat_r); rlon = r_to_d(rlon_r); - + // ll_gc_ll(lat, lon, trace, 60*(90-altitude), // &rlat, &rlon); - + return wxRealPoint(rlat, rlon); } @@ -757,12 +757,12 @@ void Sight::RebuildPolygonsAzimuth() azimuthmin = m_Measurement - m_MeasurementCertainty; azimuthmax = m_Measurement + m_MeasurementCertainty; azimuthstep = ComputeStepSize(m_MeasurementCertainty, 1, azimuthmin, azimuthmax); - + double timemin, timemax, timestep; timemin = - m_TimeCertainty; timemax = + m_TimeCertainty; timestep = ComputeStepSize(m_TimeCertainty, 1, timemin, timemax); - + BuildBearingLineOfPosition(1, azimuthmin, azimuthmax, azimuthstep, timemin, timemax, timestep); } @@ -776,7 +776,7 @@ bool Sight::BearingPoint( double altitud double localbearing = bearing; localbearing = resolve_heading(localbearing); - + double rangle; double mdb = 1000; double mdl = 1001; @@ -785,7 +785,7 @@ bool Sight::BearingPoint( double altitud { lastlat = lat; lastlon = lon; - + /* apply magnetic correction to bearing */ if(m_bMagneticNorth) { double results[14]; @@ -803,7 +803,7 @@ bool Sight::BearingPoint( double altitud // ll_gc_ll(lat, lon, trace, 60*(90-altitude), &rlat, &rlon); // ll_gc_ll_reverse(rlat, rlon, lat, lon, &b, 0); mdl = mdb; - + double y, x, yy, xx; double dang_r = d_to_r(1.0); double trace_r = d_to_r(trace); @@ -822,7 +822,7 @@ bool Sight::BearingPoint( double altitud yy = sin(lon_r - rlon_r)*cos(lat_r); xx = cos(rlat_r)*sin(lat_r) - sin(rlat_r)*cos(lat_r)*cos(lon_r - rlon_r); backbearing_r = atan2(yy,xx); - + rlat = r_to_d(rlat_r); rlon = r_to_d(rlon_r); @@ -832,7 +832,7 @@ bool Sight::BearingPoint( double altitud rangle_r = acos(sin(lat_r)*sin(rlat_r)+cos(lat_r)*cos(rlat_r)*cos(rlon_r - lon_r)); rangle = r_to_d(rangle_r); - + /* apply magnetic correction to bearing */ if(m_bMagneticNorth) { double results[14]; @@ -848,7 +848,7 @@ bool Sight::BearingPoint( double altitud trace+=mdb; trace = resolve_heading(trace); - } + } return ((fabs(mdb)<.1)&&(fabs(rangle)<90.0)); } @@ -856,17 +856,17 @@ bool Sight::BearingPoint( double altitud void Sight::BuildBearingLineOfPosition(double altitudestep, double azimuthmin, double azimuthmax, double azimuthstep, double timemin, double timemax, double timestep) -{ +{ double lasttrace[100]; for (int i = 0; i < 100; i++) lasttrace[i]= 1000.0; - + double lastlat[100]; double lastlon[100]; double trace; - + double blat, blon; - + BodyLocation(m_DateTime, &blat, &blon, 0, 0); blon = resolve_heading(blon); @@ -878,7 +878,7 @@ void Sight::BuildBearingLineOfPosition(d wxRealPointList *p, *l = new wxRealPointList; l->Append(new wxRealPoint(blat, blon)); - for(double altitude=200; altitude>=0; altitude-=1) + for(double altitude=200; altitude>=0; altitude-=1) { if(m_bMagneticNorth) progressdialog.Update(200-altitude); @@ -899,7 +899,7 @@ void Sight::BuildBearingLineOfPosition(d lat = -90.0; { - p->Append(new wxRealPoint(lat, lon)); + p->Append(new wxRealPoint(lat, lon)); lasttrace[index] = trace; lastlat[index] = lat; @@ -910,7 +910,7 @@ void Sight::BuildBearingLineOfPosition(d } wxRealPointList *m = MergePoints(l, p); wxRealPointList *n = ReduceToConvexPolygon(m); - polygons.push_back(n); + polygons.push_back(n); m->DeleteContents(true); delete m; l->DeleteContents(true); diff -Pdpru OpenCPN_Celestial_Navigation_pi.orig/src/SightDialog.cpp OpenCPN_Celestial_Navigation_pi/src/SightDialog.cpp --- OpenCPN_Celestial_Navigation_pi.orig/src/SightDialog.cpp 2013-07-09 15:51:15.158539776 +0200 +++ OpenCPN_Celestial_Navigation_pi/src/SightDialog.cpp 2013-05-03 15:48:30.919539356 +0200 @@ -45,7 +45,7 @@ #include "wx/datetime.h" #include "wx/colordlg.h" -#include "../../../include/ocpn_plugin.h" +#include <opencpn/ocpn_plugin.h> #include "SightDialog.h" #include "FindBodyDialog.h" @@ -121,7 +121,7 @@ SightDialog::SightDialog( wxWindow* pare m_cBody->Append(_T("Shaula")); m_cBody->Append(_T("Vega")); m_cBody->Append(_T("Zubenelgenubi")); - + m_cBody->SetSelection(0); // SetColorScheme((ColorScheme)0); @@ -145,7 +145,7 @@ SightDialog::SightDialog( wxWindow* pare m_sHours->SetValue(m_Sight.m_DateTime.Format(_T("%H"))); m_sMinutes->SetValue(m_Sight.m_DateTime.Format(_T("%M"))); m_sSeconds->SetValue(m_Sight.m_DateTime.Format(_T("%S"))); - + m_sCertaintySeconds->SetValue(m_Sight.m_TimeCertainty); m_sTransparency->SetValue(m_Sight.m_Colour.Alpha());
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor