Forráskód Böngészése

Add Calling AE title option for query

Rearrange the GUI to add calling AE title.  Also create
a new setting to save the selected calling AE title.
Steve Pieper 14 éve
szülő
commit
70fd6435f0

+ 6 - 25
Libs/DICOM/Widgets/Resources/UI/ctkDICOMQueryRetrieveWidget.ui

@@ -30,32 +30,13 @@
         </property>
         </property>
         <layout class="QVBoxLayout" name="verticalLayout_2">
         <layout class="QVBoxLayout" name="verticalLayout_2">
          <item>
          <item>
-          <widget class="QFrame" name="frame_3">
-           <property name="frameShape">
-            <enum>QFrame::StyledPanel</enum>
+          <widget class="ctkDICOMServerNodeWidget" name="serverNodeWidget" native="true">
+           <property name="minimumSize">
+            <size>
+             <width>300</width>
+             <height>200</height>
+            </size>
            </property>
            </property>
-           <property name="frameShadow">
-            <enum>QFrame::Raised</enum>
-           </property>
-           <layout class="QVBoxLayout" name="verticalLayout_3">
-            <item>
-             <widget class="QLabel" name="label_2">
-              <property name="text">
-               <string>Query Targets</string>
-              </property>
-             </widget>
-            </item>
-            <item>
-             <widget class="ctkDICOMServerNodeWidget" name="serverNodeWidget" native="true">
-              <property name="minimumSize">
-               <size>
-                <width>300</width>
-                <height>200</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-           </layout>
           </widget>
           </widget>
          </item>
          </item>
         </layout>
         </layout>

+ 15 - 5
Libs/DICOM/Widgets/Resources/UI/ctkDICOMServerNodeWidget.ui

@@ -6,8 +6,8 @@
    <rect>
    <rect>
     <x>0</x>
     <x>0</x>
     <y>0</y>
     <y>0</y>
-    <width>600</width>
-    <height>510</height>
+    <width>585</width>
+    <height>544</height>
    </rect>
    </rect>
   </property>
   </property>
   <property name="windowTitle">
   <property name="windowTitle">
@@ -15,9 +15,19 @@
   </property>
   </property>
   <layout class="QVBoxLayout" name="verticalLayout">
   <layout class="QVBoxLayout" name="verticalLayout">
    <item>
    <item>
+    <widget class="QLabel" name="label_2">
+     <property name="text">
+      <string>Calling AETitle</string>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QLineEdit" name="callingAETitle"/>
+   </item>
+   <item>
     <widget class="QLabel" name="label">
     <widget class="QLabel" name="label">
      <property name="text">
      <property name="text">
-      <string>Sources</string>
+      <string>Servers</string>
      </property>
      </property>
     </widget>
     </widget>
    </item>
    </item>
@@ -31,8 +41,8 @@
        <rect>
        <rect>
         <x>0</x>
         <x>0</x>
         <y>0</y>
         <y>0</y>
-        <width>580</width>
-        <height>414</height>
+        <width>565</width>
+        <height>392</height>
        </rect>
        </rect>
       </property>
       </property>
       <layout class="QVBoxLayout" name="verticalLayout_2">
       <layout class="QVBoxLayout" name="verticalLayout_2">

+ 24 - 24
Libs/DICOM/Widgets/ctkDICOMServerNodeWidget.cpp

@@ -75,22 +75,19 @@ ctkDICOMServerNodeWidget::ctkDICOMServerNodeWidget(QWidget* _parent):Superclass(
   QMap<QString, QVariant> node;
   QMap<QString, QVariant> node;
   if ( settings.value("ServerNodeCount").toInt() == 0 )
   if ( settings.value("ServerNodeCount").toInt() == 0 )
   {
   {
-    node["Name"] = "Local Database";
-    node["CheckState"] = Qt::Checked;
-    node["AETitle"] = "N/A";
-    node["Address"] = "N/A";
-    node["Port"] = "N/A";
-    settings.setValue("ServerNodeCount", 2);
+    settings.setValue("ServerNodeCount", 1);
     settings.setValue("ServerNodes/0", QVariant(node));
     settings.setValue("ServerNodes/0", QVariant(node));
     node["Name"] = "ExampleHost";
     node["Name"] = "ExampleHost";
-    node["CheckState"] = Qt::Unchecked;
-    node["AETitle"] = "CTK_AE";
+    node["CheckState"] = Qt::Checked;
+    node["AETitle"] = "ANY-SCP";
     node["Address"] = "localhost";
     node["Address"] = "localhost";
     node["Port"] = "11112";
     node["Port"] = "11112";
     settings.setValue("ServerNodes/1", QVariant(node));
     settings.setValue("ServerNodes/1", QVariant(node));
+    settings.setValue("CallingAETitle", "FINDSCU");
     settings.sync();
     settings.sync();
   }
   }
 
 
+  d->callingAETitle->setText(settings.value("CallingAETitle").toString());
   int count = settings.value("ServerNodeCount").toInt();
   int count = settings.value("ServerNodeCount").toInt();
   d->nodeTable->setRowCount(count);
   d->nodeTable->setRowCount(count);
   for (int row = 0; row < count; row++)
   for (int row = 0; row < count; row++)
@@ -108,22 +105,16 @@ ctkDICOMServerNodeWidget::ctkDICOMServerNodeWidget(QWidget* _parent):Superclass(
     d->nodeTable->setItem(row, 3, newItem);
     d->nodeTable->setItem(row, 3, newItem);
   }
   }
 
 
-  connect(d->addButton
-    ,SIGNAL(clicked()),
-    this,
-    SLOT(addNode()));
-  connect(d->removeButton
-    ,SIGNAL(clicked()),
-    this,
-    SLOT(removeNode()));
-  connect(d->nodeTable,
-    SIGNAL(cellChanged(int,int)),
-    this,
-    SLOT(onCellChanged(int,int)));
-  connect(d->nodeTable,
-    SIGNAL(currentItemChanged(QTableWidgetItem*, QTableWidgetItem*)),
-    this,
-    SLOT(onCurrentItemChanged(QTableWidgetItem*, QTableWidgetItem*)));
+  connect(d->callingAETitle, SIGNAL(textChanged(const QString&)),
+    this, SLOT(saveSettings()));
+  connect(d->addButton, SIGNAL(clicked()),
+    this, SLOT(addNode()));
+  connect(d->removeButton, SIGNAL(clicked()),
+    this, SLOT(removeNode()));
+  connect(d->nodeTable, SIGNAL(cellChanged(int,int)),
+    this, SLOT(onCellChanged(int,int)));
+  connect(d->nodeTable, SIGNAL(currentItemChanged(QTableWidgetItem*, QTableWidgetItem*)),
+    this, SLOT(onCurrentItemChanged(QTableWidgetItem*, QTableWidgetItem*)));
 }
 }
 
 
 //----------------------------------------------------------------------------
 //----------------------------------------------------------------------------
@@ -195,10 +186,19 @@ void ctkDICOMServerNodeWidget::saveSettings()
     }
     }
   }
   }
   settings.setValue("ServerNodeCount", count);
   settings.setValue("ServerNodeCount", count);
+  settings.setValue("CallingAETitle", d->callingAETitle->text());
   settings.sync();
   settings.sync();
 }
 }
 
 
 //----------------------------------------------------------------------------
 //----------------------------------------------------------------------------
+QString ctkDICOMServerNodeWidget::callingAETitle()
+{
+  Q_D(ctkDICOMServerNodeWidget);
+
+  return d->callingAETitle->text();
+}
+
+//----------------------------------------------------------------------------
 QStringList ctkDICOMServerNodeWidget::nodes()
 QStringList ctkDICOMServerNodeWidget::nodes()
 {
 {
   Q_D(ctkDICOMServerNodeWidget);
   Q_D(ctkDICOMServerNodeWidget);

+ 1 - 0
Libs/DICOM/Widgets/ctkDICOMServerNodeWidget.h

@@ -40,6 +40,7 @@ public:
   explicit ctkDICOMServerNodeWidget(QWidget* parent=0);
   explicit ctkDICOMServerNodeWidget(QWidget* parent=0);
   virtual ~ctkDICOMServerNodeWidget();
   virtual ~ctkDICOMServerNodeWidget();
 
 
+  QString callingAETitle();
   QStringList nodes();
   QStringList nodes();
   QMap<QString,QString> nodeParameters(QString &node);
   QMap<QString,QString> nodeParameters(QString &node);