| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668 | class Software {    constructor (icube) {        this.icube = icube;        this.data = {   // for it            Stores: [                /*                    {                        "Id": "1A01",               - 1| level, A| index of store, 01| count                        "Capacity": 1,              - no of positions                        "GridPosition": {                            "X": 1,                            "Y": 9                        },                        "Position": {                            "X": 98650.0,                            "Y": 100737.5,                            "Z": 1.0                        },                        "Size": {                            "Length": 2700.0,                            "Width": 1435.0,                            "Height": 900.0                        },                        "Type": "PipeRun"           - type of store                        "Props" [level, row, index] - used in the scene |level,row,index                    },                    {                        "Id": "XTrack2L02",         - XTrack, 2| index, L02| level                        "Capacity": 3,              - no of rows                        "GridPosition": {                            "X": 6,                            "Y": 8                        },                        "Position": {                            "X": 98600.0,                            "Y": 102172.5,                            "Z": 1001.0                        },                        "Size": {                            "Length": 8400.0,                            "Width": 1475.0,                            "Height": 900.0                        },                        "Type": "Track"             - type of store                        "Props" [level, row, index] - used in the scene |level,index,baseName                    }, {}...                */            ]        };        this.length = 0;        this.grid = null;        this.create();        return this;    }    /**     * create the JSON     */    create () {        this.data.Stores = [];        if (this.icube.activedXtrackIds.length === 0) return;        if (!this.icube.SPSystem || !this.icube.SPSystem[0] || (this.icube.SPSystem[0] && !this.icube.SPSystem[0][6])) return;        const topPos = 5;        const origPos = [100, 100];        const length = _round(2 * this.icube.palletOverhang + 2 * this.icube.loadPalletOverhang + g_palletInfo.length, 2);        const storeChar = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P'];        const maxValC = (this.icube.isHorizontal === true ? this.icube.maxCol : this.icube.maxRow);        let maxPallets = 0;        selectedIcube.infos.capacity.forEach((cap) => {            maxPallets += cap[g_palletInfo.max];        });        const maxY = maxPallets + this.icube.activedXtrackIds.length + topPos;        // scale xtracks        const max = [(this.icube.isHorizontal ? this.icube.area.minZ : this.icube.area.minX), (this.icube.isHorizontal ? this.icube.area.maxZ : this.icube.area.maxX)];        let xtrackScale = this.icube.activedXtrackIds.map(e => max[this.icube.isHorizontal ? 1 : 0] + (this.icube.isHorizontal ? -1 : +1) * e);        xtrackScale = xtrackScale.sort(function(a, b) { return b - a; });        // get completed store        const capacity = this.icube.infos.capacity;        for (let h = 0; h < this.icube.rackingHighLevel; h++) {            const palletInfo = this.icube.palletAtLevel.filter(e => e.idx === (h + 1));            const height = 0.38 + (palletInfo.length > 0 ? parseFloat(palletInfo[0].height) : this.icube.palletHeight);            const gridX = (maxValC + 2) * h + 1;            let offsetSpacing = 0;            for (let j = 0; j < maxValC; j++) {                if (this.icube.activedSpacing.includes(j - 1)) {                    offsetSpacing += this.icube.spacingBetweenRows * 1000;                }                let offsetY = 0;                const stPerRow = this.icube.stores.filter(e => (e.height === h && e.row === (this.icube.isHorizontal ? j : maxValC - j - 1)));                if (stPerRow.length > 0) {                    for (let s = 0; s < stPerRow[0].dimension.length; s++) {                        const storeIndex = this.icube.getIdx(stPerRow[0].dimension[s]);                        let capY = 0;                        let posY = 0;                        for (let k = 0; k <= storeIndex; k++) {                            capY += capacity[k][g_palletInfo.max];                            if (k > 1)                                posY += _round((this.icube.infos.dimensions[k - 1][1] - this.icube.infos.dimensions[k - 1][0]), 2);                        }                        const localCap = stPerRow[0].positions[s][g_palletInfo.max].length;                        if (localCap === 0) continue;                        const storeCap = capacity[storeIndex][g_palletInfo.max];                        const gridY = maxY - capY - storeIndex + 1;                        const diff = this.calculateOffsetY(stPerRow[0], s, storeIndex);                        offsetY = localCap !== storeCap ? diff[0] : 0;                        const storeWidth = _round((this.icube.infos.dimensions[storeIndex][1] - this.icube.infos.dimensions[storeIndex][0]), 2);                        const width = _round((stPerRow[0].dimension[s][1] - stPerRow[0].dimension[s][0]), 2);                        let positionY = storeIndex == 0 ? origPos[1] + g_xtrackFixedDim : origPos[1] - storeWidth - (storeIndex - 1) * g_xtrackFixedDim - posY;                        positionY += localCap !== storeCap ? diff[1] : 0;                        const store = {                            Id: parseInt(h + 1) + storeChar[s] + ('0' + (j + 1)).slice(-2),                            Capacity: localCap > storeCap ? storeCap : localCap,                            GridPosition: {                                "X": gridX + j,                                "Y": gridY + offsetY                            },                            Position: {                                "X": _round(origPos[0] + j * length, 2) * 1000 + offsetSpacing,                                "Y": parseInt(positionY * 1000),                                "Z": parseInt(this.icube.getHeightAtLevel(h) * 1000 + 1)                            },                            Size: {                                "Length": parseInt(length * 1000),                                "Width": parseInt(width * 1000),                                "Height": parseInt(height * 1000)                            },                            Type: "PipeRun",                        }                        this.data.Stores.push(store);                    }                }            }            let nextPos = 0;            for (let i = 0; i < xtrackScale.length; i++) {                const l = xtrackScale.length - i - 1;                const particles = this.icube.SPSystem[h][6].particles.filter(e => e.props[3] === _round(xtrackScale[l], 3));                let xtracks = [[]];                for (let j = 0; j < particles.length; j++) {                    xtracks[xtracks.length - 1].push(particles[j].props[this.icube.isHorizontal ? 1 : 0]);                    if (particles[j + 1]) {                        if (particles[j + 1].props[this.icube.isHorizontal ? 1 : 0] - particles[j].props[this.icube.isHorizontal ? 1 : 0] > 1) {                            xtracks.push([]);                        }                    }                }                let capY = 0;                for (let j = 0; j <= i; j++) {                    capY += capacity[j][g_palletInfo.max];                }                const gridYT = maxY - i - capY;                for (let k = 0; k < xtracks.length; k++) {                    const xtrackStart = this.icube.isHorizontal ? Math.min(...xtracks[k]) : maxValC - (Math.max(...xtracks[k])) - 1;                    const gridXT = (maxValC + 2) * h + 1 + xtrackStart;                    const capacity = xtracks[k].length;                    nextPos += (i > 0 ? xtrackScale[l + 1] - xtrackScale[l] : 0);                    let noOfSpacingPos = 0;                    let noOfSpacingSiz = 0;                    for (let j = 0; j < this.icube.activedSpacing.length; j++) {                        if (this.icube.activedSpacing[j] < xtrackStart) noOfSpacingPos++;                        if (xtracks[k].includes(this.icube.activedSpacing[j])) noOfSpacingSiz++;                    }                    const store = {                        Id: "XTrack" + parseInt(i + 1) + "L" + ('0' + (h + 1)).slice(-2),                        Capacity: capacity,                        GridPosition: {                            "X": gridXT,                            "Y": gridYT                        },                        Position: {                            "X": (origPos[0] + xtrackStart * length + noOfSpacingPos * this.icube.spacingBetweenRows) * 1000,                            "Y": (i === 0 ? origPos[1] : origPos[1] + nextPos) * 1000,                            "Z": parseInt((this.icube.getHeightAtLevel(h)) * 1000 + 1)                        },                        Size: {                            "Length": parseInt((capacity * length + noOfSpacingSiz * this.icube.spacingBetweenRows) * 1000),                            "Width": parseInt(g_xtrackFixedDim * 1000),                            "Height": parseInt(height * 1000)                        },                        Type: "Track",                    }                    this.data.Stores.push(store);                }            }        }    }    calculateOffsetY (store, localIdx, storeIdx) {        const Sdim = store.dimension[localIdx];        const Scap = store.positions[localIdx][g_palletInfo.max].length;        const dim = this.icube.infos.dimensions[storeIdx];        const cap = this.icube.infos.capacity[storeIdx][g_palletInfo.max];        const diff0 = cap - Scap;        const diff1 = _round(Math.abs(Sdim[1] - dim[1]), 3);        let ypos = 0;        // const width = _round((g_PalletW[g_palletInfo.max] + g_spacingBPallets[g_palletInfo.max] + 2 * g_loadPalletOverhang), 2);        if (diff1 > g_offsetDiff / 2) {            // console.log((diff1 + g_spacingBPallets[g_palletInfo.max]), width, (diff1 + g_spacingBPallets[g_palletInfo.max]) / width)            // ypos = parseInt(((diff1 + g_spacingBPallets[g_palletInfo.max] + 2 * g_loadPalletOverhang) / width).toFixed(0));            ypos = diff0;        }        return [ypos, diff1];    }    init (lengthVal = 0) {        if (!this.icube) return;        const atracks = this.icube.activedXtrackIds;        atracks.sort(function(a, b) {            return a - b;        });        this.data.Stores = [];        const topPos = 5;        const origPos = [100, 100];        const palletType = g_palletInfo.max;        const overhang = [0.050, 0.075, 0.100];        const lengthFix = 1.400 + 2 * overhang[this.icube.palletOverhang];        this.length = lengthVal !== 0 ? lengthVal : lengthFix;        const widthX = g_xtrackFixedDim;        const dimensionP = g_palletInfo.width;        const distBetweenP = g_spacingBPallets[g_palletInfo.max];        const widthP = dimensionP + distBetweenP;        const storeChar = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P'];        const maxValC = (this.icube.isHorizontal === true ? this.icube.maxCol : this.icube.maxRow);        const maxValR = (this.icube.isHorizontal === true ? this.icube.maxRow : this.icube.maxCol);        let pallNo = 0;        let firstCap = 0;        for (let i = 0; i < maxValC; i++) {            const auxNo = this.icube.drawPallet(this.icube.palletType, 0, i, true);            if (Math.max(...auxNo) > pallNo)                pallNo = Math.max(...auxNo);        }        let caps = 0;        let row = 0;        let capacities = [];        let capacitiesP = [];        const diffUpRight = Math.abs(this.icube.upRightDistance - this.icube.upRightDistanceOff)        if (atracks.length > 0) {            for (let i = 0; i <= atracks.length; i++) {                let capacity = 0;                capacities.push([]);                if (i === 0) {                    capacity = atracks[i] + 1;                }                else {                    if (atracks[i]) {                        capacity = atracks[i] - atracks[i - 1];                    }                    else {                        capacity = maxValR - atracks[i - 1] - 2;                    }                }                caps += capacity;                for (let j = row; j < caps; j++) {                    capacities[capacities.length -1].push(j);                }                row += capacity;            }        }        if (capacities.length === 0) return;        for (let k = 0; k < this.icube.rackingHighLevel; k++) {            const palletInfo = this.icube.palletAtLevel.filter(e => e.idx === (k + 1));            const heightP = 0.38 + (palletInfo.length > 0 ? parseFloat(palletInfo[0].height) : this.icube.palletHeight);            capacitiesP[k] = [];            const xtracksP = (this.icube.SPSystem && this.icube.SPSystem[k] && this.icube.SPSystem[k][6]) ? this.icube.SPSystem[k][6].particles : [];            let offsetSpacing = 0;            let offsetIreg = 0;            for (let j = 0; j < maxValC; j++) {                if (this.icube.activedSpacing.includes(j - 1)) {                    offsetSpacing += this.icube.spacingBetweenRows * 1000;                }                capacitiesP[k].push(this.icube.drawPallet(this.icube.palletType, k, j, false, palletType, null, true, true));                let currentCap = 0;                let currentDist = 0;                let passTh = [];                for (let p = 0; p < this.icube.activedPassthrough.length; p++) {                    if (this.icube.activedPassthrough[p][2].includes(k) && this.icube.activedPassthrough[p][1].includes(j)) {                        passTh = passTh.concat(this.icube.activedPassthrough[p][0]);                    }                }                let values = [];                for (let f = 0; f < this.icube.transform[k][3].data.length; f++) {                    if (this.icube.transform[k][3].data[f][this.icube.isHorizontal ? 1 : 0] === j)                        values.push(this.icube.transform[k][3].data[f][this.icube.isHorizontal ? 0 : 1]);                }                const gridX = (maxValC + 2) * k + (j + 1);                let indexChar = 0;                let m = 0;                let distM = 0;                for (let i = 0; i <= atracks.length; i++) {                    let capacity = [...capacities[i]];                    const found = passTh.some(r=> capacity.includes(r));                    if (found) {                        // found a passth                        let diffs = 0;                        for (let p = capacity.length - 1; p >= 0; p--) {                            if (passTh.includes(capacity[p])) {                                capacity.splice(p, 1);                                diffs++;                            }                        }                        let dist = 0;                        let cap = 0;                        if (capacitiesP[k][j][i]) {                            capacitiesP[k][j][i].forEach((val) => {                                let step = _round(val / widthP);                                step = step <= 0 ? 0 : step;                                cap += step;                                dist += val;                            })                        }                        currentCap += cap;                        currentDist += dist;                        if (i === 0) { firstCap = dist }                        const gridY = topPos + pallNo + atracks.length + cap - i - currentCap - 1;                        const posY = parseInt((i === 0 ? (origPos[1] - firstCap) : (origPos[1] - firstCap + (currentDist - dist)) + i * widthX) * 1000);                        distM = (diffs * 1.34 + (diffs + 1) * this.icube.upRightDistance);                        m = Math.ceil(distM / widthP);                        if (capacitiesP[k][j][i]) {                            for (let l = 0; l < capacitiesP[k][j][i].length; l++) {                                if (capacitiesP[k][j][i][l] <= 0) continue;                                let capBasedOnRaking = _round(capacitiesP[k][j][i][l] / widthP);                                if (capBasedOnRaking <= 0) continue;                                this.data.Stores.push({                                    Id: (k + 1) + storeChar[indexChar] + ('0' + (j + 1)).slice(-2),                                    Capacity: capBasedOnRaking,                                    GridPosition: {                                        "X": gridX,                                        "Y": gridY - l * m - capBasedOnRaking - offsetIreg + (capacitiesP[k][j][i].length - l) - 1                                    },                                    Position: {                                        "X": parseInt((j === 0 ? origPos[0] : (origPos[0] + j * this.length)) * 1000 + offsetSpacing),                                        "Y": posY + l * distM * 1000 + (l * capacitiesP[k][j][i][l] - l * (diffUpRight - 0.04)) * 1000,                                        "Z": parseInt(this.icube.getHeightAtLevel(k, false) * 1000 + 1)                                    },                                    Size: {                                        "Length": parseInt(this.length * 1000),                                        "Width": parseInt(capacitiesP[k][j][i][l] * 1000),                                        "Height": parseInt(heightP * 1000)                                    },                                    Type: "PipeRun",                                    Props: [k, j, i]                                });                                indexChar++;                            }                        }                    }                    else {                        // no passth                        let dist = 0;                        let cap = 0;                        if (capacitiesP[k][j][i]) {                            capacitiesP[k][j][i].forEach((val) => {                                let step = _round(val / widthP);                                step = step <= 0 ? 0 : step;                                cap += step;                                dist += val;                            })                        }                        currentCap += cap;                        currentDist += dist;                        if (i === 0) { firstCap = dist }                        const min = Math.min(...values);                        if (i === 0) {                            if (min !== 0)                                offsetIreg = _round((min * g_width + min * this.icube.upRightDistanceOff) / widthP);                            else                                offsetIreg = 0;                        }                        let pillers = this.icube.activedPillers.filter(e => (e.slotId === i && e.col === j));                        const gridY = topPos + pallNo + atracks.length + cap - i - currentCap - 1 - m;                        const posY = parseInt((i === 0 ? (origPos[1] - firstCap) : (origPos[1] - firstCap + (currentDist - dist) + distM) + i * widthX) * 1000);                        if (pillers.length > 0) {                            pillers = pillers.sort((a, b) => { return a.idx - b.idx; });                            let auxCap = [];                            for (let xx = 0; xx < pillers.length; xx++) {                                if (xx === 0) {                                    auxCap.push([pillers[xx].idx, 1]);                                }                                else {                                    if (Math.abs(pillers[xx].idx - pillers[xx - 1].idx) === 1) {                                        auxCap[auxCap.length - 1][1]++;                                    }                                    else {                                        auxCap.push([pillers[xx].idx, 1]);                                    }                                }                            }                            let auxStores = [];                            for (let xx = 0; xx < auxCap.length; xx++) {                                if (auxCap[xx + 1]) {                                    auxStores.push([0, auxCap[xx][0] - 1, auxCap[xx][0]]);                                }                                else {                                    let idx = 0;                                    if (auxCap.length > 1) {                                        idx = auxCap[xx - 1][0] + auxCap[xx - 1][1]                                    }                                    if ((auxCap[xx][0] - idx) !== 0)                                        auxStores.push([idx, auxCap[xx][0] - 1, auxCap[xx][0] - idx]);                                                                        if ((cap - (auxCap[xx][0] + auxCap[xx][1])) !== 0)                                        auxStores.push([auxCap[xx][0] + auxCap[xx][1], cap - 1, cap - (auxCap[xx][0] + auxCap[xx][1])]);                                }                            }                            auxStores.reverse();                            // if (k == 0) { console.log('k:'+k, 'j:'+j, 'i:'+i, 'cap:'+cap, 'grid:'+gridY, auxCap, auxStores ) }                            indexChar += auxStores.length - 1;                            for (let xx = 0; xx < auxStores.length; xx++) {                                this.data.Stores.push({                                    Id: (k + 1) + storeChar[indexChar - xx] + ('0' + (j + 1)).slice(-2),                                    Capacity: auxStores[xx][2],                                    GridPosition: {                                        "X": gridX,                                        "Y": gridY - auxStores[xx][1] - offsetIreg                                    },                                    Position: {                                        "X": parseInt((j === 0 ? origPos[0] : (origPos[0] + j * this.length)) * 1000 + offsetSpacing),                                        "Y": posY + parseInt(widthP * auxStores[xx][0] * 1000),                                        "Z": parseInt(this.icube.getHeightAtLevel(k, false) * 1000 + 1)                                    },                                    Size: {                                        "Length": parseInt(this.length * 1000),                                        "Width": parseInt((dist - widthP * (cap - auxStores[xx][2])) * 1000),                                        "Height": parseInt(heightP * 1000)                                    },                                    Type: "PipeRun",                                    Props: [k, j, i]                                });                            }                        }                        else {                            this.data.Stores.push({                                Id: (k + 1) + storeChar[indexChar] + ('0' + (j + 1)).slice(-2),                                Capacity: cap,                                GridPosition: {                                    "X": gridX,                                    "Y": gridY - cap - offsetIreg + 1                                },                                Position: {                                    "X": parseInt((j === 0 ? origPos[0] : (origPos[0] + j * this.length)) * 1000 + offsetSpacing),                                    "Y": posY,                                    "Z": parseInt(this.icube.getHeightAtLevel(k, false) * 1000 + 1)                                },                                Size: {                                    "Length": parseInt(this.length * 1000),                                    "Width": parseInt(dist * 1000),                                    "Height": parseInt(heightP * 1000)                                },                                Type: "PipeRun",                                Props: [k, j, i]                            });                        }                        if (j === 0 && i < atracks.length) {                            let capacity = xtracksP.filter(e => (e.props[this.icube.isHorizontal === true ? 0 : 1] === atracks[i] && e.props[2] === k && !e.hasOwnProperty('passTh'))).length;                            let yOffset = 0;                            let yOffset2 = 0;                            if (capacitiesP[k][j][i]) {                                let step = _round(capacitiesP[k][j][i] / widthP);                                step = step <= 0 ? 0 : step;                                yOffset = step;                                yOffset2 = capacitiesP[k][j][i];                            }                            this.data.Stores.push({                                Id: "XTrack" + i + "L" + ('0' + (k + 1)).slice(-2),                                Capacity: capacity,                                GridPosition: {                                    "X": gridX,                                    "Y": gridY - yOffset                                },                                Position: {                                    "X": parseInt((j === 0 ? origPos[0] : (origPos[0] + j * this.length)) * 1000),                                    "Y": posY + yOffset2 * 1000,                                    "Z": parseInt((this.icube.getHeightAtLevel(k, false)) * 1000 + 1)                                },                                Size: {                                    "Length": parseInt(capacity * this.length * 1000 + this.icube.activedSpacing.length * this.icube.spacingBetweenRows * 1000),                                    "Width": parseInt(widthX * 1000),                                    "Height": parseInt(heightP * 1000)                                },                                Type: "Track",                                Props: [k, atracks[i], i, "XTrack"]                            });                        }                    }                    /* tre adaugate                    if (k === 0) {                        // add chargers                        for (let l = 0; l < this.icube.activedChargers.length; l++) {                            if (this.icube.activedChargers[l].col === j) {                                if ((this.icube.activedChargers[l].row === 0 && i === 0) || (this.icube.activedChargers[l].row !== 0 && i === atracks.length)) {                                    this.data.Stores.push({                                        Id: "Charger" + (k + 1) + storeChar[indexChar] + ('0' + (j + 1)).slice(-2),                                        Type: "Charger",                                        Props: [k, j, i]                                    });                                    break;                                }                            }                        }                    }                    */                    indexChar++;                }            }        }        // console.log(capacitiesP)        /* tre adaugate        // add carriers        const carriers = this.icube.calculatedCarriersNo + this.icube.extra.carrier;        for (let i = 0; i < carriers; i++) {            this.data.Stores.push({                Name: "Carrier" + ('0' + (i + 1)).slice(-2),                Size: {                    "Length": parseInt(1270),                    "Width": parseInt(960),                    "Height": parseInt(250)                },                Type: "Carrier",                Props: [i, "Carrier"]            });        }        // add lifts        const xtracks = this.data.Stores.filter(e => e.Type === 'Track' && e.GridPosition.X === 1);        for (let i = 0; i < this.icube.activedLiftInfos.length; i++) {            let gridY = 0;            if (this.icube.lifts.length > 0) {                const height = this.icube.lifts[i].rackings.filter(e => e.isVisible === true).length - 1;                let liftH = parseInt(heightP * 1000) * height;                if (height === this.icube.rackingHighLevel && this.icube.palletAtLevel.length > 0) {                    let customH = 0;                    this.icube.palletAtLevel.forEach((item) => {                        customH += parseFloat((parseFloat(item.height) + 0.38).toFixed(2));                    });                    liftH = parseInt(heightP * 1000) * (height - this.icube.palletAtLevel.length) + parseInt(customH * 1000);                }                xtracks.forEach((val) => {                    if (val.Props[1] === this.icube.activedLiftInfos[i].row) {                        gridY = val.GridPosition.Y - 1;                    }                    else {                        if (val.Props[1] === this.icube.activedLiftInfos[i].row - 1) {                            gridY = val.GridPosition.Y + 1;                        }                    }                });                this.data.Stores.push({                    Name: "Lift" + ('0' + (i + 1)).slice(-2),                    GridPosition: {                        "X": this.icube.activedLiftInfos[i].col + 1,                        "Y": gridY                    },                    Size: {                        "Length": parseInt(1000),                        "Width": parseInt(1400),                        "Height": liftH                    },                    Levels: height,                    Type: "Lift",                    Props: [i, "Lift"]                });            }        }        */        // console.log(this.data);        // console.log(JSON.stringify(this.data));    }    /**     * Show viewer for specific level     * @param {Number} hLevel      */    show (hLevel) {}    /**     * Hide viewer     */    hide () {}    /**     * Remove class     */    remove () {        this.icube = null;        this.data = {            stores: []        };        this.hide();        // for (let i = 0; i < this.plans.length; i++) {        //     this.plans[i].dispose(false, true);        // }        // this.plans = null;        delete this;    }    /**     * On change icube properties     */    update (val) {        this.create(val);    }    /**     * Download JSON file     */    download () {        let props = [];        this.data.Stores.forEach((v) => { props.push(v.Props); delete v.Props; });        download('Report.json', new Blob([JSON.stringify(this.data, null, 2)], {type : 'application/json'}));        this.data.Stores.forEach((v, i) => { v.Props = props[i] });    }}
 |