* Corrected station name parsing as condition for valid report
pull/1/head
David Freese 2012-02-15 07:01:34 -06:00
rodzic c3a79c0fc2
commit d2d254e5d3
3 zmienionych plików z 12 dodań i 13 usunięć

Wyświetl plik

@ -6972,7 +6972,6 @@ d frequency"));
{ tabsMisc = new Fl_Tabs(4, 25, 592, 345);
tabsMisc->selection_color(FL_LIGHT1);
{ tabCPUspeed = new Fl_Group(4, 50, 592, 320, _("CPU"));
tabCPUspeed->hide();
{ Fl_Group* o = new Fl_Group(6, 60, 588, 51);
o->box(FL_ENGRAVED_FRAME);
o->align(Fl_Align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE));
@ -7348,6 +7347,7 @@ d frequency"));
tabDTMFdecode->end();
} // Fl_Group* tabDTMFdecode
{ tabWX = new Fl_Group(4, 50, 592, 320, _("WX"));
tabWX->hide();
{ Fl_Group* o = new Fl_Group(6, 60, 588, 300, _("Weather query specification"));
o->box(FL_ENGRAVED_FRAME);
o->align(Fl_Align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE));

Wyświetl plik

@ -3767,7 +3767,7 @@ progdefaults.changed = true;}
} {
Fl_Group tabCPUspeed {
label CPU open
xywh {4 50 592 320} hide
xywh {4 50 592 320}
} {
Fl_Group {} {open
xywh {6 60 588 51} box ENGRAVED_FRAME align 21
@ -4097,7 +4097,7 @@ progdefaults.changed = true;}
}
Fl_Group tabWX {
label WX
xywh {4 50 592 320}
xywh {4 50 592 320} hide
} {
Fl_Group {} {
label {Weather query specification} open

Wyświetl plik

@ -236,23 +236,23 @@ void getwx(string& wx, const char *metar)
LOG_WARN("%s", "station not found\n");
return;
}
p1 = text.rfind("\n", p2);
if (p1 == string::npos) {
LOG_WARN("%s", "station not found\n");
return;
const char *eoh = "Connection: close";
p1 = text.find(eoh);
if (p1 != string::npos) {
text.erase(0, p1 + strlen(eoh) + 4);
p1 = text.find("\n");
if (p1 != string::npos)
name = text.substr(0, p1);
}
p1++;
p3 = text.find("ob:", p2);
p3 = text.find("ob:");
if (p3 == string::npos) {
LOG_WARN("%s", "observations not available\n");
return;
}
string wx_full = text.substr(p1, p3 - p1);
if (progdefaults.wx_full) {
wx.assign(wx_full);//text.substr(p1));
wx.assign(text.substr(0, p3));
return;
}
//printf("%s\n",wx_full.c_str());
@ -264,7 +264,6 @@ void getwx(string& wx, const char *metar)
text.erase(0, p + 1 + wxsta.length());
p = text.find("\n");
if (p != string::npos) text.erase(p);
//printf("%s\n", text.c_str());
// parse field contents
bool parsed = false;