From 5ad5d3f70e581dc720518c5d26043ad56b88587e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn?= Date: Thu, 28 Nov 2024 23:52:50 +0100 Subject: [PATCH 01/19] Initial commit - Project setup and basic definitions - Waiting for SDK update --- .../Speckle.Connectors.CSiShared.projitems | 3 + .../CSiConversionSettings.cs | 3 + .../GlobalUsing.cs | 1 + .../Speckle.Converters.CSiShared.projitems | 21 ++ .../Speckle.Converters.CSiShared.shproj | 13 + .../ToSpeckle/Raw/AreaToSpeckleConverter.cs | 3 + .../ToSpeckle/Raw/FrameToSpeckleConverter.cs | 3 + .../ToSpeckle/Raw/LinkToSpeckleConverter.cs | 3 + .../ToSpeckle/Raw/PointToSpeckleConverter.cs | 3 + .../ToSpeckle/Raw/TendonToSpeckleConverter.cs | 3 + .../TopLevel/CSiObjectToSpeckleConverter.cs | 42 +++ .../Speckle.Converters.ETABS21.csproj | 19 ++ .../packages.lock.json | 321 ++++++++++++++++++ .../Speckle.Converters.ETABS22.csproj | 19 ++ .../packages.lock.json | 276 +++++++++++++++ Speckle.Connectors.sln | 23 +- 16 files changed, 755 insertions(+), 1 deletion(-) create mode 100644 Converters/CSi/Speckle.Converters.CSiShared/CSiConversionSettings.cs create mode 100644 Converters/CSi/Speckle.Converters.CSiShared/GlobalUsing.cs create mode 100644 Converters/CSi/Speckle.Converters.CSiShared/Speckle.Converters.CSiShared.projitems create mode 100644 Converters/CSi/Speckle.Converters.CSiShared/Speckle.Converters.CSiShared.shproj create mode 100644 Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/AreaToSpeckleConverter.cs create mode 100644 Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/FrameToSpeckleConverter.cs create mode 100644 Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/LinkToSpeckleConverter.cs create mode 100644 Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/PointToSpeckleConverter.cs create mode 100644 Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/TendonToSpeckleConverter.cs create mode 100644 Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/TopLevel/CSiObjectToSpeckleConverter.cs create mode 100644 Converters/CSi/Speckle.Converters.ETABS21/Speckle.Converters.ETABS21.csproj create mode 100644 Converters/CSi/Speckle.Converters.ETABS21/packages.lock.json create mode 100644 Converters/CSi/Speckle.Converters.ETABS22/Speckle.Converters.ETABS22.csproj create mode 100644 Converters/CSi/Speckle.Converters.ETABS22/packages.lock.json diff --git a/Connectors/CSi/Speckle.Connectors.CSiShared/Speckle.Connectors.CSiShared.projitems b/Connectors/CSi/Speckle.Connectors.CSiShared/Speckle.Connectors.CSiShared.projitems index 846da425e..79e3b2fa7 100644 --- a/Connectors/CSi/Speckle.Connectors.CSiShared/Speckle.Connectors.CSiShared.projitems +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/Speckle.Connectors.CSiShared.projitems @@ -23,4 +23,7 @@ + + + diff --git a/Converters/CSi/Speckle.Converters.CSiShared/CSiConversionSettings.cs b/Converters/CSi/Speckle.Converters.CSiShared/CSiConversionSettings.cs new file mode 100644 index 000000000..1fb310342 --- /dev/null +++ b/Converters/CSi/Speckle.Converters.CSiShared/CSiConversionSettings.cs @@ -0,0 +1,3 @@ +namespace Speckle.Converters.CSiShared; + +public record CSiConversionSettings(cSapModel SapModel, string SpeckleUnits); diff --git a/Converters/CSi/Speckle.Converters.CSiShared/GlobalUsing.cs b/Converters/CSi/Speckle.Converters.CSiShared/GlobalUsing.cs new file mode 100644 index 000000000..2209f341b --- /dev/null +++ b/Converters/CSi/Speckle.Converters.CSiShared/GlobalUsing.cs @@ -0,0 +1 @@ +global using CSiAPIv1; diff --git a/Converters/CSi/Speckle.Converters.CSiShared/Speckle.Converters.CSiShared.projitems b/Converters/CSi/Speckle.Converters.CSiShared/Speckle.Converters.CSiShared.projitems new file mode 100644 index 000000000..ba3ccd655 --- /dev/null +++ b/Converters/CSi/Speckle.Converters.CSiShared/Speckle.Converters.CSiShared.projitems @@ -0,0 +1,21 @@ + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + true + 1b5c5fb2-3b22-4371-9aa5-3edf3b4d62de + + + Speckle.Converters.CSiShared + + + + + + + + + + + + diff --git a/Converters/CSi/Speckle.Converters.CSiShared/Speckle.Converters.CSiShared.shproj b/Converters/CSi/Speckle.Converters.CSiShared/Speckle.Converters.CSiShared.shproj new file mode 100644 index 000000000..2de5c6157 --- /dev/null +++ b/Converters/CSi/Speckle.Converters.CSiShared/Speckle.Converters.CSiShared.shproj @@ -0,0 +1,13 @@ + + + + 1b5c5fb2-3b22-4371-9aa5-3edf3b4d62de + 14.0 + + + + + + + + diff --git a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/AreaToSpeckleConverter.cs b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/AreaToSpeckleConverter.cs new file mode 100644 index 000000000..f7e709c47 --- /dev/null +++ b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/AreaToSpeckleConverter.cs @@ -0,0 +1,3 @@ +namespace Speckle.Converters.CSiShared.ToSpeckle.Raw; + +public class AreaToSpeckleConverter { } diff --git a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/FrameToSpeckleConverter.cs b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/FrameToSpeckleConverter.cs new file mode 100644 index 000000000..80c9a5851 --- /dev/null +++ b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/FrameToSpeckleConverter.cs @@ -0,0 +1,3 @@ +namespace Speckle.Converters.CSiShared.ToSpeckle.Raw; + +public class FrameToSpeckleConverter { } diff --git a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/LinkToSpeckleConverter.cs b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/LinkToSpeckleConverter.cs new file mode 100644 index 000000000..64efd158a --- /dev/null +++ b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/LinkToSpeckleConverter.cs @@ -0,0 +1,3 @@ +namespace Speckle.Converters.CSiShared.ToSpeckle.Raw; + +public class LinkToSpeckleConverter { } diff --git a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/PointToSpeckleConverter.cs b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/PointToSpeckleConverter.cs new file mode 100644 index 000000000..9949acd89 --- /dev/null +++ b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/PointToSpeckleConverter.cs @@ -0,0 +1,3 @@ +namespace Speckle.Converters.CSiShared.ToSpeckle.Raw; + +public class PointToSpeckleConverter { } diff --git a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/TendonToSpeckleConverter.cs b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/TendonToSpeckleConverter.cs new file mode 100644 index 000000000..ca35ef762 --- /dev/null +++ b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/TendonToSpeckleConverter.cs @@ -0,0 +1,3 @@ +namespace Speckle.Converters.CSiShared.ToSpeckle.Raw; + +public class TendonToSpeckleConverter { } diff --git a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/TopLevel/CSiObjectToSpeckleConverter.cs b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/TopLevel/CSiObjectToSpeckleConverter.cs new file mode 100644 index 000000000..1bf935923 --- /dev/null +++ b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/TopLevel/CSiObjectToSpeckleConverter.cs @@ -0,0 +1,42 @@ +using Speckle.Converters.Common; +using Speckle.Converters.Common.Objects; +using Speckle.Objects.Data; // This will come +using Speckle.Sdk.Models; + +namespace Speckle.Converters.CSiShared.ToSpeckle.TopLevel; + +[NameAndRankValue(nameof(ICSiObject), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +public class CSiObjectToSpeckleConverter : IToSpeckleTopLevelConverter +{ + private readonly IConverterSettingsStore _settingsStore; + + public CSiObjectToSpeckleConverter(IConverterSettingsStore settingsStore) + { + _settingsStore = settingsStore; + } + + public Base Convert(object target) + { + if (target is not ICSiObject csiObject) + { + throw new ArgumentException($"Target object is not a CSi object. It's a {target.GetType()}"); + } + + var result = new CSiObject // This should be coming from sdk + { + type = target.GetType().ToString().Split('.').Last(), + units = _settingsStore.Current.SpeckleUnits, + name = csiObject.name, + displayValue = new List() + }; + + // Get properties (material, section, etc.) + // _propertyExtractor, ObjectPropertyExtractor or similar in a Helpers folder? + + // Get display value (geometry) + // _displayValueExtractor DisplayValueExtractor or SpatialDataExtractor or GeometricDataExtractor in a Helpers folder + + + return result; + } +} diff --git a/Converters/CSi/Speckle.Converters.ETABS21/Speckle.Converters.ETABS21.csproj b/Converters/CSi/Speckle.Converters.ETABS21/Speckle.Converters.ETABS21.csproj new file mode 100644 index 000000000..7803e3924 --- /dev/null +++ b/Converters/CSi/Speckle.Converters.ETABS21/Speckle.Converters.ETABS21.csproj @@ -0,0 +1,19 @@ + + + + net48 + enable + enable + + + + + + + + + + + + + diff --git a/Converters/CSi/Speckle.Converters.ETABS21/packages.lock.json b/Converters/CSi/Speckle.Converters.ETABS21/packages.lock.json new file mode 100644 index 000000000..329c43488 --- /dev/null +++ b/Converters/CSi/Speckle.Converters.ETABS21/packages.lock.json @@ -0,0 +1,321 @@ +{ + "version": 2, + "dependencies": { + ".NETFramework,Version=v4.8": { + "Microsoft.NETFramework.ReferenceAssemblies": { + "type": "Direct", + "requested": "[1.0.3, )", + "resolved": "1.0.3", + "contentHash": "vUc9Npcs14QsyOD01tnv/m8sQUnGTGOw1BCmKcv77LBJY7OxhJ+zJF7UD/sCL3lYNFuqmQEVlkfS4Quif6FyYg==", + "dependencies": { + "Microsoft.NETFramework.ReferenceAssemblies.net48": "1.0.3" + } + }, + "Microsoft.SourceLink.GitHub": { + "type": "Direct", + "requested": "[8.0.0, )", + "resolved": "8.0.0", + "contentHash": "G5q7OqtwIyGTkeIOAc3u2ZuV/kicQaec5EaRnc0pIeSnh9LUjj+PYQrJYBURvDt7twGl2PKA7nSN0kz1Zw5bnQ==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "8.0.0", + "Microsoft.SourceLink.Common": "8.0.0" + } + }, + "PolySharp": { + "type": "Direct", + "requested": "[1.14.1, )", + "resolved": "1.14.1", + "contentHash": "mOOmFYwad3MIOL14VCjj02LljyF1GNw1wP0YVlxtcPvqdxjGGMNdNJJxHptlry3MOd8b40Flm8RPOM8JOlN2sQ==" + }, + "Speckle.CSI.API": { + "type": "Direct", + "requested": "[1.30.0, )", + "resolved": "1.30.0", + "contentHash": "4S5Udr+YDU43YgB+TXgnPtGioRj1hDnucHlr42ikr72h1yQwzmkC2HwWJibjZD+sOrAke67q1N8geIqJj9Ss4Q==" + }, + "Speckle.InterfaceGenerator": { + "type": "Direct", + "requested": "[0.9.6, )", + "resolved": "0.9.6", + "contentHash": "HKH7tYrYYlCK1ct483hgxERAdVdMtl7gUKW9ijWXxA1UsYR4Z+TrRHYmzZ9qmpu1NnTycSrp005NYM78GDKV1w==" + }, + "GraphQL.Client": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "8yPNBbuVBpTptivyAlak4GZvbwbUcjeQTL4vN1HKHRuOykZ4r7l5fcLS6vpyPyLn0x8FsL31xbOIKyxbmR9rbA==", + "dependencies": { + "GraphQL.Client.Abstractions": "6.0.0", + "GraphQL.Client.Abstractions.Websocket": "6.0.0", + "System.Net.WebSockets.Client.Managed": "1.0.22", + "System.Reactive": "5.0.0" + } + }, + "GraphQL.Client.Abstractions": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "h7uzWFORHZ+CCjwr/ThAyXMr0DPpzEANDa4Uo54wqCQ+j7qUKwqYTgOrb1W40sqbvNaZm9v/X7It31SUw0maHA==", + "dependencies": { + "GraphQL.Primitives": "6.0.0" + } + }, + "GraphQL.Client.Abstractions.Websocket": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "Nr9bPf8gIOvLuXpqEpqr9z9jslYFJOvd0feHth3/kPqeR3uMbjF5pjiwh4jxyMcxHdr8Pb6QiXkV3hsSyt0v7A==", + "dependencies": { + "GraphQL.Client.Abstractions": "6.0.0" + } + }, + "GraphQL.Primitives": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "yg72rrYDapfsIUrul7aF6wwNnTJBOFvuA9VdDTQpPa8AlAriHbufeXYLBcodKjfUdkCnaiggX1U/nEP08Zb5GA==" + }, + "Microsoft.Bcl.AsyncInterfaces": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "W8DPQjkMScOMTtJbPwmPyj9c3zYSFGawDW3jwlBOOsnY+EzZFLgNQ/UMkK35JmkNOVPdCyPr2Tw7Vv9N+KA3ZQ==", + "dependencies": { + "System.Threading.Tasks.Extensions": "4.5.4" + } + }, + "Microsoft.Build.Tasks.Git": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ==" + }, + "Microsoft.CSharp": { + "type": "Transitive", + "resolved": "4.7.0", + "contentHash": "pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA==" + }, + "Microsoft.Data.Sqlite": { + "type": "Transitive", + "resolved": "7.0.5", + "contentHash": "KGxbPeWsQMnmQy43DSBxAFtHz3l2JX8EWBSGUCvT3CuZ8KsuzbkqMIJMDOxWtG8eZSoCDI04aiVQjWuuV8HmSw==", + "dependencies": { + "Microsoft.Data.Sqlite.Core": "7.0.5", + "SQLitePCLRaw.bundle_e_sqlite3": "2.1.4" + } + }, + "Microsoft.Data.Sqlite.Core": { + "type": "Transitive", + "resolved": "7.0.5", + "contentHash": "FTerRmQPqHrCrnoUzhBu+E+1DNGwyrAMLqHkAqOOOu5pGfyMOj8qQUBxI/gDtWtG11p49UxSfWmBzRNlwZqfUg==", + "dependencies": { + "SQLitePCLRaw.core": "2.1.4" + } + }, + "Microsoft.Extensions.Configuration": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "nOP8R1mVb/6mZtm2qgAJXn/LFm/2kMjHDAg/QJLFG6CuWYJtaD3p1BwQhufBVvRzL9ceJ/xF0SQ0qsI2GkDQAA==", + "dependencies": { + "Microsoft.Extensions.Configuration.Abstractions": "2.2.0" + } + }, + "Microsoft.Extensions.Configuration.Abstractions": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "65MrmXCziWaQFrI0UHkQbesrX5wTwf9XPjY5yFm/VkgJKFJ5gqvXRoXjIZcf2wLi5ZlwGz/oMYfyURVCWbM5iw==", + "dependencies": { + "Microsoft.Extensions.Primitives": "2.2.0" + } + }, + "Microsoft.Extensions.Configuration.Binder": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "vJ9xvOZCnUAIHcGC3SU35r3HKmHTVIeHzo6u/qzlHAqD8m6xv92MLin4oJntTvkpKxVX3vI1GFFkIQtU3AdlsQ==", + "dependencies": { + "Microsoft.Extensions.Configuration": "2.2.0" + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "f9hstgjVmr6rmrfGSpfsVOl2irKAgr1QjrSi3FgnS7kulxband50f2brRLwySAQTADPZeTdow0mpSMcoAdadCw==" + }, + "Microsoft.Extensions.Options": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "UpZLNLBpIZ0GTebShui7xXYh6DmBHjWM8NxGxZbdQh/bPZ5e6YswqI+bru6BnEL5eWiOdodsXtEz3FROcgi/qg==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Primitives": "2.2.0", + "System.ComponentModel.Annotations": "4.5.0" + } + }, + "Microsoft.Extensions.Primitives": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "azyQtqbm4fSaDzZHD/J+V6oWMFaf2tWP4WEGIYePLCMw3+b2RQdj9ybgbQyjCshcitQKQ4lEDOZjmSlTTrHxUg==", + "dependencies": { + "System.Memory": "4.5.1", + "System.Runtime.CompilerServices.Unsafe": "4.5.1" + } + }, + "Microsoft.NETFramework.ReferenceAssemblies.net48": { + "type": "Transitive", + "resolved": "1.0.3", + "contentHash": "zMk4D+9zyiEWByyQ7oPImPN/Jhpj166Ky0Nlla4eXlNL8hI/BtSJsgR8Inldd4NNpIAH3oh8yym0W2DrhXdSLQ==" + }, + "Microsoft.SourceLink.Common": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw==" + }, + "Speckle.DoubleNumerics": { + "type": "Transitive", + "resolved": "4.0.1", + "contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w==" + }, + "Speckle.Newtonsoft.Json": { + "type": "Transitive", + "resolved": "13.0.2", + "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" + }, + "SQLitePCLRaw.bundle_e_sqlite3": { + "type": "Transitive", + "resolved": "2.1.4", + "contentHash": "EWI1olKDjFEBMJu0+3wuxwziIAdWDVMYLhuZ3Qs84rrz+DHwD00RzWPZCa+bLnHCf3oJwuFZIRsHT5p236QXww==", + "dependencies": { + "SQLitePCLRaw.lib.e_sqlite3": "2.1.4", + "SQLitePCLRaw.provider.dynamic_cdecl": "2.1.4" + } + }, + "SQLitePCLRaw.core": { + "type": "Transitive", + "resolved": "2.1.4", + "contentHash": "inBjvSHo9UDKneGNzfUfDjK08JzlcIhn1+SP5Y3m6cgXpCxXKCJDy6Mka7LpgSV+UZmKSnC8rTwB0SQ0xKu5pA==", + "dependencies": { + "System.Memory": "4.5.3" + } + }, + "SQLitePCLRaw.lib.e_sqlite3": { + "type": "Transitive", + "resolved": "2.1.4", + "contentHash": "2C9Q9eX7CPLveJA0rIhf9RXAvu+7nWZu1A2MdG6SD/NOu26TakGgL1nsbc0JAspGijFOo3HoN79xrx8a368fBg==" + }, + "SQLitePCLRaw.provider.dynamic_cdecl": { + "type": "Transitive", + "resolved": "2.1.4", + "contentHash": "ZsaKKhgYF9B1fvcnOGKl3EycNAwd9CRWX7v0rEfuPWhQQ5Jjpvf2VEHahiLIGHio3hxi3EIKFJw9KvyowWOUAw==", + "dependencies": { + "SQLitePCLRaw.core": "2.1.4" + } + }, + "System.Buffers": { + "type": "Transitive", + "resolved": "4.4.0", + "contentHash": "AwarXzzoDwX6BgrhjoJsk6tUezZEozOT5Y9QKF94Gl4JK91I4PIIBkBco9068Y9/Dra8Dkbie99kXB8+1BaYKw==" + }, + "System.ComponentModel.Annotations": { + "type": "Transitive", + "resolved": "4.5.0", + "contentHash": "UxYQ3FGUOtzJ7LfSdnYSFd7+oEv6M8NgUatatIN2HxNtDdlcvFAf+VIq4Of9cDMJEJC0aSRv/x898RYhB4Yppg==" + }, + "System.Memory": { + "type": "Transitive", + "resolved": "4.5.3", + "contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==", + "dependencies": { + "System.Buffers": "4.4.0", + "System.Numerics.Vectors": "4.4.0", + "System.Runtime.CompilerServices.Unsafe": "4.5.2" + } + }, + "System.Net.WebSockets.Client.Managed": { + "type": "Transitive", + "resolved": "1.0.22", + "contentHash": "WqEOxPlXjuZrIjUtXNE9NxEfU/n5E35iV2PtoZdJSUC4tlrqwHnTee+wvMIM4OUaJWmwrymeqcgYrE0IkGAgLA==", + "dependencies": { + "System.Buffers": "4.4.0", + "System.Numerics.Vectors": "4.4.0" + } + }, + "System.Numerics.Vectors": { + "type": "Transitive", + "resolved": "4.4.0", + "contentHash": "UiLzLW+Lw6HLed1Hcg+8jSRttrbuXv7DANVj0DkL9g6EnnzbL75EB7EWsw5uRbhxd/4YdG8li5XizGWepmG3PQ==" + }, + "System.Reactive": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "erBZjkQHWL9jpasCE/0qKAryzVBJFxGHVBAvgRN1bzM0q2s1S4oYREEEL0Vb+1kA/6BKb5FjUZMp5VXmy+gzkQ==", + "dependencies": { + "System.Threading.Tasks.Extensions": "4.5.4" + } + }, + "System.Runtime.CompilerServices.Unsafe": { + "type": "Transitive", + "resolved": "4.5.3", + "contentHash": "3TIsJhD1EiiT0w2CcDMN/iSSwnNnsrnbzeVHSKkaEgV85txMprmuO+Yq2AdSbeVGcg28pdNDTPK87tJhX7VFHw==" + }, + "System.Threading.Tasks.Extensions": { + "type": "Transitive", + "resolved": "4.5.4", + "contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "4.5.3" + } + }, + "speckle.converters.common": { + "type": "Project", + "dependencies": { + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Objects": "[3.1.0-dev.200, )" + } + }, + "Microsoft.Extensions.Logging": { + "type": "CentralTransitive", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "Nxqhadc9FCmFHzU+fz3oc8sFlE6IadViYg8dfUdGzJZ2JUxnCsRghBhhOWdM4B2zSZqEc+0BjliBh/oNdRZuig==", + "dependencies": { + "Microsoft.Extensions.Configuration.Binder": "2.2.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging.Abstractions": "2.2.0", + "Microsoft.Extensions.Options": "2.2.0" + } + }, + "Microsoft.Extensions.Logging.Abstractions": { + "type": "CentralTransitive", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A==" + }, + "Speckle.Objects": { + "type": "CentralTransitive", + "requested": "[3.1.0-dev.200, )", + "resolved": "3.1.0-dev.200", + "contentHash": "n4O+XvMBTsl2gOjZmMeE1Kvo1DOxDLuBcUR7GQw8G0LPv+ce+JFSNaFnmyz/w4X32X2bHmbSImuMRr6U7K4dUQ==", + "dependencies": { + "Speckle.Sdk": "3.1.0-dev.200" + } + }, + "Speckle.Sdk": { + "type": "CentralTransitive", + "requested": "[3.1.0-dev.200, )", + "resolved": "3.1.0-dev.200", + "contentHash": "iRdDkEFDu8taJmzMs6RK/HiUZMeESNKfovb3U2a3yO3wEElNfpqPGXJr3GKcjjPZ+LwENgNO3/aemGzx8+TXQw==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.Bcl.AsyncInterfaces": "5.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.5", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging": "2.2.0", + "Speckle.DoubleNumerics": "4.0.1", + "Speckle.Newtonsoft.Json": "13.0.2", + "Speckle.Sdk.Dependencies": "3.1.0-dev.200" + } + }, + "Speckle.Sdk.Dependencies": { + "type": "CentralTransitive", + "requested": "[3.1.0-dev.200, )", + "resolved": "3.1.0-dev.200", + "contentHash": "4ZHkKRzI6/Xa1c20NrH3+e+m5DUB+qbBSq+GJ6MShUh6SpKOC4DRdwy0qCcAWrurq7V94xU0qN+7+QzKGeWlFw==" + } + } + } +} \ No newline at end of file diff --git a/Converters/CSi/Speckle.Converters.ETABS22/Speckle.Converters.ETABS22.csproj b/Converters/CSi/Speckle.Converters.ETABS22/Speckle.Converters.ETABS22.csproj new file mode 100644 index 000000000..20610d5ca --- /dev/null +++ b/Converters/CSi/Speckle.Converters.ETABS22/Speckle.Converters.ETABS22.csproj @@ -0,0 +1,19 @@ + + + + net8.0-windows + enable + enable + + + + + + + + + + + + + diff --git a/Converters/CSi/Speckle.Converters.ETABS22/packages.lock.json b/Converters/CSi/Speckle.Converters.ETABS22/packages.lock.json new file mode 100644 index 000000000..b11eaff34 --- /dev/null +++ b/Converters/CSi/Speckle.Converters.ETABS22/packages.lock.json @@ -0,0 +1,276 @@ +{ + "version": 2, + "dependencies": { + "net8.0-windows7.0": { + "Microsoft.NETFramework.ReferenceAssemblies": { + "type": "Direct", + "requested": "[1.0.3, )", + "resolved": "1.0.3", + "contentHash": "vUc9Npcs14QsyOD01tnv/m8sQUnGTGOw1BCmKcv77LBJY7OxhJ+zJF7UD/sCL3lYNFuqmQEVlkfS4Quif6FyYg==", + "dependencies": { + "Microsoft.NETFramework.ReferenceAssemblies.net461": "1.0.3" + } + }, + "Microsoft.SourceLink.GitHub": { + "type": "Direct", + "requested": "[8.0.0, )", + "resolved": "8.0.0", + "contentHash": "G5q7OqtwIyGTkeIOAc3u2ZuV/kicQaec5EaRnc0pIeSnh9LUjj+PYQrJYBURvDt7twGl2PKA7nSN0kz1Zw5bnQ==", + "dependencies": { + "Microsoft.Build.Tasks.Git": "8.0.0", + "Microsoft.SourceLink.Common": "8.0.0" + } + }, + "PolySharp": { + "type": "Direct", + "requested": "[1.14.1, )", + "resolved": "1.14.1", + "contentHash": "mOOmFYwad3MIOL14VCjj02LljyF1GNw1wP0YVlxtcPvqdxjGGMNdNJJxHptlry3MOd8b40Flm8RPOM8JOlN2sQ==" + }, + "Speckle.CSI.API": { + "type": "Direct", + "requested": "[2.4.0, )", + "resolved": "2.4.0", + "contentHash": "/n3qIBeamiYlWm77/2+dDPYExm/MoDEtnu5IPB2G9Dei06wMgkdBefaSDKWnh3u4iuyha6TvrBZgVGosUylRDg==" + }, + "Speckle.InterfaceGenerator": { + "type": "Direct", + "requested": "[0.9.6, )", + "resolved": "0.9.6", + "contentHash": "HKH7tYrYYlCK1ct483hgxERAdVdMtl7gUKW9ijWXxA1UsYR4Z+TrRHYmzZ9qmpu1NnTycSrp005NYM78GDKV1w==" + }, + "GraphQL.Client": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "8yPNBbuVBpTptivyAlak4GZvbwbUcjeQTL4vN1HKHRuOykZ4r7l5fcLS6vpyPyLn0x8FsL31xbOIKyxbmR9rbA==", + "dependencies": { + "GraphQL.Client.Abstractions": "6.0.0", + "GraphQL.Client.Abstractions.Websocket": "6.0.0", + "System.Reactive": "5.0.0" + } + }, + "GraphQL.Client.Abstractions": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "h7uzWFORHZ+CCjwr/ThAyXMr0DPpzEANDa4Uo54wqCQ+j7qUKwqYTgOrb1W40sqbvNaZm9v/X7It31SUw0maHA==", + "dependencies": { + "GraphQL.Primitives": "6.0.0" + } + }, + "GraphQL.Client.Abstractions.Websocket": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "Nr9bPf8gIOvLuXpqEpqr9z9jslYFJOvd0feHth3/kPqeR3uMbjF5pjiwh4jxyMcxHdr8Pb6QiXkV3hsSyt0v7A==", + "dependencies": { + "GraphQL.Client.Abstractions": "6.0.0" + } + }, + "GraphQL.Primitives": { + "type": "Transitive", + "resolved": "6.0.0", + "contentHash": "yg72rrYDapfsIUrul7aF6wwNnTJBOFvuA9VdDTQpPa8AlAriHbufeXYLBcodKjfUdkCnaiggX1U/nEP08Zb5GA==" + }, + "Microsoft.Build.Tasks.Git": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ==" + }, + "Microsoft.CSharp": { + "type": "Transitive", + "resolved": "4.7.0", + "contentHash": "pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA==" + }, + "Microsoft.Data.Sqlite": { + "type": "Transitive", + "resolved": "7.0.5", + "contentHash": "KGxbPeWsQMnmQy43DSBxAFtHz3l2JX8EWBSGUCvT3CuZ8KsuzbkqMIJMDOxWtG8eZSoCDI04aiVQjWuuV8HmSw==", + "dependencies": { + "Microsoft.Data.Sqlite.Core": "7.0.5", + "SQLitePCLRaw.bundle_e_sqlite3": "2.1.4" + } + }, + "Microsoft.Data.Sqlite.Core": { + "type": "Transitive", + "resolved": "7.0.5", + "contentHash": "FTerRmQPqHrCrnoUzhBu+E+1DNGwyrAMLqHkAqOOOu5pGfyMOj8qQUBxI/gDtWtG11p49UxSfWmBzRNlwZqfUg==", + "dependencies": { + "SQLitePCLRaw.core": "2.1.4" + } + }, + "Microsoft.Extensions.Configuration": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "nOP8R1mVb/6mZtm2qgAJXn/LFm/2kMjHDAg/QJLFG6CuWYJtaD3p1BwQhufBVvRzL9ceJ/xF0SQ0qsI2GkDQAA==", + "dependencies": { + "Microsoft.Extensions.Configuration.Abstractions": "2.2.0" + } + }, + "Microsoft.Extensions.Configuration.Abstractions": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "65MrmXCziWaQFrI0UHkQbesrX5wTwf9XPjY5yFm/VkgJKFJ5gqvXRoXjIZcf2wLi5ZlwGz/oMYfyURVCWbM5iw==", + "dependencies": { + "Microsoft.Extensions.Primitives": "2.2.0" + } + }, + "Microsoft.Extensions.Configuration.Binder": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "vJ9xvOZCnUAIHcGC3SU35r3HKmHTVIeHzo6u/qzlHAqD8m6xv92MLin4oJntTvkpKxVX3vI1GFFkIQtU3AdlsQ==", + "dependencies": { + "Microsoft.Extensions.Configuration": "2.2.0" + } + }, + "Microsoft.Extensions.DependencyInjection.Abstractions": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "f9hstgjVmr6rmrfGSpfsVOl2irKAgr1QjrSi3FgnS7kulxband50f2brRLwySAQTADPZeTdow0mpSMcoAdadCw==" + }, + "Microsoft.Extensions.Options": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "UpZLNLBpIZ0GTebShui7xXYh6DmBHjWM8NxGxZbdQh/bPZ5e6YswqI+bru6BnEL5eWiOdodsXtEz3FROcgi/qg==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Primitives": "2.2.0", + "System.ComponentModel.Annotations": "4.5.0" + } + }, + "Microsoft.Extensions.Primitives": { + "type": "Transitive", + "resolved": "2.2.0", + "contentHash": "azyQtqbm4fSaDzZHD/J+V6oWMFaf2tWP4WEGIYePLCMw3+b2RQdj9ybgbQyjCshcitQKQ4lEDOZjmSlTTrHxUg==", + "dependencies": { + "System.Memory": "4.5.1", + "System.Runtime.CompilerServices.Unsafe": "4.5.1" + } + }, + "Microsoft.NETFramework.ReferenceAssemblies.net461": { + "type": "Transitive", + "resolved": "1.0.3", + "contentHash": "AmOJZwCqnOCNp6PPcf9joyogScWLtwy0M1WkqfEQ0M9nYwyDD7EX9ZjscKS5iYnyvteX7kzSKFCKt9I9dXA6mA==" + }, + "Microsoft.SourceLink.Common": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw==" + }, + "Speckle.DoubleNumerics": { + "type": "Transitive", + "resolved": "4.0.1", + "contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w==" + }, + "Speckle.Newtonsoft.Json": { + "type": "Transitive", + "resolved": "13.0.2", + "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" + }, + "SQLitePCLRaw.bundle_e_sqlite3": { + "type": "Transitive", + "resolved": "2.1.4", + "contentHash": "EWI1olKDjFEBMJu0+3wuxwziIAdWDVMYLhuZ3Qs84rrz+DHwD00RzWPZCa+bLnHCf3oJwuFZIRsHT5p236QXww==", + "dependencies": { + "SQLitePCLRaw.lib.e_sqlite3": "2.1.4", + "SQLitePCLRaw.provider.e_sqlite3": "2.1.4" + } + }, + "SQLitePCLRaw.core": { + "type": "Transitive", + "resolved": "2.1.4", + "contentHash": "inBjvSHo9UDKneGNzfUfDjK08JzlcIhn1+SP5Y3m6cgXpCxXKCJDy6Mka7LpgSV+UZmKSnC8rTwB0SQ0xKu5pA==", + "dependencies": { + "System.Memory": "4.5.3" + } + }, + "SQLitePCLRaw.lib.e_sqlite3": { + "type": "Transitive", + "resolved": "2.1.4", + "contentHash": "2C9Q9eX7CPLveJA0rIhf9RXAvu+7nWZu1A2MdG6SD/NOu26TakGgL1nsbc0JAspGijFOo3HoN79xrx8a368fBg==" + }, + "SQLitePCLRaw.provider.e_sqlite3": { + "type": "Transitive", + "resolved": "2.1.4", + "contentHash": "CSlb5dUp1FMIkez9Iv5EXzpeq7rHryVNqwJMWnpq87j9zWZexaEMdisDktMsnnrzKM6ahNrsTkjqNodTBPBxtQ==", + "dependencies": { + "SQLitePCLRaw.core": "2.1.4" + } + }, + "System.ComponentModel.Annotations": { + "type": "Transitive", + "resolved": "4.5.0", + "contentHash": "UxYQ3FGUOtzJ7LfSdnYSFd7+oEv6M8NgUatatIN2HxNtDdlcvFAf+VIq4Of9cDMJEJC0aSRv/x898RYhB4Yppg==" + }, + "System.Memory": { + "type": "Transitive", + "resolved": "4.5.3", + "contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==" + }, + "System.Reactive": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "erBZjkQHWL9jpasCE/0qKAryzVBJFxGHVBAvgRN1bzM0q2s1S4oYREEEL0Vb+1kA/6BKb5FjUZMp5VXmy+gzkQ==" + }, + "System.Runtime.CompilerServices.Unsafe": { + "type": "Transitive", + "resolved": "4.5.1", + "contentHash": "Zh8t8oqolRaFa9vmOZfdQm/qKejdqz0J9kr7o2Fu0vPeoH3BL1EOXipKWwkWtLT1JPzjByrF19fGuFlNbmPpiw==" + }, + "speckle.converters.common": { + "type": "Project", + "dependencies": { + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Objects": "[3.1.0-dev.200, )" + } + }, + "Microsoft.Extensions.Logging": { + "type": "CentralTransitive", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "Nxqhadc9FCmFHzU+fz3oc8sFlE6IadViYg8dfUdGzJZ2JUxnCsRghBhhOWdM4B2zSZqEc+0BjliBh/oNdRZuig==", + "dependencies": { + "Microsoft.Extensions.Configuration.Binder": "2.2.0", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging.Abstractions": "2.2.0", + "Microsoft.Extensions.Options": "2.2.0" + } + }, + "Microsoft.Extensions.Logging.Abstractions": { + "type": "CentralTransitive", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "B2WqEox8o+4KUOpL7rZPyh6qYjik8tHi2tN8Z9jZkHzED8ElYgZa/h6K+xliB435SqUcWT290Fr2aa8BtZjn8A==" + }, + "Speckle.Objects": { + "type": "CentralTransitive", + "requested": "[3.1.0-dev.200, )", + "resolved": "3.1.0-dev.200", + "contentHash": "n4O+XvMBTsl2gOjZmMeE1Kvo1DOxDLuBcUR7GQw8G0LPv+ce+JFSNaFnmyz/w4X32X2bHmbSImuMRr6U7K4dUQ==", + "dependencies": { + "Speckle.Sdk": "3.1.0-dev.200" + } + }, + "Speckle.Sdk": { + "type": "CentralTransitive", + "requested": "[3.1.0-dev.200, )", + "resolved": "3.1.0-dev.200", + "contentHash": "iRdDkEFDu8taJmzMs6RK/HiUZMeESNKfovb3U2a3yO3wEElNfpqPGXJr3GKcjjPZ+LwENgNO3/aemGzx8+TXQw==", + "dependencies": { + "GraphQL.Client": "6.0.0", + "Microsoft.CSharp": "4.7.0", + "Microsoft.Data.Sqlite": "7.0.5", + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", + "Microsoft.Extensions.Logging": "2.2.0", + "Speckle.DoubleNumerics": "4.0.1", + "Speckle.Newtonsoft.Json": "13.0.2", + "Speckle.Sdk.Dependencies": "3.1.0-dev.200" + } + }, + "Speckle.Sdk.Dependencies": { + "type": "CentralTransitive", + "requested": "[3.1.0-dev.200, )", + "resolved": "3.1.0-dev.200", + "contentHash": "4ZHkKRzI6/Xa1c20NrH3+e+m5DUB+qbBSq+GJ6MShUh6SpKOC4DRdwy0qCcAWrurq7V94xU0qN+7+QzKGeWlFw==" + } + } + } +} \ No newline at end of file diff --git a/Speckle.Connectors.sln b/Speckle.Connectors.sln index c2d19b073..374f90147 100644 --- a/Speckle.Connectors.sln +++ b/Speckle.Connectors.sln @@ -203,6 +203,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ETABS21", "ETABS21", "{DA6A EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connectors.ETABS21", "Connectors\CSi\Speckle.Connectors.ETABS21\Speckle.Connectors.ETABS21.csproj", "{115D6106-1801-484A-B4E5-BCC94B6E5C7F}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.ETABS21", "Converters\CSi\Speckle.Converters.ETABS21\Speckle.Converters.ETABS21.csproj", "{791E3288-8001-4D54-8EAB-03D1D7F51044}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.ETABS22", "Converters\CSi\Speckle.Converters.ETABS22\Speckle.Converters.ETABS22.csproj", "{D61ECD90-3D17-4AF0-8B1A-0E0AD302DFF9}" +EndProject +Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Speckle.Converters.CSiShared", "Converters\CSi\Speckle.Converters.CSiShared\Speckle.Converters.CSiShared.shproj", "{1B5C5FB2-3B22-4371-9AA5-3EDF3B4D62DE}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -510,6 +516,18 @@ Global {115D6106-1801-484A-B4E5-BCC94B6E5C7F}.Local|Any CPU.Build.0 = Debug|Any CPU {115D6106-1801-484A-B4E5-BCC94B6E5C7F}.Release|Any CPU.ActiveCfg = Release|Any CPU {115D6106-1801-484A-B4E5-BCC94B6E5C7F}.Release|Any CPU.Build.0 = Release|Any CPU + {791E3288-8001-4D54-8EAB-03D1D7F51044}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {791E3288-8001-4D54-8EAB-03D1D7F51044}.Debug|Any CPU.Build.0 = Debug|Any CPU + {791E3288-8001-4D54-8EAB-03D1D7F51044}.Local|Any CPU.ActiveCfg = Debug|Any CPU + {791E3288-8001-4D54-8EAB-03D1D7F51044}.Local|Any CPU.Build.0 = Debug|Any CPU + {791E3288-8001-4D54-8EAB-03D1D7F51044}.Release|Any CPU.ActiveCfg = Release|Any CPU + {791E3288-8001-4D54-8EAB-03D1D7F51044}.Release|Any CPU.Build.0 = Release|Any CPU + {D61ECD90-3D17-4AF0-8B1A-0E0AD302DFF9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D61ECD90-3D17-4AF0-8B1A-0E0AD302DFF9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D61ECD90-3D17-4AF0-8B1A-0E0AD302DFF9}.Local|Any CPU.ActiveCfg = Debug|Any CPU + {D61ECD90-3D17-4AF0-8B1A-0E0AD302DFF9}.Local|Any CPU.Build.0 = Debug|Any CPU + {D61ECD90-3D17-4AF0-8B1A-0E0AD302DFF9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D61ECD90-3D17-4AF0-8B1A-0E0AD302DFF9}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -603,6 +621,9 @@ Global {A8E949B8-AA55-4909-99F0-8B551791A1F8} = {181F0468-B7A7-4CD7-ABD1-7F32B3ABB991} {DA6A607B-C267-4B2E-9C8A-F50B2F1BBFE0} = {073F40A8-6C95-41C1-A2F3-369FFFCB9520} {115D6106-1801-484A-B4E5-BCC94B6E5C7F} = {DA6A607B-C267-4B2E-9C8A-F50B2F1BBFE0} + {791E3288-8001-4D54-8EAB-03D1D7F51044} = {DA6A607B-C267-4B2E-9C8A-F50B2F1BBFE0} + {D61ECD90-3D17-4AF0-8B1A-0E0AD302DFF9} = {C6CD9332-874A-49DA-BEB6-3FAA5A700793} + {1B5C5FB2-3B22-4371-9AA5-3EDF3B4D62DE} = {181F0468-B7A7-4CD7-ABD1-7F32B3ABB991} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {EE253116-7070-4E9A-BCE8-2911C251B8C8} @@ -613,6 +634,7 @@ Global Connectors\Tekla\Speckle.Connector.TeklaShared\Speckle.Connectors.TeklaShared.projitems*{025c85f8-f741-4600-bc46-5fead754b65d}*SharedItemsImports = 5 Connectors\CSi\Speckle.Connectors.CsiShared\Speckle.Connectors.CsiShared.projitems*{115d6106-1801-484a-b4e5-bcc94b6e5c7f}*SharedItemsImports = 5 Converters\Revit\Speckle.Converters.RevitShared\Speckle.Converters.RevitShared.projitems*{19424b55-058c-4e9c-b86f-700aef9eaec3}*SharedItemsImports = 5 + Converters\CSi\Speckle.Converters.CSiShared\Speckle.Converters.CSiShared.projitems*{1b5c5fb2-3b22-4371-9aa5-3edf3b4d62de}*SharedItemsImports = 13 Connectors\Rhino\Speckle.Connectors.RhinoShared\Speckle.Connectors.RhinoShared.projitems*{1e2644a9-6b31-4350-8772-ceaad6ee0b21}*SharedItemsImports = 5 Connectors\Tekla\Speckle.Connector.TeklaShared\Speckle.Connectors.TeklaShared.projitems*{2319c00f-b268-4e4c-9f88-6b379e2bbd22}*SharedItemsImports = 5 Converters\Autocad\Speckle.Converters.AutocadShared\Speckle.Converters.AutocadShared.projitems*{25172c49-7aa4-4739-bb07-69785094c379}*SharedItemsImports = 5 @@ -666,7 +688,6 @@ Global Connectors\Autocad\Speckle.Connectors.AutocadShared\Speckle.Connectors.AutocadShared.projitems*{c70ebb84-ba5b-4f2f-819e-25e0985ba13c}*SharedItemsImports = 5 Connectors\Autocad\Speckle.Connectors.AutocadShared\Speckle.Connectors.AutocadShared.projitems*{ca8eae01-ab9f-4ec1-b6f3-73721487e9e1}*SharedItemsImports = 5 Connectors\Autocad\Speckle.Connectors.Civil3dShared\Speckle.Connectors.Civil3dShared.projitems*{ca8eae01-ab9f-4ec1-b6f3-73721487e9e1}*SharedItemsImports = 5 - Converters\CSi\Speckle.Converters.CSiShared\Speckle.Converters.CSiShared.projitems*{d096fab7-af65-40fa-a41c-8c45c74400f3}*SharedItemsImports = 13 Converters\Revit\Speckle.Converters.RevitShared.Tests\Speckle.Converters.RevitShared.Tests.projitems*{d8069a23-ad2e-4c9e-8574-7e8c45296a46}*SharedItemsImports = 5 Converters\Revit\Speckle.Converters.RevitShared\Speckle.Converters.RevitShared.projitems*{d8069a23-ad2e-4c9e-8574-7e8c45296a46}*SharedItemsImports = 5 Converters\Autocad\Speckle.Converters.AutocadShared\Speckle.Converters.AutocadShared.projitems*{db31e57b-60fc-49be-91e0-1374290bcf03}*SharedItemsImports = 5 From 1d76983a556e7e766fca5ef42137a032fd14c3e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn?= Date: Fri, 29 Nov 2024 14:29:53 +0100 Subject: [PATCH 02/19] CSiObjectToSpeckleConverter - Abstract TopLevel converter - Requiring a lot of wrappers and addtional steps to get to converted CSiObject --- .../Bindings/CSiSharedSendBinding.cs | 77 ++++++++++++++++++- .../Speckle.Connectors.ETABS21.csproj | 1 + .../packages.lock.json | 13 ++++ .../Speckle.Connectors.ETABS22.csproj | 1 + .../packages.lock.json | 13 ++++ .../CSiConversionSettingsFactory.cs | 20 +++++ .../Speckle.Converters.CSiShared/CSiObject.cs | 29 +++++++ .../CSiWrappers.cs | 44 +++++++++++ .../Speckle.Converters.CSiShared.projitems | 4 + .../CSiPointToSpeckleCSiObjectConverter.cs | 22 ++++++ .../ToSpeckle/Raw/PointToSpeckleConverter.cs | 8 +- .../TopLevel/CSiObjectToSpeckleConverter.cs | 34 ++++++-- 12 files changed, 253 insertions(+), 13 deletions(-) create mode 100644 Converters/CSi/Speckle.Converters.CSiShared/CSiConversionSettingsFactory.cs create mode 100644 Converters/CSi/Speckle.Converters.CSiShared/CSiObject.cs create mode 100644 Converters/CSi/Speckle.Converters.CSiShared/CSiWrappers.cs create mode 100644 Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/CSiPointToSpeckleCSiObjectConverter.cs diff --git a/Connectors/CSi/Speckle.Connectors.CSiShared/Bindings/CSiSharedSendBinding.cs b/Connectors/CSi/Speckle.Connectors.CSiShared/Bindings/CSiSharedSendBinding.cs index 9909f8935..f4ccbe12f 100644 --- a/Connectors/CSi/Speckle.Connectors.CSiShared/Bindings/CSiSharedSendBinding.cs +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/Bindings/CSiSharedSendBinding.cs @@ -1,10 +1,20 @@ -using Microsoft.Extensions.Logging; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; using Speckle.Connectors.Common.Cancellation; +using Speckle.Connectors.Common.Operations; using Speckle.Connectors.DUI.Bindings; using Speckle.Connectors.DUI.Bridge; +using Speckle.Connectors.DUI.Exceptions; +using Speckle.Connectors.DUI.Logging; using Speckle.Connectors.DUI.Models; +using Speckle.Connectors.DUI.Models.Card; using Speckle.Connectors.DUI.Models.Card.SendFilter; using Speckle.Connectors.DUI.Settings; +using Speckle.Converters.Common; +using Speckle.Converters.CSiShared; +using Speckle.Sdk; +using Speckle.Sdk.Common; +using Speckle.Sdk.Logging; namespace Speckle.Connectors.CSiShared.Bindings; @@ -21,6 +31,9 @@ public sealed class CSiSharedSendBinding : ISendBinding private readonly CancellationManager _cancellationManager; private readonly IOperationProgressManager _operationProgressManager; private readonly ILogger _logger; + private readonly ICSiConversionSettingsFactors _csiConversionSettingsFactory; + private readonly ISpeckleApplication _speckleApplication; + private readonly ISdkActivityFactory _activityFactory; public CSiSharedSendBinding( DocumentModelStore store, @@ -30,7 +43,9 @@ public CSiSharedSendBinding( IServiceProvider serviceProvider, CancellationManager cancellationManager, IOperationProgressManager operationProgressManager, - ILogger logger + ILogger logger, + ISpeckleApplication speckleApplication, + ISdkActivityFactory activityFactory ) { _store = store; @@ -42,6 +57,8 @@ ILogger logger _logger = logger; Parent = parent; Commands = new SendBindingUICommands(parent); + _speckleApplication = speckleApplication; + _activityFactory = activityFactory; } public List GetSendFilters() => _sendFilters; @@ -50,8 +67,60 @@ ILogger logger public async Task Send(string modelCardId) { - // placeholder for actual send implementation - await Task.CompletedTask.ConfigureAwait(false); + using var activity = _activityFactory.Start(); + using var scope = _serviceProvider.CreateScope(); + scope + .ServiceProvider.GetRequiredService>() + .Initialize(_csiSharedConversionSettingsFactory.Create(RhinoDoc.ActiveDoc)); + try + { + if (_store.GetModelById(modelCardId) is not SenderModelCard modelCard) + { + // Handle as GLOBAL ERROR at BrowserBridge + throw new InvalidOperationException("No publish model card was found."); + } + + CancellationToken cancellationToken = _cancellationManager.InitCancellationTokenSource(modelCardId); + + List rhinoObjects = modelCard + .SendFilter.NotNull() + .RefreshObjectIds() + .Select(id => RhinoDoc.ActiveDoc.Objects.FindId(new Guid(id))) + .Where(obj => obj != null) + .ToList(); + + if (rhinoObjects.Count == 0) + { + // Handle as CARD ERROR in this function + throw new SpeckleSendFilterException("No objects were found to convert. Please update your publish filter!"); + } + + var sendResult = await scope + .ServiceProvider.GetRequiredService>() + .Execute( + rhinoObjects, + modelCard.GetSendInfo(_speckleApplication.Slug), + _operationProgressManager.CreateOperationProgressEventHandler(Parent, modelCardId, cancellationToken), + cancellationToken + ) + .ConfigureAwait(false); + + await Commands + .SetModelSendResult(modelCardId, sendResult.RootObjId, sendResult.ConversionResults) + .ConfigureAwait(false); + } + catch (OperationCanceledException) + { + // SWALLOW -> UI handles it immediately, so we do not need to handle anything for now! + // Idea for later -> when cancel called, create promise from UI to solve it later with this catch block. + // So have 3 state on UI -> Cancellation clicked -> Cancelling -> Cancelled + return; + } + catch (Exception ex) when (!ex.IsFatal()) // UX reasons - we will report operation exceptions as model card error. We may change this later when we have more exception documentation + { + _logger.LogModelCardHandledError(ex); + await Commands.SetModelError(modelCardId, ex).ConfigureAwait(false); + } } public void CancelSend(string modelCardId) diff --git a/Connectors/CSi/Speckle.Connectors.ETABS21/Speckle.Connectors.ETABS21.csproj b/Connectors/CSi/Speckle.Connectors.ETABS21/Speckle.Connectors.ETABS21.csproj index e21c1fe97..6d295e8b5 100644 --- a/Connectors/CSi/Speckle.Connectors.ETABS21/Speckle.Connectors.ETABS21.csproj +++ b/Connectors/CSi/Speckle.Connectors.ETABS21/Speckle.Connectors.ETABS21.csproj @@ -13,6 +13,7 @@ + diff --git a/Connectors/CSi/Speckle.Connectors.ETABS21/packages.lock.json b/Connectors/CSi/Speckle.Connectors.ETABS21/packages.lock.json index 74d5a6c3d..85a74e4f1 100644 --- a/Connectors/CSi/Speckle.Connectors.ETABS21/packages.lock.json +++ b/Connectors/CSi/Speckle.Connectors.ETABS21/packages.lock.json @@ -289,6 +289,19 @@ "speckle.connectors.logging": { "type": "Project" }, + "speckle.converters.common": { + "type": "Project", + "dependencies": { + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Objects": "[3.1.0-dev.200, )" + } + }, + "speckle.converters.etabs21": { + "type": "Project", + "dependencies": { + "Speckle.Converters.Common": "[1.0.0, )" + } + }, "Microsoft.Extensions.DependencyInjection": { "type": "CentralTransitive", "requested": "[2.2.0, )", diff --git a/Connectors/CSi/Speckle.Connectors.ETABS22/Speckle.Connectors.ETABS22.csproj b/Connectors/CSi/Speckle.Connectors.ETABS22/Speckle.Connectors.ETABS22.csproj index 99a43915c..9705a4de9 100644 --- a/Connectors/CSi/Speckle.Connectors.ETABS22/Speckle.Connectors.ETABS22.csproj +++ b/Connectors/CSi/Speckle.Connectors.ETABS22/Speckle.Connectors.ETABS22.csproj @@ -13,6 +13,7 @@ + diff --git a/Connectors/CSi/Speckle.Connectors.ETABS22/packages.lock.json b/Connectors/CSi/Speckle.Connectors.ETABS22/packages.lock.json index 873e54ded..240948f79 100644 --- a/Connectors/CSi/Speckle.Connectors.ETABS22/packages.lock.json +++ b/Connectors/CSi/Speckle.Connectors.ETABS22/packages.lock.json @@ -245,6 +245,19 @@ "speckle.connectors.logging": { "type": "Project" }, + "speckle.converters.common": { + "type": "Project", + "dependencies": { + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Objects": "[3.1.0-dev.200, )" + } + }, + "speckle.converters.etabs22": { + "type": "Project", + "dependencies": { + "Speckle.Converters.Common": "[1.0.0, )" + } + }, "Microsoft.Extensions.DependencyInjection": { "type": "CentralTransitive", "requested": "[2.2.0, )", diff --git a/Converters/CSi/Speckle.Converters.CSiShared/CSiConversionSettingsFactory.cs b/Converters/CSi/Speckle.Converters.CSiShared/CSiConversionSettingsFactory.cs new file mode 100644 index 000000000..8450f54de --- /dev/null +++ b/Converters/CSi/Speckle.Converters.CSiShared/CSiConversionSettingsFactory.cs @@ -0,0 +1,20 @@ +using Speckle.Converters.Common; +using Speckle.Converters.CSiShared; +using Speckle.InterfaceGenerator; + +namespace Speckle.Converters.TeklaShared; + +[GenerateAutoInterface] +public class TeklaConversionSettingsFactory( + IHostToSpeckleUnitConverter unitsConverter, + IConverterSettingsStore settingsStore +) : ITeklaConversionSettingsFactory +{ + public CSiConversionSettings Current => settingsStore.Current; + + // NOTE: Distance.CurrentUnitType reflects Settings > Options > Units and decimals + // Internal units (mm) are, however, always returned. + // If model units != internal units, user can rely on units appended to each report parameter + public CSiConversionSettings Create(Model document, bool sendRebarsAsSolid) => + new(document, sendRebarsAsSolid, unitsConverter.ConvertOrThrow(Distance.CurrentUnitType)); +} diff --git a/Converters/CSi/Speckle.Converters.CSiShared/CSiObject.cs b/Converters/CSi/Speckle.Converters.CSiShared/CSiObject.cs new file mode 100644 index 000000000..1dd26b035 --- /dev/null +++ b/Converters/CSi/Speckle.Converters.CSiShared/CSiObject.cs @@ -0,0 +1,29 @@ +using Speckle.Objects; +using Speckle.Sdk.Models; + +namespace Speckle.Converters.CSiShared; + +[SpeckleType("Converters.CSiShared.CSiObject")] +public class CSiObject : Base, ICSiObject +{ + public required string name { get; set; } + public required string type { get; set; } + + [DetachProperty] +#pragma warning disable IDE1006 + public required List displayValue { get; set; } +#pragma warning restore IDE1006 + +#pragma warning disable IDE1006 + public required string units { get; set; } +#pragma warning restore IDE1006 + + IReadOnlyList IDataObject.displayValue => displayValue; +} + +public interface ICSiObject : IDataObject +{ +#pragma warning disable IDE1006 + string type { get; } +#pragma warning restore IDE1006 +} diff --git a/Converters/CSi/Speckle.Converters.CSiShared/CSiWrappers.cs b/Converters/CSi/Speckle.Converters.CSiShared/CSiWrappers.cs new file mode 100644 index 000000000..33d2e6530 --- /dev/null +++ b/Converters/CSi/Speckle.Converters.CSiShared/CSiWrappers.cs @@ -0,0 +1,44 @@ +// NOTE: This is an interim solution. API allows us to query the model, not get any instances from it +// Potentially move all of this to a new shared project at later stage + +namespace Speckle.Converters.CSiShared; + +public interface ICSiWrapper +{ + string Name { get; set; } +} + +public class CSiPointWrapper : ICSiWrapper +{ + public string Name { get; set; } +} + +public class CSiFrameWrapper : ICSiWrapper +{ + public string Name { get; set; } +} + +public class CSiCableWrapper : ICSiWrapper +{ + public string Name { get; set; } +} + +public class CSiTendonWrapper : ICSiWrapper +{ + public string Name { get; set; } +} + +public class CSiAreaWrapper : ICSiWrapper +{ + public string Name { get; set; } +} + +public class CSiSolidWrapper : ICSiWrapper +{ + public string Name { get; set; } +} + +public class CSiLinkWrapper : ICSiWrapper +{ + public string Name { get; set; } +} diff --git a/Converters/CSi/Speckle.Converters.CSiShared/Speckle.Converters.CSiShared.projitems b/Converters/CSi/Speckle.Converters.CSiShared/Speckle.Converters.CSiShared.projitems index ba3ccd655..6fa615953 100644 --- a/Converters/CSi/Speckle.Converters.CSiShared/Speckle.Converters.CSiShared.projitems +++ b/Converters/CSi/Speckle.Converters.CSiShared/Speckle.Converters.CSiShared.projitems @@ -10,8 +10,12 @@ + + + + diff --git a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/CSiPointToSpeckleCSiObjectConverter.cs b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/CSiPointToSpeckleCSiObjectConverter.cs new file mode 100644 index 000000000..e98d3735a --- /dev/null +++ b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/CSiPointToSpeckleCSiObjectConverter.cs @@ -0,0 +1,22 @@ +using Speckle.Converters.Common.Objects; +using Speckle.Objects.Geometry; + +namespace Speckle.Converters.CSiShared.ToSpeckle.Raw +{ + public class CSiPointToSpeckleCSiObjectConverter : ITypedConverter + { + private ITypedConverter _pointConverter; + + public CSiPointToSpeckleCSiObjectConverter(ITypedConverter converter) + { + _pointConverter = converter; + } + + public CSiObject Convert(CSiPointWrapper source) + { + var point = _pointConverter.Convert(source); // Point is speckle point for displayvalue of csi object + + CSiObject cSiObject = new CSiObject(); // TODO: Finish implementation + } + } +} diff --git a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/PointToSpeckleConverter.cs b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/PointToSpeckleConverter.cs index 9949acd89..585063ae7 100644 --- a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/PointToSpeckleConverter.cs +++ b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/PointToSpeckleConverter.cs @@ -1,3 +1,9 @@ +using Speckle.Converters.Common.Objects; +using Speckle.Objects.Geometry; + namespace Speckle.Converters.CSiShared.ToSpeckle.Raw; -public class PointToSpeckleConverter { } +public class PointToSpeckleConverter : ITypedConverter +{ + public Point Convert(CSiPointWrapper target) => throw new NotImplementedException(); +} diff --git a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/TopLevel/CSiObjectToSpeckleConverter.cs b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/TopLevel/CSiObjectToSpeckleConverter.cs index 1bf935923..a75f8a866 100644 --- a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/TopLevel/CSiObjectToSpeckleConverter.cs +++ b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/TopLevel/CSiObjectToSpeckleConverter.cs @@ -1,33 +1,52 @@ using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -using Speckle.Objects.Data; // This will come +// using Speckle.Objects.Geometry; +// This will come at a later stage: using Speckle.Objects.Data; using Speckle.Sdk.Models; namespace Speckle.Converters.CSiShared.ToSpeckle.TopLevel; -[NameAndRankValue(nameof(ICSiObject), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] -public class CSiObjectToSpeckleConverter : IToSpeckleTopLevelConverter +[NameAndRankValue(nameof(CSiPointWrapper), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +public class CSiPointToSpeckleConverter : CSiObjectToSpeckleConverter +{ + public CSiPointToSpeckleConverter( + IConverterSettingsStore settingsStore, + ITypedConverter converter + ) + : base(settingsStore, converter) { } +} + +public abstract class CSiObjectToSpeckleConverter : IToSpeckleTopLevelConverter + where TInput : ICSiWrapper + where TOutput : Base { private readonly IConverterSettingsStore _settingsStore; + private readonly ITypedConverter _converter; - public CSiObjectToSpeckleConverter(IConverterSettingsStore settingsStore) + protected CSiObjectToSpeckleConverter( + IConverterSettingsStore settingsStore, + ITypedConverter converter + ) { _settingsStore = settingsStore; + _converter = converter; } public Base Convert(object target) { - if (target is not ICSiObject csiObject) + if (target is not TInput csiWrapper) { throw new ArgumentException($"Target object is not a CSi object. It's a {target.GetType()}"); } + var point = _converter.Convert(csiWrapper); + var result = new CSiObject // This should be coming from sdk { type = target.GetType().ToString().Split('.').Last(), units = _settingsStore.Current.SpeckleUnits, - name = csiObject.name, - displayValue = new List() + name = csiWrapper.Name, + displayValue = new List { point } }; // Get properties (material, section, etc.) @@ -36,7 +55,6 @@ public Base Convert(object target) // Get display value (geometry) // _displayValueExtractor DisplayValueExtractor or SpatialDataExtractor or GeometricDataExtractor in a Helpers folder - return result; } } From 80178ce5b3de9be4514ef57f6f3e4f49a65540f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn?= Date: Fri, 29 Nov 2024 16:33:03 +0100 Subject: [PATCH 03/19] ICSiWrapper with factory --- .../Bindings/CSiSharedSelectionBinding.cs | 20 +------ .../Bindings/CSiSharedSendBinding.cs | 42 +++++++++------ .../Speckle.Connectors.CSiShared.projitems | 1 + .../Utils/ObjectIdentifiers.cs | 31 +++++++++++ .../CSiConversionSettingsFactory.cs | 14 ++--- .../CSiWrappers.cs | 54 +++++++++++++------ .../Speckle.Converters.CSiShared.projitems | 8 ++- .../Helpers/DisplayValueExtractor.cs | 25 +++++++++ .../ToSpeckle/Raw/AreaToSpeckleConverter.cs | 3 -- .../CSiPointToSpeckleCSiObjectConverter.cs | 22 -------- .../ToSpeckle/Raw/FrameToSpeckleConverter.cs | 10 ++-- .../ToSpeckle/Raw/JointToSpeckleConverter.cs | 7 +++ .../ToSpeckle/Raw/LinkToSpeckleConverter.cs | 3 -- .../ToSpeckle/Raw/PointToSpeckleConverter.cs | 9 ---- .../ToSpeckle/Raw/ShellToSpeckleConverter.cs | 7 +++ .../ToSpeckle/Raw/TendonToSpeckleConverter.cs | 3 -- .../TopLevel/CSiObjectToSpeckleConverter.cs | 51 +++++++----------- 17 files changed, 168 insertions(+), 142 deletions(-) create mode 100644 Connectors/CSi/Speckle.Connectors.CSiShared/Utils/ObjectIdentifiers.cs create mode 100644 Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Helpers/DisplayValueExtractor.cs delete mode 100644 Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/AreaToSpeckleConverter.cs delete mode 100644 Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/CSiPointToSpeckleCSiObjectConverter.cs create mode 100644 Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/JointToSpeckleConverter.cs delete mode 100644 Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/LinkToSpeckleConverter.cs delete mode 100644 Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/PointToSpeckleConverter.cs create mode 100644 Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/ShellToSpeckleConverter.cs delete mode 100644 Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/TendonToSpeckleConverter.cs diff --git a/Connectors/CSi/Speckle.Connectors.CSiShared/Bindings/CSiSharedSelectionBinding.cs b/Connectors/CSi/Speckle.Connectors.CSiShared/Bindings/CSiSharedSelectionBinding.cs index 2c667686c..2275c8c61 100644 --- a/Connectors/CSi/Speckle.Connectors.CSiShared/Bindings/CSiSharedSelectionBinding.cs +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/Bindings/CSiSharedSelectionBinding.cs @@ -1,4 +1,5 @@ using Speckle.Connectors.CSiShared.HostApp; +using Speckle.Connectors.CSiShared.Utils; using Speckle.Connectors.DUI.Bindings; using Speckle.Connectors.DUI.Bridge; @@ -44,7 +45,7 @@ public SelectionInfo GetSelection() var typeKey = objectType[i]; var typeName = objectTypeMap.TryGetValue(typeKey, out var name) ? name : $"Unknown ({typeKey})"; - encodedIds.Add(EncodeObjectIdentifier(typeKey, objectName[i])); + encodedIds.Add(ObjectIdentifier.Encode(typeKey, objectName[i])); typeCounts[typeName] = (typeCounts.TryGetValue(typeName, out var count) ? count : 0) + 1; // NOTE: Cross-framework compatibility } @@ -56,21 +57,4 @@ public SelectionInfo GetSelection() return new SelectionInfo(encodedIds, summary); } - - // NOTE: All API methods are based on the objectType and objectName, not the GUID - // We will obviously manage the GUIDs but for all method calls we need a concatenated version of the objectType and objectName - // Since objectType >= 1 and <= 7, we know first index will always be the objectType - // Remaining string represents objectName and since the user can add any string (provided it is unique), this is safer - // than using a delimiting character (which could clash with user string) - private string EncodeObjectIdentifier(int objectType, string objectName) - { - // Just in case some weird objectType pops up - if (objectType < 1 || objectType > 7) - { - throw new ArgumentException($"Invalid object type: {objectType}. Must be between 1 and 7."); - } - - // Simply prepend the object type as a single character - return $"{objectType}{objectName}"; - } } diff --git a/Connectors/CSi/Speckle.Connectors.CSiShared/Bindings/CSiSharedSendBinding.cs b/Connectors/CSi/Speckle.Connectors.CSiShared/Bindings/CSiSharedSendBinding.cs index f4ccbe12f..a18c2c7cc 100644 --- a/Connectors/CSi/Speckle.Connectors.CSiShared/Bindings/CSiSharedSendBinding.cs +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/Bindings/CSiSharedSendBinding.cs @@ -2,6 +2,8 @@ using Microsoft.Extensions.Logging; using Speckle.Connectors.Common.Cancellation; using Speckle.Connectors.Common.Operations; +using Speckle.Connectors.CSiShared.HostApp; +using Speckle.Connectors.CSiShared.Utils; using Speckle.Connectors.DUI.Bindings; using Speckle.Connectors.DUI.Bridge; using Speckle.Connectors.DUI.Exceptions; @@ -31,7 +33,8 @@ public sealed class CSiSharedSendBinding : ISendBinding private readonly CancellationManager _cancellationManager; private readonly IOperationProgressManager _operationProgressManager; private readonly ILogger _logger; - private readonly ICSiConversionSettingsFactors _csiConversionSettingsFactory; + private readonly ICSiApplicationService _csiApplicationService; // Update selection binding to centralized CSiSharedApplicationService instead of trying to maintain a reference to "sapModel" + private readonly ICSiConversionSettingsFactory _csiConversionSettingsFactory; private readonly ISpeckleApplication _speckleApplication; private readonly ISdkActivityFactory _activityFactory; @@ -44,8 +47,10 @@ public CSiSharedSendBinding( CancellationManager cancellationManager, IOperationProgressManager operationProgressManager, ILogger logger, + ICSiConversionSettingsFactory csiConversionSettingsFactory, ISpeckleApplication speckleApplication, - ISdkActivityFactory activityFactory + ISdkActivityFactory activityFactory, + ICSiApplicationService csiApplicationService ) { _store = store; @@ -57,8 +62,10 @@ ISdkActivityFactory activityFactory _logger = logger; Parent = parent; Commands = new SendBindingUICommands(parent); + _csiConversionSettingsFactory = csiConversionSettingsFactory; _speckleApplication = speckleApplication; _activityFactory = activityFactory; + _csiApplicationService = csiApplicationService; } public List GetSendFilters() => _sendFilters; @@ -68,37 +75,35 @@ ISdkActivityFactory activityFactory public async Task Send(string modelCardId) { using var activity = _activityFactory.Start(); - using var scope = _serviceProvider.CreateScope(); - scope - .ServiceProvider.GetRequiredService>() - .Initialize(_csiSharedConversionSettingsFactory.Create(RhinoDoc.ActiveDoc)); + try { if (_store.GetModelById(modelCardId) is not SenderModelCard modelCard) { - // Handle as GLOBAL ERROR at BrowserBridge throw new InvalidOperationException("No publish model card was found."); } + using var scope = _serviceProvider.CreateScope(); + scope + .ServiceProvider.GetRequiredService>() + .Initialize(_csiConversionSettingsFactory.Create(_csiApplicationService.SapModel)); CancellationToken cancellationToken = _cancellationManager.InitCancellationTokenSource(modelCardId); - List rhinoObjects = modelCard + List wrappers = modelCard .SendFilter.NotNull() .RefreshObjectIds() - .Select(id => RhinoDoc.ActiveDoc.Objects.FindId(new Guid(id))) - .Where(obj => obj != null) + .Select(DecodeObjectIdentifier) .ToList(); - if (rhinoObjects.Count == 0) + if (wrappers.Count == 0) { - // Handle as CARD ERROR in this function throw new SpeckleSendFilterException("No objects were found to convert. Please update your publish filter!"); } var sendResult = await scope .ServiceProvider.GetRequiredService>() .Execute( - rhinoObjects, + wrappers, modelCard.GetSendInfo(_speckleApplication.Slug), _operationProgressManager.CreateOperationProgressEventHandler(Parent, modelCardId, cancellationToken), cancellationToken @@ -111,18 +116,21 @@ await Commands } catch (OperationCanceledException) { - // SWALLOW -> UI handles it immediately, so we do not need to handle anything for now! - // Idea for later -> when cancel called, create promise from UI to solve it later with this catch block. - // So have 3 state on UI -> Cancellation clicked -> Cancelling -> Cancelled return; } - catch (Exception ex) when (!ex.IsFatal()) // UX reasons - we will report operation exceptions as model card error. We may change this later when we have more exception documentation + catch (Exception ex) when (!ex.IsFatal()) { _logger.LogModelCardHandledError(ex); await Commands.SetModelError(modelCardId, ex).ConfigureAwait(false); } } + private ICSiWrapper DecodeObjectIdentifier(string encodedId) + { + var (type, name) = ObjectIdentifier.Decode(encodedId); + return CSiWrapperFactory.Create(type, name); + } + public void CancelSend(string modelCardId) { _cancellationManager.CancelOperation(modelCardId); diff --git a/Connectors/CSi/Speckle.Connectors.CSiShared/Speckle.Connectors.CSiShared.projitems b/Connectors/CSi/Speckle.Connectors.CSiShared/Speckle.Connectors.CSiShared.projitems index 79e3b2fa7..a6d4f85a5 100644 --- a/Connectors/CSi/Speckle.Connectors.CSiShared/Speckle.Connectors.CSiShared.projitems +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/Speckle.Connectors.CSiShared.projitems @@ -22,6 +22,7 @@ + diff --git a/Connectors/CSi/Speckle.Connectors.CSiShared/Utils/ObjectIdentifiers.cs b/Connectors/CSi/Speckle.Connectors.CSiShared/Utils/ObjectIdentifiers.cs new file mode 100644 index 000000000..2d45e0f13 --- /dev/null +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/Utils/ObjectIdentifiers.cs @@ -0,0 +1,31 @@ +namespace Speckle.Connectors.CSiShared.Utils; + +// NOTE: All API methods are based on the objectType and objectName, not the GUID +// We will obviously manage the GUIDs but for all method calls we need a concatenated version of the objectType and objectName +// Since objectType >= 1 and <= 7, we know first index will always be the objectType +// Remaining string represents objectName and since the user can add any string (provided it is unique), this is safer +// than using a delimiting character (which could clash with user string) +public static class ObjectIdentifier +{ + public static string Encode(int objectType, string objectName) + { + if (objectType < 1 || objectType > 7) + { + throw new ArgumentException($"Invalid object type: {objectType}. Must be between 1 and 7."); + } + return $"{objectType}{objectName}"; + } + + public static (int type, string name) Decode(string encodedId) + { + if (string.IsNullOrEmpty(encodedId) || encodedId.Length < 2) + { + throw new ArgumentException($"Invalid encoded ID: {encodedId}"); + } + + int objectType = int.Parse(encodedId[0].ToString()); + string objectName = encodedId[1..]; + + return (objectType, objectName); + } +} diff --git a/Converters/CSi/Speckle.Converters.CSiShared/CSiConversionSettingsFactory.cs b/Converters/CSi/Speckle.Converters.CSiShared/CSiConversionSettingsFactory.cs index 8450f54de..a6c7f0d80 100644 --- a/Converters/CSi/Speckle.Converters.CSiShared/CSiConversionSettingsFactory.cs +++ b/Converters/CSi/Speckle.Converters.CSiShared/CSiConversionSettingsFactory.cs @@ -1,20 +1,16 @@ using Speckle.Converters.Common; -using Speckle.Converters.CSiShared; using Speckle.InterfaceGenerator; -namespace Speckle.Converters.TeklaShared; +namespace Speckle.Converters.CSiShared; [GenerateAutoInterface] -public class TeklaConversionSettingsFactory( +public class CSiConversionSettingsFactory( IHostToSpeckleUnitConverter unitsConverter, IConverterSettingsStore settingsStore -) : ITeklaConversionSettingsFactory +) : ICSiConversionSettingsFactory { public CSiConversionSettings Current => settingsStore.Current; - // NOTE: Distance.CurrentUnitType reflects Settings > Options > Units and decimals - // Internal units (mm) are, however, always returned. - // If model units != internal units, user can rely on units appended to each report parameter - public CSiConversionSettings Create(Model document, bool sendRebarsAsSolid) => - new(document, sendRebarsAsSolid, unitsConverter.ConvertOrThrow(Distance.CurrentUnitType)); + // TODO: Units currently hard-coded + public CSiConversionSettings Create(cSapModel document) => new(document, unitsConverter.ConvertOrThrow("mm")); } diff --git a/Converters/CSi/Speckle.Converters.CSiShared/CSiWrappers.cs b/Converters/CSi/Speckle.Converters.CSiShared/CSiWrappers.cs index 33d2e6530..b5db54dbf 100644 --- a/Converters/CSi/Speckle.Converters.CSiShared/CSiWrappers.cs +++ b/Converters/CSi/Speckle.Converters.CSiShared/CSiWrappers.cs @@ -1,44 +1,64 @@ -// NOTE: This is an interim solution. API allows us to query the model, not get any instances from it -// Potentially move all of this to a new shared project at later stage - namespace Speckle.Converters.CSiShared; public interface ICSiWrapper { string Name { get; set; } + int ObjectType { get; } +} + +public abstract class CSiWrapperBase : ICSiWrapper +{ + public required string Name { get; set; } + public abstract int ObjectType { get; } +} + +public class CSiJointWrapper : CSiWrapperBase +{ + public override int ObjectType => 1; } -public class CSiPointWrapper : ICSiWrapper +public class CSiFrameWrapper : CSiWrapperBase { - public string Name { get; set; } + public override int ObjectType => 2; } -public class CSiFrameWrapper : ICSiWrapper +public class CSiCableWrapper : CSiWrapperBase { - public string Name { get; set; } + public override int ObjectType => 3; } -public class CSiCableWrapper : ICSiWrapper +public class CSiTendonWrapper : CSiWrapperBase { - public string Name { get; set; } + public override int ObjectType => 4; } -public class CSiTendonWrapper : ICSiWrapper +public class CSiShellWrapper : CSiWrapperBase { - public string Name { get; set; } + public override int ObjectType => 5; } -public class CSiAreaWrapper : ICSiWrapper +public class CSiSolidWrapper : CSiWrapperBase { - public string Name { get; set; } + public override int ObjectType => 6; } -public class CSiSolidWrapper : ICSiWrapper +public class CSiLinkWrapper : CSiWrapperBase { - public string Name { get; set; } + public override int ObjectType => 7; } -public class CSiLinkWrapper : ICSiWrapper +public static class CSiWrapperFactory { - public string Name { get; set; } + public static ICSiWrapper Create(int objectType, string name) => + objectType switch + { + 1 => new CSiJointWrapper { Name = name }, + 2 => new CSiFrameWrapper { Name = name }, + 3 => new CSiCableWrapper { Name = name }, + 4 => new CSiTendonWrapper { Name = name }, + 5 => new CSiShellWrapper { Name = name }, + 6 => new CSiSolidWrapper { Name = name }, + 7 => new CSiLinkWrapper { Name = name }, + _ => throw new ArgumentOutOfRangeException(nameof(objectType), $"Unsupported object type: {objectType}") + }; } diff --git a/Converters/CSi/Speckle.Converters.CSiShared/Speckle.Converters.CSiShared.projitems b/Converters/CSi/Speckle.Converters.CSiShared/Speckle.Converters.CSiShared.projitems index 6fa615953..e30ab3690 100644 --- a/Converters/CSi/Speckle.Converters.CSiShared/Speckle.Converters.CSiShared.projitems +++ b/Converters/CSi/Speckle.Converters.CSiShared/Speckle.Converters.CSiShared.projitems @@ -14,12 +14,10 @@ - - + - - - + + diff --git a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Helpers/DisplayValueExtractor.cs b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Helpers/DisplayValueExtractor.cs new file mode 100644 index 000000000..76952031d --- /dev/null +++ b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Helpers/DisplayValueExtractor.cs @@ -0,0 +1,25 @@ +using Speckle.Sdk.Models; + +namespace Speckle.Converters.CSiShared.ToSpeckle.Helpers; + +public class DisplayValueExtractor +{ + public DisplayValueExtractor() { } + + public IEnumerable GetDisplayValue(ICSiWrapper wrapper) + { + return wrapper switch + { + CSiJointWrapper joint => ExtractJoint(joint.Name), + CSiFrameWrapper frame => ExtractFrame(frame.Name), + CSiShellWrapper shell => ExtractShell(shell.Name), + _ => Enumerable.Empty() + }; + } + + private IEnumerable ExtractJoint(string name) => throw new NotImplementedException(); + + private IEnumerable ExtractFrame(string name) => throw new NotImplementedException(); + + private IEnumerable ExtractShell(string name) => throw new NotImplementedException(); +} diff --git a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/AreaToSpeckleConverter.cs b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/AreaToSpeckleConverter.cs deleted file mode 100644 index f7e709c47..000000000 --- a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/AreaToSpeckleConverter.cs +++ /dev/null @@ -1,3 +0,0 @@ -namespace Speckle.Converters.CSiShared.ToSpeckle.Raw; - -public class AreaToSpeckleConverter { } diff --git a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/CSiPointToSpeckleCSiObjectConverter.cs b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/CSiPointToSpeckleCSiObjectConverter.cs deleted file mode 100644 index e98d3735a..000000000 --- a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/CSiPointToSpeckleCSiObjectConverter.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Speckle.Converters.Common.Objects; -using Speckle.Objects.Geometry; - -namespace Speckle.Converters.CSiShared.ToSpeckle.Raw -{ - public class CSiPointToSpeckleCSiObjectConverter : ITypedConverter - { - private ITypedConverter _pointConverter; - - public CSiPointToSpeckleCSiObjectConverter(ITypedConverter converter) - { - _pointConverter = converter; - } - - public CSiObject Convert(CSiPointWrapper source) - { - var point = _pointConverter.Convert(source); // Point is speckle point for displayvalue of csi object - - CSiObject cSiObject = new CSiObject(); // TODO: Finish implementation - } - } -} diff --git a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/FrameToSpeckleConverter.cs b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/FrameToSpeckleConverter.cs index 80c9a5851..269d2eb1d 100644 --- a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/FrameToSpeckleConverter.cs +++ b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/FrameToSpeckleConverter.cs @@ -1,3 +1,7 @@ -namespace Speckle.Converters.CSiShared.ToSpeckle.Raw; - -public class FrameToSpeckleConverter { } +namespace Speckle.Converters.ETABS22.ToSpeckle.Raw +{ + public class FrameToSpeckleConverter + { + + } +} diff --git a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/JointToSpeckleConverter.cs b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/JointToSpeckleConverter.cs new file mode 100644 index 000000000..9c59d751e --- /dev/null +++ b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/JointToSpeckleConverter.cs @@ -0,0 +1,7 @@ +namespace Speckle.Converters.ETABS22.ToSpeckle.Raw +{ + public class JointToSpeckleConverter + { + + } +} diff --git a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/LinkToSpeckleConverter.cs b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/LinkToSpeckleConverter.cs deleted file mode 100644 index 64efd158a..000000000 --- a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/LinkToSpeckleConverter.cs +++ /dev/null @@ -1,3 +0,0 @@ -namespace Speckle.Converters.CSiShared.ToSpeckle.Raw; - -public class LinkToSpeckleConverter { } diff --git a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/PointToSpeckleConverter.cs b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/PointToSpeckleConverter.cs deleted file mode 100644 index 585063ae7..000000000 --- a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/PointToSpeckleConverter.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Speckle.Converters.Common.Objects; -using Speckle.Objects.Geometry; - -namespace Speckle.Converters.CSiShared.ToSpeckle.Raw; - -public class PointToSpeckleConverter : ITypedConverter -{ - public Point Convert(CSiPointWrapper target) => throw new NotImplementedException(); -} diff --git a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/ShellToSpeckleConverter.cs b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/ShellToSpeckleConverter.cs new file mode 100644 index 000000000..98d58bb8d --- /dev/null +++ b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/ShellToSpeckleConverter.cs @@ -0,0 +1,7 @@ +namespace Speckle.Converters.ETABS22.ToSpeckle.Raw +{ + public class ShellToSpeckleConverter + { + + } +} diff --git a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/TendonToSpeckleConverter.cs b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/TendonToSpeckleConverter.cs deleted file mode 100644 index ca35ef762..000000000 --- a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/TendonToSpeckleConverter.cs +++ /dev/null @@ -1,3 +0,0 @@ -namespace Speckle.Converters.CSiShared.ToSpeckle.Raw; - -public class TendonToSpeckleConverter { } diff --git a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/TopLevel/CSiObjectToSpeckleConverter.cs b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/TopLevel/CSiObjectToSpeckleConverter.cs index a75f8a866..4e9589b46 100644 --- a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/TopLevel/CSiObjectToSpeckleConverter.cs +++ b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/TopLevel/CSiObjectToSpeckleConverter.cs @@ -1,60 +1,45 @@ using Speckle.Converters.Common; using Speckle.Converters.Common.Objects; -// using Speckle.Objects.Geometry; -// This will come at a later stage: using Speckle.Objects.Data; +using Speckle.Converters.CSiShared.ToSpeckle.Helpers; using Speckle.Sdk.Models; namespace Speckle.Converters.CSiShared.ToSpeckle.TopLevel; -[NameAndRankValue(nameof(CSiPointWrapper), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] -public class CSiPointToSpeckleConverter : CSiObjectToSpeckleConverter -{ - public CSiPointToSpeckleConverter( - IConverterSettingsStore settingsStore, - ITypedConverter converter - ) - : base(settingsStore, converter) { } -} - -public abstract class CSiObjectToSpeckleConverter : IToSpeckleTopLevelConverter - where TInput : ICSiWrapper - where TOutput : Base +[NameAndRankValue(nameof(ICSiWrapper), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +public class CSiObjectToSpeckleConverter : IToSpeckleTopLevelConverter { private readonly IConverterSettingsStore _settingsStore; - private readonly ITypedConverter _converter; + private readonly DisplayValueExtractor _displayValueExtractor; + + // TODO: _propertyExtractor - protected CSiObjectToSpeckleConverter( + public CSiObjectToSpeckleConverter( IConverterSettingsStore settingsStore, - ITypedConverter converter + DisplayValueExtractor displayValueExtractor + // TODO: _propertyExtractor ) { _settingsStore = settingsStore; - _converter = converter; + _displayValueExtractor = displayValueExtractor; + // TODO: _property_extractor } public Base Convert(object target) { - if (target is not TInput csiWrapper) + if (target is not ICSiWrapper csiWrapper) { - throw new ArgumentException($"Target object is not a CSi object. It's a {target.GetType()}"); + throw new ArgumentException($"Target object must be a CSi wrapper. Got {target.GetType()}"); } - var point = _converter.Convert(csiWrapper); - - var result = new CSiObject // This should be coming from sdk + var result = new CSiObject { - type = target.GetType().ToString().Split('.').Last(), - units = _settingsStore.Current.SpeckleUnits, name = csiWrapper.Name, - displayValue = new List { point } + type = csiWrapper.GetType().ToString().Split('.').Last().Replace("Wrapper", ""), + units = _settingsStore.Current.SpeckleUnits, + // TODO: properties + displayValue = _displayValueExtractor.GetDisplayValue(csiWrapper).ToList() }; - // Get properties (material, section, etc.) - // _propertyExtractor, ObjectPropertyExtractor or similar in a Helpers folder? - - // Get display value (geometry) - // _displayValueExtractor DisplayValueExtractor or SpatialDataExtractor or GeometricDataExtractor in a Helpers folder - return result; } } From aac56b8af89e050293bbd2b52ccdd281dc5c604a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn?= Date: Fri, 29 Nov 2024 16:35:45 +0100 Subject: [PATCH 04/19] raw conversion placeholders --- .../ToSpeckle/Raw/FrameToSpeckleConverter.cs | 10 +++------- .../ToSpeckle/Raw/JointToSpeckleConverter.cs | 10 +++------- .../ToSpeckle/Raw/ShellToSpeckleConverter.cs | 10 +++------- 3 files changed, 9 insertions(+), 21 deletions(-) diff --git a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/FrameToSpeckleConverter.cs b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/FrameToSpeckleConverter.cs index 269d2eb1d..fb586aff8 100644 --- a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/FrameToSpeckleConverter.cs +++ b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/FrameToSpeckleConverter.cs @@ -1,7 +1,3 @@ -namespace Speckle.Converters.ETABS22.ToSpeckle.Raw -{ - public class FrameToSpeckleConverter - { - - } -} +namespace Speckle.Converters.ETABS22.ToSpeckle.Raw; + +public class FrameToSpeckleConverter { } diff --git a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/JointToSpeckleConverter.cs b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/JointToSpeckleConverter.cs index 9c59d751e..07d6fb0a2 100644 --- a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/JointToSpeckleConverter.cs +++ b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/JointToSpeckleConverter.cs @@ -1,7 +1,3 @@ -namespace Speckle.Converters.ETABS22.ToSpeckle.Raw -{ - public class JointToSpeckleConverter - { - - } -} +namespace Speckle.Converters.ETABS22.ToSpeckle.Raw; + +public class JointToSpeckleConverter { } diff --git a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/ShellToSpeckleConverter.cs b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/ShellToSpeckleConverter.cs index 98d58bb8d..d990579e6 100644 --- a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/ShellToSpeckleConverter.cs +++ b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/ShellToSpeckleConverter.cs @@ -1,7 +1,3 @@ -namespace Speckle.Converters.ETABS22.ToSpeckle.Raw -{ - public class ShellToSpeckleConverter - { - - } -} +namespace Speckle.Converters.ETABS22.ToSpeckle.Raw; + +public class ShellToSpeckleConverter { } From 03f90f25d7fc142fb551bf3a279e9c5c63cbe93e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn?= Date: Fri, 29 Nov 2024 16:53:44 +0100 Subject: [PATCH 05/19] service registration --- .../Plugin/SpeckleFormBase.cs | 2 ++ .../ServiceRegistration.cs | 31 +++++++++++++++++++ .../Speckle.Converters.CSiShared.projitems | 1 + 3 files changed, 34 insertions(+) create mode 100644 Converters/CSi/Speckle.Converters.CSiShared/ServiceRegistration.cs diff --git a/Connectors/CSi/Speckle.Connectors.CSiShared/Plugin/SpeckleFormBase.cs b/Connectors/CSi/Speckle.Connectors.CSiShared/Plugin/SpeckleFormBase.cs index da7b7bde2..12ad13f2e 100644 --- a/Connectors/CSi/Speckle.Connectors.CSiShared/Plugin/SpeckleFormBase.cs +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/Plugin/SpeckleFormBase.cs @@ -3,6 +3,7 @@ using Speckle.Connectors.Common; using Speckle.Connectors.CSiShared.HostApp; using Speckle.Connectors.DUI.WebView; +using Speckle.Converters.CSiShared; using Speckle.Sdk.Host; namespace Speckle.Connectors.CSiShared; @@ -21,6 +22,7 @@ protected SpeckleFormBase() var services = new ServiceCollection(); services.Initialize(HostApplications.ETABS, GetVersion()); services.AddCSi(); + services.AddCSiConverters(); Container = services.BuildServiceProvider(); diff --git a/Converters/CSi/Speckle.Converters.CSiShared/ServiceRegistration.cs b/Converters/CSi/Speckle.Converters.CSiShared/ServiceRegistration.cs new file mode 100644 index 000000000..40d08c873 --- /dev/null +++ b/Converters/CSi/Speckle.Converters.CSiShared/ServiceRegistration.cs @@ -0,0 +1,31 @@ +using System.Reflection; +using Microsoft.Extensions.DependencyInjection; +using Speckle.Converters.Common; +using Speckle.Converters.CSiShared.ToSpeckle.Helpers; +using Speckle.Converters.CSiShared.ToSpeckle.TopLevel; +using Speckle.Sdk; + +namespace Speckle.Converters.CSiShared; + +public static class ServiceRegistration +{ + public static IServiceCollection AddCSiConverters(this IServiceCollection serviceCollection) + { + var converterAssembly = Assembly.GetExecutingAssembly(); + + serviceCollection.AddTransient(); + + serviceCollection.AddScoped(); + // TODO: Property extractor + + // TODO: Root + serviceCollection.AddScoped< + IConverterSettingsStore, + ConverterSettingsStore + >(); + + serviceCollection.AddMatchingInterfacesAsTransient(converterAssembly); + + return serviceCollection; + } +} diff --git a/Converters/CSi/Speckle.Converters.CSiShared/Speckle.Converters.CSiShared.projitems b/Converters/CSi/Speckle.Converters.CSiShared/Speckle.Converters.CSiShared.projitems index e30ab3690..6b2eb47c5 100644 --- a/Converters/CSi/Speckle.Converters.CSiShared/Speckle.Converters.CSiShared.projitems +++ b/Converters/CSi/Speckle.Converters.CSiShared/Speckle.Converters.CSiShared.projitems @@ -14,6 +14,7 @@ + From 9f23c50094b841f97d38ff8410b396ee8e6c83c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn?= Date: Fri, 29 Nov 2024 18:24:14 +0100 Subject: [PATCH 06/19] root to speckle --- .../HostApp/CSiSharedDocumentModelStore.cs | 75 ++++++++++- .../Operations/Send/CSiRootObjectBuilder.cs | 118 ++++++++++++++++++ .../ServiceRegistration.cs | 6 + .../Speckle.Connectors.CSiShared.projitems | 4 +- .../CSiRootToSpeckleConverter.cs | 42 +++++++ .../CSiToSpeckleUnitConverter.cs | 27 ++++ .../ServiceRegistration.cs | 5 +- .../Speckle.Converters.CSiShared.projitems | 2 + 8 files changed, 269 insertions(+), 10 deletions(-) create mode 100644 Connectors/CSi/Speckle.Connectors.CSiShared/Operations/Send/CSiRootObjectBuilder.cs create mode 100644 Converters/CSi/Speckle.Converters.CSiShared/CSiRootToSpeckleConverter.cs create mode 100644 Converters/CSi/Speckle.Converters.CSiShared/CSiToSpeckleUnitConverter.cs diff --git a/Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiSharedDocumentModelStore.cs b/Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiSharedDocumentModelStore.cs index 0117155b2..dbe2477a9 100644 --- a/Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiSharedDocumentModelStore.cs +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiSharedDocumentModelStore.cs @@ -1,14 +1,79 @@ -using Speckle.Connectors.DUI.Models; +using System.IO; +using Microsoft.Extensions.Logging; +using Speckle.Connectors.DUI.Models; using Speckle.Connectors.DUI.Utils; +using Speckle.Sdk; +using Speckle.Sdk.Helpers; +using Speckle.Sdk.Logging; namespace Speckle.Connectors.CSiShared.HostApp; public class CSiSharedDocumentModelStore : DocumentModelStore { - public CSiSharedDocumentModelStore(IJsonSerializer jsonSerializerSettings) - : base(jsonSerializerSettings) { } + private readonly ISpeckleApplication _speckleApplication; + private readonly ILogger _logger; + private readonly ICSiApplicationService _csiApplicationService; + private string HostAppUserDataPath { get; set; } + private string DocumentStateFile { get; set; } + private string ModelPathHash { get; set; } - protected override void HostAppSaveState(string modelCardState) => throw new NotImplementedException(); + public CSiSharedDocumentModelStore( + IJsonSerializer jsonSerializerSettings, + ISpeckleApplication speckleApplication, + ILogger logger, + ICSiApplicationService csiApplicationService + ) + : base(jsonSerializerSettings) + { + _speckleApplication = speckleApplication; + _logger = logger; + _csiApplicationService = csiApplicationService; + SetPaths(); + LoadState(); + } - protected override void LoadState() => throw new NotImplementedException(); + private void SetPaths() + { + ModelPathHash = Crypt.Md5(_csiApplicationService.SapModel.GetModelFilepath(), length: 32); + HostAppUserDataPath = Path.Combine( + SpecklePathProvider.UserSpeckleFolderPath, + "ConnectorsFileData", + _speckleApplication.Slug + ); + DocumentStateFile = Path.Combine(HostAppUserDataPath, $"{ModelPathHash}.json"); + } + + protected override void HostAppSaveState(string modelCardState) + { + try + { + if (!Directory.Exists(HostAppUserDataPath)) + { + Directory.CreateDirectory(HostAppUserDataPath); + } + File.WriteAllText(DocumentStateFile, modelCardState); + } + catch (Exception ex) when (!ex.IsFatal()) + { + _logger.LogError(ex.Message); + } + } + + protected override void LoadState() + { + if (!Directory.Exists(HostAppUserDataPath)) + { + ClearAndSave(); + return; + } + + if (!File.Exists(DocumentStateFile)) + { + ClearAndSave(); + return; + } + + string serializedState = File.ReadAllText(DocumentStateFile); + LoadFromString(serializedState); + } } diff --git a/Connectors/CSi/Speckle.Connectors.CSiShared/Operations/Send/CSiRootObjectBuilder.cs b/Connectors/CSi/Speckle.Connectors.CSiShared/Operations/Send/CSiRootObjectBuilder.cs new file mode 100644 index 000000000..b1caf691a --- /dev/null +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/Operations/Send/CSiRootObjectBuilder.cs @@ -0,0 +1,118 @@ +using Microsoft.Extensions.Logging; +using Speckle.Connectors.Common.Builders; +using Speckle.Connectors.Common.Caching; +using Speckle.Connectors.Common.Conversion; +using Speckle.Connectors.Common.Operations; +using Speckle.Connectors.CSiShared.HostApp; +using Speckle.Converters.Common; +using Speckle.Converters.CSiShared; +using Speckle.Sdk; +using Speckle.Sdk.Logging; +using Speckle.Sdk.Models; +using Speckle.Sdk.Models.Collections; + +namespace Speckle.Connectors.CSiShared.Builders; + +public class CSiRootObjectBuilder : IRootObjectBuilder +{ + private readonly IRootToSpeckleConverter _rootToSpeckleConverter; + private readonly ISendConversionCache _sendConversionCache; + private readonly IConverterSettingsStore _converterSettings; + private readonly ILogger _logger; + private readonly ISdkActivityFactory _activityFactory; + private readonly ICSiApplicationService _csiApplicationService; + + public CSiRootObjectBuilder( + IRootToSpeckleConverter rootToSpeckleConverter, + ISendConversionCache sendConversionCache, + IConverterSettingsStore converterSettings, + ILogger logger, + ISdkActivityFactory activityFactory, + ICSiApplicationService csiApplicationService + ) + { + _sendConversionCache = sendConversionCache; + _converterSettings = converterSettings; + _rootToSpeckleConverter = rootToSpeckleConverter; + _logger = logger; + _activityFactory = activityFactory; + _csiApplicationService = csiApplicationService; + } + + public async Task Build( + IReadOnlyList csiObjects, + SendInfo sendInfo, + IProgress onOperationProgressed, + CancellationToken cancellationToken = default + ) + { + using var activity = _activityFactory.Start("Build"); + + string fileName = _csiApplicationService.SapModel.GetModelFilename(false); + Collection rootObjectCollection = new() { name = fileName }; + rootObjectCollection["units"] = _converterSettings.Current.SpeckleUnits; + + var groupedObjects = csiObjects.GroupBy(x => x.GetType()); + List results = new(csiObjects.Count); + int count = 0; + + using (var _ = _activityFactory.Start("Convert all")) + { + foreach (var group in groupedObjects) + { + Collection typeCollection = new() { name = group.Key.Name.Replace("Wrapper", "") }; + rootObjectCollection.elements ??= new List(); + rootObjectCollection.elements.Add(typeCollection); + + foreach (ICSiWrapper csiObject in group) + { + using var _2 = _activityFactory.Start("Convert"); + cancellationToken.ThrowIfCancellationRequested(); + + var result = ConvertCSiObject(csiObject, typeCollection, sendInfo.ProjectId); + results.Add(result); + + count++; + onOperationProgressed.Report(new("Converting", (double)count / csiObjects.Count)); + } + } + } + + if (results.All(x => x.Status == Status.ERROR)) + { + throw new SpeckleException("Failed to convert all objects."); + } + + await Task.Yield(); + return new RootObjectBuilderResult(rootObjectCollection, results); + } + + private SendConversionResult ConvertCSiObject(ICSiWrapper csiObject, Collection typeCollection, string projectId) + { + string applicationId = $"{csiObject.ObjectType}{csiObject.Name}"; // TODO: NO! Use GUID + string sourceType = csiObject.GetType().Name; + + try + { + Base converted; + if (_sendConversionCache.TryGetValue(projectId, applicationId, out ObjectReference? value)) + { + converted = value; + } + else + { + converted = _rootToSpeckleConverter.Convert(csiObject); + } + + typeCollection.elements ??= new List(); + typeCollection.elements.Add(converted); + + return new(Status.SUCCESS, applicationId, sourceType, converted); + } + catch (Exception ex) when (!ex.IsFatal()) + { + _logger.LogError(ex, sourceType); + return new(Status.ERROR, applicationId, sourceType, null, ex); + } + } +} diff --git a/Connectors/CSi/Speckle.Connectors.CSiShared/ServiceRegistration.cs b/Connectors/CSi/Speckle.Connectors.CSiShared/ServiceRegistration.cs index ce63063fc..f4ab45ce6 100644 --- a/Connectors/CSi/Speckle.Connectors.CSiShared/ServiceRegistration.cs +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/ServiceRegistration.cs @@ -1,6 +1,9 @@ using Microsoft.Extensions.DependencyInjection; using Speckle.Connectors.Common; +using Speckle.Connectors.Common.Builders; +using Speckle.Connectors.Common.Operations; using Speckle.Connectors.CSiShared.Bindings; +using Speckle.Connectors.CSiShared.Builders; using Speckle.Connectors.CSiShared.Filters; using Speckle.Connectors.CSiShared.HostApp; using Speckle.Connectors.DUI; @@ -9,6 +12,7 @@ using Speckle.Connectors.DUI.Models; using Speckle.Connectors.DUI.Models.Card.SendFilter; using Speckle.Connectors.DUI.WebView; +using Speckle.Converters.CSiShared; namespace Speckle.Connectors.CSiShared; @@ -37,6 +41,8 @@ public static IServiceCollection AddCSi(this IServiceCollection services) services.AddSingleton(); services.AddScoped(); + services.AddScoped, CSiRootObjectBuilder>(); + services.AddScoped>(); services.RegisterTopLevelExceptionHandler(); diff --git a/Connectors/CSi/Speckle.Connectors.CSiShared/Speckle.Connectors.CSiShared.projitems b/Connectors/CSi/Speckle.Connectors.CSiShared/Speckle.Connectors.CSiShared.projitems index a6d4f85a5..17f10af31 100644 --- a/Connectors/CSi/Speckle.Connectors.CSiShared/Speckle.Connectors.CSiShared.projitems +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/Speckle.Connectors.CSiShared.projitems @@ -13,6 +13,7 @@ + Form @@ -24,7 +25,4 @@ - - - diff --git a/Converters/CSi/Speckle.Converters.CSiShared/CSiRootToSpeckleConverter.cs b/Converters/CSi/Speckle.Converters.CSiShared/CSiRootToSpeckleConverter.cs new file mode 100644 index 000000000..f99a75692 --- /dev/null +++ b/Converters/CSi/Speckle.Converters.CSiShared/CSiRootToSpeckleConverter.cs @@ -0,0 +1,42 @@ +using Microsoft.Extensions.Logging; +using Speckle.Converters.Common; +using Speckle.Converters.Common.Objects; +using Speckle.Converters.Common.Registration; +using Speckle.Sdk.Common.Exceptions; +using Speckle.Sdk.Models; + +namespace Speckle.Converters.CSiShared; + +public class CSiRootToSpeckleConverter : IRootToSpeckleConverter +{ + private readonly IConverterManager _toSpeckle; + private readonly IConverterSettingsStore _settingsStore; + private readonly ILogger _logger; + + public CSiRootToSpeckleConverter( + IConverterManager toSpeckle, + IConverterSettingsStore settingsStore, + ILogger logger + ) + { + _toSpeckle = toSpeckle; + _settingsStore = settingsStore; + _logger = logger; + } + + public Base Convert(object target) + { + if (target is not ICSiWrapper wrapper) + { + throw new ValidationException($"Target object is not a CSiWrapper. It's a ${target.GetType()}"); + } + + Type type = target.GetType(); + var objectConverter = _toSpeckle.ResolveConverter(type, true); + + Base result = objectConverter.Convert(target); + result.applicationId = $"{wrapper.ObjectType}{wrapper.Name}"; + + return result; + } +} diff --git a/Converters/CSi/Speckle.Converters.CSiShared/CSiToSpeckleUnitConverter.cs b/Converters/CSi/Speckle.Converters.CSiShared/CSiToSpeckleUnitConverter.cs new file mode 100644 index 000000000..d48961448 --- /dev/null +++ b/Converters/CSi/Speckle.Converters.CSiShared/CSiToSpeckleUnitConverter.cs @@ -0,0 +1,27 @@ +using Speckle.Converters.Common; + +namespace Speckle.Converters.CSiShared; + +// TODO: Unit conversions! This is all gross, I know! +public class CSiToSpeckleUnitConverter : IHostToSpeckleUnitConverter +{ +#pragma warning disable IDE0060 + public string ToSpeckle(string value) +#pragma warning restore IDE0060 + { + // CSi default is meters + return "m"; + } + +#pragma warning disable IDE0060 + public string FromSpeckle(string value) +#pragma warning restore IDE0060 + { + return "m"; + } + + public string ConvertOrThrow(string hostUnit) + { + return hostUnit ?? throw new ArgumentNullException(nameof(hostUnit), "Host unit cannot be null"); + } +} diff --git a/Converters/CSi/Speckle.Converters.CSiShared/ServiceRegistration.cs b/Converters/CSi/Speckle.Converters.CSiShared/ServiceRegistration.cs index 40d08c873..f5724a8b7 100644 --- a/Converters/CSi/Speckle.Converters.CSiShared/ServiceRegistration.cs +++ b/Converters/CSi/Speckle.Converters.CSiShared/ServiceRegistration.cs @@ -1,6 +1,7 @@ using System.Reflection; using Microsoft.Extensions.DependencyInjection; using Speckle.Converters.Common; +using Speckle.Converters.Common.Registration; using Speckle.Converters.CSiShared.ToSpeckle.Helpers; using Speckle.Converters.CSiShared.ToSpeckle.TopLevel; using Speckle.Sdk; @@ -14,11 +15,11 @@ public static IServiceCollection AddCSiConverters(this IServiceCollection servic var converterAssembly = Assembly.GetExecutingAssembly(); serviceCollection.AddTransient(); - serviceCollection.AddScoped(); // TODO: Property extractor - // TODO: Root + serviceCollection.AddRootCommon(converterAssembly); + serviceCollection.AddApplicationConverters(converterAssembly); serviceCollection.AddScoped< IConverterSettingsStore, ConverterSettingsStore diff --git a/Converters/CSi/Speckle.Converters.CSiShared/Speckle.Converters.CSiShared.projitems b/Converters/CSi/Speckle.Converters.CSiShared/Speckle.Converters.CSiShared.projitems index 6b2eb47c5..af4952ac6 100644 --- a/Converters/CSi/Speckle.Converters.CSiShared/Speckle.Converters.CSiShared.projitems +++ b/Converters/CSi/Speckle.Converters.CSiShared/Speckle.Converters.CSiShared.projitems @@ -12,6 +12,8 @@ + + From 336b5c55ca440fca1a2522045cfd244d4cc90757 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn?= Date: Sat, 30 Nov 2024 16:18:38 +0100 Subject: [PATCH 07/19] type registration and resolution CSiWrapperBase instead of ICSiWrapper correctly resolves all types --- .../ToSpeckle/TopLevel/CSiObjectToSpeckleConverter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/TopLevel/CSiObjectToSpeckleConverter.cs b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/TopLevel/CSiObjectToSpeckleConverter.cs index 4e9589b46..4225ca7d8 100644 --- a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/TopLevel/CSiObjectToSpeckleConverter.cs +++ b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/TopLevel/CSiObjectToSpeckleConverter.cs @@ -5,7 +5,7 @@ namespace Speckle.Converters.CSiShared.ToSpeckle.TopLevel; -[NameAndRankValue(nameof(ICSiWrapper), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] +[NameAndRankValue(nameof(CSiWrapperBase), NameAndRankValueAttribute.SPECKLE_DEFAULT_RANK)] public class CSiObjectToSpeckleConverter : IToSpeckleTopLevelConverter { private readonly IConverterSettingsStore _settingsStore; From 00912724b574ffcf27295a256090106cd74a762d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn?= Date: Sat, 30 Nov 2024 17:35:02 +0100 Subject: [PATCH 08/19] Setting up object level converters --- .../ToSpeckle/Raw/FrameToSpeckleConverter.cs | 42 ++++++++++++++++++- .../ToSpeckle/Raw/JointToSpeckleConverter.cs | 2 +- .../ToSpeckle/Raw/ShellToSpeckleConverter.cs | 2 +- 3 files changed, 42 insertions(+), 4 deletions(-) diff --git a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/FrameToSpeckleConverter.cs b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/FrameToSpeckleConverter.cs index fb586aff8..c4911ef3c 100644 --- a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/FrameToSpeckleConverter.cs +++ b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/FrameToSpeckleConverter.cs @@ -1,3 +1,41 @@ -namespace Speckle.Converters.ETABS22.ToSpeckle.Raw; +using Speckle.Converters.Common; +using Speckle.Converters.Common.Objects; +using Speckle.Objects.Geometry; -public class FrameToSpeckleConverter { } +namespace Speckle.Converters.CSiShared.ToSpeckle.Raw; + +public class FrameToSpeckleConverter : ITypedConverter +{ + private readonly IConverterSettingsStore _settingsStore; + private readonly ITypedConverter _pointConverter; + private readonly ICSiApplicationService _csiApplicationService; // I need access to the SapModel here, but this is in the connectors project. + + public FrameToSpeckleConverter( + IConverterSettingsStore settingsStore, + ITypedConverter pointConverter, + ICSiApplicationService csiApplicationService + ) + { + _settingsStore = settingsStore; + _pointConverter = pointConverter; + _csiApplicationService = csiApplicationService; + } + + public Line Convert(CSiFrameWrapper target) + { + string Point1 = ""; + string Point2 = ""; + int result = cSapModel.FrameObj.GetPoints(target.Name, ref Point1, ref Point2); + if (result != 0) + { + throw new Exception($"Failed to convert frame {target.Name}"); + } + + return new() + { + start = _pointConverter.Convert(Point1), + end = _pointConverter.Convert(Point2), + units = _settingsStore.Current.SpeckleUnits + }; + } +} diff --git a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/JointToSpeckleConverter.cs b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/JointToSpeckleConverter.cs index 07d6fb0a2..8b4dd6091 100644 --- a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/JointToSpeckleConverter.cs +++ b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/JointToSpeckleConverter.cs @@ -1,3 +1,3 @@ -namespace Speckle.Converters.ETABS22.ToSpeckle.Raw; +namespace Speckle.Converters.CSiShared.ToSpeckle.Raw; public class JointToSpeckleConverter { } diff --git a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/ShellToSpeckleConverter.cs b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/ShellToSpeckleConverter.cs index d990579e6..6d3aa15d8 100644 --- a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/ShellToSpeckleConverter.cs +++ b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/ShellToSpeckleConverter.cs @@ -1,3 +1,3 @@ -namespace Speckle.Converters.ETABS22.ToSpeckle.Raw; +namespace Speckle.Converters.CSiShared.ToSpeckle.Raw; public class ShellToSpeckleConverter { } From b5fb154f9a2cc6164e71f56c18f2a30366906640 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn?= Date: Sun, 1 Dec 2024 13:26:46 +0100 Subject: [PATCH 09/19] some basic conversions --- .../Helpers/DisplayValueExtractor.cs | 35 ++++++++++++---- .../ToSpeckle/Raw/FrameToSpeckleConverter.cs | 41 +++++++++++++------ .../ToSpeckle/Raw/JointToSpeckleConverter.cs | 39 +++++++++++++++++- 3 files changed, 95 insertions(+), 20 deletions(-) diff --git a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Helpers/DisplayValueExtractor.cs b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Helpers/DisplayValueExtractor.cs index 76952031d..c0a65a709 100644 --- a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Helpers/DisplayValueExtractor.cs +++ b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Helpers/DisplayValueExtractor.cs @@ -1,25 +1,46 @@ +using Speckle.Converters.Common.Objects; +using Speckle.Objects.Geometry; using Speckle.Sdk.Models; namespace Speckle.Converters.CSiShared.ToSpeckle.Helpers; public class DisplayValueExtractor { - public DisplayValueExtractor() { } + private readonly ITypedConverter _jointConverter; + private readonly ITypedConverter _frameConverter; + private readonly ITypedConverter _shellConverter; + + public DisplayValueExtractor( + ITypedConverter jointConverter, + ITypedConverter frameConverter, + ITypedConverter shellConverter + ) + { + _jointConverter = jointConverter; + _frameConverter = frameConverter; + _shellConverter = shellConverter; + } public IEnumerable GetDisplayValue(ICSiWrapper wrapper) { return wrapper switch { - CSiJointWrapper joint => ExtractJoint(joint.Name), - CSiFrameWrapper frame => ExtractFrame(frame.Name), - CSiShellWrapper shell => ExtractShell(shell.Name), + CSiJointWrapper joint => ExtractJoint(joint), + CSiFrameWrapper frame => ExtractFrame(frame), + CSiShellWrapper shell => ExtractShell(shell), _ => Enumerable.Empty() }; } - private IEnumerable ExtractJoint(string name) => throw new NotImplementedException(); + private IEnumerable ExtractJoint(CSiJointWrapper target) + { + yield return _jointConverter.Convert(target); + } - private IEnumerable ExtractFrame(string name) => throw new NotImplementedException(); + private IEnumerable ExtractFrame(CSiFrameWrapper target) + { + yield return _frameConverter.Convert(target); + } - private IEnumerable ExtractShell(string name) => throw new NotImplementedException(); + private IEnumerable ExtractShell(CSiShellWrapper target) => throw new NotImplementedException(); } diff --git a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/FrameToSpeckleConverter.cs b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/FrameToSpeckleConverter.cs index c4911ef3c..59e34f130 100644 --- a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/FrameToSpeckleConverter.cs +++ b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/FrameToSpeckleConverter.cs @@ -4,37 +4,54 @@ namespace Speckle.Converters.CSiShared.ToSpeckle.Raw; +// NOTE: This is HORRIBLE but serves just as a poc! We need point caching and weak referencing to joint objects public class FrameToSpeckleConverter : ITypedConverter { private readonly IConverterSettingsStore _settingsStore; private readonly ITypedConverter _pointConverter; - private readonly ICSiApplicationService _csiApplicationService; // I need access to the SapModel here, but this is in the connectors project. public FrameToSpeckleConverter( IConverterSettingsStore settingsStore, - ITypedConverter pointConverter, - ICSiApplicationService csiApplicationService + ITypedConverter pointConverter ) { _settingsStore = settingsStore; _pointConverter = pointConverter; - _csiApplicationService = csiApplicationService; } - public Line Convert(CSiFrameWrapper target) + public Line Convert(CSiFrameWrapper target) // NOTE: THIS IS TEMPORARY { - string Point1 = ""; - string Point2 = ""; - int result = cSapModel.FrameObj.GetPoints(target.Name, ref Point1, ref Point2); - if (result != 0) + // frame points + string startPoint = "", + endPoint = ""; + if (_settingsStore.Current.SapModel.FrameObj.GetPoints(target.Name, ref startPoint, ref endPoint) != 0) { - throw new Exception($"Failed to convert frame {target.Name}"); + throw new ArgumentException($"Failed to convert frame {target.Name}"); } + // start point coordinates + double startX = 0, + startY = 0, + startZ = 0; + if (_settingsStore.Current.SapModel.PointObj.GetCoordCartesian(startPoint, ref startX, ref startY, ref startZ) != 0) + { + throw new ArgumentException($"Failed to convert point {startPoint}"); + } + + // end point coordinates + double endX = 0, + endY = 0, + endZ = 0; + if (_settingsStore.Current.SapModel.PointObj.GetCoordCartesian(endPoint, ref endX, ref endY, ref endZ) != 0) + { + throw new ArgumentException($"Failed to convert point {endPoint}"); + } + + // Create and return the line return new() { - start = _pointConverter.Convert(Point1), - end = _pointConverter.Convert(Point2), + start = new Point(startX, startY, startZ, _settingsStore.Current.SpeckleUnits), + end = new Point(endX, endY, endZ, _settingsStore.Current.SpeckleUnits), units = _settingsStore.Current.SpeckleUnits }; } diff --git a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/JointToSpeckleConverter.cs b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/JointToSpeckleConverter.cs index 8b4dd6091..927785e22 100644 --- a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/JointToSpeckleConverter.cs +++ b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/JointToSpeckleConverter.cs @@ -1,3 +1,40 @@ +using Speckle.Converters.Common; +using Speckle.Converters.Common.Objects; +using Speckle.Objects.Geometry; + namespace Speckle.Converters.CSiShared.ToSpeckle.Raw; -public class JointToSpeckleConverter { } +public class JointToSpeckleConverter : ITypedConverter +{ + private readonly IConverterSettingsStore _settingStore; + + public JointToSpeckleConverter(IConverterSettingsStore settingStore) + { + _settingStore = settingStore; + } + + public Point Convert(CSiJointWrapper target) // NOTE: This is just a tempoarary POC + { + string applicationId = ""; + + _ = _settingStore.Current.SapModel.PointObj.GetGUID(target.Name, ref applicationId); + + double pointX = 0; + double pointY = 0; + double pointZ = 0; + + int result = _settingStore.Current.SapModel.PointObj.GetCoordCartesian( + target.Name, + ref pointX, + ref pointY, + ref pointZ + ); + + if (result != 0) + { + throw new ArgumentException($"Failed to convert {target.Name} to {typeof(Point)}"); + } + + return new(pointX, pointY, pointZ, _settingStore.Current.SpeckleUnits, applicationId); + } +} From 173451f6da21f6f1c6ba6f6e6d84662f4a3ec08e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn?= Date: Sun, 1 Dec 2024 17:25:54 +0100 Subject: [PATCH 10/19] units framework --- .../CSiConversionSettingsFactory.cs | 6 +-- .../CSiToSpeckleUnitConverter.cs | 49 ++++++++++++------- .../ServiceRegistration.cs | 3 +- .../ToSpeckle/Raw/JointToSpeckleConverter.cs | 2 +- 4 files changed, 38 insertions(+), 22 deletions(-) diff --git a/Converters/CSi/Speckle.Converters.CSiShared/CSiConversionSettingsFactory.cs b/Converters/CSi/Speckle.Converters.CSiShared/CSiConversionSettingsFactory.cs index a6c7f0d80..89aade283 100644 --- a/Converters/CSi/Speckle.Converters.CSiShared/CSiConversionSettingsFactory.cs +++ b/Converters/CSi/Speckle.Converters.CSiShared/CSiConversionSettingsFactory.cs @@ -5,12 +5,12 @@ namespace Speckle.Converters.CSiShared; [GenerateAutoInterface] public class CSiConversionSettingsFactory( - IHostToSpeckleUnitConverter unitsConverter, + IHostToSpeckleUnitConverter unitsConverter, IConverterSettingsStore settingsStore ) : ICSiConversionSettingsFactory { public CSiConversionSettings Current => settingsStore.Current; - // TODO: Units currently hard-coded - public CSiConversionSettings Create(cSapModel document) => new(document, unitsConverter.ConvertOrThrow("mm")); + public CSiConversionSettings Create(cSapModel document) => + new(document, unitsConverter.ConvertOrThrow(document.GetPresentUnits())); } diff --git a/Converters/CSi/Speckle.Converters.CSiShared/CSiToSpeckleUnitConverter.cs b/Converters/CSi/Speckle.Converters.CSiShared/CSiToSpeckleUnitConverter.cs index d48961448..ab8e3df92 100644 --- a/Converters/CSi/Speckle.Converters.CSiShared/CSiToSpeckleUnitConverter.cs +++ b/Converters/CSi/Speckle.Converters.CSiShared/CSiToSpeckleUnitConverter.cs @@ -1,27 +1,42 @@ using Speckle.Converters.Common; +using Speckle.Sdk.Common; +using Speckle.Sdk.Common.Exceptions; namespace Speckle.Converters.CSiShared; -// TODO: Unit conversions! This is all gross, I know! -public class CSiToSpeckleUnitConverter : IHostToSpeckleUnitConverter +/// +/// Convert CSi eUnits enumeration to Speckle units. +/// +/// +/// CSi GetPresentUnits() valid for both SAP 2000 and ETABS. +/// Represents units transmitted through API calls and not necessarily those displayed in GUI. +/// +public class CSiToSpeckleUnitConverter : IHostToSpeckleUnitConverter { -#pragma warning disable IDE0060 - public string ToSpeckle(string value) -#pragma warning restore IDE0060 - { - // CSi default is meters - return "m"; - } + private readonly Dictionary _unitMapping = new Dictionary(); -#pragma warning disable IDE0060 - public string FromSpeckle(string value) -#pragma warning restore IDE0060 + public CSiToSpeckleUnitConverter() { - return "m"; + _unitMapping[eUnits.lb_in_F] = Units.Inches; + _unitMapping[eUnits.lb_ft_F] = Units.Feet; + _unitMapping[eUnits.kip_in_F] = Units.Inches; + _unitMapping[eUnits.kip_ft_F] = Units.Feet; + _unitMapping[eUnits.kN_mm_C] = Units.Millimeters; + _unitMapping[eUnits.kN_m_C] = Units.Meters; + _unitMapping[eUnits.kgf_mm_C] = Units.Millimeters; + _unitMapping[eUnits.kgf_m_C] = Units.Meters; + _unitMapping[eUnits.N_mm_C] = Units.Millimeters; + _unitMapping[eUnits.N_m_C] = Units.Meters; + _unitMapping[eUnits.Ton_mm_C] = Units.Millimeters; + _unitMapping[eUnits.Ton_m_C] = Units.Meters; + _unitMapping[eUnits.kN_cm_C] = Units.Centimeters; + _unitMapping[eUnits.kgf_cm_C] = Units.Centimeters; + _unitMapping[eUnits.N_cm_C] = Units.Centimeters; + _unitMapping[eUnits.Ton_cm_C] = Units.Centimeters; } - public string ConvertOrThrow(string hostUnit) - { - return hostUnit ?? throw new ArgumentNullException(nameof(hostUnit), "Host unit cannot be null"); - } + public string ConvertOrThrow(eUnits hostUnit) => + _unitMapping.TryGetValue(hostUnit, out string? value) + ? value + : throw new UnitNotSupportedException($"The Unit System \"{hostUnit}\" is unsupported."); } diff --git a/Converters/CSi/Speckle.Converters.CSiShared/ServiceRegistration.cs b/Converters/CSi/Speckle.Converters.CSiShared/ServiceRegistration.cs index f5724a8b7..aa6819e91 100644 --- a/Converters/CSi/Speckle.Converters.CSiShared/ServiceRegistration.cs +++ b/Converters/CSi/Speckle.Converters.CSiShared/ServiceRegistration.cs @@ -16,10 +16,11 @@ public static IServiceCollection AddCSiConverters(this IServiceCollection servic serviceCollection.AddTransient(); serviceCollection.AddScoped(); + // TODO: Property extractor serviceCollection.AddRootCommon(converterAssembly); - serviceCollection.AddApplicationConverters(converterAssembly); + serviceCollection.AddApplicationConverters(converterAssembly); serviceCollection.AddScoped< IConverterSettingsStore, ConverterSettingsStore diff --git a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/JointToSpeckleConverter.cs b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/JointToSpeckleConverter.cs index 927785e22..93efabda0 100644 --- a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/JointToSpeckleConverter.cs +++ b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/JointToSpeckleConverter.cs @@ -13,7 +13,7 @@ public JointToSpeckleConverter(IConverterSettingsStore se _settingStore = settingStore; } - public Point Convert(CSiJointWrapper target) // NOTE: This is just a tempoarary POC + public Point Convert(CSiJointWrapper target) // NOTE: This is just a temporary POC { string applicationId = ""; From 480099687f6304e6e1662011e2713c28ffa116c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn?= Date: Mon, 2 Dec 2024 12:55:07 +0100 Subject: [PATCH 11/19] raw conversion placeholders these are gross (just a poc for first send) --- .../Helpers/DisplayValueExtractor.cs | 5 +- .../ToSpeckle/Raw/ShellToSpeckleConverter.cs | 68 ++++++++++++++++++- 2 files changed, 71 insertions(+), 2 deletions(-) diff --git a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Helpers/DisplayValueExtractor.cs b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Helpers/DisplayValueExtractor.cs index c0a65a709..248d21465 100644 --- a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Helpers/DisplayValueExtractor.cs +++ b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Helpers/DisplayValueExtractor.cs @@ -42,5 +42,8 @@ private IEnumerable ExtractFrame(CSiFrameWrapper target) yield return _frameConverter.Convert(target); } - private IEnumerable ExtractShell(CSiShellWrapper target) => throw new NotImplementedException(); + private IEnumerable ExtractShell(CSiShellWrapper target) + { + yield return _shellConverter.Convert(target); + } } diff --git a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/ShellToSpeckleConverter.cs b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/ShellToSpeckleConverter.cs index 6d3aa15d8..21529096d 100644 --- a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/ShellToSpeckleConverter.cs +++ b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/ShellToSpeckleConverter.cs @@ -1,3 +1,69 @@ +using Speckle.Converters.Common; +using Speckle.Converters.Common.Objects; +using Speckle.Objects.Geometry; + namespace Speckle.Converters.CSiShared.ToSpeckle.Raw; -public class ShellToSpeckleConverter { } +public class ShellToSpeckleConverter : ITypedConverter +{ + private readonly IConverterSettingsStore _settingsStore; + + public ShellToSpeckleConverter(IConverterSettingsStore settingsStore) + { + _settingsStore = settingsStore; + } + + public Mesh Convert(CSiShellWrapper target) + { + int numberPoints = 0; + string[] pointNames = Array.Empty(); + int result = _settingsStore.Current.SapModel.AreaObj.GetPoints(target.Name, ref numberPoints, ref pointNames); + + if (result != 0) + { + throw new ArgumentException($"Failed to convert {target.Name} to Speckle Mesh"); + } + + // List to store vertices defining a face + List vertices = new List(); + List faces = new List(); + + // How many vertices to define a face? + faces.Add(numberPoints); + + // Lopp through points to get coordinates + // TODO: This is gross! + foreach (string pointName in pointNames) + { + double pointX = 0; + double pointY = 0; + double pointZ = 0; + + result = _settingsStore.Current.SapModel.PointObj.GetCoordCartesian( + pointName, + ref pointX, + ref pointY, + ref pointZ + ); + + if (result != 0) + { + throw new ArgumentException($"Failed to retrieve coordinate of vertex point name {pointName}."); + } + + // Add vertex info + vertices.Add(pointX); + vertices.Add(pointY); + vertices.Add(pointZ); + + // TODO: Check normals direction? + } + + return new Mesh() + { + vertices = vertices, + faces = faces, + units = _settingsStore.Current.SpeckleUnits + }; + } +} From 71b3298533d36367634ab383d6e5380535fe2b8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn?= Date: Mon, 2 Dec 2024 13:50:40 +0100 Subject: [PATCH 12/19] CollectionManager Simple organization --- .../HostApp/CSiSendCollectionManager.cs | 35 +++++++++++++++++++ .../Operations/Send/CSiRootObjectBuilder.cs | 34 ++++++++---------- .../ServiceRegistration.cs | 1 + .../Speckle.Connectors.CSiShared.projitems | 1 + 4 files changed, 52 insertions(+), 19 deletions(-) create mode 100644 Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiSendCollectionManager.cs diff --git a/Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiSendCollectionManager.cs b/Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiSendCollectionManager.cs new file mode 100644 index 000000000..f0ee37ab3 --- /dev/null +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiSendCollectionManager.cs @@ -0,0 +1,35 @@ +using Speckle.Converters.Common; +using Speckle.Converters.CSiShared; +using Speckle.Sdk.Models.Collections; + +namespace Speckle.Connectors.CSiShared.HostApp; + +public class CSiSendCollectionManager +{ + private readonly IConverterSettingsStore _converterSettings; + private readonly Dictionary _collectionCache = new(); + + public CSiSendCollectionManager(IConverterSettingsStore converterSettings) + { + _converterSettings = converterSettings; + } + + // TODO: Frames could be further classified under Columns, Braces and Beams. Same for shells: walls, floors + public Collection GetAndCreateObjectHostCollection(ICSiWrapper csiObject, Collection rootObject) + { + var path = csiObject.GetType().Name.Replace("Wrapper", ""); // CSiJointWrapper → CSiJoint, CSiFrameWrapper → CSiFrame etc. + + if (_collectionCache.TryGetValue(path, out Collection? value)) + { + return value; + } + + Collection childCollection = new(path); + rootObject.elements.Add(childCollection); + _collectionCache[path] = childCollection; + + rootObject = childCollection; + + return rootObject; + } +} diff --git a/Connectors/CSi/Speckle.Connectors.CSiShared/Operations/Send/CSiRootObjectBuilder.cs b/Connectors/CSi/Speckle.Connectors.CSiShared/Operations/Send/CSiRootObjectBuilder.cs index b1caf691a..e652f39fa 100644 --- a/Connectors/CSi/Speckle.Connectors.CSiShared/Operations/Send/CSiRootObjectBuilder.cs +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/Operations/Send/CSiRootObjectBuilder.cs @@ -18,6 +18,7 @@ public class CSiRootObjectBuilder : IRootObjectBuilder private readonly IRootToSpeckleConverter _rootToSpeckleConverter; private readonly ISendConversionCache _sendConversionCache; private readonly IConverterSettingsStore _converterSettings; + private readonly CSiSendCollectionManager _sendCollectionManager; private readonly ILogger _logger; private readonly ISdkActivityFactory _activityFactory; private readonly ICSiApplicationService _csiApplicationService; @@ -26,6 +27,7 @@ public CSiRootObjectBuilder( IRootToSpeckleConverter rootToSpeckleConverter, ISendConversionCache sendConversionCache, IConverterSettingsStore converterSettings, + CSiSendCollectionManager sendCollectionManager, ILogger logger, ISdkActivityFactory activityFactory, ICSiApplicationService csiApplicationService @@ -33,6 +35,7 @@ ICSiApplicationService csiApplicationService { _sendConversionCache = sendConversionCache; _converterSettings = converterSettings; + _sendCollectionManager = sendCollectionManager; _rootToSpeckleConverter = rootToSpeckleConverter; _logger = logger; _activityFactory = activityFactory; @@ -48,33 +51,25 @@ public async Task Build( { using var activity = _activityFactory.Start("Build"); - string fileName = _csiApplicationService.SapModel.GetModelFilename(false); - Collection rootObjectCollection = new() { name = fileName }; + string modelFileName = _csiApplicationService.SapModel.GetModelFilename(false) ?? "Unnamed model"; + Collection rootObjectCollection = new() { name = modelFileName }; rootObjectCollection["units"] = _converterSettings.Current.SpeckleUnits; - var groupedObjects = csiObjects.GroupBy(x => x.GetType()); List results = new(csiObjects.Count); int count = 0; using (var _ = _activityFactory.Start("Convert all")) { - foreach (var group in groupedObjects) + foreach (ICSiWrapper csiObject in csiObjects) { - Collection typeCollection = new() { name = group.Key.Name.Replace("Wrapper", "") }; - rootObjectCollection.elements ??= new List(); - rootObjectCollection.elements.Add(typeCollection); + using var _2 = _activityFactory.Start("Convert"); + cancellationToken.ThrowIfCancellationRequested(); - foreach (ICSiWrapper csiObject in group) - { - using var _2 = _activityFactory.Start("Convert"); - cancellationToken.ThrowIfCancellationRequested(); + var result = ConvertCSiObject(csiObject, rootObjectCollection, sendInfo.ProjectId); + results.Add(result); - var result = ConvertCSiObject(csiObject, typeCollection, sendInfo.ProjectId); - results.Add(result); - - count++; - onOperationProgressed.Report(new("Converting", (double)count / csiObjects.Count)); - } + count++; + onOperationProgressed.Report(new("Converting", (double)count / csiObjects.Count)); } } @@ -104,8 +99,9 @@ private SendConversionResult ConvertCSiObject(ICSiWrapper csiObject, Collection converted = _rootToSpeckleConverter.Convert(csiObject); } - typeCollection.elements ??= new List(); - typeCollection.elements.Add(converted); + var collection = _sendCollectionManager.GetAndCreateObjectHostCollection(csiObject, typeCollection); + collection.elements ??= new List(); + collection.elements.Add(converted); return new(Status.SUCCESS, applicationId, sourceType, converted); } diff --git a/Connectors/CSi/Speckle.Connectors.CSiShared/ServiceRegistration.cs b/Connectors/CSi/Speckle.Connectors.CSiShared/ServiceRegistration.cs index f4ab45ce6..b07a76bb3 100644 --- a/Connectors/CSi/Speckle.Connectors.CSiShared/ServiceRegistration.cs +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/ServiceRegistration.cs @@ -41,6 +41,7 @@ public static IServiceCollection AddCSi(this IServiceCollection services) services.AddSingleton(); services.AddScoped(); + services.AddScoped(); services.AddScoped, CSiRootObjectBuilder>(); services.AddScoped>(); diff --git a/Connectors/CSi/Speckle.Connectors.CSiShared/Speckle.Connectors.CSiShared.projitems b/Connectors/CSi/Speckle.Connectors.CSiShared/Speckle.Connectors.CSiShared.projitems index 17f10af31..997972617 100644 --- a/Connectors/CSi/Speckle.Connectors.CSiShared/Speckle.Connectors.CSiShared.projitems +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/Speckle.Connectors.CSiShared.projitems @@ -13,6 +13,7 @@ + From fce77fc66b7e22c02b4d290ce750491ecf14a4c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn?= Date: Mon, 2 Dec 2024 15:25:41 +0100 Subject: [PATCH 13/19] Comments --- .../Bindings/CSiSharedSelectionBinding.cs | 12 +++++-- .../Bindings/CSiSharedSendBinding.cs | 2 +- .../HostApp/CSiApplicationService.cs | 34 +++++++++++++++++++ ...ModelStore.cs => CSiDocumentModelStore.cs} | 8 ++--- ...SharedIdleManager.cs => CSiIdleManager.cs} | 6 ++-- .../HostApp/CSiSendCollectionManager.cs | 9 ++++- .../HostApp/CSiSharedApplicationService.cs | 27 --------------- ...SiSharedPluginBase.cs => CSiPluginBase.cs} | 4 +-- .../ServiceRegistration.cs | 6 ++-- .../Speckle.Connectors.CSiShared.projitems | 8 ++--- .../Utils/ObjectIdentifiers.cs | 18 ++++++---- .../Plugin/cPlugin.cs | 2 +- .../Plugin/cPlugin.cs | 2 +- .../Speckle.Converters.CSiShared/CSiObject.cs | 1 + .../CSiWrappers.cs | 15 ++++++++ .../ToSpeckle/Raw/FrameToSpeckleConverter.cs | 2 +- .../ToSpeckle/Raw/JointToSpeckleConverter.cs | 1 + .../ToSpeckle/Raw/ShellToSpeckleConverter.cs | 1 + .../TopLevel/CSiObjectToSpeckleConverter.cs | 2 +- 19 files changed, 101 insertions(+), 59 deletions(-) create mode 100644 Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiApplicationService.cs rename Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/{CSiSharedDocumentModelStore.cs => CSiDocumentModelStore.cs} (90%) rename Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/{CSiSharedIdleManager.cs => CSiIdleManager.cs} (62%) delete mode 100644 Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiSharedApplicationService.cs rename Connectors/CSi/Speckle.Connectors.CSiShared/Plugin/{CSiSharedPluginBase.cs => CSiPluginBase.cs} (92%) diff --git a/Connectors/CSi/Speckle.Connectors.CSiShared/Bindings/CSiSharedSelectionBinding.cs b/Connectors/CSi/Speckle.Connectors.CSiShared/Bindings/CSiSharedSelectionBinding.cs index 2275c8c61..5ba75ef41 100644 --- a/Connectors/CSi/Speckle.Connectors.CSiShared/Bindings/CSiSharedSelectionBinding.cs +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/Bindings/CSiSharedSelectionBinding.cs @@ -9,7 +9,7 @@ public class CSiSharedSelectionBinding : ISelectionBinding { public string Name => "selectionBinding"; public IBrowserBridge Parent { get; } - private readonly ICSiApplicationService _csiApplicationService; // Update selection binding to centralized CSiSharedApplicationService instead of trying to maintain a reference to "sapModel" + private readonly ICSiApplicationService _csiApplicationService; public CSiSharedSelectionBinding(IBrowserBridge parent, ICSiApplicationService csiApplicationService) { @@ -17,9 +17,15 @@ public CSiSharedSelectionBinding(IBrowserBridge parent, ICSiApplicationService c _csiApplicationService = csiApplicationService; } + /// + /// Gets the selection and creates an encoded ID (objectType and objectName). + /// + /// + /// Refer to ObjectIdentifier.cs for more info. + /// public SelectionInfo GetSelection() { - // TODO: Handle better. Enums? ObjectType same in ETABS and SAP + // TODO: Since this is standard across CSi Suite - better stored in an enum? var objectTypeMap = new Dictionary { { 1, "Point" }, @@ -46,7 +52,7 @@ public SelectionInfo GetSelection() var typeName = objectTypeMap.TryGetValue(typeKey, out var name) ? name : $"Unknown ({typeKey})"; encodedIds.Add(ObjectIdentifier.Encode(typeKey, objectName[i])); - typeCounts[typeName] = (typeCounts.TryGetValue(typeName, out var count) ? count : 0) + 1; // NOTE: Cross-framework compatibility + typeCounts[typeName] = (typeCounts.TryGetValue(typeName, out var count) ? count : 0) + 1; // NOTE: Cross-framework compatibility (net 48 and net8) } var summary = diff --git a/Connectors/CSi/Speckle.Connectors.CSiShared/Bindings/CSiSharedSendBinding.cs b/Connectors/CSi/Speckle.Connectors.CSiShared/Bindings/CSiSharedSendBinding.cs index a18c2c7cc..2514121d0 100644 --- a/Connectors/CSi/Speckle.Connectors.CSiShared/Bindings/CSiSharedSendBinding.cs +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/Bindings/CSiSharedSendBinding.cs @@ -33,7 +33,7 @@ public sealed class CSiSharedSendBinding : ISendBinding private readonly CancellationManager _cancellationManager; private readonly IOperationProgressManager _operationProgressManager; private readonly ILogger _logger; - private readonly ICSiApplicationService _csiApplicationService; // Update selection binding to centralized CSiSharedApplicationService instead of trying to maintain a reference to "sapModel" + private readonly ICSiApplicationService _csiApplicationService; // Update selection binding to centralized CSiApplicationService instead of trying to maintain a reference to "sapModel" private readonly ICSiConversionSettingsFactory _csiConversionSettingsFactory; private readonly ISpeckleApplication _speckleApplication; private readonly ISdkActivityFactory _activityFactory; diff --git a/Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiApplicationService.cs b/Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiApplicationService.cs new file mode 100644 index 000000000..27a034195 --- /dev/null +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiApplicationService.cs @@ -0,0 +1,34 @@ +namespace Speckle.Connectors.CSiShared.HostApp; + +/// +/// Create a centralized access point for ETABS and SAP APIs across the entire program. +/// +/// +/// All API methods are based on the objectType and objectName, not the GUID. +/// CSi is already giving us the "sapModel" reference through the plugin interface. No need to attach to running instance. +/// Since objectType is a single int (1, 2 ... 7) we know first index will always be the objectType. +/// Prevent having to pass the "sapModel" around between classes and this ensures consistent access. +/// Name "sapModel" is misleading since it doesn't only apply to SAP2000, but this is the convention in the API, so we keep it. +/// +public interface ICSiApplicationService +{ + cSapModel SapModel { get; } + void Initialize(cSapModel sapModel, cPluginCallback pluginCallback); +} + +public class CSiApplicationService : ICSiApplicationService +{ + public cSapModel SapModel { get; private set; } + private cPluginCallback _pluginCallback; + + public CSiApplicationService() + { + SapModel = null!; + } + + public void Initialize(cSapModel sapModel, cPluginCallback pluginCallback) + { + SapModel = sapModel; + _pluginCallback = pluginCallback; + } +} diff --git a/Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiSharedDocumentModelStore.cs b/Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiDocumentModelStore.cs similarity index 90% rename from Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiSharedDocumentModelStore.cs rename to Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiDocumentModelStore.cs index dbe2477a9..cda75e378 100644 --- a/Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiSharedDocumentModelStore.cs +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiDocumentModelStore.cs @@ -8,19 +8,19 @@ namespace Speckle.Connectors.CSiShared.HostApp; -public class CSiSharedDocumentModelStore : DocumentModelStore +public class CSiDocumentModelStore : DocumentModelStore { private readonly ISpeckleApplication _speckleApplication; - private readonly ILogger _logger; + private readonly ILogger _logger; private readonly ICSiApplicationService _csiApplicationService; private string HostAppUserDataPath { get; set; } private string DocumentStateFile { get; set; } private string ModelPathHash { get; set; } - public CSiSharedDocumentModelStore( + public CSiDocumentModelStore( IJsonSerializer jsonSerializerSettings, ISpeckleApplication speckleApplication, - ILogger logger, + ILogger logger, ICSiApplicationService csiApplicationService ) : base(jsonSerializerSettings) diff --git a/Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiSharedIdleManager.cs b/Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiIdleManager.cs similarity index 62% rename from Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiSharedIdleManager.cs rename to Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiIdleManager.cs index accedfd75..081639361 100644 --- a/Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiSharedIdleManager.cs +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiIdleManager.cs @@ -2,11 +2,11 @@ namespace Speckle.Connectors.CSiShared.HostApp; -public sealed class CSiSharedIdleManager : AppIdleManager +public sealed class CSiIdleManager : AppIdleManager { private readonly IIdleCallManager _idleCallManager; - public CSiSharedIdleManager(IIdleCallManager idleCallManager) + public CSiIdleManager(IIdleCallManager idleCallManager) : base(idleCallManager) { _idleCallManager = idleCallManager; @@ -14,7 +14,7 @@ public CSiSharedIdleManager(IIdleCallManager idleCallManager) protected override void AddEvent() { - // ETABS specific idle handling can be added here if needed + // TODO: CSi specific idle handling can be added here if needed _idleCallManager.AppOnIdle(() => { }); } } diff --git a/Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiSendCollectionManager.cs b/Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiSendCollectionManager.cs index f0ee37ab3..127361edd 100644 --- a/Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiSendCollectionManager.cs +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiSendCollectionManager.cs @@ -4,6 +4,13 @@ namespace Speckle.Connectors.CSiShared.HostApp; +/// +/// We can use the CSiWrappers to create our collection structure. +/// +/// +/// This class manages the collections. If the key (from the path) already exists, this collection is returned. +/// If it doesn't exist, a new collection is created and added to the rootObject. +/// public class CSiSendCollectionManager { private readonly IConverterSettingsStore _converterSettings; @@ -14,7 +21,7 @@ public CSiSendCollectionManager(IConverterSettingsStore c _converterSettings = converterSettings; } - // TODO: Frames could be further classified under Columns, Braces and Beams. Same for shells: walls, floors + // TODO: Frames could be further classified under Columns, Braces and Beams. Same for Shells which could be classified into walls, floors public Collection GetAndCreateObjectHostCollection(ICSiWrapper csiObject, Collection rootObject) { var path = csiObject.GetType().Name.Replace("Wrapper", ""); // CSiJointWrapper → CSiJoint, CSiFrameWrapper → CSiFrame etc. diff --git a/Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiSharedApplicationService.cs b/Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiSharedApplicationService.cs deleted file mode 100644 index 7bbefbee2..000000000 --- a/Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiSharedApplicationService.cs +++ /dev/null @@ -1,27 +0,0 @@ -namespace Speckle.Connectors.CSiShared.HostApp; - -// NOTE: Create a centralized access point for ETABS and SAP APIs across the entire program -// CSi is already giving us the "sapModel" reference through the plugin interface. No need to attach to running instance -// Prevent having to pass the "sapModel" around between classes and this ensures consistent access -public interface ICSiApplicationService -{ - cSapModel SapModel { get; } - void Initialize(cSapModel sapModel, cPluginCallback pluginCallback); -} - -public class CSiApplicationService : ICSiApplicationService -{ - public cSapModel SapModel { get; private set; } - private cPluginCallback _pluginCallback; - - public CSiApplicationService() - { - SapModel = null!; - } - - public void Initialize(cSapModel sapModel, cPluginCallback pluginCallback) - { - SapModel = sapModel; - _pluginCallback = pluginCallback; - } -} diff --git a/Connectors/CSi/Speckle.Connectors.CSiShared/Plugin/CSiSharedPluginBase.cs b/Connectors/CSi/Speckle.Connectors.CSiShared/Plugin/CSiPluginBase.cs similarity index 92% rename from Connectors/CSi/Speckle.Connectors.CSiShared/Plugin/CSiSharedPluginBase.cs rename to Connectors/CSi/Speckle.Connectors.CSiShared/Plugin/CSiPluginBase.cs index 39c5f0a2b..28be43ebf 100644 --- a/Connectors/CSi/Speckle.Connectors.CSiShared/Plugin/CSiSharedPluginBase.cs +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/Plugin/CSiPluginBase.cs @@ -1,7 +1,7 @@ namespace Speckle.Connectors.CSiShared; [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "")] -public abstract class CSiSharedPluginBase : cPluginContract, IDisposable +public abstract class CSiPluginBase : cPluginContract, IDisposable { private const string s_modality = "Non-Modal"; private SpeckleFormBase? _panel; @@ -50,7 +50,7 @@ public void Dispose() GC.SuppressFinalize(this); } - ~CSiSharedPluginBase() + ~CSiPluginBase() { Dispose(false); } diff --git a/Connectors/CSi/Speckle.Connectors.CSiShared/ServiceRegistration.cs b/Connectors/CSi/Speckle.Connectors.CSiShared/ServiceRegistration.cs index b07a76bb3..994d0c75d 100644 --- a/Connectors/CSi/Speckle.Connectors.CSiShared/ServiceRegistration.cs +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/ServiceRegistration.cs @@ -24,10 +24,10 @@ public static IServiceCollection AddCSi(this IServiceCollection services) services.AddSingleton(); services.AddConnectorUtils(); - services.AddDUI(); + services.AddDUI(); services.AddDUIView(); - services.AddSingleton(); + services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); @@ -35,7 +35,7 @@ public static IServiceCollection AddCSi(this IServiceCollection services) services.AddSingleton(sp => sp.GetRequiredService()); services.AddSingleton(); - services.AddSingleton(); + services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); diff --git a/Connectors/CSi/Speckle.Connectors.CSiShared/Speckle.Connectors.CSiShared.projitems b/Connectors/CSi/Speckle.Connectors.CSiShared/Speckle.Connectors.CSiShared.projitems index 997972617..e49c115ee 100644 --- a/Connectors/CSi/Speckle.Connectors.CSiShared/Speckle.Connectors.CSiShared.projitems +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/Speckle.Connectors.CSiShared.projitems @@ -15,14 +15,14 @@ - + Form - - - + + + diff --git a/Connectors/CSi/Speckle.Connectors.CSiShared/Utils/ObjectIdentifiers.cs b/Connectors/CSi/Speckle.Connectors.CSiShared/Utils/ObjectIdentifiers.cs index 2d45e0f13..443893e7c 100644 --- a/Connectors/CSi/Speckle.Connectors.CSiShared/Utils/ObjectIdentifiers.cs +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/Utils/ObjectIdentifiers.cs @@ -1,15 +1,19 @@ namespace Speckle.Connectors.CSiShared.Utils; -// NOTE: All API methods are based on the objectType and objectName, not the GUID -// We will obviously manage the GUIDs but for all method calls we need a concatenated version of the objectType and objectName -// Since objectType >= 1 and <= 7, we know first index will always be the objectType -// Remaining string represents objectName and since the user can add any string (provided it is unique), this is safer -// than using a delimiting character (which could clash with user string) +/// +/// ObjectIdentifier based on concatenating the objectType and objectName. CSi is annoying, we can't use GUIDs. +/// +/// +/// All API methods are based on the objectType and objectName, not the GUID. +/// We will obviously manage the GUIDs but for all method calls we need a concatenated version of the objectType and objectName. +/// Since objectType is a single int (1, 2 ... 7) we know first index will always be the objectType. +/// This int gets used by the CSiWrapperFactory to create the CSiWrappers. +/// public static class ObjectIdentifier { public static string Encode(int objectType, string objectName) { - if (objectType < 1 || objectType > 7) + if (objectType < 1 || objectType > 7) // Both ETABS and SAP2000 APIs have the same returns for objectType { throw new ArgumentException($"Invalid object type: {objectType}. Must be between 1 and 7."); } @@ -18,7 +22,7 @@ public static string Encode(int objectType, string objectName) public static (int type, string name) Decode(string encodedId) { - if (string.IsNullOrEmpty(encodedId) || encodedId.Length < 2) + if (string.IsNullOrEmpty(encodedId) || encodedId.Length < 2) // Superfluous. But rather safe than sorry { throw new ArgumentException($"Invalid encoded ID: {encodedId}"); } diff --git a/Connectors/CSi/Speckle.Connectors.ETABS21/Plugin/cPlugin.cs b/Connectors/CSi/Speckle.Connectors.ETABS21/Plugin/cPlugin.cs index 0807f7294..eb7f18b63 100644 --- a/Connectors/CSi/Speckle.Connectors.ETABS21/Plugin/cPlugin.cs +++ b/Connectors/CSi/Speckle.Connectors.ETABS21/Plugin/cPlugin.cs @@ -6,7 +6,7 @@ namespace Speckle.Connectors.ETABS21; [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "")] -public class cPlugin : CSiSharedPluginBase +public class cPlugin : CSiPluginBase { protected override SpeckleFormBase CreateForm() => new SpeckleForm(); } diff --git a/Connectors/CSi/Speckle.Connectors.ETABS22/Plugin/cPlugin.cs b/Connectors/CSi/Speckle.Connectors.ETABS22/Plugin/cPlugin.cs index eba957e39..d6ab41c8d 100644 --- a/Connectors/CSi/Speckle.Connectors.ETABS22/Plugin/cPlugin.cs +++ b/Connectors/CSi/Speckle.Connectors.ETABS22/Plugin/cPlugin.cs @@ -6,7 +6,7 @@ namespace Speckle.Connectors.ETABS22; [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "")] -public class cPlugin : CSiSharedPluginBase +public class cPlugin : CSiPluginBase { protected override SpeckleFormBase CreateForm() => new SpeckleForm(); } diff --git a/Converters/CSi/Speckle.Converters.CSiShared/CSiObject.cs b/Converters/CSi/Speckle.Converters.CSiShared/CSiObject.cs index 1dd26b035..25d3039c5 100644 --- a/Converters/CSi/Speckle.Converters.CSiShared/CSiObject.cs +++ b/Converters/CSi/Speckle.Converters.CSiShared/CSiObject.cs @@ -3,6 +3,7 @@ namespace Speckle.Converters.CSiShared; +// NOTE: These are just temporarily here. Should be in SDK [SpeckleType("Converters.CSiShared.CSiObject")] public class CSiObject : Base, ICSiObject { diff --git a/Converters/CSi/Speckle.Converters.CSiShared/CSiWrappers.cs b/Converters/CSi/Speckle.Converters.CSiShared/CSiWrappers.cs index b5db54dbf..d8aa5b7a1 100644 --- a/Converters/CSi/Speckle.Converters.CSiShared/CSiWrappers.cs +++ b/Converters/CSi/Speckle.Converters.CSiShared/CSiWrappers.cs @@ -6,6 +6,14 @@ public interface ICSiWrapper int ObjectType { get; } } +/// +/// Based on GetSelected() returns of objectType and objectName, we need to create a CSiWrapper object. +/// +/// +/// Creating a class that can be used to pass a type to the converter. +/// Since the API only provides a framework for us to query the model, we don't get instances. +/// The types are the same for both SAP 2000 and ETABS. +/// public abstract class CSiWrapperBase : ICSiWrapper { public required string Name { get; set; } @@ -47,6 +55,13 @@ public class CSiLinkWrapper : CSiWrapperBase public override int ObjectType => 7; } +/// +/// ObjectType specific wrappers created during bindings. +/// +/// +/// Switch statements based off of the objectType int return. +/// Used in the connectors and allows converters to be resolved effectively. +/// public static class CSiWrapperFactory { public static ICSiWrapper Create(int objectType, string name) => diff --git a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/FrameToSpeckleConverter.cs b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/FrameToSpeckleConverter.cs index 59e34f130..9655c60cb 100644 --- a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/FrameToSpeckleConverter.cs +++ b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/FrameToSpeckleConverter.cs @@ -19,7 +19,7 @@ ITypedConverter pointConverter _pointConverter = pointConverter; } - public Line Convert(CSiFrameWrapper target) // NOTE: THIS IS TEMPORARY + public Line Convert(CSiFrameWrapper target) // NOTE: THIS IS TEMPORARY POC { // frame points string startPoint = "", diff --git a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/JointToSpeckleConverter.cs b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/JointToSpeckleConverter.cs index 93efabda0..b82da95e9 100644 --- a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/JointToSpeckleConverter.cs +++ b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/JointToSpeckleConverter.cs @@ -4,6 +4,7 @@ namespace Speckle.Converters.CSiShared.ToSpeckle.Raw; +// NOTE: This is HORRIBLE but serves just as a poc! public class JointToSpeckleConverter : ITypedConverter { private readonly IConverterSettingsStore _settingStore; diff --git a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/ShellToSpeckleConverter.cs b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/ShellToSpeckleConverter.cs index 21529096d..461bf0b47 100644 --- a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/ShellToSpeckleConverter.cs +++ b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/Raw/ShellToSpeckleConverter.cs @@ -4,6 +4,7 @@ namespace Speckle.Converters.CSiShared.ToSpeckle.Raw; +// NOTE: This is HORRIBLE but serves just as a poc! We need point caching and weak referencing to joint objects public class ShellToSpeckleConverter : ITypedConverter { private readonly IConverterSettingsStore _settingsStore; diff --git a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/TopLevel/CSiObjectToSpeckleConverter.cs b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/TopLevel/CSiObjectToSpeckleConverter.cs index 4225ca7d8..0a903daaa 100644 --- a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/TopLevel/CSiObjectToSpeckleConverter.cs +++ b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/TopLevel/CSiObjectToSpeckleConverter.cs @@ -34,7 +34,7 @@ public Base Convert(object target) var result = new CSiObject { name = csiWrapper.Name, - type = csiWrapper.GetType().ToString().Split('.').Last().Replace("Wrapper", ""), + type = csiWrapper.GetType().ToString().Split('.').Last().Replace("Wrapper", ""), // CSiJointWrapper → CSiJoint, CSiFrameWrapper → CSiFrame etc. units = _settingsStore.Current.SpeckleUnits, // TODO: properties displayValue = _displayValueExtractor.GetDisplayValue(csiWrapper).ToList() From d11c0d60968e962fedad6205f46c87901b27123b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn?= Date: Mon, 2 Dec 2024 16:15:27 +0100 Subject: [PATCH 14/19] back to BASE-ics --- .../Bindings/CSiSharedSendBinding.cs | 2 +- .../Speckle.Converters.CSiShared/CSiObject.cs | 30 ------------------- .../Speckle.Converters.CSiShared.projitems | 1 - .../TopLevel/CSiObjectToSpeckleConverter.cs | 18 +++++------ 4 files changed, 8 insertions(+), 43 deletions(-) delete mode 100644 Converters/CSi/Speckle.Converters.CSiShared/CSiObject.cs diff --git a/Connectors/CSi/Speckle.Connectors.CSiShared/Bindings/CSiSharedSendBinding.cs b/Connectors/CSi/Speckle.Connectors.CSiShared/Bindings/CSiSharedSendBinding.cs index 2514121d0..d74bd99d9 100644 --- a/Connectors/CSi/Speckle.Connectors.CSiShared/Bindings/CSiSharedSendBinding.cs +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/Bindings/CSiSharedSendBinding.cs @@ -33,7 +33,7 @@ public sealed class CSiSharedSendBinding : ISendBinding private readonly CancellationManager _cancellationManager; private readonly IOperationProgressManager _operationProgressManager; private readonly ILogger _logger; - private readonly ICSiApplicationService _csiApplicationService; // Update selection binding to centralized CSiApplicationService instead of trying to maintain a reference to "sapModel" + private readonly ICSiApplicationService _csiApplicationService; private readonly ICSiConversionSettingsFactory _csiConversionSettingsFactory; private readonly ISpeckleApplication _speckleApplication; private readonly ISdkActivityFactory _activityFactory; diff --git a/Converters/CSi/Speckle.Converters.CSiShared/CSiObject.cs b/Converters/CSi/Speckle.Converters.CSiShared/CSiObject.cs deleted file mode 100644 index 25d3039c5..000000000 --- a/Converters/CSi/Speckle.Converters.CSiShared/CSiObject.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Speckle.Objects; -using Speckle.Sdk.Models; - -namespace Speckle.Converters.CSiShared; - -// NOTE: These are just temporarily here. Should be in SDK -[SpeckleType("Converters.CSiShared.CSiObject")] -public class CSiObject : Base, ICSiObject -{ - public required string name { get; set; } - public required string type { get; set; } - - [DetachProperty] -#pragma warning disable IDE1006 - public required List displayValue { get; set; } -#pragma warning restore IDE1006 - -#pragma warning disable IDE1006 - public required string units { get; set; } -#pragma warning restore IDE1006 - - IReadOnlyList IDataObject.displayValue => displayValue; -} - -public interface ICSiObject : IDataObject -{ -#pragma warning disable IDE1006 - string type { get; } -#pragma warning restore IDE1006 -} diff --git a/Converters/CSi/Speckle.Converters.CSiShared/Speckle.Converters.CSiShared.projitems b/Converters/CSi/Speckle.Converters.CSiShared/Speckle.Converters.CSiShared.projitems index af4952ac6..0a27119d4 100644 --- a/Converters/CSi/Speckle.Converters.CSiShared/Speckle.Converters.CSiShared.projitems +++ b/Converters/CSi/Speckle.Converters.CSiShared/Speckle.Converters.CSiShared.projitems @@ -11,7 +11,6 @@ - diff --git a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/TopLevel/CSiObjectToSpeckleConverter.cs b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/TopLevel/CSiObjectToSpeckleConverter.cs index 0a903daaa..ec515f50c 100644 --- a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/TopLevel/CSiObjectToSpeckleConverter.cs +++ b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/TopLevel/CSiObjectToSpeckleConverter.cs @@ -24,20 +24,16 @@ DisplayValueExtractor displayValueExtractor // TODO: _property_extractor } - public Base Convert(object target) + public Base Convert(object target) => Convert((CSiWrapperBase)target); + private Base Convert(CSiWrapperBase target) { - if (target is not ICSiWrapper csiWrapper) + var result = new Base { - throw new ArgumentException($"Target object must be a CSi wrapper. Got {target.GetType()}"); - } - - var result = new CSiObject - { - name = csiWrapper.Name, - type = csiWrapper.GetType().ToString().Split('.').Last().Replace("Wrapper", ""), // CSiJointWrapper → CSiJoint, CSiFrameWrapper → CSiFrame etc. - units = _settingsStore.Current.SpeckleUnits, + ["name"] = target.Name, + ["type"] = target.GetType().ToString().Split('.').Last().Replace("Wrapper", ""), // CSiJointWrapper → CSiJoint, CSiFrameWrapper → CSiFrame etc. + ["units"] = _settingsStore.Current.SpeckleUnits, // TODO: properties - displayValue = _displayValueExtractor.GetDisplayValue(csiWrapper).ToList() + ["displayValue"] = _displayValueExtractor.GetDisplayValue(target).ToList() }; return result; From 84d5a64d1d38e13c3f38222ddf0cf6db5b84ba84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn?= Date: Mon, 2 Dec 2024 16:36:35 +0100 Subject: [PATCH 15/19] local --- Local.sln | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Local.sln b/Local.sln index 89f3b16cc..4fcb17378 100644 --- a/Local.sln +++ b/Local.sln @@ -208,6 +208,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ETABS21", "ETABS21", "{FCCE EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connectors.ETABS21", "Connectors\CSi\Speckle.Connectors.ETABS21\Speckle.Connectors.ETABS21.csproj", "{1696F113-7F6B-49D6-A4EF-15751C7600F9}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Converters.ETABS21", "Converters\CSi\Speckle.Converters.ETABS21\Speckle.Converters.ETABS21.csproj", "{3B81B220-92E3-43FC-86C6-1E6DBEEB1917}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Converters.ETABS22", "Converters\CSi\Speckle.Converters.ETABS22\Speckle.Converters.ETABS22.csproj", "{5E924B13-B3E8-4724-9BA7-CE82E39866EB}" +EndProject +Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Speckle.Converters.CSiShared", "Converters\CSi\Speckle.Converters.CSiShared\Speckle.Converters.CSiShared.shproj", "{1B5C5FB2-3B22-4371-9AA5-3EDF3B4D62DE}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -533,6 +539,18 @@ Global {1696F113-7F6B-49D6-A4EF-15751C7600F9}.Local|Any CPU.Build.0 = Debug|Any CPU {1696F113-7F6B-49D6-A4EF-15751C7600F9}.Release|Any CPU.ActiveCfg = Release|Any CPU {1696F113-7F6B-49D6-A4EF-15751C7600F9}.Release|Any CPU.Build.0 = Release|Any CPU + {3B81B220-92E3-43FC-86C6-1E6DBEEB1917}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3B81B220-92E3-43FC-86C6-1E6DBEEB1917}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3B81B220-92E3-43FC-86C6-1E6DBEEB1917}.Local|Any CPU.ActiveCfg = Debug|Any CPU + {3B81B220-92E3-43FC-86C6-1E6DBEEB1917}.Local|Any CPU.Build.0 = Debug|Any CPU + {3B81B220-92E3-43FC-86C6-1E6DBEEB1917}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3B81B220-92E3-43FC-86C6-1E6DBEEB1917}.Release|Any CPU.Build.0 = Release|Any CPU + {5E924B13-B3E8-4724-9BA7-CE82E39866EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5E924B13-B3E8-4724-9BA7-CE82E39866EB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5E924B13-B3E8-4724-9BA7-CE82E39866EB}.Local|Any CPU.ActiveCfg = Debug|Any CPU + {5E924B13-B3E8-4724-9BA7-CE82E39866EB}.Local|Any CPU.Build.0 = Debug|Any CPU + {5E924B13-B3E8-4724-9BA7-CE82E39866EB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5E924B13-B3E8-4724-9BA7-CE82E39866EB}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -626,6 +644,9 @@ Global {A8E949B8-AA55-4909-99F0-8B551791A1F8} = {D2638AC8-28B2-4667-A47B-3FAB9F900E6F} {FCCE9A47-05D8-41CB-A8EE-586FC5B69545} = {1F11635B-410A-4B16-A909-99CE3CCEF52E} {1696F113-7F6B-49D6-A4EF-15751C7600F9} = {FCCE9A47-05D8-41CB-A8EE-586FC5B69545} + {3B81B220-92E3-43FC-86C6-1E6DBEEB1917} = {FCCE9A47-05D8-41CB-A8EE-586FC5B69545} + {5E924B13-B3E8-4724-9BA7-CE82E39866EB} = {F2A1E5FC-CFEF-4590-BF0D-BE7B9F74E567} + {1B5C5FB2-3B22-4371-9AA5-3EDF3B4D62DE} = {D2638AC8-28B2-4667-A47B-3FAB9F900E6F} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {EE253116-7070-4E9A-BCE8-2911C251B8C8} From 03dca1980287ad87eb9dfb4d5a6e585af294a860 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn?= Date: Mon, 2 Dec 2024 16:40:24 +0100 Subject: [PATCH 16/19] csharpier Missing blank line --- .../ToSpeckle/TopLevel/CSiObjectToSpeckleConverter.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/TopLevel/CSiObjectToSpeckleConverter.cs b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/TopLevel/CSiObjectToSpeckleConverter.cs index ec515f50c..3682f18a7 100644 --- a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/TopLevel/CSiObjectToSpeckleConverter.cs +++ b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/TopLevel/CSiObjectToSpeckleConverter.cs @@ -25,6 +25,7 @@ DisplayValueExtractor displayValueExtractor } public Base Convert(object target) => Convert((CSiWrapperBase)target); + private Base Convert(CSiWrapperBase target) { var result = new Base From af1d8725b2748885b526580f57d9e606862b6985 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn?= Date: Mon, 2 Dec 2024 16:54:37 +0100 Subject: [PATCH 17/19] newline --- .../ToSpeckle/TopLevel/CSiObjectToSpeckleConverter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/TopLevel/CSiObjectToSpeckleConverter.cs b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/TopLevel/CSiObjectToSpeckleConverter.cs index 3682f18a7..d387b4cc5 100644 --- a/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/TopLevel/CSiObjectToSpeckleConverter.cs +++ b/Converters/CSi/Speckle.Converters.CSiShared/ToSpeckle/TopLevel/CSiObjectToSpeckleConverter.cs @@ -25,7 +25,7 @@ DisplayValueExtractor displayValueExtractor } public Base Convert(object target) => Convert((CSiWrapperBase)target); - + private Base Convert(CSiWrapperBase target) { var result = new Base From f862e13eadc206fb4c177807f247b6271b3993e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn?= Date: Tue, 3 Dec 2024 11:57:01 +0100 Subject: [PATCH 18/19] AddObjectCollectionToRoot PR comments: - Updated GetAndCreateObjectHostCollection to more descriptive name of AddObjectCollectionToRoot - Removing unnecessary rootObject = childCollection line --- .../HostApp/CSiSendCollectionManager.cs | 11 ++++------- .../Operations/Send/CSiRootObjectBuilder.cs | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiSendCollectionManager.cs b/Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiSendCollectionManager.cs index 127361edd..472e3fc2d 100644 --- a/Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiSendCollectionManager.cs +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiSendCollectionManager.cs @@ -22,21 +22,18 @@ public CSiSendCollectionManager(IConverterSettingsStore c } // TODO: Frames could be further classified under Columns, Braces and Beams. Same for Shells which could be classified into walls, floors - public Collection GetAndCreateObjectHostCollection(ICSiWrapper csiObject, Collection rootObject) + public Collection AddObjectCollectionToRoot(ICSiWrapper csiObject, Collection rootObject) { var path = csiObject.GetType().Name.Replace("Wrapper", ""); // CSiJointWrapper → CSiJoint, CSiFrameWrapper → CSiFrame etc. - if (_collectionCache.TryGetValue(path, out Collection? value)) + if (_collectionCache.TryGetValue(path, out Collection? collection)) { - return value; + return collection; } Collection childCollection = new(path); rootObject.elements.Add(childCollection); _collectionCache[path] = childCollection; - - rootObject = childCollection; - - return rootObject; + return childCollection; } } diff --git a/Connectors/CSi/Speckle.Connectors.CSiShared/Operations/Send/CSiRootObjectBuilder.cs b/Connectors/CSi/Speckle.Connectors.CSiShared/Operations/Send/CSiRootObjectBuilder.cs index e652f39fa..a5cb5c58c 100644 --- a/Connectors/CSi/Speckle.Connectors.CSiShared/Operations/Send/CSiRootObjectBuilder.cs +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/Operations/Send/CSiRootObjectBuilder.cs @@ -99,7 +99,7 @@ private SendConversionResult ConvertCSiObject(ICSiWrapper csiObject, Collection converted = _rootToSpeckleConverter.Convert(csiObject); } - var collection = _sendCollectionManager.GetAndCreateObjectHostCollection(csiObject, typeCollection); + var collection = _sendCollectionManager.AddObjectCollectionToRoot(csiObject, typeCollection); collection.elements ??= new List(); collection.elements.Add(converted); From 7f1da73d653382502623bbd666e54c9ad59e92b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn?= Date: Tue, 3 Dec 2024 12:11:30 +0100 Subject: [PATCH 19/19] cleaning locks --- .../packages.lock.json | 2 +- .../packages.lock.json | 2 +- .../packages.lock.json | 24 +++++++++---------- .../packages.lock.json | 24 +++++++++---------- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/Connectors/CSi/Speckle.Connectors.ETABS21/packages.lock.json b/Connectors/CSi/Speckle.Connectors.ETABS21/packages.lock.json index 539b6c67d..0e4b4a12b 100644 --- a/Connectors/CSi/Speckle.Connectors.ETABS21/packages.lock.json +++ b/Connectors/CSi/Speckle.Connectors.ETABS21/packages.lock.json @@ -293,7 +293,7 @@ "type": "Project", "dependencies": { "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", - "Speckle.Objects": "[3.1.0-dev.200, )" + "Speckle.Objects": "[3.1.0-dev.203, )" } }, "speckle.converters.etabs21": { diff --git a/Connectors/CSi/Speckle.Connectors.ETABS22/packages.lock.json b/Connectors/CSi/Speckle.Connectors.ETABS22/packages.lock.json index bd651110d..df71add36 100644 --- a/Connectors/CSi/Speckle.Connectors.ETABS22/packages.lock.json +++ b/Connectors/CSi/Speckle.Connectors.ETABS22/packages.lock.json @@ -249,7 +249,7 @@ "type": "Project", "dependencies": { "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", - "Speckle.Objects": "[3.1.0-dev.200, )" + "Speckle.Objects": "[3.1.0-dev.203, )" } }, "speckle.converters.etabs22": { diff --git a/Converters/CSi/Speckle.Converters.ETABS21/packages.lock.json b/Converters/CSi/Speckle.Converters.ETABS21/packages.lock.json index 329c43488..29676a680 100644 --- a/Converters/CSi/Speckle.Converters.ETABS21/packages.lock.json +++ b/Converters/CSi/Speckle.Converters.ETABS21/packages.lock.json @@ -263,7 +263,7 @@ "type": "Project", "dependencies": { "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", - "Speckle.Objects": "[3.1.0-dev.200, )" + "Speckle.Objects": "[3.1.0-dev.203, )" } }, "Microsoft.Extensions.Logging": { @@ -286,18 +286,18 @@ }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.1.0-dev.200, )", - "resolved": "3.1.0-dev.200", - "contentHash": "n4O+XvMBTsl2gOjZmMeE1Kvo1DOxDLuBcUR7GQw8G0LPv+ce+JFSNaFnmyz/w4X32X2bHmbSImuMRr6U7K4dUQ==", + "requested": "[3.1.0-dev.203, )", + "resolved": "3.1.0-dev.203", + "contentHash": "7FiT0ouWGcUDln2iJt75psiLZzZ0GaDBgR8meFEIdxJKuhq0QmIX4ll9uwsRsmt9vFJBasvdYpkZqppAH70l3A==", "dependencies": { - "Speckle.Sdk": "3.1.0-dev.200" + "Speckle.Sdk": "3.1.0-dev.203" } }, "Speckle.Sdk": { "type": "CentralTransitive", - "requested": "[3.1.0-dev.200, )", - "resolved": "3.1.0-dev.200", - "contentHash": "iRdDkEFDu8taJmzMs6RK/HiUZMeESNKfovb3U2a3yO3wEElNfpqPGXJr3GKcjjPZ+LwENgNO3/aemGzx8+TXQw==", + "requested": "[3.1.0-dev.203, )", + "resolved": "3.1.0-dev.203", + "contentHash": "vCqzyfPw2T1WeON4mdU5o59lde262EoGYIYyULI4PE+JdJGaqr8sy9TucSL8BpSc5QRHfS8S6osINYp0/kSRSw==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.Bcl.AsyncInterfaces": "5.0.0", @@ -307,14 +307,14 @@ "Microsoft.Extensions.Logging": "2.2.0", "Speckle.DoubleNumerics": "4.0.1", "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Dependencies": "3.1.0-dev.200" + "Speckle.Sdk.Dependencies": "3.1.0-dev.203" } }, "Speckle.Sdk.Dependencies": { "type": "CentralTransitive", - "requested": "[3.1.0-dev.200, )", - "resolved": "3.1.0-dev.200", - "contentHash": "4ZHkKRzI6/Xa1c20NrH3+e+m5DUB+qbBSq+GJ6MShUh6SpKOC4DRdwy0qCcAWrurq7V94xU0qN+7+QzKGeWlFw==" + "requested": "[3.1.0-dev.203, )", + "resolved": "3.1.0-dev.203", + "contentHash": "jbA6aj1PEkQLpyexUcvGgMHlkjsGCJa1DQndBIPiH3awbOVxzsXc5Yufq17fnI4CkAcMvagp8RE+yEc89l8MAw==" } } } diff --git a/Converters/CSi/Speckle.Converters.ETABS22/packages.lock.json b/Converters/CSi/Speckle.Converters.ETABS22/packages.lock.json index b11eaff34..45521324c 100644 --- a/Converters/CSi/Speckle.Converters.ETABS22/packages.lock.json +++ b/Converters/CSi/Speckle.Converters.ETABS22/packages.lock.json @@ -219,7 +219,7 @@ "type": "Project", "dependencies": { "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", - "Speckle.Objects": "[3.1.0-dev.200, )" + "Speckle.Objects": "[3.1.0-dev.203, )" } }, "Microsoft.Extensions.Logging": { @@ -242,18 +242,18 @@ }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.1.0-dev.200, )", - "resolved": "3.1.0-dev.200", - "contentHash": "n4O+XvMBTsl2gOjZmMeE1Kvo1DOxDLuBcUR7GQw8G0LPv+ce+JFSNaFnmyz/w4X32X2bHmbSImuMRr6U7K4dUQ==", + "requested": "[3.1.0-dev.203, )", + "resolved": "3.1.0-dev.203", + "contentHash": "7FiT0ouWGcUDln2iJt75psiLZzZ0GaDBgR8meFEIdxJKuhq0QmIX4ll9uwsRsmt9vFJBasvdYpkZqppAH70l3A==", "dependencies": { - "Speckle.Sdk": "3.1.0-dev.200" + "Speckle.Sdk": "3.1.0-dev.203" } }, "Speckle.Sdk": { "type": "CentralTransitive", - "requested": "[3.1.0-dev.200, )", - "resolved": "3.1.0-dev.200", - "contentHash": "iRdDkEFDu8taJmzMs6RK/HiUZMeESNKfovb3U2a3yO3wEElNfpqPGXJr3GKcjjPZ+LwENgNO3/aemGzx8+TXQw==", + "requested": "[3.1.0-dev.203, )", + "resolved": "3.1.0-dev.203", + "contentHash": "vCqzyfPw2T1WeON4mdU5o59lde262EoGYIYyULI4PE+JdJGaqr8sy9TucSL8BpSc5QRHfS8S6osINYp0/kSRSw==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", @@ -262,14 +262,14 @@ "Microsoft.Extensions.Logging": "2.2.0", "Speckle.DoubleNumerics": "4.0.1", "Speckle.Newtonsoft.Json": "13.0.2", - "Speckle.Sdk.Dependencies": "3.1.0-dev.200" + "Speckle.Sdk.Dependencies": "3.1.0-dev.203" } }, "Speckle.Sdk.Dependencies": { "type": "CentralTransitive", - "requested": "[3.1.0-dev.200, )", - "resolved": "3.1.0-dev.200", - "contentHash": "4ZHkKRzI6/Xa1c20NrH3+e+m5DUB+qbBSq+GJ6MShUh6SpKOC4DRdwy0qCcAWrurq7V94xU0qN+7+QzKGeWlFw==" + "requested": "[3.1.0-dev.203, )", + "resolved": "3.1.0-dev.203", + "contentHash": "jbA6aj1PEkQLpyexUcvGgMHlkjsGCJa1DQndBIPiH3awbOVxzsXc5Yufq17fnI4CkAcMvagp8RE+yEc89l8MAw==" } } }