/* eslint-disable array-callback-return */
/* eslint-disable no-unused-vars */
import * as THREE from "three";
import {
Canvas,
useFrame,
extend,
useLoader,
useThree,
axesHelper,
} from "react-three-fiber";
import { useRef, Suspense, useState, useEffect } from "react";
import { OrbitControls } from "@react-three/drei";
import {
useWebSocket,
useFullscreen,
useThrottle,
useRequest,
useAsyncEffect,
} from "ahooks";
import {
ShrinkOutlined,
CloseCircleFilled,
ExclamationCircleFilled,
} from "@ant-design/icons";
import { Tooltip, notification } from "antd";
import Model from "./models/gltf";
import Robot from "./models";
import Jixiebi from "./models/jiqiebi";
import { doFetch } from "../utils/doFetch";
import {
Selection,
EffectComposer,
Outline,
} from "@react-three/postprocessing";
let infos = {
device_5: "能耗1(1-12设备)",
device_6: "能耗2(13-24设备)",
device_1: "数控车床T360-2",
device_2: "数控车床T360-1",
device_3: "立式智能加工中心M850b",
device_4: "立式智能加工中心M850",
};
const modelconfig = [
{
name: "0",
position: [-24, 0, 24],
status: 1,
modelname: "cqg",
scale: 0.035,
},
{
name: "1",
position: [-21.5, 0, 24],
status: 1,
modelname: "kyj",
},
{
name: "2",
position: [-21.5, 0, 25.5],
status: 1,
modelname: "lgj",
scale: 0.06,
},
{
name: "3",
position: [-19, 0, 15],
status: 1,
modelname: "ptwymc",
rotation: [0, 1.6, 0],
},
{
name: "4",
position: [-21, 0, 6.5],
status: 1,
modelname: "pmmc",
scale: 0.06,
},
{
name: "5",
position: [-21, 0, -12],
status: 1,
modelname: "M1.4",
},
{
name: "6",
position: [-21, 0, -4],
status: 1,
modelname: "M1.4",
},
{
name: "7",
position: [-21, 0, -22],
status: 1,
modelname: "M8",
rotation: [0, 1.6, 0],
},
{
name: "8",
position: [-6, 0, -22],
status: 1,
modelname: "M8",
rotation: [0, 1.6, 0],
},
{
name: "9",
position: [3, 0, -22],
status: 1,
modelname: "M8",
rotation: [0, 1.6, 0],
},
{
name: "10",
position: [12, 0, -22],
status: 1,
modelname: "M8",
rotation: [0, 1.6, 0],
},
{
name: "11",
position: [21, 0, -22],
status: 1,
modelname: "M8",
rotation: [0, 1.6, 0],
},
{
name: "12",
position: [18, 0, -20.5],
status: 1,
modelname: "T360",
scale: 0.75,
},
{
name: "13",
position: [5.7, 0, -7],
status: 1,
modelname: "T360",
scale: 0.75,
rotation: [0, 1.6, 0],
},
{
name: "14",
position: [19.8, 0, 8],
status: 1,
modelname: "M850",
scale: 0.052,
rotation: [0, 1.58, 0],
},
{
name: "15",
position: [18, 0, 17],
status: 1,
modelname: "M8",
},
{
name: "16",
position: [18, 0, 25],
status: 1,
modelname: "M8",
},
{
name: "17",
position: [11, 0, 26],
status: 1,
modelname: "M1.4",
},
{
name: "18",
position: [16.5, 0, 18.5],
status: 1,
modelname: "T360",
scale: 0.75,
rotation: [0, -1.58, 0],
},
{
name: "19",
position: [11, 0, 8],
status: 1,
modelname: "M850",
scale: 0.052,
rotation: [0, -1.58, 0],
},
{
name: "20",
position: [-2, 0, 9.2],
status: 1,
modelname: "T3.4",
scale: 0.23,
rotation: [0, 1.58, 0],
},
{
name: "21",
position: [-0.5, 0, 26],
status: 1,
modelname: "M1.4",
},
{
name: "22",
position: [-9, 0, 24.5],
status: 1,
modelname: "CAK5085",
rotation: [0, -1.58, 0],
scale: 0.04,
},
{
name: "23",
position: [-9, 0, 16.6],
status: 1,
modelname: "wyjmmc",
rotation: [0, -1.58, 0],
scale: 0.055,
},
{
name: "24",
position: [-8.79, 0, 8],
status: 1,
modelname: "nymc",
rotation: [0, -1.58, 0],
scale: 0.055,
},
];
const statusbar = {
1: {
color: "#6AE49B",
name: "运行",
},
2: {
color: "#4887E0",
name: "待机",
},
3: {
color: "#8D8D8D",
name: "关机",
},
4: {
color: "#F31A1A",
name: "故障",
},
};
const Floor = (props) => {
return (
<>
离线设备