diff --git a/addons/breathing/functions/fnc_fullHealLocal.sqf b/addons/breathing/functions/fnc_fullHealLocal.sqf index 9791dd752..a9d16ce03 100644 --- a/addons/breathing/functions/fnc_fullHealLocal.sqf +++ b/addons/breathing/functions/fnc_fullHealLocal.sqf @@ -27,6 +27,7 @@ _patient setVariable [QGVAR(deepPenetratingInjury), false, true]; _patient setVariable [QGVAR(etco2Monitor), [], true]; _patient setVariable [QGVAR(breathRate), 15, true]; _patient setVariable [QGVAR(nasalCannula), false, true]; +_patient setVariable [QGVAR(pulseOxAttached), false, true]; if (ACEGVAR(advanced_fatigue,enabled)) then { ["kat_LSDF"] call ACEFUNC(advanced_fatigue,removeDutyFactor); diff --git a/addons/breathing/functions/fnc_treatmentAdvanced_pulseoximeterLocal.sqf b/addons/breathing/functions/fnc_treatmentAdvanced_pulseoximeterLocal.sqf index 203156c3a..07c586ba7 100644 --- a/addons/breathing/functions/fnc_treatmentAdvanced_pulseoximeterLocal.sqf +++ b/addons/breathing/functions/fnc_treatmentAdvanced_pulseoximeterLocal.sqf @@ -29,6 +29,7 @@ _patient setVariable [QGVAR(PulseOximeter_VolumePatient), _medic getVariable QGV private _attachedPulseOximeter = _patient getVariable [QGVAR(PulseOximeter_Attached), [0,0]]; _attachedPulseOximeter set [(ALL_BODY_PARTS find toLower _bodyPart)-2,1]; _patient setVariable [QGVAR(PulseOximeter_Attached), _attachedPulseOximeter, true]; +_patient setVariable [QGVAR(pulseOxAttached), true, true]; [{ params ["_args", "_idPFH"]; diff --git a/addons/breathing/functions/fnc_treatmentAdvanced_removePulseoximeter.sqf b/addons/breathing/functions/fnc_treatmentAdvanced_removePulseoximeter.sqf index c7dc09c8f..4a50f050d 100644 --- a/addons/breathing/functions/fnc_treatmentAdvanced_removePulseoximeter.sqf +++ b/addons/breathing/functions/fnc_treatmentAdvanced_removePulseoximeter.sqf @@ -24,5 +24,6 @@ _medic setVariable [QGVAR(PulseOximeter_Volume), _patient getVariable QGVAR(Puls private _attachedPulseOximeter = _patient getVariable [QGVAR(PulseOximeter_Attached), [0,0]]; _attachedPulseOximeter set [(ALL_BODY_PARTS find toLower _bodyPart)-2,0]; _patient setVariable [QGVAR(PulseOximeter_Attached), _attachedPulseOximeter, true]; +_patient setVariable [QGVAR(pulseOxAttached), false, true]; [_medic, "kat_Pulseoximeter", 1] call ACEFUNC(common,addToInventory); diff --git a/addons/circulation/RscTitles.hpp b/addons/circulation/RscTitles.hpp new file mode 100644 index 000000000..818c75dac --- /dev/null +++ b/addons/circulation/RscTitles.hpp @@ -0,0 +1,343 @@ +#include "defines.hpp" + +#define pixelW (1 / (getResolution select 2)) +#define pixelH (1 / (getResolution select 3)) +#define pixelScale 0.50 + +// pixel grids macros +#define UI_GRID_W (pixelW * pixelGridBase) +#define UI_GRID_H (pixelH * pixelGridBase) + +#define SAFEZONE_X_RIGHTEDGE ((safeZoneX - 1) * -1) +#define SAFEZONE_Y_LOWEDGE ((safeZoneY - 1) * -1) + +#define FRAME_W(N) ((UI_GRID_W * (N)) * (1.7777 / (getResolution select 4))) +#define FRAME_H(N) ((UI_GRID_H * (N))) + +class RscText; +class RscPicture; +class RscTitles +{ + class CPR_PulseOx + { + idd = 22835; + enableSimulation = 1; + movingEnable = 0; + fadeIn=0; + fadeOut=1; + duration = 10e10; + onLoad = "uiNamespace setVariable ['kat_pulseox', _this select 0];"; + class controls + { + class KatPulseOxIcon: RscPicture + { + idc = 22801; + text = "\x\kat\addons\circulation\UI\kat_pulseox.paa"; + x = QUOTE(0.5 - (FRAME_W(25) / 2)); + y = QUOTE(0.5 - (FRAME_H(45) / 2)); + w = QUOTE(FRAME_W(30)); + h = QUOTE(FRAME_H(30)); + }; + class KatPulseOxSpo2: RscText + { + idc = 22802; + x = QUOTE(0.5 - (FRAME_W(1) / 2)); + y = QUOTE(0.5 - (FRAME_H(25) / 2)); + w = QUOTE(FRAME_W(10)); + h = QUOTE(FRAME_H(10)); + type = 0; + style = 0; + font = "RobotoCondensed"; + sizeEx = QUOTE(KAT_GRID_H * 1.7 * (0.55 / (getResolution select 5))); + shadow = 0; + colorBackground[] = {0,0,0,0}; + colorText[] = {0.8,0.8,0,1}; + text = "O2"; + }; + class KatPulseOxHR: KatPulseOxSpo2 + { + idc = 22803; + x = QUOTE(0.5 + (FRAME_W(7) / 2)); + text = "HR"; + }; + }; + }; + + class CPR_AED_X + { + idd = IDC_AEDX_MONITOR_TITLE; + movingEnable = 0; + fadeIn=0; + fadeOut=1; + duration = 10e10; + onLoad = "uiNamespace setVariable ['KAT_Circulation_AEDX_Monitor_Display', _this select 0];"; + objects[] = {}; + + class ControlsBackground { + class BlackBackground_Title: RscText { + idc = -1; + x = QUOTE(KAT_pxToScreen_X(450)); + y = QUOTE(KAT_pxToScreen_Y(290)); + w = QUOTE(KAT_pxToScreen_W(1062)); + h = QUOTE(KAT_pxToScreen_H(824)); + type = 0; + style = 80; + colorBackground[] = {0,0,0,1}; + colorText[] = {0,0,0,1}; + text = ""; + }; + class Background: BlackBackground_Title {}; + class EKG_Title: RscPicture { + idc = IDC_EKG_DISPLAY_TITLE; + x = QUOTE(KAT_pxToScreen_X(475)); + y = QUOTE(KAT_pxToScreen_Y(234)); + w = QUOTE(KAT_pxToScreen_W(1024)); + h = QUOTE(KAT_pxToScreen_H(1024)); + type = 0; + style = 48; + size = 0; + colorBackground[] = {0,0,0,1}; + colorText[] = {1,1,1,1}; + text = QPATHTOF(ui\ekg_off.paa); + }; + class EKGSlider_Title: RscPicture { + idc = IDC_EKG_SLIDER_TITLE; + x = QUOTE(KAT_pxToScreen_X(250)); + y = QUOTE(KAT_pxToScreen_Y(426)); + w = QUOTE(KAT_pxToScreen_W(256)); + h = QUOTE(KAT_pxToScreen_H(256)); + type = 0; + style = 48; + colorBackground[] = {0,0,0,0}; + colorText[] = {1,1,1,1}; + text = QPATHTOF(ui\ekg_slider.paa); + }; + class HeartRateVitalsDisplayBackground_Title: RscText { + idc = IDC_DISPLAY_HEARTRATE_TEXT_TITLE; + x = QUOTE(KAT_pxToScreen_X(552)); + y = QUOTE(KAT_pxToScreen_Y(866)); + w = QUOTE(KAT_pxToScreen_W(190)); + h = QUOTE(KAT_pxToScreen_H(30)); + type = 0; + style = 0; + font = "RobotoCondensed"; + sizeEx = QUOTE(KAT_GRID_H * 0.6 * (0.55 / (getResolution select 5))); + shadow = 0; + colorBackground[] = {0.77,0.96,0.32,1}; + colorText[] = {0,0,0,1}; + text = "HR"; + }; + class HeartRateVitalsDisplayBackgroundText_Title: HeartRateVitalsDisplayBackground_Title { + idc = -1; + style = 1; + colorBackground[] = {0,0,0,0}; + font = "RobotoCondensedLight"; + text = "bpm"; + }; + class BloodPressureVitalsDisplayBackground_Title: HeartRateVitalsDisplayBackground_Title { + idc = -1; + x = QUOTE(KAT_pxToScreen_X(746)); + w = QUOTE(KAT_pxToScreen_W(260)); + colorBackground[] = {0.04,0.96,0.98,1}; + colorText[] = {0,0,0,1}; + text = "NIBP"; + }; + class BloodPressureVitalsDisplayBackgroundText_Title: BloodPressureVitalsDisplayBackground_Title { + idc = -1; + style = 1; + colorBackground[] = {0,0,0,0}; + font = "RobotoCondensedLight"; + text = "mmHg"; + }; + class BloodPressureVitalsDisplayLine_Title: RscText + { + idc = -1; + style = 2; + x = QUOTE(KAT_pxToScreen_X(760)); + y = QUOTE(KAT_pxToScreen_Y(979)); + w = QUOTE(KAT_pxToScreen_W(120)); + h = QUOTE(KAT_pxToScreen_H(3)); + colorBackground[] = {0.04,0.96,0.98,1}; + colorText[] = {1,1,1,1}; + text = ""; + }; + class RespirationRateDisplayBackground_Title: HeartRateVitalsDisplayBackground_Title { + idc = -1; + x = QUOTE(KAT_pxToScreen_X(1010)); + colorBackground[] = {0.73,0.02,0.74,1}; + colorText[] = {0,0,0,1}; + text = "Resp"; + }; + class RespirationRateDisplayBackgroundText_Title: RespirationRateDisplayBackground_Title { + idc = -1; + style = 1; + colorBackground[] = {0,0,0,0}; + font = "RobotoCondensedLight"; + text = "/min"; + }; + class SpO2DisplayBackground_Title: HeartRateVitalsDisplayBackground_Title { + idc = -1; + x = QUOTE(KAT_pxToScreen_X(1204)); + colorBackground[] = {0.99,0.97,0.02,1}; + colorText[] = {0,0,0,1}; + text = "SpO2"; + }; + class SpO2DisplayBackgroundText_Title: SpO2DisplayBackground_Title { + idc = -1; + style = 1; + colorBackground[] = {0,0,0,0}; + font = "RobotoCondensedLight"; + text = "%"; + }; + class SpO2PulseRateDisplayBorder_Title: RscText { + idc = IDC_DISPLAY_PULSERATEBORDER_TITLE; + x = QUOTE(KAT_pxToScreen_X(1366)); + y = QUOTE(KAT_pxToScreen_Y(907)); + w = QUOTE(KAT_pxToScreen_W(26)); + h = QUOTE(KAT_pxToScreen_H(80)); + type = 0; + style = 0; + font = "RobotoCondensed"; + sizeEx = QUOTE(KAT_GRID_H * 0.6 * (0.55 / (getResolution select 5))); + shadow = 0; + colorBackground[] = {0.99,0.97,0.02,1}; + colorText[] = {0,0,0,0}; + text = ""; + show = 0; + }; + class SpO2PulseRateDisplayBackground_Title: SpO2PulseRateDisplayBorder_Title { + idc = IDC_DISPLAY_PULSERATEBG_TITLE; + x = QUOTE(KAT_pxToScreen_X(1368)); + y = QUOTE(KAT_pxToScreen_Y(910)); + w = QUOTE(KAT_pxToScreen_W(20)); + h = QUOTE(KAT_pxToScreen_H(74)); + colorBackground[] = {0,0,0,1}; + }; + class SpO2PulseRateDisplayBar_Title: SpO2PulseRateDisplayBorder_Title { + idc = IDC_DISPLAY_PULSERATEDSPBAR_TITLE; + x = QUOTE(KAT_pxToScreen_X(1370)); + y = QUOTE(KAT_pxToScreen_Y(911)); + w = QUOTE(KAT_pxToScreen_W(17)); + h = QUOTE(KAT_pxToScreen_H(71)); + }; + class SpO2PulseRateDisplayBarB_Title: SpO2PulseRateDisplayBar_Title { + idc = IDC_DISPLAY_PULSERATEBAR_TITLE; + colorBackground[] = {0,0,0,1}; + }; + class HeartRateDisplay_Title: RscText { + idc = IDC_DISPLAY_HEARTRATE_TITLE; + x = QUOTE(KAT_pxToScreen_X(552)); + y = QUOTE(KAT_pxToScreen_Y(896)); + w = QUOTE(KAT_pxToScreen_W(190)); + h = QUOTE(KAT_pxToScreen_H(80)); + type = 0; + style = 2; + font = "RobotoCondensed"; + sizeEx = QUOTE(KAT_GRID_H * 2.5 * (0.55 / (getResolution select 5))); + shadow = 0; + colorBackground[] = {0,0,0,0}; + colorText[] = {0.77,0.96,0.32,1}; + text = "---"; + }; + class TopBloodPressureDisplay_Title: HeartRateDisplay_Title { + idc = IDC_DISPLAY_BLOODPRESSURE_T_TITLE; + style = 1; + x = QUOTE(KAT_pxToScreen_X(760)); + w = QUOTE(KAT_pxToScreen_W(120)); + h = QUOTE(KAT_pxToScreen_H(70)); + sizeEx = QUOTE(KAT_GRID_H * 1.8 * (0.55 / (getResolution select 5))); + colorText[] = {0.04,0.96,0.98,1}; + text = "---"; + }; + class BottomBloodPressureDisplay_Title: TopBloodPressureDisplay_Title { + idc = IDC_DISPLAY_BLOODPRESSURE_B_TITLE; + y = QUOTE(KAT_pxToScreen_Y(990)); + colorText[] = {0.04,0.96,0.98,1}; + text = "---"; + }; + class MeanBloodPressureDisplay_Title: TopBloodPressureDisplay_Title { + idc = IDC_DISPLAY_BLOODPRESSURE_M_TITLE; + x = QUOTE(KAT_pxToScreen_X(910)); + w = QUOTE(KAT_pxToScreen_W(100)); + h = QUOTE(KAT_pxToScreen_H(60)); + sizeEx = QUOTE(KAT_GRID_H * 1.1 * (0.55 / (getResolution select 5))); + colorText[] = {0.04,0.96,0.98,1}; + text = ""; + }; + class RespirationRateDisplay_Title: HeartRateDisplay_Title { + idc = IDC_DISPLAY_RESP_TITLE; + x = QUOTE(KAT_pxToScreen_X(1010)); + h = QUOTE(KAT_pxToScreen_H(120)); + sizeEx = QUOTE(KAT_GRID_H * 0.7 * (0.55 / (getResolution select 5))); + colorText[] = {0.73,0.02,0.74,1}; + text = "Resp off"; + }; + class SpO2Display_Title: HeartRateDisplay_Title { + idc = IDC_DISPLAY_SPO2_TITLE; + x = QUOTE(KAT_pxToScreen_X(1200)); + w = QUOTE(KAT_pxToScreen_W(170)); + colorText[] = {0.99,0.97,0.02,1}; + text = "---"; + }; + class DateAndTime_Title: RscText { + idc = IDC_DISPLAY_DATEANDTIME_TITLE; + x = QUOTE(KAT_pxToScreen_X(505)); + y = QUOTE(KAT_pxToScreen_Y(318)); + w = QUOTE(KAT_pxToScreen_W(400)); + h = QUOTE(KAT_pxToScreen_H(40)); + type = 0; + style = 0; + font = "RobotoCondensed"; + sizeEx = QUOTE(KAT_GRID_H * 0.8 * (0.55 / (getResolution select 5))); + shadow = 0; + colorBackground[] = {0,0,0,0}; + colorText[] = {1,1,1,1}; + text = "00/00/0000 00:00"; + }; + class Battery_Title: RscPicture { + idc = -1; + x = QUOTE(KAT_pxToScreen_X(1256)); + y = QUOTE(KAT_pxToScreen_Y(322)); + w = QUOTE(KAT_pxToScreen_W(64)); + h = QUOTE(KAT_pxToScreen_H(64)); + style = 48; + colorBackground[] = {0,0,0,0}; + colorText[] = {1,1,1,1}; + text = QPATHTOF(ui\battery.paa); + }; + class ElapsedTime_Title: DateAndTime_Title { + idc = IDC_DISPLAY_ELAPSEDTIME_TITLE; + x = QUOTE(KAT_pxToScreen_X(1335)); + w = QUOTE(KAT_pxToScreen_W(130)); + style = 2; + text = "00:00:00"; + }; + class AEDBackground_Title: RscPicture { + idc = -1; + x = QUOTE(KAT_GUI_GRID_X); + y = QUOTE(KAT_pxToScreen_Y(-300)); + w = QUOTE(KAT_GUI_GRID_W); + h = QUOTE(KAT_GUI_GRID_H); + type = 0; + style = 48; + font = "TahomaB"; + size = 0; + colorBackground[] = {0,0,0,0}; + colorText[] = {1,1,1,1}; + text = QPATHTOF(ui\zoll.paa); + }; + class ShockButton_Title: RscPicture { + idc = IDC_SHOCKBUTTON; + x = QUOTE(KAT_pxToScreen_X(1487)); + y = QUOTE(KAT_pxToScreen_Y(1080)); + w = QUOTE(KAT_pxToScreen_W(256)); + h = QUOTE(KAT_pxToScreen_H(256)); + style = 48; + colorBackground[] = {0,0,0,0}; + colorText[] = {1,1,1,1}; + text = QPATHTOF(ui\shockbutton.paa); + show = 0; + }; + }; + }; +}; diff --git a/addons/circulation/XEH_PREP.hpp b/addons/circulation/XEH_PREP.hpp index a207e6fc7..46ae44a37 100644 --- a/addons/circulation/XEH_PREP.hpp +++ b/addons/circulation/XEH_PREP.hpp @@ -9,6 +9,7 @@ PREP(AEDX_DisconnectVitalsMonitor); PREP(AEDX_ViewMonitor_AnalyzeFeedback); PREP(AEDX_ViewMonitor_Charging); PREP(AEDX_ViewMonitor_Condition); +PREP(AEDX_ViewMonitor_CPR); PREP(AEDX_ViewMonitor); PREP(AEDX_VitalsMonitor_CheckCondition); PREP(AEDX_VitalsMonitor); @@ -45,6 +46,7 @@ PREP(placeAED); PREP(removeLog); PREP(showBloodGas); PREP(treatmentAdvanced_IV); +PREP(PulseOx_ViewMonitor); PREP(updateBloodPressureChange); PREP(updateHeartRate); PREP(updateInternalBleeding); diff --git a/addons/circulation/config.cpp b/addons/circulation/config.cpp index 9a681577f..20b716de7 100644 --- a/addons/circulation/config.cpp +++ b/addons/circulation/config.cpp @@ -62,6 +62,7 @@ class CfgPatches { }; }; +#include "RscTitles.hpp" #include "CfgFunctions.hpp" #include "CfgMoves.hpp" #include "CfgEventHandlers.hpp" diff --git a/addons/circulation/defines.hpp b/addons/circulation/defines.hpp index af16c3936..f06aede78 100644 --- a/addons/circulation/defines.hpp +++ b/addons/circulation/defines.hpp @@ -60,4 +60,26 @@ #define IDC_CHARGE_BAR_100 70057 #define IDC_CHARGE_BAR_120 70058 #define IDC_CHARGE_BAR_150 70059 -#define IDC_CHARGE_BAR_200 70060 \ No newline at end of file +#define IDC_CHARGE_BAR_200 70060 + +#define IDC_AEDX_MONITOR_TITLE 71000 +#define IDC_EKG_SLIDER_TITLE 71001 +#define IDC_DISPLAY_HEARTRATE_TITLE 71002 +#define IDC_DISPLAY_HEARTRATE_TEXT_TITLE 71003 +#define IDC_DISPLAY_BLOODPRESSURE_T_TITLE 71004 +#define IDC_DISPLAY_BLOODPRESSURE_B_TITLE 71005 +#define IDC_DISPLAY_BLOODPRESSURE_M_TITLE 71006 +#define IDC_DISPLAY_RESP_TITLE 71007 +#define IDC_DISPLAY_SPO2_TITLE 71008 +#define IDC_DISPLAY_PULSERATEBORDER_TITLE 71009 +#define IDC_DISPLAY_PULSERATEBG_TITLE 71010 +#define IDC_DISPLAY_PULSERATEDSPBAR_TITLE 71011 +#define IDC_DISPLAY_PULSERATEBAR_TITLE 71012 +#define IDC_DISPLAY_DATEANDTIME_TITLE 71013 +#define IDC_DISPLAY_ELAPSEDTIME_TITLE 71014 +#define IDC_EKG_DISPLAY_TITLE 71015 +#define IDC_EKG_DISPLAY_MIDTEXT_TITLE 71016 +#define IDC_SHOCKBUTTON_TITLE 71017 +#define IDC_AEDMODE_MSG_BG_TITLE 71018 +#define IDC_AEDMODE_MSG_TOP_TITLE 71019 +#define IDC_AEDMODE_MSG_TITLE 71020 \ No newline at end of file diff --git a/addons/circulation/functions/fnc_AEDX_ViewMonitor_CPR.sqf b/addons/circulation/functions/fnc_AEDX_ViewMonitor_CPR.sqf new file mode 100644 index 000000000..ece1083e6 --- /dev/null +++ b/addons/circulation/functions/fnc_AEDX_ViewMonitor_CPR.sqf @@ -0,0 +1,269 @@ +#include "..\script_component.hpp" +#include "..\defines.hpp" +/* + * Author: Blue + * Open AED-X Vitals Monitor dialog + * + * Arguments: + * 0: Medic + * 1: Target + * + * Return Value: + * None + * + * Example: + * [player, cursorTarget, 1] call kat_circulation_fnc_AEDX_ViewMonitor; + * + * Public: No + */ + +params ["_medic", "_target"]; + +GVAR(AEDX_MonitorTarget_Title) = _target; +GVAR(PulseRateReady) = true; + +private _dlg = uiNamespace getVariable ["KAT_Circulation_AEDX_Monitor_Display", displayNull]; + +[{ + params ["_args", "_idPFH"]; + _args params ["_dlg"]; + + if !(GVAR(CPRDisplayActive)) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + + private _slider = _dlg displayCtrl IDC_EKG_SLIDER_TITLE; + + _slider ctrlSetPosition [KAT_pxToScreen_X(250), (ctrlPosition _slider) select 1, (ctrlPosition _slider) select 2, (ctrlPosition _slider) select 3]; + _slider ctrlCommit 0; + + _slider ctrlSetPosition [KAT_pxToScreen_X(1460), (ctrlPosition _slider) select 1, (ctrlPosition _slider) select 2, (ctrlPosition _slider) select 3]; + _slider ctrlCommit 4; +}, 4, [_dlg]] call CBA_fnc_addPerFrameHandler; + +[{ + params ["_args", "_idPFH"]; + _args params ["_dlg", "_target"]; + + if !(GVAR(CPRDisplayActive)) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + + private _pads = false; + + if !(GVAR(AEDX_MonitorTarget_Title) isEqualTo objNull) then { + _pads = GVAR(AEDX_MonitorTarget_Title) getVariable [QGVAR(DefibrillatorPads_Connected), false]; + }; + + if !(_pads) then { + (_dlg displayCtrl IDC_EKG_DISPLAY_MIDTEXT_TITLE) ctrlSetText (LLSTRING(AEDX_Monitor_CheckPads)); + (_dlg displayCtrl IDC_EKG_DISPLAY_TITLE) ctrlSetText (QPATHTOF(ui\ekg_off.paa)); + } else { + (_dlg displayCtrl IDC_EKG_DISPLAY_MIDTEXT_TITLE) ctrlSetText ""; + private _ekgDisplay = QPATHTOF(ui\ekg_off.paa); + + if !(GVAR(AEDX_MonitorTarget_Title) getVariable [QACEGVAR(medical,CPR_provider), objNull] isEqualTo objNull) then { + _ekgDisplay = QPATHTOF(ui\ekg_cpr.paa); + } else { + if (!(GVAR(AEDX_MonitorTarget_Title) getVariable [QGVAR(heartRestart), false]) && alive GVAR(AEDX_MonitorTarget_Title)) then { + switch (GVAR(AEDX_MonitorTarget_Title) getVariable [QGVAR(cardiacArrestType), 0]) do { + case 4: {_ekgDisplay = QPATHTOF(ui\ekg_vt.paa);}; + case 3: {_ekgDisplay = QPATHTOF(ui\ekg_vf.paa);}; + case 2: {_ekgDisplay = QPATHTOF(ui\ekg_sinus.paa);}; + case 1: {_ekgDisplay = QPATHTOF(ui\ekg_asystole.paa);}; + default { + if ((GVAR(AEDX_MonitorTarget_Title) getVariable [QACEGVAR(medical,inCardiacArrest), false] && !(GVAR(AdvRhythm))) || !(alive GVAR(AEDX_MonitorTarget_Title))) then { + _ekgDisplay = QPATHTOF(ui\ekg_asystole.paa); + } else { + private _hr = 0; + if (GVAR(AEDX_MonitorTarget_Title) getVariable [QGVAR(cardiacArrestType), 0] isEqualTo 2) then { + _hr = GVAR(AEDX_MonitorTarget_Title) call FUNC(getCardiacArrestHeartRate); + } else { + _hr = GVAR(AEDX_MonitorTarget_Title) getVariable [QACEGVAR(medical,heartRate), 0]; + }; + + switch (true) do { + case (_hr > 130): {_ekgDisplay = QPATHTOF(ui\ekg_sinus_130.paa);}; + case (_hr > 110 && _hr < 130): {_ekgDisplay = QPATHTOF(ui\ekg_sinus_120.paa);}; + case (_hr > 90 && _hr < 110): {_ekgDisplay = QPATHTOF(ui\ekg_sinus_100.paa);}; + case (_hr > 70 && _hr < 90): {_ekgDisplay = QPATHTOF(ui\ekg_sinus.paa);}; + case (_hr > 50 && _hr < 70): {_ekgDisplay = QPATHTOF(ui\ekg_sinus_60.paa);}; + case (_hr > 0): {_ekgDisplay = QPATHTOF(ui\ekg_sinus_40.paa);}; + default { + _ekgDisplay = QPATHTOF(ui\ekg_asystole.paa); + }; + }; + }; + }; + }; + } else { + _ekgDisplay = QPATHTOF(ui\ekg_asystole.paa); + }; + }; + + (_dlg displayCtrl IDC_EKG_DISPLAY_TITLE) ctrlSetText (_ekgDisplay); + }; + + // Handle date and time display - [year,month,day,hour,min] + + (_dlg displayCtrl IDC_DISPLAY_DATEANDTIME_TITLE) ctrlSetText (format ["%1/%2/%3 %4:%5", (["", "0"] select (date select 2 < 10)) + str (date select 2), (["", "0"] select (date select 1 < 10)) + str (date select 1), date select 0, (["", "0"] select (date select 3 < 10)) + str (date select 3), (["", "0"] select (date select 4 < 10)) + str (date select 4)]); + (_dlg displayCtrl IDC_DISPLAY_ELAPSEDTIME_TITLE) ctrlSetText (format ["%1:%2:%3", (["", "0"] select (floor time / 3600 < 10)) + str (floor(time/3600)), (["", "0"] select (floor time / 3600 - floor time / 3600 * 60 < 10)) + str (floor(((time/3600) - floor(time/3600)) * 60)), (["", "0"] select (floor time / 60 - floor time / 60 * 60 < 10)) + str (floor(((time/60) - floor(time/60)) * 60))]); + + if (GVAR(AEDX_MonitorTarget_Title) getVariable [QGVAR(AED_X_VitalsMonitor_Connected), false]) then { + private _partIndex = ((GVAR(AEDX_MonitorTarget_Title) getVariable [QGVAR(AED_X_VitalsMonitor_Provider), [-1, -1, -1]]) select 2); + + (_dlg displayCtrl IDC_DISPLAY_PULSERATEBORDER_TITLE) ctrlShow true; + (_dlg displayCtrl IDC_DISPLAY_PULSERATEBG_TITLE) ctrlShow true; + (_dlg displayCtrl IDC_DISPLAY_PULSERATEDSPBAR_TITLE) ctrlShow true; + (_dlg displayCtrl IDC_DISPLAY_PULSERATEBAR_TITLE) ctrlShow true; + + private _PRBar = _dlg displayCtrl IDC_DISPLAY_PULSERATEBAR_TITLE; + + if (!(HAS_TOURNIQUET_APPLIED_ON(GVAR(AEDX_MonitorTarget_Title),_partIndex))) then { + if (GVAR(PulseRateReady)) then { + GVAR(PulseRateReady) = false; + private _pr = GVAR(AEDX_MonitorTarget_Title) getVariable [QACEGVAR(medical,heartRate), 0]; + + if (_pr > 0) then { + private _delay = 60/_pr; + + private _randomHigh = round(random [2, 2, 3]); + _PRBar ctrlSetPosition [(ctrlPosition _PRBar) select 0, (ctrlPosition _PRBar) select 1, (ctrlPosition _PRBar) select 2, KAT_pxToScreen_H(_randomHigh)]; + _PRBar ctrlCommit (0.2 max (_delay/4)); + + [{ + params ["_PRBar", "_delay"]; + + private _randomMid = round(random [24, 25, 29]); + + _PRBar ctrlSetPosition [(ctrlPosition _PRBar) select 0, (ctrlPosition _PRBar) select 1, (ctrlPosition _PRBar) select 2, KAT_pxToScreen_H(_randomMid)]; + _PRBar ctrlCommit 0.1; + + [{ + params ["_PRBar", "_delay"]; + + private _randomLow = round(random [67, 68, 70]); + _PRBar ctrlSetPosition [(ctrlPosition _PRBar) select 0, (ctrlPosition _PRBar) select 1, (ctrlPosition _PRBar) select 2, KAT_pxToScreen_H(_randomLow)]; + _PRBar ctrlCommit (0.2 max (_delay/2)); + }, [_PRBar, _delay], 0.1] call CBA_fnc_waitAndExecute; + }, [_PRBar, _delay], (0.2 max (_delay/3))] call CBA_fnc_waitAndExecute; + + [{ + GVAR(PulseRateReady) = true; + }, [], _delay] call CBA_fnc_waitAndExecute; + } else { + _PRBar ctrlSetPosition [(ctrlPosition _PRBar) select 0, (ctrlPosition _PRBar) select 1, (ctrlPosition _PRBar) select 2, KAT_pxToScreen_H(71)]; + _PRBar ctrlCommit 0.1; + + [{ + GVAR(PulseRateReady) = true; + }, [], 0.1] call CBA_fnc_waitAndExecute; + }; + }; + } else { + _PRBar ctrlSetPosition [(ctrlPosition _PRBar) select 0, (ctrlPosition _PRBar) select 1, (ctrlPosition _PRBar) select 2, KAT_pxToScreen_H(71)]; + _PRBar ctrlCommit 0; + }; + } else { + (_dlg displayCtrl IDC_DISPLAY_PULSERATEBORDER_TITLE) ctrlShow false; + (_dlg displayCtrl IDC_DISPLAY_PULSERATEBG_TITLE) ctrlShow false; + (_dlg displayCtrl IDC_DISPLAY_PULSERATEDSPBAR_TITLE) ctrlShow false; + (_dlg displayCtrl IDC_DISPLAY_PULSERATEBAR_TITLE) ctrlShow false; + }; +}, 0, [_dlg, _target]] call CBA_fnc_addPerFrameHandler; + +[{ + params ["_args", "_idPFH"]; + _args params ["_dlg"]; + + private _pads = false; + private _vitalsMonitor = false; + + if !(GVAR(AEDX_MonitorTarget_Title) isEqualTo objNull) then { + _pads = GVAR(AEDX_MonitorTarget_Title) getVariable [QGVAR(DefibrillatorPads_Connected), false]; + _vitalsMonitor = GVAR(AEDX_MonitorTarget_Title) getVariable [QGVAR(AED_X_VitalsMonitor_Connected), false]; + }; + + private _hr = 0; + private _pr = 0; + private _bp = [0,0]; + private _spO2 = 0; + + if !(GVAR(CPRDisplayActive)) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + + if (!_pads && !_vitalsMonitor) exitWith { + (_dlg displayCtrl IDC_DISPLAY_HEARTRATE_TITLE) ctrlSetText "---"; + (_dlg displayCtrl IDC_DISPLAY_BLOODPRESSURE_T_TITLE) ctrlSetText "---"; + (_dlg displayCtrl IDC_DISPLAY_BLOODPRESSURE_B_TITLE) ctrlSetText "---"; + (_dlg displayCtrl IDC_DISPLAY_BLOODPRESSURE_M_TITLE) ctrlSetText ""; + (_dlg displayCtrl IDC_DISPLAY_SPO2_TITLE) ctrlSetText "---"; + }; + + if !(GVAR(AEDX_MonitorTarget_Title) getVariable [QACEGVAR(medical,CPR_provider), objNull] isEqualTo objNull) then { + + private _rhythmHR = 0; + + if(GVAR(AEDX_MonitorTarget_Title) getVariable [QGVAR(cardiacArrestType), 0] > 0) then { + _rhythmHR = GVAR(AEDX_MonitorTarget_Title) call FUNC(getCardiacArrestHeartRate); + } else { + _rhythmHR = GVAR(AEDX_MonitorTarget_Title) getVariable [QACEGVAR(medical,heartRate), 0]; + }; + + _hr = random [100, 100 + _rhythmHR / 2, _rhythmHR]; + + if (GVAR(AED_X_VitalsMonitor_BloodPressureInterval) > 0) then { + _bp = GVAR(AEDX_MonitorTarget_Title) getVariable [QGVAR(StoredBloodPressure), [0,0]]; + } else { + _bp = GVAR(AEDX_MonitorTarget_Title) getVariable [QACEGVAR(medical,bloodPressure), [0,0]]; + }; + } else { + if !(GVAR(AEDX_MonitorTarget_Title) getVariable [QGVAR(heartRestart), false]) then { + if (GVAR(AEDX_MonitorTarget_Title) getVariable [QGVAR(cardiacArrestType), 0] > 0) then { + _hr = GVAR(AEDX_MonitorTarget_Title) call FUNC(getCardiacArrestHeartRate); + + if (GVAR(AED_X_VitalsMonitor_BloodPressureInterval) > 0) then { + _bp = GVAR(AEDX_MonitorTarget_Title) getVariable [QGVAR(StoredBloodPressure), [0,0]]; + }; + } else { + _hr = GVAR(AEDX_MonitorTarget_Title) getVariable [QACEGVAR(medical,heartRate), 0]; + + if (GVAR(AED_X_VitalsMonitor_BloodPressureInterval) > 0) then { + _bp = GVAR(AEDX_MonitorTarget_Title) getVariable [QGVAR(StoredBloodPressure), [0,0]]; + } else { + _bp = GVAR(AEDX_MonitorTarget_Title) getVariable [QACEGVAR(medical,bloodPressure), [0,0]]; + }; + }; + }; + }; + + private _partIndex = ((GVAR(AEDX_MonitorTarget_Title) getVariable [QGVAR(AED_X_VitalsMonitor_Provider), [-1, -1, -1]]) select 2); + + if (HAS_TOURNIQUET_APPLIED_ON(GVAR(AEDX_MonitorTarget_Title),_partIndex)) then { + _bp = [0,0]; + } else { + _spO2 = GET_SPO2(GVAR(AEDX_MonitorTarget_Title)); + _pr = GVAR(AEDX_MonitorTarget_Title) getVariable [QACEGVAR(medical,heartRate), 0]; + }; + + if (_pads) then { + (_dlg displayCtrl IDC_DISPLAY_HEARTRATE_TITLE) ctrlSetText (format["%1", round(_hr)]); + (_dlg displayCtrl IDC_DISPLAY_HEARTRATE_TEXT_TITLE) ctrlSetText (LLSTRING(AEDX_Monitor_HR)); + } else { + (_dlg displayCtrl IDC_DISPLAY_HEARTRATE_TITLE) ctrlSetText (format["%1", round(_pr)]); + (_dlg displayCtrl IDC_DISPLAY_HEARTRATE_TEXT_TITLE) ctrlSetText (LLSTRING(AEDX_Monitor_PR)); + }; + + if (_vitalsMonitor) then { + (_dlg displayCtrl IDC_DISPLAY_BLOODPRESSURE_T_TITLE) ctrlSetText (format["%1", round(_bp select 1)]); + (_dlg displayCtrl IDC_DISPLAY_BLOODPRESSURE_B_TITLE) ctrlSetText (format["%1", round(_bp select 0)]); + (_dlg displayCtrl IDC_DISPLAY_BLOODPRESSURE_M_TITLE) ctrlSetText (format["(%1)", round(((_bp select 1) - (_bp select 0))/3 + (_bp select 0))]); + (_dlg displayCtrl IDC_DISPLAY_SPO2_TITLE) ctrlSetText (format["%1", round(_spO2)]); + } else { + (_dlg displayCtrl IDC_DISPLAY_BLOODPRESSURE_T_TITLE) ctrlSetText "---"; + (_dlg displayCtrl IDC_DISPLAY_BLOODPRESSURE_B_TITLE) ctrlSetText "---"; + (_dlg displayCtrl IDC_DISPLAY_BLOODPRESSURE_M_TITLE) ctrlSetText ""; + (_dlg displayCtrl IDC_DISPLAY_SPO2_TITLE) ctrlSetText "---"; + }; +}, 1, [_dlg]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/circulation/functions/fnc_CPRStart.sqf b/addons/circulation/functions/fnc_CPRStart.sqf index 4d983776f..64812f858 100644 --- a/addons/circulation/functions/fnc_CPRStart.sqf +++ b/addons/circulation/functions/fnc_CPRStart.sqf @@ -22,6 +22,9 @@ _patient setVariable [QACEGVAR(medical,CPR_provider), _medic, true]; _medic setVariable [QGVAR(isPerformingCPR), true, true]; GVAR(CPRTarget) = _patient; +GVAR(CPRProvider) = _medic; +GVAR(CPRDisplayActive) = false; +GVAR(PulseOxDisplay) = false; GVAR(CPRCancel_EscapeID) = [0x01, [false, false, false], { GVAR(CPRTarget) setVariable [QACEGVAR(medical,CPR_provider), objNull, true]; @@ -31,6 +34,17 @@ GVAR(CPRCancel_MouseID) = [0xF0, [false, false, false], { GVAR(CPRTarget) setVariable [QACEGVAR(medical,CPR_provider), objNull, true]; }, "keydown", "", false, 0] call CBA_fnc_addKeyHandler; +GVAR(CPRDevice_Iterate) = [0xF1, [false, false, false], { + private _deviceCode = GVAR(CPRTarget) getVariable [QGVAR(deviceCode), 0]; + _deviceCode = [(_deviceCode + 1), 1] select (_deviceCode == 3); + private _deviceArray = [true,(GVAR(CPRTarget) getVariable [QEGVAR(breathing,pulseOxAttached), false]),((GVAR(CPRTarget) getVariable [QGVAR(AED_X_VitalsMonitor_Connected), false]) || (GVAR(CPRTarget) getVariable [QGVAR(DefibrillatorPads_Connected), false])),(GVAR(CPRTarget) getVariable [QGVAR(watchAvailable), false])]; + while { !(_deviceArray select _deviceCode) } do { + _deviceCode = [0, (_deviceCode + 1)] select (_deviceCode < 3); + }; + GVAR(CPRTarget) setVariable [QGVAR(deviceCode), _deviceCode, true]; + true +}, "keydown", "", false, 0] call CBA_fnc_addKeyHandler; + private _CPRStartTime = CBA_missionTime + 2.5; ACEGVAR(medical_gui,pendingReopen) = false; // Prevent medical menu from reopening @@ -47,10 +61,60 @@ if (_notInVehicle) then { loopCPR = true; }; +[{ + params ["_args", "_idPFH"]; + _args params ["_medic", "_patient"]; + + private _deviceCode = _patient getVariable [QGVAR(deviceCode), 0]; + + if ((_patient getVariable [QACEGVAR(medical,CPR_provider), objNull]) isEqualTo objNull) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + GVAR(CPRDisplayActive) = false; + GVAR(PulseOxDisplay) = false; + + "CPR_MONITOR" cutText ["", "PLAIN",0,true]; + _patient setVariable [QGVAR(deviceCode), 0, true]; + }; + + switch (true) do { + case (_deviceCode == 3): { + GVAR(CPRDisplayActive) = false; + "CPR_MONITOR" cutText ["", "PLAIN",0,true]; + }; + case (_deviceCode == 2): { + if ((_patient getVariable [QGVAR(AED_X_VitalsMonitor_Connected), false]) || (_patient getVariable [QGVAR(DefibrillatorPads_Connected), false])) then { + if !(GVAR(CPRDisplayActive)) then { + "CPR_MONITOR" cutText ["", "PLAIN",0,true]; + "CPR_MONITOR" cutRsc ["CPR_AED_X", "PLAIN", 0, true]; + GVAR(CPRDisplayActive) = true; + [_medic, GVAR(CPRTarget)] call FUNC(AEDX_ViewMonitor_CPR); + }; + } else { + "CPR_MONITOR" cutText ["", "PLAIN",0,true]; + GVAR(CPRDisplayActive) = false; + }; + }; + case (_deviceCode == 1): { + if ((_patient getVariable [QEGVAR(breathing,pulseOxAttached), false])) then { + if !(GVAR(PulseOxDisplay)) then { + "CPR_MONITOR" cutText ["", "PLAIN",0,true]; + "CPR_MONITOR" cutRsc ["CPR_PulseOx", "PLAIN", 0, true]; + GVAR(PulseOxDisplay) = true; + [_medic, GVAR(CPRTarget)] call FUNC(PulseOx_ViewMonitor); + }; + } else { + "CPR_MONITOR" cutText ["", "PLAIN",0,true]; + GVAR(PulseOxDisplay) = false; + }; + }; + case (_deviceCode == 0): { "CPR_MONITOR" cutText ["", "PLAIN"]; GVAR(PulseOxDisplay) = false; GVAR(CPRDisplayActive) = false;}; + }; +}, 2, [_medic, _patient]] call CBA_fnc_addPerFrameHandler; + [{ params ["_medic", "_patient", "_notInVehicle", "_CPRStartTime"]; - [LLSTRING(StopCPR), "", ""] call ACEFUNC(interaction,showMouseHint); + [LLSTRING(StopCPR), "Change Monitoring Device", ""] call ACEFUNC(interaction,showMouseHint); [LLSTRING(StartCPR), 1.5, _medic] call ACEFUNC(common,displayTextStructured); [{ @@ -74,6 +138,7 @@ if (_notInVehicle) then { [] call ACEFUNC(interaction,hideMouseHint); [GVAR(CPRCancel_EscapeID), "keydown"] call CBA_fnc_removeKeyHandler; [GVAR(CPRCancel_MouseID), "keydown"] call CBA_fnc_removeKeyHandler; + [GVAR(CPRDevice_Iterate), "keydown"] call CBA_fnc_removeKeyHandler; if (_notInVehicle) then { [_medic, "AinvPknlMstpSnonWnonDnon_medicEnd", 2] call ACEFUNC(common,doAnimation); diff --git a/addons/circulation/functions/fnc_PulseOx_ViewMonitor.sqf b/addons/circulation/functions/fnc_PulseOx_ViewMonitor.sqf new file mode 100644 index 000000000..13d47f448 --- /dev/null +++ b/addons/circulation/functions/fnc_PulseOx_ViewMonitor.sqf @@ -0,0 +1,34 @@ +#include "..\script_component.hpp" +#include "..\defines.hpp" +/* + * Author: Mazinski + * Open PulseOx View Monitor + * + * Arguments: + * 0: Medic + * 1: Target + * + * Return Value: + * None + * + * Example: + * [player, cursorTarget, 1] call kat_circulation_fnc_PulseOx_ViewMonitor.sqf; + * + * Public: No + */ + +params ["_medic", "_target"]; + +private _dlg = uiNamespace getVariable ["kat_pulseox", displayNull]; + +[{ + params ["_args", "_idPFH"]; + _args params ["_dlg", "_target"]; + + if !(GVAR(PulseOxDisplay)) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + + (_dlg displayCtrl 22802) ctrlSetText (format["%1", (GET_SPO2(_target)) toFixed 1]); + (_dlg displayCtrl 22803) ctrlSetText (format["%1", round(GET_HEART_RATE(_target))]); +}, 1, [_dlg, _target]] call CBA_fnc_addPerFrameHandler; \ No newline at end of file diff --git a/addons/circulation/functions/fnc_fullHealLocal.sqf b/addons/circulation/functions/fnc_fullHealLocal.sqf index 6eaf3a2e4..d262bd608 100644 --- a/addons/circulation/functions/fnc_fullHealLocal.sqf +++ b/addons/circulation/functions/fnc_fullHealLocal.sqf @@ -22,6 +22,9 @@ _patient setVariable [QGVAR(cprCount), 2, true]; _patient setVariable [QGVAR(heartRestart), false, true]; _patient setVariable [QGVAR(cardiacArrestType), 0, true]; +_patient setVariable [QGVAR(deviceCode), 0, true]; +_patient setVariable [QGVAR(watchAvailable), false, true]; + _patient setVariable [VAR_BLOODPRESSURE_CHANGE, nil, true]; _patient setVariable [QGVAR(bodyFluid), DEFAULT_BODY_FLUID]; diff --git a/addons/circulation/ui/AEDX_Monitor_Dialog.hpp b/addons/circulation/ui/AEDX_Monitor_Dialog.hpp index 30818e2d6..bd3edf77a 100644 --- a/addons/circulation/ui/AEDX_Monitor_Dialog.hpp +++ b/addons/circulation/ui/AEDX_Monitor_Dialog.hpp @@ -1,8 +1,4 @@ -#include "..\defines.hpp" - -class RscPicture; class RscLine; -class RscText; class RscBackground; class RscButton; class RscStructuredText; @@ -597,4 +593,4 @@ class GVAR(AEDX_Monitor_Dialog) { tooltip = CSTRING(AEDX_Monitor_MeasureBloodPressure); }; }; -}; +}; \ No newline at end of file diff --git a/addons/circulation/ui/kat_pulseox.paa b/addons/circulation/ui/kat_pulseox.paa new file mode 100644 index 000000000..dc540d3e3 Binary files /dev/null and b/addons/circulation/ui/kat_pulseox.paa differ