Index: /trunk/BNC/src/rinex/availplot.cpp
===================================================================
--- /trunk/BNC/src/rinex/availplot.cpp	(revision 4609)
+++ /trunk/BNC/src/rinex/availplot.cpp	(revision 4610)
@@ -1,6 +1,6 @@
 
-#include <qwt_plot_curve.h>
 #include <qwt_scale_draw.h>
 #include <qwt_text.h>
+#include <qwt_legend.h>
 
 #include "availplot.h"
@@ -57,4 +57,9 @@
   QwtSymbol* symbolBlue  = new QwtSymbol(QwtSymbol::Rect, QBrush(blue),
                                          QPen(blue), QSize(1,1));
+
+  // Legend
+  // ------
+  QwtLegend* legend = new QwtLegend;
+  insertLegend(legend, QwtPlot::RightLegend);
  
   // Curves
@@ -77,5 +82,6 @@
       const QVector<double>& xData = availData._L1ok;
       QVector<double>        yData(xData.size(), double(iC)+eps);
-      addCurve(prn, symbolGreen, xData, yData);
+      QwtPlotCurve* curve = addCurve(prn, symbolGreen, xData, yData);
+      curve->setItemAttribute(QwtPlotItem::Legend, false);
     }
 
@@ -85,5 +91,6 @@
       const QVector<double>& xData = availData._L2ok;
       QVector<double>        yData(xData.size(), double(iC)-eps);
-      addCurve(prn, symbolGreen, xData, yData);
+      QwtPlotCurve* curve = addCurve(prn, symbolGreen, xData, yData);
+      curve->setItemAttribute(QwtPlotItem::Legend, false);
     }
 
@@ -93,5 +100,6 @@
       const QVector<double>& xData = availData._L1gap;
       QVector<double>        yData(xData.size(), double(iC)+eps);
-      addCurve(prn, symbolBlue, xData, yData);
+      QwtPlotCurve* curve = addCurve(prn, symbolBlue, xData, yData);
+      curve->setItemAttribute(QwtPlotItem::Legend, false);
     }
 
@@ -101,5 +109,6 @@
       const QVector<double>& xData = availData._L2gap;
       QVector<double>        yData(xData.size(), double(iC)-eps);
-      addCurve(prn, symbolBlue, xData, yData);
+      QwtPlotCurve* curve = addCurve(prn, symbolBlue, xData, yData);
+      curve->setItemAttribute(QwtPlotItem::Legend, false);
     }
 
@@ -109,5 +118,6 @@
       const QVector<double>& xData = availData._L1slip;
       QVector<double>        yData(xData.size(), double(iC)+eps);
-      addCurve(prn, symbolRed, xData, yData);
+      QwtPlotCurve* curve = addCurve(prn, symbolRed, xData, yData);
+      curve->setItemAttribute(QwtPlotItem::Legend, false);
     }
 
@@ -117,5 +127,6 @@
       const QVector<double>& xData = availData._L2slip;
       QVector<double>        yData(xData.size(), double(iC)-eps);
-      addCurve(prn, symbolRed, xData, yData);
+      QwtPlotCurve* curve = addCurve(prn, symbolRed, xData, yData);
+      curve->setItemAttribute(QwtPlotItem::Legend, false);
     }
   }
@@ -138,7 +149,8 @@
 // Add Curve
 //////////////////////////////////////////////////////////////////////////////
-void t_availPlot::addCurve(const QString& name, const QwtSymbol* symbol,
-                           const QVector<double>& xData,
-                           const QVector<double>& yData) {
+QwtPlotCurve* t_availPlot::addCurve(const QString& name, 
+                                    const QwtSymbol* symbol,
+                                    const QVector<double>& xData,
+                                    const QVector<double>& yData) {
   QwtPlotCurve* curve = new QwtPlotCurve(name);
   curve->setSymbol(symbol);
@@ -148,3 +160,4 @@
   curve->setSamples(xData, yData);
   curve->attach(this);
+  return curve;
 }
Index: /trunk/BNC/src/rinex/availplot.h
===================================================================
--- /trunk/BNC/src/rinex/availplot.h	(revision 4609)
+++ /trunk/BNC/src/rinex/availplot.h	(revision 4610)
@@ -5,4 +5,5 @@
 #include <qwt_plot.h>
 #include <qwt_symbol.h>
+#include <qwt_plot_curve.h>
 
 class t_availData;
@@ -15,6 +16,7 @@
 
 private:
-  void addCurve(const QString& name, const QwtSymbol* symbol,
-                const QVector<double>& xData, const QVector<double>& yData);
+  QwtPlotCurve* addCurve(const QString& name, const QwtSymbol* symbol,
+                         const QVector<double>& xData, 
+                         const QVector<double>& yData);
 };
 
