Small bugfix and version bump

This commit is contained in:
Daniel Schick 2024-07-30 08:36:11 +02:00
parent 121ccaf295
commit a59daa7a78
5 changed files with 51 additions and 18 deletions

View File

@ -108,30 +108,40 @@ namespace ENI2
}
}
public bool HasCriticalInfoMissing(out string messageText)
public bool HasCriticalInfoMissing(out string messageText, string locode)
{
messageText = "";
// Hier haben wir Logik für Spezialfälle, z.B. dass für BRE und BRV bestimmte Meldeklassen gesendet werden *müssen*
if(this.Core.PoC.Equals("DEBRV") || this.Core.PoC.Equals("DEBRE") || this.Core.PoC.Equals("DEHAM"))
switch (locode)
{
foreach(Message aMessage in _messages)
case "DEBRV":
case "DEBRE":
{
foreach (Message aMessage in _messages)
{
if (!this.Core.PoC.Equals("DEHAM")) {
if ((aMessage.MessageNotificationClass == Message.NotificationClass.NOA_NOD) && (aMessage.InternalStatus != Message.BSMDStatus.CONFIRMED)) { messageText = "NOA_NOD"; return true; }
if ((aMessage.MessageNotificationClass == Message.NotificationClass.AGNT) && (aMessage.InternalStatus != Message.BSMDStatus.CONFIRMED)) { messageText = "AGNT"; return true; }
if ((aMessage.MessageNotificationClass == Message.NotificationClass.INFO) && (aMessage.InternalStatus != Message.BSMDStatus.CONFIRMED)) { messageText = "INFO"; return true; }
if ((aMessage.MessageNotificationClass == Message.NotificationClass.SEC) && (aMessage.InternalStatus != Message.BSMDStatus.CONFIRMED)) { messageText = "SEC"; return true; }
if ((aMessage.MessageNotificationClass == Message.NotificationClass.TIEFA) && (aMessage.InternalStatus != Message.BSMDStatus.CONFIRMED)) { messageText = "TIEFA"; return true; }
}
if ((aMessage.MessageNotificationClass == Message.NotificationClass.SERV) && (aMessage.InternalStatus != Message.BSMDStatus.CONFIRMED)) { messageText = "SERV"; return true; }
}
break;
case "DEHAM":
foreach (Message aMessage in _messages)
{
if ((aMessage.MessageNotificationClass == Message.NotificationClass.SERV) && (aMessage.Elements.Count == 0)) { messageText = "SERV"; return true; }
}
break;
default:
break;
}
return false;
}
#endregion
#region Construction

View File

@ -36,8 +36,8 @@
<MinimumRequiredVersion>5.4.0.0</MinimumRequiredVersion>
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>publish.html</WebPage>
<ApplicationRevision>9</ApplicationRevision>
<ApplicationVersion>7.2.3.1</ApplicationVersion>
<ApplicationRevision>2</ApplicationRevision>
<ApplicationVersion>7.2.3.2</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut>
<PublishWizardCompleted>true</PublishWizardCompleted>

View File

@ -216,17 +216,28 @@ namespace ENI2
}
// Dez.22: Special case for BRE/BRV: Warning if some messages are not "confirmed"
if(drc.Core.PoC.Equals("DEBRE")||drc.Core.PoC.Equals("DEBRV")||drc.Core.PoC.Equals("DEHAM"))
if(drc.Core.PoC.Equals("DEBRE")||drc.Core.PoC.Equals("DEBRV"))
{
if(drc.HasCriticalInfoMissing(out string missingClass))
if(drc.HasCriticalInfoMissing(out string missingClass, drc.Core.PoC))
{
_log.WarnFormat("set close warning because at least {0} is missing from BRE/BRV/HAM arrival", missingClass);
// _log.WarnFormat("set close warning because at least {0} is missing from BRE/BRV/HAM arrival", missingClass);
if (MessageBox.Show(string.Format(Properties.Resources.textSpecialCaseBREBRV, missingClass), Properties.Resources.textConfirmation, MessageBoxButton.YesNo,
MessageBoxImage.Question, MessageBoxResult.No) == MessageBoxResult.No)
e.Cancel = true;
}
}
// Jul.24: Special case HAM extended (from above)
if (drc.Core.PoC.Equals("DEHAM"))
{
if (drc.HasCriticalInfoMissing(out string missingClass, drc.Core.PoC))
{
if (MessageBox.Show(string.Format(Properties.Resources.textSpecialCaseDEHAM, missingClass), Properties.Resources.textConfirmation, MessageBoxButton.YesNo,
MessageBoxImage.Question, MessageBoxResult.No) == MessageBoxResult.No)
e.Cancel = true;
}
}
if (!e.Cancel)
{
if (lockedCores.ContainsKey(tabItem))

View File

@ -4682,6 +4682,15 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to No {0} info given for DEHAM. Close anyway?.
/// </summary>
public static string textSpecialCaseDEHAM {
get {
return ResourceManager.GetString("textSpecialCaseDEHAM", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Special requirements.
/// </summary>

View File

@ -1900,4 +1900,7 @@
<data name="textCopyToPASD" xml:space="preserve">
<value>Copy to PASD</value>
</data>
<data name="textSpecialCaseDEHAM" xml:space="preserve">
<value>No {0} info given for DEHAM. Close anyway?</value>
</data>
</root>