@@ -48,22 +53,25 @@ const SideBarRight: React.FC = () => {
{activeModule === "simulation" && (
<>
setSubModule("analysis")}
>
@@ -75,12 +83,21 @@ const SideBarRight: React.FC = () => {
{/* process builder */}
{toggleUI &&
subModule === "properties" &&
- activeModule !== "visualization" && (
+ activeModule !== "visualization" &&
+ !selectedFloorItem && (
+ )}
+ {toggleUI &&
+ subModule === "properties" &&
+ activeModule !== "visualization" &&
+ selectedFloorItem && (
+
)}
@@ -89,9 +106,7 @@ const SideBarRight: React.FC = () => {
activeModule === "builder" && (
)}
@@ -99,20 +114,24 @@ const SideBarRight: React.FC = () => {
{toggleUI && activeModule === "simulation" && (
<>
- {subModule === "mechanics" && selectedActionSphere && selectedActionSphere.path.type === "Conveyor" && (
-
-
-
+ {subModule === "mechanics" &&
+ selectedActionSphere &&
+ selectedActionSphere.path.type === "Conveyor" && (
+
-
- )}
- {subModule === "mechanics" && selectedActionSphere && selectedActionSphere.path.type === "Vehicle" && (
-
-
-
+ )}
+ {subModule === "mechanics" &&
+ selectedActionSphere &&
+ selectedActionSphere.path.type === "Vehicle" && (
+
-
- )}
+ )}
{subModule === "mechanics" && !selectedActionSphere && (
diff --git a/app/src/components/layout/sidebarRight/customInput/PositionInputs.tsx b/app/src/components/layout/sidebarRight/customInput/PositionInputs.tsx
index b65d782..881e225 100644
--- a/app/src/components/layout/sidebarRight/customInput/PositionInputs.tsx
+++ b/app/src/components/layout/sidebarRight/customInput/PositionInputs.tsx
@@ -4,12 +4,16 @@ interface PositionInputProps {
onChange: (value: string) => void; // Callback for value change
placeholder?: string; // Optional placeholder
type?: string; // Input type (e.g., text, number, email)
+ value1?: number;
+ value2?: number;
}
const PositionInput: React.FC
= ({
onChange,
placeholder = "Enter value", // Default placeholder
type = "number", // Default type
+ value1 = "number",
+ value2 = "number",
}) => {
return (
@@ -22,6 +26,7 @@ const PositionInput: React.FC
= ({
type={type}
onChange={(e) => onChange(e.target.value)}
placeholder={placeholder}
+ value={value2}
/>
@@ -31,6 +36,7 @@ const PositionInput: React.FC
= ({
type={type}
onChange={(e) => onChange(e.target.value)}
placeholder={placeholder}
+ value={value1}
/>
diff --git a/app/src/components/layout/sidebarRight/customInput/RotationInput.tsx b/app/src/components/layout/sidebarRight/customInput/RotationInput.tsx
index 3ab01a4..962e967 100644
--- a/app/src/components/layout/sidebarRight/customInput/RotationInput.tsx
+++ b/app/src/components/layout/sidebarRight/customInput/RotationInput.tsx
@@ -4,17 +4,19 @@ interface RotationInputProps {
onChange: (value: string) => void; // Callback for value change
placeholder?: string; // Optional placeholder
type?: string; // Input type (e.g., text, number, email)
+ value?: number;
}
const RotationInput: React.FC
= ({
onChange,
placeholder = "Enter value", // Default placeholder
type = "number", // Default type
+ value = "number",
}) => {
return (
Rotation
-
+
diff --git a/app/src/components/layout/sidebarRight/properties/AssetProperties.tsx b/app/src/components/layout/sidebarRight/properties/AssetProperties.tsx
index 8309024..c47fd81 100644
--- a/app/src/components/layout/sidebarRight/properties/AssetProperties.tsx
+++ b/app/src/components/layout/sidebarRight/properties/AssetProperties.tsx
@@ -1,9 +1,11 @@
-import React, { useState } from "react";
+import React, { useEffect, useState } from "react";
import InputToggle from "../../../ui/inputs/InputToggle";
import InputWithDropDown from "../../../ui/inputs/InputWithDropDown";
import { RemoveIcon } from "../../../icons/ExportCommonIcons";
import PositionInput from "../customInput/PositionInputs";
import RotationInput from "../customInput/RotationInput";
+import { useselectedFloorItem } from "../../../../store/store";
+import * as THREE from "three";
interface UserData {
id: number; // Unique identifier for the user data
@@ -14,7 +16,13 @@ interface UserData {
const AssetProperties: React.FC = () => {
const [userData, setUserData] = useState
([]); // State to track user data
const [nextId, setNextId] = useState(1); // Unique ID for new entries
+ const { selectedFloorItem } = useselectedFloorItem();
+ let xValue = selectedFloorItem.position.x;
+ let zValue = selectedFloorItem.position.z;
+ let rotationRad = selectedFloorItem.rotation.y;
+ let rotationDeg = THREE.MathUtils.radToDeg(rotationRad);
+ // useEffect(() => {}, [selectedFloorItem]);
// Function to handle adding new user data
const handleAddUserData = () => {
const newUserData: UserData = {
@@ -45,12 +53,16 @@ const AssetProperties: React.FC = () => {
return (
{/* Name */}
-
Selected Object
+
{selectedFloorItem.userData.name}
-
{ }} />
- { }} />
+ {}}
+ value1={xValue.toFixed(5)}
+ value2={zValue.toFixed(5)}
+ />
+ {}} value={rotationDeg} />