architwin 1.16.1 → 1.16.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/architwin.js +1 -1
- package/lib/atwinui/components/toolbar/i18n.js +4 -2
- package/lib/atwinui/components/toolbar/spacePartition/roomFormPane.d.ts +4 -1
- package/lib/atwinui/components/toolbar/spacePartition/roomFormPane.js +26 -14
- package/lib/atwinui/components/toolbar/spacePartition/roomTreePane.d.ts +5 -0
- package/lib/atwinui/components/toolbar/spacePartition/roomTreePane.js +24 -4
- package/lib/atwinui/components/toolbar/tagListPane.js +1 -1
- package/lib/atwinui/events.js +40 -14
- package/lib/loaders/planeGeometry2.js +7 -7
- package/package.json +1 -1
|
@@ -277,7 +277,8 @@ i18n
|
|
|
277
277
|
"Window": "Window",
|
|
278
278
|
"CannotBackDrawingMode": "Cannot go back while drawing mode is active.",
|
|
279
279
|
"PleaseOffDrawingMode": "Action cannot be done, please turn off drawing mode.",
|
|
280
|
-
"IotCategoryRequired": "IoT Category is required"
|
|
280
|
+
"IotCategoryRequired": "IoT Category is required",
|
|
281
|
+
"SuccessUpdatedFloorLevel": "Updated the partition's floor level"
|
|
281
282
|
}
|
|
282
283
|
},
|
|
283
284
|
ja: {
|
|
@@ -549,7 +550,8 @@ i18n
|
|
|
549
550
|
"CannotBackDrawingMode": "描画モードがアクティブな間は戻ることができません。",
|
|
550
551
|
"PleaseOffDrawingMode": "操作を行う前に、描画モードをオフにしてください。",
|
|
551
552
|
"Successfully Deleted Tag": "タグを削除しました",
|
|
552
|
-
"IotCategoryRequired": "IoTカテゴリは必須です"
|
|
553
|
+
"IotCategoryRequired": "IoTカテゴリは必須です",
|
|
554
|
+
"SuccessUpdatedFloorLevel": "区画のフロアオフセット値が更新されました"
|
|
553
555
|
}
|
|
554
556
|
}
|
|
555
557
|
},
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { FORM_MODE, PartitionNode, PolygonData, WallPolyData, IObjectData } from "../../../../types";
|
|
2
|
-
export declare let isEditWindow: boolean;
|
|
3
2
|
export declare function renderRoomFormPane(): HTMLDivElement;
|
|
4
3
|
/**
|
|
5
4
|
* Toggles the state of the partition drawing functionality.
|
|
@@ -31,6 +30,7 @@ export declare function displayPartitionFormMode(): void;
|
|
|
31
30
|
*/
|
|
32
31
|
export declare function handlePartitionRowEditBtnClickEvent(partitions: Array<PartitionNode>, targetElement: HTMLElement): void;
|
|
33
32
|
export declare function displayWall(wall: WallPolyData): HTMLElement;
|
|
33
|
+
export declare function setDrawConfig(drawMode: 'window' | 'partition'): void;
|
|
34
34
|
/**
|
|
35
35
|
* Clears the partition form by resetting UI elements and internal data.
|
|
36
36
|
* - Navigates back to the partition list view.
|
|
@@ -123,3 +123,6 @@ export declare function handlePartitionWallEditBtn(wallUuid: string): Promise<vo
|
|
|
123
123
|
export declare function getTempCurrentRoomEditData(): Array<PartitionNode>;
|
|
124
124
|
export declare function setTempCurrentRoomEditData(roomEditData: Array<PartitionNode>): void;
|
|
125
125
|
export declare function getCurrentWall(): WallPolyData;
|
|
126
|
+
export declare function getIsEditWindow(): boolean;
|
|
127
|
+
export declare function setIsEditWindow(value: boolean): void;
|
|
128
|
+
export declare function setCurrentEditWindowIndex(value: number): void;
|
|
@@ -44,7 +44,7 @@ let wallMaterial = '';
|
|
|
44
44
|
let currentEditWindowIndex = null;
|
|
45
45
|
let currentWindowIndex = null;
|
|
46
46
|
let tempCurrentEditRoom = null;
|
|
47
|
-
|
|
47
|
+
let isEditWindow = false;
|
|
48
48
|
export function renderRoomFormPane() {
|
|
49
49
|
log.info("__@ renderRoomFormPane: ", roomFormMode);
|
|
50
50
|
const element = document.createElement('div');
|
|
@@ -939,18 +939,7 @@ function setupEditWindow(element, window) {
|
|
|
939
939
|
currentEditWindowIndex = window.index;
|
|
940
940
|
drawingMode = 'window';
|
|
941
941
|
toggleDrawWindowButton();
|
|
942
|
-
|
|
943
|
-
setCurrentPolygon(currentObject);
|
|
944
|
-
const drawConfig = {
|
|
945
|
-
lineTypeComponentConfig: {
|
|
946
|
-
renderPolygonOnAdd: false,
|
|
947
|
-
drawingMode: drawingMode,
|
|
948
|
-
polygonData: currentObject.object.object_data.json_data,
|
|
949
|
-
targetUUID: currentWall.uuid,
|
|
950
|
-
targetIndex: currentEditWindowIndex
|
|
951
|
-
}
|
|
952
|
-
};
|
|
953
|
-
setDrawingConfig(drawConfig);
|
|
942
|
+
setDrawConfig('window');
|
|
954
943
|
// @ts-ignore
|
|
955
944
|
const windowComponent = {
|
|
956
945
|
inputs: {
|
|
@@ -997,6 +986,20 @@ function setupEditWindow(element, window) {
|
|
|
997
986
|
toggleUndoRedoButtons(false, false);
|
|
998
987
|
});
|
|
999
988
|
}
|
|
989
|
+
export function setDrawConfig(drawMode) {
|
|
990
|
+
log.info("currentObject ", currentObject);
|
|
991
|
+
setCurrentPolygon(currentObject);
|
|
992
|
+
const drawConfig = {
|
|
993
|
+
lineTypeComponentConfig: {
|
|
994
|
+
renderPolygonOnAdd: false,
|
|
995
|
+
drawingMode: drawMode,
|
|
996
|
+
polygonData: currentObject.object.object_data.json_data,
|
|
997
|
+
targetUUID: currentWall.uuid,
|
|
998
|
+
targetIndex: currentEditWindowIndex
|
|
999
|
+
}
|
|
1000
|
+
};
|
|
1001
|
+
setDrawingConfig(drawConfig);
|
|
1002
|
+
}
|
|
1000
1003
|
function saveWallChanges() {
|
|
1001
1004
|
log.info("currentWall", currentWall);
|
|
1002
1005
|
updateWallInPolygon(currentWall);
|
|
@@ -1608,7 +1611,7 @@ function updatePartitionDataArray(payload, currentPartitionDataArray) {
|
|
|
1608
1611
|
else if (drawingMode === 'window') {
|
|
1609
1612
|
log.info("currentPartitionData", currentPartitionData);
|
|
1610
1613
|
// Update current partition data
|
|
1611
|
-
currentPartitionData.polygon_json =
|
|
1614
|
+
currentPartitionData.polygon_json = payload.polygon_json;
|
|
1612
1615
|
// Update current partition data array
|
|
1613
1616
|
const currentPartitionDataIndex = currentPartitionDataArray.findIndex(partitionData => partitionData.uuid == currentPartitionData.uuid);
|
|
1614
1617
|
currentPartitionDataArray[currentPartitionDataIndex] = currentPartitionData;
|
|
@@ -1822,3 +1825,12 @@ export function setTempCurrentRoomEditData(roomEditData) {
|
|
|
1822
1825
|
export function getCurrentWall() {
|
|
1823
1826
|
return currentWall;
|
|
1824
1827
|
}
|
|
1828
|
+
export function getIsEditWindow() {
|
|
1829
|
+
return isEditWindow;
|
|
1830
|
+
}
|
|
1831
|
+
export function setIsEditWindow(value) {
|
|
1832
|
+
isEditWindow = value;
|
|
1833
|
+
}
|
|
1834
|
+
export function setCurrentEditWindowIndex(value) {
|
|
1835
|
+
currentEditWindowIndex = value;
|
|
1836
|
+
}
|
|
@@ -35,6 +35,11 @@ export declare function updateParentVisibility(isPartition: boolean, currentBtn:
|
|
|
35
35
|
* @returns An array of room nodes.
|
|
36
36
|
*/
|
|
37
37
|
export declare function getRoomData(): PartitionNode[];
|
|
38
|
+
/**
|
|
39
|
+
* Sets the current room data being edited based on the provided ID.
|
|
40
|
+
* @param id - The unique identifier of the room to be edited.
|
|
41
|
+
*/
|
|
42
|
+
export declare function setCurrentEditRoomData(id: string): void;
|
|
38
43
|
/**
|
|
39
44
|
* Retrieves the current room data being edited.
|
|
40
45
|
* @returns The current room node being edited.
|
|
@@ -10,9 +10,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import { getBundleVersion, extractUUID } from "../../../../utils";
|
|
11
11
|
import { batchAddEventListenerByClassName, handleDeletePartition, handlePartitionVisibility, handlePolygonVisibility, handleWindowVisibility, toggleDisplayPane } from "../../../events";
|
|
12
12
|
import i18n from "../i18n";
|
|
13
|
-
import { getCurrentPolygonData, handlePartitionRowEditBtnClickEvent, handlePartitionWallEditBtn, setPartitionFormMode } from "./roomFormPane";
|
|
13
|
+
import { getCurrentPolygonData, handlePartitionRowEditBtnClickEvent, handlePartitionWallEditBtn, setCurrentEditWindowIndex, setDrawConfig, setDrawingMode, setIsEditWindow, setPartitionFormMode } from "./roomFormPane";
|
|
14
14
|
import { SPACE_EVENTS } from "../../../../types";
|
|
15
|
-
import { _3DXObjects, dispatchSpaceEvent, getChildrenOfModel, goToModel, goToPosition, renderPolygon, setSelectedObject } from "../../../../architwin";
|
|
15
|
+
import { _3DXObjects, dispatchSpaceEvent, enableVerticeControls, getChildrenOfModel, goToModel, goToPosition, renderPolygon, setSelectedObject } from "../../../../architwin";
|
|
16
16
|
import log from 'loglevel';
|
|
17
17
|
import { getShortcutTooltipHTML } from "../static/common";
|
|
18
18
|
let roomDataArray = [];
|
|
@@ -550,7 +550,11 @@ export function getRoomData() {
|
|
|
550
550
|
* Sets the current room data being edited based on the provided ID.
|
|
551
551
|
* @param id - The unique identifier of the room to be edited.
|
|
552
552
|
*/
|
|
553
|
-
function setCurrentEditRoomData(id) {
|
|
553
|
+
export function setCurrentEditRoomData(id) {
|
|
554
|
+
if (!id) {
|
|
555
|
+
currentEditRoomData = null;
|
|
556
|
+
return;
|
|
557
|
+
}
|
|
554
558
|
const roomUUID = extractUUID(id);
|
|
555
559
|
currentEditRoomData = getRoomData().find(room => room.uuid === roomUUID);
|
|
556
560
|
}
|
|
@@ -773,11 +777,13 @@ function displayWindows(wall, partitionId, parentId) {
|
|
|
773
777
|
if (!window.options.is_deleted) {
|
|
774
778
|
const windowCoords = JSON.stringify(window.edges);
|
|
775
779
|
const windowCoordsEncoded = btoa(windowCoords);
|
|
780
|
+
const windowPath = JSON.stringify(window.path);
|
|
781
|
+
const windowPathEncoded = btoa(windowPath);
|
|
776
782
|
itemsHTML += `
|
|
777
783
|
<li window-coords="${windowCoordsEncoded}" partition-id="${partitionId}" id="window-${wall.uuid}-${window.index}" wall-id="${wall.uuid}" window-name="${window.name}" window-index="${window.index}" class="at_window_row_item">
|
|
778
784
|
<div>${window.name}</div>
|
|
779
785
|
<div>
|
|
780
|
-
<span window-coords="${windowCoordsEncoded}" partition-id="${partitionId}" partition-parent-uuid="${parentId}" polygon-item-id="${wall.uuid}" index="${window.index}" class="mdi mdi-pencil at_window_edit_btn"></span>
|
|
786
|
+
<span window-path="${windowPathEncoded}" window-coords="${windowCoordsEncoded}" partition-id="${partitionId}" partition-parent-uuid="${parentId}" polygon-item-id="${wall.uuid}" index="${window.index}" class="mdi mdi-pencil at_window_edit_btn"></span>
|
|
781
787
|
<span id="${window.name}" partition-id="${partitionId}" partition-parent-uuid="${parentId}" polygon-item-id="${wall.uuid}" class="mdi ${window.options.is_visible ? 'mdi-eye ' : 'mdi-eye-off'} at_child_visible_btn"></span>
|
|
782
788
|
</div>
|
|
783
789
|
</li>
|
|
@@ -818,6 +824,9 @@ function openPartitionChildEdit(targetElement, parentRoomElement, parentRoomUuid
|
|
|
818
824
|
function openWindowEdit(targetElement, parentRoomElement, parentRoomUuid, partitionId) {
|
|
819
825
|
return __awaiter(this, void 0, void 0, function* () {
|
|
820
826
|
const index = targetElement.getAttribute('index');
|
|
827
|
+
const windowPathEncoded = targetElement.getAttribute('window-path');
|
|
828
|
+
const windowPathJSON = atob(windowPathEncoded);
|
|
829
|
+
const windowPath = JSON.parse(windowPathJSON);
|
|
821
830
|
yield openPartitionChildEdit(targetElement, parentRoomElement, parentRoomUuid, partitionId, true);
|
|
822
831
|
yield new Promise(resolve => requestAnimationFrame(resolve));
|
|
823
832
|
const editBtn = document.querySelector(`#at-edit-window-btn-${index}`);
|
|
@@ -834,6 +843,17 @@ function openWindowEdit(targetElement, parentRoomElement, parentRoomUuid, partit
|
|
|
834
843
|
editBtn.style.display = "none";
|
|
835
844
|
confirmBtn.style.display = "flex";
|
|
836
845
|
inputName.focus();
|
|
846
|
+
setIsEditWindow(true);
|
|
847
|
+
setCurrentEditWindowIndex(Number(index));
|
|
848
|
+
setDrawConfig('window');
|
|
849
|
+
// @ts-ignore
|
|
850
|
+
const windowComponent = {
|
|
851
|
+
inputs: {
|
|
852
|
+
path: windowPath
|
|
853
|
+
}
|
|
854
|
+
};
|
|
855
|
+
enableVerticeControls(windowComponent);
|
|
856
|
+
setDrawingMode(true);
|
|
837
857
|
}
|
|
838
858
|
});
|
|
839
859
|
}
|
|
@@ -414,7 +414,7 @@ export function renderTagRow(tag, tagIconUrl, tag_type = null) {
|
|
|
414
414
|
<td>
|
|
415
415
|
<div class="at_table_button_row">
|
|
416
416
|
<span class="mdi mdi-eye at_visibility_tag_btn ${isGenerallyDisabled ? 'at_disabled' : ''}" id="at-visibility-tag-${tag.id}" data-cy="at-visibility-tag-${tag.id}" tag-id="${tag.id}" tag-id="${tag.id}"></span>
|
|
417
|
-
<span class="mdi mdi-pencil at_edit_tag_btn ${isGenerallyDisabled ? 'at_disabled' : ''}" id="at-edit-tag-${tag.id}" data-cy="at-edit-tag-${tag.id}" tag-id="${tag.id}" target-pane="at-tag-form-pane"></span>
|
|
417
|
+
<span class="mdi mdi-pencil at_edit_tag_btn ${isGenerallyDisabled ? 'at_disabled' : ''}" id="at-edit-tag-${tag.id}" data-cy="at-edit-tag-${tag.id}" tag-id="${tag.id}" target-pane="${isIoT ? 'at-tag-iot-form-pane' : 'at-tag-form-pane'}"></span>
|
|
418
418
|
<span class="mdi mdi-content-copy at_copy_tag_btn ${isTagReadOnly ? 'at_disabled' : ''} id="at-edit-tag-${tag.id}"" id="at-copy-tag-${tag.id}" data-cy="at-copy-tag-${tag.id}" tag-id="${tag.id}"></span>
|
|
419
419
|
<span class="mdi mdi-message at_message_tag_btn ${isIoT ? 'at_hidden' : ''}" id="at-message-tag-${tag.id}" data-cy="at-message-tag-${tag.id}" tag-id="${tag.id}" target-pane="at-tag-messaging-pane"></span>
|
|
420
420
|
<span class="mdi mdi-map-marker at_locate_tag_btn ${!isIoT ? 'at_hidden' : ''} ${isIotTagReadOnly ? 'at_disabled' : ''}" id="at-relocate-tag-${tag.id}" data-cy="at-relocate-tag-${tag.id}" tag-id="${tag.id}"></span>
|
package/lib/atwinui/events.js
CHANGED
|
@@ -25,7 +25,7 @@ import { isValidUrl, debounce, isElementVisible, extractUUID, showLoader, isVec3
|
|
|
25
25
|
import log from 'loglevel';
|
|
26
26
|
import * as minimap from '../minimap';
|
|
27
27
|
import { clearActiveThemeCard, getSelectedTheme } from "./components/toolbar/themePane";
|
|
28
|
-
import { getCurrentEditRoomData, displayRoomTree, updatePartitionVisibilityUI, getSelectedPartitionId, updatePolygonVisibilityData, toggleVisibilityState, setFilteredDisplay, updateRoomVisibilityUI, highlightSelectedPartitionChild, highlightSelectedWindow, getRoomData } from "./components/toolbar/spacePartition/roomTreePane";
|
|
28
|
+
import { getCurrentEditRoomData, displayRoomTree, updatePartitionVisibilityUI, getSelectedPartitionId, updatePolygonVisibilityData, toggleVisibilityState, setFilteredDisplay, updateRoomVisibilityUI, highlightSelectedPartitionChild, highlightSelectedWindow, getRoomData, setCurrentEditRoomData } from "./components/toolbar/spacePartition/roomTreePane";
|
|
29
29
|
import { toggleDrawPartitionButton, displayPartitionFormMode, setPartitionFormMode, clearPartitionForm, setPolygonData, getPartitionFormData, getPartitionSavingMode, setPartitionSavingMode, getPartitionFormMode, getNewlyAddedPartition, getCurrentPartitionData, getTempCurrentPolygon, clearTempCurrentPolygon, toggleDrawWindowButton, getIsDrawing, getDrawingMode, getCurrentPolygonData, setTempCurrentRoomEditData, toggleUndoRedoButtons } from "./components/toolbar/spacePartition/roomFormPane";
|
|
30
30
|
import { actionSettingsSelectOption, getTempCoordinateSystem, getTempMeasurementUnit, getTempRotationUnit, setCoordinateSystem, setMeasurementUnit, setRotationUnit, initSettingsValues, setTempCoordinateSystem, setTempMeasurementUnit, setTempRotationUnit, toggleActionSettingsDropdown, toggleCalibrateBasepoint, setScaleFactor, getTempScaleFactor, setTempScaleFactor, setBasepoint, getTempBasepoint, setTempBasepoint, getBasepoint, toggleActionSettings, getBasepointObjectPayload, displayConvertedCoordinates, getCoordinateSystem, getScaleFactor, getMeasurementUnit, getRotationUnit, setBasepointObjectPayload } from "./components/toolbar/actionSettingsPane";
|
|
31
31
|
import { getBasepointCalibrateBpCoordinateValues, getBasepointCalibrateMpCoordinateValues, initBsepointCalibratePane, toggleBasepointCalibratePane } from "./components/toolbar/basepointCalibratePane";
|
|
@@ -65,6 +65,7 @@ let _currentSandboxId = undefined;
|
|
|
65
65
|
let isNotyfExecuted = false; // flag for notification
|
|
66
66
|
let pipeColor = "";
|
|
67
67
|
let allTagsVisible = true;
|
|
68
|
+
let lastFloorLevel = undefined;
|
|
68
69
|
function batchAddEventListenerByClassName(className, callback) {
|
|
69
70
|
if (className) {
|
|
70
71
|
const elements = document.querySelectorAll(`.${className}`);
|
|
@@ -2241,6 +2242,8 @@ function handleSavePartition() {
|
|
|
2241
2242
|
clearSelectedObject();
|
|
2242
2243
|
clearFloorBaseHeight();
|
|
2243
2244
|
setTempCurrentRoomEditData(null);
|
|
2245
|
+
setCurrentEditRoomData(null);
|
|
2246
|
+
lastFloorLevel = undefined;
|
|
2244
2247
|
notyf.success(`${i18n.t('SuccessRoomSaved')}`);
|
|
2245
2248
|
});
|
|
2246
2249
|
}
|
|
@@ -2342,6 +2345,15 @@ function handleCancelPartition() {
|
|
|
2342
2345
|
obj.children = [];
|
|
2343
2346
|
}
|
|
2344
2347
|
if (polyJson && polyJson.path) {
|
|
2348
|
+
log.info("lastFloorLevel before", lastFloorLevel);
|
|
2349
|
+
if (lastFloorLevel) {
|
|
2350
|
+
setSelectedObject(obj.object, obj.node, obj.component, obj.type);
|
|
2351
|
+
polyJson.path = polyJson.path.map(point => {
|
|
2352
|
+
point.y = lastFloorLevel;
|
|
2353
|
+
return point;
|
|
2354
|
+
});
|
|
2355
|
+
log.info("polyJson with lastFloorLevel", polyJson);
|
|
2356
|
+
}
|
|
2345
2357
|
const payload = {
|
|
2346
2358
|
uuid: currentPartition.uuid,
|
|
2347
2359
|
polygon_json: polyJson
|
|
@@ -2377,7 +2389,9 @@ function handleCancelPartition() {
|
|
|
2377
2389
|
clearPartitionForm();
|
|
2378
2390
|
clearSelectedObject();
|
|
2379
2391
|
clearFloorBaseHeight();
|
|
2392
|
+
setCurrentEditRoomData(null);
|
|
2380
2393
|
toggleDisplayPane('at-cancel-room-form-btn');
|
|
2394
|
+
lastFloorLevel = undefined;
|
|
2381
2395
|
}));
|
|
2382
2396
|
}
|
|
2383
2397
|
/**
|
|
@@ -2535,23 +2549,26 @@ function handleFloorLevelInputChange() {
|
|
|
2535
2549
|
notyf.success(`${i18n.t('SuccessBaseHeight')}`);
|
|
2536
2550
|
const objects = get3DXObjects();
|
|
2537
2551
|
const latestObj = objects[objects.length - 1];
|
|
2538
|
-
const
|
|
2552
|
+
const currentRoomData = getCurrentEditRoomData();
|
|
2539
2553
|
const currentPolygon = getCurrentPolygon();
|
|
2540
2554
|
log.info("latestObj ", latestObj);
|
|
2541
|
-
if (
|
|
2555
|
+
if (currentRoomData) {
|
|
2542
2556
|
let partitionsUUIDs = [];
|
|
2543
|
-
partitionsUUIDs =
|
|
2557
|
+
partitionsUUIDs = currentRoomData.children.map(child => child.uuid);
|
|
2544
2558
|
const target = objects.find(obj => partitionsUUIDs.includes(obj.object.object_data.uuid));
|
|
2545
2559
|
if (target) {
|
|
2546
2560
|
setSelectedObject(target.object, target.node, target.component, target.type);
|
|
2547
2561
|
const adjustedFloorBaseHeight = getFloorBaseHeight();
|
|
2548
2562
|
const polyJson = target.object.object_data.json_data;
|
|
2549
|
-
const
|
|
2563
|
+
const formMode = getPartitionFormMode();
|
|
2564
|
+
if (formMode == "EDIT" /* FORM_MODE.EDIT */)
|
|
2565
|
+
lastFloorLevel = polyJson.path[0].y;
|
|
2566
|
+
const updatedPath = polyJson.path.map((path, index) => {
|
|
2550
2567
|
path.y = adjustedFloorBaseHeight;
|
|
2551
2568
|
return path;
|
|
2552
2569
|
});
|
|
2553
2570
|
renderPolygon(updatedPath);
|
|
2554
|
-
notyf.success(
|
|
2571
|
+
notyf.success(`${i18n.t('SuccessUpdatedFloorLevel')}`);
|
|
2555
2572
|
}
|
|
2556
2573
|
else {
|
|
2557
2574
|
log.error("No matching uuid for the polygon");
|
|
@@ -2561,12 +2578,15 @@ function handleFloorLevelInputChange() {
|
|
|
2561
2578
|
setSelectedObject(currentPolygon.object, currentPolygon.node, currentPolygon.component, currentPolygon.type);
|
|
2562
2579
|
const adjustedFloorBaseHeight = getFloorBaseHeight();
|
|
2563
2580
|
const polyJson = latestObj.object.object_data.json_data;
|
|
2564
|
-
const
|
|
2581
|
+
const formMode = getPartitionFormMode();
|
|
2582
|
+
if (formMode == "EDIT" /* FORM_MODE.EDIT */)
|
|
2583
|
+
lastFloorLevel = polyJson.path[0].y;
|
|
2584
|
+
const updatedPath = polyJson.path.map((path, index) => {
|
|
2565
2585
|
path.y = adjustedFloorBaseHeight;
|
|
2566
2586
|
return path;
|
|
2567
2587
|
});
|
|
2568
2588
|
renderPolygon(updatedPath);
|
|
2569
|
-
notyf.success(
|
|
2589
|
+
notyf.success(`${i18n.t('SuccessUpdatedFloorLevel')}`);
|
|
2570
2590
|
}
|
|
2571
2591
|
else {
|
|
2572
2592
|
log.warn("currentPartitionData and latestObj value is undefined or its type is not valid");
|
|
@@ -2588,7 +2608,7 @@ function handleMarkFloor() {
|
|
|
2588
2608
|
});
|
|
2589
2609
|
yield getTargetPosition((coord) => {
|
|
2590
2610
|
const objects = get3DXObjects();
|
|
2591
|
-
const
|
|
2611
|
+
const currentRoomData = getCurrentEditRoomData();
|
|
2592
2612
|
const currentPolygon = getCurrentPolygon();
|
|
2593
2613
|
log.info("coord ", coord);
|
|
2594
2614
|
if (coord.y < -1) {
|
|
@@ -2600,14 +2620,17 @@ function handleMarkFloor() {
|
|
|
2600
2620
|
if (Math.sign(coord.y) == 1 || coord.y > -0.9) {
|
|
2601
2621
|
setFloorBaseHeight(coord.y);
|
|
2602
2622
|
const adjustedHeight = getFloorBaseHeight();
|
|
2603
|
-
if (
|
|
2623
|
+
if (currentRoomData) {
|
|
2604
2624
|
let partitionsUUIDs = [];
|
|
2605
|
-
partitionsUUIDs =
|
|
2625
|
+
partitionsUUIDs = currentRoomData.children.map(child => child.uuid);
|
|
2606
2626
|
const target = objects.find(obj => partitionsUUIDs.includes(obj.object.object_data.uuid));
|
|
2607
2627
|
if (target) {
|
|
2608
2628
|
setSelectedObject(target.object, target.node, target.component, target.type);
|
|
2609
2629
|
const polyJson = target.object.object_data.json_data;
|
|
2610
|
-
const
|
|
2630
|
+
const formMode = getPartitionFormMode();
|
|
2631
|
+
if (formMode == "EDIT" /* FORM_MODE.EDIT */)
|
|
2632
|
+
lastFloorLevel = polyJson.path[0].y;
|
|
2633
|
+
const updatedPath = polyJson.path.map((path, index) => {
|
|
2611
2634
|
path.y = adjustedHeight;
|
|
2612
2635
|
return path;
|
|
2613
2636
|
});
|
|
@@ -2622,12 +2645,15 @@ function handleMarkFloor() {
|
|
|
2622
2645
|
//setSelectedObject(currentPolygon.object,currentPolygon.node,currentPolygon.component,currentPolygon.type)
|
|
2623
2646
|
setSelectedObject(currentPolygon.object, currentPolygon.node, currentPolygon.component, currentPolygon.type);
|
|
2624
2647
|
const polyJson = currentPolygon.object.object_data.json_data;
|
|
2625
|
-
const
|
|
2648
|
+
const formMode = getPartitionFormMode();
|
|
2649
|
+
if (formMode == "EDIT" /* FORM_MODE.EDIT */)
|
|
2650
|
+
lastFloorLevel = polyJson.path[0].y;
|
|
2651
|
+
const updatedPath = polyJson.path.map((path, index) => {
|
|
2626
2652
|
path.y = adjustedHeight;
|
|
2627
2653
|
return path;
|
|
2628
2654
|
});
|
|
2629
2655
|
renderPolygon(updatedPath);
|
|
2630
|
-
notyf.success(
|
|
2656
|
+
notyf.success(`${i18n.t('SuccessUpdatedFloorLevel')}`);
|
|
2631
2657
|
}
|
|
2632
2658
|
else {
|
|
2633
2659
|
log.warn("currentPolygon is undefined");
|
|
@@ -539,10 +539,10 @@ class PlaneVideo {
|
|
|
539
539
|
});
|
|
540
540
|
// socketEmit({socketEvent: IO_SPACE_EVENTS.MEDIA_SCREEN, data: {event: IO_MEDIASCREEN_EVENTS.PAUSE, mediaViewerId: this.inputs.mediaViewerId }})
|
|
541
541
|
}
|
|
542
|
-
else if (this.audio === 'unmuted' && eventData['collider'].name == '
|
|
542
|
+
else if (this.audio === 'unmuted' && eventData['collider'].name == 'unmuteBtn') {
|
|
543
543
|
this.planeElement.muted = true;
|
|
544
|
-
this.muteButtonModel.visible =
|
|
545
|
-
this.unmuteButtonModel.visible =
|
|
544
|
+
this.muteButtonModel.visible = true;
|
|
545
|
+
this.unmuteButtonModel.visible = false;
|
|
546
546
|
this.audio = 'muted';
|
|
547
547
|
const { duration, currentTime } = getVideoMetadata(this.planeElement);
|
|
548
548
|
dispatchSpaceEvent(SPACE_EVENTS.MEDIA_MUTE, {
|
|
@@ -555,10 +555,10 @@ class PlaneVideo {
|
|
|
555
555
|
});
|
|
556
556
|
// socketEmit({socketEvent: IO_SPACE_EVENTS.MEDIA_SCREEN, data: {event: IO_MEDIASCREEN_EVENTS.MUTE, mediaViewerId: this.inputs.mediaViewerId }})
|
|
557
557
|
}
|
|
558
|
-
else if (this.audio === 'muted' && eventData['collider'].name == '
|
|
558
|
+
else if (this.audio === 'muted' && eventData['collider'].name == 'muteBtn') {
|
|
559
559
|
this.planeElement.muted = false;
|
|
560
|
-
this.muteButtonModel.visible =
|
|
561
|
-
this.unmuteButtonModel.visible =
|
|
560
|
+
this.muteButtonModel.visible = false;
|
|
561
|
+
this.unmuteButtonModel.visible = true;
|
|
562
562
|
this.audio = 'unmuted';
|
|
563
563
|
const { duration, currentTime } = getVideoMetadata(this.planeElement);
|
|
564
564
|
dispatchSpaceEvent(SPACE_EVENTS.MEDIA_UNMUTE, {
|
|
@@ -692,6 +692,7 @@ class PlaneVideo {
|
|
|
692
692
|
transparent: true,
|
|
693
693
|
alphaTest: 0.5
|
|
694
694
|
}));
|
|
695
|
+
this.muteButtonModel.visible = false;
|
|
695
696
|
this.muteButtonModel.name = "muteBtn";
|
|
696
697
|
this.mesh.add(this.muteButtonModel);
|
|
697
698
|
}
|
|
@@ -707,7 +708,6 @@ class PlaneVideo {
|
|
|
707
708
|
transparent: true,
|
|
708
709
|
alphaTest: 0.5
|
|
709
710
|
}));
|
|
710
|
-
this.unmuteButtonModel.visible = false;
|
|
711
711
|
this.unmuteButtonModel.name = "unmuteBtn";
|
|
712
712
|
this.mesh.add(this.unmuteButtonModel);
|
|
713
713
|
}
|