From 7acf7ad6948e3e952173a2551ea4a92a8ff56c35 Mon Sep 17 00:00:00 2001 From: suerprisePlus <15810472099@163.com> Date: 星期四, 06 六月 2024 19:36:48 +0800 Subject: [PATCH] 1 --- public/CimSDK/Workers/path/Path.html | 107 ++++++++++++++++++++++++++++++++++------------------- 1 files changed, 69 insertions(+), 38 deletions(-) diff --git a/public/CimSDK/Workers/path/Path.html b/public/CimSDK/Workers/path/Path.html index 5ea4c0b..6c215f2 100644 --- a/public/CimSDK/Workers/path/Path.html +++ b/public/CimSDK/Workers/path/Path.html @@ -5,7 +5,7 @@ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"> - <title>SmartEarth-SDK绀轰緥</title> + <title>SmartEarth-SDK Demo</title> <link rel="stylesheet" href="../layui/css/layui.css"> <style> html, @@ -60,7 +60,7 @@ } .layui-form-label { - width: 96px !important; + width: 116px !important; } .layui-input-block { @@ -122,115 +122,115 @@ <body> <div class="layui-prop"> <div class="bnt-box"> - <button type="button" class="layui-btn layui-btn-normal" id="start">缁х画婕父</button> - <button type="button" class="layui-btn layui-btn-normal" id="stop" style="margin-left: 0;">鏆傚仠婕父</button> - <button type="button" class="layui-btn layui-btn-normal" id="exit">閫�鍑烘极娓�</button> + <button type="button" class="layui-btn layui-btn-normal" id="start"></button> + <button type="button" class="layui-btn layui-btn-normal" id="stop" style="margin-left: 0;"></button> + <button type="button" class="layui-btn layui-btn-normal" id="exit"></button> </div> <form class="layui-form" action=""> <div class="layui-form-item"> - <label class="layui-form-label">璺嚎鍚嶇О</label> + <label class="layui-form-label" id="routeName"></label> <div class="layui-input-block" id="roadName" style="line-height: 38px;"> </div> </div> <div class="layui-form-item"> - <label class="layui-form-label">瑙嗚妯″紡</label> + <label class="layui-form-label" id="viewMode"></label> <div class="layui-input-block"> <select id="sjms" name="sjms" lay-filter="sjms"> - <option value="0">璺熼殢妯″瀷</option> - <option value="1">绗竴浜虹О瑙嗚</option> - <option value="2">涓婂笣瑙嗚</option> + <option value="0"></option> + <option value="1"></option> + <option value="2"></option> </select> </div> </div> <div class="layui-form-item norline fly"> - <label class="layui-form-label">椋炶楂樺害</label> + <label class="layui-form-label" id="flyHeight"></label> <div class="layui-input-block"> <input id="cameraHeight" type="text" value="0" name="cameraHeight" lay-filter="cameraHeight" class="layui-input" onkeyup="value=value.replace(/[^\d\.\-]/g,'')"> </div> </div> <div class="layui-form-item norline fly notGod"> - <label class="layui-form-label">椋炶璺濈</label> + <label class="layui-form-label" id="flyDistance"></label> <div class="layui-input-block"> <input id="cameraDistance" type="text" value="0" name="cameraDistance" lay-filter="cameraDistance" class="layui-input" onkeyup="value=value.replace(/[^\d\.\-]/g,'')"> </div> </div> <div class="layui-form-item norline fly notGod"> - <label class="layui-form-label">淇话瑙�</label> + <label class="layui-form-label" id="labelPitch"></label> <div class="layui-input-block"> <input id="pitch" type="text" value="0" name="pitch" lay-filter="pitch" class="layui-input" onkeyup="value=value.replace(/[^\d\.\-]/g,'')"> </div> </div> <div class="layui-form-item norline"> - <label class="layui-form-label">婕父閫熷害(m/s)</label> + <label class="layui-form-label" id="roamingSpeed"></label> <div class="layui-input-block"> <div id="flySpeed" class="flySpeed"></div> </div> </div> <div class="layui-form-item norline"> - <label class="layui-form-label">鎬婚暱搴�</label> + <label class="layui-form-label" id="totalLength"></label> <div class="layui-input-block" id="totalLen" style="line-height: 38px;"> </div> </div> <div class="layui-form-item norline"> - <label class="layui-form-label">宸叉极娓搁暱搴�</label> + <label class="layui-form-label" id="roamingLength"></label> <div class="layui-input-block" id="distanceTraveled" style="line-height: 38px;"> 0 </div> </div> <div class="layui-form-item norline"> - <label class="layui-form-label">鎬绘椂闀�</label> + <label class="layui-form-label" id="duration"></label> <div class="layui-input-block" id="totalTime" style="line-height: 38px;"> </div> </div> <div class="layui-form-item norline"> - <label class="layui-form-label">宸叉极娓告椂闂�</label> + <label class="layui-form-label" id="roamingTime"></label> <div class="layui-input-block" id="time" style="line-height: 38px;"> 0 </div> </div> <div class="layui-form-item norline"> - <label class="layui-form-label">鏄惁鏄剧ず妯″瀷</label> + <label class="layui-form-label" id="showModelLabel"></label> <div class="layui-input-block"> <input id="showModel" type="checkbox" lay-skin="switch" lay-filter="showModel" value="off" - lay-text="鏄瘄鍚�"> + lay-text=""> </div> </div> <div class="layui-form-item norline"> - <label class="layui-form-label">鏄惁鏄剧ず璺嚎</label> + <label class="layui-form-label" id="showRoute"></label> <div class="layui-input-block"> <input id="showLine" type="checkbox" lay-skin="switch" lay-filter="showLine" value="off" - lay-text="鏄瘄鍚�"> + lay-text=""> </div> </div> <div class="layui-form-item norline"> - <label class="layui-form-label">閫熷害</label> + <label class="layui-form-label" id="speed"></label> <div class="layui-input-block" id="sd" style="line-height: 38px;"> 50m/s </div> </div> <div class="layui-form-item norline"> - <label class="layui-form-label">缁忓害</label> + <label class="layui-form-label" id="lon"></label> <div class="layui-input-block" id="jd" style="line-height: 38px;"> </div> </div> <div class="layui-form-item norline"> - <label class="layui-form-label">绾害</label> + <label class="layui-form-label" id="lat"></label> <div class="layui-input-block" id="wd" style="line-height: 38px;"> </div> </div> <div class="layui-form-item norline"> - <label class="layui-form-label">婕父楂樼▼</label> + <label class="layui-form-label" id="roamingElevation"></label> <div class="layui-input-block" id="height" style="line-height: 38px;"> </div> </div> <div class="layui-form-item norline"> - <label class="layui-form-label">鍦伴潰楂樼▼</label> + <label class="layui-form-label" id="groundElevation"></label> <div class="layui-input-block" id="globeHeight" style="line-height: 38px;"> </div> </div> @@ -241,7 +241,7 @@ </div> </form> </div> - <script src="../jquery-2.0.3.js"></script> + <script src="../jquery-3.5.0.min.js"></script> <script src="../layui/layui.js"></script> <script> @@ -250,8 +250,36 @@ var sgworld = parent.earthCtrl; var routeData = parent.PathAnimationData.flyData; var url = parent.SmartEarthRootUrl + "Workers/Model/xiaoche.glb"; + const positionEndCallback = parent.PathAnimationData.positionEndCallback $('#start').hide(); $('#stop').show(); + document.getElementById("start").innerText = `${sgworld.language.SG_CONTINUE_ROAMING}` + document.getElementById("stop").innerText = `${sgworld.language.SG_STOP_ROAMING}` + document.getElementById("exit").innerText = `${sgworld.language.SG_QUIT_ROAMING}` + document.getElementById("routeName").innerText = `${sgworld.language.SG_ROUTE_NAME}` + document.getElementById("viewMode").innerText = `${sgworld.language.SG_VIEW_MODE}` + var select = document.getElementById("sjms"); + select.options[0].innerText = `${sgworld.language.SG_FOLLOW_MODEL}` + select.options[1].innerText = `${sgworld.language.SG_FIRST_PERSON}` + select.options[2].innerText = `${sgworld.language.SG_GOD_PERSPECTIVE}` + + document.getElementById("flyHeight").innerText = `${sgworld.language.SG_FLYING_HEIGHT}` + document.getElementById("flyDistance").innerText = `${sgworld.language.SG_FLYING_DISTANCE}` + document.getElementById("labelPitch").innerText = `${sgworld.language.CREATOR_PITCH}` + document.getElementById("roamingSpeed").innerText = `${sgworld.language.SG_ROAMING_SPEED}` + document.getElementById("totalLength").innerText = `${sgworld.language.SG_TOTAL_LENGTH}` + document.getElementById("roamingLength").innerText = `${sgworld.language.SG_ROAMING_LENGTH}` + document.getElementById("duration").innerText = `${sgworld.language.SG_DURATION}` + document.getElementById("showModel").setAttribute("lay-text", `${sgworld.language.SG_YES_OR_NO}`) + document.getElementById("showLine").setAttribute("lay-text", `${sgworld.language.SG_YES_OR_NO}`) + document.getElementById("roamingTime").innerText = `${sgworld.language.SG_ROAMING_TIME}` + document.getElementById("showModelLabel").innerText = `${sgworld.language.SG_SHOW_MODEL}` + document.getElementById("showRoute").innerText = `${sgworld.language.SG_SHOW_ROUTE}` + document.getElementById("speed").innerText = `${sgworld.language.SG_SPEED}` + document.getElementById("lon").innerText = `${sgworld.language.EARTH_CTRL_POSITION_LON}` + document.getElementById("lat").innerText = `${sgworld.language.EARTH_CTRL_POSITION_LAT}` + document.getElementById("roamingElevation").innerText = `${sgworld.language.SG_ROAMING_ELEVATION}` + document.getElementById("groundElevation").innerText = `${sgworld.language.SG_GROUND_ELEVATION}` var form, element, slider; var ratio = 0; layui.use(['form', 'element', 'slider'], function () { @@ -330,11 +358,11 @@ }); $('#cameraHeight').on('input propertychange', function (event) { const inputHeight = $(this).val(); - const height = inputHeight.replace(/[^\d\.\-]/g, ''); + const height = inputHeight.replace(/[^\d\.\-]/g, ''); if(height && height !== '-') { fly && fly.setFlyHeight(parseFloat(height)); - routeData && (routeData.height = parseFloat(height)); - } + routeData && (routeData.height = parseFloat(height)); + } }); $('#pitch').on('input propertychange', function (event) { var pitch = $(this).val().replace(/[^\d\.\-]/g, ''); @@ -382,7 +410,7 @@ } }); - function shuj(data) { + function shuj(data,endss) { if (data.distanceTraveled) { //宸叉极娓搁暱搴� document.getElementById("distanceTraveled").innerText = getDistance(data.distanceTraveled); @@ -414,6 +442,9 @@ if (data.ratio) { ratio = parseInt(data.ratio * 100); } + if (endss && positionEndCallback != null && typeof positionEndCallback === 'function') { + positionEndCallback(data, endss); + } } //鑷姩鐐瑰嚮鍏抽棴绐楀彛鐐瑰叧闂簨浠� @@ -421,7 +452,7 @@ var $title = $(window.parent.document).find('.layui-layer-title'); if ($title.length > 0) { $title.each(function (i, item) { - if (item.innerHTML === "婕父璺嚎") { + if (item.innerHTML === `${sgworld.language.SG_ROAMING_ROUTE}`) { var closeButton = $(item).parent().find('.layui-layer-close'); var event = document.createEvent('MouseEvents'); event.initEvent("click", false, true); @@ -434,15 +465,15 @@ function getTime(data) { var time; if (data < 60) { - time = data + "绉�"; + time = data + `${sgworld.language.SG_SECOND}`; } else if (data >= 60 && data < 3600) { - time = Math.floor(data / 60) + '鍒�' + data % 60 + '绉�'; + time = Math.floor(data / 60) + `${sgworld.language.SG_MINUTE}` + data % 60 + `${sgworld.language.SG_SECOND}`; } else { var h = Math.floor(data / 3600); data -= h * 3600; var m = Math.floor(data / 60); data -= m * 60; - time = h + '灏忔椂' + m + '鍒�' + data + '绉�'; + time = h + `${sgworld.language.SG_HOUR}`+ m + `${sgworld.language.SG_MINUTE}` + data + `${sgworld.language.SG_SECOND}`; } return time; } @@ -452,9 +483,9 @@ data = parseFloat(data).toFixed(2); data = parseFloat(data); if (data >= 1000) { - dis = (data / 1000).toFixed(3) + "鍗冪背"; + dis = (data / 1000).toFixed(3) + `${sgworld.language.UNIT_KILOMETER}`; } else { - dis = data + "绫�"; + dis = data + `${sgworld.language.UNIT_METER}`; } return dis; } -- Gitblit v1.9.3