swift
simulatorfscommon.cpp
1 // SPDX-FileCopyrightText: Copyright (C) 2013 swift Project Community / Contributors
2 // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3 
4 #include "simulatorfscommon.h"
5 
6 #include "core/webdataservices.h"
7 #include "misc/logmessage.h"
9 #include "misc/stringutils.h"
10 
11 using namespace swift::misc;
12 using namespace swift::misc::physical_quantities;
13 using namespace swift::misc::aviation;
14 using namespace swift::misc::geo;
15 using namespace swift::misc::network;
16 using namespace swift::misc::simulation;
17 using namespace swift::misc::simulation::fscommon;
18 using namespace swift::core;
19 using namespace swift::simplugin::common;
20 
21 namespace swift::simplugin::fscommon
22 {
23  CSimulatorFsCommon::CSimulatorFsCommon(const CSimulatorPluginInfo &info, IOwnAircraftProvider *ownAircraftProvider,
24  IRemoteAircraftProvider *renderedAircraftProvider,
25  IClientProvider *clientProvider, QObject *parent)
26  : CSimulatorPluginCommon(info, ownAircraftProvider, renderedAircraftProvider, clientProvider, parent)
27  {
29  }
30 
32 
34  {
35  CSimulatorPluginCommon::initSimulatorInternals();
37  }
38 
40  {
43 
44  ISimulator::reset();
45  }
46 
48  {
49  if (CSimpleCommandParser::registered("swift::simplugin::fscommon::CSimulatorFsCommon")) { return; }
50  CSimpleCommandParser::registerCommand({ ".drv", "alias: .driver .plugin" });
51  }
52 
54  {
55  // reset flags
56  m_simPaused = false;
57  const bool r = CSimulatorPluginCommon::disconnectFrom();
59  return r;
60  }
61 } // namespace swift::simplugin::fscommon
void emitSimulatorCombinedStatus(SimulatorStatus oldStatus=Unspecified)
Emit the combined status.
Definition: simulator.cpp:812
swift::misc::simulation::CSimulatorInternals m_simulatorInternals
setup read from the sim
Definition: simulator.h:578
Direct in memory access to client (network client) data.
void setSimulatorVersion(const QString &versionInfo)
Simulator version info, something like "10.3.2".
Direct threadsafe in memory access to own aircraft.
Direct thread safe in memory access to remote aircraft.
QString getSimulatorVersion() const
Simulator version as set from the running simulator.
Common base class for simulator plugins.
virtual bool disconnectFrom()
Disconnect from simulator.
int m_ownAircraftUpdateCycles
own aircraft updates, even with 50 updates/sec long enough even for 32bit
virtual void reset()
Full reset of state.
int m_skipCockpitUpdateCycles
skip some update cycles to allow changes in simulator cockpit to be set
virtual void initSimulatorInternals()
Init the internal objects.
Backend services of the swift project, like dealing with the network or the simulators.
Definition: actionbind.cpp:7
Free functions in swift::misc.