albar965 / littlenavmap

Little Navmap is a free flight planner, navigation tool, moving map, airport search and airport information system for Flight Simulator X, Microsoft Flight Simulator 2020, Prepar3D and X-Plane.
https://albar965.github.io/littlenavmap.html
GNU General Public License v3.0
1.23k stars 161 forks source link

Feature/rfg performance #1144

Closed u-an-i closed 3 weeks ago

u-an-i commented 3 weeks ago

see code review for notes

u-an-i commented 3 weeks ago

@albar965 not tested. but deeply thought about.

If it does not compile for you or does not run for you, I'll set up my environment.

The performance boost should be a factor at least around number of threads Qt finds ideal.

albar965 commented 3 weeks ago

Search again stopped working. Progress pops up and nothing happens.

u-an-i commented 3 weeks ago

I'll start setting up my env !_

albar965 commented 3 weeks ago

I can send you some needed packages, scripts and whatever. Windows or Linux?

u-an-i commented 3 weeks ago

Windows, marble build is currently already running

albar965 commented 3 weeks ago

Ok. :+1:

u-an-i commented 3 weeks ago

error at 35 % of C:\Zusatz\GitHub\build-marble-release>mingw32-make -j2

In file included from C:/Zusatz/Qt/5.15.2/mingw81_64/include/QtCore/qglobal.h:1304,
                 from C:/Zusatz/Qt/5.15.2/mingw81_64/include/QtCore/QtGlobal:1,
                 from C:\Zusatz\GitHub\marble\src\lib\marble\graphicsview\MarbleGraphicsItem.h:16,
                 from C:\Zusatz\GitHub\marble\src\lib\marble\graphicsview\ScreenGraphicsItem.h:15,
                 from C:\Zusatz\GitHub\marble\src\lib\marble\graphicsview\FrameGraphicsItem.h:16,
                 from C:\Zusatz\GitHub\marble\src\lib\marble\graphicsview\FrameGraphicsItem.cpp:12:
C:/Zusatz/Qt/5.15.2/mingw81_64/include/QtCore/qflags.h:123:80: note: declared here
     QT_DEPRECATED_X("Use default constructor instead") Q_DECL_CONSTEXPR inline QFlags(Zero) noexcept : i(0) {}
                                                                                ^~~~~~
C:\Zusatz\GitHub\marble\src\lib\marble\graphicsview\FrameGraphicsItem.cpp: At global scope:
C:\Zusatz\GitHub\marble\src\lib\marble\graphicsview\FrameGraphicsItem.cpp:239:51: error: return type 'class QPainterPat ' is incomplete
 QPainterPath FrameGraphicsItem::backgroundShape() const
                                                   ^~~~~
C:\Zusatz\GitHub\marble\src\lib\marble\graphicsview\FrameGraphicsItem.cpp: In member function 'virtual void Marble::FrameGraphicsItem::backgroundShape() const':
C:\Zusatz\GitHub\marble\src\lib\marble\graphicsview\FrameGraphicsItem.cpp:242:18: error: aggregate 'QPainterPath path' has incomplete type and cannot be defined
     QPainterPath path;
                  ^~~~
C:\Zusatz\GitHub\marble\src\lib\marble\graphicsview\FrameGraphicsItem.cpp: In member function 'virtual void Marble::FrameGraphicsItem::paintBackground(QPainter*)':
C:\Zusatz\GitHub\marble\src\lib\marble\graphicsview\FrameGraphicsItem.cpp:261:42: error: invalid use of void expression
     painter->drawPath( backgroundShape() );

Marble build adapted from https://github.com/albar965/littlenavmap/wiki/Compiling

albar965 commented 3 weeks ago

Use either of marble/build/win/build_debug_32.cmd, marble/build/win/build_debug_64.cmd, marble/build/win/build_release_32.cmd or marble/build/win/build_release_64.cmd.

You need to set the environment variable APROJECTS to the folder containing atools, marble and littlenavmap.

albar965 commented 3 weeks ago

Better use Qt Creator to build atools and littlenavmap. The scripts in 'littlenavmap/build/win' are special and need the Inno Setup and stuff.

u-an-i commented 3 weeks ago

👍 how do i solve the marble build issue?

albar965 commented 3 weeks ago

👍 how do i solve the marble build issue?

Use the scripts I mentioned above and the branch lnm/1.1.

u-an-i commented 3 weeks ago

a, sorry, I switched to lnm/1.1 on GitHub and set to open GitHub Desktop. I thought it checked out that branch. It didn't. :( Now I'm on it.

albar965 commented 3 weeks ago

Perfect. :slightly_smiling_face:

u-an-i commented 3 weeks ago

build (and deployed) marble and atools successfully.

lnm release build: :-1: Fehler: No rule to make target 'C:/Zusatz/GitHub/littlenavmap/../build-atools-release/libatools.a', needed by 'littlenavmap.exe'. Stop.

albar965 commented 3 weeks ago

Check out atools release/4.0 to the same folder %APROJECTS (C:/Zusatz/GitHub in your case) and build it before.

Sorry, I plan to update the build instructions for a long time already.

u-an-i commented 3 weeks ago

I did and it build succesfully -- I thought. The build ends "green" in Qt Creator. But it produces no folder on the APROJETCS level: image

u-an-i commented 3 weeks ago

this folder was created C:\Zusatz\GitHub\atools\build\Desktop_Qt_5_15_2_MinGW_64_bit-Release image

albar965 commented 3 weeks ago

make deploy in Qt Creator creates the folder.

image

image

u-an-i commented 3 weeks ago

ah :) image

albar965 commented 3 weeks ago

image

albar965 commented 3 weeks ago

Better for copy and paste ../build-%{Project:Name}-%{CurrentBuild:Type}

u-an-i commented 3 weeks ago

:)

u-an-i commented 3 weeks ago

progress :) .

now:

image

environment is this:

image

because has lib and include:

image

but this also exists :

image

u-an-i commented 3 weeks ago

got it, must remove the marble subfolder from include path

albar965 commented 3 weeks ago

You need these too:

openssl-1.1.1w-win64.zip openssl-1.1.1w-win32.zip

albar965 commented 3 weeks ago

And: X-Plane SDK.zip MSFS SDK.zip

Extract all as is with subfolders into %APROJECTS

u-an-i commented 3 weeks ago

i thank you !

what is the final command to create the exe and distributable folders ?

image

albar965 commented 3 weeks ago

mingw32-make.exe deploy. See screenshot of my run configuration above.

u-an-i commented 3 weeks ago

thx,

image

albar965 commented 3 weeks ago

Extract the files I attached above to APROJECTS. This is https://github.com/albar965/littlenavmap/pull/1144#issuecomment-2152913992 and https://github.com/albar965/littlenavmap/pull/1144#issuecomment-2152918752

You probably have to create a symbolic link to the SSL folders or rename them.

u-an-i commented 3 weeks ago
&& del /f /q "C:\Zusatz\GitHub\littlenavmap\..\deploy\Little Navmap win64\simconnect\simconnect.manifest" && xcopy \lib\SimConnect.dll "C:\Zusatz\GitHub\littlenavmap\..\deploy\Little Navmap win64" && xcopy C:\Zusatz\GitHub\marble-release-win64\lib\\..\libmarblewidget-qt5.dll 

\lib\SimConnect.dll

u-an-i commented 3 weeks ago

I did, I think it's the \lib\SimConnect.dll src

u-an-i commented 3 weeks ago

what's the correct src ?

u-an-i commented 3 weeks ago

a SimConnect.dll was already copied

u-an-i commented 3 weeks ago

thank you for your attention !

albar965 commented 3 weeks ago

I just see that the Simconnect.dll is included in the repo. Should work.

u-an-i commented 3 weeks ago

works now ! :)

I deleted xcopy \lib\SimConnect.dll "C:\Zusatz\GitHub\littlenavmap\..\deploy\Little Navmap win64"

u-an-i commented 3 weeks ago

https://github.com/albar965/littlenavmap/assets/84718885/5b4e329f-2b65-4fc3-a4a1-7c2cfa4a95b0

Retry works for me.

Max Distance is not honored.

Destination airport uses Departure as Destination.

I investigate.

u-an-i commented 3 weeks ago

found everything, fixed everything, everything works,

can you delete a few characters from the Windows makefile generation: delete && xcopy \lib\SimConnect.dll "C:\Zusatz\GitHub\littlenavmap\..\deploy\Little Navmap win64" on line 1455 ?

benchmarks soon

https://github.com/albar965/littlenavmap/pull/1145

@albar965

u-an-i commented 3 weeks ago

the current RGF max distance value is somewhere around 20 000 NM.

just occurred to me: half the earths circumference is only around 11 000 NM.

The distance calculation cannot deliver values > that I guess.

u-an-i commented 3 weeks ago

For "search again" we might want to reuse the old dataset to continue search in order to not find the same match again.

u-an-i commented 3 weeks ago

benchmarks don't deliver: both versions find > 10 000 NM matches almost instantly.

albar965 commented 3 weeks ago

just occurred to me: half the earths circumference is only around 11 000 NM.

Max is 10800 NM. The measurement line wraps around the globe if you try to make longer lines. The max "distance from mark" is limited to 8000 NM.

can you delete a few characters from the Windows makefile generation: delete && xcopy \lib\SimConnect.dll "C:\Zusatz\GitHub\littlenavmap\..\deploy\Little Navmap win64" on line 1455 ?

I include the MSFS SDK SimConnect in the 64 bit build and load it dynamically on runtime. Did you install the SDK and/or adjust the env variable SIMCONNECT_PATH_WIN64?

I can adjust the lines to copy only if the file is present.

Benchmark not needed. It was already fast in the debug build. :+1:

u-an-i commented 3 weeks ago

:)

here i can enter up to 20 500 NM

image

I used your SDK link and set the env variable. SimConnect.dll is already copied in a xcopy command prior. The /lib/SimConnect.dll command argument looks like a remnant from adjusting Linux paths. I always had to delete it in the makefile to deploy successfull.y

albar965 commented 3 weeks ago

here i can enter up to 20 500 NM

I can change it to the max. The Great Circle distance calculation will never return longer than 10800 NM.

I used your SDK link and set the env variable. SimConnect.dll is already copied in a xcopy command prior. The /lib/SimConnect.dll command argument looks like a remnant from adjusting Linux paths. I always had to delete it in the makefile to deploy successfull.y

Ok. I'll have a look. Maybe some historical stuff left in.