Skip to content

Commit

Permalink
chore: rename isHalt to isStation
Browse files Browse the repository at this point in the history
  • Loading branch information
Grodien committed Nov 19, 2024
1 parent 9c8b724 commit 6a7e6bf
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ class ServicePointRow extends BaseRowBuilder {
@override
DASTableCell informationCell() {
final servicePointName = servicePoint.name.localized;
final textStyle = servicePoint.isHalt
? SBBTextStyles.largeLight.copyWith(fontSize: 24.0, fontStyle: FontStyle.italic)
: SBBTextStyles.largeBold.copyWith(fontSize: 24.0);
final textStyle = servicePoint.isStation
? SBBTextStyles.largeBold.copyWith(fontSize: 24.0)
: SBBTextStyles.largeLight.copyWith(fontSize: 24.0, fontStyle: FontStyle.italic);
return DASTableCell(
alignment: _defaultAlignment,
child: Row(
Expand Down
4 changes: 2 additions & 2 deletions das_client/lib/model/journey/service_point.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class ServicePoint extends BaseData {
{required this.name,
required this.mandatoryStop,
required this.isStop,
required this.isHalt,
required this.isStation,
this.bracketStation,
required super.order,
required super.kilometre})
Expand All @@ -17,6 +17,6 @@ class ServicePoint extends BaseData {
final LocalizedString name;
final bool mandatoryStop;
final bool isStop;
final bool isHalt;
final bool isStation;
final BracketStation? bracketStation;
}
2 changes: 1 addition & 1 deletion das_client/lib/sfera/src/mapper/sfera_model_mapper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class SferaModelMapper {
order: _calculateOrder(segmentIndex, timingPoint.location),
mandatoryStop: tpConstraint.stoppingPointInformation?.stopType?.mandatoryStop ?? true,
isStop: tpConstraint.stopSkipPass == StopSkipPass.stoppingPoint,
isHalt: tafTapLocation.locationType == TafTapLocationType.stoppingLocation,
isStation: tafTapLocation.locationType != TafTapLocationType.stoppingLocation,
bracketStation: _parseBracketStation(tafTapLocations, tafTapLocation),
kilometre: kilometreMap[timingPoint.location] ?? []));
}
Expand Down
13 changes: 13 additions & 0 deletions das_client/test/sfera/mapper/sfera_mapper_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,19 @@ void main() {
expect(servicePoints[4].isStop, true);
});

test('Test station point is parsed correctly', () async {
final journey = getJourney('9999', 5);
final servicePoints = journey.data.where((it) => it.type == Datatype.servicePoint).cast<ServicePoint>().toList();

expect(journey.valid, true);
expect(servicePoints, hasLength(5));
expect(servicePoints[0].isStation, true);
expect(servicePoints[1].isStation, true);
expect(servicePoints[2].isStation, false);
expect(servicePoints[3].isStation, true);
expect(servicePoints[4].isStation, true);
});

test('Test bracket stations is parsed correctly', () async {
final journey = getJourney('9999', 5);
final servicePoints = journey.data.where((it) => it.type == Datatype.servicePoint).cast<ServicePoint>().toList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

<SP_Areas>
<TAF_TAP_Location startEndQualifier="StartsEnds" TAF_TAP_location_abbreviation="C"
TAF_TAP_location_type="station">
TAF_TAP_location_type="stopping location">
<TAF_TAP_LocationIdent>
<CountryCodeISO>CH</CountryCodeISO>
<LocationPrimaryCode>9993</LocationPrimaryCode>
Expand Down

0 comments on commit 6a7e6bf

Please sign in to comment.