-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding colored activitylogs for critical values
These can be enabled or disabled with airway settings
- Loading branch information
Showing
5 changed files
with
101 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters