# HG changeset patch # User Sebastien Jodogne # Date 1579625567 -3600 # Node ID 169d57e18b39b61273d1b03169cb1e530b134343 # Parent 4543ffad256da0ef8ae9687827158f8717f25cd6 test diff -r 4543ffad256d -r 169d57e18b39 OrthancServer/main.cpp --- 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 tt(t); + std::auto_ptr 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 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"); }