-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding RMV.de for southern/central Hesse, Germany
Adding support for Rhein-Main-Verkehrsverbund (RMV), the transport network serving the Frankfurt metropolitan area in southern and central Hesse, Germany. The implementation is actually quite simple, as RMV uses HAFAS, inheriting and specializing the existing ParserHafasXml class.
- Loading branch information
Showing
6 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#include "parser_xmlrmvde.h" | ||
|
||
#include <QNetworkReply> | ||
|
||
ParserXmlRMVde::ParserXmlRMVde(QObject *parent) : | ||
ParserHafasXml(parent) | ||
{ | ||
baseXmlUrl = QLatin1String("http://www.rmv.de/auskunft/bin/jp/query.exe"); | ||
baseUrl = QLatin1String("http://www.rmv.de/auskunft/bin/jp/query.exe"); | ||
} | ||
|
||
void ParserXmlRMVde::parseStationsByName(QNetworkReply *networkReply) | ||
{ | ||
const QString data = QString::fromUtf8(networkReply->readAll()); | ||
const StationsList result = internalParseStationsByName(data); | ||
emit stationsResult(result); | ||
} | ||
|
||
QString ParserXmlRMVde::getTrainRestrictionsCodes(int trainrestrictions) | ||
{ | ||
Q_UNUSED(trainrestrictions) | ||
// TODO should something else get returned? | ||
return "1111111111111111"; | ||
} | ||
|
||
QStringList ParserXmlRMVde::getTrainRestrictions() | ||
{ | ||
QStringList result; | ||
result.append(tr("All")); | ||
return result; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/**************************************************************************** | ||
** | ||
** This file is a part of Fahrplan. | ||
** | ||
** This program is free software; you can redistribute it and/or modify | ||
** it under the terms of the GNU General Public License as published by | ||
** the Free Software Foundation; either version 2 of the License, or | ||
** (at your option) any later version. | ||
** | ||
** This program is distributed in the hope that it will be useful, | ||
** but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
** GNU General Public License for more details. | ||
** | ||
** You should have received a copy of the GNU General Public License along | ||
** with this program. If not, see <http://www.gnu.org/licenses/>. | ||
** | ||
****************************************************************************/ | ||
|
||
#ifndef PARSER_XMLRMVDE_H | ||
#define PARSER_XMLRMVDE_H | ||
|
||
#include "parser_hafasxml.h" | ||
|
||
class ParserXmlRMVde : public ParserHafasXml | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
explicit ParserXmlRMVde(QObject *parent = 0); | ||
static QString getName() { return QString(QLatin1String("%1 (rmv.de)")).arg(tr("Germany, Hesse")); } | ||
virtual QString name() { return getName(); } | ||
virtual QString shortName() { return QLatin1String("rmv.de"); } | ||
|
||
protected: | ||
void parseStationsByName(QNetworkReply *networkReply); | ||
QStringList getTrainRestrictions(); | ||
QString getTrainRestrictionsCodes(int trainrestrictions); | ||
}; | ||
|
||
#endif // PARSER_XMLRMVDE_H |