Skip to content

Commit

Permalink
attempt build fix
Browse files Browse the repository at this point in the history
  • Loading branch information
JFriel committed Mar 12, 2024
1 parent 795cbb4 commit 27a2456
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 43 deletions.
1 change: 1 addition & 0 deletions Packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
| ------- | ------------| ------- | ------- | -------------------------- |
| HIC.DicomTypeTranslation | [GitHub](https://github.com/SMI/DicomTypeTranslation) | [GPL 3.0](https://www.gnu.org/licenses/gpl-3.0.html) | Translate dicom types into C# / database types | |
| LibArchive.Net | [GitHub](https://github.com/jas88/libarchive.net) | [BSD] | Access archive formats without the LZMA bugs of SharpCompress | |
| fo-dicom | [GitHub](https://github.com/fo-dicom/fo-dicom) | LICENCE GOES HERE | |"
14 changes: 8 additions & 6 deletions Rdmp.Dicom/Cache/Pipeline/CachingSCP.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
using FellowOakDicom;
using FellowOakDicom.Log;
using FellowOakDicom.Network;
using System;
using System.Text;
using System.Threading.Tasks;
using FellowOakDicom.Imaging.Codec;
using FellowOakDicom.Memory;
using Rdmp.Core.ReusableLibraryCode.Progress;
using Microsoft.Extensions.Logging;
using FellowOakDicom.Log;
using ILogger = Microsoft.Extensions.Logging.ILogger;

namespace Rdmp.Dicom.Cache.Pipeline;

Expand Down Expand Up @@ -60,8 +62,8 @@ public class CachingSCP : DicomService, IDicomServiceProvider, IDicomCStoreProvi
private string CalledAE = string.Empty;
private string CallingAE = string.Empty;

private static readonly DicomServiceDependencies Dependencies = new(new ConsoleLogManager(),new DesktopNetworkManager(),new DefaultTranscoderManager(),new ArrayPoolMemoryProvider());
public CachingSCP(INetworkStream stream, Encoding encoding, Logger logger): base(stream, encoding, logger, Dependencies)
private static readonly DicomServiceDependencies Dependencies =new(new LoggerFactory(),new DesktopNetworkManager(),new DefaultTranscoderManager(),new ArrayPoolMemoryProvider());
public CachingSCP(INetworkStream stream, Encoding encoding, ILogger logger): base(stream, encoding, logger, Dependencies)
{
Options.LogDimseDatasets = false;
Options.LogDataPDUs = false;
Expand All @@ -88,7 +90,7 @@ public Task OnReceiveAssociationReleaseRequestAsync()
public void OnReceiveAbort(DicomAbortSource source, DicomAbortReason reason)
{
var msg = $"Received abort from {source}for {reason}";
Logger.Warn(msg, source, reason);
Logger.LogWarning(msg, source, reason);
Listener.OnNotify(this,new NotifyEventArgs(ProgressEventType.Warning, $"Aborted: {msg}"));
}
#endregion
Expand All @@ -98,7 +100,7 @@ public void OnConnectionClosed(Exception e)
{
var msg = "Connection closed";
if (e != null) msg += e.Message + e.StackTrace;
Logger.Info(msg, e);
Logger.LogInformation(msg, e);
Listener.OnNotify(this,new NotifyEventArgs(Verbose ? ProgressEventType.Information : ProgressEventType.Trace,
$"ConnectionClosed: {msg}"));
}
Expand Down Expand Up @@ -132,7 +134,7 @@ public async Task OnCStoreRequestExceptionAsync(string tempFileName, Exception e
{
var msg = "CStore request exception";
if (e != null) msg += e.Message + e.StackTrace;
Logger.Info(msg, e);
Logger.LogInformation(msg, e);
await Task.Run(()=>Listener.OnNotify(this, new NotifyEventArgs(ProgressEventType.Error, "CStoreRequest failed", e)));
}
#endregion
Expand Down
3 changes: 2 additions & 1 deletion Rdmp.Dicom/Cache/Pipeline/PACSSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using System.Collections.Concurrent;
using FellowOakDicom.Log;
using FellowOakDicom.Network.Client;
using Microsoft.Extensions.Logging;

namespace Rdmp.Dicom.Cache.Pipeline;

Expand Down Expand Up @@ -90,7 +91,7 @@ public override SMIDataChunk DoGetChunk(ICacheFetchRequest cacheRequest, IDataLo
};

//helps with tidying up resources if we abort or through an exception and neatly avoids -> Access to disposed closure
using var server = new DicomServer<CachingSCP>(new DicomServerDependencies(new DesktopNetworkManager(),new ConsoleLogManager()));
using var server = new DicomServer<CachingSCP>(new DicomServerDependencies(new DesktopNetworkManager(), new LoggerFactory()));

Check warning

Code scanning / CodeQL

Missing Dispose call on local IDisposable Warning

Disposable 'LoggerFactory' is created but not disposed.
var client = DicomClientFactory.Create(dicomConfiguration.RemoteAetHost,
dicomConfiguration.RemoteAetPort, false, dicomConfiguration.LocalAetTitle,
dicomConfiguration.RemoteAetTitle);
Expand Down
73 changes: 37 additions & 36 deletions Rdmp.Dicom/Rdmp.Dicom.csproj
Original file line number Diff line number Diff line change
@@ -1,38 +1,39 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PackageId>HIC.Rdmp.Dicom</PackageId>
<RootNamespace>Rdmp.Dicom</RootNamespace>
<AssemblyName>Rdmp.Dicom</AssemblyName>
<TargetFramework>net8.0</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
<ItemGroup>
<None Remove="db\runAfterCreateDatabase\CreateSMIPluginDatabase.sql" />
<None Remove="db\up\001_AddIsExternalReferenceFlag.sql" />
<None Remove="db\up\002_ImagesToLoadList.sql" />
<None Remove="db\up\003_Quarantine.sql" />
<None Remove="db\up\004_TagPromotionConfiguration.sql" />
<None Remove="db\up\005_EnsureUIDMapUnique.sql" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\SharedAssemblyInfo.cs" Link="SharedAssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="db\runAfterCreateDatabase\CreateSMIPluginDatabase.sql" />
<EmbeddedResource Include="db\up\001_AddIsExternalReferenceFlag.sql" />
<EmbeddedResource Include="db\up\002_ImagesToLoadList.sql" />
<EmbeddedResource Include="db\up\003_Quarantine.sql" />
<EmbeddedResource Include="db\up\004_TagPromotionConfiguration.sql" />
<EmbeddedResource Include="db\up\005_EnsureUIDMapUnique.sql" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="HIC.DicomTypeTranslation" Version="4.0.3" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\RDMP\Rdmp.Core\Rdmp.Core.csproj" />
</ItemGroup>
<PropertyGroup>
<PackageId>HIC.Rdmp.Dicom</PackageId>
<RootNamespace>Rdmp.Dicom</RootNamespace>
<AssemblyName>Rdmp.Dicom</AssemblyName>
<TargetFramework>net8.0</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
<ItemGroup>
<None Remove="db\runAfterCreateDatabase\CreateSMIPluginDatabase.sql" />
<None Remove="db\up\001_AddIsExternalReferenceFlag.sql" />
<None Remove="db\up\002_ImagesToLoadList.sql" />
<None Remove="db\up\003_Quarantine.sql" />
<None Remove="db\up\004_TagPromotionConfiguration.sql" />
<None Remove="db\up\005_EnsureUIDMapUnique.sql" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\SharedAssemblyInfo.cs" Link="SharedAssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="db\runAfterCreateDatabase\CreateSMIPluginDatabase.sql" />
<EmbeddedResource Include="db\up\001_AddIsExternalReferenceFlag.sql" />
<EmbeddedResource Include="db\up\002_ImagesToLoadList.sql" />
<EmbeddedResource Include="db\up\003_Quarantine.sql" />
<EmbeddedResource Include="db\up\004_TagPromotionConfiguration.sql" />
<EmbeddedResource Include="db\up\005_EnsureUIDMapUnique.sql" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="HIC.DicomTypeTranslation" Version="4.0.3" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="fo-dicom" Version="5.1.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\RDMP\Rdmp.Core\Rdmp.Core.csproj" />
</ItemGroup>
</Project>

0 comments on commit 27a2456

Please sign in to comment.