Changeset d83449f in subsurface


Ignore:
Timestamp:
Mar 24, 2017, 9:35:51 AM (4 weeks ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
597539c
Parents:
d600320
git-author:
Stefan Fuchs <sfuchs@…> (03/20/17 14:10:42)
git-committer:
Dirk Hohndel <dirk@…> (03/24/17 09:35:51)
Message:

Don't erroneously mark the cylinder pressure red - second try

Second attempt to do the thing with the red background color for cylinder
start and end pressure correctly. This now should cover all scenarios.

This rewrites and partitially reverts commit b8e044d

Signed-off-by: Stefan Fuchs <sfuchs@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • qt-models/cylindermodel.cpp

    r8834fc0 rd83449f  
    148148                case START:
    149149                case END:
    150                         if ((cyl->start.mbar && !cyl->end.mbar && !cyl->sample_end.mbar) ||
    151                                         (cyl->end.mbar && cyl->start.mbar <= cyl->end.mbar))
     150                        pressure_t startp, endp;
     151                        startp = cyl->start.mbar ? cyl->start : cyl->sample_start;
     152                        endp = cyl->end.mbar ? cyl->end : cyl->sample_end;
     153                        if ((startp.mbar && !endp.mbar) ||
     154                                        (endp.mbar && startp.mbar <= endp.mbar))
    152155                                ret = REDORANGE1_HIGH_TRANS;
    153156                        break;
     
    158161                QFont font = defaultModelFont();
    159162                switch (index.column()) {
     163                // if we don't have manually set pressure data use italic font
    160164                case START:
    161165                        font.setItalic(!cyl->start.mbar);
    162166                        break;
    163167                case END:
    164                         font.setItalic(!cyl->end.mbar && !cyl->sample_end.mbar);
     168                        font.setItalic(!cyl->end.mbar);
    165169                        break;
    166170                }
Note: See TracChangeset for help on using the changeset viewer.