diff --git a/src/api/chat.js b/src/api/chat.js index 99fb60676..bc2dd4e5f 100644 --- a/src/api/chat.js +++ b/src/api/chat.js @@ -239,7 +239,7 @@ export function getPermissionJoint(group) { }); } -// +// 添加或更新真实设备和仿真对象连接 export function setRealDevice(group, data) { return request({ url: `/api/jointTraining/room/realDevice?group=${group}`, @@ -247,3 +247,20 @@ export function setRealDevice(group, data) { data: data }); } + +// 删除真实设备和仿真对象连接 +export function delRealDevice(id, group) { + return request({ + url: `/api/jointTraining/room/realDevice/${id}`, + method: 'delete', + params: { group: group } + }); +} + +// 获取真实设备列表 +export function getRealDevices(group) { + return request({ + url: `/api/jointTraining/room/${group}/devices`, + method: 'get' + }); +} diff --git a/src/i18n/langs/en/approval.js b/src/i18n/langs/en/approval.js index 0625695be..682cb4c02 100644 --- a/src/i18n/langs/en/approval.js +++ b/src/i18n/langs/en/approval.js @@ -32,5 +32,6 @@ export default { instructions: 'Instructions', chapterTrainingName: 'Chapter/training name', revokeScriptSuccess: 'Revoke script success', - revokeScriptFailed: 'Revoke script failed' + revokeScriptFailed: 'Revoke script failed', + skin: 'Skin' }; diff --git a/src/i18n/langs/en/error.js b/src/i18n/langs/en/error.js index a991c67b1..e75e4c0cc 100644 --- a/src/i18n/langs/en/error.js +++ b/src/i18n/langs/en/error.js @@ -94,5 +94,11 @@ export default { getTrainListFailed: 'Failed to get train list', getDraftCourseDataFailed: 'Failed to get draft course data!', failedToGetCourseData: 'Failed to get course data!', - failedToGetSystemData: 'Failed to get system data!' + failedToGetSystemData: 'Failed to get system data!', + inquiryPLCDeviceFailed: 'Inquiry PLC device failed!', + getScreenDoorsListFailed: 'Get the list of screen doors failed!', + theDeviceTypeAlreadyExists: 'The device type already exists!', + connectToRealDeviceFailed: 'Connect to real device failed!', + getRealDeviceListFailed: 'Get real device list failed!', + deleteRealDeviceFailed: 'Delete real device failed!' }; diff --git a/src/i18n/langs/en/exam.js b/src/i18n/langs/en/exam.js index 97fc53ffc..73b18ec01 100644 --- a/src/i18n/langs/en/exam.js +++ b/src/i18n/langs/en/exam.js @@ -37,5 +37,8 @@ export default { theBestTimeToCompleteTheQuestion: 'The best time to complete the question', trainingNotes: 'Training notes', giveUpTheExam: 'Give up the exam', - nameOfTestPaper: 'Test name' + nameOfTestPaper: 'Test name', + courseDescription: 'Course description', + enterTheExam: 'Enter the exam', + returnCourseList: 'Return course list' }; diff --git a/src/i18n/langs/en/lesson.js b/src/i18n/langs/en/lesson.js index 76a476b97..3a0b71073 100644 --- a/src/i18n/langs/en/lesson.js +++ b/src/i18n/langs/en/lesson.js @@ -58,7 +58,7 @@ export default { courseList: 'Course list', countSkinCode: 'Duplicate skin cannot be the same type as the copied skin', createNewCoursesFromRelease: 'Create new courses from release', - courseName: 'Course name:', + courseName: 'Course name', parentChapter: 'Parent chapter:', chapterName: 'Chapter name:', chapterInstructions: 'Chapter instructions:', @@ -71,7 +71,7 @@ export default { draftCourseName: 'Draft course name:', associatedSkin: 'Associated skin:', associatedProducts: 'Associated products:', - courseDescription: 'Course description:', + courseDescription: 'Course description', editCourse: 'Edit course', createCourse: 'Create course', courseRelease: 'Course release', @@ -116,5 +116,8 @@ export default { pendingReview: 'Pending review', published: 'Published', rejected: 'Rejected', - review: 'Review' + review: 'Review', + explanation: 'Explanation', + courseDetails: 'Course details', + courseTree: 'Course tree:' }; diff --git a/src/i18n/langs/en/map.js b/src/i18n/langs/en/map.js index 0e09fc04c..151f8d3ce 100644 --- a/src/i18n/langs/en/map.js +++ b/src/i18n/langs/en/map.js @@ -4,7 +4,7 @@ export default { pleaseSelect: 'please choose', pleaseEnter: 'please input', sketchMap: 'Draft map list', - newConstruction: 'create', + newConstruction: 'Create', importMap: 'Import the map', createNewMap: 'A new map', normalCreate: 'The normal to create', diff --git a/src/i18n/langs/en/teach.js b/src/i18n/langs/en/teach.js index d145ed68a..b03d30291 100644 --- a/src/i18n/langs/en/teach.js +++ b/src/i18n/langs/en/teach.js @@ -16,5 +16,7 @@ export default { permissionDistribute: 'Permission distribution (class)', authorityTransferred: 'Authority transferred', courseList: 'Course list', - seconds: 'seconds' + seconds: 'seconds', + enterTheCourse: 'Enter the course', + returnCourseList: 'Return course list' }; diff --git a/src/i18n/langs/en/trainRoom.js b/src/i18n/langs/en/trainRoom.js index 94a379547..a230a2095 100644 --- a/src/i18n/langs/en/trainRoom.js +++ b/src/i18n/langs/en/trainRoom.js @@ -27,5 +27,10 @@ export default { recording: 'recording...', sendText: 'Send text', left: 'left', - right: 'right' + right: 'right', + realDevice: 'Real device', + plcGatewayOnline: '[PLC gateway online]', + plcGatewayOffline: '[PLC gateway offline]', + uplinkPlatform: 'Uplink platform', + downlinkPlatform: 'Downlink platform' }; diff --git a/src/i18n/langs/zh/approval.js b/src/i18n/langs/zh/approval.js index db8c4db95..59e2c3755 100644 --- a/src/i18n/langs/zh/approval.js +++ b/src/i18n/langs/zh/approval.js @@ -32,6 +32,6 @@ export default { instructions: '说明', chapterTrainingName: '章节/课程名称', revokeScriptSuccess: '撤回成功', - revokeScriptFailed: '撤回失败' - + revokeScriptFailed: '撤回失败', + skin: '皮肤' }; diff --git a/src/i18n/langs/zh/error.js b/src/i18n/langs/zh/error.js index cd065c76d..4e1d1387c 100644 --- a/src/i18n/langs/zh/error.js +++ b/src/i18n/langs/zh/error.js @@ -94,5 +94,11 @@ export default { getTrainListFailed: '获取列车列表失败', getDraftCourseDataFailed: '获取草稿课程数据失败!', failedToGetCourseData: '获取课程数据失败!', - failedToGetSystemData: '获取系统数据失败!' + failedToGetSystemData: '获取系统数据失败!', + inquiryPLCDeviceFailed: '查询PLC设备失败!', + getScreenDoorsListFailed: '获取屏蔽门列表失败!', + theDeviceTypeAlreadyExists: '已存在该设备类型!', + connectToRealDeviceFailed: '关联真实设备失败!', + getRealDeviceListFailed: '获取真实设备列表失败!', + deleteRealDeviceFailed: '删除真实设备失败!' }; diff --git a/src/i18n/langs/zh/exam.js b/src/i18n/langs/zh/exam.js index 970e474e7..56318a45a 100644 --- a/src/i18n/langs/zh/exam.js +++ b/src/i18n/langs/zh/exam.js @@ -37,5 +37,8 @@ export default { maximumTimeToCompleteThisQuestion: '完成本题最大用时', theBestTimeToCompleteTheQuestion: '完成本题最佳用时', trainingNotes: '实训说明', - giveUpTheExam: '放弃考试' + giveUpTheExam: '放弃考试', + courseDescription: '课程说明', + enterTheExam: '进入考试', + returnCourseList: '返回课程列表' }; diff --git a/src/i18n/langs/zh/global.js b/src/i18n/langs/zh/global.js index 47813af43..be258d559 100644 --- a/src/i18n/langs/zh/global.js +++ b/src/i18n/langs/zh/global.js @@ -161,6 +161,6 @@ export default { help: '帮助', city: '城市', simulationSystem: '仿真系统', - lessonSystem: '课程系统', + lessonSystem: '教学系统', examSystem: '考试系统' }; diff --git a/src/i18n/langs/zh/lesson.js b/src/i18n/langs/zh/lesson.js index b0978644a..72ede12fb 100644 --- a/src/i18n/langs/zh/lesson.js +++ b/src/i18n/langs/zh/lesson.js @@ -57,7 +57,7 @@ export default { contentSorting: '内容排序', courseList: '课程列表', createNewCoursesFromRelease: '从发布课程新建', - courseName: '课程名称:', + courseName: '课程名称', parentChapter: '父级章节:', chapterName: '章节名称:', chapterInstructions: '章节说明:', @@ -70,7 +70,7 @@ export default { draftCourseName: '草稿课程名称:', associatedSkin: '关联皮肤:', associatedProducts: '关联产品:', - courseDescription: '课程说明:', + courseDescription: '课程说明', editCourse: '编辑课程', createCourse: '创建课程', courseRelease: '课程发布', @@ -115,7 +115,9 @@ export default { pendingReview: '待审核', published: '已发布', rejected: '已驳回', - review: '查看' - + review: '查看', + explanation: '驳回说明', + courseDetails: '课程详情', + courseTree: '课程树:' }; diff --git a/src/i18n/langs/zh/teach.js b/src/i18n/langs/zh/teach.js index cb98b896c..a5663050c 100644 --- a/src/i18n/langs/zh/teach.js +++ b/src/i18n/langs/zh/teach.js @@ -16,5 +16,7 @@ export default { permissionDistribute: '权限分发(上课)', authorityTransferred: '权限转赠', courseList: '课程列表', - seconds: '秒' + seconds: '秒', + enterTheCourse: '进入课程', + returnCourseList: '返回课程列表' }; diff --git a/src/i18n/langs/zh/trainRoom.js b/src/i18n/langs/zh/trainRoom.js index 04c70d8b2..481f9ebf0 100644 --- a/src/i18n/langs/zh/trainRoom.js +++ b/src/i18n/langs/zh/trainRoom.js @@ -27,5 +27,10 @@ export default { recording: '录音中...', sendText: '发送文字', left: '左', - right: '右' + right: '右', + realDevice: '真实设备', + plcGatewayOnline: '[PLC网关在线]', + plcGatewayOffline: '[PLC网关离线]', + uplinkPlatform: '上行站台', + downlinkPlatform: '下行站台' }; diff --git a/src/jlmap3d/jl3ddrive/moveupdate/DrivingConnect.js b/src/jlmap3d/jl3ddrive/moveupdate/DrivingConnect.js index 7b443c5e0..ec72177b3 100644 --- a/src/jlmap3d/jl3ddrive/moveupdate/DrivingConnect.js +++ b/src/jlmap3d/jl3ddrive/moveupdate/DrivingConnect.js @@ -157,13 +157,13 @@ export function Jl3dDriving(updatemmi,sound) { if (trainlisttest.list[code].runMode == '02') { if (trainlisttest.list[code].isStandTrack == true) { - trainlisttest.list[code].speeds = parseFloat(data.body[tl].v*10/36/23/trainlisttest.list[code].len); + trainlisttest.list[code].speeds = parseFloat(data.body[tl].v*10/36/24/trainlisttest.list[code].len); } else { - trainlisttest.list[code].speeds = parseFloat(data.body[tl].v*10/36/23/trainlisttest.list[code].len); + trainlisttest.list[code].speeds = parseFloat(data.body[tl].v*10/36/24/trainlisttest.list[code].len); } } else { - trainlisttest.list[code].speeds = parseFloat(data.body[tl].v*10/36/23/trainlisttest.list[code].len); + trainlisttest.list[code].speeds = parseFloat(data.body[tl].v*10/36/24/trainlisttest.list[code].len); } if (code == drivingcode) { @@ -357,7 +357,7 @@ export function Jl3dDriving(updatemmi,sound) { // trainlisttest.list[code].startmark = 1; }else{ trainlisttest.list[code].speeds = data.body[i].speed; - trainlisttest.list[code].speeds = parseFloat(data.body[i].speed*10/36/23/trainlisttest.list[code].len); + trainlisttest.list[code].speeds = parseFloat(data.body[i].speed*10/36/24/trainlisttest.list[code].len); } @@ -414,45 +414,45 @@ export function Jl3dDriving(updatemmi,sound) { updatemmi.updatenowlen(0); } } - if (data.body[i].directionType == '02') { // 向右 + if (data.body[i].directionType == '02') { // 向右 - if (trainlisttest.list[code].status != data.body[i].directionType) { - trainlisttest.list[code].progress = 0; - const rotaposx = trainlisttest.list[code].children[5].matrixWorld.elements[12]; - const rotaposz = trainlisttest.list[code].children[0].matrixWorld.elements[14]; - trainlisttest.list[code].rotation.y = 0; - trainlisttest.list[code].position.x = rotaposx; - for (let tl=0; tl<6; tl++) { - trainlisttest.list[code].children[tl].position.z = rotaposz; - } - - trainlisttest.list[code].progress = (rotaposx-rails.linkrail[data.body[i].linkCode].lp.x)/rails.linkrail[data.body[i].linkCode].lengthfact; - trainlisttest.list[code].status = '02'; - trainlisttest.list[code].curve = rails.linkrail[data.body[i].linkCode].lineleft; - trainlisttest.list[code].nextcurve = null; - } - trainlisttest.list[code].len = rails.linkrail[data.body[i].linkCode].lengthfact; - - } else if (data.body[i].directionType == '03') { // 向左 - - if (trainlisttest.list[code].status != data.body[i].directionType) { - trainlisttest.list[code].progress = 0; - const rotaposx = trainlisttest.list[code].children[5].matrixWorld.elements[12]; - const rotaposz = Math.abs(trainlisttest.list[code].children[0].matrixWorld.elements[14]); - trainlisttest.list[code].rotation.y = Math.PI; - trainlisttest.list[code].position.x = rotaposx; - for (let tl=0; tl<6; tl++) { - trainlisttest.list[code].children[tl].position.z = -rotaposz; - } - trainlisttest.list[code].progress = 1-(rotaposx-rails.linkrail[data.body[i].linkCode].lp.x)/rails.linkrail[data.body[i].linkCode].lengthfact; - trainlisttest.list[code].status = '03'; - trainlisttest.list[code].curve = rails.linkrail[data.body[i].linkCode].lineright; - trainlisttest.list[code].nextcurve = null; + if (trainlisttest.list[code].status != data.body[i].directionType) { + trainlisttest.list[code].progress = 0; + const rotaposx = trainlisttest.list[code].children[5].matrixWorld.elements[12]; + const rotaposz = trainlisttest.list[code].children[0].matrixWorld.elements[14]; + trainlisttest.list[code].rotation.y = 0; + trainlisttest.list[code].position.x = rotaposx; + for (let tl=0; tl<6; tl++) { + trainlisttest.list[code].children[tl].position.z = rotaposz; } - trainlisttest.list[code].len = rails.linkrail[data.body[i].linkCode].lengthfact; - + trainlisttest.list[code].progress = (rotaposx-rails.linkrail[data.body[i].linkCode].lp.x)/rails.linkrail[data.body[i].linkCode].lengthfact; + trainlisttest.list[code].status = '02'; + trainlisttest.list[code].curve = rails.linkrail[data.body[i].linkCode].lineleft; + trainlisttest.list[code].nextcurve = null; } + trainlisttest.list[code].len = rails.linkrail[data.body[i].linkCode].lengthfact; + + } else if (data.body[i].directionType == '03') { // 向左 + + if (trainlisttest.list[code].status != data.body[i].directionType) { + trainlisttest.list[code].progress = 0; + const rotaposx = trainlisttest.list[code].children[5].matrixWorld.elements[12]; + const rotaposz = Math.abs(trainlisttest.list[code].children[0].matrixWorld.elements[14]); + trainlisttest.list[code].rotation.y = Math.PI; + trainlisttest.list[code].position.x = rotaposx; + for (let tl=0; tl<6; tl++) { + trainlisttest.list[code].children[tl].position.z = -rotaposz; + } + trainlisttest.list[code].progress = 1-(rotaposx-rails.linkrail[data.body[i].linkCode].lp.x)/rails.linkrail[data.body[i].linkCode].lengthfact; + trainlisttest.list[code].status = '03'; + trainlisttest.list[code].curve = rails.linkrail[data.body[i].linkCode].lineright; + trainlisttest.list[code].nextcurve = null; + } + + trainlisttest.list[code].len = rails.linkrail[data.body[i].linkCode].lengthfact; + + } // console.log(data.body[i].directionType); @@ -468,9 +468,9 @@ export function Jl3dDriving(updatemmi,sound) { // console.log(rails.linkrail[nextcode].lineleft.points); // console.log("***********************"); // console.log(rails.linkrail[nextcode].lineleft.points); - + let nextcode; if(code == drivingcode){ - let nextcode; + if(data.body[i].directionType == '02'){ trainlisttest.list[code].status = '02'; @@ -501,19 +501,29 @@ export function Jl3dDriving(updatemmi,sound) { let nextcode; if(data.body[i].directionType == '02'){ if(rails.linkrail[data.body[i].linkCode].lineleft){ + nextcode = rails.linkrail[data.body[i].linkCode].rconnect; trainlisttest.list[code].status = '02'; + if(nextcode){ + trainlisttest.list[code].nextcurve = rails.linkrail[nextcode].lineleft; + trainlisttest.list[code].nextlen = rails.linkrail[nextcode].lengthfact; + } trainlisttest.list[code].curve = rails.linkrail[data.body[i].linkCode].lineleft; trainlisttest.list[code].len = rails.linkrail[data.body[i].linkCode].lengthfact; trainlisttest.list[code].progress = data.body[i].linkOffsetPercent; - trainlisttest.list[code].speeds = parseFloat(trainlisttest.list[code].speed*10/36/23/trainlisttest.list[code].len); + trainlisttest.list[code].speeds = parseFloat(trainlisttest.list[code].speed*10/36/24/trainlisttest.list[code].len); } }else if(data.body[i].directionType == '03'){ if(rails.linkrail[data.body[i].linkCode].lineright){ + nextcode = rails.linkrail[data.body[i].linkCode].lconnect; trainlisttest.list[code].status = '03'; + if(nextcode){ + trainlisttest.list[code].nextcurve = rails.linkrail[nextcode].lineright; + trainlisttest.list[code].nextlen = rails.linkrail[nextcode].lengthfact; + } trainlisttest.list[code].curve = rails.linkrail[data.body[i].linkCode].lineright; trainlisttest.list[code].len = rails.linkrail[data.body[i].linkCode].lengthfact; trainlisttest.list[code].progress = 1-data.body[i].linkOffsetPercent; - trainlisttest.list[code].speeds = parseFloat(trainlisttest.list[code].speed*10/36/23/trainlisttest.list[code].len); + trainlisttest.list[code].speeds = parseFloat(trainlisttest.list[code].speed*10/36/24/trainlisttest.list[code].len); } } trainlisttest.list[code].nextcode = nextcode; diff --git a/src/jlmap3d/jl3ddrive/moveupdate/UpdateTrain.js b/src/jlmap3d/jl3ddrive/moveupdate/UpdateTrain.js index d309ac76e..9fb15c145 100644 --- a/src/jlmap3d/jl3ddrive/moveupdate/UpdateTrain.js +++ b/src/jlmap3d/jl3ddrive/moveupdate/UpdateTrain.js @@ -146,7 +146,7 @@ export function UpdateTrain(camera,traindata,control){ trainmodel.progress = 0; trainmodel.len = trainmodel.nextlen; trainmodel.nowcode = trainmodel.nextcode; - trainmodel.speeds = parseFloat(trainmodel.speed*10/36/22/trainmodel.len); + trainmodel.speeds = parseFloat(trainmodel.speed*10/36/24/trainmodel.len); trainmodel.curve = trainmodel.nextcurve; trainmodel.nextcurve = null; @@ -296,7 +296,7 @@ export function UpdateTrain(camera,traindata,control){ // console.log(trainmodel.rotalist); } - console.log(trainmodel.nextcurve); + // console.log(trainmodel.nextcurve); if(trainmodel.progress > -(trainmodel.speeds)){ trainmodel.progress += trainmodel.speeds; } diff --git a/src/layout/components/Entry.vue b/src/layout/components/Entry.vue index af388eea5..6defc9701 100644 --- a/src/layout/components/Entry.vue +++ b/src/layout/components/Entry.vue @@ -1,5 +1,6 @@