From 48218571a16bddfbd96eec6a8fe87af18dcbc082 Mon Sep 17 00:00:00 2001 From: Dogukan Karatas Date: Sat, 23 Nov 2024 16:19:35 +0100 Subject: [PATCH 01/11] dui3 integration --- .../Bindings/BasicConnectorBinding.cs | 49 +++ .../Bindings/ETABSIdleManager.cs | 20 ++ .../ETABS/Speckle.Connector.ETABS22/Form1.cs | 47 +++ .../ServiceRegistration.cs | 29 ++ .../Speckle.Connector.ETABS22.csproj | 35 ++ .../Speckle.Connector.ETABS22/cPlugin.cs | 64 ++++ .../packages.lock.json | 314 ++++++++++++++++++ Speckle.Connectors.sln | 12 + 8 files changed, 570 insertions(+) create mode 100644 Connectors/ETABS/Speckle.Connector.ETABS22/Bindings/BasicConnectorBinding.cs create mode 100644 Connectors/ETABS/Speckle.Connector.ETABS22/Bindings/ETABSIdleManager.cs create mode 100644 Connectors/ETABS/Speckle.Connector.ETABS22/Form1.cs create mode 100644 Connectors/ETABS/Speckle.Connector.ETABS22/ServiceRegistration.cs create mode 100644 Connectors/ETABS/Speckle.Connector.ETABS22/Speckle.Connector.ETABS22.csproj create mode 100644 Connectors/ETABS/Speckle.Connector.ETABS22/cPlugin.cs create mode 100644 Connectors/ETABS/Speckle.Connector.ETABS22/packages.lock.json diff --git a/Connectors/ETABS/Speckle.Connector.ETABS22/Bindings/BasicConnectorBinding.cs b/Connectors/ETABS/Speckle.Connector.ETABS22/Bindings/BasicConnectorBinding.cs new file mode 100644 index 000000000..cac0d80c7 --- /dev/null +++ b/Connectors/ETABS/Speckle.Connector.ETABS22/Bindings/BasicConnectorBinding.cs @@ -0,0 +1,49 @@ +using Speckle.Connectors.DUI.Bindings; +using Speckle.Connectors.DUI.Bridge; +using Speckle.Connectors.DUI.Models; +using Speckle.Connectors.DUI.Models.Card; +using Speckle.Sdk; + +namespace Speckle.Connector.ETABS22.Bindings; + +public class EtabsBasicConnectorBinding : IBasicConnectorBinding +{ + private readonly ISpeckleApplication _speckleApplication; + private readonly DocumentModelStore _store; + + public string Name => "baseBinding"; + public IBrowserBridge Parent { get; } + public BasicConnectorBindingCommands Commands { get; } + + public EtabsBasicConnectorBinding( + IBrowserBridge parent, + ISpeckleApplication speckleApplication, + DocumentModelStore store + ) + { + Parent = parent; + _speckleApplication = speckleApplication; + _store = store; + Commands = new BasicConnectorBindingCommands(parent); + } + + public string GetConnectorVersion() => _speckleApplication.SpeckleVersion; + + public string GetSourceApplicationName() => _speckleApplication.Slug; + + public string GetSourceApplicationVersion() => _speckleApplication.HostApplicationVersion; + + public DocumentInfo? GetDocumentInfo() => new DocumentInfo("ETABS Model", "ETABS Model", "1"); + + public DocumentModelStore GetDocumentState() => _store; + + public void AddModel(ModelCard model) => _store.Models.Add(model); + + public void UpdateModel(ModelCard model) => _store.UpdateModel(model); + + public void RemoveModel(ModelCard model) => _store.RemoveModel(model); + + public Task HighlightModel(string modelCardId) => Task.CompletedTask; + + public Task HighlightObjects(IReadOnlyList objectIds) => Task.CompletedTask; +} diff --git a/Connectors/ETABS/Speckle.Connector.ETABS22/Bindings/ETABSIdleManager.cs b/Connectors/ETABS/Speckle.Connector.ETABS22/Bindings/ETABSIdleManager.cs new file mode 100644 index 000000000..a29473e2e --- /dev/null +++ b/Connectors/ETABS/Speckle.Connector.ETABS22/Bindings/ETABSIdleManager.cs @@ -0,0 +1,20 @@ +using Speckle.Connectors.DUI.Bridge; + +namespace Speckle.Connector.ETABS22.Bindings; + +public sealed class EtabsIdleManager : AppIdleManager +{ + private readonly IIdleCallManager _idleCallManager; + + public EtabsIdleManager(IIdleCallManager idleCallManager) + : base(idleCallManager) + { + _idleCallManager = idleCallManager; + } + + protected override void AddEvent() + { + // ETABS specific idle handling can be added here if needed + _idleCallManager.AppOnIdle(() => { }); + } +} diff --git a/Connectors/ETABS/Speckle.Connector.ETABS22/Form1.cs b/Connectors/ETABS/Speckle.Connector.ETABS22/Form1.cs new file mode 100644 index 000000000..14c6f4ec4 --- /dev/null +++ b/Connectors/ETABS/Speckle.Connector.ETABS22/Form1.cs @@ -0,0 +1,47 @@ +using System.Windows.Forms.Integration; +using CSiAPIv1; +using Microsoft.Extensions.DependencyInjection; +using Speckle.Connectors.Common; +using Speckle.Connectors.DUI.WebView; +using Speckle.Sdk.Host; + +namespace Speckle.Connector.ETABS22; + +public class Form1 : Form +{ + private ElementHost Host { get; set; } + public static new ServiceProvider? Container { get; set; } + private cSapModel _sapModel; + private cPluginCallback _pluginCallback; + + public Form1() + { + var services = new ServiceCollection(); + services.Initialize(HostApplications.ETABS, GetVersion()); + services.AddETABS(); + + Container = services.BuildServiceProvider(); + + var webview = Container.GetRequiredService(); + Host = new() { Child = webview, Dock = DockStyle.Fill }; + Controls.Add(Host); + FormClosing += Form1Closing; + } + + public void SetSapModel(ref cSapModel sapModel, ref cPluginCallback pluginCallback) + { + _sapModel = sapModel; + _pluginCallback = pluginCallback; + } + + public void Form1Closing(object? sender, FormClosingEventArgs e) + { + Host.Dispose(); + _pluginCallback.Finish(0); + } + + private static HostAppVersion GetVersion() + { + return HostAppVersion.v2022; + } +} diff --git a/Connectors/ETABS/Speckle.Connector.ETABS22/ServiceRegistration.cs b/Connectors/ETABS/Speckle.Connector.ETABS22/ServiceRegistration.cs new file mode 100644 index 000000000..c2f9ccea0 --- /dev/null +++ b/Connectors/ETABS/Speckle.Connector.ETABS22/ServiceRegistration.cs @@ -0,0 +1,29 @@ +using Microsoft.Extensions.DependencyInjection; +using Speckle.Connector.ETABS22.Bindings; +using Speckle.Connectors.Common; +using Speckle.Connectors.DUI; +using Speckle.Connectors.DUI.Bindings; +using Speckle.Connectors.DUI.Bridge; +using Speckle.Connectors.DUI.WebView; + +namespace Speckle.Connector.ETABS22; + +public static class ServiceRegistration +{ + public static IServiceCollection AddETABS(this IServiceCollection services) + { + services.AddConnectorUtils(); + services.AddDUI(); + services.AddDUIView(); + + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + + services.AddSingleton(sp => sp.GetRequiredService()); + services.AddSingleton(); + services.AddSingleton(); + + return services; + } +} diff --git a/Connectors/ETABS/Speckle.Connector.ETABS22/Speckle.Connector.ETABS22.csproj b/Connectors/ETABS/Speckle.Connector.ETABS22/Speckle.Connector.ETABS22.csproj new file mode 100644 index 000000000..7d1651e11 --- /dev/null +++ b/Connectors/ETABS/Speckle.Connector.ETABS22/Speckle.Connector.ETABS22.csproj @@ -0,0 +1,35 @@ + + + + net8.0-windows + enable + enable + AnyCPU;x64 + true + true + true + + + + + ..\..\..\..\..\..\..\..\Program Files\Computers and Structures\ETABS 22\CSiAPIv1.dll + false + runtime + + + + + + Form + + + + + + + + + + + + diff --git a/Connectors/ETABS/Speckle.Connector.ETABS22/cPlugin.cs b/Connectors/ETABS/Speckle.Connector.ETABS22/cPlugin.cs new file mode 100644 index 000000000..c1249d997 --- /dev/null +++ b/Connectors/ETABS/Speckle.Connector.ETABS22/cPlugin.cs @@ -0,0 +1,64 @@ +using CSiAPIv1; + +namespace Speckle.Connector.ETABS22; + +[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "")] +public class cPlugin : cPluginContract, IDisposable +{ + private static string s_modality = "Non-Modal"; + private Form1? _panel; + private bool _disposed; + + public void Main(ref cSapModel sapModel, ref cPluginCallback pluginCallback) + { + _panel = new Form1(); + _panel.SetSapModel(ref sapModel, ref pluginCallback); + + // Subscribe to form closed event to handle disposal + _panel.FormClosed += (s, e) => Dispose(); + + if (string.Equals(s_modality, "Non-Modal", StringComparison.OrdinalIgnoreCase)) + { + _panel.Show(); + } + else + { + _panel.ShowDialog(); + } + } + + public int Info(ref string text) + { + text = "Hey Speckler! This is our next-gen ETABS Connector."; + return 0; + } + + protected virtual void Dispose(bool disposing) + { + if (!_disposed) + { + if (disposing) + { + // Dispose managed resources + if (_panel != null) + { + _panel.Dispose(); + _panel = null; + } + } + + _disposed = true; + } + } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + ~cPlugin() + { + Dispose(false); + } +} diff --git a/Connectors/ETABS/Speckle.Connector.ETABS22/packages.lock.json b/Connectors/ETABS/Speckle.Connector.ETABS22/packages.lock.json new file mode 100644 index 000000000..cdc9e68f0 --- /dev/null +++ b/Connectors/ETABS/Speckle.Connector.ETABS22/packages.lock.json @@ -0,0 +1,314 @@ +{ + "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.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.connectors.common": { + "type": "Project", + "dependencies": { + "Microsoft.Extensions.DependencyInjection": "[2.2.0, )", + "Speckle.Connectors.Logging": "[1.0.0, )", + "Speckle.Objects": "[3.1.0-dev.181, )", + "Speckle.Sdk": "[3.1.0-dev.181, )", + "Speckle.Sdk.Dependencies": "[3.1.0-dev.181, )" + } + }, + "speckle.connectors.dui": { + "type": "Project", + "dependencies": { + "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", + "Speckle.Connectors.Common": "[1.0.0, )", + "Speckle.Sdk": "[3.1.0-dev.181, )", + "Speckle.Sdk.Dependencies": "[3.1.0-dev.181, )", + "System.Threading.Tasks.Dataflow": "[6.0.0, )" + } + }, + "speckle.connectors.dui.webview": { + "type": "Project", + "dependencies": { + "Microsoft.Web.WebView2": "[1.0.1938.49, )", + "Speckle.Connectors.DUI": "[1.0.0, )" + } + }, + "speckle.connectors.logging": { + "type": "Project" + }, + "Microsoft.Extensions.DependencyInjection": { + "type": "CentralTransitive", + "requested": "[2.2.0, )", + "resolved": "2.2.0", + "contentHash": "MZtBIwfDFork5vfjpJdG5g8wuJFt7d/y3LOSVVtDK/76wlbtz6cjltfKHqLx2TKVqTj5/c41t77m1+h20zqtPA==", + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0" + } + }, + "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==" + }, + "Microsoft.Web.WebView2": { + "type": "CentralTransitive", + "requested": "[1.0.1938.49, )", + "resolved": "1.0.1938.49", + "contentHash": "z8KnFnaTYzhA/ZnyRX0qGfS1NU5ZBJeClAH64F0fVDvdDJTvME7xl6zTJ0Jlfe1BtL3C0NH9xTy64shg2baKdw==" + }, + "Speckle.Objects": { + "type": "CentralTransitive", + "requested": "[3.1.0-dev.181, )", + "resolved": "3.1.0-dev.181", + "contentHash": "r6GGA7Pq4CPGYOu6OmmLW/hhhREo/l44RUFhsoYmpHNGpOg1UjF45dwyfLgaU38wrNxQoURjLUQDkxGfhb8liA==", + "dependencies": { + "Speckle.Sdk": "3.1.0-dev.181" + } + }, + "Speckle.Sdk": { + "type": "CentralTransitive", + "requested": "[3.1.0-dev.181, )", + "resolved": "3.1.0-dev.181", + "contentHash": "VmRRphUJm+qfcjtdzxkTstAD0opaIP57tP6GJ2YnalyRj3wBTGBQuy7gwhGjWyAvsMnkugpKFEfAVuNm/zHQ2A==", + "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.181" + } + }, + "Speckle.Sdk.Dependencies": { + "type": "CentralTransitive", + "requested": "[3.1.0-dev.181, )", + "resolved": "3.1.0-dev.181", + "contentHash": "W7Nb3hAPlLXGZmEFWdf9vyhXKGZk3M+lypEKB+IWQVwr3NL+bzPgfw2130kTuMr/9zGx8jUbSfx2ulTql9mZxw==" + }, + "System.Threading.Tasks.Dataflow": { + "type": "CentralTransitive", + "requested": "[6.0.0, )", + "resolved": "6.0.0", + "contentHash": "+tyDCU3/B1lDdOOAJywHQoFwyXIUghIaP2BxG79uvhfTnO+D9qIgjVlL/JV2NTliYbMHpd6eKDmHp2VHpij7MA==" + } + } + } +} \ No newline at end of file diff --git a/Speckle.Connectors.sln b/Speckle.Connectors.sln index e63d5a8dd..ba9f5c828 100644 --- a/Speckle.Connectors.sln +++ b/Speckle.Connectors.sln @@ -189,6 +189,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connector.Tekla2023 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converter.Tekla2023", "Converters\Tekla\Speckle.Converter.Tekla2023\Speckle.Converter.Tekla2023.csproj", "{8F9181C2-1808-44C0-A33A-5BAE40C49E63}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ETABS", "ETABS", "{073F40A8-6C95-41C1-A2F3-369FFFCB9520}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Connector.ETABS22", "Connectors\ETABS\Speckle.Connector.ETABS22\Speckle.Connector.ETABS22.csproj", "{7C49337A-6F7B-47AB-B549-42E799E89CF2}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -484,6 +488,12 @@ Global {8F9181C2-1808-44C0-A33A-5BAE40C49E63}.Local|Any CPU.Build.0 = Local|Any CPU {8F9181C2-1808-44C0-A33A-5BAE40C49E63}.Release|Any CPU.ActiveCfg = Release|Any CPU {8F9181C2-1808-44C0-A33A-5BAE40C49E63}.Release|Any CPU.Build.0 = Release|Any CPU + {7C49337A-6F7B-47AB-B549-42E799E89CF2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7C49337A-6F7B-47AB-B549-42E799E89CF2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7C49337A-6F7B-47AB-B549-42E799E89CF2}.Local|Any CPU.ActiveCfg = Debug|Any CPU + {7C49337A-6F7B-47AB-B549-42E799E89CF2}.Local|Any CPU.Build.0 = Debug|Any CPU + {7C49337A-6F7B-47AB-B549-42E799E89CF2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7C49337A-6F7B-47AB-B549-42E799E89CF2}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -570,6 +580,8 @@ Global {C552C165-5023-47AB-9EE1-1EA61819D2B1} = {696086E4-D8CC-4FE0-A9B3-5F10B9089B55} {025C85F8-F741-4600-BC46-5FEAD754B65D} = {C552C165-5023-47AB-9EE1-1EA61819D2B1} {8F9181C2-1808-44C0-A33A-5BAE40C49E63} = {C552C165-5023-47AB-9EE1-1EA61819D2B1} + {073F40A8-6C95-41C1-A2F3-369FFFCB9520} = {42826721-9A18-4762-8BA9-F1429DD5C5B1} + {7C49337A-6F7B-47AB-B549-42E799E89CF2} = {073F40A8-6C95-41C1-A2F3-369FFFCB9520} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {EE253116-7070-4E9A-BCE8-2911C251B8C8} From 6803130c3b9540e0e2e37b4531c6914d2955c57d Mon Sep 17 00:00:00 2001 From: Dogukan Karatas Date: Sat, 23 Nov 2024 17:53:01 +0100 Subject: [PATCH 02/11] registers necessary classes --- ...nding.cs => ETABSBasicConnectorBinding.cs} | 0 .../Bindings/ETABSSelectionBinding.cs | 21 +++++++ .../Bindings/ETABSSendBinding.cs | 61 +++++++++++++++++++ .../Filters/ETABSSelectionFilter.cs | 13 ++++ .../ETABS/Speckle.Connector.ETABS22/Form1.cs | 2 + .../HostApp/ETABSDocumentModelStore.cs | 14 +++++ .../{Bindings => HostApp}/ETABSIdleManager.cs | 2 +- .../{ => Plugin}/cPlugin.cs | 0 .../Properties/launchSettings.json | 8 +++ .../ServiceRegistration.cs | 15 +++++ .../Speckle.Connector.ETABS22.csproj | 4 -- 11 files changed, 135 insertions(+), 5 deletions(-) rename Connectors/ETABS/Speckle.Connector.ETABS22/Bindings/{BasicConnectorBinding.cs => ETABSBasicConnectorBinding.cs} (100%) create mode 100644 Connectors/ETABS/Speckle.Connector.ETABS22/Bindings/ETABSSelectionBinding.cs create mode 100644 Connectors/ETABS/Speckle.Connector.ETABS22/Bindings/ETABSSendBinding.cs create mode 100644 Connectors/ETABS/Speckle.Connector.ETABS22/Filters/ETABSSelectionFilter.cs create mode 100644 Connectors/ETABS/Speckle.Connector.ETABS22/HostApp/ETABSDocumentModelStore.cs rename Connectors/ETABS/Speckle.Connector.ETABS22/{Bindings => HostApp}/ETABSIdleManager.cs (90%) rename Connectors/ETABS/Speckle.Connector.ETABS22/{ => Plugin}/cPlugin.cs (100%) create mode 100644 Connectors/ETABS/Speckle.Connector.ETABS22/Properties/launchSettings.json diff --git a/Connectors/ETABS/Speckle.Connector.ETABS22/Bindings/BasicConnectorBinding.cs b/Connectors/ETABS/Speckle.Connector.ETABS22/Bindings/ETABSBasicConnectorBinding.cs similarity index 100% rename from Connectors/ETABS/Speckle.Connector.ETABS22/Bindings/BasicConnectorBinding.cs rename to Connectors/ETABS/Speckle.Connector.ETABS22/Bindings/ETABSBasicConnectorBinding.cs diff --git a/Connectors/ETABS/Speckle.Connector.ETABS22/Bindings/ETABSSelectionBinding.cs b/Connectors/ETABS/Speckle.Connector.ETABS22/Bindings/ETABSSelectionBinding.cs new file mode 100644 index 000000000..166e6383e --- /dev/null +++ b/Connectors/ETABS/Speckle.Connector.ETABS22/Bindings/ETABSSelectionBinding.cs @@ -0,0 +1,21 @@ +using Speckle.Connectors.DUI.Bindings; +using Speckle.Connectors.DUI.Bridge; + +namespace Speckle.Connector.ETABS22.Bindings; + +public class ETABSSelectionBinding : ISelectionBinding +{ + public string Name => "selectionBinding"; + public IBrowserBridge Parent { get; } + + public ETABSSelectionBinding(IBrowserBridge parent) + { + Parent = parent; + } + + public SelectionInfo GetSelection() + { + // placeholder for actual implementation + return new SelectionInfo(new List(), "No objects selected."); + } +} diff --git a/Connectors/ETABS/Speckle.Connector.ETABS22/Bindings/ETABSSendBinding.cs b/Connectors/ETABS/Speckle.Connector.ETABS22/Bindings/ETABSSendBinding.cs new file mode 100644 index 000000000..4b4976fac --- /dev/null +++ b/Connectors/ETABS/Speckle.Connector.ETABS22/Bindings/ETABSSendBinding.cs @@ -0,0 +1,61 @@ +using Microsoft.Extensions.Logging; +using Speckle.Connectors.Common.Cancellation; +using Speckle.Connectors.DUI.Bindings; +using Speckle.Connectors.DUI.Bridge; +using Speckle.Connectors.DUI.Models; +using Speckle.Connectors.DUI.Models.Card.SendFilter; +using Speckle.Connectors.DUI.Settings; + +namespace Speckle.Connector.ETABS22.Bindings; + +public sealed class ETABSSendBinding : ISendBinding +{ + public string Name => "sendBinding"; + public SendBindingUICommands Commands { get; } + public IBrowserBridge Parent { get; } + + private readonly DocumentModelStore _store; + private readonly IAppIdleManager _idleManager; + private readonly IServiceProvider _serviceProvider; + private readonly List _sendFilters; + private readonly CancellationManager _cancellationManager; + private readonly IOperationProgressManager _operationProgressManager; + private readonly ILogger _logger; + + public ETABSSendBinding( + DocumentModelStore store, + IAppIdleManager idleManager, + IBrowserBridge parent, + IEnumerable sendFilters, + IServiceProvider serviceProvider, + CancellationManager cancellationManager, + IOperationProgressManager operationProgressManager, + ILogger logger + ) + { + _store = store; + _idleManager = idleManager; + _serviceProvider = serviceProvider; + _sendFilters = sendFilters.ToList(); + _cancellationManager = cancellationManager; + _operationProgressManager = operationProgressManager; + _logger = logger; + Parent = parent; + Commands = new SendBindingUICommands(parent); + } + + public List GetSendFilters() => _sendFilters; + + public List GetSendSettings() => []; + + public async Task Send(string modelCardId) + { + // placeholder for actual send implementation + await Task.CompletedTask.ConfigureAwait(false); + } + + public void CancelSend(string modelCardId) + { + _cancellationManager.CancelOperation(modelCardId); + } +} diff --git a/Connectors/ETABS/Speckle.Connector.ETABS22/Filters/ETABSSelectionFilter.cs b/Connectors/ETABS/Speckle.Connector.ETABS22/Filters/ETABSSelectionFilter.cs new file mode 100644 index 000000000..669227594 --- /dev/null +++ b/Connectors/ETABS/Speckle.Connector.ETABS22/Filters/ETABSSelectionFilter.cs @@ -0,0 +1,13 @@ +using Speckle.Connectors.DUI.Models.Card.SendFilter; + +namespace Speckle.Connector.ETABS22.Filters; + +public class ETABSSelectionFilter : DirectSelectionSendFilter +{ + public ETABSSelectionFilter() + { + IsDefault = true; + } + + public override List RefreshObjectIds() => SelectedObjectIds; +} diff --git a/Connectors/ETABS/Speckle.Connector.ETABS22/Form1.cs b/Connectors/ETABS/Speckle.Connector.ETABS22/Form1.cs index 14c6f4ec4..d27d388c7 100644 --- a/Connectors/ETABS/Speckle.Connector.ETABS22/Form1.cs +++ b/Connectors/ETABS/Speckle.Connector.ETABS22/Form1.cs @@ -16,6 +16,8 @@ public class Form1 : Form public Form1() { + this.Text = "Speckle (Beta)"; + var services = new ServiceCollection(); services.Initialize(HostApplications.ETABS, GetVersion()); services.AddETABS(); diff --git a/Connectors/ETABS/Speckle.Connector.ETABS22/HostApp/ETABSDocumentModelStore.cs b/Connectors/ETABS/Speckle.Connector.ETABS22/HostApp/ETABSDocumentModelStore.cs new file mode 100644 index 000000000..bf2dd2b1b --- /dev/null +++ b/Connectors/ETABS/Speckle.Connector.ETABS22/HostApp/ETABSDocumentModelStore.cs @@ -0,0 +1,14 @@ +using Speckle.Connectors.DUI.Models; +using Speckle.Newtonsoft.Json; + +namespace Speckle.Connector.ETABS22.HostApp; + +public class ETABSDocumentModelStore : DocumentModelStore +{ + public ETABSDocumentModelStore(JsonSerializerSettings jsonSerializerSettings) + : base(jsonSerializerSettings, true) { } + + public override void WriteToFile() { } + + public override void ReadFromFile() { } +} diff --git a/Connectors/ETABS/Speckle.Connector.ETABS22/Bindings/ETABSIdleManager.cs b/Connectors/ETABS/Speckle.Connector.ETABS22/HostApp/ETABSIdleManager.cs similarity index 90% rename from Connectors/ETABS/Speckle.Connector.ETABS22/Bindings/ETABSIdleManager.cs rename to Connectors/ETABS/Speckle.Connector.ETABS22/HostApp/ETABSIdleManager.cs index a29473e2e..b8f94eb50 100644 --- a/Connectors/ETABS/Speckle.Connector.ETABS22/Bindings/ETABSIdleManager.cs +++ b/Connectors/ETABS/Speckle.Connector.ETABS22/HostApp/ETABSIdleManager.cs @@ -1,6 +1,6 @@ using Speckle.Connectors.DUI.Bridge; -namespace Speckle.Connector.ETABS22.Bindings; +namespace Speckle.Connector.ETABS22.HostApp; public sealed class EtabsIdleManager : AppIdleManager { diff --git a/Connectors/ETABS/Speckle.Connector.ETABS22/cPlugin.cs b/Connectors/ETABS/Speckle.Connector.ETABS22/Plugin/cPlugin.cs similarity index 100% rename from Connectors/ETABS/Speckle.Connector.ETABS22/cPlugin.cs rename to Connectors/ETABS/Speckle.Connector.ETABS22/Plugin/cPlugin.cs diff --git a/Connectors/ETABS/Speckle.Connector.ETABS22/Properties/launchSettings.json b/Connectors/ETABS/Speckle.Connector.ETABS22/Properties/launchSettings.json new file mode 100644 index 000000000..1fd348981 --- /dev/null +++ b/Connectors/ETABS/Speckle.Connector.ETABS22/Properties/launchSettings.json @@ -0,0 +1,8 @@ +{ + "profiles": { + "ETABS 22": { + "commandName": "Executable", + "executablePath": "C:\\Program Files\\Computers and Structures\\ETABS 22\\ETABS.exe" + } + } +} diff --git a/Connectors/ETABS/Speckle.Connector.ETABS22/ServiceRegistration.cs b/Connectors/ETABS/Speckle.Connector.ETABS22/ServiceRegistration.cs index c2f9ccea0..7a833ccbe 100644 --- a/Connectors/ETABS/Speckle.Connector.ETABS22/ServiceRegistration.cs +++ b/Connectors/ETABS/Speckle.Connector.ETABS22/ServiceRegistration.cs @@ -1,9 +1,13 @@ using Microsoft.Extensions.DependencyInjection; using Speckle.Connector.ETABS22.Bindings; +using Speckle.Connector.ETABS22.Filters; +using Speckle.Connector.ETABS22.HostApp; using Speckle.Connectors.Common; using Speckle.Connectors.DUI; using Speckle.Connectors.DUI.Bindings; using Speckle.Connectors.DUI.Bridge; +using Speckle.Connectors.DUI.Models; +using Speckle.Connectors.DUI.Models.Card.SendFilter; using Speckle.Connectors.DUI.WebView; namespace Speckle.Connector.ETABS22; @@ -12,10 +16,14 @@ public static class ServiceRegistration { public static IServiceCollection AddETABS(this IServiceCollection services) { + services.AddSingleton(); + services.AddConnectorUtils(); services.AddDUI(); services.AddDUIView(); + services.AddSingleton(); + services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); @@ -24,6 +32,13 @@ public static IServiceCollection AddETABS(this IServiceCollection services) services.AddSingleton(); services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + + services.AddScoped(); + + services.RegisterTopLevelExceptionHandler(); + return services; } } diff --git a/Connectors/ETABS/Speckle.Connector.ETABS22/Speckle.Connector.ETABS22.csproj b/Connectors/ETABS/Speckle.Connector.ETABS22/Speckle.Connector.ETABS22.csproj index 7d1651e11..a0ae0b903 100644 --- a/Connectors/ETABS/Speckle.Connector.ETABS22/Speckle.Connector.ETABS22.csproj +++ b/Connectors/ETABS/Speckle.Connector.ETABS22/Speckle.Connector.ETABS22.csproj @@ -28,8 +28,4 @@ - - - - From cd5e90cbb85eb73ad3f3a17a813fb9942425b0da Mon Sep 17 00:00:00 2001 From: Dogukan Karatas Date: Sat, 23 Nov 2024 18:27:08 +0100 Subject: [PATCH 03/11] adds solution to local --- .../Speckle.Connector.ETABS22.csproj | 10 +++++----- .../{Plugin => }/cPlugin.cs | 1 - Local.sln | 12 ++++++++++++ 3 files changed, 17 insertions(+), 6 deletions(-) rename Connectors/ETABS/Speckle.Connector.ETABS22/{Plugin => }/cPlugin.cs (95%) diff --git a/Connectors/ETABS/Speckle.Connector.ETABS22/Speckle.Connector.ETABS22.csproj b/Connectors/ETABS/Speckle.Connector.ETABS22/Speckle.Connector.ETABS22.csproj index a0ae0b903..4a73a5927 100644 --- a/Connectors/ETABS/Speckle.Connector.ETABS22/Speckle.Connector.ETABS22.csproj +++ b/Connectors/ETABS/Speckle.Connector.ETABS22/Speckle.Connector.ETABS22.csproj @@ -19,13 +19,13 @@ - - Form - + + - - + + Form + diff --git a/Connectors/ETABS/Speckle.Connector.ETABS22/Plugin/cPlugin.cs b/Connectors/ETABS/Speckle.Connector.ETABS22/cPlugin.cs similarity index 95% rename from Connectors/ETABS/Speckle.Connector.ETABS22/Plugin/cPlugin.cs rename to Connectors/ETABS/Speckle.Connector.ETABS22/cPlugin.cs index c1249d997..df6a82069 100644 --- a/Connectors/ETABS/Speckle.Connector.ETABS22/Plugin/cPlugin.cs +++ b/Connectors/ETABS/Speckle.Connector.ETABS22/cPlugin.cs @@ -14,7 +14,6 @@ public void Main(ref cSapModel sapModel, ref cPluginCallback pluginCallback) _panel = new Form1(); _panel.SetSapModel(ref sapModel, ref pluginCallback); - // Subscribe to form closed event to handle disposal _panel.FormClosed += (s, e) => Dispose(); if (string.Equals(s_modality, "Non-Modal", StringComparison.OrdinalIgnoreCase)) diff --git a/Local.sln b/Local.sln index 738e2b396..6fc28d46f 100644 --- a/Local.sln +++ b/Local.sln @@ -194,6 +194,10 @@ Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Speckle.Connectors.TeklaSha EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Speckle.Converters.TeklaShared", "Converters\Tekla\Speckle.Converters.TeklaShared\Speckle.Converters.TeklaShared.shproj", "{52666479-5401-47D6-B7BA-D554784439EA}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ETABS", "ETABS", "{1F11635B-410A-4B16-A909-99CE3CCEF52E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Connector.ETABS22", "Connectors\ETABS\Speckle.Connector.ETABS22\Speckle.Connector.ETABS22.csproj", "{CAF10E70-EB0A-4D52-920A-524AA7783FD2}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -507,6 +511,12 @@ Global {4C373FD0-E3F3-478B-AD32-CDBF340D21A9}.Local|Any CPU.Build.0 = Local|Any CPU {4C373FD0-E3F3-478B-AD32-CDBF340D21A9}.Release|Any CPU.ActiveCfg = Release|Any CPU {4C373FD0-E3F3-478B-AD32-CDBF340D21A9}.Release|Any CPU.Build.0 = Release|Any CPU + {CAF10E70-EB0A-4D52-920A-524AA7783FD2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CAF10E70-EB0A-4D52-920A-524AA7783FD2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CAF10E70-EB0A-4D52-920A-524AA7783FD2}.Local|Any CPU.ActiveCfg = Debug|Any CPU + {CAF10E70-EB0A-4D52-920A-524AA7783FD2}.Local|Any CPU.Build.0 = Debug|Any CPU + {CAF10E70-EB0A-4D52-920A-524AA7783FD2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CAF10E70-EB0A-4D52-920A-524AA7783FD2}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -593,6 +603,8 @@ Global {4C373FD0-E3F3-478B-AD32-CDBF340D21A9} = {474752C4-3D2A-4A7D-B8E0-B7A43FC3694C} {3AB9028B-B2D2-464B-9BA3-39C192441E50} = {0B47C151-3B4E-4EB5-AB21-02FD096A2024} {52666479-5401-47D6-B7BA-D554784439EA} = {0B47C151-3B4E-4EB5-AB21-02FD096A2024} + {1F11635B-410A-4B16-A909-99CE3CCEF52E} = {42826721-9A18-4762-8BA9-F1429DD5C5B1} + {CAF10E70-EB0A-4D52-920A-524AA7783FD2} = {1F11635B-410A-4B16-A909-99CE3CCEF52E} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {EE253116-7070-4E9A-BCE8-2911C251B8C8} From 036ab00b6ef826f6635defe3d88ecc4129ceb2d9 Mon Sep 17 00:00:00 2001 From: Dogukan Karatas Date: Mon, 25 Nov 2024 15:44:55 +0100 Subject: [PATCH 04/11] updates packages.lock --- .../HostApp/ETABSDocumentModelStore.cs | 4 +-- .../packages.lock.json | 32 +++++++++---------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Connectors/ETABS/Speckle.Connector.ETABS22/HostApp/ETABSDocumentModelStore.cs b/Connectors/ETABS/Speckle.Connector.ETABS22/HostApp/ETABSDocumentModelStore.cs index bf2dd2b1b..cc3075b77 100644 --- a/Connectors/ETABS/Speckle.Connector.ETABS22/HostApp/ETABSDocumentModelStore.cs +++ b/Connectors/ETABS/Speckle.Connector.ETABS22/HostApp/ETABSDocumentModelStore.cs @@ -1,11 +1,11 @@ using Speckle.Connectors.DUI.Models; -using Speckle.Newtonsoft.Json; +using Speckle.Connectors.DUI.Utils; namespace Speckle.Connector.ETABS22.HostApp; public class ETABSDocumentModelStore : DocumentModelStore { - public ETABSDocumentModelStore(JsonSerializerSettings jsonSerializerSettings) + public ETABSDocumentModelStore(IJsonSerializer jsonSerializerSettings) : base(jsonSerializerSettings, true) { } public override void WriteToFile() { } diff --git a/Connectors/ETABS/Speckle.Connector.ETABS22/packages.lock.json b/Connectors/ETABS/Speckle.Connector.ETABS22/packages.lock.json index cdc9e68f0..30c94949f 100644 --- a/Connectors/ETABS/Speckle.Connector.ETABS22/packages.lock.json +++ b/Connectors/ETABS/Speckle.Connector.ETABS22/packages.lock.json @@ -214,9 +214,9 @@ "dependencies": { "Microsoft.Extensions.DependencyInjection": "[2.2.0, )", "Speckle.Connectors.Logging": "[1.0.0, )", - "Speckle.Objects": "[3.1.0-dev.181, )", - "Speckle.Sdk": "[3.1.0-dev.181, )", - "Speckle.Sdk.Dependencies": "[3.1.0-dev.181, )" + "Speckle.Objects": "[3.1.0-dev.191, )", + "Speckle.Sdk": "[3.1.0-dev.191, )", + "Speckle.Sdk.Dependencies": "[3.1.0-dev.191, )" } }, "speckle.connectors.dui": { @@ -224,8 +224,8 @@ "dependencies": { "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", "Speckle.Connectors.Common": "[1.0.0, )", - "Speckle.Sdk": "[3.1.0-dev.181, )", - "Speckle.Sdk.Dependencies": "[3.1.0-dev.181, )", + "Speckle.Sdk": "[3.1.0-dev.191, )", + "Speckle.Sdk.Dependencies": "[3.1.0-dev.191, )", "System.Threading.Tasks.Dataflow": "[6.0.0, )" } }, @@ -274,18 +274,18 @@ }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.1.0-dev.181, )", - "resolved": "3.1.0-dev.181", - "contentHash": "r6GGA7Pq4CPGYOu6OmmLW/hhhREo/l44RUFhsoYmpHNGpOg1UjF45dwyfLgaU38wrNxQoURjLUQDkxGfhb8liA==", + "requested": "[3.1.0-dev.191, )", + "resolved": "3.1.0-dev.191", + "contentHash": "+m7jRFm0ABbkcSz2UphdxAsislY10IpQ1u79c8a3aVvegLjnsVQZ1sXfRIRO1aFdulkhjYKXYpB3N9M8Z+epgQ==", "dependencies": { - "Speckle.Sdk": "3.1.0-dev.181" + "Speckle.Sdk": "3.1.0-dev.191" } }, "Speckle.Sdk": { "type": "CentralTransitive", - "requested": "[3.1.0-dev.181, )", - "resolved": "3.1.0-dev.181", - "contentHash": "VmRRphUJm+qfcjtdzxkTstAD0opaIP57tP6GJ2YnalyRj3wBTGBQuy7gwhGjWyAvsMnkugpKFEfAVuNm/zHQ2A==", + "requested": "[3.1.0-dev.191, )", + "resolved": "3.1.0-dev.191", + "contentHash": "VVT3LJiYlhqnggxxdeTt1QLrqfxDb044x0yX6kxS9b5MRzeDvK2Vz86pLDfuHs+SXvDimRVfYx1M42IW/aPcTQ==", "dependencies": { "GraphQL.Client": "6.0.0", "Microsoft.CSharp": "4.7.0", @@ -294,14 +294,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.181" + "Speckle.Sdk.Dependencies": "3.1.0-dev.191" } }, "Speckle.Sdk.Dependencies": { "type": "CentralTransitive", - "requested": "[3.1.0-dev.181, )", - "resolved": "3.1.0-dev.181", - "contentHash": "W7Nb3hAPlLXGZmEFWdf9vyhXKGZk3M+lypEKB+IWQVwr3NL+bzPgfw2130kTuMr/9zGx8jUbSfx2ulTql9mZxw==" + "requested": "[3.1.0-dev.191, )", + "resolved": "3.1.0-dev.191", + "contentHash": "EmEOyjsGsNi56Z/ZoBOn8WirTmIT2yqWvlUeUh0BSPX2TDMZXHTKOM/kHmP6HSd10KVFn2Zo/ItY7/K9iRtL1Q==" }, "System.Threading.Tasks.Dataflow": { "type": "CentralTransitive", From 944be18e5af5f7e4642289e945896c6c795fdfe0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn?= Date: Thu, 28 Nov 2024 00:11:57 +0100 Subject: [PATCH 05/11] v3 Kick-Off - Migrated the proof-of-concept to a Shared project - Some renaming headache - Use of Speckle.CSI.API NGet package (thanks Jedd) - Basic selection info works - Ready for CNX-828 and CNX-835 --- .../CSiSharedBasicConnectorBinding.cs} | 6 +- .../Bindings/CSiSharedSelectionBinding.cs | 76 +++++++++++++++++++ .../Bindings/CSiSharedSendBinding.cs} | 10 +-- .../Filters/CSiSharedSelectionFilter.cs} | 6 +- .../Speckle.Connectors.CSiShared}/Form1.cs | 12 ++- .../GlobalUsing.cs | 1 + .../HostApp/CSiSharedApplicationService.cs | 27 +++++++ .../HostApp/CSiSharedDocumentModelStore.cs} | 6 +- .../HostApp/CSiSharedIdleManager.cs} | 6 +- .../Properties/launchSettings.json | 0 .../ServiceRegistration.cs | 22 +++--- .../Speckle.Connectors.CSiShared.projitems | 31 ++++++++ .../Speckle.Connectors.CSiShared.shproj | 20 +++++ .../Speckle.Connectors.CSiShared}/cPlugin.cs | 6 +- .../Properties/launchSettings.json | 8 ++ .../Speckle.Connectors.ETABS22.csproj} | 19 ++--- .../packages.lock.json | 6 ++ .../Bindings/ETABSSelectionBinding.cs | 21 ----- Directory.Packages.props | 3 +- Speckle.Connectors.sln | 17 ++++- 20 files changed, 234 insertions(+), 69 deletions(-) rename Connectors/{ETABS/Speckle.Connector.ETABS22/Bindings/ETABSBasicConnectorBinding.cs => CSi/Speckle.Connectors.CSiShared/Bindings/CSiSharedBasicConnectorBinding.cs} (90%) create mode 100644 Connectors/CSi/Speckle.Connectors.CSiShared/Bindings/CSiSharedSelectionBinding.cs rename Connectors/{ETABS/Speckle.Connector.ETABS22/Bindings/ETABSSendBinding.cs => CSi/Speckle.Connectors.CSiShared/Bindings/CSiSharedSendBinding.cs} (88%) rename Connectors/{ETABS/Speckle.Connector.ETABS22/Filters/ETABSSelectionFilter.cs => CSi/Speckle.Connectors.CSiShared/Filters/CSiSharedSelectionFilter.cs} (52%) rename Connectors/{ETABS/Speckle.Connector.ETABS22 => CSi/Speckle.Connectors.CSiShared}/Form1.cs (66%) create mode 100644 Connectors/CSi/Speckle.Connectors.CSiShared/GlobalUsing.cs create mode 100644 Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiSharedApplicationService.cs rename Connectors/{ETABS/Speckle.Connector.ETABS22/HostApp/ETABSDocumentModelStore.cs => CSi/Speckle.Connectors.CSiShared/HostApp/CSiSharedDocumentModelStore.cs} (53%) rename Connectors/{ETABS/Speckle.Connector.ETABS22/HostApp/ETABSIdleManager.cs => CSi/Speckle.Connectors.CSiShared/HostApp/CSiSharedIdleManager.cs} (66%) rename Connectors/{ETABS/Speckle.Connector.ETABS22 => CSi/Speckle.Connectors.CSiShared}/Properties/launchSettings.json (100%) rename Connectors/{ETABS/Speckle.Connector.ETABS22 => CSi/Speckle.Connectors.CSiShared}/ServiceRegistration.cs (54%) create mode 100644 Connectors/CSi/Speckle.Connectors.CSiShared/Speckle.Connectors.CSiShared.projitems create mode 100644 Connectors/CSi/Speckle.Connectors.CSiShared/Speckle.Connectors.CSiShared.shproj rename Connectors/{ETABS/Speckle.Connector.ETABS22 => CSi/Speckle.Connectors.CSiShared}/cPlugin.cs (83%) create mode 100644 Connectors/CSi/Speckle.Connectors.ETABS22/Properties/launchSettings.json rename Connectors/{ETABS/Speckle.Connector.ETABS22/Speckle.Connector.ETABS22.csproj => CSi/Speckle.Connectors.ETABS22/Speckle.Connectors.ETABS22.csproj} (61%) rename Connectors/{ETABS/Speckle.Connector.ETABS22 => CSi/Speckle.Connectors.ETABS22}/packages.lock.json (98%) delete mode 100644 Connectors/ETABS/Speckle.Connector.ETABS22/Bindings/ETABSSelectionBinding.cs diff --git a/Connectors/ETABS/Speckle.Connector.ETABS22/Bindings/ETABSBasicConnectorBinding.cs b/Connectors/CSi/Speckle.Connectors.CSiShared/Bindings/CSiSharedBasicConnectorBinding.cs similarity index 90% rename from Connectors/ETABS/Speckle.Connector.ETABS22/Bindings/ETABSBasicConnectorBinding.cs rename to Connectors/CSi/Speckle.Connectors.CSiShared/Bindings/CSiSharedBasicConnectorBinding.cs index cac0d80c7..443aae106 100644 --- a/Connectors/ETABS/Speckle.Connector.ETABS22/Bindings/ETABSBasicConnectorBinding.cs +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/Bindings/CSiSharedBasicConnectorBinding.cs @@ -4,9 +4,9 @@ using Speckle.Connectors.DUI.Models.Card; using Speckle.Sdk; -namespace Speckle.Connector.ETABS22.Bindings; +namespace Speckle.Connectors.CSiShared.Bindings; -public class EtabsBasicConnectorBinding : IBasicConnectorBinding +public class CSiSharedBasicConnectorBinding : IBasicConnectorBinding { private readonly ISpeckleApplication _speckleApplication; private readonly DocumentModelStore _store; @@ -15,7 +15,7 @@ public class EtabsBasicConnectorBinding : IBasicConnectorBinding public IBrowserBridge Parent { get; } public BasicConnectorBindingCommands Commands { get; } - public EtabsBasicConnectorBinding( + public CSiSharedBasicConnectorBinding( IBrowserBridge parent, ISpeckleApplication speckleApplication, DocumentModelStore store diff --git a/Connectors/CSi/Speckle.Connectors.CSiShared/Bindings/CSiSharedSelectionBinding.cs b/Connectors/CSi/Speckle.Connectors.CSiShared/Bindings/CSiSharedSelectionBinding.cs new file mode 100644 index 000000000..165bee71d --- /dev/null +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/Bindings/CSiSharedSelectionBinding.cs @@ -0,0 +1,76 @@ +using Speckle.Connectors.CSiShared.HostApp; +using Speckle.Connectors.DUI.Bindings; +using Speckle.Connectors.DUI.Bridge; + +namespace Speckle.Connectors.CSiShared.Bindings; + +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" + + public CSiSharedSelectionBinding(IBrowserBridge parent, ICSiApplicationService csiApplicationService) + { + Parent = parent; + _csiApplicationService = csiApplicationService; + } + + public SelectionInfo GetSelection() + { + // TODO: Handle better. Enums? ObjectType same in ETABS and SAP + var objectTypeMap = new Dictionary + { + { 1, "Point" }, + { 2, "Frame" }, + { 3, "Cable" }, + { 4, "Tendon" }, + { 5, "Area" }, + { 6, "Solid" }, + { 7, "Link" } + }; + + int numberItems = 0; + int[] objectType = Array.Empty(); + string[] objectName = Array.Empty(); + + _csiApplicationService.SapModel.SelectObj.GetSelected(ref numberItems, ref objectType, ref objectName); + + var encodedIds = new List(numberItems); + var typeCounts = new Dictionary(); + + for (int i = 0; i < numberItems; i++) + { + var typeKey = objectType[i]; + var typeName = objectTypeMap.TryGetValue(typeKey, out var name) ? name : $"Unknown ({typeKey})"; + + encodedIds.Add(EncodeObjectIdentifier(typeKey, objectName[i])); + typeCounts[typeName] = typeCounts.GetValueOrDefault(typeName) + 1; + } + + var summary = + encodedIds.Count == 0 + ? "No objects selected." + : $"{encodedIds.Count} objects ({string.Join(", ", + typeCounts.Select(kv => $"{kv.Value} {kv.Key}"))})"; + + 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/ETABS/Speckle.Connector.ETABS22/Bindings/ETABSSendBinding.cs b/Connectors/CSi/Speckle.Connectors.CSiShared/Bindings/CSiSharedSendBinding.cs similarity index 88% rename from Connectors/ETABS/Speckle.Connector.ETABS22/Bindings/ETABSSendBinding.cs rename to Connectors/CSi/Speckle.Connectors.CSiShared/Bindings/CSiSharedSendBinding.cs index 4b4976fac..9909f8935 100644 --- a/Connectors/ETABS/Speckle.Connector.ETABS22/Bindings/ETABSSendBinding.cs +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/Bindings/CSiSharedSendBinding.cs @@ -6,9 +6,9 @@ using Speckle.Connectors.DUI.Models.Card.SendFilter; using Speckle.Connectors.DUI.Settings; -namespace Speckle.Connector.ETABS22.Bindings; +namespace Speckle.Connectors.CSiShared.Bindings; -public sealed class ETABSSendBinding : ISendBinding +public sealed class CSiSharedSendBinding : ISendBinding { public string Name => "sendBinding"; public SendBindingUICommands Commands { get; } @@ -20,9 +20,9 @@ public sealed class ETABSSendBinding : ISendBinding private readonly List _sendFilters; private readonly CancellationManager _cancellationManager; private readonly IOperationProgressManager _operationProgressManager; - private readonly ILogger _logger; + private readonly ILogger _logger; - public ETABSSendBinding( + public CSiSharedSendBinding( DocumentModelStore store, IAppIdleManager idleManager, IBrowserBridge parent, @@ -30,7 +30,7 @@ public ETABSSendBinding( IServiceProvider serviceProvider, CancellationManager cancellationManager, IOperationProgressManager operationProgressManager, - ILogger logger + ILogger logger ) { _store = store; diff --git a/Connectors/ETABS/Speckle.Connector.ETABS22/Filters/ETABSSelectionFilter.cs b/Connectors/CSi/Speckle.Connectors.CSiShared/Filters/CSiSharedSelectionFilter.cs similarity index 52% rename from Connectors/ETABS/Speckle.Connector.ETABS22/Filters/ETABSSelectionFilter.cs rename to Connectors/CSi/Speckle.Connectors.CSiShared/Filters/CSiSharedSelectionFilter.cs index 669227594..a302f1202 100644 --- a/Connectors/ETABS/Speckle.Connector.ETABS22/Filters/ETABSSelectionFilter.cs +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/Filters/CSiSharedSelectionFilter.cs @@ -1,10 +1,10 @@ using Speckle.Connectors.DUI.Models.Card.SendFilter; -namespace Speckle.Connector.ETABS22.Filters; +namespace Speckle.Connectors.CSiShared.Filters; -public class ETABSSelectionFilter : DirectSelectionSendFilter +public class CSiSharedSelectionFilter : DirectSelectionSendFilter { - public ETABSSelectionFilter() + public CSiSharedSelectionFilter() { IsDefault = true; } diff --git a/Connectors/ETABS/Speckle.Connector.ETABS22/Form1.cs b/Connectors/CSi/Speckle.Connectors.CSiShared/Form1.cs similarity index 66% rename from Connectors/ETABS/Speckle.Connector.ETABS22/Form1.cs rename to Connectors/CSi/Speckle.Connectors.CSiShared/Form1.cs index d27d388c7..5daf6107d 100644 --- a/Connectors/ETABS/Speckle.Connector.ETABS22/Form1.cs +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/Form1.cs @@ -1,11 +1,14 @@ using System.Windows.Forms.Integration; -using CSiAPIv1; using Microsoft.Extensions.DependencyInjection; using Speckle.Connectors.Common; +using Speckle.Connectors.CSiShared; +using Speckle.Connectors.CSiShared.HostApp; using Speckle.Connectors.DUI.WebView; using Speckle.Sdk.Host; -namespace Speckle.Connector.ETABS22; +// NOTE: Plugin entry point must match the assembly name, otherwise hits you with a "Not found" error when loading plugin +// TODO: Move ETABS implementation to csproj as part of CNX-835 and/or CNX-828 +namespace Speckle.Connectors.ETABS22; public class Form1 : Form { @@ -34,6 +37,11 @@ public void SetSapModel(ref cSapModel sapModel, ref cPluginCallback pluginCallba { _sapModel = sapModel; _pluginCallback = pluginCallback; + + // NOTE: Update the form to initialize the CSiSharedApplicationService when we receive "sapModel" + // Ensures service ready to use by other components + var csiService = Container!.GetRequiredService(); + csiService.Initialize(sapModel, pluginCallback); } public void Form1Closing(object? sender, FormClosingEventArgs e) diff --git a/Connectors/CSi/Speckle.Connectors.CSiShared/GlobalUsing.cs b/Connectors/CSi/Speckle.Connectors.CSiShared/GlobalUsing.cs new file mode 100644 index 000000000..2209f341b --- /dev/null +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/GlobalUsing.cs @@ -0,0 +1 @@ +global using CSiAPIv1; diff --git a/Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiSharedApplicationService.cs b/Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiSharedApplicationService.cs new file mode 100644 index 000000000..7bbefbee2 --- /dev/null +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiSharedApplicationService.cs @@ -0,0 +1,27 @@ +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/ETABS/Speckle.Connector.ETABS22/HostApp/ETABSDocumentModelStore.cs b/Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiSharedDocumentModelStore.cs similarity index 53% rename from Connectors/ETABS/Speckle.Connector.ETABS22/HostApp/ETABSDocumentModelStore.cs rename to Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiSharedDocumentModelStore.cs index cc3075b77..40997ddf3 100644 --- a/Connectors/ETABS/Speckle.Connector.ETABS22/HostApp/ETABSDocumentModelStore.cs +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiSharedDocumentModelStore.cs @@ -1,11 +1,11 @@ using Speckle.Connectors.DUI.Models; using Speckle.Connectors.DUI.Utils; -namespace Speckle.Connector.ETABS22.HostApp; +namespace Speckle.Connectors.CSiShared.HostApp; -public class ETABSDocumentModelStore : DocumentModelStore +public class CSiSharedDocumentModelStore : DocumentModelStore { - public ETABSDocumentModelStore(IJsonSerializer jsonSerializerSettings) + public CSiSharedDocumentModelStore(IJsonSerializer jsonSerializerSettings) : base(jsonSerializerSettings, true) { } public override void WriteToFile() { } diff --git a/Connectors/ETABS/Speckle.Connector.ETABS22/HostApp/ETABSIdleManager.cs b/Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiSharedIdleManager.cs similarity index 66% rename from Connectors/ETABS/Speckle.Connector.ETABS22/HostApp/ETABSIdleManager.cs rename to Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiSharedIdleManager.cs index b8f94eb50..accedfd75 100644 --- a/Connectors/ETABS/Speckle.Connector.ETABS22/HostApp/ETABSIdleManager.cs +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiSharedIdleManager.cs @@ -1,12 +1,12 @@ using Speckle.Connectors.DUI.Bridge; -namespace Speckle.Connector.ETABS22.HostApp; +namespace Speckle.Connectors.CSiShared.HostApp; -public sealed class EtabsIdleManager : AppIdleManager +public sealed class CSiSharedIdleManager : AppIdleManager { private readonly IIdleCallManager _idleCallManager; - public EtabsIdleManager(IIdleCallManager idleCallManager) + public CSiSharedIdleManager(IIdleCallManager idleCallManager) : base(idleCallManager) { _idleCallManager = idleCallManager; diff --git a/Connectors/ETABS/Speckle.Connector.ETABS22/Properties/launchSettings.json b/Connectors/CSi/Speckle.Connectors.CSiShared/Properties/launchSettings.json similarity index 100% rename from Connectors/ETABS/Speckle.Connector.ETABS22/Properties/launchSettings.json rename to Connectors/CSi/Speckle.Connectors.CSiShared/Properties/launchSettings.json diff --git a/Connectors/ETABS/Speckle.Connector.ETABS22/ServiceRegistration.cs b/Connectors/CSi/Speckle.Connectors.CSiShared/ServiceRegistration.cs similarity index 54% rename from Connectors/ETABS/Speckle.Connector.ETABS22/ServiceRegistration.cs rename to Connectors/CSi/Speckle.Connectors.CSiShared/ServiceRegistration.cs index 7a833ccbe..c30abfcd0 100644 --- a/Connectors/ETABS/Speckle.Connector.ETABS22/ServiceRegistration.cs +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/ServiceRegistration.cs @@ -1,8 +1,8 @@ using Microsoft.Extensions.DependencyInjection; -using Speckle.Connector.ETABS22.Bindings; -using Speckle.Connector.ETABS22.Filters; -using Speckle.Connector.ETABS22.HostApp; using Speckle.Connectors.Common; +using Speckle.Connectors.CSiShared.Bindings; +using Speckle.Connectors.CSiShared.Filters; +using Speckle.Connectors.CSiShared.HostApp; using Speckle.Connectors.DUI; using Speckle.Connectors.DUI.Bindings; using Speckle.Connectors.DUI.Bridge; @@ -10,32 +10,34 @@ using Speckle.Connectors.DUI.Models.Card.SendFilter; using Speckle.Connectors.DUI.WebView; -namespace Speckle.Connector.ETABS22; +namespace Speckle.Connectors.CSiShared; public static class ServiceRegistration { + // TODO: AddCSi and AddETABS for shared and specific implementations respectively. To do with CNX-828 public static IServiceCollection AddETABS(this IServiceCollection services) { services.AddSingleton(); + services.AddSingleton(); services.AddConnectorUtils(); services.AddDUI(); services.AddDUIView(); - services.AddSingleton(); + services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); services.AddSingleton(sp => sp.GetRequiredService()); - services.AddSingleton(); - services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); - services.AddSingleton(); - services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); - services.AddScoped(); + 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 new file mode 100644 index 000000000..18d0db05c --- /dev/null +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/Speckle.Connectors.CSiShared.projitems @@ -0,0 +1,31 @@ + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + true + a8e949b8-aa55-4909-99f0-8b551791a1f8 + + + Speckle.Connectors.CSiShared + + + + + + + + + Form + + + + + + + + + + PreserveNewest + + + diff --git a/Connectors/CSi/Speckle.Connectors.CSiShared/Speckle.Connectors.CSiShared.shproj b/Connectors/CSi/Speckle.Connectors.CSiShared/Speckle.Connectors.CSiShared.shproj new file mode 100644 index 000000000..d66e04f58 --- /dev/null +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/Speckle.Connectors.CSiShared.shproj @@ -0,0 +1,20 @@ + + + + a8e949b8-aa55-4909-99f0-8b551791a1f8 + 14.0 + + + + + + + + + Form + + + + + + diff --git a/Connectors/ETABS/Speckle.Connector.ETABS22/cPlugin.cs b/Connectors/CSi/Speckle.Connectors.CSiShared/cPlugin.cs similarity index 83% rename from Connectors/ETABS/Speckle.Connector.ETABS22/cPlugin.cs rename to Connectors/CSi/Speckle.Connectors.CSiShared/cPlugin.cs index df6a82069..19d1bd052 100644 --- a/Connectors/ETABS/Speckle.Connector.ETABS22/cPlugin.cs +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/cPlugin.cs @@ -1,6 +1,6 @@ -using CSiAPIv1; - -namespace Speckle.Connector.ETABS22; +// NOTE: Plugin entry point must match the assembly name, otherwise hits you with a "Not found" error when loading plugin +// TODO: Move ETABS implementation to csproj as part of CNX-835 and/or CNX-828 +namespace Speckle.Connectors.ETABS22; [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "")] public class cPlugin : cPluginContract, IDisposable diff --git a/Connectors/CSi/Speckle.Connectors.ETABS22/Properties/launchSettings.json b/Connectors/CSi/Speckle.Connectors.ETABS22/Properties/launchSettings.json new file mode 100644 index 000000000..1fd348981 --- /dev/null +++ b/Connectors/CSi/Speckle.Connectors.ETABS22/Properties/launchSettings.json @@ -0,0 +1,8 @@ +{ + "profiles": { + "ETABS 22": { + "commandName": "Executable", + "executablePath": "C:\\Program Files\\Computers and Structures\\ETABS 22\\ETABS.exe" + } + } +} diff --git a/Connectors/ETABS/Speckle.Connector.ETABS22/Speckle.Connector.ETABS22.csproj b/Connectors/CSi/Speckle.Connectors.ETABS22/Speckle.Connectors.ETABS22.csproj similarity index 61% rename from Connectors/ETABS/Speckle.Connector.ETABS22/Speckle.Connector.ETABS22.csproj rename to Connectors/CSi/Speckle.Connectors.ETABS22/Speckle.Connectors.ETABS22.csproj index 4a73a5927..09021af6a 100644 --- a/Connectors/ETABS/Speckle.Connector.ETABS22/Speckle.Connector.ETABS22.csproj +++ b/Connectors/CSi/Speckle.Connectors.ETABS22/Speckle.Connectors.ETABS22.csproj @@ -4,28 +4,23 @@ net8.0-windows enable enable - AnyCPU;x64 + AnyCPU true true + 22 + $(DefineConstants);ETABS22;ETABS22_OR_GREATER true - - - ..\..\..\..\..\..\..\..\Program Files\Computers and Structures\ETABS 22\CSiAPIv1.dll - false - runtime - - - - - Form - + + + + diff --git a/Connectors/ETABS/Speckle.Connector.ETABS22/packages.lock.json b/Connectors/CSi/Speckle.Connectors.ETABS22/packages.lock.json similarity index 98% rename from Connectors/ETABS/Speckle.Connector.ETABS22/packages.lock.json rename to Connectors/CSi/Speckle.Connectors.ETABS22/packages.lock.json index 30c94949f..cff81fb28 100644 --- a/Connectors/ETABS/Speckle.Connector.ETABS22/packages.lock.json +++ b/Connectors/CSi/Speckle.Connectors.ETABS22/packages.lock.json @@ -27,6 +27,12 @@ "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, )", diff --git a/Connectors/ETABS/Speckle.Connector.ETABS22/Bindings/ETABSSelectionBinding.cs b/Connectors/ETABS/Speckle.Connector.ETABS22/Bindings/ETABSSelectionBinding.cs deleted file mode 100644 index 166e6383e..000000000 --- a/Connectors/ETABS/Speckle.Connector.ETABS22/Bindings/ETABSSelectionBinding.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Speckle.Connectors.DUI.Bindings; -using Speckle.Connectors.DUI.Bridge; - -namespace Speckle.Connector.ETABS22.Bindings; - -public class ETABSSelectionBinding : ISelectionBinding -{ - public string Name => "selectionBinding"; - public IBrowserBridge Parent { get; } - - public ETABSSelectionBinding(IBrowserBridge parent) - { - Parent = parent; - } - - public SelectionInfo GetSelection() - { - // placeholder for actual implementation - return new SelectionInfo(new List(), "No objects selected."); - } -} diff --git a/Directory.Packages.props b/Directory.Packages.props index a639e68a1..8c7ffa159 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -20,6 +20,7 @@ + @@ -49,4 +50,4 @@ - + \ No newline at end of file diff --git a/Speckle.Connectors.sln b/Speckle.Connectors.sln index ba9f5c828..c9d943584 100644 --- a/Speckle.Connectors.sln +++ b/Speckle.Connectors.sln @@ -189,9 +189,15 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connector.Tekla2023 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converter.Tekla2023", "Converters\Tekla\Speckle.Converter.Tekla2023\Speckle.Converter.Tekla2023.csproj", "{8F9181C2-1808-44C0-A33A-5BAE40C49E63}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ETABS", "ETABS", "{073F40A8-6C95-41C1-A2F3-369FFFCB9520}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CSi", "CSi", "{073F40A8-6C95-41C1-A2F3-369FFFCB9520}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Connector.ETABS22", "Connectors\ETABS\Speckle.Connector.ETABS22\Speckle.Connector.ETABS22.csproj", "{7C49337A-6F7B-47AB-B549-42E799E89CF2}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connectors.ETABS22", "Connectors\CSi\Speckle.Connectors.ETABS22\Speckle.Connectors.ETABS22.csproj", "{7C49337A-6F7B-47AB-B549-42E799E89CF2}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ETABS22", "ETABS22", "{C6CD9332-874A-49DA-BEB6-3FAA5A700793}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{181F0468-B7A7-4CD7-ABD1-7F32B3ABB991}" +EndProject +Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Speckle.Connectors.CSiShared", "Connectors\CSi\Speckle.Connectors.CSiShared\Speckle.Connectors.CSiShared.shproj", "{A8E949B8-AA55-4909-99F0-8B551791A1F8}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -581,7 +587,10 @@ Global {025C85F8-F741-4600-BC46-5FEAD754B65D} = {C552C165-5023-47AB-9EE1-1EA61819D2B1} {8F9181C2-1808-44C0-A33A-5BAE40C49E63} = {C552C165-5023-47AB-9EE1-1EA61819D2B1} {073F40A8-6C95-41C1-A2F3-369FFFCB9520} = {42826721-9A18-4762-8BA9-F1429DD5C5B1} - {7C49337A-6F7B-47AB-B549-42E799E89CF2} = {073F40A8-6C95-41C1-A2F3-369FFFCB9520} + {7C49337A-6F7B-47AB-B549-42E799E89CF2} = {C6CD9332-874A-49DA-BEB6-3FAA5A700793} + {C6CD9332-874A-49DA-BEB6-3FAA5A700793} = {073F40A8-6C95-41C1-A2F3-369FFFCB9520} + {181F0468-B7A7-4CD7-ABD1-7F32B3ABB991} = {073F40A8-6C95-41C1-A2F3-369FFFCB9520} + {A8E949B8-AA55-4909-99F0-8B551791A1F8} = {181F0468-B7A7-4CD7-ABD1-7F32B3ABB991} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {EE253116-7070-4E9A-BCE8-2911C251B8C8} @@ -615,6 +624,7 @@ Global Converters\Revit\Speckle.Converters.RevitShared.Tests\Speckle.Converters.RevitShared.Tests.projitems*{68cf9bdf-94ac-4d2d-a7bd-d1c064f97051}*SharedItemsImports = 5 Converters\Revit\Speckle.Converters.RevitShared\Speckle.Converters.RevitShared.projitems*{68cf9bdf-94ac-4d2d-a7bd-d1c064f97051}*SharedItemsImports = 5 Connectors\Revit\Speckle.Connectors.RevitShared.Cef\Speckle.Connectors.RevitShared.Cef.projitems*{6a40cbe4-ecab-4ced-9917-5c64cbf75da6}*SharedItemsImports = 13 + Connectors\CSi\Speckle.Connectors.CsiShared\Speckle.Connectors.CsiShared.projitems*{7c49337a-6f7b-47ab-b549-42e799e89cf2}*SharedItemsImports = 5 Connectors\Revit\Speckle.Connectors.RevitShared.Cef\Speckle.Connectors.RevitShared.Cef.projitems*{7f1fdcf2-0ce8-4119-b3c1-f2cc6d7e1c36}*SharedItemsImports = 5 Connectors\Revit\Speckle.Connectors.RevitShared\Speckle.Connectors.RevitShared.projitems*{7f1fdcf2-0ce8-4119-b3c1-f2cc6d7e1c36}*SharedItemsImports = 5 Connectors\Autocad\Speckle.Connectors.AutocadShared\Speckle.Connectors.AutocadShared.projitems*{81fcee13-feac-475d-9ef9-71132ef26909}*SharedItemsImports = 5 @@ -630,6 +640,7 @@ Global Connectors\Revit\Speckle.Connectors.RevitShared.Cef\Speckle.Connectors.RevitShared.Cef.projitems*{a6de3da0-b242-4f49-aef0-4e26af92d16c}*SharedItemsImports = 5 Connectors\Revit\Speckle.Connectors.RevitShared\Speckle.Connectors.RevitShared.projitems*{a6de3da0-b242-4f49-aef0-4e26af92d16c}*SharedItemsImports = 5 Connectors\Rhino\Speckle.Connectors.RhinoShared\Speckle.Connectors.RhinoShared.projitems*{a6e3a82f-4696-4d92-aba1-38aa80752067}*SharedItemsImports = 5 + Connectors\CSi\Speckle.Connectors.CsiShared\Speckle.Connectors.CsiShared.projitems*{a8e949b8-aa55-4909-99f0-8b551791a1f8}*SharedItemsImports = 13 Converters\Rhino\Speckle.Converters.RhinoShared\Speckle.Converters.RhinoShared.projitems*{ac2db416-f05c-4296-9040-56d6ad4fcd27}*SharedItemsImports = 5 Converters\Tekla\Speckle.Converters.TeklaShared\Speckle.Converters.TeklaShared.projitems*{acf75860-7fce-4ae9-8c45-68ad1043550b}*SharedItemsImports = 5 Connectors\Autocad\Speckle.Connectors.AutocadShared\Speckle.Connectors.AutocadShared.projitems*{afab80bd-a4dd-4cad-9937-acbfed668a48}*SharedItemsImports = 5 From a50109d51c15a13f066f1bb11853dfe2fc9078a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn?= Date: Thu, 28 Nov 2024 00:42:18 +0100 Subject: [PATCH 06/11] Renaming - Renaming of the solution structure(s) outdated in the Local.sln --- Local.sln | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Local.sln b/Local.sln index 6fc28d46f..5bb6f9347 100644 --- a/Local.sln +++ b/Local.sln @@ -194,9 +194,9 @@ Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Speckle.Connectors.TeklaSha EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Speckle.Converters.TeklaShared", "Converters\Tekla\Speckle.Converters.TeklaShared\Speckle.Converters.TeklaShared.shproj", "{52666479-5401-47D6-B7BA-D554784439EA}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ETABS", "ETABS", "{1F11635B-410A-4B16-A909-99CE3CCEF52E}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CSi", "CSi", "{1F11635B-410A-4B16-A909-99CE3CCEF52E}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Connector.ETABS22", "Connectors\ETABS\Speckle.Connector.ETABS22\Speckle.Connector.ETABS22.csproj", "{CAF10E70-EB0A-4D52-920A-524AA7783FD2}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Connectors.ETABS22", "Connectors\CSi\ETABS22\Speckle.Connectors.ETABS22\Speckle.Connectors.ETABS22.csproj", "{CAF10E70-EB0A-4D52-920A-524AA7783FD2}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution From fe26aa12ed986842618d67dcc6bd795eada55ae6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn?= Date: Thu, 28 Nov 2024 10:39:46 +0100 Subject: [PATCH 07/11] Local.sln Updates --- Local.sln | 43 ++++++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/Local.sln b/Local.sln index 5bb6f9347..1e70afac8 100644 --- a/Local.sln +++ b/Local.sln @@ -174,7 +174,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converters.Civil3d2 EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Speckle.Connectors.Civil3dShared", "Connectors\Autocad\Speckle.Connectors.Civil3dShared\Speckle.Connectors.Civil3dShared.shproj", "{EFD01520-93E8-4CCA-8E03-9CDC635F55F4}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Sdk.Dependencies", "..\speckle-sharp-sdk\src\Speckle.Sdk.Dependencies\Speckle.Sdk.Dependencies.csproj", "{B4679D71-F2F5-4759-8FDD-E305C1370306}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Sdk.Dependencies", "..\speckle-sharp-sdk\src\Speckle.Sdk.Dependencies\Speckle.Sdk.Dependencies.csproj", "{B4679D71-F2F5-4759-8FDD-E305C1370306}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "2024", "2024", "{474752C4-3D2A-4A7D-B8E0-B7A43FC3694C}" EndProject @@ -182,13 +182,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "2023", "2023", "{AF303676-6 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{0B47C151-3B4E-4EB5-AB21-02FD096A2024}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Connector.Tekla2023", "Connectors\Tekla\Speckle.Connector.Tekla2023\Speckle.Connector.Tekla2023.csproj", "{A277CDF6-7C8F-4870-8D15-AF35F4749CAA}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connector.Tekla2023", "Connectors\Tekla\Speckle.Connector.Tekla2023\Speckle.Connector.Tekla2023.csproj", "{A277CDF6-7C8F-4870-8D15-AF35F4749CAA}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Converter.Tekla2023", "Converters\Tekla\Speckle.Converter.Tekla2023\Speckle.Converter.Tekla2023.csproj", "{B236750B-CFE5-4640-9073-77A27A7257F6}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converter.Tekla2023", "Converters\Tekla\Speckle.Converter.Tekla2023\Speckle.Converter.Tekla2023.csproj", "{B236750B-CFE5-4640-9073-77A27A7257F6}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Connector.Tekla2024", "Connectors\Tekla\Speckle.Connector.Tekla2024\Speckle.Connector.Tekla2024.csproj", "{2CBC9A3D-8AC6-4127-ADA5-C6D7F07A35E3}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connector.Tekla2024", "Connectors\Tekla\Speckle.Connector.Tekla2024\Speckle.Connector.Tekla2024.csproj", "{2CBC9A3D-8AC6-4127-ADA5-C6D7F07A35E3}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Converter.Tekla2024", "Converters\Tekla\Speckle.Converter.Tekla2024\Speckle.Converter.Tekla2024.csproj", "{4C373FD0-E3F3-478B-AD32-CDBF340D21A9}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Converter.Tekla2024", "Converters\Tekla\Speckle.Converter.Tekla2024\Speckle.Converter.Tekla2024.csproj", "{4C373FD0-E3F3-478B-AD32-CDBF340D21A9}" EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Speckle.Connectors.TeklaShared", "Connectors\Tekla\Speckle.Connector.TeklaShared\Speckle.Connectors.TeklaShared.shproj", "{3AB9028B-B2D2-464B-9BA3-39C192441E50}" EndProject @@ -196,7 +196,13 @@ Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Speckle.Converters.TeklaSha EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CSi", "CSi", "{1F11635B-410A-4B16-A909-99CE3CCEF52E}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Connectors.ETABS22", "Connectors\CSi\ETABS22\Speckle.Connectors.ETABS22\Speckle.Connectors.ETABS22.csproj", "{CAF10E70-EB0A-4D52-920A-524AA7783FD2}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Speckle.Connectors.ETABS22", "Connectors\CSi\Speckle.Connectors.ETABS22\Speckle.Connectors.ETABS22.csproj", "{AFB47B71-4185-4135-98BB-EEDFFA8AA194}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ETABS22", "ETABS22", "{F2A1E5FC-CFEF-4590-BF0D-BE7B9F74E567}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{D2638AC8-28B2-4667-A47B-3FAB9F900E6F}" +EndProject +Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Speckle.Connectors.CSiShared", "Connectors\CSi\Speckle.Connectors.CSiShared\Speckle.Connectors.CSiShared.shproj", "{A8E949B8-AA55-4909-99F0-8B551791A1F8}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -511,12 +517,12 @@ Global {4C373FD0-E3F3-478B-AD32-CDBF340D21A9}.Local|Any CPU.Build.0 = Local|Any CPU {4C373FD0-E3F3-478B-AD32-CDBF340D21A9}.Release|Any CPU.ActiveCfg = Release|Any CPU {4C373FD0-E3F3-478B-AD32-CDBF340D21A9}.Release|Any CPU.Build.0 = Release|Any CPU - {CAF10E70-EB0A-4D52-920A-524AA7783FD2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CAF10E70-EB0A-4D52-920A-524AA7783FD2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CAF10E70-EB0A-4D52-920A-524AA7783FD2}.Local|Any CPU.ActiveCfg = Debug|Any CPU - {CAF10E70-EB0A-4D52-920A-524AA7783FD2}.Local|Any CPU.Build.0 = Debug|Any CPU - {CAF10E70-EB0A-4D52-920A-524AA7783FD2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CAF10E70-EB0A-4D52-920A-524AA7783FD2}.Release|Any CPU.Build.0 = Release|Any CPU + {AFB47B71-4185-4135-98BB-EEDFFA8AA194}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AFB47B71-4185-4135-98BB-EEDFFA8AA194}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AFB47B71-4185-4135-98BB-EEDFFA8AA194}.Local|Any CPU.ActiveCfg = Debug|Any CPU + {AFB47B71-4185-4135-98BB-EEDFFA8AA194}.Local|Any CPU.Build.0 = Debug|Any CPU + {AFB47B71-4185-4135-98BB-EEDFFA8AA194}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AFB47B71-4185-4135-98BB-EEDFFA8AA194}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -604,7 +610,10 @@ Global {3AB9028B-B2D2-464B-9BA3-39C192441E50} = {0B47C151-3B4E-4EB5-AB21-02FD096A2024} {52666479-5401-47D6-B7BA-D554784439EA} = {0B47C151-3B4E-4EB5-AB21-02FD096A2024} {1F11635B-410A-4B16-A909-99CE3CCEF52E} = {42826721-9A18-4762-8BA9-F1429DD5C5B1} - {CAF10E70-EB0A-4D52-920A-524AA7783FD2} = {1F11635B-410A-4B16-A909-99CE3CCEF52E} + {AFB47B71-4185-4135-98BB-EEDFFA8AA194} = {F2A1E5FC-CFEF-4590-BF0D-BE7B9F74E567} + {F2A1E5FC-CFEF-4590-BF0D-BE7B9F74E567} = {1F11635B-410A-4B16-A909-99CE3CCEF52E} + {D2638AC8-28B2-4667-A47B-3FAB9F900E6F} = {1F11635B-410A-4B16-A909-99CE3CCEF52E} + {A8E949B8-AA55-4909-99F0-8B551791A1F8} = {D2638AC8-28B2-4667-A47B-3FAB9F900E6F} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {EE253116-7070-4E9A-BCE8-2911C251B8C8} @@ -621,10 +630,14 @@ Global Converters\Civil3d\Speckle.Converters.Civil3dShared\Speckle.Converters.Civil3dShared.projitems*{25172c49-7aa4-4739-bb07-69785094c379}*SharedItemsImports = 5 Converters\Revit\Speckle.Converters.RevitShared\Speckle.Converters.RevitShared.projitems*{26391930-f86f-47e0-a5f6-b89919e38ce1}*SharedItemsImports = 5 Connectors\Autocad\Speckle.Connectors.AutocadShared\Speckle.Connectors.AutocadShared.projitems*{27afbc57-f493-4b51-bee0-0c364b6a6a13}*SharedItemsImports = 5 + Connectors\Tekla\Speckle.Connector.TeklaShared\Speckle.Connectors.TeklaShared.projitems*{2cbc9a3d-8ac6-4127-ada5-c6d7f07a35e3}*SharedItemsImports = 5 Converters\Autocad\Speckle.Converters.AutocadShared\Speckle.Converters.AutocadShared.projitems*{2f04e109-2b13-4dfc-961d-b7eea94299bd}*SharedItemsImports = 5 Converters\Civil3d\Speckle.Converters.Civil3dShared\Speckle.Converters.Civil3dShared.projitems*{35175682-da83-4c0a-a49d-b191f5885d8e}*SharedItemsImports = 13 + Connectors\Tekla\Speckle.Connector.TeklaShared\Speckle.Connectors.TeklaShared.projitems*{3ab9028b-b2d2-464b-9ba3-39c192441e50}*SharedItemsImports = 13 Connectors\Autocad\Speckle.Connectors.AutocadShared\Speckle.Connectors.AutocadShared.projitems*{41bc679f-887f-44cf-971d-a5502ee87db0}*SharedItemsImports = 13 + Converters\Tekla\Speckle.Converters.TeklaShared\Speckle.Converters.TeklaShared.projitems*{4c373fd0-e3f3-478b-ad32-cdbf340d21a9}*SharedItemsImports = 5 Converters\Revit\Speckle.Converters.RevitShared\Speckle.Converters.RevitShared.projitems*{4d40a101-07e6-4ff2-8934-83434932591d}*SharedItemsImports = 5 + Converters\Tekla\Speckle.Converters.TeklaShared\Speckle.Converters.TeklaShared.projitems*{52666479-5401-47d6-b7ba-d554784439ea}*SharedItemsImports = 13 Converters\Rhino\Speckle.Converters.RhinoShared\Speckle.Converters.RhinoShared.projitems*{57c1aa51-5be2-40f3-8cb2-8b7d2af0ff5c}*SharedItemsImports = 5 Connectors\Revit\Speckle.Connectors.RevitShared.Cef\Speckle.Connectors.RevitShared.Cef.projitems*{617bd3c7-87d9-4d28-8ac9-4910945bb9fc}*SharedItemsImports = 5 Connectors\Revit\Speckle.Connectors.RevitShared\Speckle.Connectors.RevitShared.projitems*{617bd3c7-87d9-4d28-8ac9-4910945bb9fc}*SharedItemsImports = 5 @@ -640,11 +653,15 @@ Global Connectors\Revit\Speckle.Connectors.RevitShared\Speckle.Connectors.RevitShared.projitems*{7f1fdcf2-0ce8-4119-b3c1-f2cc6d7e1c36}*SharedItemsImports = 5 Connectors\Autocad\Speckle.Connectors.AutocadShared\Speckle.Connectors.AutocadShared.projitems*{89c4cbc7-1606-40de-b6da-fbe3aac98395}*SharedItemsImports = 5 Converters\Autocad\Speckle.Converters.AutocadShared\Speckle.Converters.AutocadShared.projitems*{9add1b7a-6401-4202-8613-f668e2fbc0a4}*SharedItemsImports = 13 + Connectors\Tekla\Speckle.Connector.TeklaShared\Speckle.Connectors.TeklaShared.projitems*{a277cdf6-7c8f-4870-8d15-af35f4749caa}*SharedItemsImports = 5 Connectors\Revit\Speckle.Connectors.RevitShared.Cef\Speckle.Connectors.RevitShared.Cef.projitems*{a6de3da0-b242-4f49-aef0-4e26af92d16c}*SharedItemsImports = 5 Connectors\Revit\Speckle.Connectors.RevitShared\Speckle.Connectors.RevitShared.projitems*{a6de3da0-b242-4f49-aef0-4e26af92d16c}*SharedItemsImports = 5 + Connectors\CSi\Speckle.Connectors.CSiShared\Speckle.Connectors.CSiShared.projitems*{a8e949b8-aa55-4909-99f0-8b551791a1f8}*SharedItemsImports = 13 Converters\Rhino\Speckle.Converters.RhinoShared\Speckle.Converters.RhinoShared.projitems*{ac2db416-f05c-4296-9040-56d6ad4fcd27}*SharedItemsImports = 5 Converters\Autocad\Speckle.Converters.AutocadShared\Speckle.Converters.AutocadShared.projitems*{ae75b68f-3594-403b-9719-9c36da0e3f8a}*SharedItemsImports = 5 Converters\Civil3d\Speckle.Converters.Civil3dShared\Speckle.Converters.Civil3dShared.projitems*{ae75b68f-3594-403b-9719-9c36da0e3f8a}*SharedItemsImports = 5 + Connectors\CSi\Speckle.Connectors.CSiShared\Speckle.Connectors.CSiShared.projitems*{afb47b71-4185-4135-98bb-eedffa8aa194}*SharedItemsImports = 5 + Converters\Tekla\Speckle.Converters.TeklaShared\Speckle.Converters.TeklaShared.projitems*{b236750b-cfe5-4640-9073-77a27a7257f6}*SharedItemsImports = 5 Connectors\Rhino\Speckle.Connectors.RhinoShared\Speckle.Connectors.RhinoShared.projitems*{b37d4b9a-8d3f-4fa5-b9c8-e6c5f8a0c1e2}*SharedItemsImports = 13 Converters\Autocad\Speckle.Converters.AutocadShared\Speckle.Converters.AutocadShared.projitems*{b6c04ec4-ed81-4e61-b4b2-4902015808d7}*SharedItemsImports = 5 Converters\Civil3d\Speckle.Converters.Civil3dShared\Speckle.Converters.Civil3dShared.projitems*{b6c04ec4-ed81-4e61-b4b2-4902015808d7}*SharedItemsImports = 5 From 29d7f448b328b9f4fe5327037373cfb45d73932d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn?= Date: Thu, 28 Nov 2024 11:00:42 +0100 Subject: [PATCH 08/11] SDK 3.1.0-dev.200 changes --- .../CSiSharedBasicConnectorBinding.cs | 2 +- .../HostApp/CSiSharedDocumentModelStore.cs | 6 ++-- .../ServiceRegistration.cs | 2 +- .../packages.lock.json | 32 +++++++++---------- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Connectors/CSi/Speckle.Connectors.CSiShared/Bindings/CSiSharedBasicConnectorBinding.cs b/Connectors/CSi/Speckle.Connectors.CSiShared/Bindings/CSiSharedBasicConnectorBinding.cs index 443aae106..6526e4ae8 100644 --- a/Connectors/CSi/Speckle.Connectors.CSiShared/Bindings/CSiSharedBasicConnectorBinding.cs +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/Bindings/CSiSharedBasicConnectorBinding.cs @@ -37,7 +37,7 @@ DocumentModelStore store public DocumentModelStore GetDocumentState() => _store; - public void AddModel(ModelCard model) => _store.Models.Add(model); + public void AddModel(ModelCard model) => _store.AddModel(model); public void UpdateModel(ModelCard model) => _store.UpdateModel(model); diff --git a/Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiSharedDocumentModelStore.cs b/Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiSharedDocumentModelStore.cs index 40997ddf3..0117155b2 100644 --- a/Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiSharedDocumentModelStore.cs +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/HostApp/CSiSharedDocumentModelStore.cs @@ -6,9 +6,9 @@ namespace Speckle.Connectors.CSiShared.HostApp; public class CSiSharedDocumentModelStore : DocumentModelStore { public CSiSharedDocumentModelStore(IJsonSerializer jsonSerializerSettings) - : base(jsonSerializerSettings, true) { } + : base(jsonSerializerSettings) { } - public override void WriteToFile() { } + protected override void HostAppSaveState(string modelCardState) => throw new NotImplementedException(); - public override void ReadFromFile() { } + protected override void LoadState() => throw new NotImplementedException(); } diff --git a/Connectors/CSi/Speckle.Connectors.CSiShared/ServiceRegistration.cs b/Connectors/CSi/Speckle.Connectors.CSiShared/ServiceRegistration.cs index c30abfcd0..9e730e441 100644 --- a/Connectors/CSi/Speckle.Connectors.CSiShared/ServiceRegistration.cs +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/ServiceRegistration.cs @@ -21,7 +21,7 @@ public static IServiceCollection AddETABS(this IServiceCollection services) services.AddSingleton(); services.AddConnectorUtils(); - services.AddDUI(); + services.AddDUI(); services.AddDUIView(); services.AddSingleton(); diff --git a/Connectors/CSi/Speckle.Connectors.ETABS22/packages.lock.json b/Connectors/CSi/Speckle.Connectors.ETABS22/packages.lock.json index cff81fb28..873e54ded 100644 --- a/Connectors/CSi/Speckle.Connectors.ETABS22/packages.lock.json +++ b/Connectors/CSi/Speckle.Connectors.ETABS22/packages.lock.json @@ -220,9 +220,9 @@ "dependencies": { "Microsoft.Extensions.DependencyInjection": "[2.2.0, )", "Speckle.Connectors.Logging": "[1.0.0, )", - "Speckle.Objects": "[3.1.0-dev.191, )", - "Speckle.Sdk": "[3.1.0-dev.191, )", - "Speckle.Sdk.Dependencies": "[3.1.0-dev.191, )" + "Speckle.Objects": "[3.1.0-dev.200, )", + "Speckle.Sdk": "[3.1.0-dev.200, )", + "Speckle.Sdk.Dependencies": "[3.1.0-dev.200, )" } }, "speckle.connectors.dui": { @@ -230,8 +230,8 @@ "dependencies": { "Microsoft.Extensions.Logging.Abstractions": "[2.2.0, )", "Speckle.Connectors.Common": "[1.0.0, )", - "Speckle.Sdk": "[3.1.0-dev.191, )", - "Speckle.Sdk.Dependencies": "[3.1.0-dev.191, )", + "Speckle.Sdk": "[3.1.0-dev.200, )", + "Speckle.Sdk.Dependencies": "[3.1.0-dev.200, )", "System.Threading.Tasks.Dataflow": "[6.0.0, )" } }, @@ -280,18 +280,18 @@ }, "Speckle.Objects": { "type": "CentralTransitive", - "requested": "[3.1.0-dev.191, )", - "resolved": "3.1.0-dev.191", - "contentHash": "+m7jRFm0ABbkcSz2UphdxAsislY10IpQ1u79c8a3aVvegLjnsVQZ1sXfRIRO1aFdulkhjYKXYpB3N9M8Z+epgQ==", + "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.191" + "Speckle.Sdk": "3.1.0-dev.200" } }, "Speckle.Sdk": { "type": "CentralTransitive", - "requested": "[3.1.0-dev.191, )", - "resolved": "3.1.0-dev.191", - "contentHash": "VVT3LJiYlhqnggxxdeTt1QLrqfxDb044x0yX6kxS9b5MRzeDvK2Vz86pLDfuHs+SXvDimRVfYx1M42IW/aPcTQ==", + "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", @@ -300,14 +300,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.191" + "Speckle.Sdk.Dependencies": "3.1.0-dev.200" } }, "Speckle.Sdk.Dependencies": { "type": "CentralTransitive", - "requested": "[3.1.0-dev.191, )", - "resolved": "3.1.0-dev.191", - "contentHash": "EmEOyjsGsNi56Z/ZoBOn8WirTmIT2yqWvlUeUh0BSPX2TDMZXHTKOM/kHmP6HSd10KVFn2Zo/ItY7/K9iRtL1Q==" + "requested": "[3.1.0-dev.200, )", + "resolved": "3.1.0-dev.200", + "contentHash": "4ZHkKRzI6/Xa1c20NrH3+e+m5DUB+qbBSq+GJ6MShUh6SpKOC4DRdwy0qCcAWrurq7V94xU0qN+7+QzKGeWlFw==" }, "System.Threading.Tasks.Dataflow": { "type": "CentralTransitive", From 2f84c2c7fc53b3ab604350090054ebeae11902a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn?= Date: Thu, 28 Nov 2024 11:09:59 +0100 Subject: [PATCH 09/11] s_modality Code style error --- Connectors/CSi/Speckle.Connectors.CSiShared/cPlugin.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Connectors/CSi/Speckle.Connectors.CSiShared/cPlugin.cs b/Connectors/CSi/Speckle.Connectors.CSiShared/cPlugin.cs index 19d1bd052..9c60f5075 100644 --- a/Connectors/CSi/Speckle.Connectors.CSiShared/cPlugin.cs +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/cPlugin.cs @@ -5,7 +5,7 @@ namespace Speckle.Connectors.ETABS22; [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "")] public class cPlugin : cPluginContract, IDisposable { - private static string s_modality = "Non-Modal"; + private const string s_modality = "Non-Modal"; private Form1? _panel; private bool _disposed; From 00bfe8121201767cb29d6b1d1de24885476147a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn?= Date: Thu, 28 Nov 2024 11:44:42 +0100 Subject: [PATCH 10/11] Remove launchSettings.json from shared --- .../Properties/launchSettings.json | 8 -------- .../Speckle.Connectors.CSiShared.projitems | 5 ----- 2 files changed, 13 deletions(-) delete mode 100644 Connectors/CSi/Speckle.Connectors.CSiShared/Properties/launchSettings.json diff --git a/Connectors/CSi/Speckle.Connectors.CSiShared/Properties/launchSettings.json b/Connectors/CSi/Speckle.Connectors.CSiShared/Properties/launchSettings.json deleted file mode 100644 index 1fd348981..000000000 --- a/Connectors/CSi/Speckle.Connectors.CSiShared/Properties/launchSettings.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "profiles": { - "ETABS 22": { - "commandName": "Executable", - "executablePath": "C:\\Program Files\\Computers and Structures\\ETABS 22\\ETABS.exe" - } - } -} diff --git a/Connectors/CSi/Speckle.Connectors.CSiShared/Speckle.Connectors.CSiShared.projitems b/Connectors/CSi/Speckle.Connectors.CSiShared/Speckle.Connectors.CSiShared.projitems index 18d0db05c..8920d9f65 100644 --- a/Connectors/CSi/Speckle.Connectors.CSiShared/Speckle.Connectors.CSiShared.projitems +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/Speckle.Connectors.CSiShared.projitems @@ -23,9 +23,4 @@ - - - PreserveNewest - - From fa496c7e310f70c7efa9a66569f415b860e8795a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn?= Date: Thu, 28 Nov 2024 13:33:59 +0100 Subject: [PATCH 11/11] Removing null supression --- Connectors/CSi/Speckle.Connectors.CSiShared/Form1.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Connectors/CSi/Speckle.Connectors.CSiShared/Form1.cs b/Connectors/CSi/Speckle.Connectors.CSiShared/Form1.cs index 5daf6107d..b69ad0d53 100644 --- a/Connectors/CSi/Speckle.Connectors.CSiShared/Form1.cs +++ b/Connectors/CSi/Speckle.Connectors.CSiShared/Form1.cs @@ -40,7 +40,7 @@ public void SetSapModel(ref cSapModel sapModel, ref cPluginCallback pluginCallba // NOTE: Update the form to initialize the CSiSharedApplicationService when we receive "sapModel" // Ensures service ready to use by other components - var csiService = Container!.GetRequiredService(); + var csiService = Container.GetRequiredService(); csiService.Initialize(sapModel, pluginCallback); }