/** * ConnectCommandsServer methods connect to commands-server in asychronized mode * this connection enable the user to set properties in flight-gear application **/ public void ConnectCommandsServer() { if (commands_server != null) { return; } commands_server = CommandsServer.Instance; commands_server.connectToServer(); }
/// <summary> /// Constructor /// </summary> /// <param name="server"> The server to which the commands will be sent </param> public ManualControlModel(CommandsServer server) : base(server) { this.commandsNamesPaths = new Dictionary <string, string> { { "THROTTLE", "/controls/engines/current-engine/throttle" }, { "RUDDER", "/controls/flight/rudder" }, { "ELEVATOR", "/controls/flight/elevator" }, { "AILERON", "/controls/flight/aileron" } }; }
private CommandsServer server; // command server instance /** * ManualModel creates manual model instance * the model responsible for manual logics and contains methods which performs * complex calculations and operations **/ public ManualModel() { server = CommandsServer.Instance; }
/// <summary> /// Constructor. /// </summary> /// <param name="server"> The server to which the commands are sent </param> public CommandsParser(CommandsServer server) { this.server = server; }
private CommandsServer server; // commands flight server /** * AutoPilotModel creates auto-pilot model instance * the model responsible for auto-pilot logics and contains methods which performs * complex calculations and operations **/ public AutoPilotModel() { server = CommandsServer.Instance; }
/// <summary> /// Constructor /// </summary> /// <param name="server"> The server to which the commands will be sent </param> public AutoControlModel(CommandsServer server) : base(server) { }
/** * closeConnection method close the connection to flightgear server. **/ public override void closeConnection() { client.Close(); instance = null; }