diff --git a/addons/vitals/functions/fnc_handleCardiacFunction.sqf b/addons/vitals/functions/fnc_handleCardiacFunction.sqf index 868eade04..cfad3f0f8 100644 --- a/addons/vitals/functions/fnc_handleCardiacFunction.sqf +++ b/addons/vitals/functions/fnc_handleCardiacFunction.sqf @@ -42,7 +42,7 @@ if IN_CRDC_ARRST(_unit) then { private _painLevel = GET_PAIN_PERCEIVED(_unit); // Adjustments and Pain Levels are taken off of last cycle HR to prevent any spiraling vitials - private _lastCycleHeartRate = GET_HEART_RATE(_unit) - _hrTargetAdjustment - (10 * _painLevel); + private _lastCycleHeartRate = GET_HEART_RATE(_unit) - _hrTargetAdjustment - (10 * _painLevel) - (ACEGVAR(advanced_fatigue,anFatigue) * 50); private _lastCycleCO2 = _lastCycleHeartRate * HEART_RATE_CO2_MULTIPLIER; private _demandReturn = _lastCycleCO2 / CO2_TO_DEMAND_DIVISOR; private _strokeVolume = (_bloodVolume / BLOOD_VOLUME_TO_STROKE_DIVISOR); @@ -63,9 +63,9 @@ if IN_CRDC_ARRST(_unit) then { }; // All additional adjustments are added back - _actualHeartRate = _actualHeartRate + _hrTargetAdjustment + (10 * _painLevel); + _actualHeartRate = _actualHeartRate + _hrTargetAdjustment + (10 * _painLevel) + (ACEGVAR(advanced_fatigue,anFatigue) * 50); }; _unit setVariable [VAR_HEART_RATE, _actualHeartRate, _syncValue]; -_actualHeartRate \ No newline at end of file +_actualHeartRate diff --git a/addons/vitals/functions/fnc_handleOxygenFunction.sqf b/addons/vitals/functions/fnc_handleOxygenFunction.sqf index 439c2f0d1..2924b2534 100644 --- a/addons/vitals/functions/fnc_handleOxygenFunction.sqf +++ b/addons/vitals/functions/fnc_handleOxygenFunction.sqf @@ -95,9 +95,10 @@ if (EGVAR(pharma,kidneyAction)) then { // Adjust dissociation constant based on temperature private _phConstant = ((-0.00006653 * (_temperature ^ 2)) - (0.03268 * _temperature) + 7.4); + private _fatigue = [0, (ACEGVAR(advanced_fatigue,anFatigue) / 2)] select (ACEGVAR(advanced_fatigue,enabled)); // pH is from the Henderson-Hasselbalch equation - _pH = (_phConstant + log(24 / ((0.03 * _paco2)))) - ((_externalPh max 1) / 2000); + _pH = (_phConstant + log(24 / ((0.03 * _paco2)))) - ((_externalPh max 1) / 2000) - (_fatigue / 3); }; // Fractional Oxygen when breathing normal air is 0.21, 1 when breathing 100% Oxygen, and 0 when no air is being brought into the lungs @@ -125,8 +126,8 @@ private _arrestPerfusion = [1, (1 * EGVAR(breathing,SpO2_PerfusionMultiplier))] // PaO2 moves in controlled steps to prevent hard movements when Ventilation Demand spikes _pao2 = if (_previousCyclePao2 != _pao2) then { ([ (_previousCyclePao2 - ((PAO2_MAX_CHANGE * EGVAR(breathing,SpO2_MultiplyNegative) * _arrestPerfusion) * _deltaT)) , (_previousCyclePao2 + ((PAO2_MAX_CHANGE * EGVAR(breathing,SpO2_MultiplyPositive)) * _deltaT))] select ((_previousCyclePao2 - _pao2) < 0)) } else { _pao2 }; -// Oxy-Hemo Dissociation Curve, driven by PaO2 with shaping done by pH -private _o2Sat = ((_pao2 max 1)^2.7 / ((25 - (((_pH / DEFAULT_PH) - 1) * 150))^2.7 + _pao2^2.7)) min 0.999; +// Oxy-Hemo Dissociation Curve, driven by PaO2 with shaping done by pH. +private _o2Sat = (((_pao2 max 1)^2.7 / ((25 - (((_pH / DEFAULT_PH) - 1) * 150))^2.7 + _pao2^2.7))) min 0.999; _unit setVariable [VAR_BREATHING_RATE, (_respiratoryRate max 0), _syncValues]; _unit setVariable [VAR_BLOOD_GAS, [_paco2, _pao2, _o2Sat, 24, _pH, _etco2], _syncValues]; diff --git a/addons/watch/XEH_preInit.sqf b/addons/watch/XEH_preInit.sqf index 4923255d1..929d3c893 100644 --- a/addons/watch/XEH_preInit.sqf +++ b/addons/watch/XEH_preInit.sqf @@ -35,4 +35,13 @@ ADDON = true; [CBA_SETTINGS_CAT, ELSTRING(GUI,SubCategory_Basic)], [[0, 1], [LLSTRING(SETTING_AltitudeForm_meters), LLSTRING(SETTING_AltitudeForm_feet)], 0], true +] call CBA_Settings_fnc_init; + +[ + QGVAR(watchInaccuracy), + "CHECKBOX", + [LLSTRING(SETTING_WatchInaccuracy), LLSTRING(SETTING__WatchInaccuracy_Desc)], + [CBA_SETTINGS_CAT, ELSTRING(GUI,SubCategory_Basic)], + [false], + true ] call CBA_Settings_fnc_init; \ No newline at end of file diff --git a/addons/watch/functions/fnc_init.sqf b/addons/watch/functions/fnc_init.sqf index 85716b198..1b9fa8505 100644 --- a/addons/watch/functions/fnc_init.sqf +++ b/addons/watch/functions/fnc_init.sqf @@ -23,4 +23,4 @@ _unit setVariable [QGVAR(rangerStart), false, true]; _unit setVariable [QGVAR(rangerTimer), 0, true]; _unit setVariable [QGVAR(rangerHands), true, true]; -_unit setVariable [QGVAR(katminSeconds), false, true]; +_unit setVariable [QGVAR(katminSeconds), false, true]; \ No newline at end of file diff --git a/addons/watch/functions/fnc_showCWatch.sqf b/addons/watch/functions/fnc_showCWatch.sqf index 9139a0b40..6dc10fb74 100644 --- a/addons/watch/functions/fnc_showCWatch.sqf +++ b/addons/watch/functions/fnc_showCWatch.sqf @@ -84,7 +84,14 @@ private _bearing = _display displayCtrl 20807; _altitude ctrlSetText ([_altitudeValue, 1, 0] call CBA_fnc_formatNumber); }; - _hr ctrlSetText ([GET_HEART_RATE(_unit), 1, 0] call CBA_fnc_formatNumber); + if (GVAR(watchInaccuracy)) then { + private _fatigue = [0, (ACEGVAR(advanced_fatigue,anFatigue) * 2)] select (ACEGVAR(advanced_fatigue,enabled)); + private _temperature = _unit getVariable [QEGVAR(hypothermia,unitTemperature), 37]; + + _hr ctrlSetText ([(GET_HEART_RATE(_unit) + ((2 * _fatigue) - (37 - _temperature))), 1, 0] call CBA_fnc_formatNumber); + } else { + _hr ctrlSetText ([GET_HEART_RATE(_unit), 1, 0] call CBA_fnc_formatNumber); + }; }, 1, [ _unit, diff --git a/addons/watch/functions/fnc_showKWatch.sqf b/addons/watch/functions/fnc_showKWatch.sqf index 06859b318..6bd16b723 100644 --- a/addons/watch/functions/fnc_showKWatch.sqf +++ b/addons/watch/functions/fnc_showKWatch.sqf @@ -119,8 +119,16 @@ private _timeSeconds = _display displayCtrl 22008; _temp ctrlSetText (format ["%1C", ([(_altitudeValue call ACEFUNC(weather,calculateTemperatureAtHeight)), 1, 0] call CBA_fnc_formatNumber)]); }; - _hr ctrlSetText ([GET_HEART_RATE(_unit), 1, 0] call CBA_fnc_formatNumber); - _o2 ctrlSetText ([GET_KAT_SPO2(_unit), 1, 0] call CBA_fnc_formatNumber); + if (GVAR(watchInaccuracy)) then { + private _fatigue = [0, (ACEGVAR(advanced_fatigue,anFatigue) * 2)] select (ACEGVAR(advanced_fatigue,enabled)); + private _temperature = _unit getVariable [QEGVAR(hypothermia,unitTemperature), 37]; + + _hr ctrlSetText ([(GET_HEART_RATE(_unit) + ((2 * _fatigue) - (37 - _temperature))), 1, 0] call CBA_fnc_formatNumber); + _o2 ctrlSetText ([(GET_KAT_SPO2(_unit) - (_fatigue - (37 - _temperature))), 1, 0] call CBA_fnc_formatNumber); + } else { + _hr ctrlSetText ([GET_HEART_RATE(_unit), 1, 0] call CBA_fnc_formatNumber); + _o2 ctrlSetText ([GET_KAT_SPO2(_unit), 1, 0] call CBA_fnc_formatNumber); + }; switch (true) do { case(rain != 0): { _rain ctrlShow true; _overcast ctrlShow false; _sun ctrlShow false; }; diff --git a/addons/watch/functions/fnc_showRWatch.sqf b/addons/watch/functions/fnc_showRWatch.sqf index e2e16aac5..afa380058 100644 --- a/addons/watch/functions/fnc_showRWatch.sqf +++ b/addons/watch/functions/fnc_showRWatch.sqf @@ -63,8 +63,16 @@ private _o2 = _display displayCtrl 22810; _altitude ctrlSetText ([_altitudeValue, 1, 0] call CBA_fnc_formatNumber); }; - _hr ctrlSetText ([GET_HEART_RATE(_unit), 1, 0] call CBA_fnc_formatNumber); - _o2 ctrlSetText ([GET_KAT_SPO2(_unit), 1, 0] call CBA_fnc_formatNumber); + if (GVAR(watchInaccuracy)) then { + private _fatigue = [0, (ACEGVAR(advanced_fatigue,anFatigue) * 2)] select (ACEGVAR(advanced_fatigue,enabled)); + private _temperature = _unit getVariable [QEGVAR(hypothermia,unitTemperature), 37]; + + _hr ctrlSetText ([(GET_HEART_RATE(_unit) + ((2 * _fatigue) - (37 - _temperature))), 1, 0] call CBA_fnc_formatNumber); + _o2 ctrlSetText ([(GET_KAT_SPO2(_unit) - (_fatigue - (37 - _temperature))), 1, 0] call CBA_fnc_formatNumber); + } else { + _hr ctrlSetText ([GET_HEART_RATE(_unit), 1, 0] call CBA_fnc_formatNumber); + _o2 ctrlSetText ([GET_KAT_SPO2(_unit), 1, 0] call CBA_fnc_formatNumber); + }; private _hours = floor dayTime; private _minutes = floor ((dayTime - _hours) * 60); diff --git a/addons/watch/functions/fnc_showSWatch.sqf b/addons/watch/functions/fnc_showSWatch.sqf index 356eff061..72797fc46 100644 --- a/addons/watch/functions/fnc_showSWatch.sqf +++ b/addons/watch/functions/fnc_showSWatch.sqf @@ -91,8 +91,16 @@ private _altitudeUnit = GVAR(altitudeUnit); _time ctrlSetText (format ["%1:%2", [_hour, 2] call CBA_fnc_formatNumber, [_minute, 2] call CBA_fnc_formatNumber]); - _hr ctrlSetText ([GET_HEART_RATE(_unit), 1, 0] call CBA_fnc_formatNumber); - _o2 ctrlSetText ([GET_KAT_SPO2(_unit), 1, 0] call CBA_fnc_formatNumber); + if (GVAR(watchInaccuracy)) then { + private _fatigue = [0, (ACEGVAR(advanced_fatigue,anFatigue) * 2)] select (ACEGVAR(advanced_fatigue,enabled)); + private _temperature = _unit getVariable [QEGVAR(hypothermia,unitTemperature), 37]; + + _hr ctrlSetText ([(GET_HEART_RATE(_unit) + ((2 * _fatigue) - (37 - _temperature))), 1, 0] call CBA_fnc_formatNumber); + _o2 ctrlSetText ([(GET_KAT_SPO2(_unit) - (_fatigue - (37 - _temperature))), 1, 0] call CBA_fnc_formatNumber); + } else { + _hr ctrlSetText ([GET_HEART_RATE(_unit), 1, 0] call CBA_fnc_formatNumber); + _o2 ctrlSetText ([GET_KAT_SPO2(_unit), 1, 0] call CBA_fnc_formatNumber); + }; private _curTime = CBA_missionTime; private _timeDiff = _curTime - _prevTime; diff --git a/addons/watch/stringtable.xml b/addons/watch/stringtable.xml index 84c3229f4..aa5f91bf1 100644 --- a/addons/watch/stringtable.xml +++ b/addons/watch/stringtable.xml @@ -133,6 +133,12 @@ 英尺 英尺 + + Watch Vitals Inaccuracy + + + Enables watch inaccuracy when reading patient vitals + Watch with Vital Monitoring Capabilities Horloge met ingebouwde vitale waarden monitor