Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Libraries
KPublicTransport
Commits
0c76e62b
Commit
0c76e62b
authored
Sep 02, 2021
by
Volker Krause
Browse files
Fetch GBFS version, vehicle types and geofencing zone data if available
parent
21fd201a
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/lib/gbfs/gbfs.cpp
View file @
0c76e62b
...
...
@@ -21,6 +21,9 @@ struct {
{
"station_information"
},
{
"station_status"
},
{
"free_bike_status"
},
{
"gbfs_versions"
},
{
"vehicle_types"
},
{
"geofencing_zones"
},
};
static_assert
((
sizeof
(
file_info_map
)
/
sizeof
(
file_info_map
[
0
]))
==
GBFS
::
Unknown
,
""
);
...
...
src/lib/gbfs/gbfs.h
View file @
0c76e62b
...
...
@@ -23,6 +23,9 @@ namespace GBFS
StationInformation
,
StationStatus
,
FreeBikeStatus
,
Versions
,
VehicleTypes
,
GeofencingZones
,
Unknown
,
// keep last
};
...
...
src/lib/gbfs/gbfsjob.cpp
View file @
0c76e62b
...
...
@@ -138,6 +138,9 @@ void GBFSJob::parseDiscoverData(bool sysInfoOnly)
case
GBFS
::
StationInformation
:
case
GBFS
::
StationStatus
:
case
GBFS
::
FreeBikeStatus
:
case
GBFS
::
Versions
:
case
GBFS
::
VehicleTypes
:
case
GBFS
::
GeofencingZones
:
if
(
!
m_store
.
hasCurrentData
(
type
))
{
qDebug
()
<<
"fetching"
<<
name
;
auto
reply
=
m_nam
->
get
(
QNetworkRequest
(
url
));
...
...
src/lib/gbfs/gbfsstore.cpp
View file @
0c76e62b
...
...
@@ -28,7 +28,10 @@ struct {
{
std
::
chrono
::
hours
(
24
*
5
)
},
{
std
::
chrono
::
hours
(
24
*
5
)
},
{
std
::
chrono
::
minutes
(
5
)
},
{
std
::
chrono
::
minutes
(
5
)
}
{
std
::
chrono
::
minutes
(
5
)
},
{
std
::
chrono
::
hours
(
24
*
5
)
},
{
std
::
chrono
::
hours
(
24
*
5
)
},
{
std
::
chrono
::
hours
(
24
*
5
)
},
};
static_assert
((
sizeof
(
file_ttl_map
)
/
sizeof
(
file_ttl_map
[
0
]))
==
GBFS
::
Unknown
,
""
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment