diff --git a/ENI-2/ENI2/ENI2/DetailRootControl.xaml.cs b/ENI-2/ENI2/ENI2/DetailRootControl.xaml.cs
index d19edd53..fa9d8fd0 100644
--- a/ENI-2/ENI2/ENI2/DetailRootControl.xaml.cs
+++ b/ENI-2/ENI2/ENI2/DetailRootControl.xaml.cs
@@ -678,7 +678,7 @@ namespace ENI2
vViolations.AddRange(violations);
}
- #region 12.11.18: ein paar neue komische globale Plausi-Prüfungen
+ #region 12.11.18 / 6.3.21: globale Plausi-Prüfungen
Message crewMessage = _messages.Find(message => message.MessageNotificationClass == Message.NotificationClass.CREW);
Message pasMessage = _messages.Find(message => message.MessageNotificationClass == Message.NotificationClass.PAS);
Message pobaMessage = _messages.Find(message => message.MessageNotificationClass == Message.NotificationClass.POBA);
@@ -756,6 +756,31 @@ namespace ENI2
#endregion
+ #region last port plausibility SEC vs NOANOD
+
+ if((secMessage.Elements.Count > 0) && (noanodMessage.Elements.Count > 0))
+ {
+ SEC sec = secMessage.Elements[0] as SEC;
+ NOA_NOD noanod = noanodMessage.Elements[0] as NOA_NOD;
+ if(sec.LastTenPortFacilitesCalled.Count > 0)
+ {
+ if(!sec.LastTenPortFacilitesCalled[0].PortFacilityPortLoCode.Equals(noanod.LastPort))
+ {
+ MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "SEC last port doesn't match NOANOD last port", null, "Last port mismatch", null, "SEC");
+ mv.MessageGroupName = Properties.Resources.textOverview;
+ vViolations.Add(mv);
+ }
+ if(sec.LastTenPortFacilitesCalled[0].PortFacilityDateOfDeparture != (noanod.ETDFromLastPort ?? DateTime.Now).Date)
+ {
+ MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "SEC last port departure doesn't match NOANOD ETDFromLastPort", null, "Last port departure mismatch", null, "SEC");
+ mv.MessageGroupName = Properties.Resources.textOverview;
+ vViolations.Add(mv);
+ }
+ }
+ }
+
+ #endregion
+
#endregion
foreach (MessageError me in vErrors)
diff --git a/ENI-2/ENI2/ENI2/DetailViewControls/DangerousGoodsDetailControl.xaml.cs b/ENI-2/ENI2/ENI2/DetailViewControls/DangerousGoodsDetailControl.xaml.cs
index 0f763b38..8fc3e72f 100644
--- a/ENI-2/ENI2/ENI2/DetailViewControls/DangerousGoodsDetailControl.xaml.cs
+++ b/ENI-2/ENI2/ENI2/DetailViewControls/DangerousGoodsDetailControl.xaml.cs
@@ -11,6 +11,8 @@ using System.Windows.Controls;
using System.Windows.Media.Imaging;
using System;
using System.Collections.Generic;
+using System.Windows.Data;
+using System.Collections.Specialized;
namespace ENI2.DetailViewControls
{
@@ -103,15 +105,19 @@ namespace ENI2.DetailViewControls
this.groupBoxHAZ.DataContext = haz;
- this.dataGridIMDGItems.Initialize();
- this.dataGridIMDGItems.ItemsSource = this.haz.IMDGPositions;
+ this.dataGridIMDGItems.Initialize();
+ this.dataGridIMDGItems.ItemsSource = this.haz.IMDGPositions;
+ CollectionView myCollectionView = (CollectionView)CollectionViewSource.GetDefaultView(dataGridIMDGItems.Items);
+ ((INotifyCollectionChanged)myCollectionView).CollectionChanged += DangerousGoodsDetailControl_CollectionChanged;
this.dataGridIMDGItems.CreateRequested += DataGridIMDGItems_CreateRequested;
this.dataGridIMDGItems.AddingNewItem += DataGridIMDGItems_AddingNewItem;
this.dataGridIMDGItems.EditRequested += DataGridIMDGItems_EditRequested;
- this.dataGridIMDGItems.DeleteRequested += DataGridIMDGItems_DeleteRequested;
+ this.dataGridIMDGItems.DeleteRequested += DataGridIMDGItems_DeleteRequested;
this.dataGridIBCItems.Initialize();
this.dataGridIBCItems.ItemsSource = this.haz.IBCPositions;
+ myCollectionView = (CollectionView)CollectionViewSource.GetDefaultView(dataGridIBCItems.Items);
+ ((INotifyCollectionChanged)myCollectionView).CollectionChanged += DangerousGoodsDetailControl_CollectionChanged;
this.dataGridIBCItems.CreateRequested += DataGridIBCItems_CreateRequested;
this.dataGridIBCItems.AddingNewItem += DataGridIBCItems_AddingNewItem;
this.dataGridIBCItems.EditRequested += DataGridIBCItems_EditRequested;
@@ -119,6 +125,8 @@ namespace ENI2.DetailViewControls
this.dataGridIGCItems.Initialize();
this.dataGridIGCItems.ItemsSource = this.haz.IGCPositions;
+ myCollectionView = (CollectionView)CollectionViewSource.GetDefaultView(dataGridIGCItems.Items);
+ ((INotifyCollectionChanged)myCollectionView).CollectionChanged += DangerousGoodsDetailControl_CollectionChanged;
this.dataGridIGCItems.CreateRequested += DataGridIGCItems_CreateRequested;
this.dataGridIGCItems.AddingNewItem += DataGridIGCItems_AddingNewItem;
this.dataGridIGCItems.EditRequested += DataGridIGCItems_EditRequested;
@@ -126,6 +134,8 @@ namespace ENI2.DetailViewControls
this.dataGridIMSBCItems.Initialize();
this.dataGridIMSBCItems.ItemsSource = this.haz.IMSBCPositions;
+ myCollectionView = (CollectionView)CollectionViewSource.GetDefaultView(dataGridIMSBCItems.Items);
+ ((INotifyCollectionChanged)myCollectionView).CollectionChanged += DangerousGoodsDetailControl_CollectionChanged;
this.dataGridIMSBCItems.CreateRequested += DataGridIMSBCItems_CreateRequested;
this.dataGridIMSBCItems.AddingNewItem += DataGridIMSBCItems_AddingNewItem;
this.dataGridIMSBCItems.EditRequested += DataGridIMSBCItems_EditRequested;
@@ -133,11 +143,15 @@ namespace ENI2.DetailViewControls
this.dataGridMARPOLItems.Initialize();
this.dataGridMARPOLItems.ItemsSource = this.haz.MARPOLPositions;
+ myCollectionView = (CollectionView)CollectionViewSource.GetDefaultView(dataGridMARPOLItems.Items);
+ ((INotifyCollectionChanged)myCollectionView).CollectionChanged += DangerousGoodsDetailControl_CollectionChanged;
this.dataGridMARPOLItems.CreateRequested += DataGridMARPOLItems_CreateRequested;
this.dataGridMARPOLItems.AddingNewItem += DataGridMARPOLItems_AddingNewItem;
this.dataGridMARPOLItems.EditRequested += DataGridMARPOLItems_EditRequested;
this.dataGridMARPOLItems.DeleteRequested += DataGridMARPOLItems_DeleteRequested;
+ this.RefreshTabHeaders();
+
#endregion
if (!this.haz.IsDeparture)
@@ -184,7 +198,7 @@ namespace ENI2.DetailViewControls
}
this._initialized = true;
- }
+ }
#region SetEnabled
@@ -747,7 +761,40 @@ namespace ENI2.DetailViewControls
HighlightService.HighlightControl(this.groupBoxHAZ, HighlightService.HighlightStyle.VIOLATION, this._hazMessage);
}
- #endregion
+ #endregion
+
+ private void DangerousGoodsDetailControl_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
+ {
+ this.RefreshTabHeaders();
+ }
+
+ private void RefreshTabHeaders()
+ {
+ if (this.haz.IMDGPositions.Count > 0)
+ this.tabIMDGItems.Header = string.Format("{0} ({1})", Properties.Resources.textIMDGItems, this.haz.IMDGPositions.Count);
+ else
+ this.tabIMDGItems.Header = Properties.Resources.textIMDGItems;
+
+ if (this.haz.IBCPositions.Count > 0)
+ this.tabIBCItems.Header = string.Format("{0} ({1})", Properties.Resources.textIBCItems, this.haz.IBCPositions.Count);
+ else
+ this.tabIBCItems.Header = Properties.Resources.textIBCItems;
+
+ if (this.haz.IGCPositions.Count > 0)
+ this.tabIGCItems.Header = string.Format("{0} ({1})", Properties.Resources.textIGCItems, this.haz.IGCPositions.Count);
+ else
+ this.tabIGCItems.Header = Properties.Resources.textIGCItems;
+
+ if (this.haz.IMSBCPositions.Count > 0)
+ this.tabIMSBCItems.Header = string.Format("{0} ({1})", Properties.Resources.textIMSBCItems, this.haz.IMSBCPositions.Count);
+ else
+ this.tabIMSBCItems.Header = Properties.Resources.textIMSBCItems;
+
+ if (this.haz.MARPOLPositions.Count > 0)
+ this.tabMarpolItems.Header = string.Format("{0} ({1})", Properties.Resources.textMARPOLItems, this.haz.MARPOLPositions.Count);
+ else
+ this.tabMarpolItems.Header = Properties.Resources.textMARPOLItems;
+ }
}
}
diff --git a/ENI-2/ENI2/ENI2/ENI2.csproj b/ENI-2/ENI2/ENI2/ENI2.csproj
index d587894e..8e238984 100644
--- a/ENI-2/ENI2/ENI2/ENI2.csproj
+++ b/ENI-2/ENI2/ENI2/ENI2.csproj
@@ -35,7 +35,7 @@
true
publish.html
0
- 6.0.12.%2a
+ 6.0.13.%2a
false
true
true
diff --git a/ENI-2/ENI2/ENI2/SucheControl.xaml b/ENI-2/ENI2/ENI2/SucheControl.xaml
index c5d27073..b5f362ac 100644
--- a/ENI-2/ENI2/ENI2/SucheControl.xaml
+++ b/ENI-2/ENI2/ENI2/SucheControl.xaml
@@ -54,10 +54,16 @@
-
-
-
-
+
+
+
+
+
+
+
+
+
+
500)))
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Length valid?", null, this.Title, null, this.Tablename));
- if (this.Beam_MTR.HasValue && ((this.Beam_MTR.Value < 5) || (this.Beam_MTR.Value > 50)))
+ if (this.Beam_MTR.HasValue && ((this.Beam_MTR.Value < 5) || (this.Beam_MTR.Value > 65)))
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Beam valid?", null, this.Title, null, this.Tablename));
if (this.GrossTonnage.HasValue && ((this.GrossTonnage.Value < 50) || (this.GrossTonnage > 500000)))
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Gross tonnage valid?", null, this.Title, null, this.Tablename));
diff --git a/nsw/Source/bsmd.database/WAS.cs b/nsw/Source/bsmd.database/WAS.cs
index 3bae4adb..51483f7b 100644
--- a/nsw/Source/bsmd.database/WAS.cs
+++ b/nsw/Source/bsmd.database/WAS.cs
@@ -371,6 +371,7 @@ namespace bsmd.database
bool entryMissing = false;
int missingType = 0;
+
foreach(int wasteCode in RequiredCodes)
{
bool codeFound = false;
@@ -379,7 +380,7 @@ namespace bsmd.database
if((w.WasteType ?? 0) == wasteCode)
{
codeFound = true; break;
- }
+ }
}
if(!codeFound)
{
@@ -389,6 +390,49 @@ namespace bsmd.database
}
}
+ // Extravalidierung für "0" Meldung (5.3.21)
+ double totalSludgeRetained = 0;
+ double totalWDALP = 0;
+ double totalWC = 0;
+ double totalWAR = 0;
+ double totalWAGTNP = 0;
+ double totalWDA = 0;
+
+ foreach(Waste w in this.Waste)
+ {
+ if (w.WasteType == 1100) totalSludgeRetained += w.WasteAmountRetained_MTQ ?? 0;
+ if (w.WasteType == 1300) totalSludgeRetained += w.WasteAmountRetained_MTQ ?? 0;
+ totalWDALP += w.WasteDisposedAtLastPort_MTQ ?? 0;
+ totalWC += w.WasteCapacity_MTQ ?? 0;
+ totalWAR += w.WasteAmountRetained_MTQ ?? 0;
+ totalWAGTNP += w.WasteAmountGeneratedTillNextPort_MTQ ?? 0;
+ totalWDA += w.WasteDisposalAmount_MTQ ?? 0;
+ }
+ if(totalSludgeRetained == 0)
+ {
+ violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Waste amount retained on board for types 1100 'sludge' and 1300 'oil-others' = 0", null, this.Title, null, this.Tablename));
+ }
+ if(totalWDALP == 0)
+ {
+ violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Total waste is 0 for WasteDisposedAtLastPort for all waste types", null, this.Title, null, this.Tablename));
+ }
+ if(totalWC == 0)
+ {
+ violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Total waste is 0 for WasteCapacity for all waste types", null, this.Title, null, this.Tablename));
+ }
+ if(totalWAR == 0)
+ {
+ violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Total waste is 0 for WasteAmountRetained for all waste types", null, this.Title, null, this.Tablename));
+ }
+ if(totalWAGTNP == 0)
+ {
+ violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Total waste is 0 for WasteAmountGeneratedTillNextPort for all waste types", null, this.Title, null, this.Tablename));
+ }
+ if((totalWDA == 0) && !(WasteDisposalDelivery.HasValue && (WasteDisposalDelivery.Value == 2)))
+ {
+ violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Total waste is 0 for WasteDisposalDelivery for all waste types", null, this.Title, null, this.Tablename));
+ }
+
if(entryMissing)
{
errors.Add(RuleEngine.CreateError(ValidationCode.POSITION_COUNT, string.Format("Waste {0}", missingType), null, this.Title, null, this.Tablename));