comparison OrthancServer/main.cpp @ 3615:169d57e18b39 storage-commitment

test
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 21 Jan 2020 17:52:47 +0100
parents 4543ffad256d
children 8c0ef729d5a8
comparison
equal deleted inserted replaced
3614:4543ffad256d 3615:169d57e18b39
95 { 95 {
96 private: 96 private:
97 ServerContext& server_; 97 ServerContext& server_;
98 98
99 // TODO - Remove this 99 // TODO - Remove this
100 static void Toto(std::string* t) 100 static void Toto(std::string* t, std::string* remotec)
101 { 101 {
102 try 102 try
103 { 103 {
104 std::auto_ptr<std::string> tt(t); 104 std::auto_ptr<std::string> tt(t);
105 std::auto_ptr<std::string> remote(remotec);
105 106
106 printf("Sleeping\n"); 107 printf("Sleeping\n");
107 boost::this_thread::sleep(boost::posix_time::milliseconds(100)); 108 boost::this_thread::sleep(boost::posix_time::milliseconds(100));
108 printf("Connect back\n"); 109 printf("Connect back\n");
109 110
110 //RemoteModalityParameters p("STGCMTSCU", "localhost", 11114, ModalityManufacturer_Generic); 111 RemoteModalityParameters p;
111 RemoteModalityParameters p("ORTHANC", "localhost", 4242, ModalityManufacturer_Generic); 112
113 if (*remote == "ORTHANC")
114 {
115 p = RemoteModalityParameters("ORTHANC", "localhost", 4242, ModalityManufacturer_Generic);
116 }
117 else
118 {
119 p = RemoteModalityParameters("STGCMTSCU", "localhost", 11114, ModalityManufacturer_Generic);
120 }
121
112 DicomUserConnection scu("ORTHANC", p); 122 DicomUserConnection scu("ORTHANC", p);
113 123
114 std::vector<std::string> a, b, c, d; 124 std::vector<std::string> a, b, c, d;
115 a.push_back("a"); b.push_back("b"); 125 a.push_back("a"); b.push_back("b");
116 a.push_back("c"); b.push_back("d"); 126 a.push_back("c"); b.push_back("d");
117 127
118 //scu.ReportStorageCommitment(tt->c_str(), a, b, c, d); 128 scu.ReportStorageCommitment(tt->c_str(), a, b, c, d);
119 scu.ReportStorageCommitment(tt->c_str(), a, b, a, b); 129 //scu.ReportStorageCommitment(tt->c_str(), a, b, a, b);
120 } 130 }
121 catch (OrthancException& e) 131 catch (OrthancException& e)
122 { 132 {
123 LOG(ERROR) << "EXCEPTION: " << e.What(); 133 LOG(ERROR) << "EXCEPTION: " << e.What();
124 } 134 }
144 const std::string& remoteAet, 154 const std::string& remoteAet,
145 const std::string& calledAet) 155 const std::string& calledAet)
146 { 156 {
147 // TODO - Enqueue a Storage commitment job 157 // TODO - Enqueue a Storage commitment job
148 158
149 boost::thread t(Toto, new std::string(transactionUid)); 159 boost::thread t(Toto, new std::string(transactionUid), new std::string(remoteAet));
150 160
151 printf("HANDLE REQUEST\n"); 161 printf("HANDLE REQUEST\n");
152 } 162 }
153 163
154 virtual void HandleReport(const std::string& transactionUid, 164 virtual void HandleReport(const std::string& transactionUid,