ATragMX - Implemented missing features

* Muzzle Velocity vs. Temperature Interpolation
* C1 Ballistic Coefficient vs. Distance Interpolation
* Coriolis and Spin drift output
* Options menu
* Truing Drop
---------------------------------
* Overworked default gun profiles
---------------------------------
* Fixed the Cancel buttons on the gun-, atmosphere- and target columns.
* Fixed some muzzle velocity entries in the default gun list.
* Fixed divide by zero error in the target range estimator
This commit is contained in:
ulteq 2016-11-02 13:56:59 +01:00 committed by ulteq
parent a0d6e0322b
commit 3f4564605b
47 changed files with 1614 additions and 70 deletions

View File

@ -2,6 +2,8 @@
#define ST_RIGHT 1
#define ST_CENTER 2
#define ST_WITH_RECT 160
class ATragMX_RscText {
idc=-1;
type=0;
@ -350,6 +352,7 @@ class ATragMX_Display {
colorBackground[]={0.15,0.21,0.23,0.3};
colorFocused[]={0.15,0.21,0.23,0.2};
text="MV";
action=QUOTE(0 call FUNC(toggle_muzzle_velocity_data));
};
class TEXT_MUZZLE_VELOCITY_OUTPUT: TEXT_BORE_HEIGHT_OUTPUT {
idc=130;
@ -383,18 +386,18 @@ class ATragMX_Display {
y=0.265*safezoneH+safezoneY+0.320;
text="";
};
class TEXT_BAROMETRIC_PRESSURE: TEXT_AIR_FRICTION {
class TEXT_BAROMETRIC_PRESSURE: TEXT_TEMPERATURE {
idc=21;
x=0.550*safezoneW+safezoneX+0.20;
y=0.265*safezoneH+safezoneY+0.355;
text="BP";
};
class TEXT_BAROMETRIC_PRESSURE_OUTPUT: TEXT_TEMPERATURE_OUTPUT {
idc=210;
y=0.265*safezoneH+safezoneY+0.355;
};
class TEXT_RELATIVE_HUMIDITY: TEXT_AIR_FRICTION {
class TEXT_RELATIVE_HUMIDITY: TEXT_BAROMETRIC_PRESSURE {
idc=22;
x=0.550*safezoneW+safezoneX+0.20;
y=0.265*safezoneH+safezoneY+0.390;
text="RH";
};
@ -526,7 +529,7 @@ class ATragMX_Display {
};
class TEXT_ELEVATION_OUTPUT_ABSOLUTE: ATragMX_RscText {
idc=400;
style=160;
style=ST_WITH_RECT+ST_RIGHT;
sizeEx=0.025;
w=0.065;
h=0.032;
@ -606,17 +609,39 @@ class ATragMX_Display {
class TEXT_SCOPE_CLICK_NUMBER: TEXT_GUN_LIST {
idc=2001;
style=ST_CENTER;
w=0.03;
w=0.025;
x=0.550*safezoneW+safezoneX+0.27;
text="4";
action=QUOTE(call FUNC(toggle_solution_setup));
};
class TEXT_CALCULATE: TEXT_SCOPE_UNIT {
class TEXT_OPTIONS: TEXT_GUN_LIST {
idc=3000;
style=ST_RIGHT;
x=0.550*safezoneW+safezoneX+0.3;
text="Calc";
action=QUOTE(call FUNC(calculate_target_solution));
text="Options";
action=QUOTE(false call FUNC(toggle_option_menu));
};
class TEXT_OPTIONS_BACKGROUND: ATragMX_RscButton {
idc=3001;
colorBackground[]={0.15,0.21,0.23,0.2};
colorBackgroundActive[]={0.15,0.21,0.23,0.2};
colorFocused[]={0.15,0.21,0.23,0.2};
x=0.550*safezoneW+safezoneX+0.105;
y=0.265*safezoneH+safezoneY+0.17;
w=0.3;
h=0.535;
offsetPressedX=0.0;
offsetPressedY=0.0;
action=QUOTE(false call FUNC(toggle_option_menu));
};
class TEXT_OPTIONS_LIST_OUTPUT: ATragMX_RscListBox {
idc=3002;
w=0.17;
h=0.28;
x=0.550*safezoneW+safezoneX+0.225;
y=0.265*safezoneH+safezoneY+0.355;
sizeEx=0.025;
onMouseButtonClick=QUOTE(true call FUNC(toggle_option_menu));
};
class TEXT_RANGE_CARD_SCOPE_UNIT: TEXT_GUN_PROFILE {
@ -766,8 +791,9 @@ class ATragMX_Display {
class TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE: TEXT_TARGET_RANGE_ASSIST_MEASUREMENT_METHOD {
idc=7003;
style=ST_RIGHT;
x=0.550*safezoneW+safezoneX+0.10;
x=0.550*safezoneW+safezoneX+0.092;
y=0.265*safezoneH+safezoneY+0.4;
w=0.128;
text="Target Size";
};
class TEXT_TARGET_RANGE_ASSIST_IMAGE_SIZE: TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE {
@ -874,22 +900,22 @@ class ATragMX_Display {
class TEXT_TARGET_SPEED_ASSIST_TARGET_RANGE: TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE {
idc=8000;
x=0.550*safezoneW+safezoneX+0.13;
x=0.550*safezoneW+safezoneX+0.12;
text="Target Range";
};
class TEXT_TARGET_SPEED_ASSIST_NUM_TICKS: TEXT_TARGET_RANGE_ASSIST_IMAGE_SIZE {
idc=8001;
x=0.550*safezoneW+safezoneX+0.13;
x=0.550*safezoneW+safezoneX+0.12;
text="Num Ticks";
};
class TEXT_TARGET_SPEED_ASSIST_TIME: TEXT_TARGET_RANGE_ASSIST_ANGLE {
idc=8002;
x=0.550*safezoneW+safezoneX+0.13;
x=0.550*safezoneW+safezoneX+0.12;
text="Time (secs)";
};
class TEXT_TARGET_SPEED_ASSIST_TARGET_ESTIMATED_SPEED: TEXT_TARGET_RANGE_ASSIST_ESTIMATED_RANGE {
idc=8003;
x=0.550*safezoneW+safezoneX+0.13;
x=0.550*safezoneW+safezoneX+0.12;
text="Est Speed";
};
class TEXT_TARGET_SPEED_ASSIST_TARGET_RANGE_INPUT: TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE_INPUT {
@ -1468,5 +1494,343 @@ class ATragMX_Display {
y=0.265*safezoneH+safezoneY+0.55;
action=QUOTE(0 call FUNC(toggle_solution_setup));
};
class TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE: TEXT_BORE_HEIGHT {
idc=16000;
w=0.22;
y=0.265*safezoneH+safezoneY+0.25;
sizeEx=0.022;
text="Temperature";
};
class TEXT_MUZZLE_VELOCITY_DATA_MUZZLE_VELOCITY: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE {
idc=16001;
x=0.550*safezoneW+safezoneX+0.215;
sizeEx=0.022;
text="Muzzle velocity";
};
class TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_1: ATragMX_RscEdit {
idc=160021;
w=0.082;
h=0.035;
x=0.550*safezoneW+safezoneX+0.128;
y=0.265*safezoneH+safezoneY+0.29;
text="0";
};
class TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_2: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_1 {
idc=160022;
y=0.265*safezoneH+safezoneY+0.325;
};
class TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_3: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_1 {
idc=160023;
y=0.265*safezoneH+safezoneY+0.360;
};
class TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_4: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_1 {
idc=160024;
y=0.265*safezoneH+safezoneY+0.395;
};
class TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_5: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_1 {
idc=160025;
y=0.265*safezoneH+safezoneY+0.430;
};
class TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_6: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_1 {
idc=160026;
y=0.265*safezoneH+safezoneY+0.465;
};
class TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_7: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_1 {
idc=160027;
y=0.265*safezoneH+safezoneY+0.500;
};
class TEXT_MUZZLE_VELOCITY_DATA_MUZZLE_VELOCITY_INPUT_1: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_1 {
idc=160031;
x=0.550*safezoneW+safezoneX+0.225;
};
class TEXT_MUZZLE_VELOCITY_DATA_MUZZLE_VELOCITY_INPUT_2: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_2 {
idc=160032;
x=0.550*safezoneW+safezoneX+0.225;
};
class TEXT_MUZZLE_VELOCITY_DATA_MUZZLE_VELOCITY_INPUT_3: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_3 {
idc=160033;
x=0.550*safezoneW+safezoneX+0.225;
};
class TEXT_MUZZLE_VELOCITY_DATA_MUZZLE_VELOCITY_INPUT_4: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_4 {
idc=160034;
x=0.550*safezoneW+safezoneX+0.225;
};
class TEXT_MUZZLE_VELOCITY_DATA_MUZZLE_VELOCITY_INPUT_5: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_5 {
idc=160035;
x=0.550*safezoneW+safezoneX+0.225;
};
class TEXT_MUZZLE_VELOCITY_DATA_MUZZLE_VELOCITY_INPUT_6: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_6 {
idc=160036;
x=0.550*safezoneW+safezoneX+0.225;
};
class TEXT_MUZZLE_VELOCITY_DATA_MUZZLE_VELOCITY_INPUT_7: TEXT_MUZZLE_VELOCITY_DATA_TEMPERATURE_INPUT_7 {
idc=160037;
x=0.550*safezoneW+safezoneX+0.225;
};
class TEXT_MUZZLE_VELOCITY_DATA_CLEAR: TEXT_TARGET_DATA_NEXT {
idc=16004;
style=ST_CENTER;
h=0.035;
y=0.265*safezoneH+safezoneY+0.3625;
text="Clear";
action=QUOTE(call FUNC(clear_muzzle_velocity_data));
};
class TEXT_MUZZLE_VELOCITY_DATA_QUESTIONMARK: TEXT_MUZZLE_VELOCITY_DATA_CLEAR {
idc=16005;
y=0.265*safezoneH+safezoneY+0.430;
text="?";
action="";
};
class TEXT_MUZZLE_VELOCITY_DATA_DONE: TEXT_TARGET_DATA_DONE {
idc=16006;
action=QUOTE(1 call FUNC(toggle_muzzle_velocity_data));
};
class TEXT_MUZZLE_VELOCITY_DATA_CANCEL: TEXT_TARGET_DATA_CANCEL {
idc=16007;
action=QUOTE(0 call FUNC(toggle_muzzle_velocity_data));
};
class TEXT_MUZZLE_VELOCITY_DATA_PREV: TEXT_TARGET_DATA_PREV {
idc=16008;
};
class TEXT_MUZZLE_VELOCITY_DATA_NEXT: TEXT_TARGET_DATA_NEXT {
idc=16009;
};
class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE: TEXT_BORE_HEIGHT {
idc=17000;
w=0.22;
x=0.550*safezoneW+safezoneX+0.15;
y=0.265*safezoneH+safezoneY+0.25;
sizeEx=0.022;
text="Meters";
};
class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_C1_BALLISTIC_COEFFICIENT: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE {
idc=17001;
x=0.550*safezoneW+safezoneX+0.235;
sizeEx=0.022;
text="BC-Coef";
};
class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_1: ATragMX_RscEdit {
idc=170021;
w=0.082;
h=0.035;
x=0.550*safezoneW+safezoneX+0.128;
y=0.265*safezoneH+safezoneY+0.29;
text="0";
};
class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_2: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_1 {
idc=170022;
y=0.265*safezoneH+safezoneY+0.325;
};
class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_3: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_1 {
idc=170023;
y=0.265*safezoneH+safezoneY+0.360;
};
class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_4: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_1 {
idc=170024;
y=0.265*safezoneH+safezoneY+0.395;
};
class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_5: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_1 {
idc=170025;
y=0.265*safezoneH+safezoneY+0.430;
};
class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_6: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_1 {
idc=170026;
y=0.265*safezoneH+safezoneY+0.465;
};
class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_7: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_1 {
idc=170027;
y=0.265*safezoneH+safezoneY+0.500;
};
class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_C1_BALLISTIC_COEFFICIENT_INPUT_1: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_1 {
idc=170031;
x=0.550*safezoneW+safezoneX+0.225;
};
class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_C1_BALLISTIC_COEFFICIENT_INPUT_2: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_2 {
idc=170032;
x=0.550*safezoneW+safezoneX+0.225;
};
class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_C1_BALLISTIC_COEFFICIENT_INPUT_3: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_3 {
idc=170033;
x=0.550*safezoneW+safezoneX+0.225;
};
class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_C1_BALLISTIC_COEFFICIENT_INPUT_4: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_4 {
idc=170034;
x=0.550*safezoneW+safezoneX+0.225;
};
class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_C1_BALLISTIC_COEFFICIENT_INPUT_5: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_5 {
idc=170035;
x=0.550*safezoneW+safezoneX+0.225;
};
class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_C1_BALLISTIC_COEFFICIENT_INPUT_6: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_6 {
idc=170036;
x=0.550*safezoneW+safezoneX+0.225;
};
class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_C1_BALLISTIC_COEFFICIENT_INPUT_7: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DISTANCE_INPUT_7 {
idc=170037;
x=0.550*safezoneW+safezoneX+0.225;
};
class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_QUESTIONMARK: TEXT_TARGET_DATA_NEXT {
idc=17004;
style=ST_CENTER;
w=0.04;
h=0.035;
y=0.265*safezoneH+safezoneY+0.35;
text="?";
action="";
};
class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_CLEAR: TEXT_C1_BALLISTIC_COEFFICIENT_DATA_QUESTIONMARK {
idc=17005;
w=0.07;
y=0.265*safezoneH+safezoneY+0.4175;
text="Clear";
action=QUOTE(call FUNC(clear_c1_ballistic_coefficient_data));
};
class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_DONE: TEXT_TARGET_DATA_DONE {
idc=17006;
action=QUOTE(1 call FUNC(toggle_c1_ballistic_coefficient_data));
};
class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_CANCEL: TEXT_TARGET_DATA_CANCEL {
idc=17007;
action=QUOTE(0 call FUNC(toggle_c1_ballistic_coefficient_data));
};
class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_PREV: TEXT_TARGET_DATA_PREV {
idc=17008;
};
class TEXT_C1_BALLISTIC_COEFFICIENT_DATA_NEXT: TEXT_TARGET_DATA_NEXT {
idc=17009;
};
class TEXT_TRUING_DROP_ZERO_RANGE: ATragMX_RscText {
idc=18000;
style=ST_LEFT;
x=0.550*safezoneW+safezoneX+0.115;
y=0.265*safezoneH+safezoneY+0.220;
w=0.135;
h=0.03;
sizeEx=0.025;
text="ZR=100meters";
};
class TEXT_TRUING_DROP_DROP_UNIT: TEXT_TRUING_DROP_ZERO_RANGE {
idc=18001;
style=ST_LEFT;
x=0.550*safezoneW+safezoneX+0.25;
text="Drop=mil";
};
class TEXT_TRUING_DROP_TARGET_RANGE: TEXT_TRUING_DROP_ZERO_RANGE {
idc=18002;
y=0.265*safezoneH+safezoneY+0.35;
sizeEx=0.027;
text="Target Range";
};
class TEXT_TRUING_DROP_DROP: TEXT_TRUING_DROP_TARGET_RANGE {
idc=18003;
w=0.07;
y=0.265*safezoneH+safezoneY+0.40;
text="Drop";
};
class TEXT_TRUING_DROP_MUZZLE_VELOCITY: TEXT_TRUING_DROP_DROP {
idc=18004;
y=0.265*safezoneH+safezoneY+0.50;
text="MV";
};
class TEXT_TRUING_DROP_C1_BALLISTIC_COEFFICIENT: TEXT_TRUING_DROP_DROP {
idc=18005;
y=0.265*safezoneH+safezoneY+0.55;
text="C1";
};
class TEXT_TRUING_DROP_DROP_OUTPUT: ATragMX_RscEdit {
idc=18006;
style=ST_WITH_RECT+ST_RIGHT;
colorBackground[]={0.15,0.21,0.23,0.3};
colorDisabled[]={0,0,0,1};
w=0.06;
y=0.265*safezoneH+safezoneY+0.40;
x=0.550*safezoneW+safezoneX+0.17;
text="";
};
class TEXT_TRUING_DROP_MUZZLE_VELOCITY_OUTPUT: TEXT_TRUING_DROP_DROP_OUTPUT {
idc=18007;
y=0.265*safezoneH+safezoneY+0.50;
text="";
};
class TEXT_TRUING_DROP_C1_BALLISTIC_COEFFICIENT_OUTPUT: TEXT_TRUING_DROP_DROP_OUTPUT {
idc=18008;
y=0.265*safezoneH+safezoneY+0.55;
text="";
};
class TEXT_TRUING_DROP_SUPER: TEXT_TARGET_A {
idc=18009;
w=0.06;
x=0.550*safezoneW+safezoneX+0.25;
y=0.265*safezoneH+safezoneY+0.30;
text="SUPER";
action=QUOTE(GVAR(truingDropMode) = 0; call FUNC(update_truing_drop_selection));
};
class TEXT_TRUING_DROP_SUB: TEXT_TRUING_DROP_SUPER {
idc=18010;
x=0.550*safezoneW+safezoneX+0.32;
text="SUB";
action=QUOTE(GVAR(truingDropMode) = 1; call FUNC(update_truing_drop_selection));
};
class TEXT_TRUING_DROP_TARGET_RANGE_SUPER_INPUT: ATragMX_RscEdit {
idc=18011;
style=ST_WITH_RECT+ST_RIGHT;
colorDisabled[]={0,0,0,0.6};
w=0.06;
x=0.550*safezoneW+safezoneX+0.25;
y=0.265*safezoneH+safezoneY+0.35;
};
class TEXT_TRUING_DROP_TARGET_RANGE_SUB_INPUT: TEXT_TRUING_DROP_TARGET_RANGE_SUPER_INPUT {
idc=18012;
x=0.550*safezoneW+safezoneX+0.32;
};
class TEXT_TRUING_DROP_DROP_SUPER_INPUT: TEXT_TRUING_DROP_TARGET_RANGE_SUPER_INPUT {
idc=18013;
y=0.265*safezoneH+safezoneY+0.40;
};
class TEXT_TRUING_DROP_DROP_SUB_INPUT: TEXT_TRUING_DROP_TARGET_RANGE_SUB_INPUT {
idc=18014;
y=0.265*safezoneH+safezoneY+0.40;
};
class TEXT_TRUING_DROP_CALC: TEXT_GUN_LIST {
idc=18015;
style=ST_CENTER;
w=0.11;
x=0.550*safezoneW+safezoneX+0.26;
y=0.265*safezoneH+safezoneY+0.45;
text="Calc";
action=QUOTE(true call FUNC(calculate_truing_drop));
};
class TEXT_TRUING_DROP_MV_INPUT: TEXT_TRUING_DROP_TARGET_RANGE_SUPER_INPUT {
idc=18016;
y=0.265*safezoneH+safezoneY+0.50;
};
class TEXT_TRUING_DROP_C1_BALLISTIC_COEFFICIENT_INPUT: TEXT_TRUING_DROP_TARGET_RANGE_SUB_INPUT {
idc=18017;
y=0.265*safezoneH+safezoneY+0.55;
};
class TEXT_TRUING_DROP_ACCEPT: TEXT_GUN_LIST {
idc=18018;
w=0.085;
h=0.04;
x=0.550*safezoneW+safezoneX+0.125;
y=0.265*safezoneH+safezoneY+0.60;
text="Accept";
action=QUOTE(1 call FUNC(toggle_truing_drop));
};
class TEXT_TRUING_DROP_CANCEL: TEXT_TRUING_DROP_ACCEPT {
idc=18019;
x=0.550*safezoneW+safezoneX+0.210;
text="Cancel";
action=QUOTE(0 call FUNC(toggle_truing_drop));
};
class TEXT_TRUING_DROP_RESTORE: TEXT_TRUING_DROP_CANCEL {
idc=18020;
x=0.550*safezoneW+safezoneX+0.29525;
text="Restore";
action=QUOTE(true call FUNC(restore_truing_drop));
};
};
};

View File

@ -1,13 +1,17 @@
PREP(add_new_gun);
PREP(calculate_distance_at_velocity);
PREP(calculate_range_card);
PREP(calculate_solution);
PREP(calculate_target_range_assist);
PREP(calculate_target_solution);
PREP(calculate_target_speed_assist);
PREP(calculate_truing_drop);
PREP(can_show);
PREP(change_gun);
PREP(change_target_slot);
PREP(clear_c1_ballistic_coefficient_data);
PREP(clear_muzzle_velocity_data);
PREP(clear_user_data);
PREP(create_dialog);
PREP(cycle_gun_list);
@ -18,17 +22,27 @@ PREP(cycle_scope_unit);
PREP(cycle_target_size_units);
PREP(cycle_target_speed_direction);
PREP(delete_gun);
PREP(evaluate_option_menu_input);
PREP(init);
PREP(insert_c1_ballistic_coefficient_data);
PREP(insert_muzzle_velocity_data);
PREP(parse_input);
PREP(recalculate_c1_ballistic_coefficient);
PREP(recalculate_muzzle_velocity);
PREP(reset_relative_click_memory);
PREP(restore_atmo_default);
PREP(restore_truing_drop);
PREP(restore_user_data);
PREP(save_gun);
PREP(shift_c1_ballistic_coefficient_data);
PREP(shift_muzzle_velocity_data);
PREP(show_add_new_gun);
PREP(show_atmo_env_data);
PREP(show_c1_ballistic_coefficient_data);
PREP(show_gun_ammo_data);
PREP(show_gun_list);
PREP(show_main_page);
PREP(show_muzzle_velocity_data);
PREP(show_range_card);
PREP(show_range_card_setup);
PREP(show_solution_setup);
@ -36,24 +50,34 @@ PREP(show_target_data);
PREP(show_target_range_assist);
PREP(show_target_speed_assist);
PREP(show_target_speed_assist_timer);
PREP(show_truing_drop);
PREP(sord);
PREP(store_user_data);
PREP(target_speed_assist_timer);
PREP(toggle_atmo_env_data);
PREP(toggle_c1_ballistic_coefficient_data);
PREP(toggle_coriolis);
PREP(toggle_gun_ammo_data);
PREP(toggle_gun_list);
PREP(toggle_muzzle_velocity_data);
PREP(toggle_option_menu);
PREP(toggle_range_card);
PREP(toggle_range_card_setup);
PREP(toggle_solution_setup);
PREP(toggle_target_data);
PREP(toggle_target_range_assist);
PREP(toggle_target_speed_assist);
PREP(toggle_truing_drop);
PREP(true_c1_ballistic_coefficient);
PREP(true_muzzle_velocity);
PREP(update_atmosphere);
PREP(update_atmo_env_data);
PREP(update_atmo_selection);
PREP(update_c1_ballistic_coefficient_data);
PREP(update_gun);
PREP(update_gun_ammo_data);
PREP(update_inclination_angle);
PREP(update_muzzle_velocity_data);
PREP(update_range_card);
PREP(update_relative_click_memory);
PREP(update_result);
@ -62,6 +86,8 @@ PREP(update_solution_setup);
PREP(update_target);
PREP(update_target_data);
PREP(update_target_selection);
PREP(update_truing_drop_data);
PREP(update_truing_drop_selection);
PREP(update_unit_selection);
PREP(update_zero_range);
PREP(on_close_dialog);

View File

@ -5,49 +5,49 @@
if ((profileNamespace getVariable ["ACE_ATragMX_profileNamespaceVersion", 0]) == ATRAGMX_PROFILE_NAMESPACE_VERSION && count (profileNamespace getVariable ["ACE_ATragMX_gunList", []]) > 0) then {
GVAR(gunList) = profileNamespace getVariable "ACE_ATragMX_gunList";
} else {
// Profile Name, Muzzle Velocity, Zero Range, Scope Base Angle, AirFriction, Bore Height, Scope Unit, Scope Click Unit, Scope Click Number, Maximum Elevation, Dialed Elevation, Dialed Windage, Mass, Bullet Diameter, Rifle Twist, BC, Drag Model, Atmosphere Model
GVAR(gunList) = [["12.7x108mm" , 820, 100, 0.0657485, -0.00063800, 3.81, 0, 2, 10, 120, 0, 0, 48.28, 12.7, 38.10, 0.630, 1, "ASM" ],
// Profile Name, Muzzle Velocity, Zero Range, Scope Base Angle, AirFriction, Bore Height, Scope Unit, Scope Click Unit, Scope Click Number, Maximum Elevation, Dialed Elevation, Dialed Windage, Mass, Bullet Diameter, Rifle Twist, BC, Drag Model, Atmosphere Model, Muzzle Velocity vs. Temperature Interpolation, C1 Ballistic Coefficient vs. Distance Interpolation
GVAR(gunList) = [["12.7x108mm" , 820, 100, 0.0657485, -0.00063800, 3.81, 0, 2, 10, 120, 0, 0, 48.28, 12.7, 38.10, 0.630, 1, "ASM" , [[-15,793],[0,800],[10,807],[15,812],[25,826],[30,835],[35,846]], [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]]],
["12.7x99mm AMAX" , 860, 100, 0.0611565, -0.00036645, 3.81, 0, 2, 10, 120, 0, 0, 48.60, 12.7, 38.10, 1.050, 1, "ASM" ],
["12.7x99mm" , 900, 100, 0.0582418, -0.00057503, 3.81, 0, 2, 10, 120, 0, 0, 41.92, 12.7, 38.10, 0.670, 1, "ASM" ],
["12.7x99mm AMAX" , 860, 100, 0.0611565, -0.00036645, 3.81, 0, 2, 10, 120, 0, 0, 48.60, 12.7, 38.10, 1.050, 1, "ASM" , [[-15,833],[0,840],[10,847],[15,852],[25,866],[30,875],[35,886]], [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]]],
["12.7x99mm" , 900, 100, 0.0582418, -0.00057503, 3.81, 0, 2, 10, 120, 0, 0, 41.92, 12.7, 38.10, 0.670, 1, "ASM" , [[-15,873],[0,880],[10,887],[15,892],[25,906],[30,915],[35,926]], [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]]],
["12.7x54mm" , 300, 100, 0.3394630, -0.00019268, 3.81, 0, 2, 10, 120, 0, 0, 48.60, 12.7, 24.13, 1.050, 1, "ASM" ],
["12.7x54mm" , 300, 100, 0.3394630, -0.00019268, 3.81, 0, 2, 10, 120, 0, 0, 48.60, 12.7, 24.13, 1.050, 1, "ASM" , [[-15,297],[0,298],[10,299],[15,299],[25,301],[30,302],[35,303]], [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]]],
[".50 Beowulf" , 563, 100, 0.0657485, -0.00202645, 3.81, 0, 2, 10, 120, 0, 0, 21.71, 12.7, 50.80, 0.210, 1, "ASM" ],
[".50 Beowulf" , 563, 100, 0.0657485, -0.00202645, 3.81, 0, 2, 10, 120, 0, 0, 21.71, 12.7, 50.80, 0.210, 1, "ASM" , [[-15,560],[0,561],[10,562],[15,562],[25,564],[30,565],[35,566]], [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]]],
[".408 Chey Tac" , 910, 100, 0.0569400, -0.00038944, 3.81, 0, 2, 10, 120, 0, 0, 26.57, 10.4, 33.02, 0.970, 1, "ASM" ],
[".408 Chey Tac" , 910, 100, 0.0569400, -0.00038944, 3.81, 0, 2, 10, 120, 0, 0, 26.57, 10.4, 33.02, 0.970, 1, "ASM" , [[-15,883],[0,890],[10,897],[15,902],[25,916],[30,925],[35,936]], [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]]],
["9.3×64mm" , 870, 100, 0.0619295, -0.00108571, 3.81, 0, 2, 10, 120, 0, 0, 14.90, 9.30, 35.56, 0.368, 1, "ASM" ],
["9.3×64mm" , 870, 100, 0.0619295, -0.00108571, 3.81, 0, 2, 10, 120, 0, 0, 14.90, 9.30, 35.56, 0.368, 1, "ASM" , [[-15,843],[0,850],[10,857],[15,862],[25,876],[30,885],[35,896]], [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]]],
[".338LM 250gr" , 880, 100, 0.0598469, -0.00059133, 3.81, 0, 2, 10, 120, 0, 0, 16.20, 8.58, 25.40, 0.322, 7, "ICAO"],
[".338LM 300gr" , 800, 100, 0.0677343, -0.00052190, 3.81, 0, 2, 10, 120, 0, 0, 19.44, 8.58, 25.40, 0.381, 7, "ICAO"],
[".338LM API526" , 895, 100, 0.0588865, -0.00069611, 3.81, 0, 2, 10, 120, 0, 0, 16.39, 8.58, 25.40, 0.560, 1, "ASM" ],
[".338LM 250gr" , 880, 100, 0.0598469, -0.00059133, 3.81, 0, 2, 10, 120, 0, 0, 16.20, 8.58, 25.40, 0.645, 1, "ICAO", [[-15,853],[0,860],[10,867],[15,872],[25,886],[30,895],[35,906]], [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]]],
[".338LM 300gr" , 800, 100, 0.0677343, -0.00052190, 3.81, 0, 2, 10, 120, 0, 0, 19.44, 8.58, 25.40, 0.759, 1, "ICAO", [[-15,773],[0,780],[10,787],[15,792],[25,806],[30,815],[35,826]], [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]]],
[".338LM API526" , 880, 100, 0.0588865, -0.00069611, 3.81, 0, 2, 10, 120, 0, 0, 16.39, 8.58, 25.40, 0.760, 1, "ICAO", [[-15,853],[0,860],[10,867],[15,872],[25,886],[30,895],[35,906]], [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]]],
[".300WM Mk248 Mod0" , 900, 100, 0.0584442, -0.00070530, 3.81, 0, 2, 10, 120, 0, 0, 12.31, 7.80, 25.40, 0.268, 7, "ICAO"],
[".300WM Mk248 Mod1" , 867, 100, 0.0610738, -0.00061188, 3.81, 0, 2, 10, 120, 0, 0, 14.26, 7.80, 25.40, 0.310, 7, "ICAO"],
[".300WM Berger OTM" , 853, 100, 0.0622179, -0.00053733, 3.81, 0, 2, 10, 120, 0, 0, 14.90, 7.80, 25.40, 0.368, 7, "ICAO"],
[".300WM Mk248 Mod0" , 900, 100, 0.0584442, -0.00070530, 3.81, 0, 2, 10, 120, 0, 0, 12.31, 7.80, 25.40, 0.537, 1, "ICAO", [[-15,838],[0,845],[10,852],[15,857],[25,871],[30,880],[35,891]], [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]]],
[".300WM Mk248 Mod1" , 867, 100, 0.0610738, -0.00061188, 3.81, 0, 2, 10, 120, 0, 0, 14.26, 7.80, 25.40, 0.619, 1, "ICAO", [[-15,820],[0,827],[10,834],[15,839],[25,853],[30,862],[35,873]], [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]]],
[".300WM Berger OTM" , 853, 100, 0.0622179, -0.00053733, 3.81, 0, 2, 10, 120, 0, 0, 14.90, 7.80, 25.40, 0.715, 1, "ICAO", [[-15,773],[0,780],[10,787],[15,792],[25,806],[30,815],[35,826]], [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]]],
["7.62x54mmR" , 800, 100, 0.0691878, -0.00100023, 3.81, 0, 2, 10, 120, 0, 0, 9.849, 7.92, 24.13, 0.400, 1, "ICAO"],
["7.62x54mmR" , 820, 100, 0.0691878, -0.00100023, 3.81, 0, 2, 10, 120, 0, 0, 9.849, 7.92, 24.13, 0.400, 1, "ICAO", [[-15,793],[0,800],[10,807],[15,812],[25,826],[30,835],[35,846]], [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]]],
["7.62x51mm M80" , 810, 100, 0.0679374, -0.00100957, 3.81, 0, 2, 10, 120, 0, 0, 9.461, 7.82, 25.40, 0.200, 7, "ICAO"],
["7.62x51mm M118LR" , 780, 100, 0.0710319, -0.00082828, 3.81, 0, 2, 10, 120, 0, 0, 11.34, 7.82, 25.40, 0.243, 7, "ICAO"],
["7.62x51mm Mk316" , 780, 100, 0.0710319, -0.00082029, 3.81, 0, 2, 10, 120, 0, 0, 11.34, 7.82, 25.40, 0.243, 7, "ICAO"],
["7.62x51mm Mk319" , 910, 100, 0.0584524, -0.00102338, 3.81, 0, 2, 10, 120, 0, 0, 8.424, 7.82, 25.40, 0.377, 1, "ICAO"],
["7.62x51mm M993" , 930, 100, 0.0570316, -0.00107148, 3.81, 0, 2, 10, 120, 0, 0, 8.230, 7.82, 25.40, 0.359, 1, "ICAO"],
["7.62x51mm Subsonic", 320, 100, 0.3059680, -0.00049899, 3.81, 0, 2, 10, 120, 0, 0, 12.96, 7.82, 25.40, 0.235, 7, "ICAO"],
["7.62x51mm M80" , 810, 100, 0.0679374, -0.00100957, 3.81, 0, 2, 10, 120, 0, 0, 9.461, 7.82, 25.40, 0.398, 1, "ICAO", [[-15,783],[0,790],[10,797],[15,802],[25,816],[30,825],[35,836]], [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]]],
["7.62x51mm M118LR" , 765, 100, 0.0710319, -0.00082828, 3.81, 0, 2, 10, 120, 0, 0, 11.34, 7.82, 25.40, 0.482, 1, "ICAO", [[-15,738],[0,745],[10,752],[15,757],[25,771],[30,780],[35,791]], [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]]],
["7.62x51mm Mk316" , 782, 100, 0.0710319, -0.00082029, 3.81, 0, 2, 10, 120, 0, 0, 11.34, 7.82, 25.40, 0.483, 1, "ICAO", [[-15,777],[0,778],[10,779],[15,781],[25,783],[30,785],[35,787]], [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]]],
["7.62x51mm Mk319" , 901, 100, 0.0584524, -0.00102338, 3.81, 0, 2, 10, 120, 0, 0, 8.424, 7.82, 25.40, 0.377, 1, "ICAO", [[-15,898],[0,899],[10,900],[15,900],[25,902],[30,903],[35,904]], [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]]],
["7.62x51mm M993" , 920, 100, 0.0570316, -0.00107148, 3.81, 0, 2, 10, 120, 0, 0, 8.230, 7.82, 25.40, 0.359, 1, "ICAO", [[-15,893],[0,900],[10,907],[15,912],[25,926],[30,935],[35,946]], [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]]],
["7.62x51mm Subsonic", 315, 100, 0.3059680, -0.00049899, 3.81, 0, 2, 10, 120, 0, 0, 12.96, 7.82, 25.40, 0.502, 1, "ICAO", [[-15,312],[0,313],[10,314],[15,314],[25,316],[30,317],[35,318]], [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]]],
["6.5x39mm" , 800, 100, 0.0683482, -0.00075308, 3.81, 0, 2, 10, 120, 0, 0, 7.970, 6.71, 22.86, 0.263, 7, "ICAO"],
["6.5x47mm Lapua" , 800, 100, 0.0682221, -0.00067037, 3.81, 0, 2, 10, 120, 0, 0, 9.007, 6.71, 22.86, 0.290, 7, "ICAO"],
["6.5mm Creedmor" , 840, 100, 0.0636501, -0.00060887, 3.81, 0, 2, 10, 120, 0, 0, 9.072, 6.71, 22.86, 0.317, 7, "ICAO"],
["6.5x39mm" , 774, 100, 0.0683482, -0.00075308, 3.81, 0, 2, 10, 120, 0, 0, 7.970, 6.71, 22.86, 0.524, 1, "ICAO", [[-15,747],[0,754],[10,761],[15,766],[25,780],[30,789],[35,800]], [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]]],
["6.5x47mm Lapua" , 775, 100, 0.0682221, -0.00067037, 3.81, 0, 2, 10, 120, 0, 0, 9.007, 6.71, 22.86, 0.577, 1, "ICAO", [[-15,748],[0,755],[10,762],[15,767],[25,781],[30,790],[35,801]], [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]]],
["6.5mm Creedmor" , 830, 100, 0.0636501, -0.00060887, 3.81, 0, 2, 10, 120, 0, 0, 9.072, 6.71, 22.86, 0.632, 1, "ICAO", [[-15,803],[0,810],[10,817],[15,822],[25,836],[30,845],[35,856]], [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]]],
["5.8x42mm DBP87" , 930, 100, 0.0572574, -0.00117956, 3.81, 0, 2, 10, 120, 0, 0, 4.150, 5.99, 24.40, 0.156, 7, "ICAO" ],
["5.8x42mm DBP87" , 950, 100, 0.0572574, -0.00117956, 3.81, 0, 2, 10, 120, 0, 0, 4.150, 5.99, 24.40, 0.313, 1, "ICAO", [[-15,923],[0,930],[10,937],[15,942],[25,956],[30,965],[35,976]], [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]]],
["5.56x45mm M855" , 870, 100, 0.0626386, -0.00126466, 3.81, 0, 2, 10, 120, 0, 0, 4.018, 5.70, 17.78, 0.151, 7, "ASM" ],
["5.56x45mm Mk262" , 820, 100, 0.0671481, -0.00109563, 3.81, 0, 2, 10, 120, 0, 0, 4.990, 5.70, 17.78, 0.361, 1, "ASM" ],
["5.56x45mm Mk318" , 880, 100, 0.0615937, -0.00123318, 3.81, 0, 2, 10, 120, 0, 0, 4.018, 5.70, 17.78, 0.307, 1, "ASM" ],
["5.56x45mm M995" , 869, 100, 0.0626713, -0.00123272, 3.81, 0, 2, 10, 120, 0, 0, 4.536, 5.70, 17.78, 0.310, 1, "ASM" ],
["5.56x45mm M855" , 870, 100, 0.0626386, -0.00126466, 3.81, 0, 2, 10, 120, 0, 0, 4.018, 5.70, 17.78, 0.302, 1, "ASM" , [[-15,843],[0,849],[10,857],[15,862],[25,876],[30,885],[35,898]], [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]]],
["5.56x45mm Mk262" , 820, 100, 0.0671481, -0.00109563, 3.81, 0, 2, 10, 120, 0, 0, 4.990, 5.70, 17.78, 0.361, 1, "ASM" , [[-15,793],[0,800],[10,807],[15,812],[25,826],[30,835],[35,846]], [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]]],
["5.56x45mm Mk318" , 880, 100, 0.0615937, -0.00123318, 3.81, 0, 2, 10, 120, 0, 0, 4.018, 5.70, 17.78, 0.307, 1, "ASM" , [[-15,853],[0,860],[10,867],[15,872],[25,886],[30,895],[35,906]], [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]]],
["5.56x45mm M995" , 869, 100, 0.0626713, -0.00123272, 3.81, 0, 2, 10, 120, 0, 0, 4.536, 5.70, 17.78, 0.310, 1, "ASM" , [[-15,842],[0,849],[10,856],[15,861],[25,875],[30,884],[35,895]], [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]]],
["5.45x39mm 7N6M" , 735, 100, 0.0787205, -0.00116278, 3.81, 0, 2, 10, 120, 0, 0, 3.428, 5.59, 16.00, 0.168, 7, "ICAO"]];
["5.45x39mm 7N6M" , 735, 100, 0.0787205, -0.00116278, 3.81, 0, 2, 10, 120, 0, 0, 3.428, 5.59, 16.00, 0.336, 1, "ICAO", [[-15,708],[0,715],[10,722],[15,727],[25,741],[30,750],[35,761]], [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]]]];
[] call FUNC(clear_user_data);
profileNamespace setVariable ["ACE_ATragMX_gunList", GVAR(gunList)];

View File

@ -17,7 +17,7 @@
private _gunName = ctrlText 11001;
if (_gunName != "") then {
private _gunProfileEntry = [_gunName, 810, 100, 0.0679, -0.0010350, 3.81, 0, 2, 10, 120, 0, 0, 9.525, 7.82, 25.40, 0.393, 1, "ICAO"],
private _gunProfileEntry = [_gunName, 810, 100, 0.0679, -0.0010350, 3.81, 0, 2, 10, 120, 0, 0, 9.525, 7.82, 25.40, 0.393, 1, "ICAO", [[-15,0],[0,0],[10,0],[15,0],[25,0],[30,0],[35,0]], [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]]];
GVAR(gunList) = GVAR(gunList) + [_gunProfileEntry];

View File

@ -0,0 +1,41 @@
/*
* Author: Ruthberg
* Calculates distance at which the bullet velocity drops below the threshold velocity
*
* Arguments:
* theshold velocity <number>
*
* Return Value:
* distance <number
*
* Example:
* 403 call ace_atragmx_fnc_calculate_distance_at_velocity
*
* Public: No
*/
#include "script_component.hpp"
#define __DELTA_T 0.001
if (isNil QGVAR(targetSolutionInput)) exitWith { 0 };
private _thresholdVelocity = _this;
private _velocity = GVAR(targetSolutionInput) select 4;
if (_velocity <= _thresholdVelocity) exitWith { 0 };
private _distance = 0;
while {_velocity > _thresholdVelocity} do {
private _bc = GVAR(targetSolutionInput) select 14;
private _dragModel = GVAR(targetSolutionInput) select 15;
private _drag = if (missionNamespace getVariable [QEGVAR(advanced_ballistics,extensionAvailable), false]) then {
parseNumber(("ace_advanced_ballistics" callExtension format["retard:%1:%2:%3", _dragModel, _bc, _velocity]))
} else {
([_dragModel, _bc, _velocity] call EFUNC(advanced_ballistics,calculateRetardation))
};
_distance = _distance + _velocity * __DELTA_T;
_velocity = _velocity - (_drag * __DELTA_T);
};
_distance

View File

@ -16,7 +16,7 @@
#include "script_component.hpp"
private _angle = parseNumber(ctrlText 7012);
private _targetSize = parseNumber(ctrlText 7010);
private _targetSize = abs(parseNumber(ctrlText 7010));
if (GVAR(rangeAssistUseTargetHeight)) then {
_targetSize = _targetSize * cos(_angle);
};
@ -43,7 +43,7 @@ switch (GVAR(rangeAssistImageSizeUnit)) do {
_imageSize = _imageSize / 60 / 1.047;
};
};
private _estRange = parseNumber(ctrlText 7013);
private _estRange = abs(parseNumber(ctrlText 7013));
if (GVAR(currentUnit) == 1) then {
_estRange = _estRange / 1.0936133;
};
@ -52,7 +52,7 @@ switch (_this) do {
case 0: {
_targetSize = tan(_imageSize) * _estRange;
if (GVAR(rangeAssistUseTargetHeight)) then {
if (GVAR(rangeAssistUseTargetHeight) && cos(_angle) != 0) then {
_targetSize = _targetSize / cos(_angle);
};
@ -71,8 +71,10 @@ switch (_this) do {
ctrlSetText [7010, Str(Round(_targetSize * 100) / 100)];
};
case 1: {
_imageSize = atan(_targetSize / _estRange);
if (_estRange > 0) then {
_imageSize = atan(_targetSize / _estRange);
};
switch (GVAR(rangeAssistImageSizeUnit)) do {
case 0: {
_imageSize = _imageSize * 6400 / 360;
@ -88,8 +90,10 @@ switch (_this) do {
ctrlSetText [7011, Str(Round(_imageSize * 100) / 100)];
};
case 2: {
_estRange = _targetSize / tan(_imageSize);
if (tan(_imageSize) != 0) then {
_estRange = _targetSize / tan(_imageSize);
};
ctrlSetText [7013, Str(Round(_estRange))];
};
};

View File

@ -70,9 +70,10 @@ _inclinationAngle = GVAR(inclinationAngle) select GVAR(currentTarget);
_targetSpeed = GVAR(targetSpeed) select GVAR(currentTarget);
_targetRange = GVAR(targetRange) select GVAR(currentTarget);
private ["_result"];
_result = [_scopeBaseAngle, _bulletMass, _boreHeight, _airFriction, _muzzleVelocity, _temperature, _barometricPressure, _relativeHumidity, 1000,
[_windSpeed1, _windSpeed2], _windDirection, _inclinationAngle, _targetSpeed, _targetRange, _bc, _dragModel, _atmosphereModel, false, _stabilityFactor, _twistDirection, _latitude, _directionOfFire] call FUNC(calculate_solution);
GVAR(targetSolutionInput) = [_scopeBaseAngle, _bulletMass, _boreHeight, _airFriction, _muzzleVelocity, _temperature, _barometricPressure, _relativeHumidity, 1000,
[_windSpeed1, _windSpeed2], _windDirection, _inclinationAngle, _targetSpeed, _targetRange, _bc, _dragModel, _atmosphereModel, false, _stabilityFactor, _twistDirection, _latitude, _directionOfFire];
private _result = GVAR(targetSolutionInput) call FUNC(calculate_solution);
GVAR(elevationOutput) set [GVAR(currentTarget), _result select 0];
GVAR(windage1Output) set [GVAR(currentTarget), (_result select 1) select 0];
@ -80,5 +81,8 @@ GVAR(windage2Output) set [GVAR(currentTarget), (_result select 1) select 1];
GVAR(leadOutput) set [GVAR(currentTarget), _result select 2];
GVAR(tofOutput) set [GVAR(currentTarget), _result select 3];
GVAR(velocityOutput) set [GVAR(currentTarget), _result select 4];
GVAR(verticalCoriolisOutput) set [GVAR(currentTarget), _result select 6];
GVAR(horizontalCoriolisOutput) set [GVAR(currentTarget), _result select 7];
GVAR(spinDriftOutput) set [GVAR(currentTarget), _result select 8];
[] call FUNC(update_result);

View File

@ -0,0 +1,107 @@
/*
* Author: Ruthberg
* Calculates the truing drop and updates the output fields
*
* Arguments:
* parse input <BOOL>
*
* Return Value:
* Nothing
*
* Example:
* call ace_atragmx_fnc_calculate_truing_drop
*
* Public: No
*/
#include "script_component.hpp"
private _parseInput = _this;
private _transonicRange = GVAR(truingDropRangeData) select 0;
private _subsonicRange = GVAR(truingDropRangeData) select 1;
private _transonicDrop = GVAR(truingDropDropData) select 1;
private _subsonicDrop = GVAR(truingDropDropData) select 2;
if (_parseInput) then {
_transonicRange = 0 max abs(parseNumber(ctrlText 18011)) min 4000;
_subsonicRange = 0 max abs(parseNumber(ctrlText 18012)) min 4000;
if (GVAR(currentUnit) != 2) then {
_transonicRange = _transonicRange * 0.9144;
_subsonicRange = _subsonicRange * 0.9144;
};
_transonicRange = Round(_transonicRange);
_subsonicRange = Round(_subsonicRange);
_subsonicRange = _transonicRange max _subsonicRange;
_transonicDrop = 0 max abs(parseNumber(ctrlText 18013)) min 1000;
_subsonicDrop = 0 max abs(parseNumber(ctrlText 18014)) min 1000;
private _dropUnit = GVAR(currentScopeUnit);
if (_dropUnit == 3) then {
switch (GVAR(currentScopeClickUnit)) do {
case 0: { _dropUnit = 1; };
case 1: { _dropUnit = 2; };
case 2: { _dropUnit = 0; };
};
};
switch (_dropUnit) do {
case 0: {
_transonicDrop = _transonicDrop * 3.38;
_subsonicDrop = _subsonicDrop * 3.38;
};
case 2: {
_transonicDrop = _transonicDrop / 1.047;
_subsonicDrop = _subsonicDrop / 1.047;
};
};
_transonicDrop = Round(_transonicDrop * 100) / 100;
_subsonicDrop = Round(_subsonicDrop * 100) / 100;
_subsonicDrop = _transonicDrop max _subsonicDrop;
};
if ((GVAR(truingDropDropData) select 0) == 0 || {!([_transonicRange, _subsonicRange] isEqualTo GVAR(truingDropRangeData))}) then {
if (isNil QGVAR(targetSolutionInput)) then {
call FUNC(calculate_target_solution);
};
private _solutionInput = +GVAR(targetSolutionInput);
if (_transonicRange == 0) then {
_transonicRange = Round(403 call FUNC(calculate_distance_at_velocity));
};
_solutionInput set [13, _transonicRange];
private _result1 = _solutionInput call FUNC(calculate_solution);
_transonicDrop = Round((_result1 select 0) * 100) / 100;
GVAR(truingDropRangeData) set [0, _transonicRange];
GVAR(truingDropDropData) set [1, _transonicDrop];
GVAR(truingDropReferenceDropData) set [0, _transonicDrop];
private _speedOfSound = (_solutionInput select 5) call EFUNC(weather,calculateSpeedOfSound);
if (_subsonicRange == 0) then {
_subsonicRange = _speedOfSound call FUNC(calculate_distance_at_velocity);
if (GVAR(currentUnit) == 2) then {
_subsonicRange = _subsonicRange + 200;
} else {
_subsonicRange = _subsonicRange + 200 * 1.0936133;
};
_subsonicRange = Round(_subsonicRange);
};
_solutionInput set [13, _subsonicRange];
private _result2 = _solutionInput call FUNC(calculate_solution);
_subsonicDrop = Round((_result2 select 0) * 100) / 100;
GVAR(truingDropRangeData) set [1, _subsonicRange];
GVAR(truingDropDropData) set [2, _subsonicDrop];
GVAR(truingDropReferenceDropData) set [1, _subsonicDrop];
} else {
if (_transonicDrop != GVAR(truingDropDropData) select 1 || _subsonicDrop != GVAR(truingDropDropData) select 2) then {
GVAR(truingDropDropData) set [1, _transonicDrop];
GVAR(truingDropDropData) set [2, _subsonicDrop];
if (GVAR(truingDropMode) == 0) then {
call FUNC(true_muzzle_velocity);
} else {
call FUNC(true_c1_ballistic_coefficient);
};
};
};
call FUNC(update_truing_drop_data);

View File

@ -26,6 +26,12 @@ if (_restoreMemory) then {
};
GVAR(currentGun) = _gunID;
[false, false] call FUNC(recalculate_muzzle_velocity);
if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then {
false call FUNC(restore_truing_drop);
[false, false] call FUNC(recalculate_c1_ballistic_coefficient);
};
if (_updateDisplay) then {
lbSetCurSel [6000, GVAR(currentGun)];
};
@ -37,6 +43,8 @@ GVAR(currentScopeClickNumber) = 1 max (GVAR(workingMemory) select 8) min 10;
if (_updateDisplay) then {
[] call FUNC(update_gun);
[] call FUNC(update_gun_ammo_data);
[] call FUNC(update_muzzle_velocity_data);
[] call FUNC(update_c1_ballistic_coefficient_data);
};
GVAR(elevationOutput) set [GVAR(currentTarget), 0];
@ -45,6 +53,9 @@ GVAR(windage2Output) set [GVAR(currentTarget), 0];
GVAR(leadOutput) set [GVAR(currentTarget), 0];
GVAR(tofOutput) set [GVAR(currentTarget), 0];
GVAR(velocityOutput) set [GVAR(currentTarget), 0];
GVAR(verticalCoriolisOutput) set [GVAR(currentTarget), 0];
GVAR(horizontalCoriolisOutput) set [GVAR(currentTarget), 0];
GVAR(spinDriftOutput) set [GVAR(currentTarget), 0];
if (_updateDisplay) then {
[] call FUNC(calculate_target_solution);

View File

@ -17,9 +17,8 @@
private _target = 0 max _this min 3;
call FUNC(parse_input);
[] call FUNC(parse_input);
GVAR(currentTarget) = _target;
call FUNC(update_target_selection);
[] call FUNC(calculate_target_solution);
call FUNC(calculate_target_solution);

View File

@ -0,0 +1,21 @@
/*
* Author: Ruthberg
* Clears the c1 ballistic coefficient data fields
*
* Arguments:
* Nothing
*
* Return Value:
* Nothing
*
* Example:
* call ace_atragmx_fnc_clear_c1_ballistic_coefficient_data
*
* Public: No
*/
#include "script_component.hpp"
// Distances
{ctrlSetText [_x, "0"]} forEach [170021, 170022, 170023, 170024, 170025, 170026, 170027];
// Ballistic Coefficients
{ctrlSetText [_x, "0"]} forEach [170031, 170032, 170033, 170034, 170035, 170036, 170037];

View File

@ -0,0 +1,21 @@
/*
* Author: Ruthberg
* Clears the muzzle velocity data fields
*
* Arguments:
* Nothing
*
* Return Value:
* Nothing
*
* Example:
* call ace_atragmx_fnc_clear_muzzle_velocity_data
*
* Public: No
*/
#include "script_component.hpp"
// Temperatures
{ctrlSetText [_x, "0"]} forEach [160021, 160022, 160023, 160024, 160025, 160026, 160027];
// Muzzle velocities
{ctrlSetText [_x, "0"]} forEach [160031, 160032, 160033, 160034, 160035, 160036, 160037];

View File

@ -28,6 +28,7 @@ profileNamespace setVariable ["ACE_ATragMX_temperature", nil];
profileNamespace setVariable ["ACE_ATragMX_barometricPressure", nil];
profileNamespace setVariable ["ACE_ATragMX_relativeHumidity", nil];
profileNamespace setVariable ["ACE_ATragMX_showCoriolis", nil];
profileNamespace setVariable ["ACE_ATragMX_showWind2", nil];
profileNamespace setVariable ["ACE_ATragMX_latitude", nil];
profileNamespace setVariable ["ACE_ATragMX_directionOfFire", nil];

View File

@ -30,8 +30,10 @@ GVAR(showMainPage) call FUNC(show_main_page);
GVAR(showAddNewGun) call FUNC(show_add_new_gun);
GVAR(showAtmoEnvData) call FUNC(show_atmo_env_data);
GVAR(showC1BallisticCoefficientData) call FUNC(show_c1_ballistic_coefficient_data);
GVAR(showGunAmmoData) call FUNC(show_gun_ammo_data);
GVAR(showGunList) call FUNC(show_gun_list);
GVAR(showMuzzleVelocityData) call FUNC(show_muzzle_velocity_data);
GVAR(showRangeCard) call FUNC(show_range_card);
if (GVAR(showRangeCard)) then {
ctrlSetFocus ((uiNamespace getVariable "ATragMX_Display") displayCtrl 5001);
@ -43,6 +45,7 @@ GVAR(showTargetData) call FUNC(show_target_data);
GVAR(showTargetRangeAssist) call FUNC(show_target_range_assist);
GVAR(showTargetSpeedAssist) call FUNC(show_target_speed_assist);
GVAR(showTargetSpeedAssistTimer) call FUNC(show_target_speed_assist_timer);
GVAR(showTruingDrop) call FUNC(show_truing_drop);
[GVAR(currentGun), false, true] call FUNC(change_gun);
@ -50,6 +53,13 @@ GVAR(showTargetSpeedAssistTimer) call FUNC(show_target_speed_assist_timer);
lbAdd [6000, _x select 0];
} forEach GVAR(gunList);
ctrlShow [3001, false];
ctrlShow [3002, false];
{
(__dsp displayCtrl _x) ctrlEnable false;
} forEach [18006, 18007, 18008];
GVAR(active) = true;
GVAR(DialogPFH) = [{

View File

@ -15,10 +15,10 @@
*/
#include "script_component.hpp"
[] call FUNC(parse_input);
GVAR(currentScopeUnit) = (GVAR(currentScopeUnit) + 1) % (count GVAR(scopeUnits));
GVAR(workingMemory) set [6, GVAR(currentScopeUnit)];
true call FUNC(show_main_page);
[] call FUNC(update_scope_unit);
[] call FUNC(update_result);

View File

@ -0,0 +1,30 @@
/*
* Author: Ruthberg
* Evalutes input from the option menu
*
* Arguments:
* option menu id <number>
*
* Return Value:
* Nothing
*
* Example:
* 1 call ace_atragmx_fnc_evaluate_option_menu_input
*
* Public: No
*/
#include "script_component.hpp"
params ["_optionID"];
switch (_optionID) do {
case 0: {}; // Accuracy 1st
case 1: { 0 call FUNC(toggle_muzzle_velocity_data); }; // MuzVel Table
case 2: { 0 call FUNC(toggle_c1_ballistic_coefficient_data); }; // Bal Coef Table
case 3: { 0 call FUNC(toggle_target_speed_assist); }; // Target Speed Est
case 4: { 0 call FUNC(toggle_target_range_assist); }; // Target Range Est
case 5: { 0 call FUNC(toggle_truing_drop); }; // Truing Drop
case 6: { 0 call FUNC(toggle_coriolis); }; // Show Coriolis
case 7: { 0 call FUNC(toggle_solution_setup); }; // Set Clicks
case 8: {}; // Gun Note
};

View File

@ -65,18 +65,33 @@ GVAR(targetSpeedDirection) = [1, 1, 1, 1];
GVAR(targetRange) = [0, 0, 0, 0];
GVAR(showWind2) = false;
GVAR(showCoriolis) = false;
GVAR(elevationOutput) = [0, 0, 0, 0];
GVAR(windage1Output) = [0, 0, 0, 0];
GVAR(windage2Output) = [0, 0, 0, 0];
GVAR(leadOutput) = [0, 0, 0, 0];
GVAR(tofOutput) = [0, 0, 0, 0];
GVAR(velocityOutput) = [0, 0, 0, 0];
GVAR(verticalCoriolisOutput) = [0, 0, 0, 0];
GVAR(horizontalCoriolisOutput) = [0, 0, 0, 0];
GVAR(spinDriftOutput) = [0, 0, 0, 0];
GVAR(truingDropMode) = 0;
GVAR(truingDropRangeData) = [0, 0];
GVAR(truingDropDropData) = [0, 0, 0];
GVAR(truingDropReferenceDropData) = [0, 0, 0];
GVAR(truingDropC1) = 0;
GVAR(truingDropMuzzleVelocity) = 0;
GVAR(targetSolutionInput) = nil;
GVAR(showMainPage) = true;
GVAR(showAddNewGun) = false;
GVAR(showAtmoEnvData) = false;
GVAR(showC1BallisticCoefficientData) = false;
GVAR(showGunAmmoData) = false;
GVAR(showGunList) = false;
GVAR(showMuzzleVelocityData) = false;
GVAR(showRangeCard) = false;
GVAR(showRangeCardSetup) = false;
GVAR(showSolutionSetup) = false;
@ -84,3 +99,4 @@ GVAR(showTargetData) = false;
GVAR(showTargetRangeAssist) = false;
GVAR(showTargetSpeedAssist) = false;
GVAR(showTargetSpeedAssistTimer) = false;
GVAR(showTruingDrop) = false;

View File

@ -0,0 +1,55 @@
/*
* Author: Ruthberg
* Inserts entry in the c1 ballistic coefficient vs. distance interpolation table
*
* Arguments:
* transonic range - <NUMBER>
* subsonic range - <NUMBER>
* c1 ballistic coefficient - <NUMBER>
*
* Return Value:
* Nothing
*
* Example:
* [800, 0.485] call ace_atragmx_fnc_insert_c1_ballistic_coefficient_data
*
* Public: No
*/
#include "script_component.hpp"
params ["_transonicRange", "_subsonicRange", "_c1"];
private _entries = {(_x select 1) > 0} count (GVAR(workingMemory) select 19);
if (_entries > 0) then {
// Insert
private _insertIndex = 0;
private _minDiff = 10000;
{
if (_minDiff > 0 && {(((GVAR(workingMemory) select 19) select _forEachIndex) select 1) == 0}) then {
_insertIndex = _forEachIndex;
_minDiff = 0;
};
private _tr = ((GVAR(workingMemory) select 19) select _forEachIndex) select 0;
private _diff = abs(_subsonicRange - _tr);
if (_diff == 0) exitWith {
_insertIndex = _forEachIndex;
};
if (_diff < _minDiff) then {
_insertIndex = _forEachIndex;
_minDiff = _diff;
};
} forEach (GVAR(workingMemory) select 19);
(GVAR(workingMemory) select 19) set [_insertIndex, [_subsonicRange, 0.1 max _c1 min 2.0]];
} else {
// Reset
private _zeroRange = GVAR(workingMemory) select 2;
private _bc = GVAR(workingMemory) select 15;
GVAR(workingMemory) set [19, [[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]]];
(GVAR(workingMemory) select 19) set [0, [_zeroRange, _bc]];
(GVAR(workingMemory) select 19) set [1, [_transonicRange + (_subsonicRange - _transonicRange) * 0.75, _bc]];
(GVAR(workingMemory) select 19) set [2, [_subsonicRange, 0.1 max _c1 min 2.0]];
};
call FUNC(update_c1_ballistic_coefficient_data);

View File

@ -0,0 +1,41 @@
/*
* Author: Ruthberg
* Inserts entry in the muzzle velocity vs. temperature interpolation table
*
* Arguments:
* temperature - <NUMBER>
* muzzle velocity - <NUMBER>
*
* Return Value:
* Nothing
*
* Example:
* [10, 800] call ace_atragmx_fnc_insert_muzzle_velocity_data
*
* Public: No
*/
#include "script_component.hpp"
params ["_temperature", "_muzzleVelocity"];
private _insertIndex = 0;
private _minDiff = 1000;
{
if (_minDiff > 0 && {(((GVAR(workingMemory) select 18) select _forEachIndex) select 1) == 0}) then {
_insertIndex = _forEachIndex;
_minDiff = 0;
};
private _t = ((GVAR(workingMemory) select 18) select _forEachIndex) select 0;
private _diff = abs(_temperature - _t);
if (_diff == 0) exitWith {
_insertIndex = _forEachIndex;
};
if (_diff < _minDiff) then {
_insertIndex = _forEachIndex;
_minDiff = _diff;
};
} forEach (GVAR(workingMemory) select 18);
(GVAR(workingMemory) select 18) set [_insertIndex, [_temperature, 0 max _muzzleVelocity min 1400]];
call FUNC(update_muzzle_velocity_data);

View File

@ -1,6 +1,6 @@
/*
* Author: Ruthberg
* Parses all input fields in the gun, atmosphere and target column and the result input fields
* Parses all input fields in the gun-, atmosphere- and target column, the result input fields and the muzzle velocity data input fields
*
* Arguments:
* Nothing
@ -15,6 +15,35 @@
*/
#include "script_component.hpp"
// Muzzle velocity vs. temperature interpolation data
{
private _temperature = -50 max parseNumber(ctrlText _x) min 160;
if (GVAR(currentUnit) == 1) then {
_temperature = (_temperature - 32) / 1.8;
};
((GVAR(workingMemory) select 18) select _forEachIndex) set [0, _temperature];
} forEach [160021, 160022, 160023, 160024, 160025, 160026, 160027];
{
private _muzzleVelocity = parseNumber(ctrlText _x);
if (GVAR(currentUnit) == 1) then {
_muzzleVelocity = _muzzleVelocity / 3.2808399;
};
((GVAR(workingMemory) select 18) select _forEachIndex) set [1, 0 max _muzzleVelocity min 1400];
} forEach [160031, 160032, 160033, 160034, 160035, 160036, 160037];
// C1 coefficient vs. distance interpolation data
{
private _distance = 0 max parseNumber(ctrlText _x) min 4000;
if (GVAR(currentUnit) != 2) then {
_distance = _distance * 0.9144;
};
((GVAR(workingMemory) select 19) select _forEachIndex) set [0, _distance];
} forEach [170021, 170022, 170023, 170024, 170025, 170026, 170027];
{
private _c1 = 0 max parseNumber(ctrlText _x) min 2.0;
((GVAR(workingMemory) select 19) select _forEachIndex) set [1, _c1];
} forEach [170031, 170032, 170033, 170034, 170035, 170036, 170037];
GVAR(altitude) = -1000 max parseNumber(ctrlText 130030) min 20000;
GVAR(temperature) = -50 max parseNumber(ctrlText 130040) min 160;
GVAR(barometricPressure) = 10 max parseNumber(ctrlText 130050) min 1350;
@ -49,11 +78,11 @@ if ((ctrlText 140051) == ">") then {
GVAR(targetRange) set [GVAR(currentTarget), 0 max abs(parseNumber(ctrlText 140060)) min 4000];
if (GVAR(currentUnit) != 2) then {
GVAR(windSpeed1) set [GVAR(currentTarget), (GVAR(windSpeed1) select GVAR(currentTarget)) * 0.44704];
GVAR(windSpeed2) set [GVAR(currentTarget), (GVAR(windSpeed2) select GVAR(currentTarget)) * 0.44704];
GVAR(targetSpeed) set [GVAR(currentTarget), (GVAR(targetSpeed) select GVAR(currentTarget)) * 0.44704];
GVAR(windSpeed2) set [GVAR(currentTarget), (GVAR(windSpeed2) select GVAR(currentTarget)) * 0.44704];
GVAR(targetSpeed) set [GVAR(currentTarget), (GVAR(targetSpeed) select GVAR(currentTarget)) * 0.44704];
};
if (GVAR(currentUnit) == 1) then {
GVAR(targetRange) set [GVAR(currentTarget), (GVAR(targetRange) select GVAR(currentTarget)) * 0.9144];
GVAR(targetRange) set [GVAR(currentTarget), (GVAR(targetRange) select GVAR(currentTarget)) * 0.9144];
};
private ["_boreHeight", "_bulletMass", "_bulletDiameter", "_airFriction", "_rifleTwist", "_muzzleVelocity", "_zeroRange"];
@ -67,7 +96,7 @@ if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) t
};
_rifleTwist = parseNumber(ctrlText 120040);
_muzzleVelocity = parseNumber(ctrlText 120050);
_zeroRange = parseNumber (ctrlText 120060);
_zeroRange = parseNumber(ctrlText 120060);
if (GVAR(currentUnit) != 2) then {
_boreHeight = _boreHeight * 2.54;
_bulletMass = _bulletMass * 0.06479891;
@ -88,10 +117,16 @@ GVAR(workingMemory) set [12, _bulletMass];
GVAR(workingMemory) set [13, _bulletDiameter];
GVAR(workingMemory) set [14, _rifleTwist];
if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then {
if (_airFriction != GVAR(workingMemory) select 15) then {
(_airFriction - (GVAR(workingMemory) select 15)) call FUNC(shift_c1_ballistic_coefficient_data);
};
GVAR(workingMemory) set [15, _airFriction];
} else {
GVAR(workingMemory) set [4, _airFriction];
};
if (_muzzleVelocity != GVAR(workingMemory) select 1) then {
(_muzzleVelocity - (GVAR(workingMemory) select 1)) call FUNC(shift_muzzle_velocity_data);
};
GVAR(workingMemory) set [1, _muzzleVelocity];
GVAR(workingMemory) set [2, _zeroRange];
@ -101,5 +136,7 @@ GVAR(workingMemory) set [2, _zeroRange];
[] call FUNC(update_atmo_env_data);
[] call FUNC(update_target);
[] call FUNC(update_target_data);
[] call FUNC(update_muzzle_velocity_data);
[] call FUNC(update_c1_ballistic_coefficient_data);
[] call FUNC(store_user_data);

View File

@ -0,0 +1,57 @@
/*
* Author: Ruthberg
* Recalculates the c1 ballistic coefficient based on the c1 ballistic coefficient vs. distance interpolation input
*
* Arguments:
* parse input <BOOL>
* update display <BOOL>
*
* Return Value:
* Nothing
*
* Example:
* call ace_atragmx_fnc_recalculate_c1_ballistic_coefficient
*
* Public: No
*/
#include "script_component.hpp"
params ["_parseInput", "_updateDisplay"];
if (_parseInput) then {
[] call FUNC(parse_input);
};
private _lookupTable = [];
{
if ((_x select 1) > 0) then {
_lookupTable pushBack _x;
};
} forEach (GVAR(workingMemory) select 19);
private _lookupTableSize = count _lookupTable;
if (_lookupTableSize < 2) exitWith {};
_lookupTable sort true;
private ["_lowerIndex", "_upperIndex"];
for "_index" from 1 to (_lookupTableSize - 1) do {
_upperIndex = _index;
_lowerIndex = _upperIndex - 1;
if (((_lookupTable select _index) select 0) >= (GVAR(targetRange) select GVAR(currentTarget))) exitWith {}
};
private ["_lowerDistance", "_upperDistance", "_lowerC1", "_upperC1", "_slope", "_c1"];
_lowerDistance = (_lookupTable select _lowerIndex) select 0;
_upperDistance = (_lookupTable select _upperIndex) select 0;
_lowerC1 = (_lookupTable select _lowerIndex) select 1;
_upperC1 = (_lookupTable select _upperIndex) select 1;
_slope = (_upperC1 - _lowerC1) / (_upperDistance - _lowerDistance);
_c1 = 0.1 max (_lowerC1 + ((GVAR(targetRange) select GVAR(currentTarget)) - _lowerDistance) * _slope) min 2.0;
if (_c1 != GVAR(workingMemory) select 15) then {
GVAR(workingMemory) set [15, _c1];
if (_updateDisplay) then {
call FUNC(update_gun);
call FUNC(update_gun_ammo_data);
};
};

View File

@ -0,0 +1,57 @@
/*
* Author: Ruthberg
* Recalculates the muzzle velocity based on the muzzle velocity vs. temperature interpolation input
*
* Arguments:
* parse input <BOOL>
* update display <BOOL>
*
* Return Value:
* Nothing
*
* Example:
* call ace_atragmx_fnc_recalculate_muzzle_velocity
*
* Public: No
*/
#include "script_component.hpp"
params ["_parseInput", "_updateDisplay"];
if (_parseInput) then {
[] call FUNC(parse_input);
};
private _lookupTable = [];
{
if ((_x select 1) > 0) then {
_lookupTable pushBack _x;
};
} forEach (GVAR(workingMemory) select 18);
private _lookupTableSize = count _lookupTable;
if (_lookupTableSize < 2) exitWith {};
_lookupTable sort true;
private ["_lowerIndex", "_upperIndex"];
for "_index" from 1 to (_lookupTableSize - 1) do {
_upperIndex = _index;
_lowerIndex = _upperIndex - 1;
if (((_lookupTable select _index) select 0) >= GVAR(temperature)) exitWith {}
};
private ["_lowerTemperature", "_upperTemperature", "_lowerMuzzleVelocity", "_upperMuzzleVelocity", "_slope", "_muzzleVelocity"];
_lowerTemperature = (_lookupTable select _lowerIndex) select 0;
_upperTemperature = (_lookupTable select _upperIndex) select 0;
_lowerMuzzleVelocity = (_lookupTable select _lowerIndex) select 1;
_upperMuzzleVelocity = (_lookupTable select _upperIndex) select 1;
_slope = (_upperMuzzleVelocity - _lowerMuzzleVelocity) / (_upperTemperature - _lowerTemperature);
_muzzleVelocity = _lowerMuzzleVelocity + (GVAR(temperature) - _lowerTemperature) * _slope;
if (_muzzleVelocity != GVAR(workingMemory) select 1) then {
GVAR(workingMemory) set [1, _muzzleVelocity];
if (_updateDisplay) then {
call FUNC(update_gun);
call FUNC(update_gun_ammo_data);
};
};

View File

@ -0,0 +1,33 @@
/*
* Author: Ruthberg
* Restores the truing drop defaults
*
* Arguments:
* update display <BOOL>
*
* Return Value:
* Nothing
*
* Example:
* call ace_atragmx_fnc_restore_truing_drop
*
* Public: No
*/
#include "script_component.hpp"
private _updateDisplay = _this;
GVAR(truingDropMode) = 0;
GVAR(truingDropRangeData) = [0, 0];
GVAR(truingDropDropData) = [0, 0, 0];
GVAR(truingDropReferenceDropData) = [0, 0, 0];
GVAR(truingDropC1) = 0;
GVAR(truingDropMuzzleVelocity) = 0;
// Resets input fields
call FUNC(update_truing_drop_selection);
if (_updateDisplay) then {
// Repopulates input fields
false call FUNC(calculate_truing_drop);
};

View File

@ -26,6 +26,7 @@ GVAR(barometricPressure) = 340 max (profileNamespace getVariable ["ACE_ATragMX_b
GVAR(relativeHumidity) = 0 max (profileNamespace getVariable ["ACE_ATragMX_relativeHumidity", 0.5]) min 1;
GVAR(showWind2) = profileNamespace getVariable ["ACE_ATragMX_showWind2", false];
GVAR(showCoriolis) = profileNamespace getVariable ["ACE_ATragMX_showCoriolis", true];
GVAR(latitude) = profileNamespace getVariable ["ACE_ATragMX_latitude", [38, 38, 38, 38]];
GVAR(directionOfFire) = profileNamespace getVariable ["ACE_ATragMX_directionOfFire", [0, 0, 0, 0]];
GVAR(windSpeed1) = profileNamespace getVariable ["ACE_ATragMX_windSpeed1", [0, 0, 0, 0]];

View File

@ -0,0 +1,25 @@
/*
* Author: Ruthberg
* Shifts all c1 ballistic coefficient entries in the c1 ballistic coefficient vs. distance interpolation table
*
* Arguments:
* ballistic coefficient - <NUMBER>
*
* Return Value:
* Nothing
*
* Example:
* 10 call ace_atragmx_fnc_shift_c1_ballistic_coefficient_data
*
* Public: No
*/
#include "script_component.hpp"
if (_this == 0) exitWith {};
{
private _c1 = _x select 1;
if (_c1 > 0) then {
((GVAR(workingMemory) select 19) select _forEachIndex) set [1, 0.1 max (_c1 + _this) min 2];
}
} forEach (GVAR(workingMemory) select 19);

View File

@ -0,0 +1,25 @@
/*
* Author: Ruthberg
* Shifts all muzzle velocity entries in the muzzle velocity vs. temperature interpolation table
*
* Arguments:
* velocity - <NUMBER>
*
* Return Value:
* Nothing
*
* Example:
* 10 call ace_atragmx_fnc_shift_muzzle_velocity_data
*
* Public: No
*/
#include "script_component.hpp"
if (_this == 0) exitWith {};
{
private _velocity = _x select 1;
if (_velocity > 0) then {
((GVAR(workingMemory) select 18) select _forEachIndex) set [1, 0 max (_velocity + _this) min 1400];
}
} forEach (GVAR(workingMemory) select 18);

View File

@ -0,0 +1,25 @@
/*
* Author: Ruthberg
* Shows/Hides the c1 ballistic coefficient data controls
*
* Arguments:
* visible - <BOOL>
*
* Return Value:
* Nothing
*
* Example:
* false call ace_atragmx_fnc_show_c1_ballistic_coefficient_data
*
* Public: No
*/
#include "script_component.hpp"
GVAR(showC1BallisticCoefficientData) = _this;
{ctrlShow [_x, _this]} forEach [17000, 17001, 170021, 170022, 170023, 170024, 170025, 170026, 170027, 170031, 170032, 170033, 170034, 170035, 170036, 170037, 17004, 17005, 17006, 17007, 17008, 17009];
if (_this) then {
ctrlSetFocus ((uiNamespace getVariable "ATragMX_Display") displayCtrl 170031);
[] call FUNC(update_c1_ballistic_coefficient_data);
};

View File

@ -21,6 +21,18 @@ GVAR(showMainPage) = _this;
500, 501, 502, 503, 600, 601, 602, 603, 1000, 1001, 1002, 1003, 1004, 2000, 2001, 3000, 4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008];
if (_this) then {
if (GVAR(showCoriolis)) then {
ctrlSetText [4003, "Hold"];
ctrlSetText [4004, "Cor"];
ctrlSetText [4005, "Spin"];
{ctrlShow [_x, false]} forEach [402, 4006, 4007];
} else {
ctrlSetText [4003, "Abs"];
ctrlSetText [4004, "Rel"];
ctrlSetText [4005, "Cur"];
private _visible = (GVAR(currentScopeUnit) == 3);
{ctrlShow [_x, _visible]} forEach [401, 402, 411, 412, 4004, 4005, 4006, 4007];
};
if (GVAR(atmosphereModeTBH)) then {
{ctrlShow [_x, false]} forEach [23, 230];
} else {

View File

@ -0,0 +1,25 @@
/*
* Author: Ruthberg
* Shows/Hides the muzzle velocity data controls
*
* Arguments:
* visible - <BOOL>
*
* Return Value:
* Nothing
*
* Example:
* false call ace_atragmx_fnc_show_muzzle_velocity_data
*
* Public: No
*/
#include "script_component.hpp"
GVAR(showMuzzleVelocityData) = _this;
{ctrlShow [_x, _this]} forEach [16000, 16001, 160021, 160022, 160023, 160024, 160025, 160026, 160027, 160031, 160032, 160033, 160034, 160035, 160036, 160037, 16004, 16005, 16006, 16007, 16008, 16009];
if (_this) then {
ctrlSetFocus ((uiNamespace getVariable "ATragMX_Display") displayCtrl 160031);
[] call FUNC(update_muzzle_velocity_data);
};

View File

@ -0,0 +1,43 @@
/*
* Author: Ruthberg
* Shows/Hides the truing drop controls
*
* Arguments:
* visible - <BOOL>
*
* Return Value:
* Nothing
*
* Example:
* call ace_atragmx_fnc_show_truing_drop
*
* Public: No
*/
#include "script_component.hpp"
GVAR(showTruingDrop) = _this;
{ctrlShow [_x, _this]} forEach [18000, 18001, 18002, 18003, 18004, 18005, 18006, 18007, 18008, 18009, 18010, 18011, 18012, 18013, 18014, 18015, 18016, 18017, 18018, 18019, 18020];
if (_this) then {
if (GVAR(currentUnit) == 2) then {
ctrlSetText [18000, format["ZR=%1meters", Round(GVAR(workingMemory) select 2)]];
} else {
ctrlSetText [18000, format["ZR=%1yards", Round((GVAR(workingMemory) select 2) * 1.0936133)]];
};
private _dropUnit = GVAR(currentScopeUnit);
if (_dropUnit == 3) then {
switch (GVAR(currentScopeClickUnit)) do {
case 0: { _dropUnit = 1; };
case 1: { _dropUnit = 2; };
case 2: { _dropUnit = 0; };
};
};
switch (_dropUnit) do {
case 0: { ctrlSetText [18001, "Drop=mils"]; };
case 1: { ctrlSetText [18001, "Drop=tmoa"]; };
case 2: { ctrlSetText [18001, "Drop=smoa"]; };
};
false call FUNC(calculate_truing_drop);
call FUNC(update_truing_drop_selection);
};

View File

@ -28,6 +28,7 @@ profileNamespace setVariable ["ACE_ATragMX_barometricPressure", GVAR(barometricP
profileNamespace setVariable ["ACE_ATragMX_relativeHumidity", GVAR(relativeHumidity)];
profileNamespace setVariable ["ACE_ATragMX_showWind2", GVAR(showWind2)];
profileNamespace setVariable ["ACE_ATragMX_showCoriolis", GVAR(showCoriolis)];
profileNamespace setVariable ["ACE_ATragMX_latitude", GVAR(latitude)];
profileNamespace setVariable ["ACE_ATragMX_directionOfFire", GVAR(directionOfFire)];
profileNamespace setVariable ["ACE_ATragMX_windSpeed1", GVAR(windSpeed1)];

View File

@ -20,7 +20,11 @@ if (ctrlVisible 13000) then {
true call FUNC(show_main_page);
if (_this == 1) then {
GVAR(truingDropDropData) set [0, 0];
[true, true] call FUNC(recalculate_muzzle_velocity);
call FUNC(calculate_target_solution);
} else {
call FUNC(update_atmo_env_data);
};
} else {
true call FUNC(show_atmo_env_data);

View File

@ -0,0 +1,33 @@
/*
* Author: Ruthberg
* Toggles the c1 ballistic coefficient data screen on/off
*
* Arguments:
* Apply new data? <NUMBER>
*
* Return Value:
* Nothing
*
* Example:
* 1 call ace_atragmx_fnc_toggle_c1_ballistic_coefficient_data
*
* Public: No
*/
#include "script_component.hpp"
if (!(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false])) exitWith {};
if (ctrlVisible 17000) then {
false call FUNC(show_c1_ballistic_coefficient_data);
true call FUNC(show_main_page);
if (_this == 1) then {
[true, true] call FUNC(recalculate_c1_ballistic_coefficient);
call FUNC(calculate_target_solution);
} else {
call FUNC(update_c1_ballistic_coefficient_data);
};
} else {
true call FUNC(show_c1_ballistic_coefficient_data);
false call FUNC(show_main_page);
};

View File

@ -0,0 +1,19 @@
/*
* Author: Ruthberg
* Toggles the coriolis and spin drift output on/off
*
* Arguments:
* Nothing
*
* Return Value:
* Nothing
*
* Example:
* call ace_atragmx_fnc_toggle_coriolis
*
* Public: No
*/
#include "script_component.hpp"
GVAR(showCoriolis) = !GVAR(showCoriolis);
true call FUNC(show_main_page);

View File

@ -20,8 +20,11 @@ if (ctrlVisible 12000) then {
true call FUNC(show_main_page);
if (_this == 1) then {
GVAR(truingDropDropData) set [0, 0];
call FUNC(update_zero_range);
call FUNC(calculate_target_solution);
} else {
call FUNC(update_gun_ammo_data);
};
} else {
true call FUNC(show_gun_ammo_data);

View File

@ -0,0 +1,33 @@
/*
* Author: Ruthberg
* Toggles the muzzle velocity data screen on/off
*
* Arguments:
* Apply new data? <NUMBER>
*
* Return Value:
* Nothing
*
* Example:
* 1 call ace_atragmx_fnc_toggle_muzzle_velocity_data
*
* Public: No
*/
#include "script_component.hpp"
if (!(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false])) exitWith {};
if (ctrlVisible 16000) then {
false call FUNC(show_muzzle_velocity_data);
true call FUNC(show_main_page);
if (_this == 1) then {
[true, true] call FUNC(recalculate_muzzle_velocity);
call FUNC(calculate_target_solution);
} else {
call FUNC(update_muzzle_velocity_data);
};
} else {
true call FUNC(show_muzzle_velocity_data);
false call FUNC(show_main_page);
};

View File

@ -0,0 +1,51 @@
/*
* Author: Ruthberg
* Toggles the option menu on/off
*
* Arguments:
* open menu item <BOOL>
*
* Return Value:
* Nothing
*
* Example:
* 1 call ace_atragmx_fnc_toggle_option_menu
*
* Public: No
*/
#include "script_component.hpp"
if (ctrlVisible 3001) then {
if (_this) then {
private _optionID = lbCurSel 3002;
if (_optionID > 0) then {
ctrlShow [3001, false];
ctrlShow [3002, false];
[_optionID] call FUNC(evaluate_option_menu_input);
};
} else {
ctrlShow [3001, false];
ctrlShow [3002, false];
};
} else {
lbClear 3002;
lbAdd [3002, "Accuracy 1st"];
lbAdd [3002, "Muz Vel Table"];
lbAdd [3002, "Drag Coef Table"];
lbAdd [3002, "Target Speed Est"];
lbAdd [3002, "Target Range Est"];
lbAdd [3002, "Truing Drop"];
if (GVAR(showCoriolis)) then {
lbAdd [3002, "Show Coriolis *"];
} else {
lbAdd [3002, "Show Coriolis"];
};
lbAdd [3002, "Set Clicks"];
lbAdd [3002, "Gun Note"];
lbSetCurSel [3002, 0];
ctrlShow [3001, true];
ctrlShow [3002, true];
};

View File

@ -21,6 +21,8 @@ if (ctrlVisible 14000) then {
if (_this == 1) then {
call FUNC(calculate_target_solution);
} else {
call FUNC(update_target_data);
};
} else {
true call FUNC(show_target_data);

View File

@ -0,0 +1,39 @@
/*
* Author: Ruthberg
* Toggles the truing drop screen on/off
*
* Arguments:
* Apply new data? <NUMBER>
*
* Return Value:
* Nothing
*
* Example:
* 1 call ace_atragmx_fnc_toggle_truing_drop
*
* Public: No
*/
#include "script_component.hpp"
if (!(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false])) exitWith {};
if (ctrlVisible 18000) then {
false call FUNC(show_truing_drop);
true call FUNC(show_main_page);
if (_this == 1) then {
if (GVAR(truingDropMode) == 0) then {
[GVAR(temperature), GVAR(truingDropMuzzleVelocity)] call FUNC(insert_muzzle_velocity_data);
[false, true] call FUNC(recalculate_muzzle_velocity);
} else {
[GVAR(truingDropRangeData) select 0, GVAR(truingDropRangeData) select 1, GVAR(truingDropC1)] call FUNC(insert_c1_ballistic_coefficient_data);
[false, true] call FUNC(recalculate_c1_ballistic_coefficient);
};
call FUNC(calculate_target_solution);
} else {
call FUNC(update_truing_drop_data);
};
} else {
false call FUNC(show_main_page);
true call FUNC(show_truing_drop);
};

View File

@ -0,0 +1,42 @@
/*
* Author: Ruthberg
* Trues the c1 ballistic coefficient
*
* Arguments:
* Nothing
*
* Return Value:
* Nothing
*
* Example:
* call ace_atragmx_fnc_true_c1_ballistic_coefficient
*
* Public: No
*/
#include "script_component.hpp"
private _referenceDrop = GVAR(truingDropDropData) select 0;
private _actualDrop = GVAR(truingDropDropData) select 2;
if (Round(_actualDrop * 10) / 10 == Round(_referenceDrop * 10) / 10) exitWith {};
private _step = 0.01;
if (_actualDrop > _referenceDrop) then {
_step = -0.01;
};
private _solutionInput = +GVAR(targetSolutionInput);
_solutionInput set [13, GVAR(truingDropRangeData) select 1];
private _c1 = _solutionInput select 14;
{
_step = _step * _x;
while { _actualDrop * _step < _referenceDrop * _step } do {
_c1 = _c1 + _step;
_solutionInput set [14, _c1];
private _result = _solutionInput call FUNC(calculate_solution);
_referenceDrop = (_result select 0);
};
} forEach [1, -0.1];
GVAR(truingDropC1) = _c1;

View File

@ -0,0 +1,42 @@
/*
* Author: Ruthberg
* Trues the muzzle velocity
*
* Arguments:
* Nothing
*
* Return Value:
* Nothing
*
* Example:
* call ace_atragmx_fnc_true_muzzle_velocity
*
* Public: No
*/
#include "script_component.hpp"
private _referenceDrop = GVAR(truingDropDropData) select 0;
private _actualDrop = GVAR(truingDropDropData) select 1;
if (Round(_actualDrop * 10) / 10 == Round(_referenceDrop * 10) / 10) exitWith {};
private _step = 10;
if (_actualDrop > _referenceDrop) then {
_step = -10;
};
private _solutionInput = +GVAR(targetSolutionInput);
_solutionInput set [13, GVAR(truingDropRangeData) select 0];
private _muzzleVelocity = _solutionInput select 4;
{
_step = _step * _x;
while { _actualDrop * _step < _referenceDrop * _step } do {
_muzzleVelocity = _muzzleVelocity + _step;
_solutionInput set [4, _muzzleVelocity];
private _result = _solutionInput call FUNC(calculate_solution);
_referenceDrop = (_result select 0);
};
} forEach [1, -0.1];
GVAR(truingDropMuzzleVelocity) = _muzzleVelocity;

View File

@ -0,0 +1,25 @@
/*
* Author: Ruthberg
* Updates the c1 ballistic coefficient data fields
*
* Arguments:
* Nothing
*
* Return Value:
* Nothing
*
* Example:
* call ace_atragmx_fnc_update_c1_ballistic_coefficient_data
*
* Public: No
*/
#include "script_component.hpp"
// Distances
if (GVAR(currentUnit) == 2) then {
{ctrlSetText [_x, Str(Round(((GVAR(workingMemory) select 19) select _forEachIndex) select 0))]} forEach [170021, 170022, 170023, 170024, 170025, 170026, 170027];
} else {
{ctrlSetText [_x, Str(Round((((GVAR(workingMemory) select 19) select _forEachIndex) select 0) * 1.0936133))]} forEach [170021, 170022, 170023, 170024, 170025, 170026, 170027];
};
// Ballistic coefficients
{ctrlSetText [_x, Str(Round((((GVAR(workingMemory) select 19) select _forEachIndex) select 1) * 1000) / 1000)]} forEach [170031, 170032, 170033, 170034, 170035, 170036, 170037];

View File

@ -0,0 +1,28 @@
/*
* Author: Ruthberg
* Updates the muzzle velocity data fields
*
* Arguments:
* Nothing
*
* Return Value:
* Nothing
*
* Example:
* call ace_atragmx_fnc_update_muzzle_velocity_data
*
* Public: No
*/
#include "script_component.hpp"
if (GVAR(currentUnit) == 2) then {
// Temperatures
{ctrlSetText [_x, Str(Round((((GVAR(workingMemory) select 18) select _forEachIndex) select 0) * 10) / 10)]} forEach [160021, 160022, 160023, 160024, 160025, 160026, 160027];
// Muzzle velocities
{ctrlSetText [_x, Str(Round(((GVAR(workingMemory) select 18) select _forEachIndex) select 1))]} forEach [160031, 160032, 160033, 160034, 160035, 160036, 160037];
} else {
// Temperatures
{ctrlSetText [_x, Str(Round(((((GVAR(workingMemory) select 18) select _forEachIndex) select 0) * 1.8 + 32) * 10) / 10)]} forEach [160021, 160022, 160023, 160024, 160025, 160026, 160027];
// Muzzle velocities
{ctrlSetText [_x, Str(Round((((GVAR(workingMemory) select 18) select _forEachIndex) select 1) * 3.2808399))]} forEach [160031, 160032, 160033, 160034, 160035, 160036, 160037];
};

View File

@ -15,17 +15,28 @@
*/
#include "script_component.hpp"
private ["_elevationAbs", "_elevationRel", "_elevationCur", "_windageAbs", "_wind2", "_windageRel", "_windageCur", "_lead", "_clickSize", "_clickNumber", "_clickInterval"];
private ["_elevationAbs", "_elevationRel", "_elevationCur", "_windageAbs", "_windageRel", "_windageCur", "_wind2", "_lead", "_clickSize", "_clickNumber", "_clickInterval"];
_elevationAbs = GVAR(elevationOutput) select GVAR(currentTarget);
_elevationRel = 0;
_elevationCur = 0;
_windageAbs = GVAR(windage1Output) select GVAR(currentTarget);
_windageRel = 0;
_windageCur = 0;
_wind2 = GVAR(windage2Output) select GVAR(currentTarget);
_elevationCur = GVAR(workingMemory) select 10;
_windageCur = GVAR(workingMemory) select 11;
if (GVAR(showCoriolis)) then {
_elevationRel = GVAR(verticalCoriolisOutput) select GVAR(currentTarget);
_windageRel = GVAR(horizontalCoriolisOutput) select GVAR(currentTarget);
_windageCur = GVAR(spinDriftOutput) select GVAR(currentTarget);
} else {
_elevationCur = GVAR(workingMemory) select 10;
_windageCur = GVAR(workingMemory) select 11;
_elevationRel = _elevationAbs - _elevationCur;
_windageRel = _windageAbs - _windageCur;
_elevationRel = _elevationAbs - _elevationCur;
_windageRel = _windageAbs - _windageCur;
};
_lead = GVAR(leadOutput) select GVAR(currentTarget);

View File

@ -0,0 +1,77 @@
/*
* Author: Ruthberg
* Updates the truing drop data fields
*
* Arguments:
* Nothing
*
* Return Value:
* Nothing
*
* Example:
* call ace_atragmx_fnc_update_truing_drop_data
*
* Public: No
*/
#include "script_component.hpp"
if (GVAR(currentUnit) == 2) then {
ctrlSetText [18011, Str(Round(GVAR(truingDropRangeData) select 0))];
ctrlSetText [18012, Str(Round(GVAR(truingDropRangeData) select 1))];
} else {
ctrlSetText [18011, Str(Round((GVAR(truingDropRangeData) select 0) * 1.0936133))];
ctrlSetText [18012, Str(Round((GVAR(truingDropRangeData) select 1) * 1.0936133))];
};
if (GVAR(truingDropMode) == 0) then {
GVAR(truingDropDropData) set [0, GVAR(truingDropReferenceDropData) select 0];
} else {
GVAR(truingDropDropData) set [0, GVAR(truingDropReferenceDropData) select 1];
};
private _dropUnit = GVAR(currentScopeUnit);
if (_dropUnit == 3) then {
switch (GVAR(currentScopeClickUnit)) do {
case 0: { _dropUnit = 1; };
case 1: { _dropUnit = 2; };
case 2: { _dropUnit = 0; };
};
};
private _dropData = +GVAR(truingDropDropData);
switch (_dropUnit) do {
case 0: {
_dropData set [0, (_dropData select 0) / 3.38];
_dropData set [1, (_dropData select 1) / 3.38];
_dropData set [2, (_dropData select 2) / 3.38];
};
case 2: {
_dropData set [0, (_dropData select 0) * 1.047];
_dropData set [1, (_dropData select 1) * 1.047];
_dropData set [2, (_dropData select 2) * 1.047];
};
};
ctrlSetText [18006, Str(Round((_dropData select 0) * 100) / 100)];
ctrlSetText [18013, Str(Round((_dropData select 1) * 100) / 100)];
ctrlSetText [18014, Str(Round((_dropData select 2) * 100) / 100)];
if (GVAR(currentUnit) != 2) then {
ctrlSetText [18007, Str(Round((GVAR(workingMemory) select 1) * 3.2808399))];
ctrlSetText [18016, Str(Round((GVAR(workingMemory) select 1) * 3.2808399))];
if (GVAR(truingDropMuzzleVelocity) > 0) then {
ctrlSetText [18016, Str(Round(GVAR(truingDropMuzzleVelocity) * 3.2808399))];
};
} else {
ctrlSetText [18007, Str(Round(GVAR(workingMemory) select 1))];
ctrlSetText [18016, Str(Round(GVAR(workingMemory) select 1))];
if (GVAR(truingDropMuzzleVelocity) > 0) then {
ctrlSetText [18016, Str(Round(GVAR(truingDropMuzzleVelocity)))];
};
};
ctrlSetText [18008, Str(Round((GVAR(workingMemory) select 15) * 1000) / 1000)];
ctrlSetText [18017, Str(Round((GVAR(workingMemory) select 15) * 1000) / 1000)];
if (GVAR(truingDropC1) > 0) then {
ctrlSetText [18017, Str(Round(GVAR(truingDropC1) * 1000) / 1000)];
};

View File

@ -0,0 +1,43 @@
/*
* Author: Ruthberg
* Updates the truing drop input method
*
* Arguments:
* Nothing
*
* Return Value:
* Nothing
*
* Example:
* call ace_atragmx_fnc_update_truing_drop_selection
*
* Public: No
*/
#include "script_component.hpp"
#define __dsp (uiNamespace getVariable "ATragMX_Display")
(__dsp displayCtrl 18009) ctrlEnable true;
(__dsp displayCtrl 18010) ctrlEnable true;
if (GVAR(truingDropMode) == 0) then {
(__dsp displayCtrl 18009) ctrlEnable false;
{
(__dsp displayCtrl _x) ctrlEnable true;
} forEach [18011, 18013, 18016];
{
(__dsp displayCtrl _x) ctrlEnable false;
} forEach [18012, 18014, 18017];
ctrlSetFocus (__dsp displayCtrl 18011);
} else {
(__dsp displayCtrl 18010) ctrlEnable false;
{
(__dsp displayCtrl _x) ctrlEnable true;
} forEach [18012, 18014, 18017];
{
(__dsp displayCtrl _x) ctrlEnable false;
} forEach [18011, 18013, 18016];
ctrlSetFocus (__dsp displayCtrl 18012);
};
[] call FUNC(update_truing_drop_data);

View File

@ -16,4 +16,4 @@
#include "\z\ace\addons\main\script_macros.hpp"
#define ATRAGMX_PROFILE_NAMESPACE_VERSION 1.8
#define ATRAGMX_PROFILE_NAMESPACE_VERSION 1.9