Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSFS native support #266

Open
wants to merge 36 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
6a542d0
Added MSFS icon
emiro85 Nov 15, 2021
d5022c7
Added MSFS simulator info
emiro85 Dec 10, 2021
b05da07
Added MSFS type across BlackMisc
emiro85 Dec 10, 2021
752cb41
Let MSFS no longer pretend to be FSX
emiro85 Dec 10, 2021
5ea081f
Added MSFS type across BlackGui
emiro85 Dec 10, 2021
2592621
Fix clearing the FG cache in swiftdata
emiro85 Dec 10, 2021
b1322b4
[FSD] Reuse FSX Simtype for MSFS
emiro85 Dec 10, 2021
b81a3fd
Add isCompiledWithMSFSSupport
emiro85 Dec 10, 2021
478ff62
[MSFS] Read out transponder mode
ltoenning Dec 22, 2021
0d0867e
Fix warnings
ltoenning Dec 24, 2021
44d0f3f
TEMP
ltoenning Dec 16, 2022
4347288
Merge remote-tracking branch 'origin/feature/msfs_native_support_rebase'
tzobler Feb 24, 2024
809eae6
Access to the datastore with msfs separation
tzobler Feb 25, 2024
8b74530
clang-format
tzobler Feb 25, 2024
7b5171d
no mistakes. Good for testing
tzobler Feb 25, 2024
33abf3a
some changes from main were adopted
tzobler Feb 26, 2024
0aef5c2
build.py original again
tzobler Feb 26, 2024
94e8033
clang-formating
tzobler Feb 26, 2024
bb6c2e6
clang part 2
tzobler Feb 26, 2024
6f0ceb1
adjustments for pull request
tzobler Feb 28, 2024
4948ae0
Search of aircraft.cfg adapted for MSFS
tzobler Mar 8, 2024
a96090c
"Saved settings" message added when saving distributor selection
tzobler Mar 8, 2024
9e2b4c5
Replace incorrect copyright
tzobler Mar 8, 2024
5908bdb
Update src/blackconfig/buildconfig_gen.inc.in
tzobler Mar 10, 2024
736813f
Update src/blackgui/components/dblogincomponent.ui
tzobler Mar 10, 2024
97aafba
copyright corrected
tzobler Mar 11, 2024
db57d81
First changes from Lars' review completed
tzobler Mar 11, 2024
e01022d
Adjusting window size swiftdata
tzobler Mar 28, 2024
f5f8519
Update src/blackcore/fsd/fsdclient.cpp
tzobler Mar 28, 2024
34ea38f
Implemented further changes from the review
tzobler Mar 28, 2024
b7cf85a
Merge branch 'msfs_retry' of https://github.com/swift-project/pilotcl…
tzobler Mar 28, 2024
eb430f4
clang_format
tzobler Mar 28, 2024
944e90a
Undo data update
ltoenning Apr 27, 2024
bfd3b70
Undo accidental changes
ltoenning Apr 27, 2024
34b973e
[skip ci] Refactor MSFS changes
ltoenning Apr 27, 2024
819cf83
[skip ci] fixup! Undo accidental changes
ltoenning Apr 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
148 changes: 74 additions & 74 deletions resources/share/shared/bootstrap/bootstrap.json
tzobler marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,76 +1,76 @@
{
"crashReportServerUrl": {
"url": "http://swift-project.sp.backtrace.io:6097/"
},
"dbDebugFlag": false,
"dbHttpPort": 80,
"dbHttpsPort": 443,
"dbRootDirectoryUrl": {
"url": "https://datastore.swift-project.org/"
},
"mappingMinimumVersion": "0.9.0",
"ncepGlobalForecastSystemUrl": {
"url": "http://nomads.ncep.noaa.gov/cgi-bin/filter_gfs_0p50.pl"
},
"ncepGlobalForecastSystemUrl25": {
"url": "http://nomads.ncep.noaa.gov/cgi-bin/filter_gfs_0p25.pl"
},
"onlineHelpUrls": {
"containerbase": [
{
"url": "https://datastore.swift-project.org/page/swifthelpdispatcher.html"
}
]
},
"pingIntervalSecs": 180,
"predefinedServers": {
"containerbase": [
]
},
"sharedUrls": {
"containerbase": [
{
"url": "http://download.swift-project.org/shared/"
}
]
},
"vatsimDataFileUrls": {
"containerbase": [
{
"url": "https://data.vatsim.net/v3/vatsim-data.json"
}
]
},
"vatsimServerFileUrl": {
"url": "https://data.vatsim.net/v3/vatsim-servers.json"
},
"vatsimFsdHttpUrl": {
"url": "http://fsd.vatsim.net"
},
"vatsimMetarsUrls": {
"containerbase": [
{
"url": "http://metar.vatsim.net/metar.php"
}
]
},
"vatsimStatusFileUrls": {
"containerbase": [
{
"url": "https://status.vatsim.net"
}
]
},
"comNavEquipmentHelpUrl": {
"url": "https://en.wikipedia.org/wiki/Equipment_codes#Radio_communication,_navigation_and_approach_aid_equipment_and_capabilities"
},
"ssrEquipmentHelpUrl": {
"url": "https://en.wikipedia.org/wiki/Equipment_codes#Surveillance_equipment_codes"
},
"afvApiServerUrl": {
"url": "https://voice1.vatsim.net/"
},
"afvMapUrl": {
"url": "https://afv-map.vatsim.net/"
}
"crashReportServerUrl": {
"url": "http://swift-project.sp.backtrace.io:6097/"
},
"dbDebugFlag": false,
"dbHttpPort": 80,
"dbHttpsPort": 443,
"dbRootDirectoryUrl": {
"url": "https://datastore.swift-project.org/"
},
"mappingMinimumVersion": "0.9.0",
"ncepGlobalForecastSystemUrl": {
"url": "http://nomads.ncep.noaa.gov/cgi-bin/filter_gfs_0p50.pl"
},
"ncepGlobalForecastSystemUrl25": {
"url": "http://nomads.ncep.noaa.gov/cgi-bin/filter_gfs_0p25.pl"
},
"onlineHelpUrls": {
"containerbase": [
{
"url": "https://datastore.swift-project.org/page/swifthelpdispatcher.html"
}
]
},
"pingIntervalSecs": 180,
"predefinedServers": {
"containerbase": [
]
},
"sharedUrls": {
"containerbase": [
{
"url": "http://download.swift-project.org/shared/"
}
]
},
"vatsimDataFileUrls": {
"containerbase": [
{
"url": "https://data.vatsim.net/v3/vatsim-data.json"
}
]
},
"vatsimServerFileUrl": {
"url": "https://data.vatsim.net/v3/vatsim-servers.json"
},
"vatsimFsdHttpUrl": {
"url": "http://fsd.vatsim.net"
},
"vatsimMetarsUrls": {
"containerbase": [
{
"url": "http://metar.vatsim.net/metar.php"
}
]
},
"vatsimStatusFileUrls": {
"containerbase": [
{
"url": "https://status.vatsim.net"
}
]
},
"comNavEquipmentHelpUrl": {
"url": "https://en.wikipedia.org/wiki/Equipment_codes#Radio_communication,_navigation_and_approach_aid_equipment_and_capabilities"
},
"ssrEquipmentHelpUrl": {
"url": "https://en.wikipedia.org/wiki/Equipment_codes#Surveillance_equipment_codes"
},
"afvApiServerUrl": {
"url": "https://voice1.vatsim.net/"
},
"afvMapUrl": {
"url": "https://afv-map.vatsim.net/"
}
}
3 changes: 3 additions & 0 deletions src/blackconfig/buildconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ namespace BlackConfig
//! with FG support?
static constexpr bool isCompiledWithFGSupport(); // defined in buildconfig_gen.inc.in

//! with MSFS support?
static constexpr bool isCompiledWithMSFSSupport(); // defined in buildconfig_gen.inc.in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More a general thing: should we rename MSFS internally to MSFS2020 or something similar? Otherwise it gets confusing because we already use "MsFlightSimulator" (which could also be abbreviated as MSFS) at other place. And how would we call it when MSFS 2024 will be released 😉

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest MSFS20 and later MSFS24. Agreed?


//! with FSUIPC support?
static constexpr bool isCompiledWithFsuipcSupport(); // defined in buildconfig_gen.inc.in

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should MSFS 2020 also be added to the method on line 48 (isCompiledWithMsFlightSimulatorSupport()?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I'll upload it with the next PUSH

Expand Down
9 changes: 9 additions & 0 deletions src/blackconfig/buildconfig_gen.inc.in
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ constexpr bool BlackConfig::CBuildConfig::isCompiledWithFGSupport()
return SWIFTCONFIG_${SWIFT_BUILD_FLIGHTGEAR_PLUGIN};
}

constexpr bool BlackConfig::CBuildConfig::isCompiledWithMSFSSupport()
{
//!!IF swiftConfig(sims.msfs)
return true;
//!!ELSE
// return false;
//!!ENDIF
}
tzobler marked this conversation as resolved.
Show resolved Hide resolved

constexpr bool BlackConfig::CBuildConfig::isCompiledWithGui()
{
return SWIFTCONFIG_${SWIFT_BUILD_BLACKGUI};
Expand Down
2 changes: 2 additions & 0 deletions src/blackcore/fsd/fsdclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ namespace BlackCore::Fsd

if (!m_statistics && (CBuildConfig::isLocalDeveloperDebugBuild() || (sApp && sApp->getOwnDistribution().isRestricted())))
{
// TOTO TZ
tzobler marked this conversation as resolved.
Show resolved Hide resolved
CLogMessage("Enabled network statistics");
m_statistics = true;
}
Expand Down Expand Up @@ -210,6 +211,7 @@ namespace BlackCore::Fsd
case CSimulatorInfo::FS9: m_simType = SimType::MSFS2004; break;
case CSimulatorInfo::FG: m_simType = SimType::FlightGear; break;
case CSimulatorInfo::XPLANE: m_simType = SimType::XPLANE11; break;
case CSimulatorInfo::MSFS: m_simType = SimType::MSFSX; break;
tzobler marked this conversation as resolved.
Show resolved Hide resolved
default: m_simType = SimType::Unknown; break;
}
m_simTypeInfo = CSimulatorInfo(simulator);
Expand Down
15 changes: 13 additions & 2 deletions src/blackgui/components/configsimulatorcomponent.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
// SPDX-FileCopyrightText: Copyright (C) 2017 swift Project Community / Contributors
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
/* Copyright (C) 2017
* swift project community / Contributors
*
* This file is part of swift Project. It is subject to the license terms in the LICENSE file found in the top-level
* directory of this distribution. No part of swift project, including this file, may be copied, modified, propagated,
* or distributed except according to the terms contained in the LICENSE file.
*/

#include "configsimulatorcomponent.h"
#include "blackgui/guiutility.h"
Expand Down Expand Up @@ -56,6 +61,7 @@ namespace BlackGui::Components
const bool p3d = (sims.isP3D() || !CFsDirectories::p3dDir().isEmpty()) && CBuildConfig::isCompiledWithP3DSupport();
const bool fsx = (sims.isFSX() || !CFsDirectories::fsxDir().isEmpty()) && CBuildConfig::isCompiledWithFsxSupport();
const bool fs9 = (sims.isFS9() || !CFsDirectories::fs9Dir().isEmpty()) && CBuildConfig::isCompiledWithFs9Support();
const bool msfs = (sims.isMSFS() || !CFsDirectories::msfsDir().isEmpty()) && CBuildConfig::isCompiledWithMSFSSupport();
const bool xp = sims.isXPlane() && CBuildConfig::isCompiledWithXPlaneSupport();
const bool fg = sims.isFG() && CBuildConfig::isCompiledWithFGSupport();

Expand All @@ -64,18 +70,21 @@ namespace BlackGui::Components
ui->cb_FS9->setChecked(fs9);
ui->cb_XP->setChecked(xp);
ui->cb_FG->setChecked(fg);
ui->cb_MSFS->setChecked(msfs);

ui->cb_P3D->setEnabled(CBuildConfig::isCompiledWithP3DSupport());
ui->cb_FSX->setEnabled(CBuildConfig::isCompiledWithFsxSupport());
ui->cb_FS9->setEnabled(CBuildConfig::isCompiledWithFs9Support());
ui->cb_XP->setEnabled(CBuildConfig::isCompiledWithXPlaneSupport());
ui->cb_FG->setEnabled(CBuildConfig::isCompiledWithFGSupport());
ui->cb_MSFS->setEnabled(CBuildConfig::isCompiledWithMSFSSupport());

CGuiUtility::checkBoxReadOnly(ui->cb_P3D, !CBuildConfig::isCompiledWithP3DSupport());
CGuiUtility::checkBoxReadOnly(ui->cb_FSX, !CBuildConfig::isCompiledWithFsxSupport());
CGuiUtility::checkBoxReadOnly(ui->cb_FS9, !CBuildConfig::isCompiledWithFs9Support());
CGuiUtility::checkBoxReadOnly(ui->cb_XP, !CBuildConfig::isCompiledWithXPlaneSupport());
CGuiUtility::checkBoxReadOnly(ui->cb_FG, !CBuildConfig::isCompiledWithFGSupport());
CGuiUtility::checkBoxReadOnly(ui->cb_MSFS, !CBuildConfig::isCompiledWithMSFSSupport());

/** does NOT work
const qreal fadeOut = 0.25;
Expand All @@ -91,6 +100,7 @@ namespace BlackGui::Components
else if (fs9) { ui->comp_SettingsSimulator->setSimulator(CSimulatorInfo(CSimulatorInfo::FS9)); }
else if (xp) { ui->comp_SettingsSimulator->setSimulator(CSimulatorInfo(CSimulatorInfo::XPLANE)); }
else if (fg) { ui->comp_SettingsSimulator->setSimulator(CSimulatorInfo(CSimulatorInfo::FG)); }
else if (msfs) { ui->comp_SettingsSimulator->setSimulator(CSimulatorInfo(CSimulatorInfo::MSFS)); }
}

QStringList CConfigSimulatorComponent::selectedSimsToPluginIds()
Expand All @@ -103,6 +113,7 @@ namespace BlackGui::Components
if (ui->cb_P3D->isChecked()) { ids << CSimulatorPluginInfo::p3dPluginIdentifier(); }
if (ui->cb_XP->isChecked()) { ids << CSimulatorPluginInfo::xplanePluginIdentifier(); }
if (ui->cb_FG->isChecked()) { ids << CSimulatorPluginInfo::fgPluginIdentifier(); }
if (ui->cb_MSFS->isChecked()) { ids << CSimulatorPluginInfo::msfsPluginIdentifier(); }

return ids;
}
Expand Down
66 changes: 40 additions & 26 deletions src/blackgui/components/configsimulatorcomponent.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>640</width>
<width>743</width>
<height>480</height>
</rect>
</property>
Expand Down Expand Up @@ -44,20 +44,13 @@
<property name="bottomMargin">
<number>4</number>
</property>
<item row="1" column="3" alignment="Qt::AlignHCenter">
<widget class="QCheckBox" name="cb_XP">
<property name="text">
<string>XPlane (32,64-bit)</string>
</property>
</widget>
</item>
<item row="0" column="2" alignment="Qt::AlignHCenter">
<widget class="QLabel" name="lbl_FS9">
<item row="0" column="0">
<widget class="QLabel" name="lbl_P3D">
<property name="styleSheet">
<string notr="true">background: &quot;lightgrey&quot;</string>
</property>
<property name="text">
<string>&lt;img width=&quot;100&quot; src=&quot;:/simulators/icons/simulators/FS9.png&quot;/&gt;</string>
<string>&lt;img width=&quot;130&quot; src=&quot;:/simulators/icons/simulators/Prepar3D.png&quot;/&gt;</string>
</property>
</widget>
</item>
Expand All @@ -68,20 +61,27 @@
</property>
</widget>
</item>
<item row="1" column="1" alignment="Qt::AlignHCenter">
<widget class="QCheckBox" name="cb_FSX">
<item row="1" column="3" alignment="Qt::AlignHCenter">
<widget class="QCheckBox" name="cb_XP">
<property name="text">
<string>FSX (32-bit)</string>
<string>XPlane (32,64-bit)</string>
</property>
</widget>
</item>
<item row="0" column="1" alignment="Qt::AlignHCenter">
<widget class="QLabel" name="lbl_FSX">
<item row="0" column="2" alignment="Qt::AlignHCenter">
<widget class="QLabel" name="lbl_FS9">
<property name="styleSheet">
<string notr="true">background: &quot;lightgrey&quot;</string>
</property>
<property name="text">
<string>&lt;img width=&quot;100&quot; src=&quot;:/simulators/icons/simulators/FSX.png&quot;/&gt;</string>
<string>&lt;img width=&quot;100&quot; src=&quot;:/simulators/icons/simulators/FS9.png&quot;/&gt;</string>
</property>
</widget>
</item>
<item row="0" column="4" alignment="Qt::AlignHCenter">
<widget class="QLabel" name="lbl_FG">
<property name="text">
<string>&lt;img width=&quot;50&quot; src=&quot;:/simulators/icons/simulators/FG.png&quot;/&gt;</string>
</property>
</widget>
</item>
Expand All @@ -98,6 +98,20 @@
</property>
</widget>
</item>
<item row="1" column="1" alignment="Qt::AlignHCenter">
<widget class="QCheckBox" name="cb_FSX">
<property name="text">
<string>FSX (32-bit)</string>
</property>
</widget>
</item>
<item row="1" column="4" alignment="Qt::AlignHCenter">
<widget class="QCheckBox" name="cb_FG">
<property name="text">
<string>FlightGear (64-bit)</string>
</property>
</widget>
</item>
<item row="0" column="3" alignment="Qt::AlignHCenter">
<widget class="QLabel" name="lbl_XP">
<property name="styleSheet">
Expand All @@ -108,27 +122,27 @@
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="lbl_P3D">
<item row="0" column="1" alignment="Qt::AlignHCenter">
<widget class="QLabel" name="lbl_FSX">
<property name="styleSheet">
<string notr="true">background: &quot;lightgrey&quot;</string>
</property>
<property name="text">
<string>&lt;img width=&quot;130&quot; src=&quot;:/simulators/icons/simulators/Prepar3D.png&quot;/&gt;</string>
<string>&lt;img width=&quot;100&quot; src=&quot;:/simulators/icons/simulators/FSX.png&quot;/&gt;</string>
</property>
</widget>
</item>
<item row="0" column="4" alignment="Qt::AlignHCenter">
<widget class="QLabel" name="lbl_FG">
<item row="0" column="5">
<widget class="QLabel" name="lbl_MSFS">
<property name="text">
<string>&lt;img width=&quot;50&quot; src=&quot;:/simulators/icons/simulators/FG.png&quot;/&gt;</string>
<string>&lt;img width=&quot;130&quot; src=&quot;:/simulators/icons/simulators/MSFS.png&quot;/&gt;</string>
</property>
</widget>
</item>
<item row="1" column="4" alignment="Qt::AlignHCenter">
<widget class="QCheckBox" name="cb_FG">
<item row="1" column="5">
<widget class="QCheckBox" name="cb_MSFS">
<property name="text">
<string>FlightGear (64-bit)</string>
<string>MSFS (32,64-bit)</string>
</property>
</widget>
</item>
Expand Down
4 changes: 2 additions & 2 deletions src/blackgui/components/dblogincomponent.ui
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,8 @@ p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.1pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;ol style=&quot;margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;&quot;&gt;&lt;li style=&quot; font-size:8pt;&quot; style=&quot; margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;You can go directly to the swift DB: ##swiftDb## &lt;/li&gt;
&lt;li style=&quot; font-size:8pt;&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;If you want to use VATSIM SSO, you need to enable it once ##swiftEnableSSO## &lt;/li&gt;
&lt;li style=&quot; font-size:8pt;&quot; style=&quot; margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;In case you do not have a password you can try &amp;quot;anonymous&amp;quot;/&amp;quot;anonymous&amp;quot;. No guarantee it will work, but worth a trial. &lt;/li&gt;&lt;/ol&gt;&lt;/body&gt;&lt;/html&gt;</string>
&lt;li style=&quot; font-size:8pt;&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;VATSIM SSO is not possible anymore&lt;/li&gt;
&lt;li style=&quot; font-size:8pt;&quot; style=&quot; margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;In case you do not have a password you can request access data in the data store </string>
tzobler marked this conversation as resolved.
Show resolved Hide resolved
</property>
<property name="textInteractionFlags">
<set>Qt::TextBrowserInteraction</set>
Expand Down
Loading
Loading