From f9ceff009b35f73dec6d13f4037119172f6cf0de Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 17 Jan 2015 22:43:52 +1300 Subject: Clean up the header files Lots and lots and lots of header files were being included without being needed. This attempts to clean some of that crud up. Signed-off-by: Dirk Hohndel --- qt-ui/profile/animationfunctions.cpp | 2 -- qt-ui/profile/divecartesianaxis.cpp | 7 ------- qt-ui/profile/diveeventitem.cpp | 3 --- qt-ui/profile/divelineitem.cpp | 2 -- qt-ui/profile/divepixmapitem.cpp | 5 ----- qt-ui/profile/diveplotdatamodel.cpp | 2 -- qt-ui/profile/diveprofileitem.cpp | 9 --------- qt-ui/profile/divetextitem.cpp | 9 --------- qt-ui/profile/divetooltipitem.cpp | 6 ------ qt-ui/profile/profilewidget2.cpp | 11 ----------- qt-ui/profile/ruleritem.cpp | 11 ----------- qt-ui/profile/tankitem.cpp | 2 -- 12 files changed, 69 deletions(-) (limited to 'qt-ui/profile') diff --git a/qt-ui/profile/animationfunctions.cpp b/qt-ui/profile/animationfunctions.cpp index fb1c85f8d..a19d50c9d 100644 --- a/qt-ui/profile/animationfunctions.cpp +++ b/qt-ui/profile/animationfunctions.cpp @@ -1,8 +1,6 @@ #include "animationfunctions.h" -#include "dive.h" #include "pref.h" #include -#include namespace Animations { diff --git a/qt-ui/profile/divecartesianaxis.cpp b/qt-ui/profile/divecartesianaxis.cpp index aaa85c634..467a8b978 100644 --- a/qt-ui/profile/divecartesianaxis.cpp +++ b/qt-ui/profile/divecartesianaxis.cpp @@ -1,17 +1,10 @@ #include "divecartesianaxis.h" -#include "divelineitem.h" #include "divetextitem.h" #include "helpers.h" #include "preferences.h" #include "diveplotdatamodel.h" #include "animationfunctions.h" #include "mainwindow.h" -#include -#include -#include -#include -#include -#include static QPen gridPen() { diff --git a/qt-ui/profile/diveeventitem.cpp b/qt-ui/profile/diveeventitem.cpp index 1a5e29dda..2ec842179 100644 --- a/qt-ui/profile/diveeventitem.cpp +++ b/qt-ui/profile/diveeventitem.cpp @@ -3,10 +3,7 @@ #include "divecartesianaxis.h" #include "animationfunctions.h" #include "libdivecomputer.h" -#include "dive.h" -#include "planner.h" #include "profile.h" -#include #include "gettextfromc.h" #include "metrics.h" diff --git a/qt-ui/profile/divelineitem.cpp b/qt-ui/profile/divelineitem.cpp index 863cd6218..f9e288a44 100644 --- a/qt-ui/profile/divelineitem.cpp +++ b/qt-ui/profile/divelineitem.cpp @@ -1,6 +1,4 @@ #include "divelineitem.h" -#include "animationfunctions.h" -#include DiveLineItem::DiveLineItem(QGraphicsItem *parent) : QGraphicsLineItem(parent) { diff --git a/qt-ui/profile/divepixmapitem.cpp b/qt-ui/profile/divepixmapitem.cpp index 8aff5315d..c9129761e 100644 --- a/qt-ui/profile/divepixmapitem.cpp +++ b/qt-ui/profile/divepixmapitem.cpp @@ -3,12 +3,7 @@ #include #include -#include -#include -#include #include -#include -#include #include #include diff --git a/qt-ui/profile/diveplotdatamodel.cpp b/qt-ui/profile/diveplotdatamodel.cpp index e60dd9ddb..9c0edc079 100644 --- a/qt-ui/profile/diveplotdatamodel.cpp +++ b/qt-ui/profile/diveplotdatamodel.cpp @@ -1,10 +1,8 @@ #include "diveplotdatamodel.h" #include "dive.h" -#include "display.h" #include "profile.h" #include "graphicsview-common.h" #include "divelist.h" -#include DivePlotDataModel::DivePlotDataModel(QObject *parent) : QAbstractTableModel(parent), diveId(0) { diff --git a/qt-ui/profile/diveprofileitem.cpp b/qt-ui/profile/diveprofileitem.cpp index 490f045fd..66faf982d 100644 --- a/qt-ui/profile/diveprofileitem.cpp +++ b/qt-ui/profile/diveprofileitem.cpp @@ -1,24 +1,15 @@ #include "diveprofileitem.h" #include "diveplotdatamodel.h" #include "divecartesianaxis.h" -#include "graphicsview-common.h" #include "divetextitem.h" -#include "profilewidget2.h" #include "animationfunctions.h" #include "dive.h" #include "profile.h" #include "preferences.h" #include "helpers.h" -#include "diveplanner.h" #include "libdivecomputer/parser.h" #include "mainwindow.h" -#include -#include -#include -#include -#include -#include #include AbstractProfilePolygonItem::AbstractProfilePolygonItem() : QObject(), QGraphicsPolygonItem(), hAxis(NULL), vAxis(NULL), dataModel(NULL), hDataColumn(-1), vDataColumn(-1) diff --git a/qt-ui/profile/divetextitem.cpp b/qt-ui/profile/divetextitem.cpp index 761f0e6f7..85e046638 100644 --- a/qt-ui/profile/divetextitem.cpp +++ b/qt-ui/profile/divetextitem.cpp @@ -1,15 +1,6 @@ #include "divetextitem.h" -#include "animationfunctions.h" #include "mainwindow.h" -#include -#include -#include -#include -#include -#include -#include - DiveTextItem::DiveTextItem(QGraphicsItem *parent) : QGraphicsItemGroup(parent), internalAlignFlags(Qt::AlignHCenter | Qt::AlignVCenter), textBackgroundItem(new QGraphicsPathItem(this)), diff --git a/qt-ui/profile/divetooltipitem.cpp b/qt-ui/profile/divetooltipitem.cpp index e89feff9c..d4818422b 100644 --- a/qt-ui/profile/divetooltipitem.cpp +++ b/qt-ui/profile/divetooltipitem.cpp @@ -1,19 +1,13 @@ #include "divetooltipitem.h" #include "divecartesianaxis.h" -#include "profilewidget2.h" #include "dive.h" #include "profile.h" #include "membuffer.h" #include "metrics.h" #include -#include -#include -#include -#include #include #include #include -#include #define PORT_IN_PROGRESS 1 #ifdef PORT_IN_PROGRESS diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index b161032d4..516b14c2f 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -1,27 +1,16 @@ #include "profilewidget2.h" #include "diveplotdatamodel.h" -#include "divepixmapitem.h" -#include "diverectitem.h" -#include "divecartesianaxis.h" -#include "diveprofileitem.h" #include "helpers.h" #include "profile.h" #include "diveeventitem.h" #include "divetextitem.h" #include "divetooltipitem.h" -#include "animationfunctions.h" #include "planner.h" #include "device.h" #include "ruleritem.h" #include "tankitem.h" -#include "dive.h" #include "pref.h" #include -#include -#include -#include -#include -#include #include #include #include diff --git a/qt-ui/profile/ruleritem.cpp b/qt-ui/profile/ruleritem.cpp index d38e88822..c88a3353d 100644 --- a/qt-ui/profile/ruleritem.cpp +++ b/qt-ui/profile/ruleritem.cpp @@ -1,21 +1,10 @@ #include "ruleritem.h" -#include "divetextitem.h" -#include "profilewidget2.h" #include "preferences.h" #include "mainwindow.h" -#include -#include -#include -#include -#include #include -#include - -#include #include "profile.h" -#include "display.h" RulerNodeItem2::RulerNodeItem2() : entry(NULL), ruler(NULL) { diff --git a/qt-ui/profile/tankitem.cpp b/qt-ui/profile/tankitem.cpp index 59acb28e0..48b586dd5 100644 --- a/qt-ui/profile/tankitem.cpp +++ b/qt-ui/profile/tankitem.cpp @@ -2,8 +2,6 @@ #include "diveplotdatamodel.h" #include "divetextitem.h" #include "profile.h" -#include -#include #include TankItem::TankItem(QObject *parent) : -- cgit v1.2.3-70-g09d2 From 76e3a10f08f20c447c0d93df9a1cc48cb9288c55 Mon Sep 17 00:00:00 2001 From: Joakim Bygdell Date: Sat, 17 Jan 2015 19:54:10 +0100 Subject: Move the heart rate graph Move the heart rate graph down to the same space as the tissue saturation graph so that it does not overlap with temperature or partial pressures. Signed-off-by: Joakim Bygdell Signed-off-by: Dirk Hohndel --- qt-ui/profile/profilewidget2.cpp | 60 +++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 32 deletions(-) (limited to 'qt-ui/profile') diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index 516b14c2f..a390ae6a5 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -55,7 +55,7 @@ static struct _ItemPos { _Axis temperature; _Axis temperatureAll; _Axis heartBeat; - _Axis heartBeatAll; + _Axis heartBeatWithTankBar; } itemPos; ProfileWidget2::ProfileWidget2(QWidget *parent) : QGraphicsView(parent), @@ -396,13 +396,11 @@ void ProfileWidget2::setupItemSizes() // Heartbeat axis config itemPos.heartBeat.pos.on.setX(3); - itemPos.heartBeat.pos.on.setY(65); + itemPos.heartBeat.pos.on.setY(82); itemPos.heartBeat.expanded.setP1(QPointF(0, 0)); itemPos.heartBeat.expanded.setP2(QPointF(0, 10)); - itemPos.heartBeatAll = itemPos.heartBeat; - itemPos.heartBeatAll.pos.on.setX(3); - itemPos.heartBeatAll.pos.on.setY(55); - itemPos.heartBeatAll.expanded.setP2(QPointF(0, 7)); + itemPos.heartBeatWithTankBar = itemPos.heartBeat; + itemPos.heartBeatWithTankBar.expanded.setP2(QPointF(0, 7)); // Percentage axis config itemPos.percentage.pos.on.setX(3); @@ -635,7 +633,7 @@ void ProfileWidget2::settingsChanged() // if we are showing calculated ceilings then we have to replot() // because the GF could have changed; otherwise we try to avoid replot() bool needReplot = prefs.calcceiling; - if (prefs.percentagegraph && PP_GRAPHS_ENABLED) { + if ((prefs.percentagegraph||prefs.hrgraph) && PP_GRAPHS_ENABLED) { profileYAxis->animateChangeLine(itemPos.depth.shrinked); temperatureAxis->setPos(itemPos.temperatureAll.pos.on); temperatureAxis->animateChangeLine(itemPos.temperature.shrinked); @@ -644,37 +642,36 @@ void ProfileWidget2::settingsChanged() if (prefs.tankbar) { percentageAxis->setPos(itemPos.percentageWithTankBar.pos.on); percentageAxis->animateChangeLine(itemPos.percentageWithTankBar.expanded); - } else { + heartBeatAxis->setPos(itemPos.heartBeatWithTankBar.pos.on); + heartBeatAxis->animateChangeLine(itemPos.heartBeatWithTankBar.expanded); + }else { percentageAxis->setPos(itemPos.percentage.pos.on); - percentageAxis->setLine(itemPos.percentage.expanded); + percentageAxis->animateChangeLine(itemPos.percentage.expanded); + heartBeatAxis->setPos(itemPos.heartBeat.pos.on); + heartBeatAxis->animateChangeLine(itemPos.heartBeat.expanded); } gasYAxis->setPos(itemPos.partialPressureTissue.pos.on); gasYAxis->animateChangeLine(itemPos.partialPressureTissue.expanded); - if (prefs.hrgraph) { - heartBeatAxis->setPos(itemPos.heartBeatAll.pos.on); - heartBeatAxis->setLine(itemPos.heartBeatAll.expanded); - } + } else if (PP_GRAPHS_ENABLED || prefs.hrgraph || prefs.percentagegraph) { profileYAxis->animateChangeLine(itemPos.depth.intermediate); temperatureAxis->setPos(itemPos.temperature.pos.on); temperatureAxis->animateChangeLine(itemPos.temperature.intermediate); cylinderPressureAxis->animateChangeLine(itemPos.cylinder.intermediate); - gasYAxis->setPos(itemPos.partialPressure.pos.on); - gasYAxis->animateChangeLine(itemPos.partialPressure.expanded); - percentageAxis->setPos(itemPos.percentage.pos.on); - percentageAxis->setLine(itemPos.percentage.expanded); - heartBeatAxis->setPos(itemPos.heartBeat.pos.on); - heartBeatAxis->setLine(itemPos.heartBeat.expanded); if (prefs.tankbar) { percentageAxis->setPos(itemPos.percentageWithTankBar.pos.on); percentageAxis->animateChangeLine(itemPos.percentageWithTankBar.expanded); gasYAxis->setPos(itemPos.partialPressureWithTankBar.pos.on); gasYAxis->setLine(itemPos.partialPressureWithTankBar.expanded); + heartBeatAxis->setPos(itemPos.heartBeatWithTankBar.pos.on); + heartBeatAxis->animateChangeLine(itemPos.heartBeatWithTankBar.expanded); } else { gasYAxis->setPos(itemPos.partialPressure.pos.on); gasYAxis->animateChangeLine(itemPos.partialPressure.expanded); percentageAxis->setPos(itemPos.percentage.pos.on); percentageAxis->setLine(itemPos.percentage.expanded); + heartBeatAxis->setPos(itemPos.heartBeat.pos.on); + heartBeatAxis->animateChangeLine(itemPos.heartBeat.expanded); } } else { profileYAxis->animateChangeLine(itemPos.depth.expanded); @@ -907,7 +904,7 @@ void ProfileWidget2::setProfileState() cylinderPressureAxis->setVisible(true); profileYAxis->setPos(itemPos.depth.pos.on); - if (prefs.percentagegraph && PP_GRAPHS_ENABLED) { + if ((prefs.percentagegraph||prefs.hrgraph) && PP_GRAPHS_ENABLED) { profileYAxis->animateChangeLine(itemPos.depth.shrinked); temperatureAxis->setPos(itemPos.temperatureAll.pos.on); temperatureAxis->animateChangeLine(itemPos.temperature.shrinked); @@ -916,37 +913,36 @@ void ProfileWidget2::setProfileState() if (prefs.tankbar) { percentageAxis->setPos(itemPos.percentageWithTankBar.pos.on); percentageAxis->animateChangeLine(itemPos.percentageWithTankBar.expanded); - } else { + heartBeatAxis->setPos(itemPos.heartBeatWithTankBar.pos.on); + heartBeatAxis->animateChangeLine(itemPos.heartBeatWithTankBar.expanded); + }else { percentageAxis->setPos(itemPos.percentage.pos.on); - percentageAxis->setLine(itemPos.percentage.expanded); + percentageAxis->animateChangeLine(itemPos.percentage.expanded); + heartBeatAxis->setPos(itemPos.heartBeat.pos.on); + heartBeatAxis->animateChangeLine(itemPos.heartBeat.expanded); } gasYAxis->setPos(itemPos.partialPressureTissue.pos.on); gasYAxis->animateChangeLine(itemPos.partialPressureTissue.expanded); - if (prefs.hrgraph) { - heartBeatAxis->setPos(itemPos.heartBeatAll.pos.on); - heartBeatAxis->setLine(itemPos.heartBeatAll.expanded); - } + } else if (PP_GRAPHS_ENABLED || prefs.hrgraph || prefs.percentagegraph) { profileYAxis->animateChangeLine(itemPos.depth.intermediate); temperatureAxis->setPos(itemPos.temperature.pos.on); temperatureAxis->animateChangeLine(itemPos.temperature.intermediate); cylinderPressureAxis->animateChangeLine(itemPos.cylinder.intermediate); - gasYAxis->setPos(itemPos.partialPressure.pos.on); - gasYAxis->animateChangeLine(itemPos.partialPressure.expanded); - percentageAxis->setPos(itemPos.percentage.pos.on); - percentageAxis->setLine(itemPos.percentage.expanded); - heartBeatAxis->setPos(itemPos.heartBeat.pos.on); - heartBeatAxis->setLine(itemPos.heartBeat.expanded); if (prefs.tankbar) { percentageAxis->setPos(itemPos.percentageWithTankBar.pos.on); percentageAxis->animateChangeLine(itemPos.percentageWithTankBar.expanded); gasYAxis->setPos(itemPos.partialPressureWithTankBar.pos.on); gasYAxis->setLine(itemPos.partialPressureWithTankBar.expanded); + heartBeatAxis->setPos(itemPos.heartBeatWithTankBar.pos.on); + heartBeatAxis->animateChangeLine(itemPos.heartBeatWithTankBar.expanded); } else { gasYAxis->setPos(itemPos.partialPressure.pos.on); gasYAxis->animateChangeLine(itemPos.partialPressure.expanded); percentageAxis->setPos(itemPos.percentage.pos.on); percentageAxis->setLine(itemPos.percentage.expanded); + heartBeatAxis->setPos(itemPos.heartBeat.pos.on); + heartBeatAxis->animateChangeLine(itemPos.heartBeat.expanded); } } else { profileYAxis->animateChangeLine(itemPos.depth.expanded); -- cgit v1.2.3-70-g09d2 From f5726ffa9d21f80232b1206456eaf971468c4b2f Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sat, 17 Jan 2015 07:02:03 -0800 Subject: Fix build: add missing #includes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit qt-ui/profile/profilewidget2.cpp:1351:10: error: invalid use of incomplete type ‘class QDebug’ qt-ui/printlayout.cpp:141:27: error: variable ‘QPointer profile’ has initializer but incomplete type In commit f9ceff009b35 ("Clean up the header files") things got broken for an as of now unreliesed future version of Qt. Signed-off-by: Thiago Macieira Signed-off-by: Dirk Hohndel --- qt-ui/printlayout.cpp | 1 + qt-ui/profile/profilewidget2.cpp | 1 + 2 files changed, 2 insertions(+) (limited to 'qt-ui/profile') diff --git a/qt-ui/printlayout.cpp b/qt-ui/printlayout.cpp index a347e1fdb..6b88f0d29 100644 --- a/qt-ui/printlayout.cpp +++ b/qt-ui/printlayout.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include "mainwindow.h" #include "printdialog.h" diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index a390ae6a5..850f357cf 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #ifndef QT_NO_DEBUG #include -- cgit v1.2.3-70-g09d2 From ecf4d18b417aa9c50ddbc936dc65f80c58d64368 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Sun, 18 Jan 2015 19:17:24 -0200 Subject: Fix extreme sluggish profile over time Whoa, this deserves a good explanation. Everytime that the mouse moved in add / plan mode, or anytime a new dive was displayed on the profile, this method would be called and connect the dataModel to the modelChanged method. This added the slot in a call-vector that the fired signal would call, adding one call to the Slot per add / plan mouse move (about 20x/s) or each time a new dive was displayed. Quickly filling the vector with more than 200 - 300 calls to this same Slot. The fix is to only connect one time. this made the add / plan mode *so* much smoother... :) Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/profile/tankitem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'qt-ui/profile') diff --git a/qt-ui/profile/tankitem.cpp b/qt-ui/profile/tankitem.cpp index 48b586dd5..c0e75a371 100644 --- a/qt-ui/profile/tankitem.cpp +++ b/qt-ui/profile/tankitem.cpp @@ -50,7 +50,7 @@ void TankItem::setData(DivePlotDataModel *model, struct plot_info *plotInfo, str memcpy(pInfoEntry, plotInfo->entry, size); copy_cylinders(d, &diveCylinderStore, false); dataModel = model; - connect(dataModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(modelDataChanged(QModelIndex, QModelIndex))); + connect(dataModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(modelDataChanged(QModelIndex, QModelIndex)), Qt::UniqueConnection); modelDataChanged(); } -- cgit v1.2.3-70-g09d2