Skip to content

Commit

Permalink
Merge pull request #559 from jongough/updates
Browse files Browse the repository at this point in the history
Updates
  • Loading branch information
jongough authored Oct 19, 2024
2 parents d01f18d + daefc42 commit 856211f
Show file tree
Hide file tree
Showing 8 changed files with 99 additions and 68 deletions.
75 changes: 44 additions & 31 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ workflows:
<<: *std-filters
- build-flatpak-x86-2208:
<<: *std-filters
- build-flatpak-arm64-2408:
<<: *std-filters
- build-flatpak-x86-2408:
<<: *std-filters
- build-msvc-wx32-2022:
<<: *std-filters
- build-debian-arm64-12-bookworm:
Expand Down Expand Up @@ -66,13 +70,6 @@ workflows:
- build-msvc-2022:
<<: *std-filters

## -------------------------------------
## UBUNTU OS Frozen - 28/05/2023 DROP
## -------------------------------------
## KEEP needed for Raspbian OpenCPN v5.6
# - build-ubuntu-armhf-1804-buster:
# <<: *std-filters

orbs:
cloudsmith: cloudsmith/[email protected]
win: circleci/[email protected]
Expand Down Expand Up @@ -142,7 +139,7 @@ jobs:
install_python: true
build-macos-wx32:
macos:
xcode: "13.4"
xcode: "14.2"
environment:
- OCPN_TARGET: macos
- CLOUDSMITH_PKG_EXT: pkg
Expand All @@ -154,9 +151,10 @@ jobs:
- run: bash ci/circleci-build-macos.sh
- deploy-code:
deploy_use_orb: false
install_python: false
build-macos-universal:
macos:
xcode: "13.4"
xcode: "14.2"
environment:
OCPN_TARGET: macos
CMAKE_BUILD_PARALLEL_LEVEL: 2
Expand Down Expand Up @@ -186,6 +184,7 @@ jobs:
sh -c "cat build/*.xml"
- deploy-code:
deploy_use_orb: false
install_python: false
build-msvc-wx32-2022:
executor:
name: win/server-2022
Expand Down Expand Up @@ -236,6 +235,39 @@ jobs:
command: bash ci/circleci-build-flatpak.sh
no_output_timeout: 30m
- deploy-code
build-flatpak-arm64-2408:
machine:
image: ubuntu-2204:current
resource_class: arm.medium
environment:
- OCPN_TARGET: flatpak-arm64
- FLATPAK_BRANCH: stable
- CLOUDSMITH_PKG_EXT: gz
- SDK_VER: 24.08
- DEPLOY_USE_ORB: true
steps:
- checkout
- run: chmod a+x ci/*.sh
- run:
command: bash ci/circleci-build-flatpak.sh
- deploy-code
build-flatpak-x86-2408:
machine:
image: ubuntu-2204:current
resource_class: arm.medium
environment:
- OCPN_TARGET: flatpak
- FLATPAK_BRANCH: stable
- CLOUDSMITH_PKG_EXT: gz
- SDK_VER: 24.08
- DEPLOY_USE_ORB: true
steps:
- checkout
- run: chmod a+x ci/*.sh
- run:
command: bash ci/circleci-build-flatpak.sh
no_output_timeout: 30m
- deploy-code
build-debian-arm64-12-bookworm:
machine:
image: ubuntu-2204:current
Expand Down Expand Up @@ -375,7 +407,7 @@ jobs:
## ---------------------
build-macos:
macos:
xcode: "13.4"
xcode: "14.2"
environment:
- OCPN_TARGET: macos
- CLOUDSMITH_PKG_EXT: pkg
Expand All @@ -387,6 +419,7 @@ jobs:
- run: bash ci/circleci-build-macos.sh
- deploy-code:
deploy_use_orb: false
install_python: false

## Appveyor doesn't build for Windows now.
## If below is used, WinXT will not work.
Expand All @@ -408,24 +441,4 @@ jobs:
- deploy-code:
deploy_use_orb: false

## -------------------------------------------
## Ubuntu OS - Generally deprecated and not used.
## -------------------------------------------
## KEEP needed for Raspbian OpenCPN v5.6
build-ubuntu-armhf-1804-buster:
machine:
image: ubuntu-2204:current
resource_class: arm.medium
environment:
- OCPN_TARGET=buster-armhf
- DOCKER_IMAGE=jongough/ubuntu-armhf:18.04
- BUILD_FLAGS=-j3
- BUILD_ENV=ubuntu
- DEPLOY_USE_ORB: true
steps:
- checkout
- run: chmod a+x ./ci/*.sh
- run:
command: ci/circleci-build-ubuntu-docker.sh
no_output_timeout: 30m
- deploy-code

8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# - xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,
# - xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# -----------------------------------------------------------------------------
# Frontend2 Author: Jon Gough Testplugn(TP) v1.0.303.0 19/09/2024 DD/MM/YYYY
# Frontend2 Author: Jon Gough Testplugn(TP) v1.0.310.0 15/10/2024 DD/MM/YYYY
# format buildCI:yes provideODAPI:yes validateJSON:yes
# ---------------------------------------------------------------------------
# -- When changing this file do NOT change the order of the sections. -- Make
Expand Down Expand Up @@ -60,9 +60,9 @@ set(PACKAGE "ocpn_draw")

set(VERSION_MAJOR "1")
set(VERSION_MINOR "8")
set(VERSION_PATCH "52")
set(VERSION_PATCH "55")
set(VERSION_TWEAK "0")
set(VERSION_DATE "19/09/2024") # DD/MM/YYYY format
set(VERSION_DATE "20/10/2024") # DD/MM/YYYY format
set(OCPN_MIN_VERSION "ov50")
set(OCPN_API_VERSION_MAJOR "1")
set(OCPN_API_VERSION_MINOR "17")
Expand Down Expand Up @@ -401,7 +401,7 @@ if (NOT OCPN_FLATPAK_CONFIG)
add_subdirectory(libs/gdal)
target_link_libraries(${PACKAGE_NAME} ocpn::gdal)

add_subdirectory(opencpn-libs/api-17)
add_subdirectory(opencpn-libs/api-18)
target_link_libraries(${PACKAGE_NAME} ocpn::api)

add_subdirectory(opencpn-libs/tinyxml)
Expand Down
8 changes: 6 additions & 2 deletions cmake/PluginConfigure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,10 @@ if (NOT SKIP_VERSION_CONFIG)
endif (NOT SKIP_VERSION_CONFIG)

# configure xml file for circleci
message(STATUS "${CMLOC}ENV BUILD_GTK2: $ENV{BUILD_GTK2}")
string(TOUPPER "$ENV{BUILD_GTK2}" BUILD_GTK2_TEMP)
set(ENV{BUILD_GTK2} ${BUILD_GTK2_TEMP})
unset(BUILD_GTK2_TEMP)

message(STATUS "${CMLOC}ENV BUILD_GTK3: $ENV{BUILD_GTK3}")
string(TOUPPER "$ENV{BUILD_GTK3}" BUILD_GTK3_TEMP)
Expand Down Expand Up @@ -266,8 +270,8 @@ if (NOT WIN32
AND NOT APPLE
AND NOT QT_ANDROID
)
if(OD_FORCE_GTK2)
find_package(GTK2)
if(BUILD_GTK2)
find_package(GTK2)
endif()

if (GTK2_FOUND AND NOT "$ENV{BUILD_GTK3}" STREQUAL "TRUE")
Expand Down
26 changes: 14 additions & 12 deletions cmake/in-files/cloudsmith-upload.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,22 @@ if [ "$CIRCLECI" ] || [ "$TRAVIS" ]; then
if pyenv versions 2>&1 >/dev/null; then
pyenv versions
if ! pyenv global 3.11.3 2>&1 >/dev/null; then
if ! pyenv global 3.9.1 2>&1 >/dev/null; then
if ! pyenv global 3.8.6 2>&1 >/dev/null; then
if ! pyenv global 3.7.1 2>&1 >/dev/null; then
if ! pyenv global 3.7.0 2>&1>/dev/null; then
if ! pyenv global 3.5.2 2>&1>/dev/null; then
sudo apt install software-properties-common
sudo apt update
sudo apt install -y python3.8 python3-pip
sudo rm /usr/bin/python3
sudo ln -s /usr/bin/python3.8 /usr/bin/python3
if ! pyenv global 3.11.0 2>&1 >/dev/null; then
if ! pyenv global 3.9.1 2>&1 >/dev/null; then
if ! pyenv global 3.8.6 2>&1 >/dev/null; then
if ! pyenv global 3.7.1 2>&1 >/dev/null; then
if ! pyenv global 3.7.0 2>&1>/dev/null; then
if ! pyenv global 3.5.2 2>&1>/dev/null; then
sudo apt install software-properties-common
sudo apt update
sudo apt install -y python3.8 python3-pip
sudo rm /usr/bin/python3
sudo ln -s /usr/bin/python3.8 /usr/bin/python3
fi
fi
fi
fi
fi
fi
fi
fi
fi
python3 --version
Expand Down
1 change: 1 addition & 0 deletions include/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class ODJSON;
class ODPlugIn_Position_Fix_Ex;
class ODAPI;
class piDC;
class ODicons;

class PlugIn_ViewPort;

Expand Down
2 changes: 1 addition & 1 deletion opencpn-libs
6 changes: 6 additions & 0 deletions src/ODicons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ void ODicons::initialize_images(void)

m_failedBitmapLoad = false;

// Reload scaling constants to pick up global changes
// and local config file
m_iToolScaleFactor = GetOCPNGUIToolScaleFactor_PlugIn();
m_iToolIconScaleFactor = g_IconDisplayScaleFactor * m_iToolScaleFactor;
m_iToolIconRefSize = g_IconDisplayScaleFactor * m_iToolScaleFactor;

#ifdef ODraw_USE_MUI
m_FileName.SetFullName(wxT("ODManager_MUI.svg"));
m_s_ocpn_draw_pi = m_FileName.GetFullPath();
Expand Down
41 changes: 23 additions & 18 deletions src/ocpn_draw_pi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,13 +419,16 @@ ocpn_draw_pi::ocpn_draw_pi(void *ppimgr)
g_pLayerDir->Append( wxT("Layers") );
appendOSDirSlash( g_pLayerDir );

m_pODicons = NULL;
m_pODicons = new ODicons();
m_pODicons->initialize_images();

m_bRecreateConfig = false;
}

ocpn_draw_pi::~ocpn_draw_pi()
{
delete m_pODicons;
m_pODicons = NULL;
#ifdef __WXMSW__
#ifdef _DEBUG
// Only turn on if memory leaks suspected. Slows down shutdown when debugging
Expand Down Expand Up @@ -522,10 +525,10 @@ int ocpn_draw_pi::Init(void)
wxString sChangesFile = g_pODConfig->m_sODNavObjSetChangesFile;
// g_pODConfig->m_pODNavObjectChangesSet = new ODNavObjectChanges( sChangesFile );

if (m_pODicons == NULL)
m_pODicons = new ODicons();

LoadConfig();

m_pODicons->initialize_images();

g_pODConfig->LateInit();

g_pODSelect = new ODSelect();
Expand All @@ -541,8 +544,6 @@ int ocpn_draw_pi::Init(void)
// Layers
g_pLayerList = new ODLayerList;

m_pODicons->initialize_images();

if(m_bLOGShowIcon) {
#ifdef ODraw_USE_SVG
m_config_button_id = InsertPlugInToolSVG(_("OCPN Draw Manager"), m_pODicons->m_s_ocpn_draw_pi, m_pODicons->m_s_ocpn_draw_pi, m_pODicons->m_s_ocpn_draw_grey_pi, wxITEM_CHECK,
Expand Down Expand Up @@ -640,16 +641,19 @@ int ocpn_draw_pi::Init(void)
#else
g_pODToolbar = new ODToolbarImpl( m_parent_window, wxID_ANY, _("Draw Toolbar"), wxDefaultPosition, wxDefaultSize, wxCAPTION|wxCLOSE_BOX|wxRESIZE_BORDER );
#endif
wxPoint wxpToolbarPos;
wxpToolbarPos.x = g_iToolbarPosX;
wxpToolbarPos.y = g_iToolbarPosY;
g_pODToolbar->SetPosition( wxpToolbarPos );
if( g_iToolbarPosX == 0 && g_iToolbarPosY == 0 )
g_pODToolbar->CenterOnParent();
else {
wxPoint wxpToolbarPos;
wxpToolbarPos.x = g_iToolbarPosX;
wxpToolbarPos.y = g_iToolbarPosY;
g_pODToolbar->SetPosition( wxpToolbarPos );
}
g_pODToolbar->SetToolbarFont();
g_pODToolbar->Fit();
g_pODToolbar->SetInitialSize();
g_pODToolbar->Bind(wxEVT_MENU, &ODToolbarImpl::OnToolButtonClick, g_pODToolbar);
//g_pODToolbar->SetMaxSize(g_pODToolbar->GetSize());
if( g_iToolbarPosX == 0 && g_iToolbarPosY == 0 ) g_pODToolbar->CenterOnParent();
if( g_iDisplayToolbar == ID_DISPLAY_ALWAYS ) g_pODToolbar->Show();

// TODO fix up undo
Expand Down Expand Up @@ -869,12 +873,10 @@ bool ocpn_draw_pi::DeInit(void)

if( g_pODToolbar ) {
g_pODToolbar->Unbind(wxEVT_MENU, &ODToolbarImpl::OnToolButtonClick, g_pODToolbar);
DeleteWindow((wxWindow**)&g_pODToolbar);
delete g_pODToolbar;
g_pODToolbar = NULL;
}

delete m_pODicons;
m_pODicons = NULL;

if( g_ODEventHandler ) {
if(g_ODEventHandler->GetEvtHandlerEnabled())
g_ODEventHandler->SetEvtHandlerEnabled(false);
Expand Down Expand Up @@ -1081,14 +1083,17 @@ void ocpn_draw_pi::SetDefaults(void)
{

}

wxBitmap *ocpn_draw_pi::GetPlugInBitmap()
{
return m_pODicons->m_p_bm_ocpn_draw_pi_properties;
}

int ocpn_draw_pi::GetToolbarToolCount(void)
{
return 1;
}

void ocpn_draw_pi::ShowPreferencesDialog( wxWindow* parent )
{
wxFont *l_dialogFont = GetOCPNScaledFont_PlugIn(wxS("Dialog"), 0);
Expand Down Expand Up @@ -3225,7 +3230,7 @@ bool ocpn_draw_pi::RenderGLOverlays(wxGLContext *pcontext, PlugIn_ViewPort *pivp
m_chart_scale = pivp->chart_scale;
m_view_scale = pivp->view_scale_ppm;

g_pDC = new piDC();
g_pDC = new piDC(pcontext);
g_pDC->SetVP(pivp);

LLBBox llbb;
Expand Down Expand Up @@ -3433,7 +3438,7 @@ wxString ocpn_draw_pi::CreateExtraPathLegInfo(piDC &dc, ODPath *path, double brg
pathInfo << wxString::Format( wxString("From: %03d \u00B0, To: %03d \u00B0\n Dist:", wxConvUTF8 ), EBLbrgFrom, EBLbrgTo );
} else {
if( g_bShowMag )
pathInfo << wxString::Format( wxString("%03d\u00B0(M) ", wxConvUTF8 ), (int)GetTrueOrMag( brg ) );
pathInfo << wxString::Format( wxString("%03d\u00B0(M) ", wxConvUTF8 ), (int)GetTrueOrMag( brg ) );
else
pathInfo << wxString::Format( wxString("%03d \u00B0 ", wxConvUTF8 ), (int)GetTrueOrMag( brg ) );
}
Expand Down Expand Up @@ -3822,7 +3827,7 @@ bool ocpn_draw_pi::CreateBoundaryLeftClick( wxMouseEvent &event )
r_rband.y = g_cursor_y;
m_dStartLat = m_cursor_lat;
m_dStartLon = m_cursor_lon;
//m_drawing_canvas_index = m_mouse_canvas_index;
m_drawing_canvas_index = m_mouse_canvas_index;
}

if(m_drawing_canvas_index != m_mouse_canvas_index) return false;
Expand Down

0 comments on commit 856211f

Please sign in to comment.