Coder Social home page Coder Social logo

swift-project / pilotclient Goto Github PK

View Code? Open in Web Editor NEW
91.0 10.0 26.0 76.74 MB

Cross-platform cross-simulator pilot client for virtual air traffic networks

Home Page: https://swift-project.org

License: GNU General Public License v3.0

C++ 93.15% HTML 1.03% CSS 0.02% JavaScript 0.07% Python 0.46% NASL 0.12% C 3.43% QML 0.07% Objective-C++ 0.18% Makefile 0.02% Perl 0.11% CMake 1.35%
flight-simulation network-client x-plane msfs flightgear prepar3d vatsim

pilotclient's Introduction

About

swift is a pilot client for virtual air traffic simulation networks, such as VATSIM, supporting the following simulators and operating systems:

  • Prepar3D (Windows)
  • Flight Simulator X (Windows)
  • Flight Simulator 2004 (Windows)
  • Flight Simulator 2020 (Windows)
  • X-Plane 11 & 12 (Windows, Linux, macOS)
  • FlightGear (Windows, Linux, macOS)

Downloads

Beta version Alpha version

Resources

🌐 Website

📗 User guide

👋 Discord

Contributing

swift is written in modern C++17 using the Qt framework.

Development version Build status

Pull requests should be made against the main branch.

📘 Developer guide

📙 API documentation

pilotclient's People

Contributors

airac avatar bsupnik avatar emiro85 avatar fpvogel avatar garrappachc avatar gmt2001 avatar hendrikpeter avatar kuroneko avatar kwb avatar ltoenning avatar oktal3700 avatar tzobler avatar wadesworld2112 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pilotclient's Issues

[bug][core] Issue using two identical Joystick for PTT

Comment KB: Not clear if this is a swift BUG, OR an issue because of the specific hardware. See the details linked in the comment below!!!!!

Using the following configuration :

Windows 10 Home Family
Prepar3D 4.2
Swift 64-0.9.4.232
An Airbus A320 home cockpit composed of the following hardware :
Two Skalarki A320 Sidestick for Cpt and F/O : https://www.skalarki-electronics.eu/onlineshop/product/240-side-stick-p-p.html
This side stick use a leo bodnar card BU036A and are connected exactly the same manner on USB.
Each PTT button are recognized as Button 21.

When configuring PTT for Cpt Sidestick, it also configure for F/O but you see only one hardware. (see screenshoot).
Consequently, when pushing PTT on Cpt Sidestick, as it is not pushed on F/O, swift client interpreted it as pushed/unpushed PTT in loop.

The only way to work is to disable the F/O sidestick.

In my opinion, I think swift is not able to separate hardware by ID if you have twice the same.

CLogCategoryList easier to construct in static member functions

The normal use case of CLogMessage and CStatusMessage involves implicit construction of the CLogCategoryList from the caller's this pointer. The value of the pointer doesn't matter, only its type is used to obtain the categories by reflection.

Obviously this is not available in static member functions. Currently there are two workarounds:

  1. Just call the static getLogCategories(), which is incorrect (doesn't use reflection).
  2. static_cast<Class*>(nullptr), which is correct but cumbersome.

We need a better way to construct a CLogCategoryList for a class, without access to a this pointer.

Test whether .wallop actually works and consider proper UI feedback

KieranToday at 4:31 PM
Is wallop available? I had need to .wallop just now but I typed .wallop and sent and nothing happened no notification or message box etc. Is this normal?

Roland RoßgottererToday at 4:33 PM
it should be available
EFD_SUP is online if you want to ask him whether he received it or not

KieranToday at 4:36 PM
I'll message direct and ask him thanks :slight_smile:
He said he didn't think there is an issue, .wallop isn't transmitting for me

[feature][UI] Flightplan widget, field 7. Cruising Altitude, small letters

Currently, when entering a value into field 7. Cruising Altitude users have to type capital letters such as "FL", "A", "S" etc.. I think this is not optimal for ease of use and I would suggest that we make it like in the REMARKS: users can use small or capital letters, swift will convert small letters to capital letters on the go.

Use metaclass system to automate generating propertyindex methods for value classes

For each new value class we must manually write the methods propertyByIndex, setPropertyByIndex, etc. For a long time I wished to automate this task using the metaclass system (previously known as tuple system). As a first step, we would need to add support for getters and setters in the metaclass system, as there are many property indexes that do not correspond directly to individual data members.

Also consider using a pair of ints for each index in CPropertyIndex (one int for the enum, another int for the metaTypeId of the enum type) as this would remove the requirement to avoid collisions of enum values defined by the index enums of different value classes. (Need to think how this would interact with dbus.)

Installer improvements

This umbrella task will be used to investigate and study several installer improvements including but not limited to:

  • Add downloadable components
    • Qt5 and other externals that rarely change could be made downloadable instead of bundling them in each installer. They would need to be downloaded only for the first installation
    • Updates could be downloadable
  • Investigate options to provide updates
  • Change MacOS installer to app based only (no installer anymore)
    • DBus and everything else would need to be setup in the wizard
  • Mat's ideas

User-defined literals for physical quantities

Examples:

using namespace BlackMisc::PhysicalQuantities::Literals;
auto temp = 32_degC;
auto angle = 180_deg;
auto qnh = 1013_hPa; // or 29.92_inHg
auto alt = 18000_ft;
auto freq = 122.8_MHz;
auto dist = 10_NM;
auto speed = 250_kts;

Copy/saving of PTT key

A mystery since a while (even RR did not know why) is why coping the PTT among swift versions fails, the key has to be removed and added again

Example: https://discordapp.com/channels/539048679160676382/539486489977946112/719273518612742324

[feature][UI] Real-World Weather update frequency

It seems the real-world weather (for flying online) is updated every 1 minute. This impacts on the fluidity of the sim as it has to render a new (or same) set of clouds and inject the weather data much too often. Could it be possible to have a feature whereby the weather update frequency can be set by the pilot/user?

Thank you.

[CI] Organizing build artifacts for download by users

To get the downloadable updates to show up in the client we would need to hook into the TUpdateInfo data trait, which is currently populated by the CSetupReader. We would probably create a new reader class and use QNetworkAccessManager to populate the existing data trait from the Github Releases REST API.

Then we could go to https://github.com/swift-project/pilotclient/releases to manually create a release and have it show up in the client update dialog. Or even add a job in our Github Actions workflow to automatically create a release for each build:

The whole idea is to reduce the complexity, reduce the number of moving parts, automate as much as possible, to reduce the release workload, the maintenance overhead, and the dependency on bespoke servers.

[bug][standalone] Models disappear in free camera mode when a certain distance away.

When in Free Camera mode in X-Plane, you can only be a certain distance before the plane is no longer generated/visible. It doesn't matter if you set a distance or not in the client.

I have put details, logs, screenshot in the linux section of Discord, as that is the version I am using (0.9.4.206). Note - this did NOT happen in the previous version (but did often crash).

https://discordapp.com/channels/539048679160676382/569861511724531712/693924677583765524
https://discordapp.com/channels/539048679160676382/569861511724531712/693924813491798016
https://discordapp.com/channels/539048679160676382/569861511724531712/693924922027671593
https://discordapp.com/channels/539048679160676382/569861511724531712/693925026532950126
https://discordapp.com/channels/539048679160676382/569861511724531712/693925197492781056

Increase the range when connected as OBS

When connected in OBS (co pilot) mode to fly in a shared cockpit, the radar tab, user tab, traffic on the ND of the plane we are flying in can "catch" only very near other planes (5NM, may be 10NM, but no more.

Following Aircraft won't actually match their altitude

https://dev.swift-project.org/T781

When you click to follow an aircraft, the "camera" just points straight up at the sky and nothing follows - you can manually go into free camera mode and find the aircraft then, but it doesn't follow the altitude the aircraft is, so it makes the feature not as useful.

This is in Xplane, and using 0.9.4.206

Note - I have found this happens only at specific airports KLGA and KJFK - I can go to Boston and NOT have this issue. Also related, if you are in free camera, the aircraft will disappear at a certain point (like hovering 100ft above) but as you bring the camera closer, it shows up. Not sure why this happens at these specific airports.

ATC Tree group by FIR/UIR

https://dev.swift-project.org/T635

ATC tree is now grouped by position.
This is better than it was before, but it would be very handy if you can group by FIR/UIR.

example:

you fly to LIRF, through LIRR FIR.
Atm, you see
CTR
-- LIRR_N_CTR
-- LSAS_CTR
APP
-- LIMM_N_APP
-- LIRR_N_APP
TWR
-- LIRF_TWR

and if you have a busy time, lots of positions are listed there.

If you can group positions by FIR/UIR, you get something like:
LSAS
-- LSAS_CTR
LIMM
-- LIMM_N_CTR
-- LIMC_TWR
LIRF
-- LIRR_N_CTR
-- LIRR_N_APP
-- LIRF_TWR

which is way easier if you only need the positions to get to LIRF.

difficulty is getting a table with all FIR/UIR's and all of their positions...

Review our use of Qt string classes

Qt has added a class QStringView, the use of which as a function parameter can avoid constructing a QString in many cases. Since one of swift's main performance bottlenecks is QString constructions, it would be nice to review which of our functions can be refactored to take a QStringView parameter.

It might make sense to also consider where we can make more use of QStringLiteral, QLatin1String, QStringRef, and QStringBuilder.

[feature][UI] Voice audio source quick toggle switch

Pilots regularly want to either get up for a few minutes to do things around the vicinity of their computers/cockpits or wish to take off their headsets during longer flights. At the same time they wish to keep monitoring voice communications on active ATC-frequencies or on UNICOM, just like in the real world where we only have to wear our headsets below 10,000ft and may remove them and switch to SPEAKERS above that altitude.

Therefore it would be really, really cool if swiftGUI had the possibility of configuring "secondary audio IN and OUT devices" ("IN" should be allowed to be the same as the primary audio IN device) for such purpose and provide a "SPEAKER" toggle-button, a hotkey-definition for it and a SPEAKER status-light on the GUI. When the SPEAKER toggle-button is selected, swift will switch from its primary voice out/in devices to the secondary out/in devices and vice versa, if selected again. This could be really useful to a lot of users.

Improved aircraft base type (AIXM modell)

Change to AIXM base class model
http://aixm.aero/sites/aixm.aero/files/imce/AIXM511HTML/AIXM/DataType_CodeAircraftType.html

Name Data Type Definition
nilReason NilReasonEnumeration
LANDPLANE string Landplane Inherited from CodeAircraftBaseType
SEAPLANE string Seaplane Inherited from CodeAircraftBaseType
AMPHIBIAN string Amphibian Inherited from CodeAircraftBaseType
HELICOPTER string Helicopter Inherited from CodeAircraftBaseType
GYROCOPTER string Gyrocopter Inherited from CodeAircraftBaseType
TILT_WING string Tilt-wing aircraft Inherited from CodeAircraftBaseType
STOL string Short Take-Off and Landing (STOL) Inherited from CodeAircraftBaseType
GLIDER string Glider Inherited from CodeAircraftBaseType
HANGGLIDER string Hang-glider Inherited from CodeAircraftBaseType
PARAGLIDER string Para-glider Inherited from CodeAircraftBaseType
ULTRA_LIGHT string Ultra light Inherited from CodeAircraftBaseType
BALLOON string Balloon Inherited from CodeAircraftBaseType
UAV string Unmanned Aerial Vehicle (UAV) drone Inherited from CodeAircraftBaseType
ALL string All aircraft types. Inherited from CodeAircraftBaseType
OTHER string Other

Weather in FSX

How often does the weather system on swift detect aircraft location and adjust the weather? For me it set the weather when i activated it and then i had to deactivate and activate it everytime i wanted the weather to update. Lack Walker

Strengthen lifetime management guarantees of workers

Original report

swift crashes if I shutdown the application inbetween these steps

template <typename T, bool UseCompare>
CWorker *CListModelBase<T, UseCompare>::updateAsync(const ContainerType &container, bool sort)
{
    Q_UNUSED(sort);
    if (m_modelDestroyed) { return nullptr; }
    const auto sortColumn = this->getSortColumn();
    const auto sortOrder  = this->getSortOrder();
    CWorker *worker = CWorker::fromTask(this, "ModelSort", [this, container, sortColumn, sortOrder]()
    {
        return this->sortContainerByColumn(container, sortColumn, sortOrder);
    });
    worker->thenWithResult<ContainerType>(this, [this](const ContainerType & sortedContainer)
    {
        if (m_modelDestroyed) { return;  }
        this->update(sortedContainer, false);
    });
    worker->then(this, &CListModelBase::asyncUpdateFinished);
    return worker;

Discussion

The list model is destroyed while the worker is still sorting the container. Hence it crashes because it tries to sort a container that was destroyed.

The design of the workers was supposed to avoid this by using parent/child relation between owner (list model) and QThread, and making the QThread destructor wait for the worker to finish. But of course I overlooked that the derived-class owner is destroyed before its base class QObject destructor gets the chance to destroy the QThread child object.

The proximate cause seems to be here, in sortContainerByColumn:

// sort the values
const std::integral_constant<bool, UseCompare> marker {};
const auto p = [ = ](const ObjectType & a, const ObjectType & b) -> bool
{
    return Private::compareForModelSort<ObjectType>(a, b, order, propertyIndex, m_sortTieBreakers, marker);
//                                                                              ^~~~~~~~~~~~~~~~~
};

return container.sorted(p);

The lambda is implicitly capturing the this pointer, through which it accesses the m_sortTieBreakers member. It crashes when m_sortTieBreakers is destroyed.

As a workaround we now capture a copy of m_sortTieBreakers instead.

Returning to the broader, general issue, there are two different concerns:

  1. Ensuring the worker does get deleted on every code path, so resources are not leaked.
  2. Ensuring any data used by the worker does not get deleted before the worker.

(1) is ensured by the parent/child relation between owner and thread, which is good. But if the owner also owns some of the data used by the worker, then (2) becomes a problem of ensuring a particular order of destruction of owned objects, which is a hard problem.

I feel like the workaround above is actually suggestive of the best general, robust solution: workers need to always work on local copies of data, and never access anything outside themselves.

Consider using CGenericDBusInterface::relayParentSignals

Regarding comment in blackmisc/genericdbusinterface.h:

//! \deprecated KB 2018-08 this seems to be not used anymore and might be removed
void relayParentSignals()
{
    Q_ASSERT_X(false, Q_FUNC_INFO, "crosscheck if still used");

We could use relayParentSignals to avoid a lot of difficult-to-maintain, difficult-to-test boilerplate code in the relaySignals method of all our DBus proxy classes.

The entirety of each relaySignals method of the contexts could be replaced with a call to m_dBusInterface->relayParentSignals(). And the same for the equivalent parts in the constructors of the xswiftbus proxy classes in the XP driver.

Cache and settings 2.0 (next generation) T267

General:

  • Technically there is no difference between settings/cache. The usage is different
  • Make data persistent (i.e. save in file)
  • Distribute via DBus if required

Scenarios:

  • 1 swift app, object shared between threads
  • swift pilot client + core same machine, object shared between processes, can be distributed via DBus or share the file
  • swift pilot client + core 2 machines, object needs to be shared between processes
  • 2 swift apps, like mapping tool and pilot client, 2 process, can be shared via file on same machine

Object types:

  • Primitives: int, QString, ...
  • value object
  • value object container
  • in theory we could just use CVariant to handle all

Metadata (query without reading the object, especially needed for large containers)

  • timestamp, last changed
  • for containers, size (count)

With T285 and T292 we have learnt:

  • the model set / model caches for each simulator are the(!) most important use case
  • they exist for each simulator
  • it looks like a single in memory provider for these caches (as with T292 implemented as CCentralMultiSimulatorModelCachesProvider and ..ModelSetProvider) is the better approach, but it has to be thread safe!
  • The question is, if we somehow implement the model set/caches, how many real other use cases do we have apart from the model caches? In other words, are there any other use cases for caches than than the model caches?

Flightlevel T788

You can't enter FL361 for flying into China. You can use S1100 but local ATC wants you to enter FL361. The function convert meters to feet gives you 36000ft. Not only inaccurate but also not what I want. My personal opinion that you over secured that field.

Plugin for external notifications or add as feature to swift itself

I have developed a plugin for vPilot that relays incoming messages to external services. The two most frequently used services are Pushover and Hoppie.

Pushover support allows notifications to be sent to devices such as smart phones and tablets to alert when somebody is trying to reach you. This is primarily useful when you have momentarily stepped away while out of coverage area and a controller suddenly comes online asking you to check in with them. This way you know to get back to your computer sooner than later without having to disconnect form Vatsim altogether.

Sending to Hoppie has benefits such as the message will then show up in your FMC/FMGC type systems as well which means you don't need to switch to a different program window to read a "contact me" message and get it inside your FM(G)C instead.

Maybe Swift can already do these types of things. I wasn't able to find information on it with cursory searches. Users of the my vPilot plugin have asked if I could add Swift support as well. I thought I would start out by submitting a feature request here and see if this is something that can be done either by you guys to make it an integrated feature or by way of a plugin I can write to extend functionality similar to how I did that with vPilot.

CEventLoop::processEventsUntil with an extra condition

In CAirspaceMonitor::loadFlightPlanFromNetwork we have this code:

const QTime waitForFlightPlan = QTime::currentTime().addMSecs(1000);
while (QTime::currentTime() < waitForFlightPlan)
{
    // process some other events and hope network answer is received already
    // CEventLoop::processEventsUntil cannot be used, as a received flight plan might be for another callsign
    sApp->processEventsFor(100);
    if (!sApp || sApp->isShuttingDown()) { return CFlightPlan(); }
    if (m_flightPlanCache.contains(callsign))
    {
        plan = m_flightPlanCache[callsign];
        break;
    }
}

It would be easy to extend CEventLoop so that processEventsUntil can take an additional condition on the signal argument so that it could be used in this case.

I just need to work out the best way to factor it into the design.

Mark specific log messages as "no duplicates"

Sometimes it was useful to avoid duplicate logs. We already have a feature aggregating log messages like "+xy similar messages".

  • For some scenarios it was also nice if we would ignore messages exactly similar to the last one
CLogMessage("Foo %1") << "a";
CLogMessage("Foo %1") << "a"; // ignored
CLogMessage("Foo %1") << "b";
CLogMessage("baz");
  • or similar without the parameters
CLogMessage("Foo %1") << "a";
CLogMessage("Foo %1") << "a"; // ignored
CLogMessage("Foo %1") << "b"; // ignored
CLogMessage("baz");

Behavior could be parameter, or extra class CLogMessageNoDuplicate

[feature][UI] Function to quickly change between audio output devices

Originally: https://dev.swift-project.org/T439

It would be really cool to have a function that allows the user to quickly change between his two favourite audio OUTPUT devices. This could be handy if a pilot needs to get up from his cockpit, but will stay in the vicinity of his computer and still wants to monitor the radio in case that ATC calls him.

Maybe a good location would be on top of the GUI, next to the status-lights. This way it would be always available, no matter what subpage the user is currently in. On the Audio page the user will be able to nominate the two audio output devices that will be affected by this click-spot.

[feature][standalone] Flash Taskbar T772

It would be great if the taskbar flashed when messages destined to you are sent. I would recommend including this feature in private messages, as well as mentions in COM1 chatter if the controller is trying to get ahold of you (or another pilot). This feature is in vPilot and I got very used to that before switching and it's very helpful in realizing you've missed a call or message. Thanks.

Modulo arithmetic as class invariants for heading, pitch, bank

Resulting from a discussion about headings in the range [-180,180) being displayed by simulator component, I think that does not make any sense. Headings are always in [0,360) and this should be a class invariant. It would be done internally in CHeading so that client code is not littered with lots of calls to normalize methods.

In the same step, pitch should be in [-90,90) and bank should be in [-180,180). This will involve some refactoring into a base class CRotation, derived from CAngle. Then CHeading, CPitch, and CBank would derived from CRotation.

Design considerations:

  • The Liskov Substitution Principle advises that inheritance might be the wrong tool to use here, as CRotation can not be a true generalisation of CAngle.
  • The design should prevent accidental conversions between the three derived classes, which could happen via the base class if we are not careful.
  • We already have CEarthAngle, CLatitude, and CLongitude which should be doing a similar thing.
  • CTrack should have similar semantics. (Is it still needed?)
  • Will CAngle still be needed as a standalone class?

ATC stations text length

It would be great when changing the text length in the ATC stations page (sliding the bar at the top to make the text limit longer), that it would keep the setting and not reset every time you change pages.

DockWidget Linux workaround still needed?

After using the latest branch (once available) with all the Ref T592 fixes, mainly changing to Qt::QueuedConnection please verify/test if this is still needed, otherwise after testing on Linux just remove.

    void CDockWidget::onTopLevelChanged(bool topLevel)
    {
#       ifdef Q_OS_LINUX
        // Give XCB platforms enough time to handle window events before adjusting it.
        QThread::msleep(100);
#       endif
``´

Make log history available to objects constructed later

The current system for subscribing to log messages is insufficient, as we want objects to have access to log messages emitted before the object was constructed.

Finding a solution to this problem is a good opportunity to use a concrete use case to begin developing a replacement for the loosely interrelated, and rigidly inflexible, systems of caches/settings/logging.

[bug][launcher] PTT Not Working on macOS Catalina T799

It seems the swift launcher cannot receive any key inputs (keyboard strokes, mouse keys or flight stick buttons) when setting up PTT. Testing after manual selection did not work either. There can be a bug with the key listening logic on modern macOS.

swift version: 0.9.4.377
macOS version: 10.15.5 Beta (19F83c)

I have tried to enable all relevant permissions.

Warn when client is about to expire

When a client build reaches its planned end-of-life, a confusing error message is displayed and the client refuses to start.

Improve the error message, and also issue a warning message when the end-of-life is within the next month.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.