diff options
author | Cristine Guadelupe <cristineguadelupe@me.com> | 2015-01-13 02:03:49 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-01-14 12:24:57 +1300 |
commit | 2b193416090f3ca9795513d94028557c96aed0b4 (patch) | |
tree | 7cda9150c7dd51f1e6aee5afbef1f6b246e4baae /qt-ui/profile | |
parent | c9535b6547c60afdb89db0822608cd7a44b3f50e (diff) | |
download | subsurface-2b193416090f3ca9795513d94028557c96aed0b4.tar.gz |
Remove instantMeanDepthLine
Take instantMeanDepthLine out of the code. We have the moving average line
plus the exact data in the information overlay.
Signed-off-by: Cristine Guadelupe <cristineguadelupe@me.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile')
-rw-r--r-- | qt-ui/profile/diveprofileitem.cpp | 20 | ||||
-rw-r--r-- | qt-ui/profile/diveprofileitem.h | 11 | ||||
-rw-r--r-- | qt-ui/profile/profilewidget2.cpp | 17 | ||||
-rw-r--r-- | qt-ui/profile/profilewidget2.h | 4 |
4 files changed, 0 insertions, 52 deletions
diff --git a/qt-ui/profile/diveprofileitem.cpp b/qt-ui/profile/diveprofileitem.cpp index 60a030bb0..7531b2acb 100644 --- a/qt-ui/profile/diveprofileitem.cpp +++ b/qt-ui/profile/diveprofileitem.cpp @@ -977,23 +977,3 @@ void PartialPressureGasItem::setColors(const QColor &normal, const QColor &alert normalColor = normal; alertColor = alert; } - -InstantMeanDepthLine::InstantMeanDepthLine() : hAxis(NULL), vAxis(NULL) -{ -} - -void InstantMeanDepthLine::mouseMoved(int time, int depth) -{ - if (model == NULL || scene() == NULL || vAxis == NULL || hAxis == NULL) - return; - - int count = model->data().nr; - for (int i = 0; i < count; i++) { - struct plot_data pI = model->data().entry[i]; - if (pI.sec == time && pI.sec != 0) { - setMeanDepth(pI.running_sum / time); - setLine(0, 0, hAxis->posAtValue(time), 0); - setPos(pos().x(), vAxis->posAtValue(pI.running_sum / time)); - } - } -} diff --git a/qt-ui/profile/diveprofileitem.h b/qt-ui/profile/diveprofileitem.h index b0693cd93..096c1a3ce 100644 --- a/qt-ui/profile/diveprofileitem.h +++ b/qt-ui/profile/diveprofileitem.h @@ -223,17 +223,6 @@ protected: DivePlotDataModel *model; }; -class InstantMeanDepthLine : public MeanDepthLine { - Q_OBJECT -public: - DiveCartesianAxis *hAxis; - DiveCartesianAxis *vAxis; - InstantMeanDepthLine(); -public -slots: - void mouseMoved(int time, int depth); -}; - class PartialPressureGasItem : public AbstractProfilePolygonItem { Q_OBJECT public: diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index f24e17d6f..87339e2f1 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -103,7 +103,6 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) : QGraphicsView(parent), mouseFollowerHorizontal(new DiveLineItem()), rulerItem(new RulerItem2()), tankItem(new TankItem()), - instantMeanDepth(new InstantMeanDepthLine()), isGrayscale(false), printMode(false), shouldCalculateMaxTime(true), @@ -118,7 +117,6 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) : QGraphicsView(parent), addItemsToScene(); scene()->installEventFilter(this); connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), this, SLOT(settingsChanged())); - connect(this, SIGNAL(mouseMoved(int, int)), instantMeanDepth, SLOT(mouseMoved(int, int))); QAction *action = NULL; #define ADD_ACTION(SHORTCUT, Slot) \ action = new QAction(this); \ @@ -173,7 +171,6 @@ ProfileWidget2::~ProfileWidget2() delete mouseFollowerHorizontal; delete rulerItem; delete tankItem; - delete instantMeanDepth; } #define SUBSURFACE_OBJ_DATA 1 @@ -213,7 +210,6 @@ void ProfileWidget2::addItemsToScene() scene()->addItem(tankItem); scene()->addItem(mouseFollowerHorizontal); scene()->addItem(mouseFollowerVertical); - scene()->addItem(instantMeanDepth); QPen pen(QColor(Qt::red).lighter()); pen.setWidth(0); mouseFollowerHorizontal->setPen(pen); @@ -274,12 +270,6 @@ void ProfileWidget2::setupItemOnScene() cylinderPressureAxis->setTickInterval(30000); - instantMeanDepth->setLine(0, 0, 96, 0); - instantMeanDepth->setX(3); - instantMeanDepth->setPen(QPen(QBrush(Qt::red), 0, Qt::SolidLine)); - instantMeanDepth->setZValue(1); - instantMeanDepth->setAxis(profileYAxis); - diveComputerText->setAlignment(Qt::AlignRight | Qt::AlignTop); diveComputerText->setBrush(getColor(TIME_TEXT, isGrayscale)); @@ -605,11 +595,6 @@ void ProfileWidget2::plotDive(struct dive *d, bool force) rulerItem->setPlotInfo(plotInfo); tankItem->setData(dataModel, &plotInfo, &displayed_dive); - instantMeanDepth->vAxis = profileYAxis; - instantMeanDepth->hAxis = timeAxis; - instantMeanDepth->setVisible(prefs.show_average_depth && !printMode); - instantMeanDepth->setModel(dataModel); - dataModel->emitDataChanged(); // The event items are a bit special since we don't know how many events are going to // exist on a dive, so I cant create cache items for that. that's why they are here @@ -847,8 +832,6 @@ void ProfileWidget2::mouseMoveEvent(QMouseEvent *event) if (timeAxis->maximum() >= hValue && timeAxis->minimum() <= hValue) { mouseFollowerVertical->setPos(pos.x(), profileYAxis->line().y1()); } - if (timeAxis->maximum() >= hValue && timeAxis->minimum() <= hValue && profileYAxis->maximum() >= vValue && profileYAxis->minimum() <= vValue) - emit mouseMoved(hValue, vValue); } bool ProfileWidget2::eventFilter(QObject *object, QEvent *event) diff --git a/qt-ui/profile/profilewidget2.h b/qt-ui/profile/profilewidget2.h index ffeecb3ee..675fa88b3 100644 --- a/qt-ui/profile/profilewidget2.h +++ b/qt-ui/profile/profilewidget2.h @@ -85,9 +85,6 @@ public: void clearHandlers(); State currentState; -signals: - void mouseMoved(int time, int depth); - public slots: // Necessary to call from QAction's signals. void settingsChanged(); @@ -185,7 +182,6 @@ private: DiveLineItem *mouseFollowerHorizontal; RulerItem2 *rulerItem; TankItem *tankItem; - InstantMeanDepthLine *instantMeanDepth; bool isGrayscale; bool printMode; |