diff --git a/misc/BreCalApi.cs b/misc/BreCalApi.cs index f53e437..d4a06ed 100644 --- a/misc/BreCalApi.cs +++ b/misc/BreCalApi.cs @@ -1,7 +1,7 @@ //---------------------- // -// Generated REST API Client Code Generator v1.8.4.0 on 29.09.2023 14:42:26 +// Generated REST API Client Code Generator v1.8.4.0 on 04.10.2023 07:39:32 // Using the tool OpenAPI Generator v7.0.0 // //---------------------- @@ -51,6 +51,9 @@ using System.Threading.Tasks; */ namespace BreCalClient.misc.Api { + +#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + /// /// Represents a collection of functions to interact with the API endpoints /// @@ -7632,5 +7635,8 @@ namespace BreCalClient.misc.Model yield break; } } + +#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' } + diff --git a/src/BreCalClient/App.config b/src/BreCalClient/App.config index 9b96e2e..0800667 100644 --- a/src/BreCalClient/App.config +++ b/src/BreCalClient/App.config @@ -11,7 +11,7 @@ - https://brecal.bsmd-emswe.eu + https://brecaltest.bsmd-emswe.eu #751D1F diff --git a/src/BreCalClient/BreCalClient.csproj b/src/BreCalClient/BreCalClient.csproj index 3c6b607..024ae43 100644 --- a/src/BreCalClient/BreCalClient.csproj +++ b/src/BreCalClient/BreCalClient.csproj @@ -8,8 +8,8 @@ True BreCalClient.App ..\..\misc\brecal.snk - 0.6.0.0 - 0.6.0.0 + 0.7.0.0 + 0.7.0.0 Bremen calling client A Windows WPF client for the Bremen calling API. containership.ico diff --git a/src/BreCalClient/BreCalLists.cs b/src/BreCalClient/BreCalLists.cs new file mode 100644 index 0000000..c8df918 --- /dev/null +++ b/src/BreCalClient/BreCalLists.cs @@ -0,0 +1,123 @@ +// Copyright (c) 2023 schick Informatik +// Description: Static lists used everywhere +// + +using BreCalClient.misc.Model; +using System.Collections.Concurrent; +using System.Collections.Generic; + + +namespace BreCalClient +{ + public static class BreCalLists + { + + #region Fields + + private static readonly List aList = new(); + private static readonly List mList = new(); + private static readonly List pList = new(); + private static readonly List tList = new(); + private static readonly List terList = new(); + + private static List _berths = new(); + private static List _participants = new(); + private static List _ships = new(); + + private readonly static ConcurrentDictionary _shipLookupDict = new(); + private readonly static ConcurrentDictionary _berthLookupDict = new(); + private readonly static Dictionary _participantLookupDict = new(); + + #endregion + + #region Properties + + public static ConcurrentDictionary ShipLookupDict { get { return _shipLookupDict; } } + + public static ConcurrentDictionary BerthLookupDict { get { return _berthLookupDict; } } + + public static Dictionary ParticipantLookupDict { get { return _participantLookupDict; } } + + /// + /// Participants that are agents + /// + public static List Participants_Agent { get { return aList; } } + + /// + /// Participants that are mooring companies + /// + public static List Participants_Mooring { get { return mList; } } + + /// + /// Participants that are pilots + /// + public static List Participants_Pilot { get { return pList; } } + + /// + /// Participants that are tug shipping companies + /// + public static List Participants_Tug { get { return tList; } } + + /// + /// Participants that are terminals + /// + public static List Participants_Terminal { get { return terList; } } + + /// + /// All participants + /// + public static List Participants { get { return _participants; } } + + /// + /// All berths + /// + public static List Berths { get { return _berths; } } + + /// + /// All ships + /// + public static List Ships { get { return _ships; } } + + #endregion + + #region methods + + internal static void InitializeParticipants(List participants) + { + _participants = participants; + + aList.Clear(); + mList.Clear(); + pList.Clear(); + tList.Clear(); + terList.Clear(); + + foreach (Participant p in participants) + { + _participantLookupDict[p.Id] = p; + if (p.IsTypeFlagSet(Extensions.ParticipantType.AGENCY)) aList.Add(p); + if (p.IsTypeFlagSet(Extensions.ParticipantType.MOORING)) mList.Add(p); + if (p.IsTypeFlagSet(Extensions.ParticipantType.PILOT)) pList.Add(p); + if (p.IsTypeFlagSet(Extensions.ParticipantType.TUG)) tList.Add(p); + if (p.IsTypeFlagSet(Extensions.ParticipantType.TERMINAL)) terList.Add(p); + } + } + + internal static void InitializeBerths(List berths) + { + foreach (var berth in berths) + _berthLookupDict[berth.Id] = berth; + _berths = berths; + } + + internal static void InitializeShips(List ships) + { + foreach (var ship in ships) + _shipLookupDict[ship.Id] = ship; + _ships = ships; + } + + #endregion + + } +} diff --git a/src/BreCalClient/EditShipcallControl.xaml b/src/BreCalClient/EditShipcallControl.xaml index 7138d90..dae9047 100644 --- a/src/BreCalClient/EditShipcallControl.xaml +++ b/src/BreCalClient/EditShipcallControl.xaml @@ -8,7 +8,7 @@ xmlns:db="clr-namespace:BreCalClient;assembly=BreCalClient" xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" mc:Ignorable="d" - Title="{x:Static p:Resources.textEditShipcall}" Height="466" Width="800" Loaded="Window_Loaded" ResizeMode="NoResize" Icon="Resources/containership.ico"> + Title="{x:Static p:Resources.textEditShipcall}" Height="214" Width="800" Loaded="Window_Loaded" ResizeMode="NoResize" Icon="Resources/containership.ico"> @@ -26,135 +26,73 @@ - - - - - - - - -