Fix time and half of depth lines.

Comment out most of the items on the profile since they are
currently completely broken ( positioning, etc ).

Also, remove the settingsChanged stuff from the DepthAxis because it
doesn't have the shrinked / expanded size on it ( it sits on the profile
code ) so I'll most probably move that to the profile settingsChanged in
the future - or if anyone knows of a better place to have this, I'm all
ears.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2014-02-07 17:38:00 -02:00 committed by Dirk Hohndel
parent 266daa326d
commit ed72aabde5
2 changed files with 68 additions and 40 deletions

View file

@ -289,17 +289,17 @@ DepthAxis::DepthAxis() : showWithPPGraph(false)
void DepthAxis::settingsChanged() void DepthAxis::settingsChanged()
{ {
bool ppGraph = isPPGraphEnabled(); // bool ppGraph = isPPGraphEnabled();
if ( ppGraph == showWithPPGraph){ // if ( ppGraph == showWithPPGraph){
return; // return;
} // }
//
if (ppGraph) { // if (ppGraph) {
animateChangeLine(QLineF(0,2,0,60)); // animateChangeLine(shrinkedLine);
} else { // } else {
animateChangeLine(QLineF(0,2,0,98)); // animateChangeLine(expandedLine);
} // }
showWithPPGraph = ppGraph; // showWithPPGraph = ppGraph;
} }
QColor TimeAxis::colorForValue(double value) QColor TimeAxis::colorForValue(double value)

View file

@ -119,7 +119,6 @@ void ProfileWidget2::setupItemOnScene()
gasYAxis->setOrientation(DiveCartesianAxis::BottomToTop); gasYAxis->setOrientation(DiveCartesianAxis::BottomToTop);
gasYAxis->setX(3); gasYAxis->setX(3);
gasYAxis->setLine(0, 0, 0, 20);
gasYAxis->setTickInterval(1); gasYAxis->setTickInterval(1);
gasYAxis->setTickSize(2); gasYAxis->setTickSize(2);
gasYAxis->setY(70); gasYAxis->setY(70);
@ -127,13 +126,11 @@ void ProfileWidget2::setupItemOnScene()
gasYAxis->setModel(dataModel); gasYAxis->setModel(dataModel);
temperatureAxis->setOrientation(DiveCartesianAxis::BottomToTop); temperatureAxis->setOrientation(DiveCartesianAxis::BottomToTop);
temperatureAxis->setLine(0, 60, 0, 90);
temperatureAxis->setX(3); temperatureAxis->setX(3);
temperatureAxis->setTickSize(2); temperatureAxis->setTickSize(2);
temperatureAxis->setTickInterval(300); temperatureAxis->setTickInterval(300);
cylinderPressureAxis->setOrientation(DiveCartesianAxis::BottomToTop); cylinderPressureAxis->setOrientation(DiveCartesianAxis::BottomToTop);
cylinderPressureAxis->setLine(0,20,0,60);
cylinderPressureAxis->setX(3); cylinderPressureAxis->setX(3);
cylinderPressureAxis->setTickSize(2); cylinderPressureAxis->setTickSize(2);
cylinderPressureAxis->setTickInterval(30000); cylinderPressureAxis->setTickInterval(30000);
@ -177,11 +174,35 @@ void ProfileWidget2::setupItemOnScene()
void ProfileWidget2::setupItemSizes() void ProfileWidget2::setupItemSizes()
{ {
// Scene is *always* 100 / 100. // Scene is *always* (double) 100 / 100.
// Background Config
/* Much probably a better math is needed here.
* good thing is that we only need to change the
* Axis and everything else is auto-adjusted.*
*/
itemPos.background.on.setX(0); itemPos.background.on.setX(0);
itemPos.background.on.setY(0); itemPos.background.on.setY(0);
itemPos.background.off.setX(0); itemPos.background.off.setX(0);
itemPos.background.off.setY(110); itemPos.background.off.setY(110);
//Depth Axis Config
itemPos.depth.pos.on.setX(3);
itemPos.depth.pos.on.setY(3);
itemPos.depth.pos.off.setX(-2);
itemPos.depth.pos.off.setY(3);
itemPos.depth.expanded.setP1(QPointF(0,0));
itemPos.depth.expanded.setP2(QPointF(0,94));
itemPos.depth.shrinked.setP1(QPointF(0,0));
itemPos.depth.shrinked.setP2(QPointF(0,60));
// Time Axis Config
itemPos.time.pos.on.setX(3);
itemPos.time.pos.on.setY(97);
itemPos.time.pos.off.setX(3);
itemPos.time.pos.off.setY(110);
itemPos.time.expanded.setP1(QPointF(0,0));
itemPos.time.expanded.setP2(QPointF(94,0));
} }
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)
@ -379,12 +400,11 @@ void ProfileWidget2::setEmptyState()
currentState = EMPTY; currentState = EMPTY;
fixBackgroundPos(); fixBackgroundPos();
Animations::moveTo(background, background->x(), itemPos.background.on.y()); Animations::moveTo(background, background->x(), itemPos.background.on.y());
profileYAxis->setPos(itemPos.depth.pos.off);
toolTipItem->setVisible(false); toolTipItem->setVisible(false);
profileYAxis->setVisible(false);
gasYAxis->setVisible(false); gasYAxis->setVisible(false);
temperatureAxis->setVisible(false); temperatureAxis->setVisible(false);
timeAxis->setVisible(false); timeAxis->setPos(itemPos.time.pos.off);
diveProfileItem->setVisible(false); diveProfileItem->setVisible(false);
cylinderPressureAxis->setVisible(false); cylinderPressureAxis->setVisible(false);
temperatureItem->setVisible(false); temperatureItem->setVisible(false);
@ -412,28 +432,36 @@ void ProfileWidget2::setProfileState()
return; return;
currentState = PROFILE; currentState = PROFILE;
setBackgroundBrush(getColor(::BACKGROUND));
Animations::moveTo(background, background->x(), itemPos.background.off.y(), 1500); Animations::moveTo(background, background->x(), itemPos.background.off.y(), 1500);
toolTipItem->setVisible(true); toolTipItem->setVisible(true);
profileYAxis->setVisible(true);
gasYAxis->setVisible(true); profileYAxis->setPos(itemPos.depth.pos.on);
temperatureAxis->setVisible(true); profileYAxis->setLine(itemPos.depth.expanded);
timeAxis->setVisible(true);
diveProfileItem->setVisible(true); qDebug() << "ProfileAxisPos" << profileYAxis->pos() << "Line" << profileYAxis->line() << scene()->items().indexOf(profileYAxis);
cylinderPressureAxis->setVisible(true); // gasYAxis->setVisible(true);
temperatureItem->setVisible(true); // temperatureAxis->setVisible(true);
gasPressureItem->setVisible(true); timeAxis->setPos(itemPos.time.pos.on);
cartesianPlane->setVisible(true); timeAxis->setLine(itemPos.time.expanded);
meanDepth->setVisible(true); qDebug() << "timeAxisPos" << timeAxis->pos() << "Line" << timeAxis->line() << scene()->items().indexOf(timeAxis);
diveComputerText->setVisible(true); // diveProfileItem->setVisible(true);
diveCeiling->setVisible(true); // cylinderPressureAxis->setVisible(true);
reportedCeiling->setVisible(true); // temperatureItem->setVisible(true);
pn2GasItem->setVisible(true); // gasPressureItem->setVisible(true);
pheGasItem->setVisible(true); // cartesianPlane->setVisible(true);
po2GasItem->setVisible(true); // meanDepth->setVisible(true);
Q_FOREACH(DiveCalculatedTissue *tissue, allTissues){ // diveComputerText->setVisible(true);
tissue->setVisible(true); // diveCeiling->setVisible(true);
} // reportedCeiling->setVisible(true);
Q_FOREACH(DiveEventItem *event, eventItems){ // pn2GasItem->setVisible(true);
event->setVisible(true); // pheGasItem->setVisible(true);
} // po2GasItem->setVisible(true);
// Q_FOREACH(DiveCalculatedTissue *tissue, allTissues){
// tissue->setVisible(true);
// }
// Q_FOREACH(DiveEventItem *event, eventItems){
// event->setVisible(true);
// }
} }