当前位置: 首页>>代码示例>>C#>>正文


C# DicomClient.SendReleaseRequest方法代码示例

本文整理汇总了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();
		}
开发者ID:khaha2210,项目名称:radio,代码行数:26,代码来源:VerificationScu.cs

示例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;
			}
		}
开发者ID:khaha2210,项目名称:radio,代码行数:17,代码来源:StorageCommitScu.cs

示例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();
			}
        }
开发者ID:scottshea,项目名称:monodicom,代码行数:62,代码来源:MoveScu.cs

示例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);
		}
开发者ID:emmandeb,项目名称:ClearCanvas-1,代码行数:60,代码来源:StorageScu.cs

示例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);
		}
开发者ID:emmandeb,项目名称:ClearCanvas-1,代码行数:60,代码来源:StorageScu.cs

示例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);
			}
		}
开发者ID:khaha2210,项目名称:radio,代码行数:28,代码来源:StorageScu.cs


注:本文中的DicomClient.SendReleaseRequest方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。