mirror of
https://github.com/subsurface/subsurface.git
synced 2024-12-02 23:20:20 +00:00
Added the Cylinder Pressure Axis
The cylinder pressure axis is the 'Y' axis for the Cylinder plot. I positioned it in around 20% to 60% of the screen state. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
e23841dd7f
commit
e3ec5ef290
2 changed files with 13 additions and 1 deletions
|
@ -33,6 +33,7 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) :
|
||||||
depthController(new DiveRectItem()),
|
depthController(new DiveRectItem()),
|
||||||
timeController(new DiveRectItem()),
|
timeController(new DiveRectItem()),
|
||||||
diveProfileItem(NULL),
|
diveProfileItem(NULL),
|
||||||
|
cylinderPressureAxis(new DiveCartesianAxis()),
|
||||||
temperatureItem(NULL),
|
temperatureItem(NULL),
|
||||||
cartesianPlane(new DiveCartesianPlane())
|
cartesianPlane(new DiveCartesianPlane())
|
||||||
{
|
{
|
||||||
|
@ -69,6 +70,12 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) :
|
||||||
temperatureAxis->setTickSize(2);
|
temperatureAxis->setTickSize(2);
|
||||||
temperatureAxis->setTickInterval(300);
|
temperatureAxis->setTickInterval(300);
|
||||||
|
|
||||||
|
cylinderPressureAxis->setOrientation(DiveCartesianAxis::TopToBottom);
|
||||||
|
cylinderPressureAxis->setLine(0,20,0,60);
|
||||||
|
cylinderPressureAxis->setX(3);
|
||||||
|
cylinderPressureAxis->setTickSize(2);
|
||||||
|
cylinderPressureAxis->setTickInterval(30000);
|
||||||
|
|
||||||
timeAxis->setLine(0,0,96,0);
|
timeAxis->setLine(0,0,96,0);
|
||||||
timeAxis->setX(3);
|
timeAxis->setX(3);
|
||||||
timeAxis->setTickSize(1);
|
timeAxis->setTickSize(1);
|
||||||
|
@ -82,7 +89,7 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) :
|
||||||
|
|
||||||
// insert in the same way it's declared on the Enum. This is needed so we don't use an map.
|
// insert in the same way it's declared on the Enum. This is needed so we don't use an map.
|
||||||
QList<QGraphicsItem*> stateItems; stateItems << background << profileYAxis << gasYAxis <<
|
QList<QGraphicsItem*> stateItems; stateItems << background << profileYAxis << gasYAxis <<
|
||||||
timeAxis << depthController << timeController << temperatureAxis;
|
timeAxis << depthController << timeController << temperatureAxis << cylinderPressureAxis;
|
||||||
Q_FOREACH(QGraphicsItem *item, stateItems) {
|
Q_FOREACH(QGraphicsItem *item, stateItems) {
|
||||||
scene()->addItem(item);
|
scene()->addItem(item);
|
||||||
}
|
}
|
||||||
|
@ -282,6 +289,10 @@ void ProfileWidget2::plotDives(QList<dive*> dives)
|
||||||
//temperatureAxis->updateTicks();
|
//temperatureAxis->updateTicks();
|
||||||
timeAxis->setMaximum(maxtime);
|
timeAxis->setMaximum(maxtime);
|
||||||
timeAxis->updateTicks();
|
timeAxis->updateTicks();
|
||||||
|
cylinderPressureAxis->setMinimum(pInfo.minpressure);
|
||||||
|
cylinderPressureAxis->setMaximum(pInfo.maxpressure);
|
||||||
|
cylinderPressureAxis->updateTicks();
|
||||||
|
|
||||||
dataModel->setDive(current_dive, pInfo);
|
dataModel->setDive(current_dive, pInfo);
|
||||||
|
|
||||||
if (diveProfileItem) {
|
if (diveProfileItem) {
|
||||||
|
|
|
@ -75,6 +75,7 @@ private:
|
||||||
DiveProfileItem *diveProfileItem;
|
DiveProfileItem *diveProfileItem;
|
||||||
DiveCartesianPlane *cartesianPlane;
|
DiveCartesianPlane *cartesianPlane;
|
||||||
DiveTemperatureItem *temperatureItem;
|
DiveTemperatureItem *temperatureItem;
|
||||||
|
DiveCartesianAxis *cylinderPressureAxis;
|
||||||
QList<DiveEventItem*> eventItems;
|
QList<DiveEventItem*> eventItems;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue