2025-04-24 11:08:42 +00:00
|
|
|
import React, { useEffect } from "react";
|
2025-03-25 06:17:41 +00:00
|
|
|
import Header from "./Header";
|
2025-03-26 05:48:23 +00:00
|
|
|
import useModuleStore, {
|
2025-04-28 12:38:27 +00:00
|
|
|
useSubModuleStore,
|
2025-03-26 05:48:23 +00:00
|
|
|
} from "../../../store/useModuleStore";
|
2025-03-25 06:17:41 +00:00
|
|
|
import {
|
2025-04-28 12:38:27 +00:00
|
|
|
AnalysisIcon,
|
|
|
|
MechanicsIcon,
|
|
|
|
PropertiesIcon,
|
|
|
|
SimulationIcon,
|
2025-03-25 06:17:41 +00:00
|
|
|
} from "../../icons/SimulationIcons";
|
2025-05-22 09:37:09 +00:00
|
|
|
import { useToggleStore } from "../../../store/useUIToggleStore";
|
2025-03-25 06:17:41 +00:00
|
|
|
import Visualization from "./visualization/Visualization";
|
|
|
|
import Analysis from "./analysis/Analysis";
|
|
|
|
import Simulations from "./simulation/Simulations";
|
2025-05-12 12:31:45 +00:00
|
|
|
import useVersionHistoryStore, {
|
2025-05-15 12:04:46 +00:00
|
|
|
useSaveVersion,
|
2025-05-12 12:31:45 +00:00
|
|
|
useSelectedFloorItem,
|
2025-05-28 05:14:19 +00:00
|
|
|
useToolMode,
|
2025-05-13 12:23:00 +00:00
|
|
|
} from "../../../store/builder/store";
|
2025-04-28 12:38:27 +00:00
|
|
|
import {
|
|
|
|
useSelectedEventData,
|
|
|
|
useSelectedEventSphere,
|
|
|
|
} from "../../../store/simulation/useSimulationStore";
|
2025-03-27 09:44:29 +00:00
|
|
|
import GlobalProperties from "./properties/GlobalProperties";
|
|
|
|
import AsstePropertiies from "./properties/AssetProperties";
|
2025-03-26 05:48:23 +00:00
|
|
|
import ZoneProperties from "./properties/ZoneProperties";
|
2025-04-23 11:45:07 +00:00
|
|
|
import EventProperties from "./properties/eventProperties/EventProperties";
|
2025-05-12 12:31:45 +00:00
|
|
|
import VersionHistory from "./versionHisory/VersionHistory";
|
2025-05-28 05:14:19 +00:00
|
|
|
import AisleProperties from "./properties/AisleProperties";
|
2025-06-10 05:48:39 +00:00
|
|
|
import WallProperties from "./properties/eventProperties/WallProperties";
|
2025-03-25 06:17:41 +00:00
|
|
|
|
|
|
|
const SideBarRight: React.FC = () => {
|
2025-04-28 12:38:27 +00:00
|
|
|
const { activeModule } = useModuleStore();
|
2025-05-13 05:02:24 +00:00
|
|
|
const { toggleUIRight } = useToggleStore();
|
2025-05-28 05:14:19 +00:00
|
|
|
const { toolMode } = useToolMode();
|
2025-04-28 12:38:27 +00:00
|
|
|
const { subModule, setSubModule } = useSubModuleStore();
|
|
|
|
const { selectedFloorItem } = useSelectedFloorItem();
|
|
|
|
const { selectedEventData } = useSelectedEventData();
|
|
|
|
const { selectedEventSphere } = useSelectedEventSphere();
|
2025-05-12 12:31:45 +00:00
|
|
|
const { viewVersionHistory, setVersionHistory } = useVersionHistoryStore();
|
2025-05-15 12:04:46 +00:00
|
|
|
const { isVersionSaved } = useSaveVersion();
|
2025-04-23 11:45:07 +00:00
|
|
|
|
2025-04-28 12:38:27 +00:00
|
|
|
// Reset activeList whenever activeModule changes
|
|
|
|
useEffect(() => {
|
|
|
|
if (activeModule !== "simulation") setSubModule("properties");
|
|
|
|
if (activeModule === "simulation") setSubModule("simulations");
|
|
|
|
}, [activeModule, setSubModule]);
|
2025-03-25 06:17:41 +00:00
|
|
|
|
2025-04-28 12:38:27 +00:00
|
|
|
useEffect(() => {
|
|
|
|
if (
|
|
|
|
activeModule !== "mechanics" &&
|
|
|
|
selectedEventData &&
|
|
|
|
selectedEventSphere
|
|
|
|
) {
|
|
|
|
setSubModule("mechanics");
|
|
|
|
} else if (!selectedEventData && !selectedEventSphere) {
|
|
|
|
if (activeModule === "simulation") {
|
|
|
|
setSubModule("simulations");
|
|
|
|
}
|
|
|
|
}
|
2025-04-29 07:20:14 +00:00
|
|
|
if (activeModule !== "simulation") {
|
|
|
|
setSubModule("properties");
|
|
|
|
}
|
2025-04-28 12:38:27 +00:00
|
|
|
}, [activeModule, selectedEventData, selectedEventSphere, setSubModule]);
|
2025-04-23 11:45:07 +00:00
|
|
|
|
2025-04-28 12:38:27 +00:00
|
|
|
return (
|
2025-05-14 13:09:47 +00:00
|
|
|
<div
|
2025-06-10 06:25:51 +00:00
|
|
|
className={`sidebar-right-wrapper ${toggleUIRight && (!isVersionSaved || activeModule !== "simulation") ? "open" : "closed"
|
2025-05-28 05:14:19 +00:00
|
|
|
}`}
|
2025-05-14 13:09:47 +00:00
|
|
|
>
|
2025-04-28 12:38:27 +00:00
|
|
|
<Header />
|
2025-05-27 10:39:36 +00:00
|
|
|
{toggleUIRight && (
|
|
|
|
<>
|
|
|
|
{!isVersionSaved && (
|
|
|
|
<div className="sidebar-actions-container">
|
|
|
|
{activeModule !== "simulation" && (
|
|
|
|
<button
|
|
|
|
id="sidebar-action-list-properties"
|
2025-05-28 05:14:19 +00:00
|
|
|
className={`sidebar-action-list ${subModule === "properties" ? "active" : ""
|
|
|
|
}`}
|
2025-05-27 10:39:36 +00:00
|
|
|
onClick={() => {
|
|
|
|
setSubModule("properties");
|
|
|
|
setVersionHistory(false);
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<div className="tooltip">properties</div>
|
|
|
|
<PropertiesIcon isActive={subModule === "properties"} />
|
|
|
|
</button>
|
|
|
|
)}
|
|
|
|
{activeModule === "simulation" && (
|
|
|
|
<>
|
|
|
|
<button
|
|
|
|
id="sidebar-action-list-simulation"
|
2025-05-28 05:14:19 +00:00
|
|
|
className={`sidebar-action-list ${subModule === "simulations" ? "active" : ""
|
|
|
|
}`}
|
2025-05-27 10:39:36 +00:00
|
|
|
onClick={() => {
|
|
|
|
setSubModule("simulations");
|
|
|
|
setVersionHistory(false);
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<div className="tooltip">simulations</div>
|
|
|
|
<SimulationIcon isActive={subModule === "simulations"} />
|
|
|
|
</button>
|
|
|
|
<button
|
|
|
|
id="sidebar-action-list-mechanics"
|
2025-05-28 05:14:19 +00:00
|
|
|
className={`sidebar-action-list ${subModule === "mechanics" ? "active" : ""
|
|
|
|
}`}
|
2025-05-27 10:39:36 +00:00
|
|
|
onClick={() => {
|
|
|
|
setSubModule("mechanics");
|
|
|
|
setVersionHistory(false);
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<div className="tooltip">mechanics</div>
|
|
|
|
<MechanicsIcon isActive={subModule === "mechanics"} />
|
|
|
|
</button>
|
|
|
|
<button
|
|
|
|
id="sidebar-action-list-analysis"
|
2025-05-28 05:14:19 +00:00
|
|
|
className={`sidebar-action-list ${subModule === "analysis" ? "active" : ""
|
|
|
|
}`}
|
2025-05-27 10:39:36 +00:00
|
|
|
onClick={() => {
|
|
|
|
setSubModule("analysis");
|
|
|
|
setVersionHistory(false);
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<div className="tooltip">analysis</div>
|
|
|
|
<AnalysisIcon isActive={subModule === "analysis"} />
|
|
|
|
</button>
|
|
|
|
</>
|
|
|
|
)}
|
|
|
|
</div>
|
2025-04-28 12:38:27 +00:00
|
|
|
)}
|
2025-05-12 12:31:45 +00:00
|
|
|
|
2025-05-27 10:39:36 +00:00
|
|
|
{viewVersionHistory && (
|
|
|
|
<div className="sidebar-right-container">
|
|
|
|
<div className="sidebar-right-content-container">
|
|
|
|
<VersionHistory />
|
|
|
|
</div>
|
2025-04-28 12:38:27 +00:00
|
|
|
</div>
|
2025-05-27 10:39:36 +00:00
|
|
|
)}
|
2025-05-12 12:31:45 +00:00
|
|
|
|
2025-05-27 10:39:36 +00:00
|
|
|
{/* process builder */}
|
|
|
|
{!viewVersionHistory &&
|
|
|
|
subModule === "properties" &&
|
|
|
|
activeModule !== "visualization" &&
|
|
|
|
!selectedFloorItem && (
|
2025-05-14 13:09:47 +00:00
|
|
|
<div className="sidebar-right-container">
|
|
|
|
<div className="sidebar-right-content-container">
|
2025-06-10 05:48:39 +00:00
|
|
|
{(() => {
|
|
|
|
if (toolMode === "Aisle") {
|
|
|
|
return <AisleProperties />;
|
|
|
|
} else if (toolMode === "Wall") {
|
|
|
|
return <WallProperties />;
|
|
|
|
} else {
|
|
|
|
return <GlobalProperties />;
|
|
|
|
}
|
|
|
|
})()}
|
2025-05-14 13:09:47 +00:00
|
|
|
</div>
|
2025-04-28 12:38:27 +00:00
|
|
|
</div>
|
2025-05-14 13:09:47 +00:00
|
|
|
)}
|
2025-05-27 10:39:36 +00:00
|
|
|
{!viewVersionHistory &&
|
|
|
|
subModule === "properties" &&
|
|
|
|
activeModule !== "visualization" &&
|
|
|
|
selectedFloorItem && (
|
2025-05-14 13:09:47 +00:00
|
|
|
<div className="sidebar-right-container">
|
|
|
|
<div className="sidebar-right-content-container">
|
2025-05-27 10:39:36 +00:00
|
|
|
<AsstePropertiies />
|
2025-05-14 13:09:47 +00:00
|
|
|
</div>
|
2025-04-28 12:38:27 +00:00
|
|
|
</div>
|
2025-05-14 13:09:47 +00:00
|
|
|
)}
|
2025-05-27 10:39:36 +00:00
|
|
|
|
|
|
|
{!viewVersionHistory &&
|
|
|
|
subModule === "zoneProperties" &&
|
|
|
|
(activeModule === "builder" || activeModule === "simulation") && (
|
2025-05-14 13:09:47 +00:00
|
|
|
<div className="sidebar-right-container">
|
|
|
|
<div className="sidebar-right-content-container">
|
2025-05-27 10:39:36 +00:00
|
|
|
<ZoneProperties />
|
2025-05-14 13:09:47 +00:00
|
|
|
</div>
|
2025-04-28 12:38:27 +00:00
|
|
|
</div>
|
2025-05-14 13:09:47 +00:00
|
|
|
)}
|
2025-05-27 10:39:36 +00:00
|
|
|
{/* simulation */}
|
|
|
|
{!isVersionSaved &&
|
|
|
|
!viewVersionHistory &&
|
|
|
|
activeModule === "simulation" && (
|
|
|
|
<>
|
|
|
|
{subModule === "simulations" && (
|
|
|
|
<div className="sidebar-right-container">
|
|
|
|
<div className="sidebar-right-content-container">
|
|
|
|
<Simulations />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)}
|
|
|
|
{subModule === "mechanics" && (
|
|
|
|
<div className="sidebar-right-container">
|
|
|
|
<div className="sidebar-right-content-container">
|
|
|
|
<EventProperties />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)}
|
|
|
|
{subModule === "analysis" && (
|
|
|
|
<div className="sidebar-right-container">
|
|
|
|
<div className="sidebar-right-content-container">
|
|
|
|
<Analysis />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)}
|
|
|
|
</>
|
|
|
|
)}
|
|
|
|
{/* realtime visualization */}
|
|
|
|
{activeModule === "visualization" && <Visualization />}
|
|
|
|
</>
|
|
|
|
)}
|
2025-04-28 12:38:27 +00:00
|
|
|
</div>
|
|
|
|
);
|
2025-03-25 06:17:41 +00:00
|
|
|
};
|
|
|
|
|
2025-04-28 12:38:27 +00:00
|
|
|
export default SideBarRight;
|