Skip to content

Commit

Permalink
rtkplot: count all observation frequencies
Browse files Browse the repository at this point in the history
and for rtkplot_qt correct the legend color.
  • Loading branch information
ourairquality committed Aug 17, 2024
1 parent fbde607 commit 01bb3d8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions app/qtapp/rtkplot_qt/plotcmn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,13 @@ void Plot::showLegend(const QStringList &msgs)

for (int i = 0; (i < 7) & (i < msgs.count()); i++) {
lblQL[i]->setText(msgs[i]);
setWidgetTextColor(lblQL[i], plotOptDialog->getMarkerColor(sel, i + 1));
int col = i + 1; // Default coloring follows the marker color index
if (msgs[0] == " #OBS = 5 ") {
// Match the legend color to the observation color, see observationColor()
int n = i < 5 ? 5 - i : 0;
col = 3 - n + (n > 2 ? 5 : 0);
}
setWidgetTextColor(lblQL[i], plotOptDialog->getMarkerColor(sel, col));
lblQL[i]->adjustSize();
lblQL[i]->updateGeometry();
}
Expand Down Expand Up @@ -316,7 +322,7 @@ QColor Plot::observationColor(const obsd_t *obs, double az, double el, QVariant
if (simulatedObservation) {
color = sysColor(obs->sat);
} else if (obstype.isNull()) { // "ALL" selected
for (i = n = 0; i < NFREQ && n < 5; i++) {
for (i = n = 0; i < NFREQ + NEXOBS && n < 5; i++) {
if (obs->L[i] != 0.0 || obs->P[i] != 0.0) n++;
}
if (n == 0) {
Expand Down
2 changes: 1 addition & 1 deletion app/winapp/rtkplot/plotcmn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ TColor __fastcall TPlot::ObsColor(const obsd_t *obs, double az, double el)
color=SysColor(obs->sat);
}
else if (!strcmp(obstype,"ALL")) {
for (i=n=0;i<NFREQ&&n<5;i++) {
for (i=n=0;i<NFREQ+NEXOBS&&n<5;i++) {
if (obs->L[i]!=0.0||obs->P[i]!=0.0) n++;
}
if (n==0) {
Expand Down

0 comments on commit 01bb3d8

Please sign in to comment.