]> Creatis software - creaImageIO.git/blob - src/creaImageIOWxPACSConnectionPanel.cpp
(some of the) unused variables
[creaImageIO.git] / src / creaImageIOWxPACSConnectionPanel.cpp
1 #include <creaImageIOWxPACSConnectionPanel.h>
2 #include <creaImageIOPACSConnection.h>
3 #include <creaImageIOSystem.h>
4 #if defined (USE_GDCM2)
5 #include "gdcmCompositeNetworkFunctions.h"
6 #endif
7 namespace creaImageIO
8 {
9   // CTor
10   WxPACSConnectionPanel::WxPACSConnectionPanel(wxWindow *parent, wxDialog* dial, WxGimmickView* view)
11  :   wxPanel( parent, 
12                   -1, wxDefaultPosition, 
13                   wxDefaultSize,
14                   wxRESIZE_BORDER | 
15                   wxSYSTEM_MENU  |
16                   wxCLOSE_BOX |
17                   wxMAXIMIZE_BOX | 
18                   wxMINIMIZE_BOX | 
19                   wxCAPTION  
20                ),       
21                    dialog(dial),
22                    mView(view)
23   {
24     GimmickDebugMessage(1,"WxPACSConnectionPanel::WxPACSConnectionPanel"
25                         <<std::endl);
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));
30
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));
34
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));
37         
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 ); 
40    
41     Layout(); 
42   }
43
44   /// Destructor
45   WxPACSConnectionPanel::~WxPACSConnectionPanel()
46   {
47     GimmickDebugMessage(1,"WxPACSConnectionPanel::~WxPACSConnectionPanel"
48                         <<std::endl);
49   }
50
51   void WxPACSConnectionPanel::OnQueryPACS(wxCommandEvent& event)
52   {
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() );
56                   gdcm::Tag tag;
57                   tag.ReadFromCommaSeparatedString("10,10"); 
58                 /*  tag.SetElement(8);
59                   tag.SetGroup(8);*/
60                 std::vector< std::pair<gdcm::Tag, std::string> > keys;
61
62                 std::pair<gdcm::Tag, std::string> pa;
63                 pa.first = tag;
64                 pa.second = "";
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);
69
70         
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());
74 #endif
75   }
76   
77 //======================================================================
78   
79 //====================================================================== 
80
81 } // EO namespace creaImageIO
82
83