Skip to content

Commit

Permalink
adapt method api for ganglinie creation
Browse files Browse the repository at this point in the history
  • Loading branch information
boal committed Nov 21, 2024
1 parent a2153a8 commit 55aeba2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ protected static void setSeriesIndexForFirstChartPercent(final StepLineSeriesEnt
}

// Refactoring: Synergieeffekt mit ProcessZaehldatenSteplineService nutzen
public LadeZaehldatenSteplineDTO ladeGanglinie(final List<IntervalDto> intervals, final MessstelleOptionsDTO options) {
public LadeZaehldatenSteplineDTO ladeGanglinie(final List<IntervalDto> intervals, final FahrzeugOptionsDTO fahrzeugOptions) {
log.debug("#ladeGanglinie");
final var ladeZaehldatenStepline = new LadeZaehldatenSteplineDTO();
ladeZaehldatenStepline.setRangeMax(0);
Expand All @@ -104,7 +104,6 @@ public LadeZaehldatenSteplineDTO ladeGanglinie(final List<IntervalDto> intervals
ladeZaehldatenStepline.setSeriesEntriesFirstChart(new ArrayList<>());

final var seriesEntries = new SeriesEntries();
final var fahrzeugOptions = options.getFahrzeuge();

intervals
.forEach(interval -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public LadeProcessedMesswerteDTO ladeMesswerte(final String messstelleId, final
.toList();

final var processedZaehldaten = new LadeProcessedMesswerteDTO();
processedZaehldaten.setZaehldatenStepline(ganglinieService.ladeGanglinie(intervals, options));
processedZaehldaten.setZaehldatenStepline(ganglinieService.ladeGanglinie(intervals, options.getFahrzeuge()));
processedZaehldaten.setZaehldatenHeatmap(heatmapService.ladeHeatmap(intervals, options));
processedZaehldaten.setZaehldatenTable(listenausgabeService.ladeListenausgabe(intervals, isKfzMessstelle, options));
processedZaehldaten
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import de.muenchen.dave.domain.dtos.laden.StepLineSeriesEntryBigDecimalDTO;
import de.muenchen.dave.domain.dtos.laden.StepLineSeriesEntryIntegerDTO;
import de.muenchen.dave.domain.dtos.messstelle.FahrzeugOptionsDTO;
import de.muenchen.dave.domain.dtos.messstelle.MessstelleOptionsDTO;
import de.muenchen.dave.geodateneai.gen.model.IntervalDto;
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
Expand Down Expand Up @@ -85,7 +84,6 @@ void ladeGanglinie() {
interval2.setProzentSchwerverkehr(BigDecimal.valueOf(14));

final var intervals = List.of(interval0, interval1, interval2);
final var options = new MessstelleOptionsDTO();
final var optionsFahrzeuge = new FahrzeugOptionsDTO();
optionsFahrzeuge.setKraftfahrzeugverkehr(true);
optionsFahrzeuge.setSchwerverkehr(true);
Expand All @@ -100,9 +98,8 @@ void ladeGanglinie() {
optionsFahrzeuge.setLastzuege(true);
optionsFahrzeuge.setBusse(true);
optionsFahrzeuge.setKraftraeder(true);
options.setFahrzeuge(optionsFahrzeuge);

final var result = ganglinieService.ladeGanglinie(intervals, options);
final var result = ganglinieService.ladeGanglinie(intervals, optionsFahrzeuge);

final var expected = new LadeZaehldatenSteplineDTO();
expected.setLegend(List.of("Pkw", "Lkw", "Lz", "Lfw", "Busse", "Krad", "Rad", "Kfz", "SV", "SV %", "GV", "GV %"));
Expand Down

0 comments on commit 55aeba2

Please sign in to comment.