[pktools] 239/375: tool tips in qt

Bas Couwenberg sebastic at xs4all.nl
Wed Dec 3 21:54:17 UTC 2014


This is an automated email from the git hooks/post-receive script.

sebastic-guest pushed a commit to branch upstream-master
in repository pktools.

commit 4ee6d979adcf178d18d0aa9518bb7f841e4cf4c6
Author: Pieter Kempeneers <kempenep at gmail.com>
Date:   Wed Apr 16 13:53:42 2014 +0200

    tool tips in qt
---
 qt/pkcomposite_gui/mainwindow.cc |  8 +++-
 qt/pkcomposite_gui/mainwindow.ui | 49 +++++++++++++++++++++--
 qt/pkcrop_gui/mainwindow.cc      | 39 ++++++++++++++++--
 qt/pkcrop_gui/mainwindow.h       |  5 +++
 qt/pkcrop_gui/mainwindow.ui      | 76 +++++++++++++++++++++++++++++++++--
 qt/pkextract_gui/mainwindow.cpp  |  8 +++-
 qt/pkextract_gui/mainwindow.ui   | 45 ++++++++++++++++++---
 qt/pksvm_gui/mainwindow.cpp      | 15 +++++++
 qt/pksvm_gui/mainwindow.ui       | 86 ++++++++++++++++++++++++++++++++++++++++
 src/apps/pkann.cc                |  6 +--
 src/apps/pksvm.cc                | 16 ++++----
 11 files changed, 325 insertions(+), 28 deletions(-)

diff --git a/qt/pkcomposite_gui/mainwindow.cc b/qt/pkcomposite_gui/mainwindow.cc
index df1eea9..2b7050c 100644
--- a/qt/pkcomposite_gui/mainwindow.cc
+++ b/qt/pkcomposite_gui/mainwindow.cc
@@ -209,9 +209,15 @@ void MainWindow::on_toolButton_Run_clicked()
 
 //        QProcess *myProcess = new QProcess(parent);
         QProcess *myProcess = new QProcess(this);
-
         myProcess->start(program);
+        myProcess->setProcessChannelMode(QProcess::MergedChannels);
         myProcess->waitForFinished(-1);
+        QString p_stderr = myProcess->readAllStandardError();
+        if(!p_stderr.isEmpty()){
+            QMessageBox msgBox;
+            msgBox.setText(p_stderr);
+            msgBox.exec();
+        }
         QString p_stdout = myProcess->readAll();
         ui->consoleEdit->insertPlainText(p_stdout);
         delete myProcess;
diff --git a/qt/pkcomposite_gui/mainwindow.ui b/qt/pkcomposite_gui/mainwindow.ui
index 6b9f5f9..4bb8406 100644
--- a/qt/pkcomposite_gui/mainwindow.ui
+++ b/qt/pkcomposite_gui/mainwindow.ui
@@ -18,7 +18,7 @@
     <item>
      <widget class="QTabWidget" name="tabWidget">
       <property name="currentIndex">
-       <number>0</number>
+       <number>2</number>
       </property>
       <widget class="QWidget" name="tab">
        <attribute name="title">
@@ -45,6 +45,9 @@
           </item>
           <item row="0" column="0">
            <widget class="QLabel" name="label">
+            <property name="toolTip">
+             <string><html><head/><body><p>Input raster images</p></body></html></string>
+            </property>
             <property name="text">
              <string>Input images</string>
             </property>
@@ -65,6 +68,9 @@
           </item>
           <item row="1" column="0">
            <widget class="QLabel" name="label_2">
+            <property name="toolTip">
+             <string><html><head/><body><p>Provide geographical extent to crop in coordinate reference system of input data</p></body></html></string>
+            </property>
             <property name="text">
              <string>Geographical extent</string>
             </property>
@@ -91,8 +97,11 @@
           </item>
           <item row="4" column="0">
            <widget class="QLabel" name="label_4">
+            <property name="toolTip">
+             <string><html><head/><body><p>Use an external OGR vector file to define the geographical extent to crop. Coordinate reference systems of input and vector must be identical</p></body></html></string>
+            </property>
             <property name="text">
-             <string>Geographical extent</string>
+             <string>Extent via vector:</string>
             </property>
            </widget>
           </item>
@@ -133,6 +142,9 @@
         </item>
         <item row="1" column="0">
          <widget class="QLabel" name="label_18">
+          <property name="toolTip">
+           <string><html><head/><body><p>Composite rule for mosaic. Default is overwrite</p></body></html></string>
+          </property>
           <property name="text">
            <string>Composit rule</string>
           </property>
@@ -166,6 +178,9 @@
           <layout class="QGridLayout" name="gridLayout_3">
            <item row="1" column="0">
             <widget class="QLabel" name="label_21">
+             <property name="toolTip">
+              <string><html><head/><body><p>invalid value for input image</p></body></html></string>
+             </property>
              <property name="text">
               <string>nodata value</string>
              </property>
@@ -176,6 +191,9 @@
            </item>
            <item row="3" column="0">
             <widget class="QLabel" name="label_23">
+             <property name="toolTip">
+              <string><html><head/><body><p>flag values larger or equal to this value as invalid</p></body></html></string>
+             </property>
              <property name="text">
               <string>max value</string>
              </property>
@@ -183,6 +201,9 @@
            </item>
            <item row="2" column="0">
             <widget class="QLabel" name="label_22">
+             <property name="toolTip">
+              <string><html><head/><body><p>flag values smaller or equal to this value as invalid</p></body></html></string>
+             </property>
              <property name="text">
               <string>min value</string>
              </property>
@@ -196,6 +217,9 @@
            </item>
            <item row="0" column="0">
             <widget class="QLabel" name="label_20">
+             <property name="toolTip">
+              <string><html><head/><body><p>Band in input image to check if pixel is valid (used for srcnodata, min and max options)</p></body></html></string>
+             </property>
              <property name="text">
               <string>band</string>
              </property>
@@ -264,6 +288,9 @@
           </item>
           <item row="8" column="0">
            <widget class="QLabel" name="label_14">
+            <property name="toolTip">
+             <string><html><head/><body><p>Nodata value to put in image if out of bounds or if no valid pixel value is found in input images</p></body></html></string>
+            </property>
             <property name="text">
              <string>Output nodata value</string>
             </property>
@@ -287,6 +314,9 @@
           </item>
           <item row="6" column="0">
            <widget class="QLabel" name="label_9">
+            <property name="toolTip">
+             <string><html><head/><body><p>Output resolution in x and y distance measure (e.g., meter). Leave empty to read from input data</p></body></html></string>
+            </property>
             <property name="text">
              <string>Output resolution</string>
             </property>
@@ -297,6 +327,9 @@
           </item>
           <item row="5" column="0">
            <widget class="QLabel" name="label_8">
+            <property name="toolTip">
+             <string><html><head/><body><p>Color table must be provided as ASCII text file with five (space delimited) columns:</p><p>value red green blue alpha</p></body></html></string>
+            </property>
             <property name="text">
              <string>Color table (ASCII)</string>
             </property>
@@ -351,6 +384,9 @@
           </item>
           <item row="9" column="0">
            <widget class="QLabel" name="label_15">
+            <property name="toolTip">
+             <string><html><head/><body><p>Create extra raster file containing information on the selected input file for each pixel</p></body></html></string>
+            </property>
             <property name="text">
              <string>Ouput info on selected pixels</string>
             </property>
@@ -361,6 +397,9 @@
           </item>
           <item row="2" column="0">
            <widget class="QLabel" name="label_5">
+            <property name="toolTip">
+             <string><html><head/><body><p>Assign projection (e.g., epsg:3035). Notice this will not re-project the image. Use gdalwarp instead.</p></body></html></string>
+            </property>
             <property name="text">
              <string>Assign projection (EPSG:code)</string>
             </property>
@@ -556,13 +595,13 @@
  </widget>
  <layoutdefault spacing="6" margin="11"/>
  <tabstops>
-  <tabstop>tabWidget</tabstop>
   <tabstop>toolButton_input</tabstop>
-  <tabstop>listWidget_input</tabstop>
   <tabstop>uly</tabstop>
   <tabstop>ulx</tabstop>
   <tabstop>lrx</tabstop>
   <tabstop>lry</tabstop>
+  <tabstop>extent</tabstop>
+  <tabstop>toolButton_extent</tabstop>
   <tabstop>resample</tabstop>
   <tabstop>crule</tabstop>
   <tabstop>rband</tabstop>
@@ -589,6 +628,8 @@
   <tabstop>toolButton_defaults</tabstop>
   <tabstop>commandLineEdit</tabstop>
   <tabstop>consoleEdit</tabstop>
+  <tabstop>listWidget_input</tabstop>
+  <tabstop>tabWidget</tabstop>
  </tabstops>
  <resources/>
  <connections/>
diff --git a/qt/pkcrop_gui/mainwindow.cc b/qt/pkcrop_gui/mainwindow.cc
index 635b10b..5f2b52b 100644
--- a/qt/pkcrop_gui/mainwindow.cc
+++ b/qt/pkcrop_gui/mainwindow.cc
@@ -55,6 +55,8 @@ MainWindow::~MainWindow()
 
 void MainWindow::setDefaults()
 {
+    m_as=false;
+    m_manual=false;
     //input
     ui->listWidget_input->clear();
     ui->ulx->clear();
@@ -64,6 +66,8 @@ void MainWindow::setDefaults()
     ui->extent->clear();
     //scaling
     ui->resample->setCurrentIndex(0);
+    ui->as_from->clear();
+    ui->as_to->clear();
     ui->scale->clear();
     ui->offset->clear();
     //output
@@ -198,8 +202,18 @@ void MainWindow::on_toolButton_Run_clicked()
             program+=" -co TILED=YES";
 
         //todo: radiobuttons on scaling
-        if(m_as)
-            program+=" -as";
+        if(m_as){
+            program+=" --autoscale ";
+            program+=ui->as_from->text();
+            program+=" --autoscale ";
+            program+=ui->as_to->text();
+        }
+        else if(m_manual){
+            program+=" --scale ";
+            program+=ui->scale->text();
+            program+=" ---offset ";
+            program+=ui->offset->text();
+        }
 //        QList<QCheckBox*> qcheckBoxList = this->findChildren<QCheckBox *>();
 
 //        for(QList<QCheckBox*>::ConstIterator qcbit=qcheckBoxList.begin();qcbit!=qcheckBoxList.end();++qcbit){
@@ -228,9 +242,15 @@ void MainWindow::on_toolButton_Run_clicked()
 
 //        QProcess *myProcess = new QProcess(parent);
         QProcess *myProcess = new QProcess(this);
-
         myProcess->start(program);
+        myProcess->setProcessChannelMode(QProcess::MergedChannels);
         myProcess->waitForFinished(-1);
+        QString p_stderr = myProcess->readAllStandardError();
+        if(!p_stderr.isEmpty()){
+            QMessageBox msgBox;
+            msgBox.setText(p_stderr);
+            msgBox.exec();
+        }
         QString p_stdout = myProcess->readAll();
         ui->consoleEdit->insertPlainText(p_stdout);
         delete myProcess;
@@ -245,4 +265,17 @@ void MainWindow::on_toolButton_Run_clicked()
 void MainWindow::on_autoscale_clicked()
 {
     m_as=true;
+    m_manual=false;
+}
+
+void MainWindow::on_manual_clicked()
+{
+    m_as=false;
+    m_manual=true;
+}
+
+void MainWindow::on_noscale_clicked()
+{
+    m_as=false;
+    m_manual=false;
 }
diff --git a/qt/pkcrop_gui/mainwindow.h b/qt/pkcrop_gui/mainwindow.h
index 562d9ab..e4b3c72 100644
--- a/qt/pkcrop_gui/mainwindow.h
+++ b/qt/pkcrop_gui/mainwindow.h
@@ -59,9 +59,14 @@ private slots:
 
     void on_actionExtent_triggered();
 
+    void on_manual_clicked();
+
+    void on_noscale_clicked();
+
 private:
     Ui::MainWindow *ui;
     void setDefaults();
+    bool m_manual;
     bool m_as;
 };
 
diff --git a/qt/pkcrop_gui/mainwindow.ui b/qt/pkcrop_gui/mainwindow.ui
index a420848..a7d3669 100644
--- a/qt/pkcrop_gui/mainwindow.ui
+++ b/qt/pkcrop_gui/mainwindow.ui
@@ -18,7 +18,7 @@
     <item>
      <widget class="QTabWidget" name="tabWidget">
       <property name="currentIndex">
-       <number>0</number>
+       <number>2</number>
       </property>
       <widget class="QWidget" name="tab">
        <attribute name="title">
@@ -58,8 +58,11 @@
           </item>
           <item row="0" column="0">
            <widget class="QLabel" name="label">
+            <property name="toolTip">
+             <string><html><head/><body><p>Input image(s)</p></body></html></string>
+            </property>
             <property name="text">
-             <string>Input images</string>
+             <string>Input image(s)</string>
             </property>
            </widget>
           </item>
@@ -68,6 +71,9 @@
           </item>
           <item row="4" column="0">
            <widget class="QLabel" name="label_4">
+            <property name="toolTip">
+             <string><html><head/><body><p>Use an external OGR vector file to define the geographical extent to crop. Coordinate reference systems of input and vector must be identical</p></body></html></string>
+            </property>
             <property name="text">
              <string>Extent via vector:</string>
             </property>
@@ -75,6 +81,9 @@
           </item>
           <item row="1" column="0">
            <widget class="QLabel" name="label_2">
+            <property name="toolTip">
+             <string><html><head/><body><p>Provide geographical extent to crop in coordinate reference system of input data</p></body></html></string>
+            </property>
             <property name="text">
              <string>Geographical extent</string>
             </property>
@@ -95,6 +104,9 @@
           </item>
           <item row="6" column="0">
            <widget class="QLabel" name="label_16">
+            <property name="whatsThis">
+             <string><html><head/><body><p>First select input image. Then select bands by clicking in the table (use Ctrl and Shift to select multiple bands)</p></body></html></string>
+            </property>
             <property name="text">
              <string>Select bands</string>
             </property>
@@ -172,6 +184,9 @@
         </item>
         <item row="1" column="0">
          <widget class="QLabel" name="label_9">
+          <property name="toolTip">
+           <string><html><head/><body><p>Output resolution in x and y distance measure (e.g., meter). Leave empty to read from input data</p></body></html></string>
+          </property>
           <property name="text">
            <string>Output resolution</string>
           </property>
@@ -198,6 +213,9 @@
           <layout class="QGridLayout" name="gridLayout_3">
            <item row="1" column="0">
             <widget class="QRadioButton" name="autoscale">
+             <property name="toolTip">
+              <string><html><head/><body><p>Auto scale input data from to (e.g., use from=0 and to=255 for Byte type image)</p></body></html></string>
+             </property>
              <property name="text">
               <string>autoscale</string>
              </property>
@@ -211,6 +229,9 @@
            </item>
            <item row="2" column="0">
             <widget class="QRadioButton" name="manual">
+             <property name="toolTip">
+              <string><html><head/><body><p>Manually scale data using scale and offset: output=scale*input+offset</p></body></html></string>
+             </property>
              <property name="text">
               <string>manual</string>
              </property>
@@ -235,6 +256,9 @@
            </item>
            <item row="0" column="0">
             <widget class="QRadioButton" name="noscale">
+             <property name="toolTip">
+              <string><html><head/><body><p>Do not scale the data</p></body></html></string>
+             </property>
              <property name="text">
               <string>no scaling</string>
              </property>
@@ -259,6 +283,39 @@
              </property>
             </spacer>
            </item>
+           <item row="1" column="1">
+            <widget class="QLabel" name="label_10">
+             <property name="text">
+              <string>from</string>
+             </property>
+            </widget>
+           </item>
+           <item row="1" column="2">
+            <widget class="QLineEdit" name="as_from"/>
+           </item>
+           <item row="1" column="3">
+            <widget class="QLabel" name="label_11">
+             <property name="text">
+              <string>to</string>
+             </property>
+            </widget>
+           </item>
+           <item row="1" column="4">
+            <widget class="QLineEdit" name="as_to"/>
+           </item>
+           <item row="1" column="5">
+            <spacer name="horizontalSpacer_11">
+             <property name="orientation">
+              <enum>Qt::Horizontal</enum>
+             </property>
+             <property name="sizeHint" stdset="0">
+              <size>
+               <width>40</width>
+               <height>20</height>
+              </size>
+             </property>
+            </spacer>
+           </item>
           </layout>
          </widget>
         </item>
@@ -336,6 +393,9 @@
           </item>
           <item row="2" column="0">
            <widget class="QLabel" name="label_5">
+            <property name="toolTip">
+             <string><html><head/><body><p>Assign projection (e.g., epsg:3035). Notice this will not re-project the image. Use gdalwarp instead.</p></body></html></string>
+            </property>
             <property name="text">
              <string>Assign projection (EPSG:code)</string>
             </property>
@@ -350,6 +410,9 @@
           </item>
           <item row="1" column="0">
            <widget class="QLabel" name="label_3">
+            <property name="toolTip">
+             <string><html><head/><body><p>Output raster image</p></body></html></string>
+            </property>
             <property name="text">
              <string>Output image</string>
             </property>
@@ -391,6 +454,9 @@
           </item>
           <item row="7" column="0">
            <widget class="QLabel" name="label_14">
+            <property name="toolTip">
+             <string><html><head/><body><p>Nodata value to put in image if out of bounds</p></body></html></string>
+            </property>
             <property name="text">
              <string>Output nodata value</string>
             </property>
@@ -417,6 +483,9 @@
           </item>
           <item row="5" column="0">
            <widget class="QLabel" name="label_8">
+            <property name="toolTip">
+             <string><html><head/><body><p>Color table must be provided as ASCII text file with five (space delimited) columns:</p><p>value red green blue alpha</p></body></html></string>
+            </property>
             <property name="text">
              <string>Color table (ASCII)</string>
             </property>
@@ -595,7 +664,6 @@
  </widget>
  <layoutdefault spacing="6" margin="11"/>
  <tabstops>
-  <tabstop>tabWidget</tabstop>
   <tabstop>toolButton_input</tabstop>
   <tabstop>uly</tabstop>
   <tabstop>ulx</tabstop>
@@ -603,6 +671,7 @@
   <tabstop>lry</tabstop>
   <tabstop>extent</tabstop>
   <tabstop>toolButton_extent</tabstop>
+  <tabstop>listWidget_band</tabstop>
   <tabstop>resample</tabstop>
   <tabstop>dx</tabstop>
   <tabstop>dy</tabstop>
@@ -627,6 +696,7 @@
   <tabstop>consoleEdit</tabstop>
   <tabstop>commandLineEdit</tabstop>
   <tabstop>listWidget_input</tabstop>
+  <tabstop>tabWidget</tabstop>
  </tabstops>
  <resources/>
  <connections/>
diff --git a/qt/pkextract_gui/mainwindow.cpp b/qt/pkextract_gui/mainwindow.cpp
index e2e15ac..bb93e00 100644
--- a/qt/pkextract_gui/mainwindow.cpp
+++ b/qt/pkextract_gui/mainwindow.cpp
@@ -156,9 +156,15 @@ void MainWindow::on_pushButton_run_clicked()
 
 //        QProcess *myProcess = new QProcess(parent);
         QProcess *myProcess = new QProcess(this);
-
         myProcess->start(program);
+        myProcess->setProcessChannelMode(QProcess::MergedChannels);
         myProcess->waitForFinished(-1);
+        QString p_stderr = myProcess->readAllStandardError();
+        if(!p_stderr.isEmpty()){
+            QMessageBox msgBox;
+            msgBox.setText(p_stderr);
+            msgBox.exec();
+        }
         QString p_stdout = myProcess->readAll();
         ui->consoleEdit->insertPlainText(p_stdout);
         delete myProcess;
diff --git a/qt/pkextract_gui/mainwindow.ui b/qt/pkextract_gui/mainwindow.ui
index 90bffaa..b7743b7 100644
--- a/qt/pkextract_gui/mainwindow.ui
+++ b/qt/pkextract_gui/mainwindow.ui
@@ -26,7 +26,7 @@
       <item>
        <widget class="QTabWidget" name="tabWidget">
         <property name="currentIndex">
-         <number>0</number>
+         <number>1</number>
         </property>
         <widget class="QWidget" name="tab_2">
          <attribute name="title">
@@ -37,6 +37,9 @@
            <layout class="QGridLayout" name="gridLayout">
             <item row="1" column="3">
              <widget class="QLabel" name="label_14">
+              <property name="toolTip">
+               <string><html><head/><body><p>Pixels in input image where mask image has msknodata will not be classified, but obtain a constant value (=nodata)</p></body></html></string>
+              </property>
               <property name="text">
                <string>msknodata</string>
               </property>
@@ -80,6 +83,9 @@
             </item>
             <item row="3" column="3">
              <widget class="QLabel" name="label_16">
+              <property name="toolTip">
+               <string><html><head/><body><p>OGR supported vector format</p></body></html></string>
+              </property>
               <property name="text">
                <string>format</string>
               </property>
@@ -88,7 +94,7 @@
             <item row="3" column="0">
              <widget class="QLabel" name="label_15">
               <property name="toolTip">
-               <string><html><head/><body><p>Classified map (raster or vector according to input image).</p></body></html></string>
+               <string><html><head/><body><p>Output will contain sample features with input band information included</p></body></html></string>
               </property>
               <property name="text">
                <string>Output data</string>
@@ -111,7 +117,7 @@
             <item row="2" column="0">
              <widget class="QLabel" name="label_23">
               <property name="toolTip">
-               <string><html><head/><body><p>Pixels in input image where mask image has msknodata will not be classified, but obtain a constant value (=nodata)</p></body></html></string>
+               <string><html><head/><body><p>OGR vector file with features to be extracted from input data. Output will contain features with input band information included</p></body></html></string>
               </property>
               <property name="text">
                <string>Sample image</string>
@@ -187,6 +193,9 @@
             </item>
             <item row="4" column="0">
              <widget class="QLabel" name="label_20">
+              <property name="toolTip">
+               <string><html><head/><body><p>Prepare a table if you want to extract a subset of the points in the provided sample vector file. Use a percentual threshold value for each of the labels in the sample. To prepare the table, first enter the number of classes and then press the button '-&gt;'.</p></body></html></string>
+              </property>
               <property name="text">
                <string>prepare table </string>
               </property>
@@ -198,7 +207,7 @@
             <item row="0" column="0">
              <widget class="QLabel" name="label_4">
               <property name="toolTip">
-               <string><html><head/><body><p>name of the attribute in your training vector file that corresponds to the class labels </p></body></html></string>
+               <string><html><head/><body><p>Rule how to extract the features from the input data</p></body></html></string>
               </property>
               <property name="text">
                <string>extraction rule</string>
@@ -217,6 +226,9 @@
             </item>
             <item row="4" column="2">
              <widget class="QToolButton" name="toolButton_createTable">
+              <property name="toolTip">
+               <string><html><head/><body><p>Prepare a table if you want to extract a subset of the points in the provided sample vector file. Use a percentual threshold value for each of the labels in the sample. To prepare the table, first enter the number of classes and then press the button '-&gt;'.</p></body></html></string>
+              </property>
               <property name="text">
                <string>-></string>
               </property>
@@ -225,7 +237,7 @@
             <item row="1" column="0">
              <widget class="QLabel" name="label_2">
               <property name="toolTip">
-               <string><html><head/><body><p>name of the attribute in your training vector file that corresponds to the class labels </p></body></html></string>
+               <string><html><head/><body><p>For single band input data, this extra attribute name will correspond to the raster values. For multi-band input data, multiple attributes with this prefix will be added (e.g. B0, B1, B2, etc.)</p></body></html></string>
               </property>
               <property name="text">
                <string>attribute (prefix) name for raster info</string>
@@ -385,6 +397,29 @@
   </action>
  </widget>
  <layoutdefault spacing="6" margin="11"/>
+ <tabstops>
+  <tabstop>input</tabstop>
+  <tabstop>toolButton_input</tabstop>
+  <tabstop>mask</tabstop>
+  <tabstop>toolButton_mask</tabstop>
+  <tabstop>msknodata</tabstop>
+  <tabstop>sample</tabstop>
+  <tabstop>toolButton_sample</tabstop>
+  <tabstop>output</tabstop>
+  <tabstop>toolButton_output</tabstop>
+  <tabstop>f</tabstop>
+  <tabstop>polygon</tabstop>
+  <tabstop>rule</tabstop>
+  <tabstop>bname</tabstop>
+  <tabstop>nclass</tabstop>
+  <tabstop>toolButton_createTable</tabstop>
+  <tabstop>commandLineEdit</tabstop>
+  <tabstop>consoleEdit</tabstop>
+  <tabstop>pushButton_run</tabstop>
+  <tabstop>pushButton_restore</tabstop>
+  <tabstop>tabWidget</tabstop>
+  <tabstop>tableView_labels</tabstop>
+ </tabstops>
  <resources/>
  <connections/>
 </ui>
diff --git a/qt/pksvm_gui/mainwindow.cpp b/qt/pksvm_gui/mainwindow.cpp
index e73668a..2d1198d 100644
--- a/qt/pksvm_gui/mainwindow.cpp
+++ b/qt/pksvm_gui/mainwindow.cpp
@@ -156,6 +156,14 @@ void MainWindow::on_pushButton_run_clicked()
             QString qsError="No training vector file selected";
             throw(qsError);
         }
+        if(!ui->input->text().isEmpty()){
+            if(ui->output->text().isEmpty())
+                MainWindow::on_actionOutput_triggered();
+            if(ui->output->text().isEmpty()){
+                QString qsError="No training vector file selected";
+                throw(qsError);
+            }
+        }
 
 //        QList<QCheckBox*> qcheckBoxList = this->findChildren<QCheckBox *>();
 
@@ -222,7 +230,14 @@ void MainWindow::on_pushButton_run_clicked()
 //        QProcess *myProcess = new QProcess(parent);
         QProcess *myProcess = new QProcess(this);
         myProcess->start(program);
+        myProcess->setProcessChannelMode(QProcess::MergedChannels);
         myProcess->waitForFinished(-1);
+        QMessageBox msgBox;
+        QString p_stderr = myProcess->readAllStandardError();
+        if(!p_stderr.isEmpty()){
+            msgBox.setText(p_stderr);
+            msgBox.exec();
+        }
         QString p_stdout = myProcess->readAll();
         ui->consoleEdit->insertPlainText(p_stdout);
         delete myProcess;
diff --git a/qt/pksvm_gui/mainwindow.ui b/qt/pksvm_gui/mainwindow.ui
index f65656f..8f425a9 100644
--- a/qt/pksvm_gui/mainwindow.ui
+++ b/qt/pksvm_gui/mainwindow.ui
@@ -29,6 +29,9 @@
          <layout class="QGridLayout" name="gridLayout">
           <item row="2" column="0">
            <widget class="QLabel" name="label_2">
+            <property name="toolTip">
+             <string><html><head/><body><p>Attribute name of the class label in the training vector file (default is label)</p></body></html></string>
+            </property>
             <property name="text">
              <string>attribute name for class label</string>
             </property>
@@ -43,6 +46,9 @@
           </item>
           <item row="0" column="0">
            <widget class="QLabel" name="label_4">
+            <property name="toolTip">
+             <string><html><head/><body><p>OGR supported vector file. Features must contain labels and band information. You can use pkextract to prepare training vector files</p></body></html></string>
+            </property>
             <property name="text">
              <string>Training vectorfile</string>
             </property>
@@ -69,6 +75,9 @@
           </item>
           <item row="3" column="0">
            <widget class="QLabel" name="label_20">
+            <property name="toolTip">
+             <string><html><head/><body><p>Provide number of classes in training file here to prepare class name-value pairs (push button prepare table). This is mandatory if labels in training vector are provided as text (instead of Integer values). The table also provide priors and balance classes in training sample.</p></body></html></string>
+            </property>
             <property name="text">
              <string>number of classes to prepare table</string>
             </property>
@@ -92,6 +101,9 @@
           </item>
           <item row="1" column="0">
            <widget class="QLabel" name="label_21">
+            <property name="toolTip">
+             <string><html><head/><body><p>Name of the training layer (optional). If not provided, all layers will be read per default.</p></body></html></string>
+            </property>
             <property name="text">
              <string>Training layername (optional)</string>
             </property>
@@ -171,6 +183,9 @@
           </item>
           <item row="1" column="0">
            <widget class="QLabel" name="label_13">
+            <property name="toolTip">
+             <string><html><head/><body><p>Dimensions of mask image must correspond to input image. Pixels in mask with values=masknodata are not classified and get nodata value.</p></body></html></string>
+            </property>
             <property name="text">
              <string>Mask image</string>
             </property>
@@ -185,6 +200,9 @@
           </item>
           <item row="2" column="0">
            <widget class="QLabel" name="label_15">
+            <property name="toolTip">
+             <string><html><head/><body><p>Output image (classified map). Can be OGR vector or GDAL raster, depending on input data.</p></body></html></string>
+            </property>
             <property name="text">
              <string>Output data</string>
             </property>
@@ -224,6 +242,9 @@
           </item>
           <item row="0" column="0">
            <widget class="QLabel" name="label_3">
+            <property name="toolTip">
+             <string><html><head/><body><p>Input image. Both OGR vectors and GDAL rasters are supported. Number of bands must match those in training sample.</p></body></html></string>
+            </property>
             <property name="text">
              <string>Input data</string>
             </property>
@@ -231,6 +252,9 @@
           </item>
           <item row="3" column="0">
            <widget class="QLabel" name="label_22">
+            <property name="toolTip">
+             <string><html><head/><body><p>Color table must be provided as ASCII text file with five (space delimited) columns:</p><p>value red green blue alpha<br/></p></body></html></string>
+            </property>
             <property name="text">
              <string>color table</string>
             </property>
@@ -278,6 +302,9 @@
           </item>
           <item row="3" column="0">
            <widget class="QLabel" name="label_5">
+            <property name="toolTip">
+             <string><html><head/><body><p>Leave empty to skip cross validation. Enter 2 for a two-fold cross validation</p></body></html></string>
+            </property>
             <property name="text">
              <string>n-fold cross validation</string>
             </property>
@@ -285,6 +312,9 @@
           </item>
           <item row="2" column="3">
            <widget class="QLabel" name="label_10">
+            <property name="toolTip">
+             <string><html><head/><body><p>the parameter C of C_SVC, epsilon_SVR, and nu_SVR (default is 1)</p></body></html></string>
+            </property>
             <property name="text">
              <string>CCost</string>
             </property>
@@ -292,6 +322,9 @@
           </item>
           <item row="0" column="3">
            <widget class="QLabel" name="label_11">
+            <property name="toolTip">
+             <string><html><head/><body><p>Coef0 in the kernel function (default is 0)</p></body></html></string>
+            </property>
             <property name="text">
              <string>Coef 0</string>
             </property>
@@ -299,6 +332,9 @@
           </item>
           <item row="0" column="0">
            <widget class="QLabel" name="label_6">
+            <property name="toolTip">
+             <string><html><head/><body><p>Type of the support vector machine</p></body></html></string>
+            </property>
             <property name="text">
              <string>SVM type</string>
             </property>
@@ -312,6 +348,9 @@
           </item>
           <item row="1" column="0">
            <widget class="QLabel" name="label_7">
+            <property name="toolTip">
+             <string><html><head/><body><p>type of kernel function (default is radial)</p></body></html></string>
+            </property>
             <property name="text">
              <string>Kernel type</string>
             </property>
@@ -322,6 +361,9 @@
           </item>
           <item row="2" column="0">
            <widget class="QLabel" name="label_9">
+            <property name="toolTip">
+             <string><html><head/><body><p>gamma in kernel function (default is 0)</p></body></html></string>
+            </property>
             <property name="text">
              <string>Gamma</string>
             </property>
@@ -335,6 +377,9 @@
           </item>
           <item row="0" column="6">
            <widget class="QLabel" name="label_12">
+            <property name="toolTip">
+             <string><html><head/><body><p>the parameter nu of nu_SVC, one_class SVM, and nu_SVR (default is 0.5)</p></body></html></string>
+            </property>
             <property name="text">
              <string>nu</string>
             </property>
@@ -358,6 +403,9 @@
           </item>
           <item row="1" column="3">
            <widget class="QLabel" name="label_8">
+            <property name="toolTip">
+             <string><html><head/><body><p>degree in kernel function (default is 3)</p></body></html></string>
+            </property>
             <property name="text">
              <string>Kernel degree</string>
             </property>
@@ -426,6 +474,9 @@
      <layout class="QHBoxLayout" name="horizontalLayout">
       <item>
        <widget class="QPushButton" name="pushButton_run">
+        <property name="toolTip">
+         <string><html><head/><body><p>Classify with current settings (check Console for output)</p></body></html></string>
+        </property>
         <property name="text">
          <string>Run</string>
         </property>
@@ -446,6 +497,9 @@
       </item>
       <item>
        <widget class="QPushButton" name="pushButton_restore">
+        <property name="toolTip">
+         <string><html><head/><body><p>reset all parameters to default</p></body></html></string>
+        </property>
         <property name="text">
          <string>Restore defaults</string>
         </property>
@@ -527,6 +581,38 @@
   </action>
  </widget>
  <layoutdefault spacing="6" margin="11"/>
+ <tabstops>
+  <tabstop>tabWidget</tabstop>
+  <tabstop>training</tabstop>
+  <tabstop>toolButton_training</tabstop>
+  <tabstop>tln</tabstop>
+  <tabstop>label</tabstop>
+  <tabstop>nclass</tabstop>
+  <tabstop>input</tabstop>
+  <tabstop>toolButton_input</tabstop>
+  <tabstop>mask</tabstop>
+  <tabstop>toolButton_mask</tabstop>
+  <tabstop>msknodata</tabstop>
+  <tabstop>output</tabstop>
+  <tabstop>toolButton_output</tabstop>
+  <tabstop>nodata</tabstop>
+  <tabstop>ct</tabstop>
+  <tabstop>toolButton_ct</tabstop>
+  <tabstop>svmtype</tabstop>
+  <tabstop>coef0</tabstop>
+  <tabstop>nu</tabstop>
+  <tabstop>kerneltype</tabstop>
+  <tabstop>kd</tabstop>
+  <tabstop>gamma</tabstop>
+  <tabstop>ccost</tabstop>
+  <tabstop>cv</tabstop>
+  <tabstop>commandLineEdit</tabstop>
+  <tabstop>consoleEdit</tabstop>
+  <tabstop>tableView_labels</tabstop>
+  <tabstop>commandLinkButtonPrepareTable</tabstop>
+  <tabstop>pushButton_run</tabstop>
+  <tabstop>pushButton_restore</tabstop>
+ </tabstops>
  <resources/>
  <connections/>
 </ui>
diff --git a/src/apps/pkann.cc b/src/apps/pkann.cc
index 52324f5..9c208e3 100644
--- a/src/apps/pkann.cc
+++ b/src/apps/pkann.cc
@@ -578,16 +578,16 @@ int main(int argc, char *argv[])
     GDALProgressFunc pfnProgress=GDALTermProgress;
     float progress=0;
   //-------------------------------- open image file ------------------------------------
-  bool refIsRaster=false;
+  bool inputIsRaster=false;
   ImgReaderOgr imgReaderOgr;
   try{
     imgReaderOgr.open(input_opt[0]);
     imgReaderOgr.close();
   }
   catch(string errorString){
-    refIsRaster=true;
+    inputIsRaster=true;
   }
-  if(refIsRaster){
+  if(inputIsRaster){
   // if(input_opt[0].find(".shp")==string::npos){
     ImgReaderGdal testImage;
     try{
diff --git a/src/apps/pksvm.cc b/src/apps/pksvm.cc
index c8032f8..fc6d0e5 100644
--- a/src/apps/pksvm.cc
+++ b/src/apps/pksvm.cc
@@ -437,11 +437,11 @@ int main(int argc, char *argv[])
         }
       }
 
-      if(priors_opt.size()==nameVector.size()){
-	std::cerr << "Warning: please check if priors are provided in correct order!!!" << std::endl;
-	for(int iclass=0;iclass<nameVector.size();++iclass)
-	  std::cerr << nameVector[iclass] << " " << priors_opt[iclass] << std::endl;
-      }
+      // if(priors_opt.size()==nameVector.size()){
+      // 	std::cerr << "Warning: please check if priors are provided in correct order!!!" << std::endl;
+      // 	for(int iclass=0;iclass<nameVector.size();++iclass)
+      // 	  std::cerr << nameVector[iclass] << " " << priors_opt[iclass] << std::endl;
+      // }
     }//if(!ibag)
 
     //Calculate features of training set
@@ -573,16 +573,16 @@ int main(int argc, char *argv[])
   if(!verbose_opt[0])
     pfnProgress(progress,pszMessage,pProgressArg);
   //-------------------------------- open image file ------------------------------------
-  bool refIsRaster=false;
+  bool inputIsRaster=false;
   ImgReaderOgr imgReaderOgr;
   try{
     imgReaderOgr.open(input_opt[0]);
     imgReaderOgr.close();
   }
   catch(string errorString){
-    refIsRaster=true;
+    inputIsRaster=true;
   }
-  if(refIsRaster){
+  if(inputIsRaster){
     ImgReaderGdal testImage;
     try{
       if(verbose_opt[0]>=1)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/pktools.git



More information about the Pkg-grass-devel mailing list