1 #include <creaImageIOWxPACSConnectionPanel.h>
2 #include <creaImageIOPACSConnection.h>
3 #include <creaImageIOSystem.h>
4 #if defined (USE_GDCM2)
5 #include "gdcmCompositeNetworkFunctions.h"
10 WxPACSConnectionPanel::WxPACSConnectionPanel(wxWindow *parent, wxDialog* dial, WxGimmickView* view)
12 -1, wxDefaultPosition,
24 GimmickDebugMessage(1,"WxPACSConnectionPanel::WxPACSConnectionPanel"
26 /// \TODO fix warning: unused variable dicId aet pn adv1 ad
27 wxStaticText * dicId=new wxStaticText(this,-1,_T(" DICOM Identification: "), wxPoint(5,5));
28 wxStaticText * aet=new wxStaticText(this,-1,_T(" AETitle: "), wxPoint(5,25));
29 aeTitle=new wxTextCtrl(this, wxID_ANY, _T("MyAeTitle"), wxPoint(75,25), wxSize(220,20));
31 wxStaticText * pn=new wxStaticText(this,-1,_T(" Port Number: "), wxPoint(5,53));
32 pNumber=new wxTextCtrl(this, wxID_ANY, _T("3306"), wxPoint(75,50), wxSize(220,20));
33 wxStaticText * adv1=new wxStaticText(this,-1,_T(" (1 - 131072) "), wxPoint(300,53));
35 wxStaticText * ad=new wxStaticText(this,-1,_T(" Address: "), wxPoint(5,80));
36 address=new wxTextCtrl(this, wxID_ANY, _T("localhost"), wxPoint(75,75), wxSize(220,20));
38 wxButton *query = new wxButton(this,wxID_ANY,_T("Query PACS Server"), wxPoint(5,110) );
39 Connect( query->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WxPACSConnectionPanel::OnQueryPACS );
45 WxPACSConnectionPanel::~WxPACSConnectionPanel()
47 GimmickDebugMessage(1,"WxPACSConnectionPanel::~WxPACSConnectionPanel"
51 void WxPACSConnectionPanel::OnQueryPACS(wxCommandEvent& event)
53 #if defined (USE_GDCM2)
54 bool didItWork = gdcm::CompositeNetworkFunctions::CEcho( crea::wx2std(address->GetValue()).c_str(), 3600,
55 "CREATIS", crea::wx2std(aeTitle->GetValue()).c_str() );
57 tag.ReadFromCommaSeparatedString("10,10");
60 std::vector< std::pair<gdcm::Tag, std::string> > keys;
62 std::pair<gdcm::Tag, std::string> pa;
65 keys.push_back(std::make_pair(tag, ""));
66 gdcm::EQueryLevel theLevel = gdcm::ePatient;
67 gdcm::ERootType theRoot = gdcm::ePatientRootType;
68 gdcm::SmartPointer<gdcm::BaseRootQuery> theQuery = gdcm::CompositeNetworkFunctions::ConstructQuery(theRoot, theLevel ,keys);
71 std::vector<gdcm::DataSet> theDataSet;
72 gdcm::CompositeNetworkFunctions::CFind(crea::wx2std(address->GetValue()).c_str(), 3600, theQuery, theDataSet,
73 "CREATIS", crea::wx2std(aeTitle->GetValue()).c_str());
77 //======================================================================
79 //======================================================================
81 } // EO namespace creaImageIO