Changeset 2516ae7e in subsurface


Ignore:
Timestamp:
Feb 4, 2017, 7:09:35 AM (8 months ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
6518b0d
Parents:
cd38cda1
git-author:
Robert C. Helling <helling@…> (02/04/17 05:12:43)
git-committer:
Dirk Hohndel <dirk@…> (02/04/17 07:09:35)
Message:

Let cylinderid = -1 mean same gas as before

It's not too clever to give 0 a special meaning (as here:
use same gas as for previous leg) when 0 is a legitimate
value.

This should solve Willem's gas disappearance problem when
reediting a dive in the planner.

Signed-off-by: Robert C. Helling <helling@…>

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • profile-widget/profilewidget2.cpp

    rf5a4838 r2516ae7e  
    933933                int minutes = rint(timeAxis->valueAt(mappedPos) / 60);
    934934                int milimeters = rint(profileYAxis->valueAt(mappedPos) / M_OR_FT(1, 1)) * M_OR_FT(1, 1);
    935                 plannerModel->addStop(milimeters, minutes * 60, 0, 0, true);
     935                plannerModel->addStop(milimeters, minutes * 60, -1, 0, true);
    936936        }
    937937}
  • qt-models/diveplannermodel.cpp

    rc49f0446 r2516ae7e  
    589589}
    590590
     591// cylinderid_in == -1 means same gas as before.
    591592int DivePlannerPointsModel::addStop(int milimeters, int seconds, int cylinderid_in, int ccpoint, bool entered)
    592593{
    593594        int cylinderid = 0;
    594595        bool usePrevious = false;
    595         if (cylinderid_in)
     596        if (cylinderid_in >= 0)
    596597                cylinderid = cylinderid_in;
    597598        else
  • qt-models/diveplannermodel.h

    r7b89190 r2516ae7e  
    5858public
    5959slots:
    60         int addStop(int millimeters = 0, int seconds = 0, int cylinderid_in = 0, int ccpoint = 0, bool entered = true);
     60        int addStop(int millimeters = 0, int seconds = 0, int cylinderid_in = -1, int ccpoint = 0, bool entered = true);
    6161        void addCylinder_clicked();
    6262        void setGFHigh(const int gfhigh);
Note: See TracChangeset for help on using the changeset viewer.