本文整理汇总了C#中Dicom.Data.DcmDataset.SetDateTime方法的典型用法代码示例。如果您正苦于以下问题:C# DcmDataset.SetDateTime方法的具体用法?C# DcmDataset.SetDateTime怎么用?C# DcmDataset.SetDateTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dicom.Data.DcmDataset
的用法示例。
在下文中一共展示了DcmDataset.SetDateTime方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnReceiveNGetRequest
protected override void OnReceiveNGetRequest(byte presentationID, ushort messageID,
DicomUID requestedClass, DicomUID requestedInstance, DicomTag[] attributes)
{
if (requestedClass == DicomUID.PrinterSOPClass && requestedInstance == DicomUID.PrinterSOPInstance) {
DcmDataset ds = new DcmDataset(DicomTransferSyntax.ImplicitVRLittleEndian);
ds.AddElementWithValue(DicomTags.PrinterStatus, "NORMAL");
ds.AddElementWithValue(DicomTags.PrinterStatus, "NORMAL");
ds.AddElementWithValue(DicomTags.PrinterName, _config.PrinterName);
ds.AddElementWithValue(DicomTags.Manufacturer, "N/A");
ds.AddElementWithValue(DicomTags.ManufacturersModelName, "N/A");
ds.AddElementWithValue(DicomTags.DeviceSerialNumber, "N/A");
ds.AddElementWithValue(DicomTags.SoftwareVersions, "N/A");
ds.SetDateTime(DicomTags.DateOfLastCalibration, DicomTags.TimeOfLastCalibration, DateTime.Now);
SendNGetResponse(presentationID, messageID, requestedClass, requestedInstance, ds, DcmStatus.Success);
return;
}
if (requestedClass == DicomUID.PrintJobSOPClass) {
DcmPrintJob job = null;
foreach (DcmPrintJob pj in _jobs) {
if (pj.SOPInstanceUID == requestedInstance) {
job = pj;
break;
}
}
if (job == null) {
job = new DcmPrintJob(requestedInstance);
job.ExecutionStatus = "DONE";
job.CreationDateTime = DateTime.Today;
job.PrintPriority = _session.PrintPriority;
job.PrinterName = _config.PrinterName;
job.Originator = Associate.CallingAE;
}
SendNGetResponse(presentationID, messageID, requestedClass, requestedInstance, job.Dataset, DcmStatus.Success);
return;
}
if (requestedClass == DicomUID.PrinterConfigurationRetrievalSOPClass && requestedInstance == DicomUID.PrinterConfigurationRetrievalSOPInstance) {
DcmDataset ds = new DcmDataset(DicomTransferSyntax.ImplicitVRLittleEndian);
DcmDataset config = new DcmDataset(DicomTransferSyntax.ImplicitVRLittleEndian);
DcmItemSequence sq = new DcmItemSequence(DicomTags.PrinterConfigurationSequence);
sq.AddSequenceItem(config);
ds.AddItem(sq);
SendNGetResponse(presentationID, messageID, requestedClass, requestedInstance, ds, DcmStatus.Success);
return;
}
SendAbort(DcmAbortSource.ServiceProvider, DcmAbortReason.NotSpecified);
}