Printer.cs 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. // Copyright (c) 2012-2020 fo-dicom contributors.
  2. // Licensed under the Microsoft Public License (MS-PL).
  3. using System;
  4. namespace Dicom.Printing
  5. {
  6. public class Printer : DicomDataset
  7. {
  8. #region Properties and Attributes
  9. public string PrinterAet { get; private set; }
  10. /// <summary>
  11. /// Printer device status
  12. /// </summary>
  13. /// <remarks>
  14. /// Enumerated values:
  15. /// <list type="bullet">
  16. /// <item><description>NORMAL</description></item>
  17. /// <item><description>WARNING</description></item>
  18. /// <item><description>FAILURE</description></item>
  19. /// </list>
  20. /// </remarks>
  21. public string PrinterStatus
  22. {
  23. get => GetSingleValueOrDefault(DicomTag.PrinterStatus, "NORMAL");
  24. private set => Add(DicomTag.PrinterStatus, value);
  25. }
  26. /// <summary>
  27. /// Additional information about printer status (2110,0020)
  28. /// </summary>
  29. /// <remarks>
  30. /// Defined terms when the printer status is equal to NORMAL: NORMAL
  31. /// See section C.13.9.1 for defined terms when the printer status is equal to WARNING or FAILURE
  32. /// </remarks>
  33. public string PrinterStatusInfo
  34. {
  35. get => GetSingleValueOrDefault(DicomTag.PrinterStatusInfo, "NORMAL");
  36. private set => Add(DicomTag.PrinterStatusInfo, value);
  37. }
  38. /// <summary>
  39. /// User defined name identifying the printer
  40. /// </summary>
  41. public string PrinterName
  42. {
  43. get => GetSingleValueOrDefault(DicomTag.PrinterName, string.Empty);
  44. private set => Add(DicomTag.PrinterName, value);
  45. }
  46. /// <summary>
  47. /// Manufacturer of the printer
  48. /// </summary>
  49. public string Manufacturer
  50. {
  51. get => GetSingleValueOrDefault(DicomTag.Manufacturer, "Nebras Technology");
  52. private set => Add(DicomTag.Manufacturer, value);
  53. }
  54. /// <summary>
  55. /// Manufacturer's model number of the printer
  56. /// </summary>
  57. public string ManufacturerModelName
  58. {
  59. get => GetSingleValueOrDefault(DicomTag.ManufacturerModelName, "PaXtreme Printer");
  60. private set => Add(DicomTag.ManufacturerModelName, value);
  61. }
  62. /// <summary>
  63. /// Manufacturer's serial number of the printer
  64. /// </summary>
  65. public string DeviceSerialNumber
  66. {
  67. get => GetSingleValueOrDefault(DicomTag.DeviceSerialNumber, string.Empty);
  68. private set => Add(DicomTag.DeviceSerialNumber, value);
  69. }
  70. /// <summary>
  71. /// Manufacturer's designation of software version of the printer
  72. /// </summary>
  73. public string SoftwareVersions
  74. {
  75. get => GetSingleValueOrDefault(DicomTag.SoftwareVersions, string.Empty);
  76. private set => Add(DicomTag.SoftwareVersions, value);
  77. }
  78. /// <summary>
  79. /// Date and Time when the printer was last calibrated
  80. /// </summary>
  81. public DateTime DateTimeOfLastCalibration
  82. {
  83. get => this.GetDateTime(DicomTag.DateOfLastCalibration, DicomTag.TimeOfLastCalibration);
  84. private set
  85. {
  86. Add(DicomTag.DateOfLastCalibration, value);
  87. Add(DicomTag.TimeOfLastCalibration, value);
  88. }
  89. }
  90. #endregion
  91. #region Constructors and Initialization
  92. /// <summary>
  93. ///
  94. /// </summary>
  95. /// <param name="printerEntity"></param>
  96. public Printer(string aet)
  97. {
  98. PrinterAet = aet;
  99. DateTimeOfLastCalibration = DateTime.Now;
  100. PrinterStatus = "NORMAL";
  101. PrinterStatusInfo = "NORMAL";
  102. }
  103. #endregion
  104. }
  105. }