Skip to content

Commit

Permalink
IISIM 2.5.8: Rhythm.Strip Debugging; Copyrights
Browse files Browse the repository at this point in the history
- ReplaceAtOver() replaced w/ Replace() for CVP: #204
  - Also replaced w/ Replace() for PA @ RA (CVP)
- Tracing.CalculateOffsets() Offset.Y & Multiplier.Y utilizing Stretch technique
  - Keeps tracings centered on Strip's Y-axis; #206
- Fixed Draw.CVP_Rhythm -> DampenAmplitude_DiastolicFillTime coefficient of -1
  - Was flipping the tracing, causing #205
  - Since no other use of DampenAmplitude_DiastolicFillTime uses custom coefficient...
    - Custom coefficient removed from constructor
- Copyrights updated (2023 -> 2024)
  - In About dialog, on splash screen .png, in readme
  • Loading branch information
tanjera committed Jan 31, 2024
1 parent 398336b commit da3493f
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 16 deletions.
Binary file modified Assets/SplashScreen_Infirmary_800x480.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Assets/SplashScreen_Infirmary_800x480.xcf
Binary file not shown.
11 changes: 6 additions & 5 deletions II Library/Classes/Rhythm.Strip.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
using II.Waveform;

namespace II.Rhythm {

public class Strip {
/* Default variables for easy modification of multiple measurement/tracing functions */
public const double DefaultLength = 6.0d;
Expand Down Expand Up @@ -581,7 +582,7 @@ public List<PointD> Scale (Physiology? p, List<PointD> addition) {
max = (max > addition [i].Y) ? max : addition [i].Y;
max = (min != max) ? max : 1; // Scaled waveforms should be 0.0 to 1.0

// Get new min and max vaules for the desired tracing
// Get new min and max values for the desired tracing
double newMin = II.Math.InverseLerp (ScaleMin, ScaleMax, trough);
double newMax = II.Math.InverseLerp (ScaleMin, ScaleMax, peak);

Expand Down Expand Up @@ -670,13 +671,13 @@ public void Add_Beat__Cardiac_Ventricular_Mechanical (Physiology? p) {
break;

case Lead.Values.CVP:
ReplaceAtOver (Draw.CVP_Rhythm (p, 1d));
Replace (Draw.CVP_Rhythm (p, 1d));
break;

case Lead.Values.PA: // Vary PA waveforms based on PA catheter placement
if (p.PulmonaryArtery_Placement.Value == PulmonaryArtery_Rhythms.Values.Right_Atrium)
ReplaceAtOver (Scale (p, Draw.CVP_Rhythm (p, 1d)));
else if (p.PulmonaryArtery_Placement.Value == PulmonaryArtery_Rhythms.Values.Right_Ventricle)
if (p.PulmonaryArtery_Placement.Value == PulmonaryArtery_Rhythms.Values.Right_Atrium) {
Replace (Scale (p, Draw.CVP_Rhythm (p, 1d)));
} else if (p.PulmonaryArtery_Placement.Value == PulmonaryArtery_Rhythms.Values.Right_Ventricle)
ReplaceAtOver (Scale (p, Draw.RV_Rhythm (p, 1d)));
else if (p.PulmonaryArtery_Placement.Value == PulmonaryArtery_Rhythms.Values.Pulmonary_Artery)
ReplaceAtOver (Scale (p, Draw.PA_Rhythm (p, 1d)));
Expand Down
4 changes: 2 additions & 2 deletions II Library/Classes/Tracing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ public static void CalculateOffsets (
break;

case Strip.Offsets.Scaled:
drawOffset.Y = (int)(height * (1 - strip.ScaleMargin));
drawMultiplier.Y = -(int)height;
drawOffset.Y = (int)(height * (1 - (strip.ScaleMargin / 2)));
drawMultiplier.Y = -(int)height * (1 - strip.ScaleMargin) * strip.Amplitude;
break;
}
}
Expand Down
9 changes: 5 additions & 4 deletions II Library/Classes/Waveform.Draw.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using System.Linq;

namespace II.Waveform {

public static class Draw {
public const int ResolutionTime = 10; // Tracing resolution milliseconds per drawing point
public const int RefreshTime = 17; // Tracing draw refresh time in milliseconds (60 fps = ~17ms)
Expand All @@ -34,10 +35,10 @@ private static void DampenAmplitude_EctopicBeat (Physiology _P, ref double _Ampl

// Decreases pulsatility based on decreased diastolic filling time. Linear interpolation of where actual HR
// is compared to set HR (e.g. for tachycardic runs of irregular rhythms, or premature contractions)
private static void DampenAmplitude_DiastolicFillTime (Physiology _P, ref double _Amplitude, double coefficient = 1.0) {
private static void DampenAmplitude_DiastolicFillTime (Physiology _P, ref double _Amplitude) {
// Utilize actual vital signs from 1 entry ago (because of electromechanical delay, most recent actual HR is for forthcoming pulsatile beat)
_Amplitude *= (coefficient * Math.Lerp (1.0d, 0.5d,
Math.Clamp ((_P.GetLastVS (Physiology.PhysiologyEventTypes.Cardiac_Baseline).HR - _P.VS_Settings.HR) / (double)_P.VS_Settings.HR)));
_Amplitude *= Math.Lerp (1.0d, 0.5d,
Math.Clamp ((_P.GetLastVS (Physiology.PhysiologyEventTypes.Cardiac_Baseline).HR - _P.VS_Settings.HR) / (double)_P.VS_Settings.HR));
}

private static void DampenAmplitude_PulsusParadoxus (Physiology _P, ref double _Amplitude) {
Expand Down Expand Up @@ -149,7 +150,7 @@ public static List<PointD> ABP_Rhythm (Physiology _P, double _Amplitude) {
public static List<PointD> CVP_Rhythm (Physiology _P, double _Amplitude) {
MagnifyAmplitude_IntrathoracicPressure (_P, ref _Amplitude);
DampenAmplitude_EctopicBeat (_P, ref _Amplitude);
DampenAmplitude_DiastolicFillTime (_P, ref _Amplitude, -1.0);
DampenAmplitude_DiastolicFillTime (_P, ref _Amplitude);

if (_P.Cardiac_Rhythm.HasPulse_Atrial && !_P.Cardiac_Rhythm.AberrantBeat)
return Plotting.Concatenate (new List<PointD> (),
Expand Down
Binary file modified II Scenario Editor/Resources/SplashScreen_Infirmary_800x480.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion II Scenario Editor/Windows/DialogAbout.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
<Label
Margin="5,0"
Padding="5,0,5,2"
Content="Ibi Keller, (c) 2017-2023" />
Content="Ibi Keller, (c) 2017-2024" />

<TextBlock
Name="tblDescription"
Expand Down
4 changes: 2 additions & 2 deletions II Simulator/II Simulator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<StartupObject>IISIM.Program</StartupObject>
<SignAssembly>False</SignAssembly>
<AssemblyName>Infirmary Integrated</AssemblyName>
<Copyright>© 2017-2023, Ibi Keller</Copyright>
<Copyright>© 2017-2024, Ibi Keller</Copyright>
<Authors>Ibi Keller</Authors>
<Version>2.5.7</Version>
<Version>2.5.8</Version>
<Company>Infirmary Integrated</Company>
<PackageLicenseFile>License.md</PackageLicenseFile>
<PackageProjectUrl>https://www.infirmary-integrated.com/</PackageProjectUrl>
Expand Down
Binary file modified II Simulator/Resources/SplashScreen_Infirmary_800x480.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion II Simulator/Windows/DialogAbout.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
Margin="5,0"
Padding="5,0,5,2"
HorizontalAlignment="Left"
Content="Ibi Keller, (c) 2017-2023" />
Content="Ibi Keller, (c) 2017-2024" />

<TextBlock
Name="tblDescription"
Expand Down
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
**Infirmary Integrated**
<br>
(c) 2017-2023, Ibi Keller (tanjera)
(c) 2017-2024, Ibi Keller (tanjera)

Infirmary Integrated is free and open-source software suite consisting of the Infirmary Integrated Simulator, Scenario Editor, and Development Tools designed to advance healthcare education for medical and nursing professionals and students. Developed as in-depth, accurate, and accessible educational tools, Infirmary Integrated can meet the needs of clinical simulators in emergency, critical care, obstetric, and many other medical and nursing specialties.

Expand Down

0 comments on commit da3493f

Please sign in to comment.