Ignore:
Timestamp:
12/21/22 10:17:25 (16 months ago)
Author:
István Váradi <ivaradi@…>
Branch:
python3
Phase:
public
Message:

Support for connecting to X-Plane remotely

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/config.py

    r1045 r1067  
    260260        self._updateURLUpdated = True
    261261
     262        self._xplaneRemote = False
     263        self._xplaneAddress = ""
     264
    262265        self._messageTypeLevels = {}
    263266
     
    667670        if updateURL!=self._updateURL:
    668671            self._updateURL = updateURL
     672            self._modified = True
     673
     674    @property
     675    def xplaneRemote(self):
     676        """Indicate if X-Plane should be accessed remotely."""
     677        return self._xplaneRemote
     678
     679    @xplaneRemote.setter
     680    def xplaneRemote(self, xplaneRemote):
     681        """Set if X-Plane should be accessed remotely."""
     682        if xplaneRemote!=self._xplaneRemote:
     683            self._xplaneRemote = xplaneRemote
     684            self._modified = True
     685
     686    @property
     687    def xplaneAddress(self):
     688        """Get the address of the machine running X-Plane"""
     689        return self._xplaneAddress
     690
     691    @xplaneAddress.setter
     692    def xplaneAddress(self, xplaneAddress):
     693        """Set the address of the machine running X-Plane."""
     694        if xplaneAddress!=self._xplaneAddress:
     695            self._xplaneAddress = xplaneAddress
    669696            self._modified = True
    670697
     
    799826                                             "defaultMSFS", os.name=="nt")
    800827
     828        self._xplaneRemote = self._getBoolean(config, "general",
     829                                              "xplaneRemote", False)
     830        self._xplaneAddress = self._get(config, "general",
     831                                        "xplaneAddress", "")
     832
    801833        self._modified = False
    802834
     
    852884                   "yes" if self._defaultMSFS else "no")
    853885
     886        config.set("general", "xplaneRemote",
     887                   "yes" if self._xplaneRemote else "no")
     888        config.set("general", "xplaneAddress", self._xplaneAddress)
     889
    854890        config.add_section(Config._messageTypesSection)
    855891        for messageType in const.messageTypes:
     
    10021038
    10031039        print("  defaultMSFS:", self._defaultMSFS)
     1040        print("  xplaneRemote:", self._xplaneRemote)
     1041        print("  xplaneAddress:", self._xplaneAddress)
    10041042
    10051043        print("  enableSounds:", self._enableSounds)
Note: See TracChangeset for help on using the changeset viewer.