SITL: Change Flighgear port with instance number

This commit is contained in:
Pierre Kancir 2016-11-15 15:44:51 +01:00 committed by Andrew Tridgell
parent c4b5bd4bd9
commit 86c8145bd9
3 changed files with 4 additions and 1 deletions

View File

@ -98,7 +98,7 @@ void SITL_State::_sitl_setup(const char *home_str)
}
if (_use_fg_view) {
fg_socket.connect("127.0.0.1", 5503);
fg_socket.connect("127.0.0.1", _fg_view_port);
}
}

View File

@ -164,6 +164,7 @@ private:
SITL::SITL *_sitl;
uint16_t _rcout_port;
uint16_t _rcin_port;
uint16_t _fg_view_port;
float _current;
bool _synthetic_clock_mode;

View File

@ -130,6 +130,7 @@ void SITL_State::_parse_command_line(int argc, char * const argv[])
_base_port = 5760;
_rcout_port = 5502;
_rcin_port = 5501;
_fg_view_port = 5503;
_fdm_address = "127.0.0.1";
_client_address = nullptr;
_use_fg_view = true;
@ -199,6 +200,7 @@ void SITL_State::_parse_command_line(int argc, char * const argv[])
_base_port += _instance * 10;
_rcout_port += _instance * 10;
_rcin_port += _instance * 10;
_fg_view_port += _instance * 10;
}
break;
case 'P':