Solver Display Color Code Tau

.. red low, green mid, blue high
This commit is contained in:
Mark Liversedge
2016-03-16 18:44:09 +00:00
parent a314f28847
commit ee3bcb4224
3 changed files with 14 additions and 3 deletions

View File

@@ -378,7 +378,7 @@ SolveCPDialog::current(int k,WBParms p,double sum)
else csumLabel->setText(QString("%1").arg(sum, 0, 'f', 3));
// visualise new point
solverDisplay->addPoint(SolverPoint(p.CP, p.W, sum));
solverDisplay->addPoint(SolverPoint(p.CP, p.W, sum, p.TAU));
if (!(k++%200) || k == 99999) QApplication::processEvents();
}

View File

@@ -84,7 +84,17 @@ SolverDisplay::paintEvent(QPaintEvent *)
case 0: { bcolor = QColor(0xed,0xf8,0xe9); size = 1; } break;
case 1: { bcolor = QColor(0xba,0xe4,0xb3); size = 2; } break;
case 2: { bcolor = QColor(0x74,0xc4,0x76); size = 3; } break;
case 3: { bcolor = QColor(0x23,0x8b,0x45); size = 5; } break;
case 3: {
if (p.t < 80) bcolor=QColor(255,0,0); // diff low
else if (p.t < 150) bcolor = QColor(0x23,0x8b,0x45); // diff mid
else if (p.t < 300) bcolor = QColor(0,0,255); // diff high
else if (p.t < 433) bcolor=QColor(255,0,0); // integral low
else if (p.t < 566) bcolor = QColor(0x23,0x8b,0x45); // integral mid
else if (p.t <= 700) bcolor = QColor(0,0,255); // integral high
size=5;
}
break;
}
painter.setBrush(bcolor);

View File

@@ -31,9 +31,10 @@
struct SolverPoint {
public:
SolverPoint(int x, int y, double z) : x(x), y(y), z(z) {}
SolverPoint(int x, int y, double z, int t) : x(x), y(y), z(z), t(t) {}
int x,y;
double z;
int t;
};
class SolverDisplay : public QWidget