User:Bugman/subsystems: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
(→‎All subsystems: Updated the output to match the newest script.)
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Hunting down subsystems ==
== Tracking down subsystems ==
 
=== Script ===


The following script is for finding all FlightGear dependencies:
The following script is for finding all FlightGear dependencies:
Line 5: Line 7:
{{collapsible script
{{collapsible script
| type  = Python script
| type  = Python script
| title  = Python script for finding all subsystems within the C++ code base.
| title  = Python script for finding all subsystems within the flightgear and simgear C++ code bases.
| intro  = This script requires the ''grep'' Unix command, which can be installed on any OS.  And it must be run with Python3.
| lang  = python
| lang  = python
| script =  
| script =  
#! /usr/bin/env python3
#! /usr/bin/env python3


 
# Python module imports.
import operator
import operator
from re import search, split
from re import search, split
from subprocess import PIPE, Popen
from subprocess import PIPE, Popen
import sys
# Source code repository paths.
SIMGEAR_PATH = "/flightgear/src/flightgear-simgear"
FLIGHTGEAR_PATH = "/flightgear/src/flightgear-flightgear"




class FindSubsystems:
class FindSubsystems:
    """Class for finding all subsystems and subsystem groups."""
     def __init__(self):
     def __init__(self):
        """Find all subsystems and subsystem groups."""
        # Command line options.
        self.xml = False
        if len(sys.argv) == 2 and sys.argv[1] == "--xml":
            self.xml = True
        # SGSubsystem storage lists.
        self.subsystems = [[], [], [], []]
        self.groups = [[], [], [], []]
        # The base objects.
        subsystem_base = Subsystem("SGSubsystem", xml=self.xml)
        group_base = Subsystem("SGSubsystemGroup", base_class=Subsystem("SGSubsystem"), xml=self.xml)
        # Add some problematic non-parsable classes.
        self.subsystems[1].append(Subsystem("FGAISim", base_class=Subsystem("FGInterface", base_class=Subsystem("SGSubsystem")), file_name="src/FDM/SP/AISim.hpp", xml=self.xml))
        # XML start.
        if self.xml:
            print("<subsystems>")
        # Find all SGSubsystem and SGSubsystemGroup derived classes.
        paths = [SIMGEAR_PATH, FLIGHTGEAR_PATH]
        printout = [False, True]
        for i in range(len(paths)):
            self.find_primary(path=paths[i], text="classes", primary=self.subsystems[0], base_name="SGSubsystem", base=subsystem_base, skip=["SGSubsystemGroup"], printout=printout[i])
            self.find_primary(path=paths[i], text="groups", primary=self.groups[0], base_name="SGSubsystemGroup", base=group_base, printout=printout[i])
            self.find_secondary(path=paths[i], text="classes", primary=self.subsystems[0], secondary=self.subsystems[1], printout=printout[i])
            self.find_secondary(path=paths[i], text="groups", primary=self.groups[0], secondary=self.groups[1], printout=printout[i])
            self.find_tertiary(path=paths[i], text="classes", secondary=self.subsystems[1], tertiary=self.subsystems[2], printout=printout[i])
            self.find_tertiary(path=paths[i], text="groups", secondary=self.groups[1], tertiary=self.groups[2], printout=printout[i])
            self.find_quaternary(path=paths[i], text="classes", tertiary=self.subsystems[2], quaternary=self.subsystems[3], printout=printout[i])
            self.find_quaternary(path=paths[i], text="groups", tertiary=self.groups[2], quaternary=self.groups[3], printout=printout[i])
        # Final summary.
        self.summarise()
        # XML end.
        if self.xml:
            print("</subsystems>")
    def count(self, storage_list):
        """Count the number of subsystems and subsystem groups.
        @param storage_list:    The data structure to count.
        @type storage_list:    list of Subsystem instances
        @return:                The number of subsystems and number of groups.
        @rtype:                int, int
        """


         # Init.
         # Init.
         self.classes_primary = []
         subsystems = 0
         self.classes_secondary = []
         groups = 0
         self.classes_tertiary = []
         for element in storage_list:
        self.classes_quaternary = []
            if element.is_group():
                groups += 1
            else:
                subsystems += 1


         self.find_primary_classes()
         # Return the counts.
         self.find_secondary_classes()
         return subsystems, groups
        self.find_tertiary_classes()
        self.find_quaternary_classes()


        self.classes_primary.sort(key=operator.attrgetter('name'))
        self.classes_secondary.sort(key=operator.attrgetter('name'))
        self.classes_tertiary.sort(key=operator.attrgetter('name'))
        self.classes_quaternary.sort(key=operator.attrgetter('name'))


         # Print out.
    def find_primary(self, path=None, text=None, primary=None, base_name=None, base=None, skip=[], printout=False):
         print("\nPrimary classes (%i):" % len(self.classes_primary))
        """Find all primary subsystems and groups
         for subsystem in self.classes_primary:
 
            print("   %s" % subsystem)
        @keyword path:      The path to the repository to search through.
        if self.classes_secondary:
        @type path:        str
            print("\nSecondary classes (%i):" % len(self.classes_secondary))
        @keyword text:      Text identifying subsystems vs. subsystem groups.
             for subsystem in self.classes_secondary:
        @type text:        str
        @keyword primary:  The primary list of subsystems or groups.
        @type primary:      list of Subsystem instances
        @keyword base_name: The name of the base class.
        @type base_name:    str
        @keyword base:      The base class object.
        @type base:        Subsystem instance
        @keyword skip:      A list of class names to skip.
        @type skip:        list of str
        @keyword printout:  A flag which if True will activate the printout of subsystems.
        @type printout:    bool
        """
 
         # Find all subsystems or groups.
         for file_name, class_name in self.grep(path=path, base_name=base_name):
            if class_name in skip:
                continue
            primary.append(Subsystem(class_name, base_class=base, file_name=file_name, xml=self.xml))
 
        # Sort the subsystems by name.
        primary.sort(key=operator.attrgetter('name'))
 
         # Printout.
        if printout:
            counts = self.count(primary)
            if self.xml:
                print(" <primary_%s subsystems=\"%i\" groups=\"%i\">" % (text, counts[0], counts[1]))
            else:
                print("\nPrimary %s (%i subsystems, %i groups):" % (text, counts[0], counts[1]))
             for subsystem in primary:
                 print("    %s" % subsystem)
                 print("    %s" % subsystem)
         if self.classes_tertiary:
            if self.xml:
             print("\nTertiary classes (%i):" % len(self.classes_tertiary))
                print("  </primary_%s>" % text)
             for subsystem in self.classes_tertiary:
 
 
    def find_secondary(self, path=None, text=None, primary=None, secondary=None, printout=False):
        """Find all secondary subsystems and groups
 
        @keyword path:      The path to the repository to search through.
        @type path:        str
        @keyword text:      Text identifying subsystems vs. subsystem groups.
        @type text:        str
        @keyword primary:  The primary list of subsystems or groups.
        @type primary:      list of Subsystem instances
        @keyword secondary: The secondary list of subsystems or groups.
         @type secondary:    list of Subsystem instances
        @keyword printout:  A flag which if True will activate the printout of subsystems.
        @type printout:    bool
        """
 
        # Loop over all primary subsystems.
        for subsystem in primary:
            for file_name, derived_class in self.grep(path=path, base_name=subsystem.name):
                secondary.append(Subsystem(derived_class, base_class=subsystem, file_name=file_name, xml=self.xml))
 
        # Sort the subsystems by name.
        secondary.sort(key=operator.attrgetter('name'))
 
        # Printout.
        if printout and secondary:
             counts = self.count(secondary)
            if self.xml:
                print(" <secondary_%s subsystems=\"%i\" groups=\"%i\">" % (text, counts[0], counts[1]))
            else:
                print("\nSecondary %s (%i subsystems, %i groups):" % (text, counts[0], counts[1]))
             for subsystem in secondary:
                 print("    %s" % subsystem)
                 print("    %s" % subsystem)
         if self.classes_quaternary:
            if self.xml:
             print("\nQuaternary classes (%i):" % len(self.classes_quaternary))
                print("  </secondary_%s>" % text)
             for subsystem in self.classes_quaternary:
 
 
    def find_tertiary(self, path=None, text=None, secondary=None, tertiary=None, printout=False):
        """Find all tertiary subsystems and groups
 
        @keyword path:      The path to the repository to search through.
        @type path:        str
        @keyword text:      Text identifying subsystems vs. subsystem groups.
        @type text:        str
        @keyword secondary: The secondary list of subsystems or groups.
        @type secondary:    list of Subsystem instances
        @keyword tertiary:  The tertiary list of subsystems or groups.
         @type tertiary:    list of Subsystem instances
        @keyword printout:  A flag which if True will activate the printout of subsystems.
        @type printout:    bool
        """
 
        # Loop over all secondary subsystems.
        for subsystem in secondary:
            for file_name, derived_class in self.grep(path=path, base_name=subsystem.name):
                tertiary.append(Subsystem(derived_class, base_class=subsystem, file_name=file_name, xml=self.xml))
 
        # Sort all subsystems by name.
        tertiary.sort(key=operator.attrgetter('name'))
 
        # Printout.
        if printout and tertiary:
             counts = self.count(tertiary)
            if self.xml:
                print(" <tertiary_%s subsystems=\"%i\" groups=\"%i\">" % (text, counts[0], counts[1]))
            else:
                print("\nTertiary %s (%i subsystems, %i groups):" % (text, counts[0], counts[1]))
             for subsystem in tertiary:
                 print("    %s" % subsystem)
                 print("    %s" % subsystem)
        print("\nTotal: %i subsystem classes." % len(self.classes_primary + self.classes_secondary + self.classes_tertiary + self.classes_quaternary))
            if self.xml:
                print(" </tertiary_%s>" % text)




     def find_primary_classes(self):
     def find_quaternary(self, path=None, text=None, tertiary=None, quaternary=None, printout=False):
         base = Subsystem("SGSubsystem")
         """Find all tertiary subsystems and groups
        for file_name, class_name in self.grep("SGSubsystem"):
            self.classes_primary.append(Subsystem(class_name, base_class=base, file_name=file_name))


        @keyword path:          The path to the repository to search through.
        @type path:            str
        @keyword text:          Text identifying subsystems vs. subsystem groups.
        @type text:            str
        @keyword tertiary:      The tertiary list of subsystems or groups.
        @type tertiary:        list of Subsystem instances
        @keyword quaternary:    The quaternary list of subsystems or groups.
        @type quaternary:      list of Subsystem instances
        @keyword printout:      A flag which if True will activate the printout of subsystems.
        @type printout:        bool
        """


    def find_secondary_classes(self):
        # Loop over all tertiary subsystems.
         for subsystem in self.classes_primary:
         for subsystem in tertiary:
             for file_name, derived_class in self.grep(subsystem.name):
             for file_name, derived_class in self.grep(path=path, base_name=subsystem.name):
                 self.classes_secondary.append(Subsystem(derived_class, base_class=subsystem, file_name=file_name))
                 quaternary.append(Subsystem(derived_class, base_class=subsystem, file_name=file_name, xml=self.xml))


        # Sort all subsystems by name.
        quaternary.sort(key=operator.attrgetter('name'))


    def find_tertiary_classes(self):
        # Printout.
        for subsystem in self.classes_secondary:
        if printout and quaternary:
             for file_name, derived_class in self.grep(subsystem.name):
            counts = self.count(quaternary)
                 self.classes_tertiary.append(Subsystem(derived_class, base_class=subsystem, file_name=file_name))
             if self.xml:
                print("  <quaternary_%s subsystems=\"%i\" groups=\"%i\">" % (text, counts[0], counts[1]))
            else:
                 print("\nQuaternary %s (%i subsystems, %i groups):" % (text, counts[0], counts[1]))
            for subsystem in quaternary:
                print("    %s" % subsystem)
            if self.xml:
                print("  </quaternary_%s>" % text)




     def find_quaternary_classes(self):
     def grep(self, path=None, base_name=None):
         for subsystem in self.classes_tertiary:
         """Generator method for finding all classes derived from the given base name and repository.
            for file_name, derived_class in self.grep(subsystem.name):
                self.classes_quaternary.append(Subsystem(derived_class, base_class=subsystem, file_name=file_name))


        @keyword path:      The path to the repository to search through.
        @type path:        str
        @keyword base_name: The name of the base class.
        @type base_name:    str
        @return:            The source file and the name of the derived class.
        @rtype:            str, str
        """


    def grep(self, base_name):
        # The Unix grep command to run.
         cmd = 'grep -rI "public \<%s\>" {{!}} grep -v "%s::"' % (base_name, base_name)
         cmd = 'cd %s; grep -rI "public \<%s\>" | grep -v "%s::"' % (path, base_name, base_name)
         pipe = Popen(cmd, shell=True, stdout=PIPE)
         pipe = Popen(cmd, shell=True, stdout=PIPE)
        # Read all output.
         for line in pipe.stdout.readlines():
         for line in pipe.stdout.readlines():
            # Convert the byte-array.
             line = line.decode()
             line = line.decode()
            # Skip this script.
             if search("grep ", line):
             if search("grep ", line):
                 continue
                 continue
            # Cannot handle this line!
             if not search("class ", line):
             if not search("class ", line):
                 print("Skipping: %s" % repr(line[:-1]))
                 sys.stderr.write("\nSkipping: %s\n" % repr(line[:-1]))
                 continue
                 continue
            # Split by single colons.
             elements = split("(?<!:):(?!:)", line)
             elements = split("(?<!:):(?!:)", line)
            # The file and class name.
             file_name = elements[0]
             file_name = elements[0]
             class_name = elements[1]
             class_name = elements[1]
             class_name = class_name.replace("class", "")
             class_name = class_name.replace("class", "")
             class_name = class_name.strip()
             class_name = class_name.strip()
            # Generator method.
             yield file_name, class_name
             yield file_name, class_name
    def summarise(self):
        """Print out a summary of all found subsystems and subsystem groups."""
        # Counts.
        subsystem_classes = len(self.subsystems[0] + self.subsystems[1] + self.subsystems[2] + self.subsystems[3])
        subsystem_groups = len(self.groups[0] + self.groups[1] + self.groups[2] + self.groups[3])
        subsystem_total = subsystem_classes + subsystem_groups
        # Separate simgear and flightgear subsystems.
        subsystem_classes_simgear = 0
        subsystem_classes_flightgear = 0
        subsystem_groups_simgear = 0
        subsystem_groups_flightgear = 0
        for subsystem in self.subsystems[0] + self.subsystems[1] + self.subsystems[2] + self.subsystems[3]:
            if subsystem.file_name[:7] == "simgear":
                subsystem_classes_simgear += 1
            else:
                subsystem_classes_flightgear += 1
        for group in self.groups[0] + self.groups[1] + self.groups[2] + self.groups[3]:
            if group.file_name[:7] == "simgear":
                subsystem_groups_simgear += 1
            else:
                subsystem_groups_flightgear += 1
        # Sums.
        simgear_total = subsystem_classes_simgear + subsystem_groups_simgear
        flightgear_total = subsystem_classes_flightgear + subsystem_groups_flightgear
        if self.xml:
            print("<total subsystem_classes=\"%i\" subsystem_groups=\"%i\" total=\"%i\"/>" % (subsystem_classes, subsystem_groups, subsystem_total))
            print("<simgear subsystem_classes=\"%i\" subsystem_groups=\"%i\" total=\"%i\"/>" % (subsystem_classes_simgear, subsystem_groups_simgear, simgear_total))
            print("<flightgear subsystem_classes=\"%i\" subsystem_groups=\"%i\" total=\"%i\"/>" % (subsystem_classes_flightgear, subsystem_groups_flightgear, flightgear_total))
        else:
            print("\nTotal: %i subsystem classes (%i flightgear, %i simgear)." % (subsystem_classes, subsystem_classes_flightgear, subsystem_classes_simgear))
            print("Total: %i subsystem groups (%i flightgear, %i simgear)." % (subsystem_groups, subsystem_groups_flightgear, subsystem_groups_simgear))
            print("Total: %i subsystem classes and groups (%i flightgear, %i simgear)." % (subsystem_total, flightgear_total, simgear_total))






class Subsystem:
class Subsystem:
     def __init__(self, name, base_class=None, file_name=None):
    """Object for storing the information for a specific subsystem."""
 
     def __init__(self, name, base_class=None, file_name=None, xml=False):
        """Set up the object.
 
        @param name:            The name of the subsystem.
        @type name:            str
        @keyword base_class:    The name of the base class.
        @type base_class:      str
        @keyword file_name:    The name of the file containing the subsystem declaration.
        @type file_name:        str
        @keyword xml:          Produce a valid XML representation of the object.
        @type xml:              bool
        """
 
        # Store the data.
         self.name = name
         self.name = name
         self.base_class = base_class
         self.base_class = base_class
         self.file_name = file_name
         self.file_name = file_name
        self.xml = xml




     def __repr__(self):
     def __repr__(self):
        """Overwrite the string representation of the object.
        @return:    The string representation.
        @rtype:    str
        """
        # The subsystem name.
         string = "<%s" % self.name
         string = "<%s" % self.name
        # The inheritance chain.
         if self.base_class:
         if self.base_class:
             string += " (from %s" % self.base_class.name
             if self.xml:
                string += " from=\""
            else:
                string += " : "
            string += "%s" % self.base_class.name
             if self.base_class.base_class:
             if self.base_class.base_class:
                 string += " : %s" % self.base_class.base_class.name
                 string += " : %s" % self.base_class.base_class.name
Line 114: Line 373:
                     if self.base_class.base_class.base_class.base_class:
                     if self.base_class.base_class.base_class.base_class:
                         string += " : %s" % self.base_class.base_class.base_class.base_class.name
                         string += " : %s" % self.base_class.base_class.base_class.base_class.name
             string += ")"
                        if self.base_class.base_class.base_class.base_class.base_class:
                            string += " : %s" % self.base_class.base_class.base_class.base_class.base_class.name
            if self.xml:
                string += "\""
 
        # Add the source file name.
        if self.xml:
            string += " in="
        else:
            string += " in "
        string += "\"%s\"" % self.file_name
 
        # Closure.
        if self.xml:
             string += "/"
         string += ">"
         string += ">"


        # Return the representation.
         return string
         return string




    def is_group(self):
        """Determine this is a subsystem or subsystem group.
        @return:    True if this is a subsystem group.
        @rtype:    bool
        """
        # Chase the base name as far as possible.
        if self.name == "SGSubsystemGroup":
            return True
        if self.base_class.name == "SGSubsystemGroup":
            return True
        if self.base_class.base_class:
            if self.base_class.base_class.name == "SGSubsystemGroup":
                return True
            if self.base_class.base_class.base_class:
                if self.base_class.base_class.base_class.name == "SGSubsystemGroup":
                    return True
                if self.base_class.base_class.base_class.base_class:
                    if self.base_class.base_class.base_class.base_class.name == "SGSubsystemGroup":
                        return True
                    if self.base_class.base_class.base_class.base_class.base_class:
                        if self.base_class.base_class.base_class.base_class.name.base_class.name == "SGSubsystemGroup":
                            return True


        # A normal subsystem.
        return False
# Instantiate the class if run as a script.
if __name__ == "__main__":
if __name__ == "__main__":
     FindSubsystems()
     FindSubsystems()
}}
}}
=== All subsystems ===


The result is:
The result is:
{{collapsible script
| type  = XML output
| title  = A listing of all flightgear and simgear subsystems and subsystem groups.
| intro  = XML output from the Python script for finding all subsystems within the flightgear and simgear C++ code bases.  The error output from the script was redirected and hence not shown below.
| lang  = xml
| script =
<subsystems>
  <primary_classes subsystems="91" groups="0">
    <ADF from="SGSubsystem" in="src/Instrumentation/adf.hxx"/>
    <AirportDynamicsManager from="SGSubsystem" in="src/Airports/airportdynamicsmanager.hxx"/>
    <AirspeedIndicator from="SGSubsystem" in="src/Instrumentation/airspeed_indicator.hxx"/>
    <Altimeter from="SGSubsystem" in="src/Instrumentation/altimeter.hxx"/>
    <AreaSampler from="SGSubsystem" in="src/Environment/terrainsampler.cxx"/>
    <AttitudeIndicator from="SGSubsystem" in="src/Instrumentation/attitude_indicator.hxx"/>
    <Clock from="SGSubsystem" in="src/Instrumentation/clock.hxx"/>
    <CommRadio from="SGSubsystem" in="src/Instrumentation/commradio.hxx"/>
    <Component from="SGSubsystem" in="src/Autopilot/component.hxx"/>
    <DCLGPS from="SGSubsystem" in="src/Instrumentation/dclgps.hxx"/>
    <DME from="SGSubsystem" in="src/Instrumentation/dme.hxx"/>
    <Ephemeris from="SGSubsystem" in="src/Environment/ephemeris.hxx"/>
    <FDMShell from="SGSubsystem" in="src/FDM/fdm_shell.hxx"/>
    <FGAIManager from="SGSubsystem" in="src/AIModel/AIManager.hxx"/>
    <FGATCManager from="SGSubsystem" in="src/ATC/atc_mgr.hxx"/>
    <FGAircraftModel from="SGSubsystem" in="src/Model/acmodel.hxx"/>
    <FGCom from="SGSubsystem" in="src/Network/fgcom.hxx"/>
    <FGControls from="SGSubsystem" in="src/Aircraft/controls.hxx"/>
    <FGDNSClient from="SGSubsystem" in="src/Network/DNSClient.hxx"/>
    <FGElectricalSystem from="SGSubsystem" in="src/Systems/electrical.hxx"/>
    <FGEventInput from="SGSubsystem" in="src/Input/FGEventInput.hxx"/>
    <FGFX from="SGSubsystem" in="docs-mini/README.introduction"/>
    <FGFlightHistory from="SGSubsystem" in="src/Aircraft/FlightHistory.hxx"/>
    <FGHTTPClient from="SGSubsystem" in="src/Network/HTTPClient.hxx"/>
    <FGHttpd from="SGSubsystem" in="src/Network/http/httpd.hxx"/>
    <FGIO from="SGSubsystem" in="src/Main/fg_io.hxx"/>
    <FGInterface from="SGSubsystem" in="src/FDM/flight.hxx"/>
    <FGJoystickInput from="SGSubsystem" in="src/Input/FGJoystickInput.hxx"/>
    <FGKR_87 from="SGSubsystem" in="src/Instrumentation/kr_87.hxx"/>
    <FGKeyboardInput from="SGSubsystem" in="src/Input/FGKeyboardInput.hxx"/>
    <FGLight from="SGSubsystem" in="src/Time/light.hxx"/>
    <FGLogger from="SGSubsystem" in="src/Main/logger.hxx"/>
    <FGMagVarManager from="SGSubsystem" in="src/Environment/magvarmanager.hxx"/>
    <FGMarkerBeacon from="SGSubsystem" in="src/Instrumentation/marker_beacon.hxx"/>
    <FGModelMgr from="SGSubsystem" in="src/Model/modelmgr.hxx"/>
    <FGMouseInput from="SGSubsystem" in="src/Input/FGMouseInput.hxx"/>
    <FGMultiplayMgr from="SGSubsystem" in="src/MultiPlayer/multiplaymgr.hxx"/>
    <FGNasalSys from="SGSubsystem" in="src/Scripting/NasalSys.hxx"/>
    <FGNavRadio from="SGSubsystem" in="src/Instrumentation/navradio.hxx"/>
    <FGPanel from="SGSubsystem" in="utils/fgpanel/FGPanel.hxx"/>
    <FGPanelProtocol from="SGSubsystem" in="utils/fgpanel/FGPanelProtocol.hxx"/>
    <FGPrecipitationMgr from="SGSubsystem" in="src/Environment/precipitation_mgr.hxx"/>
    <FGProperties from="SGSubsystem" in="src/Main/fg_props.hxx"/>
    <FGReplay from="SGSubsystem" in="src/Aircraft/replay.hxx"/>
    <FGRidgeLift from="SGSubsystem" in="src/Environment/ridge_lift.hxx"/>
    <FGRouteMgr from="SGSubsystem" in="src/Autopilot/route_mgr.hxx"/>
    <FGScenery from="SGSubsystem" in="src/Scenery/scenery.hxx"/>
    <FGSoundManager from="SGSubsystem" in="src/Sound/soundmanager.hxx"/>
    <FGSubmodelMgr from="SGSubsystem" in="src/AIModel/submodel.hxx"/>
    <FGTrafficManager from="SGSubsystem" in="src/Traffic/TrafficMgr.hxx"/>
    <FGViewMgr from="SGSubsystem" in="src/Viewer/viewmgr.hxx"/>
    <FGVoiceMgr from="SGSubsystem" in="src/Sound/voice.hxx"/>
    <GPS from="SGSubsystem" in="src/Instrumentation/gps.hxx"/>
    <GSDI from="SGSubsystem" in="src/Instrumentation/gsdi.hxx"/>
    <GUIMgr from="SGSubsystem" in="src/Canvas/gui_mgr.hxx"/>
    <GroundRadar from="SGSubsystem" in="src/Cockpit/groundradar.hxx"/>
    <HUD from="SGSubsystem" in="src/Instrumentation/HUD/HUD.hxx"/>
    <HeadingIndicator from="SGSubsystem" in="src/Instrumentation/heading_indicator.hxx"/>
    <HeadingIndicatorDG from="SGSubsystem" in="src/Instrumentation/heading_indicator_dg.hxx"/>
    <HeadingIndicatorFG from="SGSubsystem" in="src/Instrumentation/heading_indicator_fg.hxx"/>
    <InstVerticalSpeedIndicator from="SGSubsystem" in="src/Instrumentation/inst_vertical_speed_indicator.hxx"/>
    <LayerInterpolateController from="SGSubsystem" in="src/Environment/environment_ctrl.hxx"/>
    <MK_VIII from="SGSubsystem" in="src/Instrumentation/mk_viii.hxx"/>
    <MagCompass from="SGSubsystem" in="src/Instrumentation/mag_compass.hxx"/>
    <MasterReferenceGyro from="SGSubsystem" in="src/Instrumentation/mrg.hxx"/>
    <NavDisplay from="SGSubsystem" in="src/Cockpit/NavDisplay.hxx"/>
    <NavRadio from="SGSubsystem" in="src/Instrumentation/newnavradio.hxx"/>
    <NewGUI from="SGSubsystem" in="src/GUI/new_gui.hxx"/>
    <PerformanceDB from="SGSubsystem" in="src/AIModel/performancedb.hxx"/>
    <PitotSystem from="SGSubsystem" in="src/Systems/pitot.hxx"/>
    <PropertyBasedMgr from="SGSubsystem" in="simgear/props/PropertyBasedMgr.hxx"/>
    <PropertyInterpolationMgr from="SGSubsystem" in="simgear/props/PropertyInterpolationMgr.hxx"/>
    <RadarAltimeter from="SGSubsystem" in="src/Instrumentation/rad_alt.hxx"/>
    <RealWxController from="SGSubsystem" in="src/Environment/realwx_ctrl.hxx"/>
    <SGEventMgr from="SGSubsystem" in="simgear/structure/event_mgr.hxx"/>
    <SGInterpolator from="SGSubsystem" in="simgear/misc/interpolator.hxx"/>
    <SGPerformanceMonitor from="SGSubsystem" in="simgear/structure/SGPerfMon.hxx"/>
    <SGSoundMgr from="SGSubsystem" in="simgear/sound/soundmgr.hxx"/>
    <SGSubsystemMgr from="SGSubsystem" in="simgear/structure/subsystem_mgr.hxx"/>
    <SGTerraSync from="SGSubsystem" in="simgear/scene/tsync/terrasync.hxx"/>
    <SlipSkidBall from="SGSubsystem" in="src/Instrumentation/slip_skid_ball.hxx"/>
    <StaticSystem from="SGSubsystem" in="src/Systems/static.hxx"/>
    <TACAN from="SGSubsystem" in="src/Instrumentation/tacan.hxx"/>
    <TCAS from="SGSubsystem" in="src/Instrumentation/tcas.hxx"/>
    <TimeManager from="SGSubsystem" in="src/Time/TimeManager.hxx"/>
    <Transponder from="SGSubsystem" in="src/Instrumentation/transponder.hxx"/>
    <TurnIndicator from="SGSubsystem" in="src/Instrumentation/turn_indicator.hxx"/>
    <VacuumSystem from="SGSubsystem" in="src/Systems/vacuum.hxx"/>
    <VerticalSpeedIndicator from="SGSubsystem" in="src/Instrumentation/vertical_speed_indicator.hxx"/>
    <View from="SGSubsystem" in="src/Viewer/view.hxx"/>
    <wxRadarBg from="SGSubsystem" in="src/Cockpit/wxradar.hxx"/>
  </primary_classes>
  <primary_groups subsystems="0" groups="8">
    <Autopilot from="SGSubsystemGroup : SGSubsystem" in="src/Autopilot/autopilot.hxx"/>
    <CockpitDisplayManager from="SGSubsystemGroup : SGSubsystem" in="src/Cockpit/cockpitDisplayManager.hxx"/>
    <FGEnvironmentMgr from="SGSubsystemGroup : SGSubsystem" in="src/Environment/environment_mgr.hxx"/>
    <FGInput from="SGSubsystemGroup : SGSubsystem" in="src/Input/input.hxx"/>
    <FGInstrumentMgr from="SGSubsystemGroup : SGSubsystem" in="src/Instrumentation/instrument_mgr.hxx"/>
    <FGSystemMgr from="SGSubsystemGroup : SGSubsystem" in="src/Systems/system_mgr.hxx"/>
    <FGXMLAutopilotGroup from="SGSubsystemGroup : SGSubsystem" in="src/Autopilot/autopilotgroup.hxx"/>
    <TerrainSampler from="SGSubsystemGroup : SGSubsystem" in="src/Environment/terrainsampler.hxx"/>
  </primary_groups>
  <secondary_classes subsystems="28" groups="0">
    <AnalogComponent from="Component : SGSubsystem" in="src/Autopilot/analogcomponent.hxx"/>
    <BasicRealWxController from="RealWxController : SGSubsystem" in="src/Environment/realwx_ctrl.cxx"/>
    <CanvasMgr from="PropertyBasedMgr : SGSubsystem" in="simgear/canvas/CanvasMgr.hxx"/>
    <CommRadioImpl from="CommRadio : SGSubsystem" in="src/Instrumentation/commradio.cxx"/>
    <DigitalComponent from="Component : SGSubsystem" in="src/Autopilot/digitalcomponent.hxx"/>
    <FGACMS from="FGInterface : SGSubsystem" in="src/FDM/SP/ACMS.hxx"/>
    <FGADA from="FGInterface : SGSubsystem" in="src/FDM/SP/ADA.hxx"/>
    <FGAISim from="FGInterface : SGSubsystem" in="src/FDM/SP/AISim.hpp"/>
    <FGBalloonSim from="FGInterface : SGSubsystem" in="src/FDM/SP/Balloon.h"/>
    <FGExternalNet from="FGInterface : SGSubsystem" in="src/FDM/ExternalNet/ExternalNet.hxx"/>
    <FGExternalPipe from="FGInterface : SGSubsystem" in="src/FDM/ExternalPipe/ExternalPipe.hxx"/>
    <FGHIDEventInput from="FGEventInput : SGSubsystem" in="src/Input/FGHIDEventInput.hxx"/>
    <FGJSBsim from="FGInterface : SGSubsystem" in="src/FDM/JSBSim/JSBSim.hxx"/>
    <FGLaRCsim from="FGInterface : SGSubsystem" in="src/FDM/LaRCsim/LaRCsim.hxx"/>
    <FGLinuxEventInput from="FGEventInput : SGSubsystem" in="src/Input/FGLinuxEventInput.hxx"/>
    <FGMacOSXEventInput from="FGEventInput : SGSubsystem" in="src/Input/FGMacOSXEventInput.hxx"/>
    <FGMagicCarpet from="FGInterface : SGSubsystem" in="src/FDM/SP/MagicCarpet.hxx"/>
    <FGNullFDM from="FGInterface : SGSubsystem" in="src/FDM/NullFDM.hxx"/>
    <FGReadablePanel from="FGPanel : SGSubsystem" in="utils/fgpanel/panel_io.hxx"/>
    <FGSoundManager from="SGSoundMgr : SGSubsystem" in="src/Sound/soundmanager.hxx"/>
    <FGUFO from="FGInterface : SGSubsystem" in="src/FDM/UFO.hxx"/>
    <KLN89 from="DCLGPS : SGSubsystem" in="src/Instrumentation/KLN89/kln89.hxx"/>
    <LayerInterpolateControllerImplementation from="LayerInterpolateController : SGSubsystem" in="src/Environment/environment_ctrl.cxx"/>
    <MongooseHttpd from="FGHttpd : SGSubsystem" in="src/Network/http/httpd.cxx"/>
    <NavRadioImpl from="NavRadio : SGSubsystem" in="src/Instrumentation/newnavradio.cxx"/>
    <StateMachineComponent from="Component : SGSubsystem" in="src/Autopilot/autopilot.cxx"/>
    <YASim from="FGInterface : SGSubsystem" in="src/FDM/YASim/YASim.hxx"/>
    <agRadar from="wxRadarBg : SGSubsystem" in="src/Cockpit/agradar.hxx"/>
  </secondary_classes>
  <secondary_groups subsystems="0" groups="2">
    <FGXMLAutopilotGroupImplementation from="FGXMLAutopilotGroup : SGSubsystemGroup : SGSubsystem" in="src/Autopilot/autopilotgroup.cxx"/>
    <TerrainSamplerImplementation from="TerrainSampler : SGSubsystemGroup : SGSubsystem" in="src/Environment/terrainsampler.cxx"/>
  </secondary_groups>
  <tertiary_classes subsystems="6" groups="0">
    <DigitalFilter from="AnalogComponent : Component : SGSubsystem" in="src/Autopilot/digitalfilter.hxx"/>
    <Logic from="DigitalComponent : Component : SGSubsystem" in="src/Autopilot/logic.hxx"/>
    <NoaaMetarRealWxController from="BasicRealWxController : RealWxController : SGSubsystem" in="src/Environment/realwx_ctrl.cxx"/>
    <PIDController from="AnalogComponent : Component : SGSubsystem" in="src/Autopilot/pidcontroller.hxx"/>
    <PISimpleController from="AnalogComponent : Component : SGSubsystem" in="src/Autopilot/pisimplecontroller.hxx"/>
    <Predictor from="AnalogComponent : Component : SGSubsystem" in="src/Autopilot/predictor.hxx"/>
  </tertiary_classes>
  <quaternary_classes subsystems="1" groups="0">
    <FlipFlop from="Logic : DigitalComponent : Component : SGSubsystem" in="src/Autopilot/flipflop.hxx"/>
  </quaternary_classes>
<total subsystem_classes="126" subsystem_groups="10" total="136"/>
<simgear subsystem_classes="9" subsystem_groups="0" total="9"/>
<flightgear subsystem_classes="117" subsystem_groups="10" total="127"/>
</subsystems>
| show  = 1
}}


{{collapsible script
{{collapsible script
| type  = Text output
| type  = Text output
| title  = Output from the Python script for finding all subsystems within the C++ code base.
| title = A listing of all flightgear and simgear subsystems and subsystem groups.
| lang  = text
| intro = Output from the Python script for finding all subsystems within the flightgear and simgear C++ code bases.  The error output from the script was redirected and hence not shown below.
| lang  = c
| script =  
| script =  
Skipping: 'src/FDM/SP/AISim.hpp:       : public FGInterface'
Primary classes (91 subsystems, 0 groups):
    <ADF : SGSubsystem in "src/Instrumentation/adf.hxx">
    <AirportDynamicsManager : SGSubsystem in "src/Airports/airportdynamicsmanager.hxx">
    <AirspeedIndicator : SGSubsystem in "src/Instrumentation/airspeed_indicator.hxx">
    <Altimeter : SGSubsystem in "src/Instrumentation/altimeter.hxx">
    <AreaSampler : SGSubsystem in "src/Environment/terrainsampler.cxx">
    <AttitudeIndicator : SGSubsystem in "src/Instrumentation/attitude_indicator.hxx">
    <Clock : SGSubsystem in "src/Instrumentation/clock.hxx">
    <CommRadio : SGSubsystem in "src/Instrumentation/commradio.hxx">
    <Component : SGSubsystem in "src/Autopilot/component.hxx">
    <DCLGPS : SGSubsystem in "src/Instrumentation/dclgps.hxx">
    <DME : SGSubsystem in "src/Instrumentation/dme.hxx">
    <Ephemeris : SGSubsystem in "src/Environment/ephemeris.hxx">
    <FDMShell : SGSubsystem in "src/FDM/fdm_shell.hxx">
    <FGAIManager : SGSubsystem in "src/AIModel/AIManager.hxx">
    <FGATCManager : SGSubsystem in "src/ATC/atc_mgr.hxx">
    <FGAircraftModel : SGSubsystem in "src/Model/acmodel.hxx">
    <FGCom : SGSubsystem in "src/Network/fgcom.hxx">
    <FGControls : SGSubsystem in "src/Aircraft/controls.hxx">
    <FGDNSClient : SGSubsystem in "src/Network/DNSClient.hxx">
    <FGElectricalSystem : SGSubsystem in "src/Systems/electrical.hxx">
    <FGEventInput : SGSubsystem in "src/Input/FGEventInput.hxx">
    <FGFX : SGSubsystem in "docs-mini/README.introduction">
    <FGFlightHistory : SGSubsystem in "src/Aircraft/FlightHistory.hxx">
    <FGHTTPClient : SGSubsystem in "src/Network/HTTPClient.hxx">
    <FGHttpd : SGSubsystem in "src/Network/http/httpd.hxx">
    <FGIO : SGSubsystem in "src/Main/fg_io.hxx">
    <FGInterface : SGSubsystem in "src/FDM/flight.hxx">
    <FGJoystickInput : SGSubsystem in "src/Input/FGJoystickInput.hxx">
    <FGKR_87 : SGSubsystem in "src/Instrumentation/kr_87.hxx">
    <FGKeyboardInput : SGSubsystem in "src/Input/FGKeyboardInput.hxx">
    <FGLight : SGSubsystem in "src/Time/light.hxx">
    <FGLogger : SGSubsystem in "src/Main/logger.hxx">
    <FGMagVarManager : SGSubsystem in "src/Environment/magvarmanager.hxx">
    <FGMarkerBeacon : SGSubsystem in "src/Instrumentation/marker_beacon.hxx">
    <FGModelMgr : SGSubsystem in "src/Model/modelmgr.hxx">
    <FGMouseInput : SGSubsystem in "src/Input/FGMouseInput.hxx">
    <FGMultiplayMgr : SGSubsystem in "src/MultiPlayer/multiplaymgr.hxx">
    <FGNasalSys : SGSubsystem in "src/Scripting/NasalSys.hxx">
    <FGNavRadio : SGSubsystem in "src/Instrumentation/navradio.hxx">
    <FGPanel : SGSubsystem in "utils/fgpanel/FGPanel.hxx">
    <FGPanelProtocol : SGSubsystem in "utils/fgpanel/FGPanelProtocol.hxx">
    <FGPrecipitationMgr : SGSubsystem in "src/Environment/precipitation_mgr.hxx">
    <FGProperties : SGSubsystem in "src/Main/fg_props.hxx">
    <FGReplay : SGSubsystem in "src/Aircraft/replay.hxx">
    <FGRidgeLift : SGSubsystem in "src/Environment/ridge_lift.hxx">
    <FGRouteMgr : SGSubsystem in "src/Autopilot/route_mgr.hxx">
    <FGScenery : SGSubsystem in "src/Scenery/scenery.hxx">
    <FGSoundManager : SGSubsystem in "src/Sound/soundmanager.hxx">
    <FGSubmodelMgr : SGSubsystem in "src/AIModel/submodel.hxx">
    <FGTrafficManager : SGSubsystem in "src/Traffic/TrafficMgr.hxx">
    <FGViewMgr : SGSubsystem in "src/Viewer/viewmgr.hxx">
    <FGVoiceMgr : SGSubsystem in "src/Sound/voice.hxx">
    <GPS : SGSubsystem in "src/Instrumentation/gps.hxx">
    <GSDI : SGSubsystem in "src/Instrumentation/gsdi.hxx">
    <GUIMgr : SGSubsystem in "src/Canvas/gui_mgr.hxx">
    <GroundRadar : SGSubsystem in "src/Cockpit/groundradar.hxx">
    <HUD : SGSubsystem in "src/Instrumentation/HUD/HUD.hxx">
    <HeadingIndicator : SGSubsystem in "src/Instrumentation/heading_indicator.hxx">
    <HeadingIndicatorDG : SGSubsystem in "src/Instrumentation/heading_indicator_dg.hxx">
    <HeadingIndicatorFG : SGSubsystem in "src/Instrumentation/heading_indicator_fg.hxx">
    <InstVerticalSpeedIndicator : SGSubsystem in "src/Instrumentation/inst_vertical_speed_indicator.hxx">
    <LayerInterpolateController : SGSubsystem in "src/Environment/environment_ctrl.hxx">
    <MK_VIII : SGSubsystem in "src/Instrumentation/mk_viii.hxx">
    <MagCompass : SGSubsystem in "src/Instrumentation/mag_compass.hxx">
    <MasterReferenceGyro : SGSubsystem in "src/Instrumentation/mrg.hxx">
    <NavDisplay : SGSubsystem in "src/Cockpit/NavDisplay.hxx">
    <NavRadio : SGSubsystem in "src/Instrumentation/newnavradio.hxx">
    <NewGUI : SGSubsystem in "src/GUI/new_gui.hxx">
    <PerformanceDB : SGSubsystem in "src/AIModel/performancedb.hxx">
    <PitotSystem : SGSubsystem in "src/Systems/pitot.hxx">
    <PropertyBasedMgr : SGSubsystem in "simgear/props/PropertyBasedMgr.hxx">
    <PropertyInterpolationMgr : SGSubsystem in "simgear/props/PropertyInterpolationMgr.hxx">
    <RadarAltimeter : SGSubsystem in "src/Instrumentation/rad_alt.hxx">
    <RealWxController : SGSubsystem in "src/Environment/realwx_ctrl.hxx">
    <SGEventMgr : SGSubsystem in "simgear/structure/event_mgr.hxx">
    <SGInterpolator : SGSubsystem in "simgear/misc/interpolator.hxx">
    <SGPerformanceMonitor : SGSubsystem in "simgear/structure/SGPerfMon.hxx">
    <SGSoundMgr : SGSubsystem in "simgear/sound/soundmgr.hxx">
    <SGSubsystemMgr : SGSubsystem in "simgear/structure/subsystem_mgr.hxx">
    <SGTerraSync : SGSubsystem in "simgear/scene/tsync/terrasync.hxx">
    <SlipSkidBall : SGSubsystem in "src/Instrumentation/slip_skid_ball.hxx">
    <StaticSystem : SGSubsystem in "src/Systems/static.hxx">
    <TACAN : SGSubsystem in "src/Instrumentation/tacan.hxx">
    <TCAS : SGSubsystem in "src/Instrumentation/tcas.hxx">
    <TimeManager : SGSubsystem in "src/Time/TimeManager.hxx">
    <Transponder : SGSubsystem in "src/Instrumentation/transponder.hxx">
    <TurnIndicator : SGSubsystem in "src/Instrumentation/turn_indicator.hxx">
    <VacuumSystem : SGSubsystem in "src/Systems/vacuum.hxx">
    <VerticalSpeedIndicator : SGSubsystem in "src/Instrumentation/vertical_speed_indicator.hxx">
    <View : SGSubsystem in "src/Viewer/view.hxx">
    <wxRadarBg : SGSubsystem in "src/Cockpit/wxradar.hxx">


Primary classes (83):
Primary groups (0 subsystems, 8 groups):
     <ADF (from SGSubsystem)>
     <Autopilot : SGSubsystemGroup : SGSubsystem in "src/Autopilot/autopilot.hxx">
     <AirportDynamicsManager (from SGSubsystem)>
     <CockpitDisplayManager : SGSubsystemGroup : SGSubsystem in "src/Cockpit/cockpitDisplayManager.hxx">
     <AirspeedIndicator (from SGSubsystem)>
     <FGEnvironmentMgr : SGSubsystemGroup : SGSubsystem in "src/Environment/environment_mgr.hxx">
     <Altimeter (from SGSubsystem)>
     <FGInput : SGSubsystemGroup : SGSubsystem in "src/Input/input.hxx">
     <AreaSampler (from SGSubsystem)>
     <FGInstrumentMgr : SGSubsystemGroup : SGSubsystem in "src/Instrumentation/instrument_mgr.hxx">
     <AttitudeIndicator (from SGSubsystem)>
     <FGSystemMgr : SGSubsystemGroup : SGSubsystem in "src/Systems/system_mgr.hxx">
     <Clock (from SGSubsystem)>
     <FGXMLAutopilotGroup : SGSubsystemGroup : SGSubsystem in "src/Autopilot/autopilotgroup.hxx">
     <CommRadio (from SGSubsystem)>
     <TerrainSampler : SGSubsystemGroup : SGSubsystem in "src/Environment/terrainsampler.hxx">
    <Component (from SGSubsystem)>
    <DCLGPS (from SGSubsystem)>
    <DME (from SGSubsystem)>
    <Ephemeris (from SGSubsystem)>
    <FDMShell (from SGSubsystem)>
    <FGAIManager (from SGSubsystem)>
    <FGATCManager (from SGSubsystem)>
    <FGAircraftModel (from SGSubsystem)>
    <FGCom (from SGSubsystem)>
    <FGControls (from SGSubsystem)>
    <FGDNSClient (from SGSubsystem)>
    <FGElectricalSystem (from SGSubsystem)>
    <FGEventInput (from SGSubsystem)>
    <FGFX (from SGSubsystem)>
    <FGFlightHistory (from SGSubsystem)>
    <FGHTTPClient (from SGSubsystem)>
    <FGHttpd (from SGSubsystem)>
    <FGIO (from SGSubsystem)>
    <FGInterface (from SGSubsystem)>
    <FGJoystickInput (from SGSubsystem)>
    <FGKR_87 (from SGSubsystem)>
    <FGKeyboardInput (from SGSubsystem)>
    <FGLight (from SGSubsystem)>
    <FGLogger (from SGSubsystem)>
    <FGMagVarManager (from SGSubsystem)>
    <FGMarkerBeacon (from SGSubsystem)>
    <FGModelMgr (from SGSubsystem)>
    <FGMouseInput (from SGSubsystem)>
    <FGMultiplayMgr (from SGSubsystem)>
    <FGNasalSys (from SGSubsystem)>
    <FGNavRadio (from SGSubsystem)>
    <FGPanel (from SGSubsystem)>
    <FGPanelProtocol (from SGSubsystem)>
    <FGPrecipitationMgr (from SGSubsystem)>
    <FGProperties (from SGSubsystem)>
    <FGReplay (from SGSubsystem)>
    <FGRidgeLift (from SGSubsystem)>
    <FGRouteMgr (from SGSubsystem)>
    <FGScenery (from SGSubsystem)>
    <FGSoundManager (from SGSubsystem)>
    <FGSubmodelMgr (from SGSubsystem)>
    <FGTrafficManager (from SGSubsystem)>
    <FGViewMgr (from SGSubsystem)>
    <FGVoiceMgr (from SGSubsystem)>
    <GPS (from SGSubsystem)>
    <GSDI (from SGSubsystem)>
    <GUIMgr (from SGSubsystem)>
    <GroundRadar (from SGSubsystem)>
    <HUD (from SGSubsystem)>
    <HeadingIndicator (from SGSubsystem)>
    <HeadingIndicatorDG (from SGSubsystem)>
    <HeadingIndicatorFG (from SGSubsystem)>
    <InstVerticalSpeedIndicator (from SGSubsystem)>
    <LayerInterpolateController (from SGSubsystem)>
    <MK_VIII (from SGSubsystem)>
    <MagCompass (from SGSubsystem)>
    <MasterReferenceGyro (from SGSubsystem)>
    <NavDisplay (from SGSubsystem)>
    <NavRadio (from SGSubsystem)>
    <NewGUI (from SGSubsystem)>
    <PerformanceDB (from SGSubsystem)>
    <PitotSystem (from SGSubsystem)>
    <RadarAltimeter (from SGSubsystem)>
    <RealWxController (from SGSubsystem)>
    <SlipSkidBall (from SGSubsystem)>
    <StaticSystem (from SGSubsystem)>
    <TACAN (from SGSubsystem)>
    <TCAS (from SGSubsystem)>
    <TimeManager (from SGSubsystem)>
    <Transponder (from SGSubsystem)>
    <TurnIndicator (from SGSubsystem)>
    <VacuumSystem (from SGSubsystem)>
    <VerticalSpeedIndicator (from SGSubsystem)>
    <View (from SGSubsystem)>
    <wxRadarBg (from SGSubsystem)>


Secondary classes (25):
Secondary classes (28 subsystems, 0 groups):
     <AnalogComponent (from Component : SGSubsystem)>
     <AnalogComponent : Component : SGSubsystem in "src/Autopilot/analogcomponent.hxx">
     <BasicRealWxController (from RealWxController : SGSubsystem)>
     <BasicRealWxController : RealWxController : SGSubsystem in "src/Environment/realwx_ctrl.cxx">
     <CommRadioImpl (from CommRadio : SGSubsystem)>
    <CanvasMgr : PropertyBasedMgr : SGSubsystem in "simgear/canvas/CanvasMgr.hxx">
     <DigitalComponent (from Component : SGSubsystem)>
     <CommRadioImpl : CommRadio : SGSubsystem in "src/Instrumentation/commradio.cxx">
     <FGACMS (from FGInterface : SGSubsystem)>
     <DigitalComponent : Component : SGSubsystem in "src/Autopilot/digitalcomponent.hxx">
     <FGADA (from FGInterface : SGSubsystem)>
     <FGACMS : FGInterface : SGSubsystem in "src/FDM/SP/ACMS.hxx">
     <FGBalloonSim (from FGInterface : SGSubsystem)>
     <FGADA : FGInterface : SGSubsystem in "src/FDM/SP/ADA.hxx">
     <FGExternalNet (from FGInterface : SGSubsystem)>
    <FGAISim : FGInterface : SGSubsystem in "src/FDM/SP/AISim.hpp">
     <FGExternalPipe (from FGInterface : SGSubsystem)>
     <FGBalloonSim : FGInterface : SGSubsystem in "src/FDM/SP/Balloon.h">
     <FGHIDEventInput (from FGEventInput : SGSubsystem)>
     <FGExternalNet : FGInterface : SGSubsystem in "src/FDM/ExternalNet/ExternalNet.hxx">
     <FGJSBsim (from FGInterface : SGSubsystem)>
     <FGExternalPipe : FGInterface : SGSubsystem in "src/FDM/ExternalPipe/ExternalPipe.hxx">
     <FGLaRCsim (from FGInterface : SGSubsystem)>
     <FGHIDEventInput : FGEventInput : SGSubsystem in "src/Input/FGHIDEventInput.hxx">
     <FGLinuxEventInput (from FGEventInput : SGSubsystem)>
     <FGJSBsim : FGInterface : SGSubsystem in "src/FDM/JSBSim/JSBSim.hxx">
     <FGMacOSXEventInput (from FGEventInput : SGSubsystem)>
     <FGLaRCsim : FGInterface : SGSubsystem in "src/FDM/LaRCsim/LaRCsim.hxx">
     <FGMagicCarpet (from FGInterface : SGSubsystem)>
     <FGLinuxEventInput : FGEventInput : SGSubsystem in "src/Input/FGLinuxEventInput.hxx">
     <FGNullFDM (from FGInterface : SGSubsystem)>
     <FGMacOSXEventInput : FGEventInput : SGSubsystem in "src/Input/FGMacOSXEventInput.hxx">
     <FGReadablePanel (from FGPanel : SGSubsystem)>
     <FGMagicCarpet : FGInterface : SGSubsystem in "src/FDM/SP/MagicCarpet.hxx">
     <FGUFO (from FGInterface : SGSubsystem)>
     <FGNullFDM : FGInterface : SGSubsystem in "src/FDM/NullFDM.hxx">
     <KLN89 (from DCLGPS : SGSubsystem)>
     <FGReadablePanel : FGPanel : SGSubsystem in "utils/fgpanel/panel_io.hxx">
     <LayerInterpolateControllerImplementation (from LayerInterpolateController : SGSubsystem)>
    <FGSoundManager : SGSoundMgr : SGSubsystem in "src/Sound/soundmanager.hxx">
     <MongooseHttpd (from FGHttpd : SGSubsystem)>
     <FGUFO : FGInterface : SGSubsystem in "src/FDM/UFO.hxx">
     <NavRadioImpl (from NavRadio : SGSubsystem)>
     <KLN89 : DCLGPS : SGSubsystem in "src/Instrumentation/KLN89/kln89.hxx">
     <StateMachineComponent (from Component : SGSubsystem)>
     <LayerInterpolateControllerImplementation : LayerInterpolateController : SGSubsystem in "src/Environment/environment_ctrl.cxx">
     <YASim (from FGInterface : SGSubsystem)>
     <MongooseHttpd : FGHttpd : SGSubsystem in "src/Network/http/httpd.cxx">
     <agRadar (from wxRadarBg : SGSubsystem)>
     <NavRadioImpl : NavRadio : SGSubsystem in "src/Instrumentation/newnavradio.cxx">
     <StateMachineComponent : Component : SGSubsystem in "src/Autopilot/autopilot.cxx">
     <YASim : FGInterface : SGSubsystem in "src/FDM/YASim/YASim.hxx">
     <agRadar : wxRadarBg : SGSubsystem in "src/Cockpit/agradar.hxx">


Tertiary classes (6):
Secondary groups (0 subsystems, 2 groups):
     <DigitalFilter (from AnalogComponent : Component : SGSubsystem)>
     <FGXMLAutopilotGroupImplementation : FGXMLAutopilotGroup : SGSubsystemGroup : SGSubsystem in "src/Autopilot/autopilotgroup.cxx">
    <Logic (from DigitalComponent : Component : SGSubsystem)>
     <TerrainSamplerImplementation : TerrainSampler : SGSubsystemGroup : SGSubsystem in "src/Environment/terrainsampler.cxx">
    <NoaaMetarRealWxController (from BasicRealWxController : RealWxController : SGSubsystem)>
    <PIDController (from AnalogComponent : Component : SGSubsystem)>
     <PISimpleController (from AnalogComponent : Component : SGSubsystem)>
    <Predictor (from AnalogComponent : Component : SGSubsystem)>


Quaternary classes (1):
Tertiary classes (6 subsystems, 0 groups):
     <FlipFlop (from Logic : DigitalComponent : Component : SGSubsystem)>
     <DigitalFilter : AnalogComponent : Component : SGSubsystem in "src/Autopilot/digitalfilter.hxx">
    <Logic : DigitalComponent : Component : SGSubsystem in "src/Autopilot/logic.hxx">
    <NoaaMetarRealWxController : BasicRealWxController : RealWxController : SGSubsystem in "src/Environment/realwx_ctrl.cxx">
    <PIDController : AnalogComponent : Component : SGSubsystem in "src/Autopilot/pidcontroller.hxx">
    <PISimpleController : AnalogComponent : Component : SGSubsystem in "src/Autopilot/pisimplecontroller.hxx">
    <Predictor : AnalogComponent : Component : SGSubsystem in "src/Autopilot/predictor.hxx">


Total: 115 subsystem classes.
Quaternary classes (1 subsystems, 0 groups):
    <FlipFlop : Logic : DigitalComponent : Component : SGSubsystem in "src/Autopilot/flipflop.hxx">
 
Total: 126 subsystem classes (117 flightgear, 9 simgear).
Total: 10 subsystem groups (10 flightgear, 0 simgear).
Total: 136 subsystem classes and groups (127 flightgear, 9 simgear).
}}
}}


Line 271: Line 765:
#! /usr/bin/env python3
#! /usr/bin/env python3


# Python module imports.
from subprocess import PIPE, Popen
# Other module imports.
from find_subsystems import FindSubsystems
from find_subsystems import FindSubsystems


from subprocess import PIPE, Popen
 
# Source code repository paths.
SIMGEAR_PATH = "/flightgear/src/flightgear-simgear"
FLIGHTGEAR_PATH = "/flightgear/src/flightgear-flightgear"




class ToUpdate:
class ToUpdate:
    """Class for finding all files yet to be updated."""
     def __init__(self):
     def __init__(self):
        """Find all files to be updated."""
        # First find all subsystems.
         subsystems = FindSubsystems()
         subsystems = FindSubsystems()


         pipe = Popen("git diff --name-only ..next", shell=True, stdout=PIPE)
         # Generate a list of files to skip.
        cmd = "cd %s;" % SIMGEAR_PATH
        cmd += "git diff --name-only ..next;"
        cmd += "cd %s;" % FLIGHTGEAR_PATH
        cmd += "git diff --name-only ..next"
        pipe = Popen(cmd, shell=True, stdout=PIPE)
         blacklist = []
         blacklist = []
         for line in pipe.stdout.readlines():
         for line in pipe.stdout.readlines():
Line 288: Line 799:


         # Loop over all derived classes.
         # Loop over all derived classes.
         print("\nStill to be updated:")
         print("\nYet to be updated:")
         for subsystem in subsystems.classes_primary + subsystems.classes_secondary + subsystems.classes_tertiary + subsystems.classes_quaternary:
         for storage_list in subsystems.subsystems + subsystems.groups:
             if subsystem.file_name in blacklist:
             for subsystem in storage_list:
                continue
                if subsystem.file_name not in blacklist:
            print("    %s: %s" % (subsystem.file_name, subsystem))
                    print("    %s: %s" % (subsystem.file_name, subsystem))
 




# Instantiate the class if run as a script.
if __name__ == "__main__":
if __name__ == "__main__":
     ToUpdate()
     ToUpdate()
}}
}}

Revision as of 20:54, 18 April 2018

Tracking down subsystems

Script

The following script is for finding all FlightGear dependencies:

All subsystems

The result is:

Refactoring

To check that all subsystems on a branch have been updated or refactored: