mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Partial pressures and cylinder pressure back on profile.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
7fbeb71dce
commit
4882336315
2 changed files with 42 additions and 28 deletions
|
@ -90,10 +90,6 @@ void DiveCartesianAxis::updateTicks()
|
||||||
double steps = (max - min) / interval;
|
double steps = (max - min) / interval;
|
||||||
double currValue = min;
|
double currValue = min;
|
||||||
|
|
||||||
if(!labels.isEmpty()){
|
|
||||||
qDeleteAll(labels);
|
|
||||||
labels.clear();
|
|
||||||
}
|
|
||||||
if (steps < 1)
|
if (steps < 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QContextMenuEvent>
|
#include <QContextMenuEvent>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QSettings>
|
||||||
#include <QScrollBar>
|
#include <QScrollBar>
|
||||||
|
|
||||||
#ifndef QT_NO_DEBUG
|
#ifndef QT_NO_DEBUG
|
||||||
|
@ -124,8 +125,7 @@ void ProfileWidget2::setupItemOnScene()
|
||||||
|
|
||||||
gasYAxis->setOrientation(DiveCartesianAxis::BottomToTop);
|
gasYAxis->setOrientation(DiveCartesianAxis::BottomToTop);
|
||||||
gasYAxis->setTickInterval(1);
|
gasYAxis->setTickInterval(1);
|
||||||
gasYAxis->setTickSize(2);
|
gasYAxis->setTickSize(1);
|
||||||
gasYAxis->setY(70);
|
|
||||||
gasYAxis->setMinimum(0);
|
gasYAxis->setMinimum(0);
|
||||||
gasYAxis->setModel(dataModel);
|
gasYAxis->setModel(dataModel);
|
||||||
|
|
||||||
|
@ -205,6 +205,22 @@ void ProfileWidget2::setupItemSizes()
|
||||||
itemPos.time.pos.off.setY(110);
|
itemPos.time.pos.off.setY(110);
|
||||||
itemPos.time.expanded.setP1(QPointF(0,0));
|
itemPos.time.expanded.setP1(QPointF(0,0));
|
||||||
itemPos.time.expanded.setP2(QPointF(94,0));
|
itemPos.time.expanded.setP2(QPointF(94,0));
|
||||||
|
|
||||||
|
// Partial Gas Axis Config
|
||||||
|
itemPos.partialgas.pos.on.setX(97);
|
||||||
|
itemPos.partialgas.pos.on.setY(60);
|
||||||
|
itemPos.partialgas.pos.off.setX(110);
|
||||||
|
itemPos.partialgas.pos.off.setY(60);
|
||||||
|
itemPos.partialgas.expanded.setP1(QPointF(0,0));
|
||||||
|
itemPos.partialgas.expanded.setP2(QPointF(0,30));
|
||||||
|
|
||||||
|
// cylinder axis config
|
||||||
|
itemPos.cylinder.pos.on.setX(3);
|
||||||
|
itemPos.cylinder.pos.on.setY(20);
|
||||||
|
itemPos.cylinder.pos.off.setX(-10);
|
||||||
|
itemPos.cylinder.pos.off.setY(20);
|
||||||
|
itemPos.cylinder.expanded.setP1(QPointF(0,0));
|
||||||
|
itemPos.cylinder.expanded.setP2(QPointF(0,20));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProfileWidget2::setupItem(AbstractProfilePolygonItem* item, DiveCartesianAxis* hAxis, DiveCartesianAxis* vAxis, DivePlotDataModel* model, int vData, int hData, int zValue)
|
void ProfileWidget2::setupItem(AbstractProfilePolygonItem* item, DiveCartesianAxis* hAxis, DiveCartesianAxis* vAxis, DivePlotDataModel* model, int vData, int hData, int zValue)
|
||||||
|
@ -330,6 +346,8 @@ void ProfileWidget2::resizeEvent(QResizeEvent* event)
|
||||||
|
|
||||||
void ProfileWidget2::fixBackgroundPos()
|
void ProfileWidget2::fixBackgroundPos()
|
||||||
{
|
{
|
||||||
|
if(currentState != EMPTY)
|
||||||
|
return;
|
||||||
QPixmap toBeScaled;
|
QPixmap toBeScaled;
|
||||||
if (!backgrounds.keys().contains(backgroundFile)){
|
if (!backgrounds.keys().contains(backgroundFile)){
|
||||||
backgrounds[backgroundFile] = QPixmap(backgroundFile);
|
backgrounds[backgroundFile] = QPixmap(backgroundFile);
|
||||||
|
@ -402,24 +420,19 @@ void ProfileWidget2::setEmptyState()
|
||||||
backgroundFile = QString(":poster%1").arg( rand()%3 +1);
|
backgroundFile = QString(":poster%1").arg( rand()%3 +1);
|
||||||
currentState = EMPTY;
|
currentState = EMPTY;
|
||||||
fixBackgroundPos();
|
fixBackgroundPos();
|
||||||
Animations::moveTo(background, background->x(), itemPos.background.on.y());
|
profileYAxis->setPos(itemPos.depth.pos.off);
|
||||||
Animations::moveTo(profileYAxis, itemPos.depth.pos.off);
|
gasYAxis->setPos(itemPos.partialgas.pos.off);
|
||||||
|
timeAxis->setPos(itemPos.time.pos.off);
|
||||||
|
background->setY( itemPos.background.on.y());
|
||||||
toolTipItem->setVisible(false);
|
toolTipItem->setVisible(false);
|
||||||
gasYAxis->setVisible(false);
|
|
||||||
temperatureAxis->setVisible(false);
|
temperatureAxis->setVisible(false);
|
||||||
Animations::moveTo(timeAxis,itemPos.time.pos.off);
|
cylinderPressureAxis->setPos(itemPos.cylinder.pos.off);
|
||||||
diveProfileItem->setVisible(false);
|
|
||||||
cylinderPressureAxis->setVisible(false);
|
|
||||||
temperatureItem->setVisible(false);
|
temperatureItem->setVisible(false);
|
||||||
gasPressureItem->setVisible(false);
|
|
||||||
cartesianPlane->setVisible(false);
|
cartesianPlane->setVisible(false);
|
||||||
meanDepth->setVisible(false);
|
meanDepth->setVisible(false);
|
||||||
diveComputerText->setVisible(false);
|
diveComputerText->setVisible(false);
|
||||||
diveCeiling->setVisible(false);
|
diveCeiling->setVisible(false);
|
||||||
reportedCeiling->setVisible(false);
|
reportedCeiling->setVisible(false);
|
||||||
pn2GasItem->setVisible(false);
|
|
||||||
pheGasItem->setVisible(false);
|
|
||||||
po2GasItem->setVisible(false);
|
|
||||||
Q_FOREACH(DiveCalculatedTissue *tissue, allTissues){
|
Q_FOREACH(DiveCalculatedTissue *tissue, allTissues){
|
||||||
tissue->setVisible(false);
|
tissue->setVisible(false);
|
||||||
}
|
}
|
||||||
|
@ -437,28 +450,33 @@ void ProfileWidget2::setProfileState()
|
||||||
currentState = PROFILE;
|
currentState = PROFILE;
|
||||||
setBackgroundBrush(getColor(::BACKGROUND));
|
setBackgroundBrush(getColor(::BACKGROUND));
|
||||||
|
|
||||||
Animations::moveTo(background, background->x(), itemPos.background.off.y(), 1500);
|
background->setVisible(false);
|
||||||
toolTipItem->setVisible(true);
|
toolTipItem->setVisible(true);
|
||||||
|
|
||||||
Animations::moveTo(profileYAxis,itemPos.depth.pos.on);
|
profileYAxis->setPos(itemPos.depth.pos.on);
|
||||||
profileYAxis->setLine(itemPos.depth.expanded);
|
QSettings s;
|
||||||
|
s.beginGroup("TecDetails");
|
||||||
|
if(s.value("phegraph").toBool()|| s.value("po2graph").toBool()|| s.value("pn2graph").toBool()){
|
||||||
|
profileYAxis->setLine(itemPos.depth.shrinked);
|
||||||
|
}else{
|
||||||
|
profileYAxis->setLine(itemPos.depth.expanded);
|
||||||
|
}
|
||||||
|
|
||||||
// gasYAxis->setVisible(true);
|
gasYAxis->setPos(itemPos.partialgas.pos.on);
|
||||||
// temperatureAxis->setVisible(true);
|
gasYAxis->setLine(itemPos.partialgas.expanded);
|
||||||
Animations::moveTo(timeAxis, itemPos.time.pos.on);
|
|
||||||
|
timeAxis->setPos(itemPos.time.pos.on);
|
||||||
timeAxis->setLine(itemPos.time.expanded);
|
timeAxis->setLine(itemPos.time.expanded);
|
||||||
diveProfileItem->setVisible(true);
|
|
||||||
// cylinderPressureAxis->setVisible(true);
|
cylinderPressureAxis->setPos(itemPos.cylinder.pos.on);
|
||||||
|
cylinderPressureAxis->setLine(itemPos.cylinder.expanded);
|
||||||
|
|
||||||
// temperatureItem->setVisible(true);
|
// temperatureItem->setVisible(true);
|
||||||
// gasPressureItem->setVisible(true);
|
|
||||||
// cartesianPlane->setVisible(true);
|
// cartesianPlane->setVisible(true);
|
||||||
// meanDepth->setVisible(true);
|
// meanDepth->setVisible(true);
|
||||||
// diveComputerText->setVisible(true);
|
// diveComputerText->setVisible(true);
|
||||||
// diveCeiling->setVisible(true);
|
// diveCeiling->setVisible(true);
|
||||||
// reportedCeiling->setVisible(true);
|
// reportedCeiling->setVisible(true);
|
||||||
// pn2GasItem->setVisible(true);
|
|
||||||
// pheGasItem->setVisible(true);
|
|
||||||
// po2GasItem->setVisible(true);
|
|
||||||
// Q_FOREACH(DiveCalculatedTissue *tissue, allTissues){
|
// Q_FOREACH(DiveCalculatedTissue *tissue, allTissues){
|
||||||
// tissue->setVisible(true);
|
// tissue->setVisible(true);
|
||||||
// }
|
// }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue