Index: src/mlx/pyuipc_sim.py
===================================================================
--- src/mlx/pyuipc_sim.py	(revision 211)
+++ src/mlx/pyuipc_sim.py	(revision 212)
@@ -25,4 +25,5 @@
 SIM_FS2K2=6
 SIM_FS2K4=7
+SIM_FSX=8
 
 #------------------------------------------------------------------------------
@@ -260,4 +261,7 @@
         for i in range(0, Values.HOTKEY_SIZE):
             self.hotkeyTable.append([0, 0, 0, 0])
+
+        self.pmdg_737ng_switches = 0
+        self.pmdg_737ngx_lts_positionsw = 0
 
     def read(self, offset, type):
@@ -480,4 +484,8 @@
         elif offset==0x3d00:       # Name of the current aircraft
             return self.aircraftName
+        elif offset==0x6202:       # PMDG 737NG switches
+            return self.pmdg_737ng_switches
+        elif offset==0x6500:       # PMDG 737NGX lights position SW
+            return self.pmdg_737ngx_lts_positionsw
         else:
             print "Unhandled offset: %04x" % (offset,)
@@ -688,4 +696,8 @@
         elif offset==0x3d00:       # Name of the current aircraft
             self.aircraftName = value
+        elif offset==0x6202:       # PMDG 737NG switches
+            self.pmdg_737ng_switches = value
+        elif offset==0x6500:       # PMDG 737NGX lights position SW
+            self.pmdg_737ngx_lts_positionsw = value
         else:
             print "Unhandled offset: %04x" % (offset,)
@@ -808,6 +820,7 @@
 CALL_READ=1
 CALL_WRITE=2
-CALL_CLOSE=3
-CALL_FAILOPEN=4
+CALL_SETVERSION=3
+CALL_CLOSE=4
+CALL_FAILOPEN=5
 CALL_QUIT = 99
 
@@ -853,4 +866,8 @@
                     elif call==CALL_WRITE:
                         result = write(args[0])
+                    elif call==CALL_SETVERSION:
+                        global fs_version
+                        fs_version = args[0]
+                        result = None
                     elif call==CALL_CLOSE:
                         global opened
@@ -899,4 +916,8 @@
         """Write the given data."""
         return self._call(CALL_WRITE, data)
+
+    def setVersion(self, version):
+        """Set the FS version to emulate."""
+        return self._call(CALL_SETVERSION, int(version))
 
     def close(self):
@@ -1231,4 +1252,13 @@
                                                       lambda value: "0x%08x" % (value,),
                                                       lambda word: long(word, 16))
+
+        self._valueHandlers["pmdg_737ng_switches"] = (0x6202, "b",
+                                                      lambda value: value,
+                                                      lambda word: int(word))
+
+        self._valueHandlers["pmdg_737ngx_lts_positionsw"] = (0x6500, "b",
+                                                             lambda value: value,
+                                                             lambda word: int(word))
+
     def default(self, line):
         """Handle unhandle commands."""
@@ -1313,4 +1343,18 @@
             return [key + "=" for key in self._valueHandlers if key.startswith(text)]
 
+    def do_setversion(self, args):
+        """Set the version number to simulate"""
+        try:
+            value = int(args)
+            self._client.setVersion(value)
+            print "Emulating version %d" % (value,)
+        except Exception, e:
+            print >> sys.stderr, "Failed to set the version: " + str(e)
+
+    def help_setversion(self, usage = False):
+        """Help for the setversion command"""
+        if usage: print "Usage:",
+        print "setversion <number>"
+
     def do_close(self, args):
         """Close an existing connection so that FS will fail."""
@@ -1319,5 +1363,5 @@
             print "Connection closed"
         except Exception, e:
-            print >> sys.stderr, "Failed to close the connection: " + str(e)        
+            print >> sys.stderr, "Failed to close the connection: " + str(e)
         
     def do_failopen(self, args):
@@ -1331,5 +1375,5 @@
 
     def help_failopen(self, usage = False):
-        """Help for the failopen close"""
+        """Help for the failopen command"""
         if usage: print "Usage:",
         print "failopen yes|no"
