Skip to content

Commit

Permalink
Fix namespaces and move stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
adamhathcock committed Jan 14, 2025
1 parent 9e44f9f commit 9ced01f
Show file tree
Hide file tree
Showing 48 changed files with 353 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using Speckle.Sdk.SQLite;

namespace Speckle.Importer.Tester;
namespace Speckle.Importers.Ifc.Tester;

public class DummySendCacheManager(Dictionary<string, string> objects) : ISqLiteJsonCacheManager
public sealed class DummySendCacheManager(Dictionary<string, string> objects) : ISqLiteJsonCacheManager
{
public void Dispose() { }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Speckle.Sdk.Serialisation.V2.Send;
using Speckle.Sdk.Transports;

namespace Speckle.Importer.Tester;
namespace Speckle.Importers.Ifc.Tester;

public class DummyServerObjectManager : IServerObjectManager
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#pragma warning disable CA1506
using System.Diagnostics;
using Ara3D.IfcParser;
using Ara3D.Utils;
using JetBrains.Profiler.SelfApi;
//using JetBrains.Profiler.SelfApi;
using Microsoft.Extensions.DependencyInjection;
using Speckle.Importer.Tester;
using Speckle.Connectors.Ifc;
using Speckle.Connectors.Ifc.Ara3D.IfcParser;
using Speckle.Connectors.Ifc.Converters;
using Speckle.Connectors.Ifc.Types;
using Speckle.Importers.Ifc.Tester;
using Speckle.Sdk.Serialisation.V2.Send;
using Speckle.Sdk.SQLite;
using Speckle.WebIfc.Importer;
using Speckle.WebIfc.Importer.Converters;
using Speckle.WebIfc.Importer.Ifc;

var serviceProvider = Import.GetServiceProvider();
DotMemory.Init();
//DotMemory.Init();
var filePath = new FilePath(
//"C:\\Users\\adam\\Git\\speckle-server\\packages\\fileimport-service\\ifc-dotnet\\ifcs\\20210221PRIMARK.ifc"
//"C:\\Users\\adam\\Git\\speckle-server\\packages\\fileimport-service\\ifc-dotnet\\ifcs\\231110ADT-FZK-Haus-2005-2006.ifc"
Expand All @@ -39,9 +39,10 @@
Console.WriteLine($"Converted to Speckle Bases: {ms2 - ms} ms");

var cache = $"C:\\Users\\adam\\Git\\temp\\{Guid.NewGuid()}.db";
using var sqlite = new SqLiteJsonCacheManager($"Data Source={cache};", 2);
using var process2 = new SerializeProcess(
new Progress(true),
new SqLiteJsonCacheManager($"Data Source={cache};", 2),
sqlite,
new DummyServerObjectManager(),
new BaseChildFinder(new BasePropertyGatherer()),
new ObjectSerializerFactory(new BasePropertyGatherer()),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using Speckle.Sdk.Transports;

namespace Speckle.Importer.Tester;
namespace Speckle.Importers.Ifc.Tester;

public class Progress(bool write) : IProgress<ProgressArgs>
{
private readonly TimeSpan DEBOUNCE = TimeSpan.FromMilliseconds(1000);
private readonly TimeSpan _debounce = TimeSpan.FromMilliseconds(1000);
private DateTime _lastTime = DateTime.UtcNow;

private long _totalBytes;
Expand All @@ -18,7 +18,7 @@ public void Report(ProgressArgs value)
Interlocked.Add(ref _totalBytes, value.Count);
}
var now = DateTime.UtcNow;
if (now - _lastTime >= DEBOUNCE)
if (now - _lastTime >= _debounce)
{
if (value.ProgressEvent == ProgressEvent.DownloadBytes)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,7 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Speckle.WebIfc.Importer\Speckle.WebIfc.Importer.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="JetBrains.Profiler.Api" />
<PackageReference Include="JetBrains.Profiler.SelfApi" />
<ProjectReference Include="..\Speckle.Importers.Ifc\Speckle.Importers.Ifc.csproj" />
</ItemGroup>

</Project>
Loading

0 comments on commit 9ced01f

Please sign in to comment.