Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
rgleason committed Mar 1, 2019
2 parents cafe81f + 520f27c commit ad1b643
Show file tree
Hide file tree
Showing 9 changed files with 326 additions and 122 deletions.
9 changes: 3 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,13 @@ script:
- mkdir build && cd build
- if [[ "$TRAVIS_OS_NAME" == "linux" ]];
then
cmake -DCMAKE_BUILD_TYPE=Release ../;
make -sj2 package;
cmake -DCMAKE_BUILD_TYPE=Release ../ && make -sj2 package;
fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]];
then
cmake -DwxWidgets_CONFIG_EXECUTABLE=/tmp/wx312_opencpn50_macos109/bin/wx-config -DwxWidgets_CONFIG_OPTIONS="--prefix=/tmp/wx312_opencpn50_macos109" -DCMAKE_INSTALL_PREFIX=/tmp/opencpn -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 ..;
make -sj2;
make create-pkg;
ls -l;
cmake -DwxWidgets_CONFIG_EXECUTABLE=/tmp/wx312_opencpn50_macos109/bin/wx-config -DwxWidgets_CONFIG_OPTIONS="--prefix=/tmp/wx312_opencpn50_macos109" -DCMAKE_INSTALL_PREFIX=/tmp/opencpn -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 .. && make -sj2 && make create-pkg;
fi
- ls -l;

notifications:
email: false
Expand Down
19 changes: 19 additions & 0 deletions cmake/PluginConfigure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,25 @@ INCLUDE_DIRECTORIES(BEFORE ${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/s

# SET(PROFILING 1)

if (CMAKE_VERSION VERSION_LESS "3.1")
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
message(STATUS "Setting C++11 standard via CXX flags")
elseif(COMPILER_SUPPORTS_CXX0X)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
message(STATUS "Setting C++0x standard via CXX FLAGS")
else()
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
endif()
else ()
set (CMAKE_CXX_STANDARD 11)
message(STATUS "Setting C++11 standard via cmake standard mecahnism")
endif ()


# IF NOT DEBUGGING CFLAGS="-O2 -march=native"
IF(NOT MSVC)
ADD_DEFINITIONS( "-fvisibility=hidden" )
Expand Down
35 changes: 27 additions & 8 deletions src/RouteMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@

#define distance(X, Y) sqrt((X)*(X) + (Y)*(Y)) // much faster than hypot

long RouteMapPosition::s_ID = 0;

static double Swell(RouteMapConfiguration &configuration, double lat, double lon)
{
Expand Down Expand Up @@ -2385,16 +2386,34 @@ void IsoChron::ResetDrawnFlag()
bool RouteMapConfiguration::Update()
{
bool havestart = false, haveend = false;
for(std::list<RouteMapPosition>::iterator it = RouteMap::Positions.begin();
it != RouteMap::Positions.end(); it++) {
if(Start == (*it).Name) {
StartLat = (*it).lat;
StartLon = (*it).lon;
PlugIn_Waypoint waypoint;

if (!RouteGUID.IsEmpty()) {
havestart = true;
haveend = true;
}
else for(const auto &it : RouteMap::Positions ) {
if(Start == it.Name) {
double lat = it.lat;
double lon = it.lon;
if (!it.GUID.IsEmpty() && GetSingleWaypoint( it.GUID, &waypoint )) {
lat = waypoint.m_lat;
lon = waypoint.m_lon;
}
StartLat = lat;
StartLon = lon;

havestart = true;
}
if(End == (*it).Name) {
EndLat = (*it).lat;
EndLon = (*it).lon;
if(End == it.Name) {
double lat = it.lat;
double lon = it.lon;
if (!it.GUID.IsEmpty() && GetSingleWaypoint( it.GUID, &waypoint )) {
lat = waypoint.m_lat;
lon = waypoint.m_lon;
}
EndLat = lat;
EndLon = lon;
haveend = true;
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/RouteMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,11 +280,13 @@ typedef std::list<IsoChron*> IsoChronList;

struct RouteMapPosition {
RouteMapPosition(wxString n, double lat0, double lon0, wxString guid = wxEmptyString)
: Name(n), GUID(guid), lat(lat0), lon(lon0) {}
: Name(n), GUID(guid), lat(lat0), lon(lon0) {ID = ++s_ID;}

wxString Name;
wxString GUID;
double lat, lon;
long ID;
static long s_ID;
};

struct RouteMapConfiguration {
Expand Down
Loading

0 comments on commit ad1b643

Please # to comment.