Can I have a dive with heartbeats so I can test my next path? -T
From fffd2cbda986952635dca46aae23d81600240f16 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava <tomaz.canabr...@intel.com> Date: Fri, 14 Feb 2014 22:04:18 -0200 Subject: [PATCH 4/4] Align Right side of Cylinder Pressure Text to the Left.
Signed-off-by: Tomaz Canabrava <tomaz.canabr...@intel.com> --- qt-ui/profile/diveprofileitem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qt-ui/profile/diveprofileitem.cpp b/qt-ui/profile/diveprofileitem.cpp index 3c9191f..a07132f 100644 --- a/qt-ui/profile/diveprofileitem.cpp +++ b/qt-ui/profile/diveprofileitem.cpp @@ -355,7 +355,7 @@ void DiveGasPressureItem::modelDataChanged(const QModelIndex& topLeft, const QMo for (cyl = 0; cyl < MAX_CYLINDERS; cyl++) { if (last_time[cyl]) { - plot_pressure_value(last_pressure[cyl], last_time[cyl], Qt::AlignRight | Qt::AlignTop); + plot_pressure_value(last_pressure[cyl], last_time[cyl], Qt::AlignLeft | Qt::AlignTop); } } } -- 1.8.5.5
From 5b99ef292c63e5a78979e339110ec144d88b1623 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava <tomaz.canabr...@intel.com> Date: Fri, 14 Feb 2014 21:19:44 -0200 Subject: [PATCH 3/4] Left-Align the last Temperature Text. The last temperature text used to have the same align flags as all the other texts: Right. this makes it much more appealing. Signed-off-by: Tomaz Canabrava <tomaz.canabr...@intel.com> --- qt-ui/profile/diveprofileitem.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/qt-ui/profile/diveprofileitem.cpp b/qt-ui/profile/diveprofileitem.cpp index 7246309..3c9191f 100644 --- a/qt-ui/profile/diveprofileitem.cpp +++ b/qt-ui/profile/diveprofileitem.cpp @@ -267,6 +267,7 @@ void DiveTemperatureItem::modelDataChanged(const QModelIndex& topLeft, const QMo ((abs(last_valid_temp - last_printed_temp) > 500) || ((double)last / (double)sec < 0.75))) { createTextItem(sec, last_valid_temp); } + texts.last()->setAlignment(Qt::AlignLeft | Qt::AlignBottom); } void DiveTemperatureItem::createTextItem(int sec, int mkelvin) -- 1.8.5.5
From 66791eb51fdcf82b27714279deafc10f31180668 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava <tomaz.canabr...@intel.com> Date: Fri, 14 Feb 2014 21:17:31 -0200 Subject: [PATCH 2/4] Show the last temperature on the graph. The code shamelessy copied from the old profile introduced a bug where the old temperature was not correctly shown. I'v added a new member to the class that will store the last valid temperature, and use that to calculate if there's a reason or not to display it. Signed-off-by: Tomaz Canabrava <tomaz.canabr...@intel.com> --- qt-ui/profile/diveprofileitem.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/qt-ui/profile/diveprofileitem.cpp b/qt-ui/profile/diveprofileitem.cpp index 0b1d32a..7246309 100644 --- a/qt-ui/profile/diveprofileitem.cpp +++ b/qt-ui/profile/diveprofileitem.cpp @@ -227,7 +227,7 @@ DiveTemperatureItem::DiveTemperatureItem() void DiveTemperatureItem::modelDataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight) { - int last = -300, last_printed_temp = 0, sec = 0; + int last = -300, last_printed_temp = 0, sec = 0, last_valid_temp = 0; // We don't have enougth data to calculate things, quit. if (!shouldCalculateStuff(topLeft, bottomRight)) return; @@ -240,6 +240,7 @@ void DiveTemperatureItem::modelDataChanged(const QModelIndex& topLeft, const QMo int mkelvin = dataModel->index(i, vDataColumn).data().toInt(); if (!mkelvin) continue; + last_valid_temp = mkelvin; sec = dataModel->index(i, hDataColumn).data().toInt(); QPointF point( hAxis->posAtValue(sec), vAxis->posAtValue(mkelvin)); poly.append(point); @@ -262,10 +263,9 @@ void DiveTemperatureItem::modelDataChanged(const QModelIndex& topLeft, const QMo /* it would be nice to print the end temperature, if it's * different or if the last temperature print has been more * than a quarter of the dive back */ - int last_temperature = dataModel->data(dataModel->index(dataModel->rowCount()-1, DivePlotDataModel::TEMPERATURE)).toInt(); - if (last_temperature > 200000 && - ((abs(last_temperature - last_printed_temp) > 500) || ((double)last / (double)sec < 0.75))) { - createTextItem(sec, last_temperature); + if (last_valid_temp > 200000 && + ((abs(last_valid_temp - last_printed_temp) > 500) || ((double)last / (double)sec < 0.75))) { + createTextItem(sec, last_valid_temp); } } -- 1.8.5.5
From d194ba90eeda063432b3072752231339e3fc54ea Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava <tomaz.canabr...@intel.com> Date: Fri, 14 Feb 2014 21:12:52 -0200 Subject: [PATCH 1/4] Removed the 'Unused Tanks' from the toolbar. Just removed the unused tanks from the toolbar, since it's just a removal of something on the ui related code, it's good to see how much verbose the xml to generate the UI is. Signed-off-by: Tomaz Canabrava <tomaz.canabr...@intel.com> --- qt-ui/mainwindow.ui | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/qt-ui/mainwindow.ui b/qt-ui/mainwindow.ui index 7f6c672..6e1489e 100644 --- a/qt-ui/mainwindow.ui +++ b/qt-ui/mainwindow.ui @@ -446,32 +446,6 @@ </widget> </item> <item> - <widget class="QToolButton" name="profUnusedTanks"> - <property name="toolTip"> - <string>Show Unused Tanks</string> - </property> - <property name="text"> - <string>...</string> - </property> - <property name="icon"> - <iconset resource="../subsurface.qrc"> - <normaloff>:/advanced</normaloff>:/advanced</iconset> - </property> - <property name="iconSize"> - <size> - <width>24</width> - <height>24</height> - </size> - </property> - <property name="checkable"> - <bool>true</bool> - </property> - <property name="autoRaise"> - <bool>true</bool> - </property> - </widget> - </item> - <item> <widget class="QToolButton" name="profRuler"> <property name="toolTip"> <string>Enable / Disable the Ruler</string> @@ -480,7 +454,7 @@ <string>...</string> </property> <property name="icon"> - <iconset resource="../subsurface.qrc"> + <iconset> <normaloff>:/flag</normaloff>:/flag</iconset> </property> <property name="iconSize"> -- 1.8.5.5
_______________________________________________ subsurface mailing list subsurface@hohndel.org http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface