mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-12 13:46:16 +00:00
Re-enable more items on the new profile.
Temperature and DC Label. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
4882336315
commit
c05575e103
2 changed files with 26 additions and 7 deletions
|
@ -365,7 +365,8 @@ void DiveCartesianPlane::setup()
|
||||||
if (!leftAxis || !bottomAxis || !scene())
|
if (!leftAxis || !bottomAxis || !scene())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// This creates a Grid around the axis, creating the cartesian plane.
|
setPen(gridPen());
|
||||||
|
// This creates a Grid around the axis, creating the cartesian plane.
|
||||||
const int top = leftAxis->posAtValue(leftAxis->minimum());
|
const int top = leftAxis->posAtValue(leftAxis->minimum());
|
||||||
// unused for now:
|
// unused for now:
|
||||||
// const int bottom = leftAxis->posAtValue(leftAxis->maximum());
|
// const int bottom = leftAxis->posAtValue(leftAxis->maximum());
|
||||||
|
|
|
@ -43,6 +43,7 @@ static struct _ItemPos{
|
||||||
QLineF expanded;
|
QLineF expanded;
|
||||||
};
|
};
|
||||||
_Pos background;
|
_Pos background;
|
||||||
|
_Pos dcLabel;
|
||||||
_Axis depth;
|
_Axis depth;
|
||||||
_Axis partialgas;
|
_Axis partialgas;
|
||||||
_Axis time;
|
_Axis time;
|
||||||
|
@ -221,6 +222,19 @@ void ProfileWidget2::setupItemSizes()
|
||||||
itemPos.cylinder.pos.off.setY(20);
|
itemPos.cylinder.pos.off.setY(20);
|
||||||
itemPos.cylinder.expanded.setP1(QPointF(0,0));
|
itemPos.cylinder.expanded.setP1(QPointF(0,0));
|
||||||
itemPos.cylinder.expanded.setP2(QPointF(0,20));
|
itemPos.cylinder.expanded.setP2(QPointF(0,20));
|
||||||
|
|
||||||
|
// Temperature axis config
|
||||||
|
itemPos.temperature.pos.on.setX(3);
|
||||||
|
itemPos.temperature.pos.on.setY(40);
|
||||||
|
itemPos.temperature.pos.off.setX(-10);
|
||||||
|
itemPos.temperature.pos.off.setY(40);
|
||||||
|
itemPos.temperature.expanded.setP1(QPointF(0,0));
|
||||||
|
itemPos.temperature.expanded.setP2(QPointF(0,20));
|
||||||
|
|
||||||
|
itemPos.dcLabel.on.setX(3);
|
||||||
|
itemPos.dcLabel.on.setY(97);
|
||||||
|
itemPos.dcLabel.off.setX(-10);
|
||||||
|
itemPos.dcLabel.off.setY(97);
|
||||||
}
|
}
|
||||||
|
|
||||||
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)
|
||||||
|
@ -311,6 +325,7 @@ void ProfileWidget2::plotDives(QList<dive*> dives)
|
||||||
meanDepth->animateMoveTo(3, profileYAxis->posAtValue(pInfo.meandepth));
|
meanDepth->animateMoveTo(3, profileYAxis->posAtValue(pInfo.meandepth));
|
||||||
|
|
||||||
dataModel->emitDataChanged();
|
dataModel->emitDataChanged();
|
||||||
|
cartesianPlane->setup();
|
||||||
// The event items are a bit special since we don't know how many events are going to
|
// 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
|
// exist on a dive, so I cant create cache items for that. that's why they are here
|
||||||
// while all other items are up there on the constructor.
|
// while all other items are up there on the constructor.
|
||||||
|
@ -425,9 +440,8 @@ void ProfileWidget2::setEmptyState()
|
||||||
timeAxis->setPos(itemPos.time.pos.off);
|
timeAxis->setPos(itemPos.time.pos.off);
|
||||||
background->setY( itemPos.background.on.y());
|
background->setY( itemPos.background.on.y());
|
||||||
toolTipItem->setVisible(false);
|
toolTipItem->setVisible(false);
|
||||||
temperatureAxis->setVisible(false);
|
temperatureAxis->setPos(itemPos.temperature.pos.off);
|
||||||
cylinderPressureAxis->setPos(itemPos.cylinder.pos.off);
|
cylinderPressureAxis->setPos(itemPos.cylinder.pos.off);
|
||||||
temperatureItem->setVisible(false);
|
|
||||||
cartesianPlane->setVisible(false);
|
cartesianPlane->setVisible(false);
|
||||||
meanDepth->setVisible(false);
|
meanDepth->setVisible(false);
|
||||||
diveComputerText->setVisible(false);
|
diveComputerText->setVisible(false);
|
||||||
|
@ -471,10 +485,14 @@ void ProfileWidget2::setProfileState()
|
||||||
cylinderPressureAxis->setPos(itemPos.cylinder.pos.on);
|
cylinderPressureAxis->setPos(itemPos.cylinder.pos.on);
|
||||||
cylinderPressureAxis->setLine(itemPos.cylinder.expanded);
|
cylinderPressureAxis->setLine(itemPos.cylinder.expanded);
|
||||||
|
|
||||||
// temperatureItem->setVisible(true);
|
temperatureAxis->setPos(itemPos.temperature.pos.on);
|
||||||
// cartesianPlane->setVisible(true);
|
temperatureAxis->setLine(itemPos.temperature.expanded);
|
||||||
// meanDepth->setVisible(true);
|
|
||||||
// diveComputerText->setVisible(true);
|
cartesianPlane->setVisible(true);
|
||||||
|
meanDepth->setVisible(true);
|
||||||
|
diveComputerText->setVisible(true);
|
||||||
|
cartesianPlane->setHorizontalLine( timeAxis->line() );
|
||||||
|
cartesianPlane->setVerticalLine( profileYAxis->line() );
|
||||||
// diveCeiling->setVisible(true);
|
// diveCeiling->setVisible(true);
|
||||||
// reportedCeiling->setVisible(true);
|
// reportedCeiling->setVisible(true);
|
||||||
// Q_FOREACH(DiveCalculatedTissue *tissue, allTissues){
|
// Q_FOREACH(DiveCalculatedTissue *tissue, allTissues){
|
||||||
|
|
Loading…
Add table
Reference in a new issue