From 7398fc8ef42b5cc33331522021435e6d58050c5d Mon Sep 17 00:00:00 2001 From: mazinskihenry <33608576+mazinskihenry@users.noreply.github.com> Date: Tue, 14 Jan 2025 09:32:43 -0800 Subject: [PATCH] Circulation - Add ETCO2 and Respiratory Rate monitoring to AED-X Visual Monitor (#693) **When merged this pull request will:** - Title ### 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}`. --- addons/circulation/RscTitles.hpp | 33 +++++++++++++++++-- addons/circulation/defines.hpp | 12 +++++-- .../functions/fnc_AEDX_ViewMonitor.sqf | 20 +++++++++++ .../functions/fnc_AEDX_ViewMonitor_CPR.sqf | 20 +++++++++++ addons/circulation/ui/AEDX_Monitor_Dialog.hpp | 33 +++++++++++++++++-- 5 files changed, 109 insertions(+), 9 deletions(-) diff --git a/addons/circulation/RscTitles.hpp b/addons/circulation/RscTitles.hpp index 818c75dac..a5015b5bf 100644 --- a/addons/circulation/RscTitles.hpp +++ b/addons/circulation/RscTitles.hpp @@ -166,14 +166,14 @@ class RscTitles x = QUOTE(KAT_pxToScreen_X(1010)); colorBackground[] = {0.73,0.02,0.74,1}; colorText[] = {0,0,0,1}; - text = "Resp"; + text = "CO2"; }; class RespirationRateDisplayBackgroundText_Title: RespirationRateDisplayBackground_Title { idc = -1; style = 1; colorBackground[] = {0,0,0,0}; font = "RobotoCondensedLight"; - text = "/min"; + text = "mmHg"; }; class SpO2DisplayBackground_Title: HeartRateVitalsDisplayBackground_Title { idc = -1; @@ -265,13 +265,40 @@ class RscTitles text = ""; }; class RespirationRateDisplay_Title: HeartRateDisplay_Title { - idc = IDC_DISPLAY_RESP_TITLE; + idc = IDC_DISPLAY_RR_DEFAULT_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 RespirationRateDisplay_ETCO2_Title: RespirationRateDisplay_Title { + idc = IDC_DISPLAY_ETCO2_TITLE; + x = QUOTE(KAT_pxToScreen_X(1050)); + y = QUOTE(KAT_pxToScreen_Y(875)); + h = QUOTE(KAT_pxToScreen_H(120)); + sizeEx = QUOTE(KAT_GRID_H * 2.2 * (0.55 / (getResolution select 5))); + show = 0; + text = "40"; + }; + class RespirationRateDisplay_ACTUAL_Title: RespirationRateDisplay_Title { + idc = IDC_DISPLAY_RR_TITLE; + x = QUOTE(KAT_pxToScreen_X(1060)); + y = QUOTE(KAT_pxToScreen_Y(960)); + h = QUOTE(KAT_pxToScreen_H(120)); + sizeEx = QUOTE(KAT_GRID_H * 1.7 * (0.55 / (getResolution select 5))); + show = 0; + text = "15"; + }; + class RespirationRateDisplay_BR_Title: RespirationRateDisplay_Title { + idc = IDC_DISPLAY_BR_TITLE; + x = QUOTE(KAT_pxToScreen_X(990)); + y = QUOTE(KAT_pxToScreen_Y(969)); + h = QUOTE(KAT_pxToScreen_H(120)); + sizeEx = QUOTE(KAT_GRID_H * 1 * (0.55 / (getResolution select 5))); + show = 0; + text = "BR"; + }; class SpO2Display_Title: HeartRateDisplay_Title { idc = IDC_DISPLAY_SPO2_TITLE; x = QUOTE(KAT_pxToScreen_X(1200)); diff --git a/addons/circulation/defines.hpp b/addons/circulation/defines.hpp index 67d707168..3b18a908d 100644 --- a/addons/circulation/defines.hpp +++ b/addons/circulation/defines.hpp @@ -18,7 +18,7 @@ #define IDC_DISPLAY_BLOODPRESSURE_T 70013 #define IDC_DISPLAY_BLOODPRESSURE_B 70014 #define IDC_DISPLAY_BLOODPRESSURE_M 70015 -#define IDC_DISPLAY_RESP 70016 +#define IDC_DISPLAY_RR_DEFAULT 70016 #define IDC_DISPLAY_SPO2 70017 #define IDC_DISPLAY_PULSERATEBORDER 70018 #define IDC_DISPLAY_PULSERATEBG 70019 @@ -61,6 +61,9 @@ #define IDC_CHARGE_BAR_120 70058 #define IDC_CHARGE_BAR_150 70059 #define IDC_CHARGE_BAR_200 70060 +#define IDC_DISPLAY_RR 70061 +#define IDC_DISPLAY_ETCO2 70062 +#define IDC_DISPLAY_BR 70063 #define IDC_AEDX_MONITOR_TITLE 71000 #define IDC_EKG_SLIDER_TITLE 71001 @@ -69,7 +72,7 @@ #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_RR_DEFAULT_TITLE 71007 #define IDC_DISPLAY_SPO2_TITLE 71008 #define IDC_DISPLAY_PULSERATEBORDER_TITLE 71009 #define IDC_DISPLAY_PULSERATEBG_TITLE 71010 @@ -82,4 +85,7 @@ #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 +#define IDC_AEDMODE_MSG_TITLE 71020 +#define IDC_DISPLAY_RR_TITLE 71021 +#define IDC_DISPLAY_ETCO2_TITLE 71022 +#define IDC_DISPLAY_BR_TITLE 71023 \ No newline at end of file diff --git a/addons/circulation/functions/fnc_AEDX_ViewMonitor.sqf b/addons/circulation/functions/fnc_AEDX_ViewMonitor.sqf index 68c069e43..4940ea4a5 100644 --- a/addons/circulation/functions/fnc_AEDX_ViewMonitor.sqf +++ b/addons/circulation/functions/fnc_AEDX_ViewMonitor.sqf @@ -309,6 +309,26 @@ GVAR(PulseRateReady) = true; ctrlSetText [IDC_DISPLAY_BLOODPRESSURE_M, ""]; ctrlSetText [IDC_DISPLAY_SPO2, "---"]; }; + + private _hasEtco2Monitor = !(GVAR(AEDX_MonitorTarget) getVariable [QEGVAR(breathing,etco2Monitor),[]] isEqualTo []); //check for etco2 monitoring apparatus + private _etco2 = GET_ETCO2(GVAR(AEDX_MonitorTarget)); + private _breathrate = GET_BREATHING_RATE(GVAR(AEDX_MonitorTarget)); + + if (_hasEtco2Monitor) then { + ctrlShow [IDC_DISPLAY_RR_DEFAULT, false]; + ctrlShow [IDC_DISPLAY_RR, true]; + ctrlShow [IDC_DISPLAY_ETCO2, true]; + ctrlShow [IDC_DISPLAY_BR, true]; + + ctrlSetText [IDC_DISPLAY_RR, format["%1", round(_breathrate)]]; + ctrlSetText [IDC_DISPLAY_ETCO2, format["%1", round(_etco2)]]; + } else { + ctrlShow [IDC_DISPLAY_RR_DEFAULT, true]; + ctrlShow [IDC_DISPLAY_RR, false]; + ctrlShow [IDC_DISPLAY_ETCO2, false]; + ctrlShow [IDC_DISPLAY_BR, false]; + }; + }, 1, [_dlg]] call CBA_fnc_addPerFrameHandler; [{ diff --git a/addons/circulation/functions/fnc_AEDX_ViewMonitor_CPR.sqf b/addons/circulation/functions/fnc_AEDX_ViewMonitor_CPR.sqf index 624312680..b07d4fbf1 100644 --- a/addons/circulation/functions/fnc_AEDX_ViewMonitor_CPR.sqf +++ b/addons/circulation/functions/fnc_AEDX_ViewMonitor_CPR.sqf @@ -272,4 +272,24 @@ private _dlg = uiNamespace getVariable ["KAT_Circulation_AEDX_Monitor_Display", (_dlg displayCtrl IDC_DISPLAY_BLOODPRESSURE_M_TITLE) ctrlSetText ""; (_dlg displayCtrl IDC_DISPLAY_SPO2_TITLE) ctrlSetText "---"; }; + + private _hasEtco2Monitor = !(GVAR(AEDX_MonitorTarget) getVariable [QEGVAR(breathing,etco2Monitor),[]] isEqualTo []); + private _etco2 = GET_ETCO2(GVAR(AEDX_MonitorTarget)); + private _breathrate = GET_BREATHING_RATE(GVAR(AEDX_MonitorTarget)); + + if (_hasEtco2Monitor) then { + (_dlg displayCtrl IDC_DISPLAY_RR_DEFAULT_TITLE) ctrlShow false; + (_dlg displayCtrl IDC_DISPLAY_RR_TITLE) ctrlShow true; + (_dlg displayCtrl IDC_DISPLAY_ETCO2_TITLE) ctrlShow true; + (_dlg displayCtrl IDC_DISPLAY_BR_TITLE) ctrlShow true; + + (_dlg displayCtrl IDC_DISPLAY_RR_TITLE) ctrlSetText (format ["%1", round(_breathrate)]); + (_dlg displayCtrl IDC_DISPLAY_ETCO2_TITLE) ctrlSetText (format ["%1", round(_etco2)]); + } else { + (_dlg displayCtrl IDC_DISPLAY_RR_DEFAULT_TITLE) ctrlShow true; + (_dlg displayCtrl IDC_DISPLAY_RR_TITLE) ctrlShow false; + (_dlg displayCtrl IDC_DISPLAY_ETCO2_TITLE) ctrlShow false; + (_dlg displayCtrl IDC_DISPLAY_BR_TITLE) ctrlShow false; + }; + }, 1, [_dlg]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/circulation/ui/AEDX_Monitor_Dialog.hpp b/addons/circulation/ui/AEDX_Monitor_Dialog.hpp index bd3edf77a..27966e0f8 100644 --- a/addons/circulation/ui/AEDX_Monitor_Dialog.hpp +++ b/addons/circulation/ui/AEDX_Monitor_Dialog.hpp @@ -103,14 +103,14 @@ class GVAR(AEDX_Monitor_Dialog) { x = QUOTE(KAT_pxToScreen_X(1010)); colorBackground[] = {0.73,0.02,0.74,1}; colorText[] = {0,0,0,1}; - text = "Resp"; + text = "CO2"; }; class RespirationRateDisplayBackgroundText: RespirationRateDisplayBackground { idc = -1; style = 1; colorBackground[] = {0,0,0,0}; font = "RobotoCondensedLight"; - text = "/min"; + text = "mmHg"; }; class SpO2DisplayBackground: HeartRateVitalsDisplayBackground { idc = -1; @@ -202,13 +202,40 @@ class GVAR(AEDX_Monitor_Dialog) { text = ""; }; class RespirationRateDisplay: HeartRateDisplay { - idc = IDC_DISPLAY_RESP; + idc = IDC_DISPLAY_RR_DEFAULT; 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 RespirationRateDisplay_ETCO2: RespirationRateDisplay { + idc = IDC_DISPLAY_ETCO2; + x = QUOTE(KAT_pxToScreen_X(1050)); + y = QUOTE(KAT_pxToScreen_Y(1175)); + h = QUOTE(KAT_pxToScreen_H(120)); + sizeEx = QUOTE(KAT_GRID_H * 2.2 * (0.55 / (getResolution select 5))); + show = 0; + text = "40"; + }; + class RespirationRateDisplay_ACTUAL: RespirationRateDisplay { + idc = IDC_DISPLAY_RR; + x = QUOTE(KAT_pxToScreen_X(1060)); + y = QUOTE(KAT_pxToScreen_Y(1260)); + h = QUOTE(KAT_pxToScreen_H(120)); + sizeEx = QUOTE(KAT_GRID_H * 1.7 * (0.55 / (getResolution select 5))); + show = 0; + text = "15"; + }; + class RespirationRateDisplay_BR: RespirationRateDisplay { + idc = IDC_DISPLAY_BR; + x = QUOTE(KAT_pxToScreen_X(990)); + y = QUOTE(KAT_pxToScreen_Y(1269)); + h = QUOTE(KAT_pxToScreen_H(120)); + sizeEx = QUOTE(KAT_GRID_H * 1 * (0.55 / (getResolution select 5))); + show = 0; + text = "BR"; + }; class SpO2Display: HeartRateDisplay { idc = IDC_DISPLAY_SPO2; x = QUOTE(KAT_pxToScreen_X(1200));