Changeset 98a65b7 in subsurface


Ignore:
Timestamp:
May 26, 2017, 3:52:04 PM (6 months ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
05a7fe1
Parents:
bb6ceba
git-author:
Robert C. Helling <helling@…> (05/14/17 00:26:36)
git-committer:
Dirk Hohndel <dirk@…> (05/26/17 15:52:04)
Message:

Display gas density instead of SAC in planner

In the planner, the SAC is prescribed, so there is little
use in plotting it (as the color of the cylinder pressure
line). Rather use the color to show the density of breathing
gas.

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

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • core/color.cpp

    rb368ecd r98a65b7  
    8888        return getColor((color_indice_t)(SAC_COLORS_START_IDX + sac_index), false);
    8989}
     90
     91QColor getPressureColor(double density)
     92{
     93        QColor color;
     94
     95        int h = ((int) (180.0 - 180.0 * density / 8.0));
     96        while (h < 0)
     97                h += 360;
     98        color.setHsv(h , 255, 255);
     99        return color;
     100}
  • core/color.h

    rb368ecd r98a65b7  
    143143QColor getColor(const color_indice_t i, bool isGrayscale = false);
    144144QColor getSacColor(int sac, int diveSac);
     145QColor getPressureColor(double density);
    145146struct text_render_options {
    146147        double size;
  • profile-widget/diveprofileitem.cpp

    r49d0bb8 r98a65b7  
    832832                entry = dataModel->data().entry;
    833833                for (int i = 1, count = poly.count(); i < count; i++, entry++) {
    834                         if (entry->sac)
    835                                 pen.setBrush(getSacColor(entry->sac, displayed_dive.sac));
    836                         else
    837                                 pen.setBrush(MED_GRAY_HIGH_TRANS);
     834                        if (!in_planner()) {
     835                                if (entry->sac)
     836                                        pen.setBrush(getSacColor(entry->sac, displayed_dive.sac));
     837                                else
     838                                        pen.setBrush(MED_GRAY_HIGH_TRANS);
     839                        } else {
     840                                pen.setBrush(getPressureColor(entry->density));
     841                        }
    838842                        painter->setPen(pen);
    839843                        painter->drawLine(poly[i - 1], poly[i]);
Note: See TracChangeset for help on using the changeset viewer.