Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug/dave 393 belastungsplan #259

Merged
merged 3 commits into from
Jan 8, 2025
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ function draw() {
.map((value, key) => ({ direction: key, data: value }))
.value();
drawArrowsPointingSouth(groupedByDirection);
startX.value += 50;
startX.value += 85;
drawStreetName();
drawTotal();
startX.value += 90;
startX.value += 130;
drawArrowsPointingNorth(groupedByDirection);
rotateArrowsIfNecessary();
drawMessstelleInfo();
Expand Down Expand Up @@ -220,7 +220,8 @@ function addSumSouthIfNecessary(
sumMqSv,
sumMqRad,
percentageMqGv,
percentageMqSv
percentageMqSv,
true
);
}
}
Expand All @@ -244,7 +245,8 @@ function drawTotal() {
props.belastungsplanData.totalSv,
props.belastungsplanData.totalRad,
props.belastungsplanData.totalPercentGv,
props.belastungsplanData.totalPercentSv
props.belastungsplanData.totalPercentSv,
true
);
addTextSouthSide(
startX.value,
Expand All @@ -254,7 +256,8 @@ function drawTotal() {
props.belastungsplanData.totalSv,
props.belastungsplanData.totalRad,
props.belastungsplanData.totalPercentGv,
props.belastungsplanData.totalPercentSv
props.belastungsplanData.totalPercentSv,
true
);
}

Expand Down Expand Up @@ -354,7 +357,8 @@ function addSumNorthIfNecessary(
sumMqSv,
sumMqRad,
percentageMqGv,
percentageMqSv
percentageMqSv,
true
);
}
}
Expand All @@ -374,13 +378,14 @@ function rotateArrowsIfNecessary() {
function addTextToQuerschnittGroup(
text: number | string,
x: number,
y: number
y: number,
bold: boolean
) {
querschnittGroup.value.add(
SVG.SVG()
.text(`${text}`)
.font({
weight: "bold",
weight: bold ? "bold" : "normal",
})
.rotate(270, x, y)
.move(x, y)
Expand All @@ -399,18 +404,20 @@ function addTextSouthSide(
sv: number,
rad: number,
percentGv: number | string,
percentSv: number | string
percentSv: number | string,
bold: boolean = false
) {
let textposition = 2;
if (chosenOptionsCopyFahrzeuge.value.radverkehr) {
addTextToQuerschnittGroup(`${rad}`, startPointX, startPointY);
addTextToQuerschnittGroup(`${rad}`, startPointX, startPointY, bold);
startPointY += 85;
}
if (isGvpInBelastungsPlan.value) {
addTextToQuerschnittGroup(
addBracketsDependingOnPostition(`${percentGv}%`, textposition),
startPointX,
startPointY
startPointY,
bold
);
startPointY += 85;
textposition -= 1;
Expand All @@ -419,7 +426,8 @@ function addTextSouthSide(
addTextToQuerschnittGroup(
addBracketsDependingOnPostition(`${percentSv}%`, textposition),
startPointX,
startPointY
startPointY,
bold
);
startPointY += 85;
textposition -= 1;
Expand All @@ -428,7 +436,8 @@ function addTextSouthSide(
addTextToQuerschnittGroup(
addBracketsDependingOnPostition(gv, textposition),
startPointX,
startPointY
startPointY,
bold
);
startPointY += 85;
textposition -= 1;
Expand All @@ -437,12 +446,13 @@ function addTextSouthSide(
addTextToQuerschnittGroup(
addBracketsDependingOnPostition(`${sv}`, textposition),
startPointX,
startPointY
startPointY,
bold
);
startPointY += 85;
}
if (chosenOptionsCopyFahrzeuge.value.kraftfahrzeugverkehr) {
addTextToQuerschnittGroup(kfz, startPointX, startPointY);
addTextToQuerschnittGroup(kfz, startPointX, startPointY, bold);
}
}

Expand All @@ -454,19 +464,21 @@ function addTextNorthSide(
sv: number,
rad: number,
percentGv: number | string,
percentSv: number | string
percentSv: number | string,
bold: boolean = false
) {
let textposition = 0;
if (chosenOptionsCopyFahrzeuge.value.kraftfahrzeugverkehr) {
addTextToQuerschnittGroup(kfz, startPointX, startPointY);
addTextToQuerschnittGroup(kfz, startPointX, startPointY, bold);
startPointY -= 85;
textposition += 1;
}
if (chosenOptionsCopyFahrzeuge.value.schwerverkehr) {
addTextToQuerschnittGroup(
addBracketsDependingOnPostition(sv, textposition),
startPointX,
startPointY
startPointY,
bold
);
startPointY -= 85;
textposition += 1;
Expand All @@ -475,7 +487,8 @@ function addTextNorthSide(
addTextToQuerschnittGroup(
addBracketsDependingOnPostition(gv, textposition),
startPointX,
startPointY
startPointY,
bold
);
startPointY -= 85;
textposition += 1;
Expand All @@ -484,7 +497,8 @@ function addTextNorthSide(
addTextToQuerschnittGroup(
addBracketsDependingOnPostition(`${percentSv}%`, textposition),
startPointX,
startPointY
startPointY,
bold
);
startPointY -= 85;
textposition += 1;
Expand All @@ -493,11 +507,12 @@ function addTextNorthSide(
addTextToQuerschnittGroup(
addBracketsDependingOnPostition(`${percentGv}%`, textposition),
startPointX,
startPointY
startPointY,
bold
);
}
if (chosenOptionsCopyFahrzeuge.value.radverkehr) {
addTextToQuerschnittGroup(`${rad}`, startPointX, startPointY);
addTextToQuerschnittGroup(`${rad}`, startPointX, startPointY, bold);
}
}

Expand Down
Loading