FGInterface Class

From FlightGear wiki
Revision as of 15:49, 9 June 2017 by Red Leader (talk | contribs) (Style edits)
Jump to navigation Jump to search

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 (Integer)

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

Here is the Main Configuration File (/opt/fgint/Config/radiopanel.cfg):

[INT]
intname=RADIOPANEL

[MODULES]
module01=FGIntMCP23017,MCP23017
module02=FGIntHT16K33,HT16K33

[CONFFILE]
conffile01=C:\Users\david_albert\Documents\Flightgear\FarmerFGInt\fgint\Config\displays.cfg

Interface Création :

#!/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)
WIP.png Work in progress
This article or section will be worked on in the upcoming hours or days.
Note: Class Desciption in process
See history for the latest developments.