Skip to content

Commit 8e5903f

Browse files
authored
Merge pull request #693 from ourairquality/qt-refdlg-relax-id-name
qt app refdlg: relax id and name test, fix dist start index
2 parents 054a8c7 + b7225c3 commit 8e5903f

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

app/qtapp/appcmn_qt/refdlg.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,16 @@ void RefDialog::loadList(QString filename)
116116

117117
QList<QByteArray> tokens = buff.trimmed().split(' ');
118118

119-
if (tokens.size() != 5) continue;
119+
if (tokens.size() < 3) continue;
120120

121121
ui->tWStationList->setRowCount(++n);
122122

123123
for (int i = 0; i < 3; i++)
124124
pos[i] = tokens.at(i).toDouble();
125125

126-
addReference(n, pos, tokens.at(3), tokens.at(4));
127-
}
126+
addReference(n, pos, tokens.size() > 3 ? tokens.at(3) : "",
127+
tokens.size() > 4 ? tokens.at(4) : "");
128+
}
128129
if (n == 0) ui->tWStationList->setRowCount(0);
129130

130131
updateDistances();
@@ -212,7 +213,7 @@ void RefDialog::updateDistances()
212213
pos[1] *= D2R;
213214
pos2ecef(pos, ru);
214215

215-
for (int i = 1; i < ui->tWStationList->rowCount(); i++) {
216+
for (int i = 0; i < ui->tWStationList->rowCount(); i++) {
216217
if (ui->tWStationList->item(i, 1)->text() == "") continue;
217218

218219
pos[0] = ui->tWStationList->item(i, 1)->text().toDouble(&ok) * D2R;

app/qtapp/appcmn_qt/refdlg.ui

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>542</width>
9+
<width>900</width>
1010
<height>445</height>
1111
</rect>
1212
</property>

0 commit comments

Comments
 (0)