From 8202716e71eb8b5e8238b1a97db4edc43a82ef84 Mon Sep 17 00:00:00 2001
From: Olivier Langella <olivier.langella@u-psud.fr>
Date: Wed, 11 Oct 2017 21:44:54 +0200
Subject: [PATCH] residue form completed

---
 src/core/tandem_run/tandemparameters.cpp      |   2 +-
 .../edit_tandem_preset_dialog.ui              | 264 ++++++++++++++++++
 .../edittandempresetdialog.cpp                |  47 +++-
 3 files changed, 311 insertions(+), 2 deletions(-)

diff --git a/src/core/tandem_run/tandemparameters.cpp b/src/core/tandem_run/tandemparameters.cpp
index c621155ee..ad2bffda0 100644
--- a/src/core/tandem_run/tandemparameters.cpp
+++ b/src/core/tandem_run/tandemparameters.cpp
@@ -125,7 +125,7 @@ void TandemParameters::setParamLabelValue(const QString & label, const QString &
         }
     }
 
-    //text "protein, cleavage site" "protein, modified residue mass file"
+    //text "protein, cleavage site" "protein, modified residue mass file" "residue, modification mass"
 
     _map_label_value.insert(label, value);
 }
diff --git a/src/gui/edit_tandem_preset_dialog/edit_tandem_preset_dialog.ui b/src/gui/edit_tandem_preset_dialog/edit_tandem_preset_dialog.ui
index e72300045..5dcc61b0b 100644
--- a/src/gui/edit_tandem_preset_dialog/edit_tandem_preset_dialog.ui
+++ b/src/gui/edit_tandem_preset_dialog/edit_tandem_preset_dialog.ui
@@ -834,6 +834,47 @@
               <layout class="QVBoxLayout" name="verticalLayout_9">
                <item>
                 <layout class="QGridLayout" name="gridLayout">
+                 <item row="8" column="0">
+                  <widget class="QLabel" name="label_37">
+                   <property name="text">
+                    <string>Potential modifications motif 1</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="2" column="0">
+                  <widget class="QLabel" name="label_31">
+                   <property name="text">
+                    <string>Fixed modifications 1</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="2" column="1">
+                  <widget class="QLineEdit" name="rmm1_edit"/>
+                 </item>
+                 <item row="4" column="0">
+                  <widget class="QLabel" name="label_33">
+                   <property name="text">
+                    <string>Potential modifications</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="3" column="1">
+                  <widget class="QLineEdit" name="rmm2_edit"/>
+                 </item>
+                 <item row="6" column="0">
+                  <widget class="QLabel" name="label_35">
+                   <property name="text">
+                    <string>Potential modifications 2</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="2" column="2">
+                  <widget class="QPushButton" name="rmm1_push_button">
+                   <property name="text">
+                    <string>?</string>
+                   </property>
+                  </widget>
+                 </item>
                  <item row="1" column="0">
                   <widget class="QLabel" name="label_27">
                    <property name="text">
@@ -841,6 +882,13 @@
                    </property>
                   </widget>
                  </item>
+                 <item row="3" column="0">
+                  <widget class="QLabel" name="label_32">
+                   <property name="text">
+                    <string>Fixed modifications 2</string>
+                   </property>
+                  </widget>
+                 </item>
                  <item row="1" column="1">
                   <widget class="QLineEdit" name="rmm_edit"/>
                  </item>
@@ -851,6 +899,94 @@
                    </property>
                   </widget>
                  </item>
+                 <item row="5" column="0">
+                  <widget class="QLabel" name="label_34">
+                   <property name="text">
+                    <string>Potential modifications 1</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="7" column="0">
+                  <widget class="QLabel" name="label_36">
+                   <property name="text">
+                    <string>Potential modifications motif</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="3" column="2">
+                  <widget class="QPushButton" name="rmm2_push_button">
+                   <property name="text">
+                    <string>?</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="5" column="1">
+                  <widget class="QLineEdit" name="rpmm1_edit"/>
+                 </item>
+                 <item row="4" column="1">
+                  <widget class="QLineEdit" name="rpmm_edit"/>
+                 </item>
+                 <item row="6" column="2">
+                  <widget class="QPushButton" name="rpmm2_push_button">
+                   <property name="text">
+                    <string>?</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="4" column="2">
+                  <widget class="QPushButton" name="rpmm_push_button">
+                   <property name="text">
+                    <string>?</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="6" column="1">
+                  <widget class="QLineEdit" name="rpmm2_edit"/>
+                 </item>
+                 <item row="5" column="2">
+                  <widget class="QPushButton" name="rpmm1_push_button">
+                   <property name="text">
+                    <string>?</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="9" column="0">
+                  <widget class="QLabel" name="label_38">
+                   <property name="text">
+                    <string>Potential modifications motif 2</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="7" column="1">
+                  <widget class="QLineEdit" name="rpmmotif_edit"/>
+                 </item>
+                 <item row="8" column="1">
+                  <widget class="QLineEdit" name="rpmmotif1_edit"/>
+                 </item>
+                 <item row="9" column="1">
+                  <widget class="QLineEdit" name="rpmmotif2_edit"/>
+                 </item>
+                 <item row="7" column="2">
+                  <widget class="QPushButton" name="rpmmotif_push_button">
+                   <property name="text">
+                    <string>?</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="8" column="2">
+                  <widget class="QPushButton" name="rpmmotif1_push_button">
+                   <property name="text">
+                    <string>?</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="9" column="2">
+                  <widget class="QPushButton" name="rpmmotif2_push_button">
+                   <property name="text">
+                    <string>?</string>
+                   </property>
+                  </widget>
+                 </item>
                 </layout>
                </item>
                <item>
@@ -1689,6 +1825,134 @@
     </hint>
    </hints>
   </connection>
+  <connection>
+   <sender>rmm1_push_button</sender>
+   <signal>clicked()</signal>
+   <receiver>EditTandemPresetView</receiver>
+   <slot>doHelp()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>997</x>
+     <y>217</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>1616</x>
+     <y>211</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>rmm2_push_button</sender>
+   <signal>clicked()</signal>
+   <receiver>EditTandemPresetView</receiver>
+   <slot>doHelp()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>986</x>
+     <y>248</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>1684</x>
+     <y>394</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>rpmm_push_button</sender>
+   <signal>clicked()</signal>
+   <receiver>EditTandemPresetView</receiver>
+   <slot>doHelp()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>970</x>
+     <y>285</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>1691</x>
+     <y>300</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>rpmm1_push_button</sender>
+   <signal>clicked()</signal>
+   <receiver>EditTandemPresetView</receiver>
+   <slot>doHelp()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>997</x>
+     <y>323</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>1690</x>
+     <y>366</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>rpmm2_push_button</sender>
+   <signal>clicked()</signal>
+   <receiver>EditTandemPresetView</receiver>
+   <slot>doHelp()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>953</x>
+     <y>352</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>1691</x>
+     <y>336</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>rpmmotif_push_button</sender>
+   <signal>clicked()</signal>
+   <receiver>EditTandemPresetView</receiver>
+   <slot>doHelp()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>979</x>
+     <y>391</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>1637</x>
+     <y>404</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>rpmmotif1_push_button</sender>
+   <signal>clicked()</signal>
+   <receiver>EditTandemPresetView</receiver>
+   <slot>doHelp()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>976</x>
+     <y>427</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>1637</x>
+     <y>385</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>rpmmotif2_push_button</sender>
+   <signal>clicked()</signal>
+   <receiver>EditTandemPresetView</receiver>
+   <slot>doHelp()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>1000</x>
+     <y>456</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>1637</x>
+     <y>435</y>
+    </hint>
+   </hints>
+  </connection>
  </connections>
  <slots>
   <slot>doCopy()</slot>
diff --git a/src/gui/edit_tandem_preset_dialog/edittandempresetdialog.cpp b/src/gui/edit_tandem_preset_dialog/edittandempresetdialog.cpp
index ac4da95d5..6a939bcd1 100644
--- a/src/gui/edit_tandem_preset_dialog/edittandempresetdialog.cpp
+++ b/src/gui/edit_tandem_preset_dialog/edittandempresetdialog.cpp
@@ -286,10 +286,22 @@ void EditTandemPresetDialog::doHelp() {
     {
         html_doc.setFileName(":/tandem/resources/html_doc/pmrmf.html");
     }
-    if(senderObjName == "rmm_push_button")
+    if ((senderObjName == "rmm_push_button") || (senderObjName == "rmm1_push_button") || (senderObjName == "rmm2_push_button"))
     {
         html_doc.setFileName(":/tandem/resources/html_doc/rmm.html");
     }
+    if ((senderObjName == "rpmm_push_button") || (senderObjName == "rpmm1_push_button") || (senderObjName == "rpmm2_push_button"))
+    {
+        html_doc.setFileName(":/tandem/resources/html_doc/rpmm.html");
+    }
+    if ((senderObjName == "rpmmotif_push_button") || (senderObjName == "rpmmotif1_push_button") || (senderObjName == "rpmmotif2_push_button"))
+    {
+        html_doc.setFileName(":/tandem/resources/html_doc/rpmmotif.html");
+    }
+
+    _tandem_params.setParamLabelValue("residue, potential modification mass", ui->rpmm_edit->text());
+    _tandem_params.setParamLabelValue("residue, potential modification mass 1", ui->rpmm1_edit->text());
+    _tandem_params.setParamLabelValue("residue, potential modification mass 2", ui->rpmm2_edit->text());
 
     if (html_doc.open(QFile::ReadOnly | QFile::Text)) {
         QTextStream in(&html_doc);
@@ -341,6 +353,17 @@ void EditTandemPresetDialog::readUi() {
         _tandem_params.setParamLabelValue("protein, modified residue mass file", ui->pmrmf_edit->text());
 
 
+
+        _tandem_params.setParamLabelValue("residue, modification mass", ui->rmm_edit->text());
+        _tandem_params.setParamLabelValue("residue, modification mass 1", ui->rmm1_edit->text());
+        _tandem_params.setParamLabelValue("residue, modification mass 2", ui->rmm2_edit->text());
+        _tandem_params.setParamLabelValue("residue, potential modification mass", ui->rpmm_edit->text());
+        _tandem_params.setParamLabelValue("residue, potential modification mass 1", ui->rpmm1_edit->text());
+        _tandem_params.setParamLabelValue("residue, potential modification mass 2", ui->rpmm2_edit->text());
+        _tandem_params.setParamLabelValue("residue, potential modification motif", ui->rpmmotif_edit->text());
+        _tandem_params.setParamLabelValue("residue, potential modification motif 1", ui->rpmmotif1_edit->text());
+        _tandem_params.setParamLabelValue("residue, potential modification motif 2", ui->rpmmotif2_edit->text());
+
     }
     catch (pappso::PappsoException & error) {
         QMessageBox::warning(this,tr("Error in parameters :"), error.qwhat());
@@ -453,6 +476,28 @@ void EditTandemPresetDialog::populate() {
     //<note type="input" label="protein, modified residue mass file"></note>
     ui->pmrmf_edit->setText(_tandem_params.getValue("protein, modified residue mass file"));
 
+    //<note type="input" label="residue, modification mass">57.02146@C</note>
+    ui->rmm_edit->setText(_tandem_params.getValue("residue, modification mass"));
+
+    //<note type="input" label="residue, modification mass 1"></note>
+    ui->rmm1_edit->setText(_tandem_params.getValue("residue, modification mass 1"));
+    //<note type="input" label="residue, modification mass 2"></note>
+    ui->rmm2_edit->setText(_tandem_params.getValue("residue, modification mass 2"));
+
+
+    //<note type="input" label="residue, potential modification mass">15.99491@M</note>
+    ui->rpmm_edit->setText(_tandem_params.getValue("residue, potential modification mass"));
+    //<note type="input" label="residue, potential modification mass 1"></note>
+    ui->rpmm1_edit->setText(_tandem_params.getValue("residue, potential modification mass 1"));
+    //<note type="input" label="residue, potential modification mass 2"></note>
+    ui->rpmm2_edit->setText(_tandem_params.getValue("residue, potential modification mass 2"));
+    //<note type="input" label="residue, potential modification motif"></note>
+    ui->rpmmotif_edit->setText(_tandem_params.getValue("residue, potential modification motif"));
+    //<note type="input" label="residue, potential modification motif 1"></note>
+    ui->rpmmotif1_edit->setText(_tandem_params.getValue("residue, potential modification motif 1"));
+    //<note type="input" label="residue, potential modification motif 2"></note>
+    ui->rpmmotif2_edit->setText(_tandem_params.getValue("residue, potential modification motif 2"));
+
     qDebug() << "EditTandemPresetDialog::populate end";
 }
 
-- 
GitLab