This commit is contained in:
joylink_cuiweidong 2021-07-29 11:09:01 +08:00
commit 62977147c5
15 changed files with 10336 additions and 60314 deletions

View File

@ -7,6 +7,12 @@ export default {
surveillanceDisplay: 'In-vehicle surveillance - display',
trainInstrumentationDisplay: 'Train instrumentation - display',
trainInstrumentationHidden: 'Train instrumentation - hidden',
trainInstrumentationMmiDisplay: 'Train instrumentation mmi - display',
trainInstrumentationMmiHidden: 'Train instrumentation mmi - hidden',
trainInstrumentationTmsDisplay: 'Train instrumentation tms - display',
trainInstrumentationTmsHidden: 'Train instrumentation tms - hidden',
terminal: 'terminal:',
nextStation: 'Next station:',
confirmSignalOpen: 'Please confirm that the signal ahead is open',

View File

@ -5,8 +5,12 @@ export default {
stopTime:'停站时间:',
surveillanceHidden: '车内监控——隐藏',
surveillanceDisplay: '车内监控——显示',
trainInstrumentationDisplay: '列车仪表——显示',
trainInstrumentationHidden: '列车仪表——隐藏',
trainInstrumentationDisplay: '列车mmi仪表——显示',
trainInstrumentationHidden: '列车mmi仪表——隐藏',
trainInstrumentationMmiDisplay: '列车mmi仪表——显示',
trainInstrumentationMmiHidden: '列车mmi仪表——隐藏',
trainInstrumentationTmsDisplay: '列车tms仪表——显示',
trainInstrumentationTmsHidden: '列车tms仪表——隐藏',
terminal: '终点站:',
nextStation: '下一站:',
confirmSignalOpen: '请确认前方信号开放',

View File

@ -57,9 +57,11 @@ export function JLmapDriving(dom,data,mapId,storemod,translation,routegroup,proj
renderer.domElement.style.top = '0';
var renderercctv = new THREE.WebGLRenderer();
renderercctv.setSize(dom.offsetWidth*0.2, dom.offsetHeight*0.2);
// renderercctv.setSize(dom.offsetWidth*0.2, dom.offsetHeight*0.2);
renderercctv.setSize(500, 333);
renderercctv.domElement.style.position = 'absolute';
renderercctv.domElement.style.top = '0';
renderercctv.domElement.style.bottom = '0';
document.getElementById('jlsimulation').appendChild(renderer.domElement);
document.getElementById('jlcctv').appendChild(renderercctv.domElement);

View File

@ -956,6 +956,7 @@ export function jl3dFaultDeviceVr(dom,group,skinCode) {
}
function squeezeStart(){
console.log("squeeze");
scope.modelmanager.otherDevice.action.play();
if(positionStatus == "dm"){
if(vrPlaneStatus){

View File

@ -1,60 +1,24 @@
/**
* @author mrdoob / http://mrdoob.com
* @author Mugen87 / https://github.com/Mugen87
*/
class VRButton {
var VRButton = {
static createButton(originPos,vrPos, renderer, options ) {
createButton: function ( originPos,vrPos,renderer, options ) {
if ( options ) {
if ( options && options.referenceSpaceType ) {
renderer.vr.setReferenceSpaceType( options.referenceSpaceType );
console.error( 'THREE.VRButton: The "options" parameter has been removed. Please set the reference space type via renderer.xr.setReferenceSpaceType() instead.' );
}
function showEnterVR( device ) {
const button = document.createElement( 'button' );
button.style.display = '';
function showEnterVR( /*device*/ ) {
button.style.cursor = 'pointer';
button.style.left = 'calc(50% - 50px)';
button.style.width = '100px';
let currentSession = null;
button.textContent = 'ENTER_VR';
button.onmouseenter = function () {
button.style.opacity = '1.0';
};
button.onmouseleave = function () {
button.style.opacity = '0.5';
};
button.onclick = function () {
device.isPresenting ? device.exitPresent() : device.requestPresent( [ { source: renderer.domElement } ] );
originPos.position.set(vrPos.x,vrPos.y,vrPos.z);
};
renderer.vr.setDevice( device );
}
function showEnterXR( /*device*/ ) {
var currentSession = null;
function onSessionStarted( session ) {
async function onSessionStarted( session ) {
session.addEventListener( 'end', onSessionEnded );
renderer.vr.setSession( session );
await renderer.vr.setSession( session );
button.textContent = 'EXIT VR';
currentSession = session;
@ -65,7 +29,6 @@ var VRButton = {
currentSession.removeEventListener( 'end', onSessionEnded );
renderer.vr.setSession( null );
button.textContent = 'ENTER VR';
currentSession = null;
@ -105,9 +68,9 @@ var VRButton = {
// ('local' is always available for immersive sessions and doesn't need to
// be requested separately.)
var sessionInit = { optionalFeatures: [ 'local-floor', 'bounded-floor' ] };
const sessionInit = { optionalFeatures: [ 'local-floor', 'bounded-floor', 'hand-tracking', 'layers' ] };
navigator.xr.requestSession( 'immersive-vr', sessionInit ).then( onSessionStarted );
originPos.position.set(vrPos.x,vrPos.y,vrPos.z);
} else {
currentSession.end();
@ -133,21 +96,11 @@ var VRButton = {
}
function showVRNotFound() {
function showWebXRNotFound() {
disableButton();
button.textContent = 'VR NOT FOUND';
renderer.vr.setDevice( null );
}
function showXRNotFound() {
disableButton();
button.textContent = 'VR NOT FOUND';
button.textContent = 'VR NOT SUPPORTED';
}
@ -169,82 +122,36 @@ var VRButton = {
}
if ( 'xr' in navigator ) {
console.log("xr");
var button = document.createElement( 'button' );
button.id = 'VRButton';
button.style.display = 'none';
stylizeElement( button );
navigator.xr.isSessionSupported( 'immersive-vr' ).then( function ( supported ) {
if ( supported ) {
showEnterXR();
} else {
showXRNotFound();
}
supported ? showEnterVR() : showWebXRNotFound();
} );
return button;
} else if ( 'getVRDisplays' in navigator ) {
console.log("vr");
var button = document.createElement( 'button' );
button.style.display = 'none';
} else {
stylizeElement( button );
const message = document.createElement( 'a' );
window.addEventListener( 'vrdisplayconnect', function ( event ) {
if ( window.isSecureContext === false ) {
showEnterVR( event.display );
}, false );
window.addEventListener( 'vrdisplaydisconnect', function ( /*event*/ ) {
showVRNotFound();
}, false );
window.addEventListener( 'vrdisplaypresentchange', function ( event ) {
button.textContent = event.display.isPresenting ? 'EXIT_VR' : 'ENTER_VR';
}, false );
window.addEventListener( 'vrdisplayactivate', function ( event ) {
event.display.requestPresent( [ { source: renderer.domElement } ] );
}, false );
navigator.getVRDisplays()
.then( function ( displays ) {
if ( displays.length > 0 ) {
showEnterVR( displays[ 0 ] );
message.href = document.location.href.replace( /^http:/, 'https:' );
message.innerHTML = 'WEBXR NEEDS HTTPS'; // TODO Improve message
} else {
showVRNotFound();
message.href = 'https://immersiveweb.dev/';
message.innerHTML = 'WEBXR NOT AVAILABLE';
}
} ).catch( showVRNotFound );
return button;
} else {
var message = document.createElement( 'a' );
message.href = 'https://immersive-web.github.io/webxr/';
message.innerHTML = 'WEBXR NOT SUPPORTED';
message.style.left = 'calc(50% - 90px)';
message.style.width = '180px';
message.style.textDecoration = 'none';
@ -257,6 +164,6 @@ var VRButton = {
}
};
}
export { VRButton };

View File

@ -54,6 +54,7 @@ export function Jl3dTrainRescueVr(dom,group,skinCode) {
// this.renderer.shadowMap.type = THREE.PCFSoftShadowMap;
this.renderer.gammaInput = true;
this.renderer.gammaOutput = true;
console.log( this.renderer);
this.renderer.vr.enabled = true;
this.dom.appendChild(this.renderer.domElement);
document.body.appendChild( VRButton.createButton( human,{x:25,y:1.3,z:1},this.renderer ) );
@ -208,6 +209,7 @@ export function Jl3dTrainRescueVr(dom,group,skinCode) {
function onSelectStart( event ) {
// console.log();
console.log("select");
var controller = event.target;
var intersections = getIntersections( controller );
@ -249,6 +251,7 @@ export function Jl3dTrainRescueVr(dom,group,skinCode) {
let controlMoveSwitch = false;
let nowControlModel = null;
function squeezeStart(){
console.log("squeezestart");
TrainRescueStatic.handR.action.reset();
TrainRescueStatic.handR.action.time = TrainRescueStatic.handR.action._clip.duration;
TrainRescueStatic.handR.action.timeScale = 1;
@ -271,6 +274,7 @@ export function Jl3dTrainRescueVr(dom,group,skinCode) {
}
function squeezeEnd(){
console.log("squeezeend");
TrainRescueStatic.handR.action.reset();
TrainRescueStatic.handR.action.time = 0;
TrainRescueStatic.handR.action.timeScale = -1;

View File

@ -382,7 +382,7 @@ import axios from 'axios';
.drivepane{
width:500px;
height:333px;
right:500px;
right:0;
bottom:0;
position: absolute;
background-size: 100% 100%;

View File

@ -11,7 +11,8 @@
<!-- <el-button type="primary" @click="raystand">站台选择</el-button> -->
<el-button type="primary" @click="cctvplane">{{ cctvbuttonmsg }}</el-button>
<el-button type="primary" @click="showplane">{{ showbuttonmsg }}</el-button>
<el-button type="primary" @click="showmmiplane">{{ showbuttonmmimsg }}</el-button>
<el-button type="primary" @click="showtmsplane">{{ showbuttontmsmsg }}</el-button>
<el-button type="primary" @click="back">{{backmsg}}</el-button>
</el-button-group>
</div>
@ -32,7 +33,7 @@
</div>
<Drive-Mmi v-if="mmishow" ref="mmiui" />
<Drive-Tms v-if="mmishow" />
<Drive-Tms v-if="tmsshow" />
<Drive-Control v-if="dcontrolshow" ref="dcontrol" @warningmsg="warningmsg" @warningmsgoff="warningmsgoff" />
</div>
@ -85,7 +86,9 @@ export default {
cctvshow:true,
cctvbuttonmsg: this.$t('jlmap3d.surveillanceHidden'),
mmishow: false,
showbuttonmsg: this.$t('jlmap3d.trainInstrumentationDisplay'),
tmsshow: false,
showbuttonmmimsg: this.$t('jlmap3d.trainInstrumentationMmiDisplay'),
showbuttontmsmsg: this.$t('jlmap3d.trainInstrumentationTmsDisplay'),
backmsg:this.$t('global.back'),
// trainnum: '',
// stoptimes: '',
@ -176,6 +179,7 @@ export default {
},
mounted() {
this.mmishow = true;
this.tmsshow = true;
// window.datanew = this.datanew;
window.updatestatus = this.updatestatus;
@ -289,16 +293,26 @@ export default {
},
showplane() {
showmmiplane() {
if (this.mmishow == true) {
this.showbuttonmsg = this.$t('jlmap3d.trainInstrumentationHidden');
this.showbuttonmmimsg = this.$t('jlmap3d.trainInstrumentationMmiHidden');
this.mmishow = false;
} else {
this.showbuttonmsg = this.$t('jlmap3d.trainInstrumentationDisplay');
this.showbuttonmmimsg = this.$t('jlmap3d.trainInstrumentationMmiDisplay');
this.mmishow = true;
}
},
showtmsplane() {
if (this.tmsshow == true) {
this.showbuttontmsmsg = this.$t('jlmap3d.trainInstrumentationTmsHidden');
this.tmsshow = false;
} else {
this.showbuttontmsmsg = this.$t('jlmap3d.trainInstrumentationTmsDisplay');
this.tmsshow = true;
}
},
datanew(){
this.dcontrolshow = true;
},
@ -424,10 +438,10 @@ export default {
.jlmap3cctv{
float: left;
left: 0;
top:0;
bottom:333px;
//left:20%;
width: 20%;
height: 20%;
width:500px;
height:333px;
position:absolute;
z-index: -1;
}

View File

@ -529,7 +529,8 @@ export default {
height:333px;
background: black;
position:absolute;
bottom:0;
bottom:333px;
right:0;
// border: 0.1px solid #ffffff;
}
.meter{

View File

@ -51,7 +51,7 @@ export default {
background-size:100% 100%;
position:absolute;
bottom:0;
right:0;
left:0;
// border: 0.1px solid #ffffff;
}

View File

@ -4,13 +4,13 @@
<div class="jl3dmap3dMaintainerSelect" :style="{'background-image': 'url('+localStatic+'/background/other.jpg)'}">
<div class="maintainerSelectButton selectButtonImg1"
:style="{'background-image': 'url('+localStatic+'/vrtest/maintainer.png)'}"
style="left:40%" @mouseenter="onMouseOverNormal"></div>
style="left:10%" @mouseenter="onMouseOverNormal"></div>
<div class="maintainerSelectButton selectButtonImg2"
:style="{'background-image': 'url('+localStatic+'/vrtest/zc.png)'}"
style="left:40%;" v-show="normalShow"@mouseleave="onMouseOutNormal" @click="initNormal"></div>
style="left:10%;" v-show="normalShow"@mouseleave="onMouseOutNormal" @click="initNormal"></div>
<!-- <div class="maintainerSelectButton selectButtonImg3"
<div class="maintainerSelectButton selectButtonImg3"
:style="{'background-image': 'url('+localStatic+'/vrtest/maintainervr.png)'}"
style="left:40%;" @mouseenter="onMouseOverVr"></div>
@ -24,7 +24,7 @@
<div class="maintainerSelectButton selectButtonImg6"
:style="{'background-image': 'url('+localStatic+'/vrtest/trvr.png)'}"
style="left:70%;" v-show="trainRescueShow" @mouseleave="onMouseOutRescue" @click="initTrainRescueVr"></div> -->
style="left:70%;" v-show="trainRescueShow" @mouseleave="onMouseOutRescue" @click="initTrainRescueVr"></div>
</div>

2
static/three.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long