|
@@ -46,7 +46,6 @@
|
|
<button class="btn" @click="Suspend">暂 停</button>
|
|
<button class="btn" @click="Suspend">暂 停</button>
|
|
<button class="btn" @click="Begin">开 始</button>
|
|
<button class="btn" @click="Begin">开 始</button>
|
|
<button class="btn" @click="playBack" :disabled="!isShow">回 放</button>
|
|
<button class="btn" @click="playBack" :disabled="!isShow">回 放</button>
|
|
-
|
|
|
|
<input type="file" ref="fileInput" style="display: none" @change="importData" accept=".json" />
|
|
<input type="file" ref="fileInput" style="display: none" @change="importData" accept=".json" />
|
|
</div>
|
|
</div>
|
|
<div class="small" id="small" ref="small" v-show="isShow"></div>
|
|
<div class="small" id="small" ref="small" v-show="isShow"></div>
|
|
@@ -143,7 +142,8 @@ export default {
|
|
{ value: 8, label: '8倍速' },
|
|
{ value: 8, label: '8倍速' },
|
|
{ value: 16, label: '16倍速' },
|
|
{ value: 16, label: '16倍速' },
|
|
{ value: 32, label: '32倍速' },
|
|
{ value: 32, label: '32倍速' },
|
|
- { value: 64, label: '64倍速' }
|
|
|
|
|
|
+ { value: 64, label: '64倍速' },
|
|
|
|
+ { value: 128, label: '128倍速' }
|
|
],
|
|
],
|
|
// 暂停和开始
|
|
// 暂停和开始
|
|
isAnimation: false,
|
|
isAnimation: false,
|
|
@@ -206,8 +206,8 @@ export default {
|
|
this.initSmall()
|
|
this.initSmall()
|
|
this.initOrbitControls()
|
|
this.initOrbitControls()
|
|
// this.createCube();
|
|
// this.createCube();
|
|
- // this.createWave()
|
|
|
|
- // this.waveModel()
|
|
|
|
|
|
+ this.createWave()
|
|
|
|
+ this.waveModel()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
getFile() {
|
|
getFile() {
|
|
@@ -485,12 +485,11 @@ export default {
|
|
// 调用生成轨迹函数
|
|
// 调用生成轨迹函数
|
|
this.makeCurve(modelInfo)
|
|
this.makeCurve(modelInfo)
|
|
}
|
|
}
|
|
-
|
|
|
|
if (modelInfo.name === 'agent' || modelInfo.name === 'agent1') {
|
|
if (modelInfo.name === 'agent' || modelInfo.name === 'agent1') {
|
|
- // this.agentSpeed.push(modelInfo.speed[modelInfo.pathIndex]);
|
|
|
|
- // this.times.push(this.allTimes[modelInfo.pathIndex]);
|
|
|
|
|
|
+ // this.agentSpeed.push(modelInfo.speed[index]);
|
|
|
|
+ // this.times.push(this.allTimes[index]);
|
|
this.times.push(...this.allTimes.slice(modelInfo.prevIndex, index))
|
|
this.times.push(...this.allTimes.slice(modelInfo.prevIndex, index))
|
|
- // this.propsDistance.push(...this.distance.slice(modelInfo.prevIndex,modelInfo.pathIndex));
|
|
|
|
|
|
+ // this.propsDistance.push(...this.distance.slice(modelInfo.prevIndex,index));
|
|
|
|
|
|
this.propsIndex = index
|
|
this.propsIndex = index
|
|
// 展示生成事件文字
|
|
// 展示生成事件文字
|
|
@@ -498,7 +497,7 @@ export default {
|
|
}
|
|
}
|
|
if (modelInfo.name.startsWith('agent')) {
|
|
if (modelInfo.name.startsWith('agent')) {
|
|
this.agentSpeed[modelInfo.name]?.push(...modelInfo.speed.slice(modelInfo.prevIndex, index))
|
|
this.agentSpeed[modelInfo.name]?.push(...modelInfo.speed.slice(modelInfo.prevIndex, index))
|
|
- // this.propsDistance.push(...this.distance.slice(modelInfo.prevIndex,modelInfo.pathIndex));
|
|
|
|
|
|
+ // this.propsDistance.push(...this.distance.slice(modelInfo.prevIndex,index));
|
|
// 距离
|
|
// 距离
|
|
this.showDistance(this.allTimes[index], modelInfo.name)
|
|
this.showDistance(this.allTimes[index], modelInfo.name)
|
|
if (this.allDistance[modelInfo.name][index] <= 3) {
|
|
if (this.allDistance[modelInfo.name][index] <= 3) {
|
|
@@ -535,7 +534,7 @@ export default {
|
|
}
|
|
}
|
|
this.propsDirection[modelInfo.name]?.push(...modelInfo.direction.slice(modelInfo.prevIndex, index))
|
|
this.propsDirection[modelInfo.name]?.push(...modelInfo.direction.slice(modelInfo.prevIndex, index))
|
|
if (modelInfo.name === 'target') {
|
|
if (modelInfo.name === 'target') {
|
|
- // this.targetSpeed.push(modelInfo.speed[modelInfo.pathIndex]);
|
|
|
|
|
|
+ // this.targetSpeed.push(modelInfo.speed[index]);
|
|
this.targetSpeed.push(...modelInfo.speed.slice(modelInfo.prevIndex, index))
|
|
this.targetSpeed.push(...modelInfo.speed.slice(modelInfo.prevIndex, index))
|
|
this.tweenTargetPosition = {
|
|
this.tweenTargetPosition = {
|
|
x: modelInfo.route[index].x,
|
|
x: modelInfo.route[index].x,
|
|
@@ -591,7 +590,7 @@ export default {
|
|
if (intersects.length > 0) {
|
|
if (intersects.length > 0) {
|
|
let object = intersects[0].object
|
|
let object = intersects[0].object
|
|
if (object.userData.name?.startsWith('agent')) {
|
|
if (object.userData.name?.startsWith('agent')) {
|
|
- infoTag.innerHTML = `名称:${object.userData.name}
|
|
|
|
|
|
+ infoTag.innerHTML = `名称:雷${object.userData.name.substr(-1)}
|
|
<br>时间:${object.userData.time}
|
|
<br>时间:${object.userData.time}
|
|
<br>距离:${object.userData.distance}km`
|
|
<br>距离:${object.userData.distance}km`
|
|
infoTag.style.display = 'block'
|
|
infoTag.style.display = 'block'
|
|
@@ -647,11 +646,10 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
handelData(rawData1) {
|
|
handelData(rawData1) {
|
|
- let num = 1
|
|
|
|
- if (!rawData1[0][1].agent) num = 50
|
|
|
|
const rawData = rawData1.filter((item, index) => {
|
|
const rawData = rawData1.filter((item, index) => {
|
|
- return index % num === 0 || item[1].events.length !== 0 || item[1].report
|
|
|
|
|
|
+ return index % 10 === 0 || item[1].events.length !== 0 || item[1].report
|
|
})
|
|
})
|
|
|
|
+ console.log('rawData', rawData)
|
|
const color = [0xc1232b, 0x5470c6, 0xfac858, 0xee6666]
|
|
const color = [0xc1232b, 0x5470c6, 0xfac858, 0xee6666]
|
|
this.models = []
|
|
this.models = []
|
|
this.allTimes = []
|
|
this.allTimes = []
|
|
@@ -750,13 +748,13 @@ export default {
|
|
target.coordinate.push([targetX - beginCoordinate[0], targetY - beginCoordinate[1]])
|
|
target.coordinate.push([targetX - beginCoordinate[0], targetY - beginCoordinate[1]])
|
|
maxData = Math.max(targetX, targetY, maxData)
|
|
maxData = Math.max(targetX, targetY, maxData)
|
|
})
|
|
})
|
|
- // console.log(maxData);
|
|
|
|
|
|
+ console.log('rawDatarawDatarawDatarawData', rawData)
|
|
this.maxNum = Math.ceil(maxData)
|
|
this.maxNum = Math.ceil(maxData)
|
|
this.models = [].concat(...[Object.values(agents), target])
|
|
this.models = [].concat(...[Object.values(agents), target])
|
|
|
|
|
|
- // console.log('this.reportInfo', this.reportInfo)
|
|
|
|
- console.log('this.distance', this.distance)
|
|
|
|
- console.log('this.allDistance', this.allDistance)
|
|
|
|
|
|
+ // console.log("this.models", this.models);
|
|
|
|
+ // console.log("this.distance",this.distance);
|
|
|
|
+ // console.log("this.allDistance",this.allDistance);
|
|
|
|
|
|
this.models.forEach((modelInfo, index) => {
|
|
this.models.forEach((modelInfo, index) => {
|
|
// this.propsDirection.push(modelInfo.direction);
|
|
// this.propsDirection.push(modelInfo.direction);
|
|
@@ -800,6 +798,7 @@ export default {
|
|
if (filterData.length !== this.propsDistance[name].length) {
|
|
if (filterData.length !== this.propsDistance[name].length) {
|
|
this.propsDistance[name] = filterData
|
|
this.propsDistance[name] = filterData
|
|
}
|
|
}
|
|
|
|
+ //console.log('propsDistance', this.propsDistance)
|
|
// if(this.distance[name].some(item => item[0] === parseFloat(time)) && !(this.propsDistance[name].some(item => item[0] === parseFloat(time)))){
|
|
// if(this.distance[name].some(item => item[0] === parseFloat(time)) && !(this.propsDistance[name].some(item => item[0] === parseFloat(time)))){
|
|
// this.propsDistance[name].push(this.distance[name].find(item => item[0] === parseFloat(time)));
|
|
// this.propsDistance[name].push(this.distance[name].find(item => item[0] === parseFloat(time)));
|
|
// console.log("this.propsDistance",this.propsDistance);
|
|
// console.log("this.propsDistance",this.propsDistance);
|