Skip to content
This repository has been archived by the owner on May 4, 2024. It is now read-only.

Commit

Permalink
cleaning plus using distance survey for images
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosantiagomuro committed Dec 18, 2023
1 parent fc0670e commit 90a28f2
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 14 deletions.
7 changes: 3 additions & 4 deletions backend/src/images/image.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ export class ImageService {
* @author Kerbourc'h
*/
formatImagePath(image: IImage) {
image.image_path = image.image_path.replace(
process.env.IMAGE_STORE_PATH,
'/cdn/',
);
image.image_path = image.image_path
.replace(process.env.IMAGE_STORE_PATH, '/cdn/')
.replace('/home/fish/images/', '/cdn/');
return image;
}

Expand Down
6 changes: 2 additions & 4 deletions frontend/src/Components/RoadDetails/ImageGallery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,21 @@ const ImageGallery: React.FC<Props> = ({ rangeDashCamImages }) => {
getImagesForASurvey(id, true, (images) => {
setCameraImages(
images.filter((image) => {
console.log('santi0', rangeDashCamImages);
if (rangeDashCamImages === undefined || rangeDashCamImages === null)
return true;
return (
image.distance_way >=
image.distance_survey >=
(rangeDashCamImages.minRange - 5 > 0
? rangeDashCamImages.minRange - 5
: 0) &&
image.distance_way <=
image.distance_survey <=
(rangeDashCamImages.maxRange + 5 <
rangeDashCamImages.maxRangeSurvey
? rangeDashCamImages.maxRange + 5
: rangeDashCamImages.maxRangeSurvey)
);
}),
);
console.log('santiVIVA', cameraImages);
});
} else if (type === 'paths') {
getImagesForWays(id.split(','), true, (images) => {
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/Components/RoadDetails/MapArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ interface Props {
/** The distance from left to right displayed on surface images */
rangeDashCamImages?: IRangeForDashCam | null;
}

/**
* The map area op the road details(road inspect) page
*/
Expand Down Expand Up @@ -45,4 +46,8 @@ const MapArea: React.FC<Props> = ({
);
};

// {rangeDashCamImages !== undefined && rangeDashCamImages !== null ? (
// <ImageGallery rangeDashCamImages={rangeDashCamImages} />
// ) : null} should we put something like this?

export default MapArea;
6 changes: 3 additions & 3 deletions frontend/src/models/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ export interface Conditions {
}

export interface IRangeForDashCam {
minRange: number;
maxRange: number;
maxRangeSurvey: number;
minRange: number;
maxRange: number;
maxRangeSurvey: number;
}

export interface Path {
Expand Down
3 changes: 0 additions & 3 deletions frontend/src/pages/Inspect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@ const Inspect: FC = () => {
}, [data]);

useEffect(() => {
console.log('santi33', roadDistanceLeftToRight);
console.log('santi44', chartData);
if (
gradientLineData === undefined ||
roadDistanceLeftToRight === null ||
Expand All @@ -142,7 +140,6 @@ const Inspect: FC = () => {
maxRange: roadDistanceLeftToRight[1],
maxRangeSurvey: Math.max(...chartData.map((item) => item.maxX)) + 1,
});
console.log('santi55 rangeForDashCamImages', rangeForDashCamImages);
}, [roadDistanceLeftToRight]);

useEffect(() => {
Expand Down

0 comments on commit 90a28f2

Please sign in to comment.