Updated client side dialog to include mavlink port input

This commit is contained in:
2026-05-05 08:02:38 -03:00
parent 99f8d991be
commit b9e848d66e
2 changed files with 46 additions and 20 deletions

View File

@@ -10,44 +10,61 @@ class armatak_udp_socket_start_dialog {
class armatak_gui_module_udp_socket_dialog_main_frame: RscBackground { class armatak_gui_module_udp_socket_dialog_main_frame: RscBackground {
idc = 16960; idc = 16960;
x = "0.386562 * safezoneW + safezoneX"; x = "0.386562 * safezoneW + safezoneX";
y = "0.401 * safezoneH + safezoneY"; y = "0.357 * safezoneH + safezoneY";
w = "0.216563 * safezoneW"; w = "0.216563 * safezoneW";
h = "0.242 * safezoneH"; h = "0.319 * safezoneH";
colorBackground[]={0,0,0,0.45}; colorBackground[]={0,0,0,0.45};
}; };
}; };
class Controls { class Controls {
class armatak_gui_module_udp_socket_dialog_address_edit: RscEdit { class armatak_gui_module_udp_socket_dialog_address_edit: RscEdit {
idc = 16961; idc = 16961;
text = "168.15.0.3"; text = "192.168.15.121";
x = "0.391719 * safezoneW + safezoneX"; x = "0.391719 * safezoneW + safezoneX";
y = "0.445 * safezoneH + safezoneY"; y = "0.401 * safezoneH + safezoneY";
w = "0.20625 * safezoneW"; w = "0.20625 * safezoneW";
h = "0.044 * safezoneH"; h = "0.044 * safezoneH";
colorBackground[]={0,0,0,0.5}; colorBackground[]={0,0,0,0.5};
}; };
class armatak_gui_module_udp_socket_dialog_address_port_edit: RscEdit { class armatak_gui_module_udp_socket_dialog_gnss_port_edit: RscEdit {
idc = 16962; idc = 16962;
text = "4349"; text = "4349";
x = "0.391719 * safezoneW + safezoneX"; x = "0.391719 * safezoneW + safezoneX";
y = "0.522 * safezoneH + safezoneY"; y = "0.478 * safezoneH + safezoneY";
w = "0.20625 * safezoneW";
h = "0.044 * safezoneH";
colorBackground[]={0,0,0,0.5};
};
class armatak_gui_module_udp_socket_dialog_mavlink_port_edit: RscEdit {
idc = 16967;
text = "14550";
x = "0.391719 * safezoneW + safezoneX";
y = "0.555 * safezoneH + safezoneY";
w = "0.20625 * safezoneW"; w = "0.20625 * safezoneW";
h = "0.044 * safezoneH"; h = "0.044 * safezoneH";
colorBackground[]={0,0,0,0.5}; colorBackground[]={0,0,0,0.5};
}; };
class armatak_gui_module_udp_socket_dialog_address_text: RscText { class armatak_gui_module_udp_socket_dialog_address_text: RscText {
idc = 16963; idc = 16963;
text = "Phone's Socket Local Address"; text = "EUD's Address";
x = "0.391719 * safezoneW + safezoneX"; x = "0.391719 * safezoneW + safezoneX";
y = "0.412 * safezoneH + safezoneY"; y = "0.368 * safezoneH + safezoneY";
w = "0.20625 * safezoneW"; w = "0.20625 * safezoneW";
h = "0.033 * safezoneH"; h = "0.033 * safezoneH";
}; };
class armatak_gui_module_udp_socket_dialog_address_port_text: RscText { class armatak_gui_module_udp_socket_dialog_gnss_port_text: RscText {
idc = 16964; idc = 16964;
text = "Phone's Socket Local Port"; text = "Network GNSS Port";
x = "0.391719 * safezoneW + safezoneX"; x = "0.391719 * safezoneW + safezoneX";
y = "0.489 * safezoneH + safezoneY"; y = "0.445 * safezoneH + safezoneY";
w = "0.20625 * safezoneW";
h = "0.033 * safezoneH";
};
class armatak_gui_module_udp_socket_dialog_mavlink_port_text: RscText {
idc = 16968;
text = "Mavlink Port";
x = "0.391719 * safezoneW + safezoneX";
y = "0.522 * safezoneH + safezoneY";
w = "0.20625 * safezoneW"; w = "0.20625 * safezoneW";
h = "0.033 * safezoneH"; h = "0.033 * safezoneH";
}; };
@@ -56,7 +73,7 @@ class armatak_udp_socket_start_dialog {
text = "Cancel"; text = "Cancel";
action = "closeDialog 2;"; action = "closeDialog 2;";
x = "0.551563 * safezoneW + safezoneX"; x = "0.551563 * safezoneW + safezoneX";
y = "0.577 * safezoneH + safezoneY"; y = "0.632 * safezoneH + safezoneY";
w = "0.0464063 * safezoneW"; w = "0.0464063 * safezoneW";
h = "0.055 * safezoneH"; h = "0.055 * safezoneH";
}; };
@@ -65,7 +82,7 @@ class armatak_udp_socket_start_dialog {
text = "Ok"; text = "Ok";
action = QUOTE(call FUNC(startUDPSocket)); action = QUOTE(call FUNC(startUDPSocket));
x = "0.5 * safezoneW + safezoneX"; x = "0.5 * safezoneW + safezoneX";
y = "0.577 * safezoneH + safezoneY"; y = "0.632 * safezoneH + safezoneY";
w = "0.0464063 * safezoneW"; w = "0.0464063 * safezoneW";
h = "0.055 * safezoneH"; h = "0.055 * safezoneH";
}; };

View File

@@ -2,7 +2,7 @@
params ["_logic"]; params ["_logic"];
_socket_is_running = player getVariable [QGVAR(eudConnected), false]; private _socket_is_running = player getVariable [QGVAR(eudConnected), false];
if (_socket_is_running) exitWith { if (_socket_is_running) exitWith {
["Socket is already running", "error", "UDP Socket"] call EFUNC(main,notify); ["Socket is already running", "error", "UDP Socket"] call EFUNC(main,notify);
@@ -11,20 +11,29 @@ if (_socket_is_running) exitWith {
disableSerialization; disableSerialization;
_udp_socket_instance_address = ctrlText 16961; private _eud_address = ctrlText 16961;
_udp_socket_instance_port = ctrlText 16962; private _gnss_port = ctrlText 16962;
private _mavlink_port = ctrlText 16967;
_udp_socket_fulladdress = ((_udp_socket_instance_address) + ":" + (_udp_socket_instance_port)); private _udp_socket_fulladdress = _eud_address + ":" + _gnss_port;
private _mavlink_address = _eud_address + ":" + _mavlink_port;
player setVariable [QGVAR(udp_socket_address), _udp_socket_fulladdress]; player setVariable [QGVAR(udp_socket_address), _udp_socket_fulladdress];
player setVariable [QGVAR(mavlink_address), _mavlink_address];
player setVariable [QGVAR(eudConnected), true]; player setVariable [QGVAR(eudConnected), true];
"armatak" callExtension ["udp_socket:start", [_udp_socket_fulladdress]]; "armatak" callExtension ["udp_socket:start", [_udp_socket_fulladdress]];
private _mdnsInstanceName = format ["ArmaTAK-%1", name player];
"armatak" callExtension ["mdns:start_uas_advertisement", [_mdnsInstanceName, parseNumber _mavlink_port, "rtp://0.0.0.0:5600"]];
"armatak" callExtension ["log", [["info", format ["Client UDP socket started for %1 and MAVLink target set to %2", _udp_socket_fulladdress, _mavlink_address]]]];
call EFUNC(uav,startMavlinkBroadcast);
[{ [{
if (player getVariable [QGVAR(eudConnected), false]) then { if !(player getVariable [QGVAR(eudConnected), false]) exitWith {};
"armatak" callExtension ["udp_socket:send_gps_cot", [player call FUNC(extractClientPosition)]]; "armatak" callExtension ["udp_socket:send_gps_cot", [player call FUNC(extractClientPosition)]];
};
}, 0.5, []] call CBA_fnc_addPerFrameHandler; }, 0.5, []] call CBA_fnc_addPerFrameHandler;
deleteVehicle _logic; deleteVehicle _logic;