Skip to content

Commit

Permalink
back to BASE-ics
Browse files Browse the repository at this point in the history
  • Loading branch information
bjoernsteinhagen committed Dec 2, 2024
1 parent fce77fc commit d11c0d6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public sealed class CSiSharedSendBinding : ISendBinding
private readonly CancellationManager _cancellationManager;
private readonly IOperationProgressManager _operationProgressManager;
private readonly ILogger<CSiSharedSendBinding> _logger;
private readonly ICSiApplicationService _csiApplicationService; // Update selection binding to centralized CSiApplicationService instead of trying to maintain a reference to "sapModel"
private readonly ICSiApplicationService _csiApplicationService;
private readonly ICSiConversionSettingsFactory _csiConversionSettingsFactory;
private readonly ISpeckleApplication _speckleApplication;
private readonly ISdkActivityFactory _activityFactory;
Expand Down
30 changes: 0 additions & 30 deletions Converters/CSi/Speckle.Converters.CSiShared/CSiObject.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)CSiConversionSettings.cs" />
<Compile Include="$(MSBuildThisFileDirectory)CSiConversionSettingsFactory.cs" />
<Compile Include="$(MSBuildThisFileDirectory)CSiObject.cs" />
<Compile Include="$(MSBuildThisFileDirectory)CSiRootToSpeckleConverter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)CSiToSpeckleUnitConverter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)CSiWrappers.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,16 @@ DisplayValueExtractor displayValueExtractor
// TODO: _property_extractor
}

public Base Convert(object target)
public Base Convert(object target) => Convert((CSiWrapperBase)target);
private Base Convert(CSiWrapperBase target)
{
if (target is not ICSiWrapper csiWrapper)
var result = new Base
{
throw new ArgumentException($"Target object must be a CSi wrapper. Got {target.GetType()}");
}

var result = new CSiObject
{
name = csiWrapper.Name,
type = csiWrapper.GetType().ToString().Split('.').Last().Replace("Wrapper", ""), // CSiJointWrapper → CSiJoint, CSiFrameWrapper → CSiFrame etc.
units = _settingsStore.Current.SpeckleUnits,
["name"] = target.Name,
["type"] = target.GetType().ToString().Split('.').Last().Replace("Wrapper", ""), // CSiJointWrapper → CSiJoint, CSiFrameWrapper → CSiFrame etc.
["units"] = _settingsStore.Current.SpeckleUnits,
// TODO: properties
displayValue = _displayValueExtractor.GetDisplayValue(csiWrapper).ToList()
["displayValue"] = _displayValueExtractor.GetDisplayValue(target).ToList()
};

return result;
Expand Down

0 comments on commit d11c0d6

Please sign in to comment.