Index: /branches/BNC_2.12/src/bnchelp.html
===================================================================
--- /branches/BNC_2.12/src/bnchelp.html	(revision 7982)
+++ /branches/BNC_2.12/src/bnchelp.html	(revision 7983)
@@ -1532,5 +1532,18 @@
 </p>
 <p>
-Default 'Signal priority' list is an empty option string, meaning a priority sequence of 'CWPX_?' attributes when mapping RINEX 3 to RINEX 2. The meaning of this sequence of characters - take it as an example - is as follows:
+Signal priorities can be specified as equal for all systems, as system specific or as system and frequency specific. For example:</li>
+<ul>
+<li>'CWPX_?' (General signal priorities valid for all GNSS)</li>
+<li>'C:IQX I:ABCX' (System specific signal priorities for BDS and IRNSS)</li>
+<li>'G:12&PWCSLXYN G:5&IQX R:12&PC R:3&IQX' (System and frequency specific signal priorities)</li>
+</ul>
+</p>
+<p>
+The default 'Signal priority' list is defined as follows: 
+<ul>
+ <li>'G:12&PWCSLXYN G:5&IQX R:12&PC R:3&IQX E:16&BCX E:578&IQX J:1&SLXCZ J:26&SLX J:5&IQX C:IQX I:ABCX S:1&C S:5&IQX'</li>
+</ul>
+
+As an example the 'Signal priority' of 'CWPX_?' is explained in more detail: 
 <ul>
 <li>Signals with attribute 'C' enjoy the highest priority. If such a Version 3 observation becomes available, it is presented as RINEX Version 2 observation if that is the format you wish to see. Observations with other attributes are being ignored.</li>
@@ -1541,12 +1554,4 @@
 </p>
 
-<p>
-Signal priorities can be specified either as equal for all systems or system specific. The following are example priority strings:</li>
-<ul>
-<li>CWPX_? (Same signal priorities valid for all systems)</li>
-<li>G:CWPX_? R:PCX_? E:CPX_? (Specific signal priorities for GPS, GLONASS and Galileo system)</li>
-</ul>
-
-</p>
 <p>
 You may like to specify your own 'Signal priority' string(s) for producing RINEX Version 2 files. If you neither convert observation streams to RINEX Version 2 nor concatenate RINEX Version 3 to Version 2 files, then the 'Version 2' option is meaningless.
Index: /branches/BNC_2.12/src/bncmain.cpp
===================================================================
--- /branches/BNC_2.12/src/bncmain.cpp	(revision 7982)
+++ /branches/BNC_2.12/src/bncmain.cpp	(revision 7983)
@@ -107,5 +107,5 @@
       "   rnxOnlyWithSKL {Using RINEX skeleton file is mandatory [integer number: 0=no,2=yes]}\n"
       "   rnxScript      {File upload script, full path [character string]}\n"
-      "   rnxV2Priority  {Priority of signal attributes [character string, list separated by blank character, example: G:CWPX_? R:CP]}\n"
+      "   rnxV2Priority  {Priority of signal attributes [character string, list separated by blank character, example: G:12&PWCSLXYN G:5&IQX C:IQX]}\n"
       "   rnxV3          {Produce version 3 file contents [integer number: 0=no,2=yes]}\n"
       "   rnxV3filenames {Produce version 3 filenames [integer number: 0=no,2=yes]}\n"
@@ -130,5 +130,5 @@
       "   reqcRnxVersion        {RINEX version [integer number: 2|3]}\n"
       "   reqcSampling          {RINEX output file sampling rate [integer number of seconds: 0|5|10|15|20|25|30|35|40|45|50|55|60]}\n"
-      "   reqcV2Priority        {Version 2 priority of signal attributes [character string, list separated by blank character, example: G:CWPX_? R:CP]}\n"
+      "   reqcV2Priority        {Version 2 priority of signal attributes [character string, list separated by blank character, example: G:12&PWCSLXYN G:5&IQX C:IQX]}\n"
       "   reqcStartDateTime     {Start time [character string, example: 1967-11-02T00:00:00]}\n"
       "   reqcEndDateTime       {Stop time [character string, example: 2099-01-01T00:00:00 }\n"
Index: /branches/BNC_2.12/src/bncsettings.cpp
===================================================================
--- /branches/BNC_2.12/src/bncsettings.cpp	(revision 7982)
+++ /branches/BNC_2.12/src/bncsettings.cpp	(revision 7983)
@@ -134,5 +134,5 @@
     setValue_p("reqcOldReceiverNumber", "");
     setValue_p("reqcUseObsTypes",     "");
-    setValue_p("reqcV2Priority",      "");
+    setValue_p("reqcV2Priority",      "G:12&PWCSLXYN G:5&IQX R:12&PC R:3&IQX E:16&BCX E:578&IQX J:1&SLXCZ J:26&SLX J:5&IQX C:IQX I:ABCX S:1&C S:5&IQX");
     // SP3
     setValue_p("sp3CompFile",         "");
Index: /branches/BNC_2.12/src/bncwindow.cpp
===================================================================
--- /branches/BNC_2.12/src/bncwindow.cpp	(revision 7982)
+++ /branches/BNC_2.12/src/bncwindow.cpp	(revision 7983)
@@ -223,5 +223,5 @@
   QString hlp = settings.value("rnxV2Priority").toString();
   if (hlp.isEmpty()) {
-    hlp = "CWPX_?";
+    hlp = "G:12&PWCSLXYN G:5&IQX R:12&PC R:3&IQX E:16&BCX E:578&IQX J:1&SLXCZ J:26&SLX J:5&IQX C:IQX I:ABCX S:1&C S:5&IQX";
   }
   _rnxV2Priority = new QLineEdit(hlp);
@@ -681,6 +681,4 @@
   _rnxSamplSpinBox->setMaximumWidth(9*ww);
 
-  _rnxV2Priority->setMaximumWidth(19*ww);
-
   oLayout->addWidget(new QLabel("Saving RINEX observation files.<br>"),0, 0, 1,50);
   oLayout->addWidget(new QLabel("Directory"),                      1, 0);
@@ -696,7 +694,6 @@
   oLayout->addWidget(new QLabel("Script (full path)"),             4, 0);
   oLayout->addWidget(_rnxScrpLineEdit,                             4, 1, 1, 15);
-  oLayout->addWidget(new QLabel("Version 2"),                      5, 0);
-  oLayout->addWidget(_rnxV2Priority,                               5, 1);
-  oLayout->addWidget(new QLabel("Signal priority"),                5, 2);
+  oLayout->addWidget(new QLabel("Version 2 signal priority"),      5, 0);
+  oLayout->addWidget(_rnxV2Priority,                               5, 1, 1, 15);
   oLayout->addWidget(new QLabel("Version 3"),                      6, 0);
   oLayout->addWidget(_rnxV3CheckBox,                               6, 1);
@@ -1252,5 +1249,5 @@
   _rnxFileCheckBox->setWhatsThis(tr("<p>Tick check box 'Skeleton mandatory' in case you want that RINEX files are only produced if skeleton files are available for BNC. If no skeleton file is available for a particular source then no RINEX Observation file will be produced from the affected stream.</p><p>Note that a skeleton file contains RINEX header information such as receiver and antenna types. In case of stream conversion to RINEX Version 3, a skeleton file should also contain information on potentially available observation types. A missing skeleton file will therefore enforce BNC to only save a default set of RINEX 3 observation types.</p>"));
   _rnxScrpLineEdit->setWhatsThis(tr("<p>Whenever a RINEX Observation file is finally saved, you may want to compress, copy or upload it immediately, for example via FTP. BNC allows you to execute a script/batch file to carry out such operation.</p><p>Specify the full path of a script or batch file. BNC will pass the full RINEX Observation file path to the script as command line parameter (%1 on Windows systems, $1 on Unix/Linux/Mac systems).</p>"));
-  _rnxV2Priority->setWhatsThis(tr("<p>Specify a priority list of characters defining signal attributes as defined in RINEX Version 3. Priorities will be used to map observations with RINEX Version 3 attributes from incoming streams to Version 2. The underscore character '_' stands for undefined attributes. A question mark '?' can be used as wildcard which represents any one character.</p><p>Signal priorities can be specified either as equal for all systems or as system specific. The following are example priority strings:</li><ul><li>'CWPX_?' (Same signal priorities valid for all systems)</li><li>'G:CWPX_? R:PCX_? E:CPX_?' (Specific signal priorities for GPS, GLONASS and Galileo system)</li></ul>Default is priority list 'CWPX_?'.</p>"));
+  _rnxV2Priority->setWhatsThis(tr("<p>Specify a priority list of characters defining signal attributes as defined in RINEX Version 3. Priorities will be used to map observations with RINEX Version 3 attributes from incoming streams to Version 2. The underscore character '_' stands for undefined attributes. A question mark '?' can be used as wildcard which represents any one character.</p><p>Signal priorities can be specified as equal for all systems, as system specific or as system and freq. specific. For example: </li><ul><li>'CWPX_?' (General signal priorities valid for all GNSS) </li><li>'C:IQX I:ABCX' (System specific signal priorities for BDS and IRNSS) </li><li>'G:12&PWCSLXYN G:5&IQX R:12&PC R:3&IQX' (System and frequency specific signal priorities) </li></ul>Default is the following priority list 'G:12&PWCSLXYN G:5&IQX R:12&PC R:3&IQX E:16&BCX E:578&IQX J:1&SLXCZ J:26&SLX J:5&IQX C:IQX I:ABCX S:1&C S:5&IQX'.</p>"));
   _rnxV3CheckBox->setWhatsThis(tr("<p>The default format for RINEX Observation files is RINEX Version 2.</p><p>Select 'Version 3' if you want to save observations in RINEX Version 3 format.</p>"));
   _rnxV3filenameCheckBox->setWhatsThis(tr("<p>Tick 'Version 3 filenames' to let BNC create so-called extended filenames following the RINEX Version 3 standard.</p><p>Default is an empty check box, meaning to create filenames following the RINEX Version 2 standard although the file content is saved in RINEX Version 3 format.</p>"));
Index: /branches/BNC_2.12/src/reqcdlg.cpp
===================================================================
--- /branches/BNC_2.12/src/reqcdlg.cpp	(revision 7982)
+++ /branches/BNC_2.12/src/reqcdlg.cpp	(revision 7983)
@@ -138,5 +138,5 @@
   QString hlp = settings.value("reqcV2Priority").toString();
   if (hlp.isEmpty()) {
-    hlp = "CWPX_?";
+    hlp = "G:12&PWCSLXYN G:5&IQX R:12&PC R:3&IQX E:16&BCX E:578&IQX J:1&SLXCZ J:26&SLX J:5&IQX C:IQX I:ABCX S:1&C S:5&IQX";
   }
   _reqcV2Priority = new QLineEdit(hlp);
@@ -152,6 +152,6 @@
   grid->addWidget(_reqcSampling,                  ir, 4);
   ++ir;
-  grid->addWidget(new QLabel("Version 2 Signal Priority"), ir, 1);
-  grid->addWidget(_reqcV2Priority,                ir, 2);
+  grid->addWidget(new QLabel("Version 2 signal priority"),  ir, 1);
+  grid->addWidget(_reqcV2Priority,                          ir, 2, 1, 4);
   ++ir;
   grid->addWidget(new QLabel("Start"),            ir, 1);
@@ -232,5 +232,5 @@
   _reqcRnxVersion->setWhatsThis(tr("<p>Select version number of emerging new RINEX file.</p><p>Note the following:</p><p>When converting <u>RINEX Version 2 to Version 3 </u>Observation files, the tracking mode or channel information (signal attribute, see RINEX Version 3 documentation) in the (last out of the three characters) observation code is left blank if unknown.</p><p>When converting <u>RINEX Version 3 to Version 2</u>, the mapping of observations follows a 'Signal priority list' with signal attributes as defined in RINEX Version 3.</p>")); 
   _reqcSampling->setWhatsThis(tr("<p>Select sampling rate of emerging new RINEX Observation file.</p><p>'0 sec' means that observations from all epochs in the RINEX input file will become part of the RINEX output file.</p>"));
-  _reqcV2Priority->setWhatsThis(tr("<p>Specify a priority list of characters defining signal attributes as defined in RINEX Version 3. Priorities will be used in post processing mode to map RINEX Version 3 observation files to Version 2. The underscore character '_' stands for undefined attributes. The question mark '?' can be used as wildcard which represents any one character.</p><p>Signal priorities can be specified either as equal for all systems or as system specifics. The following are example priority strings:</li><ul><li>'CWPX_?' (Same signal priorities valid for all systems)</li><li>'G:CWPX_? R:PCX_? E:CPX_?' (Specific signal priorities for GPS, GLONASS and Galileo system)</li></ul>Default is priority list 'CWPX_?'.</p>"));
+  _reqcV2Priority->setWhatsThis(tr("<p>Specify a priority list of characters defining signal attributes as defined in RINEX Version 3. Priorities will be used to map observations with RINEX Version 3 attributes from incoming streams to Version 2. The underscore character '_' stands for undefined attributes. A question mark '?' can be used as wildcard which represents any one character.</p><p>Signal priorities can be specified as equal for all systems, as system specific or as system and freq. specific. For example: </li><ul><li>'CWPX_?' (General signal priorities valid for all GNSS) </li><li>'C:IQX I:ABCX' (System specific signal priorities for BDS and IRNSS) </li><li>'G:12&PWCSLXYN G:5&IQX R:12&PC R:3&IQX' (System and frequency specific signal priorities) </li></ul>Default is the following priority list 'G:12&PWCSLXYN G:5&IQX R:12&PC R:3&IQX E:16&BCX E:578&IQX J:1&SLXCZ J:26&SLX J:5&IQX C:IQX I:ABCX S:1&C S:5&IQX'.</p>"));
   _reqcStartDateTime->setWhatsThis(tr("<p>Specify begin of emerging new RINEX Observation file.</p>"));
   _reqcEndDateTime->setWhatsThis(tr("<p>Specify end of emerging new RINEX Observation file.</p>"));
Index: /branches/BNC_2.12/src/rinex/reqcedit.cpp
===================================================================
--- /branches/BNC_2.12/src/rinex/reqcedit.cpp	(revision 7982)
+++ /branches/BNC_2.12/src/rinex/reqcedit.cpp	(revision 7983)
@@ -643,31 +643,41 @@
   int key = 0;
   QString systems = obsFile->header().usedSystems();
-  QString comment = QString("RINEX 3 => 2 CONVERSION DETAILS:");
+  QString comment = QString("Signal priorities for RINEX 3 => 2 conversion:");
   QString commentKey = QString("COMMENT %1").arg(key, 3, 10, QChar('0'));
   txtMap.insert(commentKey, comment);
 
   for(int ii = 0; ii < obsFile->numSys(); ii++) {
-    key++;
     char sys = systems[ii].toAscii();
-    QString preferredAttrib = obsFile->signalPriorities(sys);
-    comment = QString("%1: Signal priority = %2").arg(sys).arg(preferredAttrib);
-    commentKey = QString("COMMENT %1").arg(key, 3, 10, QChar('0'));
     txtMap.insert(commentKey, comment);
+    QMap <char, QString>  signalPriorityMap;
+    QStringList preferredAttribListSys = obsFile->signalPriorities(sys);
     QStringList types = obsFile->header().obsTypes(sys);
     for (int jj = 0; jj < types.size(); jj++) {
-      key++;
       QString inType = types[jj];
-      for (int iPref = 0; iPref < preferredAttrib.length(); iPref++) {
-        if (preferredAttrib[iPref] == '?'                             ||
-            (inType.length() == 2 && preferredAttrib[iPref] == '_'    ) ||
-            (inType.length() == 3 && preferredAttrib[iPref] == inType[2]) ) {
-          QString outType = t_rnxObsFile::type3to2(sys, inType);
-          comment = QString("%1: %2 => %3").arg(sys).arg(inType).arg(outType);
-          commentKey = QString("COMMENT %1").arg(key, 3, 10, QChar('0'));
-          txtMap.insert(commentKey, comment);
-          break;
-        }
-      }
-    }
-  }
-}
+      char band = inType[1].toAscii();
+      for (int ii = 0; ii < preferredAttribListSys.size(); ii++) {
+        QString preferredAttrib;
+        if (preferredAttribListSys[ii].indexOf("&") != -1) {
+          QStringList hlp = preferredAttribListSys[ii].split("&", QString::SkipEmptyParts);
+          if (hlp.size() == 2 && hlp[0].contains(band)) {
+            preferredAttrib = hlp[1];
+          }
+        }
+        else {
+          preferredAttrib = preferredAttribListSys[ii];
+        }
+        if (!signalPriorityMap.contains(band) && !preferredAttrib.isEmpty()){
+          signalPriorityMap[band] = preferredAttrib;
+        }
+      }
+    }
+    QMapIterator<char, QString> it(signalPriorityMap);
+    while (it.hasNext()) {
+        it.next();
+        key++;
+        comment = QString("%1 band %2: %3").arg(sys).arg(it.key()).arg(it.value());
+        commentKey = QString("COMMENT %1").arg(key, 3, 10, QChar('0'));
+        txtMap.insert(commentKey, comment);
+    }
+  }
+}
Index: /branches/BNC_2.12/src/rinex/rnxobsfile.cpp
===================================================================
--- /branches/BNC_2.12/src/rinex/rnxobsfile.cpp	(revision 7982)
+++ /branches/BNC_2.12/src/rinex/rnxobsfile.cpp	(revision 7983)
@@ -1273,5 +1273,4 @@
   }
 }
-
 // Write Data Epoch (RINEX Version 2)
 ////////////////////////////////////////////////////////////////////////////
@@ -1303,9 +1302,8 @@
   }
   *stream << endl;
+  
   for (unsigned iSat = 0; iSat < epo->rnxSat.size(); iSat++) {
-
     const t_rnxSat& rnxSat = epo->rnxSat[iSat];
     char            sys    = rnxSat.prn.system();
-
     for (int iTypeV2 = 0; iTypeV2 < header.nTypes(sys); iTypeV2++) {
       if (iTypeV2 > 0 && iTypeV2 % 5 == 0) {
@@ -1314,7 +1312,19 @@
       QString typeV2 = header.obsType(sys, iTypeV2);
       bool    found  = false;
-
-      QString preferredAttrib = signalPriorities(sys);
-      for (int iPref = 0; iPref < preferredAttrib.length(); iPref++) {
+      QStringList preferredAttribList = signalPriorities(sys);
+      QString preferredAttrib;
+      for (int ii = 0; ii < preferredAttribList.size(); ii++) {
+        if (preferredAttribList[ii].indexOf("&") != -1) {
+          QStringList hlp = preferredAttribList[ii].split("&", QString::SkipEmptyParts);
+          if (hlp.size() == 2 && hlp[0].contains(typeV2[1])) {
+            preferredAttrib = hlp[1];
+          }
+        }
+        else {
+          preferredAttrib = preferredAttribList[ii];
+        }
+      }
+
+      for (int iPref = 0; iPref < preferredAttribList.size(); iPref++) {
         QMapIterator<QString, t_rnxObs> itObs(rnxSat.obs);
         while (itObs.hasNext()) {
@@ -1358,4 +1368,5 @@
 }
 
+
 // Write Data Epoch (RINEX Version 3)
 ////////////////////////////////////////////////////////////////////////////
@@ -1545,8 +1556,8 @@
 // Tracking Mode Priorities
 ////////////////////////////////////////////////////////////////////////////
-QString t_rnxObsFile::signalPriorities(char sys) {
+QStringList t_rnxObsFile::signalPriorities(char sys) {
 
   bncSettings settings;
-
+  
   QStringList priorList;
   QString reqcAction = settings.value("reqcAction").toString();
@@ -1555,5 +1566,5 @@
   // ---------------------------------------------------
   if (reqcAction == "Edit/Concatenate") {
-  priorList = settings.value("reqcV2Priority").toString().split(" ", QString::SkipEmptyParts);
+    priorList = settings.value("reqcV2Priority").toString().split(" ", QString::SkipEmptyParts);
   }
 
@@ -1561,25 +1572,45 @@
   // ----------------------------
   else {
-  priorList = settings.value("rnxV2Priority").toString().split(" ", QString::SkipEmptyParts);
-  }
-
-  if (priorList.empty()) {
-    priorList << "CWPX_?";
-  }
-
-  QString result;
+    priorList = settings.value("rnxV2Priority").toString().split(" ", QString::SkipEmptyParts);
+  }
+
+  QStringList result;
   for (int ii = 0; ii < priorList.size(); ii++) {
     if (priorList[ii].indexOf(":") != -1) {
       QStringList hlp = priorList[ii].split(":", QString::SkipEmptyParts);
       if (hlp.size() == 2 && hlp[0].length() == 1 && hlp[0][0] == sys) {
-        result = hlp[1];
+        result.append(hlp[1]);
+      }
+    }
+    else {
+      result.append(priorList[ii]);
+    }
+  }
+
+  if (result.empty()) {
+    switch (sys) {
+      case 'G':
+        result << "G:12&PWCSLXYN G:5&IQX";
         break;
-      }
-    }
-    else {
-      result = priorList[ii];
-    }
-  }
-
+      case 'R':
+        result << "R:12&PC R:3&IQX";
+        break;
+      case 'E':
+        result << "E:16&BCX E:578&IQX";
+        break;
+      case 'J':
+        result << "J:1&SLXCZ J:26&SLX J:5&IQX";
+        break;
+      case 'C':
+        result << "C:IQX";
+        break;
+      case 'I':
+        result << "I:ABCX";
+        break;
+      case 'S':
+        result << "S:1&C S:5&IQX";
+        break;
+    }
+  }
   return result;
 }
Index: /branches/BNC_2.12/src/rinex/rnxobsfile.h
===================================================================
--- /branches/BNC_2.12/src/rinex/rnxobsfile.h	(revision 7982)
+++ /branches/BNC_2.12/src/rinex/rnxobsfile.h	(revision 7983)
@@ -207,5 +207,5 @@
   static QString type2to3(char sys, const QString& typeV2);
   static QString type3to2(char sys, const QString& typeV3);
-  static QString signalPriorities(char sys);
+  static QStringList signalPriorities(char sys);
 
   static void writeEpoch(QTextStream* stream, const t_rnxObsHeader& header, const t_rnxEpo* epo) {
