本文整理汇总了C#中DicomClient.SendReleaseRequest方法的典型用法代码示例。如果您正苦于以下问题:C# DicomClient.SendReleaseRequest方法的具体用法?C# DicomClient.SendReleaseRequest怎么用?C# DicomClient.SendReleaseRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DicomClient
的用法示例。
在下文中一共展示了DicomClient.SendReleaseRequest方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnReceiveResponseMessage
/// <summary>
/// Called when received response message. Sets the <see cref="Result"/> property as appropriate.
/// </summary>
/// <param name="client">The client.</param>
/// <param name="association">The association.</param>
/// <param name="presentationID">The presentation ID.</param>
/// <param name="message">The message.</param>
public override void OnReceiveResponseMessage(DicomClient client, ClientAssociationParameters association, byte presentationID, DicomMessage message)
{
if (message.Status.Status != DicomState.Success)
{
Platform.Log(LogLevel.Error, "Failure status received in sending verification: {0}", message.Status.Description);
_verificationResult = VerificationResult.Failed;
}
else if (_verificationResult == VerificationResult.Canceled)
{
Platform.Log(LogLevel.Info, "Verification was canceled");
}
else
{
Platform.Log(LogLevel.Info, "Success status received in sending verification!");
_verificationResult = VerificationResult.Success;
}
client.SendReleaseRequest();
StopRunningOperation();
}
示例2: OnReceiveResponseMessage
/// <summary>
/// Called when received response message. If there are more files to send, will send them here.
/// </summary>
/// <param name="client">The client.</param>
/// <param name="association">The association.</param>
/// <param name="presentationID">The presentation ID.</param>
/// <param name="message">The message.</param>
public override void OnReceiveResponseMessage(DicomClient client, ClientAssociationParameters association, byte presentationID, DicomMessage message)
{
if (Status == ScuOperationStatus.Canceled)
{
Platform.Log(LogLevel.Info, "Cancel request received, releasing association from {0} to {1}", association.CallingAE, association.CalledAE);
client.SendReleaseRequest();
StopRunningOperation();
return;
}
}
示例3: OnReceiveResponseMessage
/// <summary>
/// Called when received response message.
/// </summary>
/// <param name="client">The client.</param>
/// <param name="association">The association.</param>
/// <param name="presentationID">The presentation ID.</param>
/// <param name="message">The message.</param>
public override void OnReceiveResponseMessage(DicomClient client, ClientAssociationParameters association, byte presentationID, DicomMessage message)
{
// Discovered issue with an SCP that was not setting these values on the final Success return, so blocking an update of the values if all of them are 0.
if (message.NumberOfFailedSubOperations != 0
|| message.NumberOfCompletedSubOperations != 0
|| message.NumberOfRemainingSubOperations != 0
|| message.NumberOfWarningSubOperations != 0)
{
_failureSubOperations = message.NumberOfFailedSubOperations;
_successSubOperations = message.NumberOfCompletedSubOperations;
_remainingSubOperations = message.NumberOfRemainingSubOperations;
_warningSubOperations = message.NumberOfWarningSubOperations;
_totalSubOperations = _failureSubOperations + _successSubOperations + _remainingSubOperations +
_warningSubOperations;
}
if (message.Status.Status == DicomState.Pending)
{
OnImageMoveCompleted();
}
else
{
DicomState status = message.Status.Status;
if (message.Status.Status != DicomState.Success)
{
if (status == DicomState.Cancel)
{
if (LogInformation) Platform.Log(LogLevel.Info, "Cancel status received in Move Scu: {0}", message.Status);
Status = ScuOperationStatus.Canceled;
}
else if (status == DicomState.Failure)
{
string msg = String.Format("Failure status received in Move Scu: {0}", message.Status);
Platform.Log(LogLevel.Error, msg);
Status = ScuOperationStatus.Failed;
FailureDescription = msg;
}
else if (status == DicomState.Warning)
{
Platform.Log(LogLevel.Warn, "Warning status received in Move Scu: {0}", message.Status);
}
else if (Status == ScuOperationStatus.Canceled)
{
if (LogInformation) Platform.Log(LogLevel.Info, "Client cancelled Move Scu operation.");
}
}
else
{
if (LogInformation) Platform.Log(LogLevel.Info, "Success status received in Move Scu!");
}
client.SendReleaseRequest();
StopRunningOperation();
}
}
示例4: OnReceiveResponseMessage
/// <summary>
/// Called when received response message. If there are more files to send, will send them here.
/// </summary>
/// <param name="client">The client.</param>
/// <param name="association">The association.</param>
/// <param name="presentationID">The presentation ID.</param>
/// <param name="message">The message.</param>
public override void OnReceiveResponseMessage(DicomClient client, ClientAssociationParameters association, byte presentationID, DicomMessage message)
{
if (_storageInstanceList.Count > 0)
{
_storageInstanceList[_fileListIndex].SendStatus = message.Status;
_storageInstanceList[_fileListIndex].ExtendedFailureDescription = message.ErrorComment;
}
if (message.Status.Status != DicomState.Success)
{
if (message.Status.Status == DicomState.Warning)
{
_warningSubOperations++;
Platform.Log(LogLevel.Warn, "Warning status received in sending C-STORE to {0}: {1}",
association.CalledAE, message.Status.Description);
}
else if (message.Status.Status == DicomState.Failure)
{
_failureSubOperations++;
Platform.Log(LogLevel.Error, "Failure status received in sending C-STORE to {0}: {1}",
association.CalledAE, message.Status.Description);
}
}
else
_successSubOperations++;
_remainingSubOperations--;
OnImageStoreCompleted(_storageInstanceList[_fileListIndex]);
if (Status == ScuOperationStatus.Canceled || message.Status.Status == DicomState.Cancel)
{
FailRemaining(DicomStatuses.Cancel);
Platform.Log(LogLevel.Info, "Cancel requested by {0}, releasing association from {1} to {2}",
(message.Status.Status == DicomState.Cancel) ? "remote host" : "client",
association.CallingAE, association.CalledAE);
Status = ScuOperationStatus.Canceled;
client.SendReleaseRequest();
StopRunningOperation();
return;
}
_fileListIndex++;
if (_fileListIndex >= _storageInstanceList.Count)
{
Platform.Log(LogLevel.Info, "Completed sending {0} C-STORE-RQ messages, releasing association.", _storageInstanceList.Count);
client.SendReleaseRequest();
StopRunningOperation();
return;
}
SendCStoreUntilSuccess(client, association);
}
示例5: SendCStoreUntilSuccess
/// <summary>
/// Generic routine to continue attempting to send C-STORE-RQ messages in the <see cref="StorageInstanceList"/> until one is successful.
/// </summary>
/// <remarks>
/// <para>
/// This routine will continue attempting to send a C-STORE until one has successfully been sent or all
/// SOP instances in the <see cref="StorageInstanceList"/> have been sent. Possible failures are that
/// a SOP Class was not negotiated, or a failure happened reading the SOP Instance from disk.
/// </para>
/// </remarks>
/// <param name="client">DICOM Client class</param>
/// <param name="association">Association Parameters</param>
private void SendCStoreUntilSuccess(DicomClient client, ClientAssociationParameters association)
{
/// TODO (CR Jun 2012): Probably shouldn't use thread pool threads for potentially long-running operations.
/// Although unlikely, this could exhaust the .NET thread pool.
// Added the background thread as part of ticket #9568. Note that we probably should have some threading
// built into NetworkBase as opposed to here.
ThreadPool.QueueUserWorkItem(delegate
{
try
{
bool ok = SendCStore(client, association);
while (ok == false)
{
Platform.Log(LogLevel.Info, "Attempted to send {0} of {1} instances to {2}.", _fileListIndex + 1, _storageInstanceList.Count, client.AssociationParams.CalledAE);
_fileListIndex++;
if (_fileListIndex >= _storageInstanceList.Count)
{
Platform.Log(LogLevel.Info,
"Completed sending C-STORE-RQ messages, releasing association.");
client.SendReleaseRequest();
StopRunningOperation();
return;
}
/// TODO (CR Jun 2012): Do we need to check for a stop signal?
// TODO (Marmot): Check stop?
// TODO (CR Jun 2012): Stop is checked for in OnReceiveResponseMessage after each c-store-rsp received.
// There's a small chance that every image we're attempting to send wasn't negotiated over the association and it
// takes awhile to go through the list, but the chances of that are small, plus it should be quick.
ok = SendCStore(client, association);
}
}
catch
{
Platform.Log(LogLevel.Error, "Error when sending C-STORE-RQ messages, aborted on-going send operations");
try
{
client.SendAssociateAbort(DicomAbortSource.ServiceProvider, DicomAbortReason.NotSpecified);
StopRunningOperation();
}
catch
{
Platform.Log(LogLevel.Error, "Error attempting to abort association");
}
}
}, null);
}
示例6: SendCStoreUntilSuccess
/// <summary>
/// Generic routine to continue attempting to send C-STORE-RQ messages in the <see cref="StorageInstanceList"/> until one is successful.
/// </summary>
/// <remarks>
/// <para>
/// This routine will continue attempting to send a C-STORE until one has successfully been sent or all
/// SOP instances in the <see cref="StorageInstanceList"/> have been sent. Possible failures are that
/// a SOP Class was not negotiated, or a failure happened reading the SOP Instance from disk.
/// </para>
/// </remarks>
/// <param name="client">DICOM Client class</param>
/// <param name="association">Association Parameters</param>
private void SendCStoreUntilSuccess(DicomClient client, ClientAssociationParameters association)
{
bool ok = SendCStore(client, association);
while (ok == false)
{
_fileListIndex++;
if (_fileListIndex >= _storageInstanceList.Count)
{
Platform.Log(LogLevel.Info, "Completed sending C-STORE-RQ messages, releasing association.");
client.SendReleaseRequest();
StopRunningOperation();
return;
}
ok = SendCStore(client, association);
}
}