diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2021-12-19 20:36:56 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2021-12-19 20:37:04 +0100 |
commit | cb0753adaefcd365134a16b5ebc0be76c1f7b7da (patch) | |
tree | 9e7d6f56e70e804c2d27e9e4a129771d6ff148d1 | |
parent | adedc93dfc2f3b62d1fe2cb51207749a2459c2fa (diff) |
remove unfinished extension support
28 files changed, 7 insertions, 860 deletions
diff --git a/api/plugin-api.cpp b/api/plugin-api.cpp index 3bfe9855..702870c7 100644 --- a/api/plugin-api.cpp +++ b/api/plugin-api.cpp @@ -56,8 +56,6 @@ ITrackerDialog::ITrackerDialog() = default; ITrackerDialog::~ITrackerDialog() = default; void ITrackerDialog::register_tracker(ITracker*) {} void ITrackerDialog::unregister_tracker() {} -IExtension::~IExtension() = default; -IExtensionDialog::~IExtensionDialog() = default; bool module_status::is_ok() const { diff --git a/api/plugin-api.hpp b/api/plugin-api.hpp index 9cc87f82..2d77bdf4 100644 --- a/api/plugin-api.hpp +++ b/api/plugin-api.hpp @@ -228,48 +228,3 @@ struct OTR_API_EXPORT ITrackerDialog : public plugin_api::detail::BaseDialog #define OPENTRACK_DECLARE_TRACKER(tracker_class, dialog_class, metadata_class) \ OPENTRACK_DECLARE_PLUGIN_INTERNAL(tracker_class, ITracker, metadata_class, dialog_class, ITrackerDialog) -struct OTR_API_EXPORT IExtension : module_status_mixin -{ - enum event_mask : unsigned - { - none = 0u, - on_raw = 1 << 0, - on_before_filter = 1 << 1, - on_before_mapping = 1 << 2, - on_finished = 1 << 3, - }; - - enum event_ordinal : unsigned - { - ev_raw = 0, - ev_before_filter = 1, - ev_before_mapping = 2, - ev_finished = 3, - - event_count = 4, - }; - - IExtension() = default; - ~IExtension() override; - - virtual event_mask hook_types() = 0; - - virtual void process_raw(Pose&) {} - virtual void process_before_filter(Pose&) {} - virtual void process_before_mapping(Pose&) {} - virtual void process_finished(Pose&) {} - - IExtension(const IExtension&) = delete; - IExtension& operator=(const IExtension&) = delete; -}; - -struct OTR_API_EXPORT IExtensionDialog : public plugin_api::detail::BaseDialog -{ - ~IExtensionDialog() override; - - virtual void register_extension(IExtension& ext) = 0; - virtual void unregister_extension() = 0; -}; - -#define OPENTRACK_DECLARE_EXTENSION(ext_class, dialog_class, metadata_class) \ - OPENTRACK_DECLARE_PLUGIN_INTERNAL(ext_class, IExtension, metadata_class, dialog_class, IExtensionDialog) diff --git a/api/plugin-support.hpp b/api/plugin-support.hpp index 9c0a3ae0..30b50753 100644 --- a/api/plugin-support.hpp +++ b/api/plugin-support.hpp @@ -38,7 +38,6 @@ enum class dylib_type : unsigned Filter = 0xdeadbabe, Tracker = 0xcafebeef, Protocol = 0xdeadf00d, - Extension = 0xcafebabe, Video = 0xbadf00d, Invalid = (unsigned)-1, }; @@ -154,7 +153,6 @@ private: OPENTRACK_LIBRARY_PREFIX "opentrack-tracker-", OPENTRACK_LIBRARY_PREFIX "opentrack-proto-", OPENTRACK_LIBRARY_PREFIX "opentrack-filter-", - OPENTRACK_LIBRARY_PREFIX "opentrack-ext-", OPENTRACK_LIBRARY_PREFIX "opentrack-video-", }; @@ -180,20 +178,17 @@ struct Modules final filter_modules(filter(type::Filter)), tracker_modules(filter(type::Tracker)), protocol_modules(filter(type::Protocol)), - extension_modules(filter(type::Extension)), video_modules(filter(type::Video)) {} dylib_list& filters() { return filter_modules; } dylib_list& trackers() { return tracker_modules; } dylib_list& protocols() { return protocol_modules; } - dylib_list& extensions() { return extension_modules; } private: dylib_list module_list; dylib_list filter_modules; dylib_list tracker_modules; dylib_list protocol_modules; - dylib_list extension_modules; dylib_list video_modules; static dylib_list& sorted(dylib_list& xs) @@ -229,7 +224,6 @@ private: { type::Filter, OPENTRACK_LIBRARY_PREFIX "opentrack-filter-*." OPENTRACK_LIBRARY_EXTENSION, }, { type::Tracker, OPENTRACK_LIBRARY_PREFIX "opentrack-tracker-*." OPENTRACK_LIBRARY_EXTENSION, }, { type::Protocol, OPENTRACK_LIBRARY_PREFIX "opentrack-proto-*." OPENTRACK_LIBRARY_EXTENSION, }, - { type::Extension, OPENTRACK_LIBRARY_PREFIX "opentrack-ext-*." OPENTRACK_LIBRARY_EXTENSION, }, { type::Video, OPENTRACK_LIBRARY_PREFIX "opentrack-video-*." OPENTRACK_LIBRARY_EXTENSION, dylib_load_none, }, }; diff --git a/ext-falcon-bms-linear-acc/CMakeLists.txt b/ext-falcon-bms-linear-acc/CMakeLists.txt deleted file mode 100644 index bb284f06..00000000 --- a/ext-falcon-bms-linear-acc/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -if(WIN32) - #otr_module(ext-falcon-bms-acceleration) -endif() diff --git a/ext-falcon-bms-linear-acc/FlightData.h b/ext-falcon-bms-linear-acc/FlightData.h deleted file mode 100644 index 3f7e99ab..00000000 --- a/ext-falcon-bms-linear-acc/FlightData.h +++ /dev/null @@ -1,578 +0,0 @@ -#pragma once - -#define FLIGHTDATA_VERSION 117 -// changelog: -// 110: initial BMS 4.33 version -// 111: added SysTest to LightBits3 -// 112: added MCAnnounced to LightBits3 -// 113: added AllLampBits2OnExceptCarapace to LightBits2 and AllLampBits3OnExceptCarapace to LightBits3 -// 114: renamed WOW LightBit to ONGROUND, added "real" (AFM) WOW to LightBits3 -// 115: renamed "real" WOW in MLGWOW, added NLGWOW -// 116: bitfields are now unsigned instead of signed -// 117: added ATF_Not_Engaged to LightBits3 - -// *** "FalconSharedMemoryArea" *** -struct FlightData -{ - // GENERAL NOTE FOR ALL LIGHTBITS: - // - // The lightbits contain status about whether a lamp is activated or deactivated. A *blinking* lamp - // is always activated, even if it is in the "off" phase of the blinking! To check whether an activated - // lamp is blinking or just "on", use the BlinkBits in FlightData2. A blinkbit does NOT alternate on/off - // either, it will just state *if* a lamp is blinking. This construct might seem strange at 1st sight, - // but only like this it can be guaranteed that even low-freq shared mem readers will pick up the info - // about blinking lamps correctly. Obviously, it is up to the external program to implement the actual - // blinking logic/freq etc. - // - // Summary: - // a) The LightBit says "lamp is active (LightBit 1) or inactive (LightBit 0)". - // b) The BlinkBit says "if the lamp is active (see LightBit 1), is it steady (BlinkBit 0) - // or is it blinking (BlinkBit 1)" - // c) If a lamp has no BlinkBit, it is always assumed to be steady if active (LightBit 1). - - enum LightBits : unsigned - { - MasterCaution = 0x1, // Left eyebrow - - // Brow Lights - TF = 0x2, // Left eyebrow - OXY_BROW = 0x4, // repurposed for eyebrow OXY LOW (was OBS, unused) - EQUIP_HOT = 0x8, // Caution light; repurposed for cooling fault (was: not used) - ONGROUND = 0x10, // True if on ground: this is not a lamp bit! - ENG_FIRE = 0x20, // Right eyebrow; upper half of split face lamp - CONFIG = 0x40, // Stores config, caution panel - HYD = 0x80, // Right eyebrow; see also OIL (this lamp is not split face) - Flcs_ABCD = 0x100, // TEST panel FLCS channel lamps; repurposed, was OIL (see HYD; that lamp is not split face) - FLCS = 0x200, // Right eyebrow; was called DUAL which matches block 25, 30/32 and older 40/42 - CAN = 0x400, // Right eyebrow - T_L_CFG = 0x800, // Right eyebrow - - // AOA Indexers - AOAAbove = 0x1000, - AOAOn = 0x2000, - AOABelow = 0x4000, - - // Refuel/NWS - RefuelRDY = 0x8000, - RefuelAR = 0x10000, - RefuelDSC = 0x20000, - - // Caution Lights - FltControlSys = 0x40000, - LEFlaps = 0x80000, - EngineFault = 0x100000, - Overheat = 0x200000, - FuelLow = 0x400000, - Avionics = 0x800000, - RadarAlt = 0x1000000, - IFF = 0x2000000, - ECM = 0x4000000, - Hook = 0x8000000, - NWSFail = 0x10000000, - CabinPress = 0x20000000, - - AutoPilotOn = 0x40000000, // TRUE if is AP on. NB: This is not a lamp bit! - TFR_STBY = 0x80000000, // MISC panel; lower half of split face TFR lamp - - // Used with the MAL/IND light code to light up "everything" - // please update this if you add/change bits! - AllLampBitsOn = 0xBFFFFFEF - }; - - enum LightBits2 : unsigned - { - // Threat Warning Prime - HandOff = 0x1, - Launch = 0x2, - PriMode = 0x4, - Naval = 0x8, - Unk = 0x10, - TgtSep = 0x20, - - // EWS - Go = 0x40, // On and operating normally - NoGo = 0x80, // On but malfunction present - Degr = 0x100, // Status message: AUTO DEGR - Rdy = 0x200, // Status message: DISPENSE RDY - ChaffLo = 0x400, // Bingo chaff quantity reached - FlareLo = 0x800, // Bingo flare quantity reached - - // Aux Threat Warning - AuxSrch = 0x1000, - AuxAct = 0x2000, - AuxLow = 0x4000, - AuxPwr = 0x8000, - - // ECM - EcmPwr = 0x10000, - EcmFail = 0x20000, - - // Caution Lights - FwdFuelLow = 0x40000, - AftFuelLow = 0x80000, - - EPUOn = 0x100000, // EPU panel; run light - JFSOn = 0x200000, // Eng Jet Start panel; run light - - // Caution panel - SEC = 0x400000, - OXY_LOW = 0x800000, - PROBEHEAT = 0x1000000, - SEAT_ARM = 0x2000000, - BUC = 0x4000000, - FUEL_OIL_HOT = 0x8000000, - ANTI_SKID = 0x10000000, - - TFR_ENGAGED = 0x20000000, // MISC panel; upper half of split face TFR lamp - GEARHANDLE = 0x40000000, // Lamp in gear handle lights on fault or gear in motion - ENGINE = 0x80000000, // Lower half of right eyebrow ENG FIRE/ENGINE lamp - - // Used with the MAL/IND light code to light up "everything" - // please update this if you add/change bits! - AllLampBits2On = 0xFFFFF03F, - AllLampBits2OnExceptCarapace = AllLampBits2On ^ HandOff ^ Launch ^ PriMode ^ Naval ^ Unk ^ TgtSep ^ AuxSrch ^ AuxAct ^ AuxLow ^ AuxPwr - }; - - enum LightBits3 : unsigned - { - // Elec panel - FlcsPmg = 0x1, - MainGen = 0x2, - StbyGen = 0x4, - EpuGen = 0x8, - EpuPmg = 0x10, - ToFlcs = 0x20, - FlcsRly = 0x40, - BatFail = 0x80, - - // EPU panel - Hydrazine = 0x100, - Air = 0x200, - - // Caution panel - Elec_Fault = 0x400, - Lef_Fault = 0x800, - - OnGround = 0x1000, // weight-on-wheels - FlcsBitRun = 0x2000, // FLT CONTROL panel RUN light (used to be Multi-engine fire light) - FlcsBitFail = 0x4000, // FLT CONTROL panel FAIL light (used to be Lock light Cue; non-F-16) - DbuWarn = 0x8000, // Right eyebrow DBU ON cell; was Shoot light cue; non-F16 - NoseGearDown = 0x10000, // Landing gear panel; on means down and locked - LeftGearDown = 0x20000, // Landing gear panel; on means down and locked - RightGearDown = 0x40000, // Landing gear panel; on means down and locked - ParkBrakeOn = 0x100000, // Parking brake engaged; NOTE: not a lamp bit - Power_Off = 0x200000, // Set if there is no electrical power. NB: not a lamp bit - - // Caution panel - cadc = 0x400000, - - // Left Aux console - SpeedBrake = 0x800000, // True if speed brake is in anything other than stowed position - - // Threat Warning Prime - additional bits - SysTest = 0x1000000, - - // Master Caution WILL come up (actual lightBit has 3sec delay like in RL), - // usable for cockpit builders with RL equipment which has a delay on its own. - // Will be set to false again as soon as the MasterCaution bit is set. - MCAnnounced = 0x2000000, - - //MLGWOW is only for AFM , it means WOW switches on MLG are triggered => FLCS switches to WOWPitchRockGain - MLGWOW = 0x4000000, - NLGWOW = 0x8000000, - - ATF_Not_Engaged = 0x10000000, - - // Free bits in LightBits3 - //0x20000000, - //0x40000000, - //0x80000000, - - // Used with the MAL/IND light code to light up "everything" - // please update this if you add/change bits! - AllLampBits3On = 0x1147EFFF, - AllLampBits3OnExceptCarapace = AllLampBits3On ^ SysTest - }; - - enum HsiBits : unsigned - { - ToTrue = 0x01, // HSI_FLAG_TO_TRUE == 1, TO - IlsWarning = 0x02, // HSI_FLAG_ILS_WARN - CourseWarning = 0x04, // HSI_FLAG_CRS_WARN - Init = 0x08, // HSI_FLAG_INIT - TotalFlags = 0x10, // HSI_FLAG_TOTAL_FLAGS; never set - ADI_OFF = 0x20, // ADI OFF Flag - ADI_AUX = 0x40, // ADI AUX Flag - ADI_GS = 0x80, // ADI GS FLAG - ADI_LOC = 0x100, // ADI LOC FLAG - HSI_OFF = 0x200, // HSI OFF Flag - BUP_ADI_OFF = 0x400, // Backup ADI Off Flag - VVI = 0x800, // VVI OFF Flag - AOA = 0x1000, // AOA OFF Flag - AVTR = 0x2000, // AVTR Light - OuterMarker = 0x4000, // MARKER beacon light for outer marker - MiddleMarker = 0x8000, // MARKER beacon light for middle marker - FromTrue = 0x10000, // HSI_FLAG_TO_TRUE == 2, FROM - - Flying = 0x80000000, // true if player is attached to an aircraft (i.e. not in UI state). NOTE: Not a lamp bit - - // Used with the MAL/IND light code to light up "everything" - // please update this is you add/change bits! - AllLampHsiBitsOn = 0xE000 - }; - - // These are outputs from the sim - // Note: some two-engine values removed in this version for compatibility - // reasons. - float x; // Ownship North (Ft) - float y; // Ownship East (Ft) - float z; // Ownship Down (Ft) --- NOTE: use FlightData2 AAUZ for barometric altitude! - float xDot; // Ownship North Rate (ft/sec) - float yDot; // Ownship East Rate (ft/sec) - float zDot; // Ownship Down Rate (ft/sec) - float alpha; // Ownship AOA (Degrees) - float beta; // Ownship Beta (Degrees) - float gamma; // Ownship Gamma (Radians) - float pitch; // Ownship Pitch (Radians) - float roll; // Ownship Pitch (Radians) - float yaw; // Ownship Pitch (Radians) - float mach; // Ownship Mach number - float kias; // Ownship Indicated Airspeed (Knots) - float vt; // Ownship True Airspeed (Ft/Sec) - float gs; // Ownship Normal Gs - float windOffset; // Wind delta to FPM (Radians) - float nozzlePos; // Ownship engine nozzle percent open (0-100) - //float nozzlePos2; // MOVED TO FlightData2! Ownship engine nozzle2 percent open (0-100) - float internalFuel; // Ownship internal fuel (Lbs) - float externalFuel; // Ownship external fuel (Lbs) - float fuelFlow; // Ownship fuel flow (Lbs/Hour) - float rpm; // Ownship engine rpm (Percent 0-103) - //float rpm2; // MOVED TO FlightData2! Ownship engine rpm2 (Percent 0-103) - float ftit; // Ownship Forward Turbine Inlet Temp (Degrees C) - //float ftit2; // MOVED TO FlightData2! Ownship Forward Turbine Inlet Temp2 (Degrees C) - float gearPos; // Ownship Gear position 0 = up, 1 = down; - float speedBrake; // Ownship speed brake position 0 = closed, 1 = 60 Degrees open - float epuFuel; // Ownship EPU fuel (Percent 0-100) - float oilPressure; // Ownship Oil Pressure (Percent 0-100) - //float oilPressure2; // MOVED TO FlightData2! Ownship Oil Pressure2 (Percent 0-100) - unsigned int lightBits; // Cockpit Indicator Lights, one bit per bulb. See enum - - // These are inputs. Use them carefully - // NB: these do not work when TrackIR device is enabled - // NB2: launch falcon with the '-head' command line parameter to activate ! - float headPitch; // Head pitch offset from design eye (radians) - float headRoll; // Head roll offset from design eye (radians) - float headYaw; // Head yaw offset from design eye (radians) - - // new lights - unsigned int lightBits2; // Cockpit Indicator Lights, one bit per bulb. See enum - unsigned int lightBits3; // Cockpit Indicator Lights, one bit per bulb. See enum - - // chaff/flare - float ChaffCount; // Number of Chaff left - float FlareCount; // Number of Flare left - - // landing gear - float NoseGearPos; // Position of the nose landinggear; caution: full down values defined in dat files - float LeftGearPos; // Position of the left landinggear; caution: full down values defined in dat files - float RightGearPos; // Position of the right landinggear; caution: full down values defined in dat files - - // ADI values - float AdiIlsHorPos; // Position of horizontal ILS bar - float AdiIlsVerPos; // Position of vertical ILS bar - - // HSI states - int courseState; // HSI_STA_CRS_STATE - int headingState; // HSI_STA_HDG_STATE - int totalStates; // HSI_STA_TOTAL_STATES; never set - - // HSI values - float courseDeviation; // HSI_VAL_CRS_DEVIATION - float desiredCourse; // HSI_VAL_DESIRED_CRS - float distanceToBeacon; // HSI_VAL_DISTANCE_TO_BEACON - float bearingToBeacon; // HSI_VAL_BEARING_TO_BEACON - float currentHeading; // HSI_VAL_CURRENT_HEADING - float desiredHeading; // HSI_VAL_DESIRED_HEADING - float deviationLimit; // HSI_VAL_DEV_LIMIT - float halfDeviationLimit; // HSI_VAL_HALF_DEV_LIMIT - float localizerCourse; // HSI_VAL_LOCALIZER_CRS - float airbaseX; // HSI_VAL_AIRBASE_X - float airbaseY; // HSI_VAL_AIRBASE_Y - float totalValues; // HSI_VAL_TOTAL_VALUES; never set - - float TrimPitch; // Value of trim in pitch axis, -0.5 to +0.5 - float TrimRoll; // Value of trim in roll axis, -0.5 to +0.5 - float TrimYaw; // Value of trim in yaw axis, -0.5 to +0.5 - - // HSI flags - unsigned int hsiBits; // HSI flags - - //DED Lines - char DEDLines[5][26]; //25 usable chars - char Invert[5][26]; //25 usable chars - - //PFL Lines - char PFLLines[5][26]; //25 usable chars - char PFLInvert[5][26]; //25 usable chars - - //TacanChannel - int UFCTChan, AUXTChan; - - // RWR - int RwrObjectCount; - int RWRsymbol[40]; - float bearing[40]; - unsigned long missileActivity[40]; - unsigned long missileLaunch[40]; - unsigned long selected[40]; - float lethality[40]; - unsigned long newDetection[40]; - - //fuel values - float fwd, aft, total; - -#if 0 - void SetLightBit (unsigned int newBit) {lightBits |= newBit;}; - void ClearLightBit(unsigned int newBit) { lightBits &= ~newBit; }; - bool IsSet(unsigned int newBit) { return ((lightBits & newBit) != 0); }; - - void SetLightBit2(unsigned int newBit) { lightBits2 |= newBit; }; - void ClearLightBit2(unsigned int newBit) { lightBits2 &= ~newBit; }; - bool IsSet2(unsigned int newBit) { return ((lightBits2 & newBit) != 0); }; - - void SetLightBit3(unsigned int newBit) { lightBits3 |= newBit; }; - void ClearLightBit3(unsigned int newBit) { lightBits3 &= ~newBit; }; - bool IsSet3(unsigned int newBit) { return ((lightBits3 & newBit) != 0); }; - - void SetHsiBit(unsigned int newBit) { hsiBits |= newBit; }; - void ClearHsiBit(unsigned int newBit) { hsiBits &= ~newBit; }; - bool IsSetHsi(unsigned int newBit) { return ((hsiBits & newBit) != 0); }; -#endif - - int VersionNum; // Version of FlightData mem area - - // New values added here for header file compatibility but not implemented - // in this version of the code at present. - float headX; // Head X offset from design eye (feet) - float headY; // Head Y offset from design eye (feet) - float headZ; // Head Z offset from design eye (feet) - - int MainPower; // Main Power switch state, 0=down, 1=middle, 2=up -}; - - -// OSB capture for MFD button labeling - -#define OSB_STRING_LENGTH 8 // currently strings appear to be max 7 printing chars - -struct OsbLabel { - char line1[OSB_STRING_LENGTH]; - char line2[OSB_STRING_LENGTH]; - bool inverted; -}; - - -// *** "FalconSharedOsbMemoryArea" *** -struct OSBData -{ - OsbLabel leftMFD[20]; - OsbLabel rightMFD[20]; -}; - - -#define FLIGHTDATA2_VERSION 9 -// changelog: -// 1: initial BMS 4.33 version -// 2: added AltCalReading, altBits, BupUhfPreset, powerBits, blinkBits, cmdsMode -// 3: added VersionNum, hydPressureA/B, cabinAlt, BupUhfFreq, currentTime, vehicleACD -// 4: added fuelflow2 -// 5: added RwrInfo, lefPos, tefPos -// 6: added vtolPos -// 7: bit fields are now unsigned instead of signed -// 8: increased RwrInfo size to 512 -// 9: added human pilot names and their status in a session - -// do NOT change these w/o crosschecking the BMS code -#define RWRINFO_SIZE 512 -#define CALLSIGN_LEN 12 -#define MAX_CALLSIGNS 32 - -// *** "FalconSharedMemoryArea2" *** -struct FlightData2 -{ - // TACAN - enum TacanSources : unsigned - { - UFC = 0, - AUX = 1, - NUMBER_OF_SOURCES = 2, - }; - enum TacanBits : unsigned - { - band = 0x01, // true in this bit position if band is X - mode = 0x02, // true in this bit position if domain is air to air - }; - - // ALTIMETER - enum AltBits : unsigned - { - CalType = 0x01, // true if calibration in inches of Mercury (Hg), false if in hectoPascal (hPa) - PneuFlag = 0x02, // true if PNEU flag is visible - }; - - // POWER - enum PowerBits : unsigned - { - BusPowerBattery = 0x01, // true if at least the battery bus is powered - BusPowerEmergency = 0x02, // true if at least the emergency bus is powered - BusPowerEssential = 0x04, // true if at least the essential bus is powered - BusPowerNonEssential = 0x08, // true if at least the non-essential bus is powered - MainGenerator = 0x10, // true if the main generator is online - StandbyGenerator = 0x20, // true if the standby generator is online - JetFuelStarter = 0x40, // true if JFS is running, can be used for magswitch - }; - - // BLINKING LIGHTS - only indicating *IF* a lamp is blinking, not implementing the actual on/off/blinking pattern logic! - enum BlinkBits : unsigned - { - // currently working - OuterMarker = 0x01, // defined in HsiBits - slow flashing for outer marker - MiddleMarker = 0x02, // defined in HsiBits - fast flashing for middle marker - PROBEHEAT = 0x04, // defined in LightBits2 - probeheat system is tested - AuxSrch = 0x08, // defined in LightBits2 - search function in NOT activated and a search radar is painting ownship - Launch = 0x10, // defined in LightBits2 - missile is fired at ownship - PriMode = 0x20, // defined in LightBits2 - priority mode is enabled but more than 5 threat emitters are detected - Unk = 0x40, // defined in LightBits2 - unknown is not active but EWS detects unknown radar - - // not working yet, defined for future use - Elec_Fault = 0x80, // defined in LightBits3 - non-resetting fault - OXY_BROW = 0x100, // defined in LightBits - monitor fault during Obogs - EPUOn = 0x200, // defined in LightBits3 - abnormal EPU operation - JFSOn_Slow = 0x400, // defined in LightBits3 - slow blinking: non-critical failure - JFSOn_Fast = 0x800, // defined in LightBits3 - fast blinking: critical failure - }; - - // CMDS mode state - enum CmdsModes : unsigned - { - CmdsOFF = 0, - CmdsSTBY = 1, - CmdsMAN = 2, - CmdsSEMI = 3, - CmdsAUTO = 4, - CmdsBYP = 5, - }; - - // HSI/eHSI mode state - enum NavModes : unsigned - { - ILS_TACAN = 0, - TACAN = 1, - NAV = 2, - ILS_NAV = 3, - }; - - // human pilot state - enum FlyStates : unsigned - { - IN_UI = 0, // UI - in the UI - LOADING = 1, // UI>3D - loading the sim data - WAITING = 2, // UI>3D - waiting for other players - FLYING = 3, // 3D - flying - DEAD = 4, // 3D>Dead - dead, waiting to respawn - UNKNOWN = 5, // ??? - }; - - // VERSION 1 - float nozzlePos2; // Ownship engine nozzle2 percent open (0-100) - float rpm2; // Ownship engine rpm2 (Percent 0-103) - float ftit2; // Ownship Forward Turbine Inlet Temp2 (Degrees C) - float oilPressure2; // Ownship Oil Pressure2 (Percent 0-100) - unsigned char navMode; // current mode selected for HSI/eHSI, see NavModes enum for details - float AAUZ; // Ownship barometric altitude given by AAU (depends on calibration) - char tacanInfo[NUMBER_OF_SOURCES]; // Tacan band/mode settings for UFC and AUX COMM - - // VERSION 2 / 7 - int AltCalReading; // barometric altitude calibration (depends on CalType) - unsigned int altBits; // various altimeter bits, see AltBits enum for details - unsigned int powerBits; // Ownship power bus / generator states, see PowerBits enum for details - unsigned int blinkBits; // Cockpit indicator lights blink status, see BlinkBits enum for details - // NOTE: these bits indicate only *if* a lamp is blinking, in addition to the - // existing on/off bits. It's up to the external program to implement the - // *actual* blinking. - int cmdsMode; // Ownship CMDS mode state, see CmdsModes enum for details - int BupUhfPreset; // BUP UHF channel preset - - // VERSION 3 - int BupUhfFreq; // BUP UHF channel frequency - float cabinAlt; // Ownship cabin altitude - float hydPressureA; // Ownship Hydraulic Pressure A - float hydPressureB; // Ownship Hydraulic Pressure B - int currentTime; // Current time in seconds (max 60 * 60 * 24) - short vehicleACD; // Ownship ACD index number, i.e. which aircraft type are we flying. - int VersionNum; // Version of FlightData2 mem area - - // VERSION 4 - float fuelFlow2; // Ownship fuel flow2 (Lbs/Hour) - - // VERSION 5 / 8 - char RwrInfo[RWRINFO_SIZE]; // New RWR Info - float lefPos; // Ownship LEF position - float tefPos; // Ownship TEF position - - // VERSION 6 - float vtolPos; // Ownship VTOL exhaust angle - - // VERSION 9 - char pilotsOnline; // Number of pilots in an MP session - char pilotsCallsign[MAX_CALLSIGNS][CALLSIGN_LEN]; // List of pilots callsign connected to an MP session - char pilotsStatus[MAX_CALLSIGNS]; // Status of the MP pilots, see enum FlyStates - -#if 0 - // TACAN - // setters for internal use only - void SetUfcTacanToAA(bool t) { if (t) { tacanInfo[UFC] |= mode; } else { tacanInfo[UFC] &= ~mode; } } - void SetAuxTacanToAA(bool t) { if (t) { tacanInfo[AUX] |= mode; } else { tacanInfo[AUX] &= ~mode; } } - void SetUfcTacanToX(bool t) { if (t) { tacanInfo[UFC] |= band; } else { tacanInfo[UFC] &= ~band; } } - void SetAuxTacanToX(bool t) { if (t) { tacanInfo[AUX] |= band; } else { tacanInfo[AUX] &= ~band; } } - - // getters for external reader programs - bool UfcTacanIsAA(void) {return ((tacanInfo[UFC] & mode) != 0); } - bool AuxTacanIsAA(void) {return ((tacanInfo[AUX] & mode) != 0); } - bool UfcTacanIsX(void) {return ((tacanInfo[UFC] & band) != 0); } - bool AuxTacanIsX(void) {return ((tacanInfo[AUX] & band) != 0); } - - // ALTIMETER - void SetAltBit(unsigned int newBit) { altBits |= newBit; }; - void ClearAltBit(unsigned int newBit) { altBits &= ~newBit; }; - bool IsSetAlt(unsigned int newBit) { return ((altBits & newBit) != 0); }; - - // POWER - void SetPowerBit(unsigned int newBit) { powerBits |= newBit; }; - void ClearPowerBit(unsigned int newBit) { powerBits &= ~newBit; }; - bool IsSetPower(unsigned int newBit) { return ((powerBits & newBit) != 0); }; - - // BLINKING LIGHTS - void SetBlinkBit(unsigned int newBit) { blinkBits |= newBit; }; - void ClearBlinkBit(unsigned int newBit) { blinkBits &= ~newBit; }; - bool IsSetBlink(unsigned int newBit) { return ((blinkBits & newBit) != 0); }; - - // CMDS mode state - void SetCmdsMode(int newMode) {cmdsMode = newMode;}; - int GetCmdsMode(void) {return cmdsMode;}; - - // HSI/eHSI mode state - void SetNavMode(int newMode) {navMode = newMode;}; - int GetNavMode(void) {return navMode;}; -#endif -}; - -#define BMS_MEM_OSB "FalconSharedOsbMemoryArea" -#define BMS_MEM_DATA1 "FalconSharedMemoryArea" -#define BMS_MEM_DATA2 "FalconSharedMemoryArea2" - -#if 0 -extern OSBData cockpitOSBData; // "FalconSharedOsbMemoryArea" -extern FlightData cockpitFlightData; // "FalconSharedMemoryArea" -extern FlightData2 cockpitFlightData2; // "FalconSharedMemoryArea2" -#endif diff --git a/ext-falcon-bms-linear-acc/bms-shm.cpp b/ext-falcon-bms-linear-acc/bms-shm.cpp deleted file mode 100644 index be7d94ff..00000000 --- a/ext-falcon-bms-linear-acc/bms-shm.cpp +++ /dev/null @@ -1,2 +0,0 @@ -#include "FlightData.h" - diff --git a/ext-falcon-bms-linear-acc/bms-shm.hpp b/ext-falcon-bms-linear-acc/bms-shm.hpp deleted file mode 100644 index 3f59c932..00000000 --- a/ext-falcon-bms-linear-acc/bms-shm.hpp +++ /dev/null @@ -1,2 +0,0 @@ -#pragma once - diff --git a/ext-falcon-bms-linear-acc/falcon-bms-dialog.cpp b/ext-falcon-bms-linear-acc/falcon-bms-dialog.cpp deleted file mode 100644 index d4268a06..00000000 --- a/ext-falcon-bms-linear-acc/falcon-bms-dialog.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include "falcon-bms-dialog.hpp" - -void falcon_bms_acceleration_dialog::register_extension(IExtension&) -{ -} - -void falcon_bms_acceleration_dialog::unregister_extension() -{ -} diff --git a/ext-falcon-bms-linear-acc/falcon-bms-dialog.hpp b/ext-falcon-bms-linear-acc/falcon-bms-dialog.hpp deleted file mode 100644 index 9aa5baa3..00000000 --- a/ext-falcon-bms-linear-acc/falcon-bms-dialog.hpp +++ /dev/null @@ -1,10 +0,0 @@ -#pragma once - -#include "falcon-bms-ext.hpp" - -struct falcon_bms_acceleration_dialog : IExtensionDialog -{ -public: - void register_extension(IExtension& ext) override; - void unregister_extension() override; -}; diff --git a/ext-falcon-bms-linear-acc/falcon-bms-ext.cpp b/ext-falcon-bms-linear-acc/falcon-bms-ext.cpp deleted file mode 100644 index b6a32540..00000000 --- a/ext-falcon-bms-linear-acc/falcon-bms-ext.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include "falcon-bms-ext.hpp" - -IExtension::event_mask falcon_bms_acceleration_ext::hook_types() -{ - return IExtension::on_finished; -} - -falcon_bms_acceleration_ext::falcon_bms_acceleration_ext() -{ -} - -void falcon_bms_acceleration_ext::process_finished(Pose& p) -{ - (void)p; -} diff --git a/ext-falcon-bms-linear-acc/falcon-bms-ext.hpp b/ext-falcon-bms-linear-acc/falcon-bms-ext.hpp deleted file mode 100644 index e08d5377..00000000 --- a/ext-falcon-bms-linear-acc/falcon-bms-ext.hpp +++ /dev/null @@ -1,11 +0,0 @@ -#pragma once - -#include "api/plugin-api.hpp" - -struct falcon_bms_acceleration_ext : IExtension -{ - event_mask hook_types() override; - falcon_bms_acceleration_ext(); - void process_finished(Pose&p) override; - module_status initialize() override { return status_ok(); } -}; diff --git a/ext-falcon-bms-linear-acc/falcon-bms-metadata.cpp b/ext-falcon-bms-linear-acc/falcon-bms-metadata.cpp deleted file mode 100644 index fa95447c..00000000 --- a/ext-falcon-bms-linear-acc/falcon-bms-metadata.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "falcon-bms-metadata.hpp" - -QString falcon_bms_acceleration_metadata::name() -{ - return "Falcon BMS linear acceleration display"; -} - -QIcon falcon_bms_acceleration_metadata::icon() -{ - return QIcon(); -} diff --git a/ext-falcon-bms-linear-acc/falcon-bms-metadata.hpp b/ext-falcon-bms-linear-acc/falcon-bms-metadata.hpp deleted file mode 100644 index eea0d6bd..00000000 --- a/ext-falcon-bms-linear-acc/falcon-bms-metadata.hpp +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once - -#include "falcon-bms-ext.hpp" - -struct falcon_bms_acceleration_metadata : Metadata -{ - QString name() override; - QIcon icon() override; -}; diff --git a/ext-falcon-bms-linear-acc/lang/nl_NL.ts b/ext-falcon-bms-linear-acc/lang/nl_NL.ts deleted file mode 100644 index 9e739505..00000000 --- a/ext-falcon-bms-linear-acc/lang/nl_NL.ts +++ /dev/null @@ -1,4 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="nl_NL"> -</TS> diff --git a/ext-falcon-bms-linear-acc/lang/ru_RU.ts b/ext-falcon-bms-linear-acc/lang/ru_RU.ts deleted file mode 100644 index f62cf2e1..00000000 --- a/ext-falcon-bms-linear-acc/lang/ru_RU.ts +++ /dev/null @@ -1,4 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1" language="ru_RU"> -</TS> diff --git a/ext-falcon-bms-linear-acc/lang/stub.ts b/ext-falcon-bms-linear-acc/lang/stub.ts deleted file mode 100644 index 6401616d..00000000 --- a/ext-falcon-bms-linear-acc/lang/stub.ts +++ /dev/null @@ -1,4 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1"> -</TS> diff --git a/ext-falcon-bms-linear-acc/lang/zh_CN.ts b/ext-falcon-bms-linear-acc/lang/zh_CN.ts deleted file mode 100644 index 6401616d..00000000 --- a/ext-falcon-bms-linear-acc/lang/zh_CN.ts +++ /dev/null @@ -1,4 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.1"> -</TS> diff --git a/ext-falcon-bms-linear-acc/module.cpp b/ext-falcon-bms-linear-acc/module.cpp deleted file mode 100644 index 80a9553d..00000000 --- a/ext-falcon-bms-linear-acc/module.cpp +++ /dev/null @@ -1,5 +0,0 @@ -#include "falcon-bms-ext.hpp" -#include "falcon-bms-dialog.hpp" -#include "falcon-bms-metadata.hpp" - -OPENTRACK_DECLARE_EXTENSION(falcon_bms_acceleration_ext, falcon_bms_acceleration_dialog, falcon_bms_acceleration_metadata) diff --git a/logic/extensions.cpp b/logic/extensions.cpp deleted file mode 100644 index 03d03a83..00000000 --- a/logic/extensions.cpp +++ /dev/null @@ -1,74 +0,0 @@ -#include "extensions.hpp" - -#include <functional> - -using namespace options; - -using ext_fun_type = void(IExtension::*)(Pose&); -using ext_mask = IExtension::event_mask; -using ext_ord = IExtension::event_ordinal; - -static constexpr struct event_type_mapping -{ - ext_fun_type ptr; - ext_mask mask; - ext_ord idx; -} ordinal_to_function[] = { - { &IExtension::process_raw, ext_mask::on_raw, ext_ord::ev_raw, }, - { &IExtension::process_before_filter, ext_mask::on_before_filter, ext_ord::ev_before_filter, }, - { &IExtension::process_before_mapping, ext_mask::on_before_mapping, ext_ord::ev_before_mapping, }, - { &IExtension::process_finished, ext_mask::on_finished, ext_ord::ev_finished, }, -}; - -bool event_handler::is_enabled(const QString& name) -{ - (void)name; -#if 1 - return true; -#else - if (!ext_bundle->contains(name)) - return false; - - return ext_bundle->get<bool>(name); -#endif -} - -event_handler::event_handler(Modules::dylib_list const& extensions) : ext_bundle(make_bundle("extensions")) -{ - for (std::shared_ptr<dylib> const& lib : extensions) - { - std::shared_ptr<IExtension> ext(reinterpret_cast<IExtension*>(lib->Constructor())); - std::shared_ptr<IExtensionDialog> dlg(reinterpret_cast<IExtensionDialog*>(lib->Dialog())); - std::shared_ptr<Metadata_> m(lib->Meta()); - - const ext_mask mask = ext->hook_types(); - - if (!is_enabled(lib->module_name)) - continue; - -#if 0 - qDebug() << "extension" << lib->module_name << "mask" << (void*)mask; -#endif - - for (event_type_mapping const& mapping : ordinal_to_function) - { - const unsigned i = mapping.idx; - const ext_mask mask_ = mapping.mask; - - if (mask & mask_) - extensions_for_event[i].push_back({ ext, dlg, m }); - } - } -} - -void event_handler::run_events(event_ordinal k, Pose& pose) -{ -#if 0 - auto fun = std::mem_fn(ordinal_to_function[k].ptr); - - for (extension& x : extensions_for_event[k]) - fun(*x.logic, pose); -#else - (void)k; (void)pose; -#endif -} diff --git a/logic/extensions.hpp b/logic/extensions.hpp deleted file mode 100644 index 3368b118..00000000 --- a/logic/extensions.hpp +++ /dev/null @@ -1,44 +0,0 @@ -#pragma once - -/* Copyright (c) 2017 Stanislaw Halik - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - */ - -#include "api/plugin-support.hpp" -#include "options/options.hpp" - -#include <vector> -#include <array> - -#include "export.hpp" - -struct OTR_LOGIC_EXPORT event_handler final -{ - using event_ordinal = IExtension::event_ordinal; - - struct extension - { - using ext = std::shared_ptr<IExtension>; - using dlg = std::shared_ptr<IExtensionDialog>; - using m = std::shared_ptr<Metadata_>; - - ext logic; - dlg dialog; - m metadata; - }; - - void run_events(event_ordinal k, Pose& pose); - event_handler(Modules::dylib_list const& extensions); - -private: - using ext_list = std::vector<extension>; - std::array<ext_list, IExtension::event_count> extensions_for_event; - - options::bundle ext_bundle; - - bool is_enabled(const QString& name); -}; - diff --git a/logic/pipeline.cpp b/logic/pipeline.cpp index 074cce24..4bb11424 100644 --- a/logic/pipeline.cpp +++ b/logic/pipeline.cpp @@ -184,8 +184,8 @@ Pose_ reltrans::apply_neck(const rmat& R, int nz, bool disable_tz) const return neck; } -pipeline::pipeline(const Mappings& m, const runtime_libraries& libs, event_handler& ev, TrackLogger& logger) : - m(m), ev(ev), libs(libs), logger(logger) +pipeline::pipeline(const Mappings& m, const runtime_libraries& libs, TrackLogger& logger) : + m(m), libs(libs), logger(logger) { } @@ -422,7 +422,6 @@ Pose pipeline::apply_reltrans(Pose value, vec6_bool disabled, bool centerp) void pipeline::logic() { using namespace euler; - using EV = event_handler::event_ordinal; logger.write_dt(); logger.reset_dt(); @@ -435,7 +434,6 @@ void pipeline::logic() { Pose tmp; libs.pTracker->data(tmp); - ev.run_events(EV::ev_raw, tmp); newpose = tmp; } @@ -454,7 +452,6 @@ void pipeline::logic() } { - ev.run_events(EV::ev_before_filter, value); // we must proceed with all the filtering since the filter // needs fresh values to prevent deconvergence if (center_ordered) @@ -466,7 +463,6 @@ void pipeline::logic() } { - ev.run_events(EV::ev_before_mapping, value); // CAVEAT rotation only, due to reltrans for (int i = 3; i < 6; i++) value(i) = map(value(i), m(i)); @@ -508,7 +504,6 @@ ok: last_value = value; value = apply_zero_pos(value); - ev.run_events(EV::ev_finished, value); libs.pProtocol->pose(value, raw); QMutexLocker foo(&mtx); diff --git a/logic/pipeline.hpp b/logic/pipeline.hpp index 80d4d8a7..a539525d 100644 --- a/logic/pipeline.hpp +++ b/logic/pipeline.hpp @@ -8,7 +8,6 @@ #include "compat/euler.hpp" #include "compat/enum-operators.hpp" #include "runtime-libraries.hpp" -#include "extensions.hpp" #include "spline/spline.hpp" #include "main-settings.hpp" @@ -85,7 +84,6 @@ class OTR_LOGIC_EXPORT pipeline : private QThread mutable QMutex mtx; main_settings s; const Mappings& m; - event_handler& ev; Timer t; Pose output_pose, raw_6dof, last_value; @@ -125,7 +123,7 @@ class OTR_LOGIC_EXPORT pipeline : private QThread bits b; public: - pipeline(const Mappings& m, const runtime_libraries& libs, event_handler& ev, TrackLogger& logger); + pipeline(const Mappings& m, const runtime_libraries& libs, TrackLogger& logger); ~pipeline() override; void raw_and_mapped_pose(double* mapped, double* raw) const; diff --git a/logic/state.cpp b/logic/state.cpp index 357430d8..8218e5c3 100644 --- a/logic/state.cpp +++ b/logic/state.cpp @@ -22,7 +22,6 @@ std::tuple<dylib_ptr, int> State::module_by_name(const QString& name, dylib_list State::State(const QString& library_path) : modules(library_path), - ev(modules.extensions()), pose(s.all_axis_opts) {} diff --git a/logic/state.hpp b/logic/state.hpp index abce1daf..809ca458 100644 --- a/logic/state.hpp +++ b/logic/state.hpp @@ -12,7 +12,6 @@ #include "api/plugin-support.hpp" #include "main-settings.hpp" #include "mappings.hpp" -#include "extensions.hpp" #include "work.hpp" #include "export.hpp" @@ -32,7 +31,6 @@ struct OTR_LOGIC_EXPORT State dylib_ptr current_filter(); Modules modules; - event_handler ev; main_settings s; module_settings m; Mappings pose; diff --git a/logic/work.cpp b/logic/work.cpp index 7689f916..8c6a3a62 100644 --- a/logic/work.cpp +++ b/logic/work.cpp @@ -57,10 +57,10 @@ std::unique_ptr<TrackLogger> Work::make_logger(main_settings &s) } -Work::Work(const Mappings& m, event_handler& ev, QFrame* frame, +Work::Work(const Mappings& m, QFrame* frame, const dylibptr& tracker, const dylibptr& filter, const dylibptr& proto) : libs(frame, tracker, filter, proto), - pipeline_{ m, libs, ev, *logger } + pipeline_{ m, libs, *logger } { if (!is_ok()) return; diff --git a/logic/work.hpp b/logic/work.hpp index 6521c09d..ef839257 100644 --- a/logic/work.hpp +++ b/logic/work.hpp @@ -59,7 +59,7 @@ public: key_tuple(s.key_zero_press2, [this](bool x) { pipeline_.set_zero(x); }, false), }; - Work(const Mappings& m, event_handler& ev, QFrame* frame, + Work(const Mappings& m, QFrame* frame, const dylibptr& tracker, const dylibptr& filter, const dylibptr& proto); void reload_shortcuts(); bool is_ok() const; diff --git a/opentrack/main-window.cpp b/opentrack/main-window.cpp index 9e7b8695..a4db3430 100644 --- a/opentrack/main-window.cpp +++ b/opentrack/main-window.cpp @@ -418,7 +418,7 @@ void main_window::start_tracker_() if (work) return; - work = std::make_shared<Work>(pose, ev, ui.video_frame, current_tracker(), current_protocol(), current_filter()); + work = std::make_shared<Work>(pose, ui.video_frame, current_tracker(), current_protocol(), current_filter()); if (!work->is_ok()) { diff --git a/variant/default/_variant.cmake b/variant/default/_variant.cmake index 7353b0f4..ffa795d0 100644 --- a/variant/default/_variant.cmake +++ b/variant/default/_variant.cmake @@ -6,7 +6,6 @@ function(otr_init_variant) "tracker-*" "proto-*" "filter-*" - "ext-*" "options" "api" "compat" |