comparison OrthancServer/OrthancInitialization.cpp @ 771:537837f50fbb

refactoring
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 30 Apr 2014 14:15:26 +0200
parents 45715eadc2e0
children 31cc399c7762
comparison
equal deleted inserted replaced
769:3f946e5c3802 771:537837f50fbb
583 int port; 583 int port;
584 ModalityManufacturer manufacturer; 584 ModalityManufacturer manufacturer;
585 585
586 return LookupDicomModalityUsingAETitle(aet, symbolicName, address, port, manufacturer); 586 return LookupDicomModalityUsingAETitle(aet, symbolicName, address, port, manufacturer);
587 } 587 }
588
589
590 void ConnectToModalityUsingAETitle(DicomUserConnection& connection,
591 const std::string& aet)
592 {
593 std::string symbolicName, address;
594 int port;
595 ModalityManufacturer manufacturer;
596
597 if (!LookupDicomModalityUsingAETitle(aet, symbolicName, address, port, manufacturer))
598 {
599 throw OrthancException("Unknown modality: " + aet);
600 }
601
602 LOG(WARNING) << "Connecting to remote DICOM modality: AET=" << aet << ", address=" << address << ", port=" << port;
603
604 connection.SetLocalApplicationEntityTitle(GetGlobalStringParameter("DicomAet", "ORTHANC"));
605 connection.SetDistantApplicationEntityTitle(aet);
606 connection.SetDistantHost(address);
607 connection.SetDistantPort(port);
608 connection.SetDistantManufacturer(manufacturer);
609 connection.Open();
610 }
611 } 588 }