Skip to content

Commit

Permalink
Display test mode status for config items
Browse files Browse the repository at this point in the history
  • Loading branch information
DocMoebiuz committed Feb 7, 2025
1 parent 0adc316 commit b618ab1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
16 changes: 15 additions & 1 deletion MobiFlight/BrowserMessages/Outgoing/ConfigValueUpdate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,20 @@ namespace MobiFlight.BrowserMessages
internal class ConfigValueUpdate
{
public string UpdateType { get; set; }
public List<IConfigItem> ConfigItems { get; set; }
public List<IConfigItem> ConfigItems { get; set; }

public ConfigValueUpdate() { }
public ConfigValueUpdate(IConfigItem item)
{
ConfigItems = new List<IConfigItem>
{
item
};
}

public ConfigValueUpdate(List<IConfigItem> configItems)
{
ConfigItems = configItems;
}
}
}
8 changes: 7 additions & 1 deletion MobiFlight/ExecutionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1371,7 +1371,7 @@ public void ExecuteTestOff(OutputConfigItem cfg, bool ResetConfigItemInTest)
ConfigItemInTestMode = null;

OutputConfigItem offCfg = (OutputConfigItem)cfg.Clone();

if (offCfg.DeviceType == null) return;

switch (offCfg.DeviceType)
Expand Down Expand Up @@ -1400,6 +1400,9 @@ public void ExecuteTestOff(OutputConfigItem cfg, bool ResetConfigItemInTest)
ExecuteDisplay(offCfg.DeviceType == ArcazeLedDigit.TYPE ? " " : "0", offCfg);
break;
}

cfg.Status.Remove(ConfigItemStatusType.Test);
MessageExchange.Instance.Publish(new ConfigValueUpdate(cfg));
}

public void ExecuteTestOn(OutputConfigItem cfg, ConnectorValue value = null)
Expand Down Expand Up @@ -1447,6 +1450,9 @@ public void ExecuteTestOn(OutputConfigItem cfg, ConnectorValue value = null)
ExecuteDisplay(value?.ToString() ?? "255", cfg);
break;
}

cfg.Status[ConfigItemStatusType.Test] = "TEST_EXECUTION";
MessageExchange.Instance.Publish(new ConfigValueUpdate(cfg));
}


Expand Down

0 comments on commit b618ab1

Please sign in to comment.