本文整理汇总了C#中Dicom.Network.DcmStatus类的典型用法代码示例。如果您正苦于以下问题:C# DcmStatus类的具体用法?C# DcmStatus怎么用?C# DcmStatus使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DcmStatus类属于Dicom.Network命名空间,在下文中一共展示了DcmStatus类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SendCEchoResponse
protected void SendCEchoResponse(byte presentationID, ushort messageIdRespondedTo, DcmStatus status)
{
DicomUID affectedClass = Associate.GetAbstractSyntax(presentationID);
DcmCommand command = CreateResponse(messageIdRespondedTo, DcmCommandField.CEchoResponse, affectedClass, status, false);
Log.Info("{0} -> C-Echo response [id: {1}]", LogID, messageIdRespondedTo);
SendDimse(presentationID, command, null);
}
示例2: SendCFindResponse
protected void SendCFindResponse(byte presentationID, ushort messageIdRespondedTo, DcmStatus status)
{
SendCFindResponse(presentationID, messageIdRespondedTo, null, status);
}
示例3: OnReceiveCMoveResponse
protected virtual void OnReceiveCMoveResponse(byte presentationID, ushort messageIdRespondedTo, DcmDataset dataset,
DcmStatus status, ushort remain, ushort complete, ushort warning, ushort failure)
{
SendAbort(DcmAbortSource.ServiceProvider, DcmAbortReason.NotSpecified);
}
示例4: OnReceiveNSetResponse
protected virtual void OnReceiveNSetResponse(byte presentationID, ushort messageIdRespondedTo, DicomUID affectedClass, DicomUID affectedInstance,
DcmDataset dataset, DcmStatus status)
{
SendAbort(DcmAbortSource.ServiceProvider, DcmAbortReason.NotSpecified);
}
示例5: SendNSetResponse
protected void SendNSetResponse(byte presentationID, ushort messageIdRespondedTo, DicomUID affectedClass, DicomUID affectedInstance,
DcmDataset dataset, DcmStatus status)
{
DcmCommand command = new DcmCommand();
command.AffectedSOPClassUID = affectedClass;
command.CommandField = DcmCommandField.NSetResponse;
command.MessageIDBeingRespondedTo = messageIdRespondedTo;
command.HasDataset = (dataset != null);
command.Status = status;
command.AffectedSOPInstanceUID = affectedInstance;
Log.Info("{0} -> N-Set response [id: {1}; class: {2}]: {3}", LogID, messageIdRespondedTo, affectedClass.Description, status);
SendDimse(presentationID, command, dataset);
}
示例6: DcmStatus
/// <summary>
/// Initializes a new instance of the <see cref="DcmStatus"/> class.
/// </summary>
/// <param name="status">The status.</param>
/// <param name="comment">The comment.</param>
public DcmStatus(DcmStatus status, string comment)
: this(String.Format("{0:x4}", status.Code), status.State, status.Description, comment)
{
}
示例7: OnReceiveCMoveResponse
protected override void OnReceiveCMoveResponse(byte presentationID, ushort messageID, DcmDataset dataset,
DcmStatus status, ushort remain, ushort complete, ushort warning, ushort failure)
{
if (OnCMoveResponse != null) {
OnCMoveResponse(_current, dataset, status, remain, complete, warning, failure);
}
if (remain == 0 && status != DcmStatus.Pending) {
PerformQueryOrRelease();
}
}
示例8: SendCMoveResponse
protected void SendCMoveResponse(byte presentationID, ushort messageIdRespondedTo, DcmDataset dataset, DcmStatus status,
ushort remain, ushort complete, ushort warning, ushort failure)
{
DicomUID affectedClass = Associate.GetAbstractSyntax(presentationID);
DcmCommand command = CreateResponse(messageIdRespondedTo, DcmCommandField.CMoveResponse, affectedClass, status, dataset != null);
command.NumberOfRemainingSuboperations = remain;
command.NumberOfCompletedSuboperations = complete;
command.NumberOfWarningSuboperations = warning;
command.NumberOfFailedSuboperations = failure;
Log.Info("{0} -> C-Move response [id: {1}; remain: {2}; complete: {3}; warning: {4}; failure: {5}]: {6}",
LogID, messageIdRespondedTo, remain, complete, warning, failure, status);
SendDimse(presentationID, command, dataset);
}
示例9: OnReceiveNGetResponse
protected override void OnReceiveNGetResponse(byte presentationID, ushort messageIdRespondedTo, DicomUID affectedClass, DicomUID affectedInstance,
DcmDataset dataset, DcmStatus status)
{
if (OnPrintGetPrinterStatusResponse != null)
{
DcmPrinterStatus printerstatus = new DcmPrinterStatus(dataset);
_acceptedPrinterStatus = OnPrintGetPrinterStatusResponse(printerstatus, status);
}
if (_acceptedPrinterStatus == false)
{
SendReleaseRequest();
return;
}
CreateFilmSession();
}
示例10: OnReceiveNSetResponse
protected override void OnReceiveNSetResponse(byte presentationID, ushort messageIdRespondedTo, DicomUID affectedClass, DicomUID affectedInstance,
DcmDataset dataset, DcmStatus status)
{
if (_filmSession != null)
{
if (affectedClass == DicomUID.BasicColorImageBoxSOPClass ||
affectedClass == DicomUID.BasicGrayscaleImageBoxSOPClass)
{
if (status == DcmStatus.Success)
{
DcmImageBox imageBox = _filmSession.FindImageBox(affectedInstance);
if (imageBox != null)
{
_pendingImageBoxResponses.Remove(imageBox);
if (_pendingImageBoxResponses.Count == 0)
{
byte pcid = Associate.FindAbstractSyntax(DicomUID.PrinterSOPClass);
SendNActionRequest(pcid, NextMessageID(), DicomUID.BasicFilmSessionSOPClass, _filmSession.SOPInstanceUID, 0x0001, null);
}
return;
}
}
}
}
SendAbort(DcmAbortSource.ServiceUser, DcmAbortReason.NotSpecified);
}
示例11: OnReceiveNDeleteResponse
protected override void OnReceiveNDeleteResponse(byte presentationID, ushort messageIdRespondedTo, DicomUID affectedClass, DicomUID affectedInstance, DcmStatus status)
{
if (_filmSession != null)
{
if (affectedClass == DicomUID.BasicFilmBoxSOPClass)
{
if (status == DcmStatus.Success)
{
DcmFilmBox filmBox = _filmSession.FindFilmBox(affectedInstance);
if (filmBox != null)
{
_pendingFilmBoxResponses.Remove(filmBox);
if (_pendingFilmBoxResponses.Count == 0)
{
byte pcid = Associate.FindAbstractSyntax(DicomUID.PrinterSOPClass);
SendNDeleteRequest(pcid, NextMessageID(), DicomUID.BasicFilmSessionSOPClass, _filmSession.SOPInstanceUID);
}
return;
}
}
}
if (affectedClass == DicomUID.BasicFilmSessionSOPClass)
{
if (status == DcmStatus.Success)
{
SendReleaseRequest();
return;
}
}
}
SendAbort(DcmAbortSource.ServiceUser, DcmAbortReason.NotSpecified);
}
示例12: OnReceiveNCreateResponse
protected override void OnReceiveNCreateResponse(byte presentationID, ushort messageIdRespondedTo, DicomUID affectedClass, DicomUID affectedInstance,
DcmDataset dataset, DcmStatus status)
{
if (_filmSession != null)
{
if (affectedClass == DicomUID.BasicFilmSessionSOPClass)
{
if (status == DcmStatus.Success)
{
int filmBoxesCount = CalculateRequiredImageBoxes();
if (filmBoxesCount == 0)
{
SendReleaseRequest();
return;
}
for (int i = 0; i < filmBoxesCount; i++)
{
DicomUID uid = DicomUID.Generate();
DcmDataset filmBoxDataset = new DcmDataset(DicomTransferSyntax.ImplicitVRLittleEndian);
DcmFilmBox filmBox = _filmSession.CreateFilmBox(uid, filmBoxDataset.Clone());
filmBox.AnnotationDisplayFormatID = _annotationDisplayFormatID;
filmBox.BorderDensity = _borderDensity;
filmBox.ConfigurationInformation = _configurationInformation;
filmBox.EmptyImageDensity = _emptyImageDensity;
filmBox.FilmOrientation = _filmOrientation;
filmBox.FilmSizeID = _filmSizeID;
filmBox.Illumination = _illumination;
filmBox.ImageDisplayFormat = _imageDisplayFormat;
filmBox.MagnificationType = _magnificationType;
filmBox.MaxDensity = _maxDensity;
filmBox.MinDensity = _minDensity;
filmBox.ReflectedAmbientLight = _reflectedAmbientLight;
filmBox.RequestedResolutionID = _requestedResolutionID;
filmBox.SmoothingType = _smoothingType;
filmBox.Trim = _trim;
byte pcid = Associate.FindAbstractSyntax(DicomUID.BasicGrayscalePrintManagementMetaSOPClass);
SendNCreateRequest(pcid, NextMessageID(), DicomUID.BasicFilmBoxSOPClass, filmBox.SOPInstanceUID, filmBox.Dataset);
}
return;
}
}
if (affectedClass == DicomUID.BasicFilmBoxSOPClass)
{
if (status == DcmStatus.Success)
{
DcmFilmBox filmBox = _filmSession.FindFilmBox(affectedInstance);
int filmBoxIndex = _filmSession.BasicFilmBoxes.IndexOf(filmBox);
if (filmBox != null)
{
DcmItemSequence referencedImageBoxSequenceList = null;
referencedImageBoxSequenceList = dataset.GetSQ(DicomTags.ReferencedImageBoxSequence);
if (referencedImageBoxSequenceList != null)
{
foreach (DcmItemSequenceItem item in referencedImageBoxSequenceList.SequenceItems)
{
DicomUID referencedSOPInstanceUID = item.Dataset.GetUID(DicomTags.ReferencedSOPInstanceUID);
if (referencedSOPInstanceUID != null)
{
DcmImageBox imageBox = new DcmImageBox(filmBox, DcmImageBox.GraySOPClassUID, referencedSOPInstanceUID);
filmBox.BasicImageBoxes.Add(imageBox);
}
}
}
_pendingImageBoxResponses.Clear();
if (filmBox.BasicImageBoxes.Count > 0)
{
int imageBoxIndex = 0;
int imagesPerFilmbox = CalculateImagesPreFilmBox();
foreach (DcmImageBox imageBox in filmBox.BasicImageBoxes)
{
if (imagesPerFilmbox * filmBoxIndex + imageBoxIndex < _files.Count)
{
UpdateImageBox(imageBox, _files[imagesPerFilmbox * filmBoxIndex + imageBoxIndex], imageBoxIndex);
}
_pendingImageBoxResponses.Add(imageBox);
imageBoxIndex++;
byte pcid = Associate.FindAbstractSyntax(DicomUID.PrinterSOPClass);
SendNSetRequest(pcid, NextMessageID(), imageBox.SOPClassUID, imageBox.SOPInstanceUID, imageBox.Dataset);
}
}
return;
}
}
}
}
SendAbort(DcmAbortSource.ServiceUser, DcmAbortReason.NotSpecified);
}
示例13: OnReceiveNActionResponse
protected override void OnReceiveNActionResponse(byte presentationID, ushort messageIdRespondedTo, DicomUID affectedClass, DicomUID affectedInstance,
ushort actionTypeID, DcmDataset dataset, DcmStatus status)
{
if (_filmSession != null)
{
if (affectedClass == DicomUID.BasicFilmSessionSOPClass)
{
if (status == DcmStatus.Success)
{
_pendingFilmBoxResponses.Clear();
byte pcid = Associate.FindAbstractSyntax(DicomUID.PrinterSOPClass);
foreach (DcmFilmBox filmBox in _filmSession.BasicFilmBoxes)
{
_pendingFilmBoxResponses.Add(filmBox);
SendNDeleteRequest(pcid, NextMessageID(), DicomUID.BasicFilmBoxSOPClass, filmBox.SOPInstanceUID);
}
return;
}
}
}
SendAbort(DcmAbortSource.ServiceUser, DcmAbortReason.NotSpecified);
}
示例14: OnReceiveNEventReportResponse
protected override void OnReceiveNEventReportResponse(byte presentationID, ushort messageIdRespondedTo,
DicomUID affectedClass, DicomUID affectedInstance, ushort eventTypeID, DcmDataset dataset, DcmStatus status)
{
if (affectedClass == DicomUID.PrintJobSOPClass) {
DcmPrintJob job = null;
foreach (DcmPrintJob pj in _jobs) {
if (pj.SOPInstanceUID == affectedInstance) {
job = pj;
break;
}
}
if (job != null && (job.ExecutionStatus == "DONE" || job.ExecutionStatus == "FAILURE"))
_jobs.Remove(job);
return;
}
}
示例15: CreateResponse
private DcmCommand CreateResponse(ushort messageIdRespondedTo, DcmCommandField commandField, DicomUID affectedClass, DcmStatus status, bool hasDataset)
{
DcmCommand command = new DcmCommand();
command.AffectedSOPClassUID = affectedClass;
command.CommandField = commandField;
command.MessageIDBeingRespondedTo = messageIdRespondedTo;
command.HasDataset = hasDataset;
command.Status = status;
if (!String.IsNullOrEmpty(status.ErrorComment))
command.ErrorComment = status.ErrorComment;
return command;
}