Skip to content

Commit

Permalink
IISIM 2.2.3, IISE 1.0.2
Browse files Browse the repository at this point in the history
Simulator 2.2.3
- Improved UX re: progression listing on playing loaded scenario (#151)
  - Made descriptions show more clearly
    - If no progression description, then target Step description is shown
    - Rather than showing additional "Default" progression, just tags the default
- Bugfix: Tracing scaling was visible after switching to non-scaling input (#153)
Scenario Editor 1.0.2
- Added panel description to "currently editing" step information pane
- Bugfix: Scenario.Step[i] not deleted in DeleteStep(i)
  • Loading branch information
tanjera committed Jul 21, 2022
1 parent 53406bd commit acac427
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 26 deletions.
2 changes: 1 addition & 1 deletion II Scenario Editor/II Scenario Editor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<TrimMode>copyused</TrimMode>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<AssemblyName>Infirmary Integrated Scenario Editor</AssemblyName>
<Version>1.0.1</Version>
<Version>1.0.2</Version>
<Company>Infirmary Integrated</Company>
<PackageLicenseFile>License.md</PackageLicenseFile>
<PackageProjectUrl>https://www.infirmary-integrated.com/</PackageProjectUrl>
Expand Down
4 changes: 3 additions & 1 deletion II Scenario Editor/Windows/PanelParameters.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,9 @@ private async Task UpdateViewModel () {
PropertyInt pintIAP = this.FindControl<PropertyInt> ("pintIAP");
PropertyInt pintPacemakerThreshold = this.FindControl<PropertyInt> ("pintPacemakerThreshold");

lblActiveStep.Content = String.Format ("Editing Step: {0}", Step is null ? "N/A" : Step.Name);
lblActiveStep.Content = String.Format ("Editing Step: {0} ({1})",
Step is null ? "N/A" : Step.Name,
Step is null ? "N/A" : Step.Description);

// Enable/Disable controls based on if Patient is null!
chkClampVitals.IsEnabled = (Patient != null);
Expand Down
7 changes: 5 additions & 2 deletions II Scenario Editor/Windows/PanelStepEditor.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -330,11 +330,14 @@ private async Task DeleteStep (ItemStep item) {

// Remove all progressions targeting the Step being removed
for (int i = s.Step.Progressions.Count - 1; i >= 0; i--) {
if (s.Step.Progressions [i].DestinationUUID == item.UUID)
s.Step.Progressions.RemoveAt (i);
if (s.Step?.Progressions [i].DestinationUUID == item.UUID)
s.Step?.Progressions.RemoveAt (i);
}
}

// Remove the Step from the Scenario model
Scenario.Steps.RemoveAll (s => s.UUID == item.UUID);

await UpdateIProgressions ();
await DrawIProgressions ();
}
Expand Down
4 changes: 4 additions & 0 deletions II Simulator/Controls/DefibTracing.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ private void UpdateInterface (object sender, EventArgs e) {
if (uiMenuToggleAutoScale is not null)
uiMenuToggleAutoScale.IsEnabled = Strip?.CanScale ?? false;

lblScaleAuto.IsVisible = Strip?.CanScale ?? false;
lblScaleMin.IsVisible = Strip?.CanScale ?? false;
lblScaleMax.IsVisible = Strip?.CanScale ?? false;

if (Strip?.CanScale ?? false) {
lblScaleAuto.Foreground = TracingBrush;
lblScaleMin.Foreground = TracingBrush;
Expand Down
4 changes: 4 additions & 0 deletions II Simulator/Controls/IABPTracing.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ private void UpdateInterface (object sender, EventArgs e) {
lblLead.Foreground = TracingBrush;
lblLead.Content = Instance?.Language.Localize (Lead.LookupString (Lead.Value));

lblScaleAuto.IsVisible = Strip?.CanScale ?? false;
lblScaleMin.IsVisible = Strip?.CanScale ?? false;
lblScaleMax.IsVisible = Strip?.CanScale ?? false;

if (Strip?.CanScale ?? false) {
lblScaleAuto.Foreground = TracingBrush;
lblScaleMin.Foreground = TracingBrush;
Expand Down
4 changes: 4 additions & 0 deletions II Simulator/Controls/MonitorTracing.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,10 @@ private void UpdateInterface (object sender, EventArgs e) {
if (uiMenuToggleAutoScale is not null)
uiMenuToggleAutoScale.IsEnabled = Strip?.CanScale ?? false;

lblScaleAuto.IsVisible = Strip?.CanScale ?? false;
lblScaleMin.IsVisible = Strip?.CanScale ?? false;
lblScaleMax.IsVisible = Strip?.CanScale ?? false;

if (Strip?.CanScale ?? false) {
lblScaleAuto.Foreground = TracingBrush;
lblScaleMin.Foreground = TracingBrush;
Expand Down
2 changes: 1 addition & 1 deletion II Simulator/II Simulator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<AssemblyName>Infirmary Integrated</AssemblyName>
<Copyright>© 2017-2022, Ibi Keller</Copyright>
<Authors>Ibi Keller</Authors>
<Version>2.2.2</Version>
<Version>2.2.3</Version>
<Company>Infirmary Integrated</Company>
<PackageLicenseFile>License.md</PackageLicenseFile>
<PackageProjectUrl>https://www.infirmary-integrated.com/</PackageProjectUrl>
Expand Down
37 changes: 16 additions & 21 deletions II Simulator/Windows/WindowMain.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1059,50 +1059,45 @@ private void OnStepChanged (object? sender, EventArgs e) {
}

private Task InitStep () {
Scenario.Step s = Instance?.Scenario?.Current ?? new Scenario.Step ();
Scenario.Step step = Instance?.Scenario?.Current ?? new Scenario.Step ();

Label lblScenarioStep = this.FindControl<Label> ("lblScenarioStep");
Label lblTimerStep = this.FindControl<Label> ("lblTimerStep");
StackPanel stackProgressions = this.FindControl<StackPanel> ("stackProgressions");

// Set Previous, Next, Pause, and Play buttons .IsEnabled based on Step properties
this.FindControl<Button> ("btnPreviousStep").IsEnabled = (!String.IsNullOrEmpty (s.DefaultSource));
this.FindControl<Button> ("btnNextStep").IsEnabled = (!String.IsNullOrEmpty (s.DefaultProgression?.UUID) || s.Progressions.Count > 0);
this.FindControl<Button> ("btnPauseStep").IsEnabled = (s.ProgressTimer > 0);
this.FindControl<Button> ("btnPreviousStep").IsEnabled = (!String.IsNullOrEmpty (step.DefaultSource));
this.FindControl<Button> ("btnNextStep").IsEnabled = (!String.IsNullOrEmpty (step.DefaultProgression?.UUID) || step.Progressions.Count > 0);
this.FindControl<Button> ("btnPauseStep").IsEnabled = (step.ProgressTimer > 0);
this.FindControl<Button> ("btnPlayStep").IsEnabled = false;

// Display Scenario's Step count
lblScenarioStep.Content = $"{Instance?.Language.Localize ("PE:ProgressionStep")}: {s.Name}";
lblScenarioStep.Content = $"{Instance?.Language.Localize ("PE:ProgressionStep")}: {step.Name}";

// Display Progress Timer if applicable, otherwise instruct that the Step requires manual progression
if (s.ProgressTimer == -1)
if (step.ProgressTimer == -1)
lblTimerStep.Content = Instance?.Language.Localize ("PE:ProgressionManual");
else
lblTimerStep.Content = String.Format ("{0} {1} {2}",
Instance?.Language.Localize ("PE:ProgressionAutomatic"),
s.ProgressTimer,
step.ProgressTimer,
Instance?.Language.Localize ("PE:ProgressionSeconds"));

// Re-populate a StackPanel with RadioButtons for Progression options, including "Default Option"
stackProgressions.Children.Clear ();

stackProgressions.Children.Add (new RadioButton () {
IsChecked = true,
Name = "radioProgression_Default",
Content = Instance?.Language.Localize ("PE:ProgressionDefault"),
GroupName = "ProgressionOptions",
Margin = new Thickness (10, 10, 10, 5)
});

for (int i = 0; i < s.Progressions.Count; i++) {
Scenario.Step.Progression p = s.Progressions [i];
for (int i = 0; i < step.Progressions.Count; i++) {
Scenario.Step.Progression prog = step.Progressions [i];
Scenario.Step? stepTo = Instance?.Scenario?.Steps?.Find (s => s.UUID == prog.DestinationUUID);

stackProgressions.Children.Add (new RadioButton () {
IsChecked = false,
Content = p.Description,
Name = String.Format ("radioProgression_{0}", p.DestinationUUID),
IsChecked = (step.DefaultProgression?.UUID == prog.UUID),
Content = String.Format ("{0}{1}",
((step.DefaultProgression?.UUID == prog.UUID) ? $"{Instance?.Language.Localize ("PE:ProgressionDefault")}: " : ""),
!String.IsNullOrEmpty (prog.Description) ? prog.Description : stepTo?.Name),
Name = String.Format ("radioProgression_{0}", prog.DestinationUUID),
GroupName = "ProgressionOptions",
Margin = (i == s.Progressions.Count - 1 ? new Thickness (10, 5, 10, 10) : new Thickness (10, 5))
Margin = (i == step.Progressions.Count - 1 ? new Thickness (10, 5, 10, 10) : new Thickness (10, 5))
});
}

Expand Down

0 comments on commit acac427

Please sign in to comment.