diff --git a/app/src/components/layout/sidebarRight/properties/AisleProperties.tsx b/app/src/components/layout/sidebarRight/properties/AisleProperties.tsx
index c277812..f354844 100644
--- a/app/src/components/layout/sidebarRight/properties/AisleProperties.tsx
+++ b/app/src/components/layout/sidebarRight/properties/AisleProperties.tsx
@@ -23,39 +23,20 @@ interface TextureItem {
const AisleProperties: React.FC = () => {
const [collapsePresets, setCollapsePresets] = useState(false);
const [collapseTexture, setCollapseTexture] = useState(true);
- const { aisleType, aisleWidth, aisleColor, setAisleType, setAisleColor, setAisleWidth } = useBuilderStore();
+
+ const { aisleType, aisleWidth, aisleColor, dashLength, gapLength, dotRadius, aisleLength, setAisleType, setAisleColor, setAisleWidth, setDashLength, setGapLength, setDotRadius, setAisleLength } = useBuilderStore();
const aisleTextureList: TextureItem[] = [
- {
- color: "yellow",
- id: "yellow1",
- brief: "pedestrian walkways",
- texture: "",
- },
+ { color: "yellow", id: "yellow1", brief: "pedestrian walkways", texture: "" },
{ color: "gray", id: "gray", brief: "basic", texture: "" },
{ color: "green", id: "green1", brief: "pedestrian walkways", texture: "" },
{ color: "orange", id: "orange", brief: "material flow", texture: "" },
{ color: "blue", id: "blue", brief: "vehicle paths", texture: "" },
{ color: "purple", id: "purple", brief: "material flow", texture: "" },
{ color: "red", id: "red", brief: "safety zone", texture: "" },
- {
- color: "bright green",
- id: "bright-green",
- brief: "safety zone",
- texture: "",
- },
- {
- color: "yellow-black",
- id: "yellow-black",
- brief: "utility aisles",
- texture: "",
- },
- {
- color: "white-black",
- id: "white-black",
- brief: "utility aisles",
- texture: "",
- },
+ { color: "bright green", id: "bright-green", brief: "safety zone", texture: "" },
+ { color: "yellow-black", id: "yellow-black", brief: "utility aisles", texture: "" },
+ { color: "white-black", id: "white-black", brief: "utility aisles", texture: "" },
];
const aisleTypes: {
@@ -64,77 +45,148 @@ const AisleProperties: React.FC = () => {
id: string;
thumbnail: string;
}[] = [
- {
- name: "Solid",
- type: "solid-aisle",
- id: "1",
- thumbnail: Solid,
- },
- {
- name: "Dotted",
- type: "dotted-aisle",
- id: "2",
- thumbnail: Dotted,
- },
- {
- name: "Dashed",
- type: "dashed-aisle",
- id: "3",
- thumbnail: Dashed,
- },
- {
- name: "Arrow",
- type: "arrow-aisle",
- id: "4",
- thumbnail: Arrow,
- },
- {
- name: "Contiuous Arrows",
- type: "arrows-aisle",
- id: "5",
- thumbnail: Arrows,
- },
- {
- name: "Directional",
- type: "junction-aisle",
- id: "6",
- thumbnail: Directional,
- },
- {
- name: "Arc",
- type: "arc-aisle",
- id: "7",
- thumbnail: Arc,
- },
- {
- name: "Circle",
- type: "circle-aisle",
- id: "8",
- thumbnail: Circle,
- },
+ { name: "Solid", type: "solid-aisle", id: "1", thumbnail: Solid },
+ { name: "Dotted", type: "dotted-aisle", id: "2", thumbnail: Dotted },
+ { name: "Dashed", type: "dashed-aisle", id: "3", thumbnail: Dashed },
+ { name: "Arrow", type: "arrow-aisle", id: "4", thumbnail: Arrow },
+ { name: "Continuous Arrows", type: "arrows-aisle", id: "5", thumbnail: Arrows },
+ { name: "Directional", type: "junction-aisle", id: "6", thumbnail: Directional },
+ { name: "Arc", type: "arc-aisle", id: "7", thumbnail: Arc },
+ { name: "Circle", type: "circle-aisle", id: "8", thumbnail: Circle },
];
const handleAisleWidthChange = (value: string) => {
const width = parseFloat(value);
- if (isNaN(width)) {
- return;
+ if (!isNaN(width)) {
+ setAisleWidth(width);
}
- setAisleWidth(width);
- }
+ };
+
+ const handleDashLengthChange = (value: string) => {
+ const length = parseFloat(value);
+ if (!isNaN(length)) {
+ setDashLength(length);
+ }
+ };
+
+ const handleGapLengthChange = (value: string) => {
+ const length = parseFloat(value);
+ if (!isNaN(length)) {
+ setGapLength(length);
+ }
+ };
+
+ const handleDotRadiusChange = (value: string) => {
+ const radius = parseFloat(value);
+ if (!isNaN(radius)) {
+ setDotRadius(radius);
+ }
+ };
+
+ const handleAisleLengthChange = (value: string) => {
+ const length = parseFloat(value);
+ if (!isNaN(length)) {
+ setAisleLength(length);
+ }
+ };
+
+ const renderAdvancedProperties = () => {
+ switch (aisleType) {
+ case 'dashed-aisle':
+ return (
+ <>
+ {aisleType &&
+ <>
+
+
+ >
+ }
+ >
+ );
+ case 'dotted-aisle':
+ return (
+ <>
+ {aisleType &&
+ <>
+
+ >
+ }
+ >
+ );
+ case 'arrows-aisle':
+ return (
+ <>
+ {aisleType &&
+ <>
+
+ >
+ }
+ >
+ );
+ default:
+ return null;
+ }
+ };
return (
Properties
+
+ {/* Basic Properties */}
-
+ {aisleType !== 'dotted-aisle' &&
+
+ }
+ {renderAdvancedProperties()}
{/* Presets */}
@@ -154,12 +206,9 @@ const AisleProperties: React.FC = () => {
{aisleTypes.map((val) => (
@@ -177,10 +226,7 @@ const AisleProperties: React.FC = () => {
aria-expanded={!collapseTexture}
>
Aisle Texture
-
+
@@ -191,8 +237,7 @@ const AisleProperties: React.FC = () => {