|
@@ -204,15 +204,15 @@ export default {
|
|
this.save = true
|
|
this.save = true
|
|
this.jsonData = {
|
|
this.jsonData = {
|
|
id: row.id,
|
|
id: row.id,
|
|
- xdname: row.xdname,
|
|
|
|
- type: row.type,
|
|
|
|
|
|
+ xdname: response.data.xdname,
|
|
|
|
+ type: response.data.type,
|
|
// creator: row.creator,
|
|
// creator: row.creator,
|
|
- createtime: row.createtime,
|
|
|
|
- bluecnt: row.bluecnt,
|
|
|
|
- target: row.target,
|
|
|
|
- starttime: row.starttime,
|
|
|
|
- steptime: row.steptime,
|
|
|
|
- endtime: row.endtime,
|
|
|
|
|
|
+ createtime: response.data.createtime,
|
|
|
|
+ bluecnt: response.data.bluecnt,
|
|
|
|
+ target: response.data.target,
|
|
|
|
+ starttime: response.data.starttime,
|
|
|
|
+ steptime: response.data.steptime,
|
|
|
|
+ endtime: response.data.endtime,
|
|
blueunit: blueunit,
|
|
blueunit: blueunit,
|
|
redunit: redunit,
|
|
redunit: redunit,
|
|
satellite: satellite,
|
|
satellite: satellite,
|
|
@@ -751,7 +751,7 @@ export default {
|
|
currentTime,
|
|
currentTime,
|
|
this.viewer2D.clock.startTime
|
|
this.viewer2D.clock.startTime
|
|
); // 获取从起始时间到当前时间的秒数
|
|
); // 获取从起始时间到当前时间的秒数
|
|
- if (parseInt(elapsedTime) % stepTime === 0) {
|
|
|
|
|
|
+ if (parseInt(elapsedTime) % stepTime === 0 && elapsedTime!=0) {
|
|
console.log('elapsedTime :>> ', elapsedTime);
|
|
console.log('elapsedTime :>> ', elapsedTime);
|
|
// 当从起始时间到当前时间的秒数是 stepTime 的倍数时,发送请求
|
|
// 当从起始时间到当前时间的秒数是 stepTime 的倍数时,发送请求
|
|
this.requestDataAndUpdateModel2D(startTime, elapsedTime);
|
|
this.requestDataAndUpdateModel2D(startTime, elapsedTime);
|
|
@@ -763,7 +763,7 @@ export default {
|
|
currentTime,
|
|
currentTime,
|
|
this.viewer2D.clock.startTime
|
|
this.viewer2D.clock.startTime
|
|
); // 获取从起始时间到当前时间的秒数
|
|
); // 获取从起始时间到当前时间的秒数
|
|
- if (parseInt(elapsedTime) % stepTime === 0) {
|
|
|
|
|
|
+ if (parseInt(elapsedTime) % stepTime === 0 && elapsedTime!=0) {
|
|
console.log('elapsedTime :>> ', elapsedTime);
|
|
console.log('elapsedTime :>> ', elapsedTime);
|
|
// 当从起始时间到当前时间的秒数是 stepTime 的倍数时,发送请求
|
|
// 当从起始时间到当前时间的秒数是 stepTime 的倍数时,发送请求
|
|
this.requestDataAndUpdateModel3D(startTime, elapsedTime);
|
|
this.requestDataAndUpdateModel3D(startTime, elapsedTime);
|
|
@@ -773,17 +773,28 @@ export default {
|
|
},
|
|
},
|
|
// 初始化stk方法,生成轨迹文件
|
|
// 初始化stk方法,生成轨迹文件
|
|
async initSTK() {
|
|
async initSTK() {
|
|
-
|
|
|
|
|
|
+ console.log('this.jsonData :>> ', this.jsonData);
|
|
|
|
+ // await axios
|
|
|
|
+ // .get("/api", this.jsonData).then(res=>{
|
|
|
|
+ // console.log('res :>> ', res);
|
|
|
|
+ // })
|
|
|
|
+ await axios
|
|
|
|
+ .post("/api/traj", this.jsonData).then(res=>{
|
|
|
|
+ console.log('res :>> ', res);
|
|
|
|
+ })
|
|
|
|
|
|
},
|
|
},
|
|
// 根据时间参数请求模型位置并更新 2D
|
|
// 根据时间参数请求模型位置并更新 2D
|
|
- requestDataAndUpdateModel2D(startTime, elapsedTime) {
|
|
|
|
|
|
+ async requestDataAndUpdateModel2D(startTime, elapsedTime) {
|
|
const jsDate = new Date(startTime);
|
|
const jsDate = new Date(startTime);
|
|
// 增加 elapsedTime 秒
|
|
// 增加 elapsedTime 秒
|
|
jsDate.setSeconds(jsDate.getSeconds() + elapsedTime);
|
|
jsDate.setSeconds(jsDate.getSeconds() + elapsedTime);
|
|
// 转换为需求字符串格式
|
|
// 转换为需求字符串格式
|
|
const newTimeString = `${jsDate.getFullYear()}-${(jsDate.getMonth() + 1).toString().padStart(2, '0')}-${jsDate.getDate().toString().padStart(2, '0')} ${jsDate.getHours().toString().padStart(2, '0')}:${jsDate.getMinutes().toString().padStart(2, '0')}:${jsDate.getSeconds().toString().padStart(2, '0')}`;
|
|
const newTimeString = `${jsDate.getFullYear()}-${(jsDate.getMonth() + 1).toString().padStart(2, '0')}-${jsDate.getDate().toString().padStart(2, '0')} ${jsDate.getHours().toString().padStart(2, '0')}:${jsDate.getMinutes().toString().padStart(2, '0')}:${jsDate.getSeconds().toString().padStart(2, '0')}`;
|
|
-
|
|
|
|
|
|
+ await axios
|
|
|
|
+ .post("/api/pos", {simulation_time: newTimeString+'.000'}).then(res=>{
|
|
|
|
+ console.log('res :>> ', res);
|
|
|
|
+ })
|
|
},
|
|
},
|
|
// 根据时间参数请求模型位置并更新 3D
|
|
// 根据时间参数请求模型位置并更新 3D
|
|
requestDataAndUpdateModel3D(startTime, elapsedTime) {
|
|
requestDataAndUpdateModel3D(startTime, elapsedTime) {
|