-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DUI3-325 Add Civil3d 2024 connector #3531
Changes from all commits
1e925f5
b2365e4
87f9077
0d8f5c7
3eab4db
261bec8
67b3596
3914a22
f3d823c
ade2092
3bb1584
9f94f9d
b28852d
1fe7e02
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,11 @@ | ||
using Speckle.Autofac; | ||
#if AUTOCAD | ||
using Speckle.Autofac.DependencyInjection; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It might make sense to put note here why we do this |
||
using Speckle.Connectors.Autocad.Bindings; | ||
using Speckle.Connectors.Autocad.Filters; | ||
using Speckle.Connectors.Autocad.HostApp; | ||
using Speckle.Connectors.Autocad.Interfaces; | ||
using Speckle.Connectors.Autocad.Operations.Receive; | ||
using Speckle.Connectors.Autocad.Operations.Send; | ||
using Speckle.Connectors.Autocad.Plugin; | ||
using Speckle.Connectors.DUI; | ||
using Speckle.Connectors.DUI.Bindings; | ||
using Speckle.Connectors.DUI.Models; | ||
using Speckle.Connectors.DUI.Models.Card.SendFilter; | ||
using Speckle.Connectors.DUI.WebView; | ||
using Speckle.Connectors.Utils; | ||
using Speckle.Connectors.Utils.Builders; | ||
using Speckle.Connectors.Utils.Caching; | ||
using Speckle.Connectors.Utils.Operations; | ||
|
@@ -24,19 +17,7 @@ public class AutocadConnectorModule : ISpeckleModule | |
{ | ||
public void Load(SpeckleContainerBuilder builder) | ||
{ | ||
builder.AddAutofac(); | ||
builder.AddConnectorUtils(); | ||
builder.AddDUI(); | ||
builder.AddDUIView(); | ||
|
||
// Register other connector specific types | ||
builder.AddSingleton<IAutocadPlugin, AutocadPlugin>(); | ||
builder.AddTransient<TransactionContext>(); | ||
builder.AddSingleton(new AutocadDocumentManager()); // TODO: Dependent to TransactionContext, can be moved to AutocadContext | ||
builder.AddSingleton<DocumentModelStore, AutocadDocumentStore>(); | ||
builder.AddSingleton<AutocadContext>(); | ||
builder.AddSingleton<AutocadLayerManager>(); | ||
builder.AddSingleton<AutocadIdleManager>(); | ||
SharedConnectorModule.LoadShared(builder); | ||
|
||
// Operations | ||
builder.AddScoped<SendOperation<AutocadRootObject>>(); | ||
|
@@ -47,13 +28,7 @@ public void Load(SpeckleContainerBuilder builder) | |
builder.AddScoped<IRootObjectBuilder<AutocadRootObject>, AutocadRootObjectBuilder>(); | ||
|
||
// Register bindings | ||
|
||
builder.AddSingleton<IBinding, TestBinding>(); | ||
builder.AddSingleton<IBinding, ConfigBinding>("connectorName", "Autocad"); // POC: Easier like this for now, should be cleaned up later | ||
builder.AddSingleton<IBinding, AccountBinding>(); | ||
builder.AddSingleton<IBinding, AutocadBasicConnectorBinding>(); | ||
builder.AddSingleton<IBasicConnectorBinding, AutocadBasicConnectorBinding>(); | ||
builder.AddSingleton<IBinding, AutocadSelectionBinding>(); | ||
builder.AddSingleton<IBinding, AutocadSendBinding>(); | ||
builder.AddSingleton<IBinding, AutocadReceiveBinding>(); | ||
|
||
|
@@ -64,3 +39,4 @@ public void Load(SpeckleContainerBuilder builder) | |
builder.AddSingleton<ISendConversionCache, SendConversionCache>(); | ||
} | ||
} | ||
#endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#if CIVIL3D | ||
using Speckle.Autofac.DependencyInjection; | ||
using Speckle.Connectors.Autocad.Bindings; | ||
using Speckle.Connectors.Autocad.Filters; | ||
using Speckle.Connectors.Autocad.Operations.Send; | ||
using Speckle.Connectors.DUI.Bindings; | ||
using Speckle.Connectors.DUI.Models.Card.SendFilter; | ||
using Speckle.Connectors.Utils.Builders; | ||
using Speckle.Connectors.Utils.Caching; | ||
using Speckle.Connectors.Utils.Operations; | ||
|
||
namespace Speckle.Connectors.Autocad.DependencyInjection; | ||
|
||
public class Civil3dConnectorModule : ISpeckleModule | ||
{ | ||
public void Load(SpeckleContainerBuilder builder) | ||
{ | ||
SharedConnectorModule.LoadShared(builder); | ||
|
||
// Operations | ||
builder.AddScoped<SendOperation<AutocadRootObject>>(); | ||
|
||
// Object Builders | ||
builder.AddScoped<IRootObjectBuilder<AutocadRootObject>, AutocadRootObjectBuilder>(); | ||
|
||
// Register bindings | ||
builder.AddSingleton<IBinding, ConfigBinding>("connectorName", "Civil3d"); // POC: Easier like this for now, should be cleaned up later | ||
builder.AddSingleton<IBinding, AutocadSendBinding>(); | ||
|
||
// register send filters | ||
builder.AddTransient<ISendFilter, AutocadSelectionFilter>(); | ||
|
||
// register send conversion cache | ||
builder.AddSingleton<ISendConversionCache, SendConversionCache>(); | ||
} | ||
} | ||
#endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using Speckle.Autofac; | ||
using Speckle.Autofac.DependencyInjection; | ||
using Speckle.Connectors.Autocad.Bindings; | ||
using Speckle.Connectors.Autocad.HostApp; | ||
using Speckle.Connectors.Autocad.Interfaces; | ||
using Speckle.Connectors.Autocad.Plugin; | ||
using Speckle.Connectors.DUI; | ||
using Speckle.Connectors.DUI.Bindings; | ||
using Speckle.Connectors.DUI.Models; | ||
using Speckle.Connectors.DUI.WebView; | ||
using Speckle.Connectors.Utils; | ||
|
||
namespace Speckle.Connectors.Autocad.DependencyInjection; | ||
|
||
public static class SharedConnectorModule | ||
{ | ||
public static void LoadShared(SpeckleContainerBuilder builder) | ||
{ | ||
builder.AddAutofac(); | ||
builder.AddConnectorUtils(); | ||
builder.AddDUI(); | ||
builder.AddDUIView(); | ||
|
||
// Register other connector specific types | ||
builder.AddSingleton<IAutocadPlugin, AutocadPlugin>(); | ||
builder.AddTransient<TransactionContext>(); | ||
builder.AddSingleton(new AutocadDocumentManager()); // TODO: Dependent to TransactionContext, can be moved to AutocadContext | ||
builder.AddSingleton<DocumentModelStore, AutocadDocumentStore>(); | ||
builder.AddSingleton<AutocadContext>(); | ||
builder.AddSingleton<AutocadLayerManager>(); | ||
builder.AddSingleton<AutocadIdleManager>(); | ||
|
||
// Register bindings | ||
builder.AddSingleton<IBinding, TestBinding>(); | ||
builder.AddSingleton<IBinding, AccountBinding>(); | ||
builder.AddSingleton<IBinding, AutocadBasicConnectorBinding>(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe this is unnecessary registration since we register it on next line as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was preexisting, so I'm leaving it here for now There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fair enough |
||
builder.AddSingleton<IBasicConnectorBinding, AutocadBasicConnectorBinding>(); | ||
builder.AddSingleton<IBinding, AutocadSelectionBinding>(); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need this one if we added Civil3D?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, to prevent breaking the DUI2 connectors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we should start to consider have new Applications(?) class for DUI3 only instead populating old.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI: @BovineOx added as subtask under the other relevant story (assigned to Ian) https://spockle.atlassian.net/browse/DUI3-431