Skip to content

Commit

Permalink
Adding colored activitylogs for critical values
Browse files Browse the repository at this point in the history
These can be enabled or disabled with airway settings
  • Loading branch information
Tomcat-SG committed Dec 19, 2020
1 parent 7842303 commit 446d7d9
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 1 deletion.
3 changes: 3 additions & 0 deletions addons/airway/CfgFunctions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ class CfgFunctions {
};
class updateInjuryList {
file = QPATHTOF(functions\fnc_updateInjuryList.sqf);
};
class updateLogList {
file = QPATHTOF(functions\fnc_updateLogList.sqf);
};
};
};
Expand Down
1 change: 1 addition & 0 deletions addons/airway/XEH_PREP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ PREP(treatmentAdvanced_airwayLocal);
PREP(treatmentAdvanced_overstretchHead);
PREP(treatmentAdvanced_turnaroundHead);
PREP(updateInjuryList);
PREP(updateLogList);
11 changes: 10 additions & 1 deletion addons/airway/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ In real life, this will happen sometimes, not quiet often.
true
] call CBA_Settings_fnc_init;


// airway Injuries Death Timer
[
QGVAR(deathTimer),
Expand Down Expand Up @@ -179,4 +178,14 @@ In real life, this will happen sometimes, not quiet often.
true
] call CBA_Settings_fnc_init;

// Enable or disable Colored Action Logs
[
QGVAR(Colored_logs),
"CHECKBOX",
[LLSTRING(COLORED_LOGS),LLSTRING(COLORED_LOGS_DESC)],
CBA_SETTINGS_CAT,
[true],
true
] call CBA_Settings_fnc_init;

ADDON = true;
63 changes: 63 additions & 0 deletions addons/airway/functions/fnc_updateLogList.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#include "script_component.hpp"
/*
* Author: mharis001
* Updates list control with given logs.
*
* Arguments:
* 0: Log list <CONTROL>
* 1: Log to add <ARRAY>
*
* Return Value:
* None
*
* Example:
* [_ctrlActivityLog, _activityLog] call ace_medical_gui_fnc_updateLogList
*
* Public: No
*/

params ["_ctrl", "_logs"];

lbClear _ctrl;

{
_x params ["_message", "_timeStamp", "_arguments"];

//set us the original string into a var to check the afterwards
_messageWOlocalization = _message;

// Localize message and arguments
if (isLocalized _message) then {
_message = localize _message;
};

_arguments = _arguments apply {if (_x isEqualType "" && {isLocalized _x}) then {localize _x} else {_x}};

// Format message with arguments
_message = format ([_message] + _arguments);

_rowIdc = _ctrl lbAdd format ["%1 %2", _timeStamp, _message];

//Color the logs if enabled by Airway Settings of KAM
if (GVAR(Colored_logs)) then {
if (_messageWOlocalization isEqualTo "STR_kat_breathing_pulseoxi_Log") then {
if (((_arguments select 0) < 45 )
|| ((_arguments select 0) > 120 )
|| ((_arguments select 1) < 75 )) then {
_ctrl lbSetColor [_rowIdc, [1, 0, 0, 1]];
};
};
if (_messageWOlocalization isEqualTo "HR: %1 RR: %2/%3 SpO2: %4") then {
if (((_arguments select 0) < 45 )
|| ((_arguments select 0) > 120 )
|| ((_arguments select 1) < 50 )
|| ((_arguments select 1) > 200 )
|| ((_arguments select 2) < 60 )
|| ((_arguments select 2) > 145 )
|| ((_arguments select 3) < 75 )) then {
_ctrl lbSetColor [_rowIdc, [1, 0, 0, 1]];
};
};
};

} forEach _logs;
24 changes: 24 additions & 0 deletions addons/airway/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,30 @@
<French>Combien de temps faudra t-il pour placer une canule de Guedel</French>
<Turkish>Guedel Tüp'ü kullanmak ne kadar sürecek</Turkish>
<Italian>Quanto tempo si impiega per posizionare una canula di Guedel</Italian>
</Key>
<Key ID="STR_kat_airway_COLORED_LOGS">
<English>Colored activitylogs (AED-X/Pulseoximeter)</English>
<German>Bunte Activitylogs (AED-X/Pulseoximeter)</German>
<Polish>Kolorowe aktywatory (AED-X/Pulseoksymetr)</Polish>
<Spanish>Registros de actividad de color (AED-X/Pulseoxímetro)</Spanish>
<Chinese>彩色活动记录(AED-X/脉冲氧饱和度仪)</Chinese>
<Czech>Barevné protokoly aktivit (AED-X / Pulseoximeter)</Czech>
<Korean>컬러 활동 기록 (AED-X / 맥박 측정기)</Korean>
<French>Blocs d'activité colorés (AED-X/Pulseoximeter)</French>
<Turkish>Renkli aktivite günlükleri (AED-X / Pulseoximeter)</Turkish>
<Italian>Zoccoli di attività colorati (AED-X/Pulsossimetro)</Italian>
</Key>
<Key ID="STR_kat_airway_COLORED_LOGS_DESC">
<English>Colors the Activitylogs of AED-X or Pulseoximeter red, if any value is critical</English>
<German>Färbt die Activitylogs von AED-X oder Pulsoximeter rot, wenn ein Wert kritisch ist</German>
<Polish>Zabarwiać aktywatory AED-X lub pulsoksymetr na czerwono, jeśli jakaś wartość jest krytyczna</Polish>
<Spanish>Coloca los registros de actividad del AED-X o del Pulsoxímetro en rojo, si algún valor es crítico</Spanish>
<Chinese>将AED-X或Pulseoximeter的Activitylogs染成红色,如果任何值是临界值。</Chinese>
<Czech>Pokud je nějaká hodnota kritická, vybarví Activitylogy AED-X nebo Pulseoximeter červeně</Czech>
<Korean>중요한 값이있는 경우 AED-X 또는 맥박 산소계의 활동 로그를 빨간색으로 표시합니다.</Korean>
<French>Colore les Activitylogs de l'AED-X ou du Pulseoximeter en rouge, si une valeur est critique</French>
<Turkish>Herhangi bir değer kritikse, AED-X veya Pulseoximeter Activitylog'larını kırmızı renklendirir</Turkish>
<Italian>Colora gli Activitylogs di AED-X o il rosso del pulsossimetro, se un valore è critico</Italian>
</Key>
</Package>
</Project>

0 comments on commit 446d7d9

Please sign in to comment.