Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions frontend/src/api/service/LadeMessdatenService.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type LadeProcessedMessdatenDTO from "@/types/messstelle/LadeProcessedMessdatenDTO";
import type LadeProcessedMesswerteDTO from "@/types/messstelle/LadeProcessedMesswerteDTO";
import type MessstelleOptionsDTO from "@/types/messstelle/MessstelleOptionsDTO";

import FetchService from "@/api/service/FetchService";
Expand All @@ -10,7 +10,7 @@ export default class LadeMessdatenService {
public static ladeMessdatenProcessed(
messstelleId: string,
options: MessstelleOptionsDTO
): Promise<LadeProcessedMessdatenDTO> {
): Promise<LadeProcessedMesswerteDTO> {
return FetchService.postData(
options,
`${this.ENDPOINT_LADE_MESSDATEN_PROCESSED}?messstelle_id=${messstelleId}`,
Expand Down
56 changes: 27 additions & 29 deletions frontend/src/components/messstelle/charts/MessstelleDiagramme.vue
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,9 @@
</template>
<script setup lang="ts">
import type CsvDTO from "@/types/common/CsvDTO";
import type LadeProcessedMessdatenDTO from "@/types/messstelle/LadeProcessedMessdatenDTO";
import type LadeProcessedMesswerteDTO from "@/types/messstelle/LadeProcessedMesswerteDTO";
import type MessstelleInfoDTO from "@/types/messstelle/MessstelleInfoDTO";
import type MessstelleOptionsDTO from "@/types/messstelle/MessstelleOptionsDTO";
import type LadeZaehldatenHeatmapDTO from "@/types/zaehlung/zaehldaten/LadeZaehldatenHeatmapDTO";
import type LadeZaehldatenSteplineDTO from "@/types/zaehlung/zaehldaten/LadeZaehldatenSteplineDTO";
import type LadeZaehldatumDTO from "@/types/zaehlung/zaehldaten/LadeZaehldatumDTO";

import { cloneDeep } from "lodash";
import { computed, ref, watch } from "vue";
Expand Down Expand Up @@ -224,18 +221,8 @@ const REQUEST_PART_SCHEMATISCHE_UEBERSICHT_AS_BASE64_PNG =

const chartDataLoading = ref(false);

const zaehldatenSteplineDTO = ref<LadeZaehldatenSteplineDTO>(
DefaultObjectCreator.createDefaultLadeZaehldatenSteplineDTO()
);

const zaehldatenHeatmapDTO = ref<LadeZaehldatenHeatmapDTO>(
DefaultObjectCreator.createDefaultLadeZaehldatenHeatmapDTO()
);

const listenausgabeDTO = ref<Array<LadeZaehldatumDTO>>([]);

const belastungsplanDataDTO = ref(
DefaultObjectCreator.createDefaultBelastungsplanMessquerschnitteDTO()
const processedMessdatenDTO = ref(
DefaultObjectCreator.createDefaultLadeProcessedMessdatenDTO()
);

const pdfReportDialog = ref(false);
Expand Down Expand Up @@ -268,6 +255,19 @@ const downloadUtils = useDownloadUtils();
const globalInfoMessage = useGlobalInfoMessage();
const dateUtils = useDateUtils();

const zaehldatenSteplineDTO = computed(() => {
return processedMessdatenDTO.value.zaehldatenStepline;
});
const listenausgabeDTO = computed(() => {
return processedMessdatenDTO.value.zaehldatenTable.zaehldaten;
});
const zaehldatenHeatmapDTO = computed(() => {
return processedMessdatenDTO.value.zaehldatenHeatmap;
});
const belastungsplanDataDTO = computed(() => {
return processedMessdatenDTO.value.belastungsplanMessquerschnitte;
});

const drawSchematischeUebersicht = computed(() => {
return (
belastungsplanDataDTO.value &&
Expand Down Expand Up @@ -361,12 +361,8 @@ function loadProcessedChartData() {
chartDataLoading.value = true;
resetData();
LadeMessdatenService.ladeMessdatenProcessed(messstelleId.value, options.value)
.then((processedZaehldaten: LadeProcessedMessdatenDTO) => {
zaehldatenSteplineDTO.value = processedZaehldaten.zaehldatenStepline;
zaehldatenHeatmapDTO.value = processedZaehldaten.zaehldatenHeatmap;
listenausgabeDTO.value = processedZaehldaten.zaehldatenTable.zaehldaten;
belastungsplanDataDTO.value =
processedZaehldaten.belastungsplanMessquerschnitte;
.then((processedZaehldaten: LadeProcessedMesswerteDTO) => {
processedMessdatenDTO.value = processedZaehldaten;
messstelleStore.setIncludedMeasuringDays(
processedZaehldaten.includedMeasuringDays
);
Expand Down Expand Up @@ -395,13 +391,8 @@ function loadProcessedChartData() {
function resetData() {
messstelleStore.setIncludedMeasuringDays(0);
messstelleStore.setRequestedMeasuringDays(0);
zaehldatenSteplineDTO.value =
DefaultObjectCreator.createDefaultLadeZaehldatenSteplineDTO();
zaehldatenHeatmapDTO.value =
DefaultObjectCreator.createDefaultLadeZaehldatenHeatmapDTO();
listenausgabeDTO.value = [];
belastungsplanDataDTO.value =
DefaultObjectCreator.createDefaultBelastungsplanMessquerschnitteDTO();
processedMessdatenDTO.value =
DefaultObjectCreator.createDefaultLadeProcessedMessdatenDTO();
}

function setMaxRangeYAchse() {
Expand Down Expand Up @@ -574,6 +565,13 @@ function generatePdf(): void {
})
);

formData.append(
"messswerte",
new Blob([JSON.stringify(processedMessdatenDTO.value)], {
type: "application/json",
})
);

switch (activeTab.value) {
case TAB_BELASTUNGSPLAN:
if (belastungsplanSvg.value) {
Expand Down
20 changes: 11 additions & 9 deletions frontend/src/components/messstelle/optionsmenue/FilterOptionen.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<span class="text-grey-lighten-1"
>Zeit:
<span class="font-weight-medium text-white"
>{{ zeitblock }}
>{{ zeitauswahl }}
</span>
in
<span class="font-weight-medium text-white"
Expand Down Expand Up @@ -105,6 +105,7 @@
</v-container>
</template>
<script setup lang="ts">
import type KeyVal from "@/types/common/KeyVal";
import type MessstelleInfoDTO from "@/types/messstelle/MessstelleInfoDTO";
import type MessstelleOptionsDTO from "@/types/messstelle/MessstelleOptionsDTO";

Expand Down Expand Up @@ -164,32 +165,33 @@ const zeitraum = computed(() => {
}
});

const zeitblock = computed(() => {
const zeitauswahl = computed(() => {
let text = Zeitauswahl.TAGESWERT.valueOf();
const existsBlock = zeitblockInfo.get(
const chosenBlock: KeyVal | undefined = zeitblockInfo.get(
filterOptionsMessstelle.value.zeitblock
);
const existsStunde = zeitblockStuendlichInfo.get(
const chosenStunde = zeitblockStuendlichInfo.get(
filterOptionsMessstelle.value.zeitblock
);
if (
Zeitauswahl.BLOCK === filterOptionsMessstelle.value.zeitauswahl &&
existsBlock
chosenBlock
) {
text = existsBlock.title;
text = chosenBlock.title;
} else if (
Zeitauswahl.STUNDE === filterOptionsMessstelle.value.zeitauswahl &&
existsStunde
chosenStunde
) {
text = existsStunde.title;
text = chosenStunde.title;
} else if (
Zeitauswahl.SPITZENSTUNDE_KFZ ===
filterOptionsMessstelle.value.zeitauswahl ||
Zeitauswahl.SPITZENSTUNDE_RAD ===
filterOptionsMessstelle.value.zeitauswahl ||
Zeitauswahl.SPITZENSTUNDE_FUSS === filterOptionsMessstelle.value.zeitauswahl
) {
text = filterOptionsMessstelle.value.zeitauswahl;
const blockInfo = chosenBlock ? ` von ${chosenBlock.title}` : ``;
text = `${filterOptionsMessstelle.value.zeitauswahl}${blockInfo}`;
}
if (dateUtils.isDateRange(filterOptionsMessstelle.value.zeitraum)) {
text = `\u00D8 ${text}`;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import type TagesTyp from "@/types/enum/TagesTyp";
import type BelastungsplanMessquerschnitteDTO from "@/types/messstelle/BelastungsplanMessquerschnitteDTO";
import type LadeZaehldatenHeatmapDTO from "@/types/zaehlung/zaehldaten/LadeZaehldatenHeatmapDTO";
import type LadeZaehldatenSteplineDTO from "@/types/zaehlung/zaehldaten/LadeZaehldatenSteplineDTO";
import type LadeZaehldatenTableDTO from "@/types/zaehlung/zaehldaten/LadeZaehldatenTableDTO";

export default interface LadeProcessedMessdatenDTO {
export default interface LadeProcessedMesswerteDTO {
zaehldatenTable: LadeZaehldatenTableDTO;

zaehldatenStepline: LadeZaehldatenSteplineDTO;
Expand All @@ -14,4 +15,6 @@ export default interface LadeProcessedMessdatenDTO {

requestedMeasuringDays: number;
includedMeasuringDays: number;

tagesTyp: TagesTyp;
}
21 changes: 21 additions & 0 deletions frontend/src/util/DefaultObjectCreator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import type ZaehlstelleKarteDTO from "@/types/karte/ZaehlstelleKarteDTO";
import type MessstelleAuswertungOptionsDTO from "@/types/messstelle/auswertung/MessstelleAuswertungOptionsDTO";
import type BelastungsplanMessquerschnitteDTO from "@/types/messstelle/BelastungsplanMessquerschnitteDTO";
import type FahrzeugOptions from "@/types/messstelle/FahrzeugOptions";
import type LadeProcessedMesswerteDTO from "@/types/messstelle/LadeProcessedMesswerteDTO";
import type MessfaehigkeitDTO from "@/types/messstelle/MessfaehigkeitDTO";
import type MessstelleInfoDTO from "@/types/messstelle/MessstelleInfoDTO";
import type MessstelleOptionsDTO from "@/types/messstelle/MessstelleOptionsDTO";
Expand All @@ -16,6 +17,7 @@ import type OptionsDTO from "@/types/zaehlung/OptionsDTO";
import type { StartEndeUhrzeitIntervalls } from "@/types/zaehlung/StartEndeUhrzeitIntervalls";
import type LadeZaehldatenHeatmapDTO from "@/types/zaehlung/zaehldaten/LadeZaehldatenHeatmapDTO";
import type LadeZaehldatenSteplineDTO from "@/types/zaehlung/zaehldaten/LadeZaehldatenSteplineDTO";
import type LadeZaehldatenTableDTO from "@/types/zaehlung/zaehldaten/LadeZaehldatenTableDTO";
import type ZeitauswahlDTO from "@/types/zaehlung/ZeitauswahlDTO";

import StartAndEndDate from "@/types/common/StartAndEndDate";
Expand Down Expand Up @@ -284,6 +286,8 @@ export default class DefaultObjectCreator {
totalRad: 0,
totalPercentSv: 0,
totalPercentGv: 0,
startUhrzeitSpitzenstunde: "",
endeUhrzeitSpitzenstunde: "",
} as BelastungsplanMessquerschnitteDTO;
}

Expand Down Expand Up @@ -327,4 +331,21 @@ export default class DefaultObjectCreator {
zoom: 12,
};
}

public static createDefaultLadeZaehldatenTableDTO(): LadeZaehldatenTableDTO {
return { zaehldaten: [] } as LadeZaehldatenTableDTO;
}

public static createDefaultLadeProcessedMessdatenDTO(): LadeProcessedMesswerteDTO {
return {
zaehldatenTable: this.createDefaultLadeZaehldatenTableDTO(),
zaehldatenStepline: this.createDefaultLadeZaehldatenSteplineDTO(),
zaehldatenHeatmap: this.createDefaultLadeZaehldatenHeatmapDTO(),
belastungsplanMessquerschnitte:
this.createDefaultBelastungsplanMessquerschnitteDTO(),
requestedMeasuringDays: -1,
includedMeasuringDays: -1,
tagesTyp: TagesTyp.UNSPECIFIED,
} as LadeProcessedMesswerteDTO;
}
}
Loading