From 27a24565deecaa887e221b857fa77c83871d06a7 Mon Sep 17 00:00:00 2001 From: James Friel Date: Tue, 12 Mar 2024 13:00:47 +0000 Subject: [PATCH] attempt build fix --- Packages.md | 1 + Rdmp.Dicom/Cache/Pipeline/CachingSCP.cs | 14 +++-- Rdmp.Dicom/Cache/Pipeline/PACSSource.cs | 3 +- Rdmp.Dicom/Rdmp.Dicom.csproj | 73 +++++++++++++------------ 4 files changed, 48 insertions(+), 43 deletions(-) diff --git a/Packages.md b/Packages.md index 6541b280..83a37a04 100644 --- a/Packages.md +++ b/Packages.md @@ -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 | |" \ No newline at end of file diff --git a/Rdmp.Dicom/Cache/Pipeline/CachingSCP.cs b/Rdmp.Dicom/Cache/Pipeline/CachingSCP.cs index 1365bfbb..9d1fa401 100644 --- a/Rdmp.Dicom/Cache/Pipeline/CachingSCP.cs +++ b/Rdmp.Dicom/Cache/Pipeline/CachingSCP.cs @@ -1,5 +1,4 @@ using FellowOakDicom; -using FellowOakDicom.Log; using FellowOakDicom.Network; using System; using System.Text; @@ -7,6 +6,9 @@ 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; @@ -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; @@ -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 @@ -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}")); } @@ -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 diff --git a/Rdmp.Dicom/Cache/Pipeline/PACSSource.cs b/Rdmp.Dicom/Cache/Pipeline/PACSSource.cs index 1c015671..7a9ae1cb 100644 --- a/Rdmp.Dicom/Cache/Pipeline/PACSSource.cs +++ b/Rdmp.Dicom/Cache/Pipeline/PACSSource.cs @@ -14,6 +14,7 @@ using System.Collections.Concurrent; using FellowOakDicom.Log; using FellowOakDicom.Network.Client; +using Microsoft.Extensions.Logging; namespace Rdmp.Dicom.Cache.Pipeline; @@ -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(new DicomServerDependencies(new DesktopNetworkManager(),new ConsoleLogManager())); + using var server = new DicomServer(new DicomServerDependencies(new DesktopNetworkManager(), new LoggerFactory())); var client = DicomClientFactory.Create(dicomConfiguration.RemoteAetHost, dicomConfiguration.RemoteAetPort, false, dicomConfiguration.LocalAetTitle, dicomConfiguration.RemoteAetTitle); diff --git a/Rdmp.Dicom/Rdmp.Dicom.csproj b/Rdmp.Dicom/Rdmp.Dicom.csproj index 7a7301c9..ac415f45 100644 --- a/Rdmp.Dicom/Rdmp.Dicom.csproj +++ b/Rdmp.Dicom/Rdmp.Dicom.csproj @@ -1,38 +1,39 @@ - - HIC.Rdmp.Dicom - Rdmp.Dicom - Rdmp.Dicom - net8.0 - false - - - - - - - - - - - - - - - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - + + HIC.Rdmp.Dicom + Rdmp.Dicom + Rdmp.Dicom + net8.0 + false + + + + + + + + + + + + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + +