diff --git a/ENI2/DetailRootControl.xaml.cs b/ENI2/DetailRootControl.xaml.cs index 549bc577..6aece539 100644 --- a/ENI2/DetailRootControl.xaml.cs +++ b/ENI2/DetailRootControl.xaml.cs @@ -187,7 +187,8 @@ namespace ENI2 this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.text9PassengerDeparture, MessageGroupControlType = typeof(PassengerDepartureControl), ImagePath = "Resources/departure_user.png" }); this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.text10DangerousCargoArrival, MessageGroupControlType = typeof(DangerousCargoControl), ImagePath = "Resources/sign_warning_radiation.png" }); this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.text11DangerousCargoDeparture, MessageGroupControlType = typeof(DangerousCargoControl), ImagePath = "Resources/sign_warning_radiation.png" }); - + this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.text12ATAATD, MessageGroupControlType = typeof(ATAControl), ImagePath = "Resources/clock.png" }); + this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.text13WasteReceipts, MessageGroupControlType = typeof(WasteReceiptsControl), ImagePath = "Resources/garbage.png" }); } this.listBoxMessages.ItemsSource = this._listBoxList; diff --git a/ENI2/DetailViewControls/WasteDetailControl.xaml.cs b/ENI2/DetailViewControls/WasteDetailControl.xaml.cs index 046108a0..d2eaac69 100644 --- a/ENI2/DetailViewControls/WasteDetailControl.xaml.cs +++ b/ENI2/DetailViewControls/WasteDetailControl.xaml.cs @@ -585,8 +585,7 @@ namespace ENI2.DetailViewControls } - #endregion - + #endregion #region Waste disposal Service Provider templates event handler diff --git a/ENI2/ENI2.csproj b/ENI2/ENI2.csproj index 1b18e555..405e0876 100644 --- a/ENI2/ENI2.csproj +++ b/ENI2/ENI2.csproj @@ -493,6 +493,9 @@ True Reference.svcmap + + ATAControl.xaml + CrewDepartureControl.xaml @@ -523,6 +526,9 @@ VoyageControl.xaml + + WasteReceiptsControl.xaml + SplashScreenWindow.xaml @@ -833,6 +839,10 @@ MainWindow.xaml Code + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -873,6 +883,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -1009,6 +1023,7 @@ + Always diff --git a/ENI2/Properties/Resources.Designer.cs b/ENI2/Properties/Resources.Designer.cs index 48a9b91a..f17f7862 100644 --- a/ENI2/Properties/Resources.Designer.cs +++ b/ENI2/Properties/Resources.Designer.cs @@ -230,6 +230,16 @@ namespace ENI2.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap clock { + get { + object obj = ResourceManager.GetObject("clock", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -992,6 +1002,24 @@ namespace ENI2.Properties { } } + /// + /// Looks up a localized string similar to 12.1 Actual time of arrival. + /// + public static string text121ATA { + get { + return ResourceManager.GetString("text121ATA", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 12.2 Actual time of departure. + /// + public static string text122ATD { + get { + return ResourceManager.GetString("text122ATD", resourceCulture); + } + } + /// /// Looks up a localized string similar to 12. Actual time of arrival / departure. /// @@ -1010,6 +1038,15 @@ namespace ENI2.Properties { } } + /// + /// Looks up a localized string similar to 13.1 Waste receipt. + /// + public static string text131WasteReceipt { + get { + return ResourceManager.GetString("text131WasteReceipt", resourceCulture); + } + } + /// /// Looks up a localized string similar to 1.3 Relevant Portcall (port of call) / Kiel-Canal-Transit. /// diff --git a/ENI2/Properties/Resources.resx b/ENI2/Properties/Resources.resx index 15abc490..a5e0cd9c 100644 --- a/ENI2/Properties/Resources.resx +++ b/ENI2/Properties/Resources.resx @@ -2158,4 +2158,16 @@ 11.6 IMDG data (on departure), if applicable + + 12.1 Actual time of arrival + + + 12.2 Actual time of departure + + + 13.1 Waste receipt + + + ..\Resources\clock.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/ENI2/Resources/clock.png b/ENI2/Resources/clock.png new file mode 100644 index 00000000..14290fde Binary files /dev/null and b/ENI2/Resources/clock.png differ diff --git a/ENI2/SheetDisplayControls/ATAControl.xaml b/ENI2/SheetDisplayControls/ATAControl.xaml new file mode 100644 index 00000000..ddff0f6e --- /dev/null +++ b/ENI2/SheetDisplayControls/ATAControl.xaml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/ENI2/SheetDisplayControls/ATAControl.xaml.cs b/ENI2/SheetDisplayControls/ATAControl.xaml.cs new file mode 100644 index 00000000..320fdb24 --- /dev/null +++ b/ENI2/SheetDisplayControls/ATAControl.xaml.cs @@ -0,0 +1,113 @@ +// Copyright (c) 2025- schick Informatik +// Description: Display control of formsheet Tab 12. ATA ATD +// + +using bsmd.database; +using System; +using System.Windows; + +namespace ENI2.SheetDisplayControls +{ + /// + /// Interaction logic for ATAControl.xaml + /// + public partial class ATAControl : DetailBaseControl + { + #region Fields + + ATA _ata; + ATD _atd; + bool startupComplete = false; + + #endregion + + #region Fields + + public ATAControl() + { + InitializeComponent(); + Loaded += ATAControl_Loaded; + } + + #endregion + + #region public overrides + + public override void Initialize() + { + base.Initialize(); + + foreach (Message aMessage in this.Messages) + { + if (aMessage.MessageNotificationClass == Message.NotificationClass.ATA) + { + this.ControlMessages.Add(aMessage); + if (aMessage.Elements.Count > 0) + _ata = aMessage.Elements[0] as ATA; + if (_ata == null) + { + _ata = new ATA(); + _ata.MessageCore = this.Core; + _ata.MessageHeader = aMessage; + aMessage.Elements.Add(_ata); + } + this.dateTimePickerATA.DataContext = _ata; + } + + if (aMessage.MessageNotificationClass == Message.NotificationClass.ATD) + { + this.ControlMessages.Add(aMessage); + if (aMessage.Elements.Count > 0) + _atd = aMessage.Elements[0] as ATD; + if (_atd == null) + { + _atd = new ATD(); + _atd.MessageCore = this.Core; + _atd.MessageHeader = aMessage; + aMessage.Elements.Add(_atd); + } + this.dateTimePickerATD.DataContext = _atd; + } + } + } + + public override void SetEnabled(bool enabled) + { + base.SetEnabled(enabled); + + } + + #endregion + + #region event handler + private void ATAControl_Loaded(object sender, RoutedEventArgs e) + { + this.RegisterDateTimePickerChange(this.dateTimePickerATA, Message.NotificationClass.ATA); + this.RegisterDateTimePickerChange(this.dateTimePickerATD, Message.NotificationClass.ATD); + startupComplete = true; + } + + private void dateTimePickerATD_ValueChanged(object sender, RoutedPropertyChangedEventArgs e) + { + if (startupComplete && this.dateTimePickerATD.Value.HasValue) + { + DateTime setTime = this.dateTimePickerATD.Value.Value; + if ((setTime > DateTime.Now.AddDays(14)) || (setTime < DateTime.Now.AddDays(-14))) + MessageBox.Show("ATD value may be invalid", "Date implausible", MessageBoxButton.OK, MessageBoxImage.Warning); + } + } + + private void dateTimePickerATA_ValueChanged(object sender, RoutedPropertyChangedEventArgs e) + { + if (startupComplete && this.dateTimePickerATA.Value.HasValue) + { + DateTime setTime = this.dateTimePickerATA.Value.Value; + if ((setTime > DateTime.Now.AddDays(14)) || (setTime < DateTime.Now.AddDays(-14))) + MessageBox.Show("ATA value may be invalid", "Date implausible", MessageBoxButton.OK, MessageBoxImage.Warning); + } + } + + #endregion + + } +} diff --git a/ENI2/SheetDisplayControls/WasteReceiptsControl.xaml b/ENI2/SheetDisplayControls/WasteReceiptsControl.xaml new file mode 100644 index 00000000..30dba09f --- /dev/null +++ b/ENI2/SheetDisplayControls/WasteReceiptsControl.xaml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +