FGInterface Class: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
(Created page with "So, before you can act on the various elements of the interface, you have to create it.<br /> An interface is created by instantiating the Class '''FGInterface'''. Creating an...")
(No difference)

Revision as of 11:54, 9 June 2017

So, before you can act on the various elements of the interface, you have to create it.
An interface is created by instantiating the Class FGInterface. Creating an FGInterface object requires two parameters:

FGInterface(config_filename, debug level)

  • config_file : The main configuration file (String, a file name in the "Config" directory)
  • debug_level : Debug Level Value (Interger)


Example : Creating an interface named INT1 with a config file named 'radiopanel.cfg'.

#!/usr/bin/env python3

# System Module Import
import socket
import os
import sys
import operator
import time
import struct

##############################
# Modules Import
##############################
from FGInterface import FGInterface as FGINT

INT1 = FGINT('radiopanel.cfg', 0)
print(INT1)