0e65b6aa57
* feature: database table extractor * feature: frame length extraction * feat: shell area extraction * feat: frame length extraction * feat: shell area extraction * docs: cleaned up object extractors * refactor: extensible database table extraction * flexible indexing (can be defined by user, defaults to typical use-case of "UniqueName") * better variable naming and more descriptive (better than csi's api) * some fail safes e.g. when forgetting to put indexingColumn in array of columns to fetch * refactor: using DatabaseTableExtractor for material name lookup * lookup for material name of a shell can use the database table extractor and simplifies EtabsShellPropertiesExtractor a lot * fix: openings shouldn't look for material assignments Frustrating way Etabs handles openings - they shouldn't be a SHELL. Anyways. Rant over * refactor: database table extractor handles dictionary lookups
42 lines
1.5 KiB
C#
42 lines
1.5 KiB
C#
using System.Reflection;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Speckle.Converters.Common;
|
|
using Speckle.Converters.Common.Registration;
|
|
using Speckle.Converters.CSiShared.ToSpeckle.Helpers;
|
|
using Speckle.Sdk;
|
|
|
|
namespace Speckle.Converters.CSiShared;
|
|
|
|
public static class ServiceRegistration
|
|
{
|
|
public static IServiceCollection AddCsiConverters(this IServiceCollection serviceCollection)
|
|
{
|
|
var converterAssembly = Assembly.GetExecutingAssembly();
|
|
|
|
// Register top-level converters
|
|
serviceCollection.AddRootCommon<CsiRootToSpeckleConverter>(converterAssembly);
|
|
|
|
// Register property extractors
|
|
serviceCollection.AddScoped<CsiFramePropertiesExtractor>();
|
|
serviceCollection.AddScoped<CsiJointPropertiesExtractor>();
|
|
serviceCollection.AddScoped<CsiShellPropertiesExtractor>();
|
|
serviceCollection.AddScoped<DatabaseTableExtractor>();
|
|
serviceCollection.AddScoped<DisplayValueExtractor>();
|
|
serviceCollection.AddScoped<SharedPropertiesExtractor>();
|
|
|
|
// Register connector caches
|
|
serviceCollection.AddScoped<CsiToSpeckleCacheSingleton>();
|
|
|
|
// Settings and unit conversions
|
|
serviceCollection.AddApplicationConverters<CsiToSpeckleUnitConverter, eUnits>(converterAssembly);
|
|
serviceCollection.AddScoped<
|
|
IConverterSettingsStore<CsiConversionSettings>,
|
|
ConverterSettingsStore<CsiConversionSettings>
|
|
>();
|
|
|
|
serviceCollection.AddMatchingInterfacesAsTransient(converterAssembly);
|
|
|
|
return serviceCollection;
|
|
}
|
|
}
|