Skip to content

Commit

Permalink
Main - Update SpO2 macros to be compatible with ACE SpO2 (#639)
Browse files Browse the repository at this point in the history
**When merged this pull request will:**
- Changes SpO2 macros to be compatible with ACE SpO2

### IMPORTANT

- [Development Guidelines](https://ace3.acemod.org/wiki/development/)
are read, understood and applied.
- Title of this PR uses our standard template `Component -
Add|Fix|Improve|Change|Make|Remove {changes}`.
  • Loading branch information
mazinskihenry authored Nov 7, 2024
1 parent 0ac764c commit d63a131
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if (GVAR(showCyanosis) && _selectionN in [0,2,3]) then {
private _spO2 = 0;

if (alive _target) then {
_spO2 = GET_SPO2(_target);
_spO2 = GET_KAT_SPO2(_target);
};

if (_spO2 <= GVAR(slightValue) || HAS_TOURNIQUET_APPLIED_ON(_target,_selectionN)) then {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ _patient setVariable [QGVAR(PulseOximeter_Attached), _attachedPulseOximeter, tru
};

private _HR = GET_HEART_RATE(_patient);
private _SpO2 = GET_SPO2(_patient);
private _SpO2 = GET_KAT_SPO2(_patient);

if (([_patient,_bodyPart] call ACEFUNC(medical_treatment,hasTourniquetAppliedTo))) then {
_HR = 0;
Expand All @@ -58,7 +58,7 @@ _patient setVariable [QGVAR(PulseOximeter_Attached), _attachedPulseOximeter, tru
[_idPFH] call CBA_fnc_removePerFrameHandler;
};

private _SpO2 = GET_SPO2(_patient);
private _SpO2 = GET_KAT_SPO2(_patient);

if (([_patient,_bodyPart] call ACEFUNC(medical_treatment,hasTourniquetAppliedTo))) then {
_SpO2 = 0;
Expand Down
2 changes: 1 addition & 1 deletion addons/circulation/functions/fnc_AEDX_ViewMonitor.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ GVAR(PulseRateReady) = true;
if (HAS_TOURNIQUET_APPLIED_ON(GVAR(AEDX_MonitorTarget),_partIndex)) then {
_bp = [0,0];
} else {
_spO2 = GET_SPO2(GVAR(AEDX_MonitorTarget));
_spO2 = GET_KAT_SPO2(GVAR(AEDX_MonitorTarget));
_pr = GVAR(AEDX_MonitorTarget) getVariable [QACEGVAR(medical,heartRate), 0];
};

Expand Down
4 changes: 2 additions & 2 deletions addons/circulation/functions/fnc_AEDX_VitalsMonitor.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ if (_patient getVariable ["kat_AEDXPatient_PFH", -1] isEqualTo -1) then {
_bp = [0,0];
_pr = 0;
} else {
_spO2 = GET_SPO2(_patient);
_spO2 = GET_KAT_SPO2(_patient);

_etco2 = GET_ETCO2(_patient);
_breathrate = GET_BREATHING_RATE(_patient);
Expand Down Expand Up @@ -291,7 +291,7 @@ if (_patient getVariable [QGVAR(AED_X_VitalsMonitor_Connected), false] && {(_pat
if (_patient getVariable [QGVAR(DefibrillatorInUse), false] || !(_patient getVariable [QGVAR(AED_X_VitalsMonitor_VolumePatient), false])) then {
} else {
private _hr = _patient getVariable [QACEGVAR(medical,heartRate), 80];
private _spO2 = GET_SPO2(_patient);
private _spO2 = GET_KAT_SPO2(_patient);
if (_spO2 < GVAR(AED_X_Monitor_SpO2Warning) || _tourniquetApplied) then {
playSound3D [QPATHTOF_SOUND(sounds\spo2warning.wav), _soundSource, false, getPosASL _soundSource, 5, 1, 15];
};
Expand Down
2 changes: 1 addition & 1 deletion addons/feedback/functions/fnc_handleEffects.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ BEGIN_COUNTER(handleEffects);

// - Current state info -------------------------------------------------------
private _opioid = GET_PP(ACE_player);
private _spO2 = GET_SPO2(ACE_player);
private _spO2 = GET_KAT_SPO2(ACE_player);
private _unconscious = IS_UNCONSCIOUS(ACE_player);

// - Visual effects -----------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion addons/main/script_macros.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@

#define GET_BLOOD_GAS(unit) (unit getVariable [VAR_BLOOD_GAS, DEFAULT_BLOOD_GAS])
#define GET_PAO2(unit) ((unit getVariable [VAR_BLOOD_GAS, DEFAULT_BLOOD_GAS]) select 1)
#define GET_SPO2(unit) (((unit getVariable [VAR_BLOOD_GAS, DEFAULT_BLOOD_GAS]) select 2) * 100)
#define GET_KAT_SPO2(unit) (((unit getVariable [VAR_BLOOD_GAS, DEFAULT_BLOOD_GAS]) select 2) * 100)
#define GET_PH(unit) ((unit getVariable [VAR_BLOOD_GAS, DEFAULT_BLOOD_GAS]) select 4)
#define GET_ETCO2(unit) ((unit getVariable [VAR_BLOOD_GAS, DEFAULT_BLOOD_GAS]) select 5)
#define GET_BREATHING_RATE(unit) (unit getVariable [VAR_BREATHING_RATE, 15])
Expand Down
2 changes: 1 addition & 1 deletion addons/vitals/functions/fnc_hasStableVitals.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ if (_bloodPressureL < 50 || {_bloodPressureH < 60}) exitWith { false };
private _heartRate = GET_HEART_RATE(_unit);
if (_heartRate < 40) exitWith { false };

private _o2 = GET_SPO2(_unit);
private _o2 = GET_KAT_SPO2(_unit);
if (_o2 < EGVAR(breathing,Stable_spo2)) exitWith { false };

true
2 changes: 1 addition & 1 deletion addons/watch/functions/fnc_showKWatch.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ private _altitude = _display displayCtrl 22007;
};

_hr ctrlSetText ([GET_HEART_RATE(_unit), 1, 0] call CBA_fnc_formatNumber);
_o2 ctrlSetText ([GET_SPO2(_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; };
Expand Down
2 changes: 1 addition & 1 deletion addons/watch/functions/fnc_showSWatch.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ 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_SPO2(_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;
Expand Down

0 comments on commit d63a131

Please sign in to comment.