From 7c8eed08bd35059946e8d535ddcc6cb6b0f454e6 Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Thu, 30 Jan 2025 09:25:42 +0100 Subject: [PATCH] Added sheet / logic part 12,13 ATA and WAS_RCPT --- ENI2/DetailRootControl.xaml.cs | 3 +- .../WasteDetailControl.xaml.cs | 3 +- ENI2/ENI2.csproj | 15 + ENI2/Properties/Resources.Designer.cs | 37 ++ ENI2/Properties/Resources.resx | 12 + ENI2/Resources/clock.png | Bin 0 -> 2286 bytes ENI2/SheetDisplayControls/ATAControl.xaml | 45 +++ ENI2/SheetDisplayControls/ATAControl.xaml.cs | 113 ++++++ .../WasteReceiptsControl.xaml | 90 +++++ .../WasteReceiptsControl.xaml.cs | 354 ++++++++++++++++++ 10 files changed, 669 insertions(+), 3 deletions(-) create mode 100644 ENI2/Resources/clock.png create mode 100644 ENI2/SheetDisplayControls/ATAControl.xaml create mode 100644 ENI2/SheetDisplayControls/ATAControl.xaml.cs create mode 100644 ENI2/SheetDisplayControls/WasteReceiptsControl.xaml create mode 100644 ENI2/SheetDisplayControls/WasteReceiptsControl.xaml.cs 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 0000000000000000000000000000000000000000..14290fde52b410e1af9965e39aecfe1e0e187cd4 GIT binary patch literal 2286 zcmV3&289i^A)gET?cpYPGFb13~H1}QAfVM^OpN9 z=R4mr__{yJ7d^0l|9<<>(9jZ9Rp-TGF?T#3M85FZ z$1sc?PN#D%Z#g272o#>Cazvw1?k2+F@aXXH@P{cQ^a zyB+1_<-e!L`(iO8rK=}|l=J{rJ-r6YmoG=*!Uf354q)NJg~*?u&wVj+7c9o`Xas$s z9@uTxbQ)X{2n5pne*a(F+S+DBL!IenWo6~8>(?S9 z#SN>bfPc_+4Z5a5VHgrd7*4vg=IK?~QvN)0@(bZ`CMjO8_f>M^gR-(R$Nz-Du3ft< zE|=?cs^7ovv&JSovvxg7zE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Cd>I$U}bhYlZRmd3X~ zsQi&rF$LGL4Ak(704sDwSad^g zaCvfRXJ~W)LvL_-a%pF1bRel9GB7YWEiy1MF(64!Lr+puAV+OtNDz)8PXGV_07*qo IM6N<$f(5uj!T + + + + + + + + + + + + + + + + + + + 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 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +