Mercurial > hg > orthanc
changeset 3615:169d57e18b39 storage-commitment
test
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 21 Jan 2020 17:52:47 +0100 |
parents | 4543ffad256d |
children | afdda32d89e6 |
files | OrthancServer/main.cpp |
diffstat | 1 files changed, 17 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/OrthancServer/main.cpp Tue Jan 21 17:48:43 2020 +0100 +++ b/OrthancServer/main.cpp Tue Jan 21 17:52:47 2020 +0100 @@ -97,26 +97,36 @@ ServerContext& server_; // TODO - Remove this - static void Toto(std::string* t) + static void Toto(std::string* t, std::string* remotec) { try { std::auto_ptr<std::string> tt(t); + std::auto_ptr<std::string> remote(remotec); printf("Sleeping\n"); boost::this_thread::sleep(boost::posix_time::milliseconds(100)); printf("Connect back\n"); - - //RemoteModalityParameters p("STGCMTSCU", "localhost", 11114, ModalityManufacturer_Generic); - RemoteModalityParameters p("ORTHANC", "localhost", 4242, ModalityManufacturer_Generic); + + RemoteModalityParameters p; + + if (*remote == "ORTHANC") + { + p = RemoteModalityParameters("ORTHANC", "localhost", 4242, ModalityManufacturer_Generic); + } + else + { + p = RemoteModalityParameters("STGCMTSCU", "localhost", 11114, ModalityManufacturer_Generic); + } + DicomUserConnection scu("ORTHANC", p); std::vector<std::string> a, b, c, d; a.push_back("a"); b.push_back("b"); a.push_back("c"); b.push_back("d"); - //scu.ReportStorageCommitment(tt->c_str(), a, b, c, d); - scu.ReportStorageCommitment(tt->c_str(), a, b, a, b); + scu.ReportStorageCommitment(tt->c_str(), a, b, c, d); + //scu.ReportStorageCommitment(tt->c_str(), a, b, a, b); } catch (OrthancException& e) { @@ -146,7 +156,7 @@ { // TODO - Enqueue a Storage commitment job - boost::thread t(Toto, new std::string(transactionUid)); + boost::thread t(Toto, new std::string(transactionUid), new std::string(remoteAet)); printf("HANDLE REQUEST\n"); }