comparison Core/DicomNetworking/DicomAssociationParameters.h @ 3920:82e88ff003d7 c-get

merge default -> c-get
author Alain Mazy <alain@mazy.be>
date Tue, 12 May 2020 14:58:24 +0200
parents 661c931f22ad
children
comparison
equal deleted inserted replaced
3918:dba48c162b7b 3920:82e88ff003d7
33 33
34 #pragma once 34 #pragma once
35 35
36 #include "RemoteModalityParameters.h" 36 #include "RemoteModalityParameters.h"
37 37
38 #include <json/value.h>
39
38 class OFCondition; // From DCMTK 40 class OFCondition; // From DCMTK
39 41
40 namespace Orthanc 42 namespace Orthanc
41 { 43 {
42 class DicomAssociationParameters 44 class DicomAssociationParameters
43 { 45 {
44 private: 46 private:
45 std::string localAet_; 47 std::string localAet_;
46 std::string remoteAet_; 48 RemoteModalityParameters remote_;
47 std::string remoteHost_; 49 uint32_t timeout_;
48 uint16_t remotePort_;
49 ModalityManufacturer manufacturer_;
50 uint32_t timeout_;
51 50
52 void ReadDefaultTimeout(); 51 static void CheckHost(const std::string& host);
53 52
54 public: 53 public:
55 DicomAssociationParameters(); 54 DicomAssociationParameters();
56 55
57 DicomAssociationParameters(const std::string& localAet, 56 DicomAssociationParameters(const std::string& localAet,
60 const std::string& GetLocalApplicationEntityTitle() const 59 const std::string& GetLocalApplicationEntityTitle() const
61 { 60 {
62 return localAet_; 61 return localAet_;
63 } 62 }
64 63
65 const std::string& GetRemoteApplicationEntityTitle() const
66 {
67 return remoteAet_;
68 }
69
70 const std::string& GetRemoteHost() const
71 {
72 return remoteHost_;
73 }
74
75 uint16_t GetRemotePort() const
76 {
77 return remotePort_;
78 }
79
80 ModalityManufacturer GetRemoteManufacturer() const
81 {
82 return manufacturer_;
83 }
84
85 void SetLocalApplicationEntityTitle(const std::string& aet) 64 void SetLocalApplicationEntityTitle(const std::string& aet)
86 { 65 {
87 localAet_ = aet; 66 localAet_ = aet;
88 } 67 }
89 68
69 const RemoteModalityParameters& GetRemoteModality() const
70 {
71 return remote_;
72 }
73
74 void SetRemoteModality(const RemoteModalityParameters& parameters);
75
90 void SetRemoteApplicationEntityTitle(const std::string& aet) 76 void SetRemoteApplicationEntityTitle(const std::string& aet)
91 { 77 {
92 remoteAet_ = aet; 78 remote_.SetApplicationEntityTitle(aet);
93 } 79 }
94 80
95 void SetRemoteHost(const std::string& host); 81 void SetRemoteHost(const std::string& host);
96 82
97 void SetRemotePort(uint16_t port) 83 void SetRemotePort(uint16_t port)
98 { 84 {
99 remotePort_ = port; 85 remote_.SetPortNumber(port);
100 } 86 }
101 87
102 void SetRemoteManufacturer(ModalityManufacturer manufacturer) 88 void SetRemoteManufacturer(ModalityManufacturer manufacturer)
103 { 89 {
104 manufacturer_ = manufacturer; 90 remote_.SetManufacturer(manufacturer);
105 } 91 }
106
107 void SetRemoteModality(const RemoteModalityParameters& parameters);
108 92
109 bool IsEqual(const DicomAssociationParameters& other) const; 93 bool IsEqual(const DicomAssociationParameters& other) const;
110 94
95 // Setting it to "0" disables the timeout (infinite wait)
111 void SetTimeout(uint32_t seconds) 96 void SetTimeout(uint32_t seconds)
112 { 97 {
113 timeout_ = seconds; 98 timeout_ = seconds;
114 } 99 }
115 100
120 105
121 bool HasTimeout() const 106 bool HasTimeout() const
122 { 107 {
123 return timeout_ != 0; 108 return timeout_ != 0;
124 } 109 }
110
111 void SerializeJob(Json::Value& target) const;
112
113 static DicomAssociationParameters UnserializeJob(const Json::Value& serialized);
125 114
126 static void SetDefaultTimeout(uint32_t seconds); 115 static void SetDefaultTimeout(uint32_t seconds);
116
117 static uint32_t GetDefaultTimeout();
127 }; 118 };
128 } 119 }