mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-17 22:46:16 +00:00
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>
This commit is contained in:
parent
c9535b6547
commit
2b19341609
4 changed files with 0 additions and 52 deletions
|
@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue