Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
VAServerLauncher
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LuFG VR VIS
VR-Group
VAServerLauncher
Commits
756874c8
Commit
756874c8
authored
2 years ago
by
Philipp Schäfer
Browse files
Options
Downloads
Patches
Plain Diff
VA Launcher: VA Versions now only have the directory as parameter
parent
1078643b
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
LaunchScript/VirtualAcousticStarterConfig.json
+5
-6
5 additions, 6 deletions
LaunchScript/VirtualAcousticStarterConfig.json
LaunchScript/VirtualAcousticsStarterServer.py
+26
-35
26 additions, 35 deletions
LaunchScript/VirtualAcousticsStarterServer.py
with
31 additions
and
41 deletions
LaunchScript/VirtualAcousticStarterConfig.json
+
5
−
6
View file @
756874c8
...
...
@@ -5,12 +5,11 @@
"nDefaultSleep"
:
3
,
"tReproductionModules"
:
[
"TalkthroughHP"
,
"CTC"
],
"tVirtualAcousticVersions"
:
{
"2018.a"
:
{
"file"
:
"bin/VAServer.exe"
,
"dir"
:
"../v2018.a"
,
"params"
:
"localhost:12340 conf/VACore.ini"
},
"2019.a"
:
{
"file"
:
"bin/VAServer.exe"
,
"dir"
:
"../v2019.a"
,
"params"
:
"localhost:12340 conf/VACore.ini"
},
"2020.a"
:
{
"file"
:
"bin/VAServer.exe"
,
"dir"
:
"../v2020.a"
,
"params"
:
"localhost:12340 conf/VACore.ini"
},
"2022.a"
:
{
"file"
:
"bin/VAServer.exe"
,
"dir"
:
"../v2022.a"
,
"params"
:
"localhost:12340 conf/VACore.ini"
},
"2020.a_AirTraffic"
:
{
"file"
:
"bin/VAServer.exe"
,
"dir"
:
"../v2020.a"
,
"params"
:
"localhost:12340 conf/VACore.ATNRenderer.ini"
}
"dVAServerDirectories"
:
{
"2018.a"
:
"../v2018.a"
,
"2019.a"
:
"../v2019.a"
,
"2020.a"
:
"../v2020.a"
,
"2022.a"
:
"../v2022.a"
}
}
...
...
This diff is collapsed.
Click to expand it.
LaunchScript/VirtualAcousticsStarterServer.py
+
26
−
35
View file @
756874c8
...
...
@@ -16,7 +16,7 @@ class LauncherConfig:
json_config
=
json
.
load
(
json_file
)
try
:
conf
.
dVirtualAcoustic
Version
s
=
json_config
[
"
tVirtualAcousticVersion
s
"
]
conf
.
dVirtualAcoustic
Directorie
s
=
json_config
[
"
dVAServerDirectorie
s
"
]
conf
.
sLocalIP
=
json_config
[
"
sLocalIP
"
]
conf
.
nLauncherPort
=
json_config
[
"
nLauncherPort
"
]
conf
.
nVAServerPort
=
json_config
[
"
nVAServerPort
"
]
...
...
@@ -107,11 +107,11 @@ class VirtualAcousticsLauncher:
self
.
oVAProcess
.
kill
()
self
.
oVAProcess
=
None
d
VAServer
ToStart
=
self
.
ReadVAServerIDToStart
()
if
not
d
VAServer
ToStart
:
s
VAServer
Dir
=
self
.
ReadVAServerIDToStart
()
if
not
s
VAServer
Dir
:
continue
self
.
StartRequestedVAServer
(
d
VAServer
ToStart
)
self
.
StartRequestedVAServer
(
s
VAServer
Dir
)
except
KeyboardInterrupt
:
print
(
"
Caught keyboard interrupt, quitting
"
)
...
...
@@ -131,64 +131,55 @@ class VirtualAcousticsLauncher:
return
None
else
:
try
:
d
VAServer
Instance
=
self
.
oConfig
.
dVirtualAcoustic
Version
s
[
self
.
sVAServerID
]
s
VAServer
Dir
=
self
.
oConfig
.
dVirtualAcoustic
Directorie
s
[
self
.
sVAServerID
]
except
KeyError
:
d
VAServer
Instance
=
None
s
VAServer
Dir
=
None
if
not
d
VAServer
Instance
:
if
not
s
VAServer
Dir
:
print
(
'
Requested VA Instance
"'
+
self
.
sVAServerID
+
'"
not available
'
)
self
.
oLauncherConnection
.
send
(
b
'
f
'
)
#answer 'requested version not available
self
.
oLauncherConnection
.
close
()
return
None
return
d
VAServer
Instance
return
s
VAServer
Dir
def
StartRequestedVAServer
(
self
,
tInstance
):
try
:
sWorkingDir
=
tInstance
[
"
dir
"
]
except
KeyError
:
sWorkingDir
=
None
def
StartRequestedVAServer
(
self
,
sVAServerDir
):
# Check for VAServer.exe
sVAExecutableFile
=
"
bin/VAServer.exe
"
try
:
self
.
sVAExecutableFile
=
tInstance
[
"
file
"
]
if
not
os
.
path
.
isfile
(
self
.
sVAExecutableFile
):
if
sWorkingDir
and
os
.
path
.
isfile
(
sWorkingDir
+
"
/
"
+
self
.
sVAExecutableFile
):
self
.
sVAExecutableFile
=
sWorkingDir
+
"
/
"
+
self
.
sVAExecutableFile
if
not
os
.
path
.
isfile
(
sVAExecutableFile
):
if
sVAServerDir
and
os
.
path
.
isfile
(
sVAServerDir
+
"
/
"
+
sVAExecutableFile
):
sVAExecutableFile
=
sVAServerDir
+
"
/
"
+
sVAExecutableFile
else
:
print
(
"
ERROR: Invalid config for
"
+
self
.
sVAServerID
+
"
-- file
"
+
self
.
sVAExecutableFile
+
"
does not exist
"
)
print
(
"
ERROR: Invalid config for
"
+
self
.
sVAServerID
+
"
-- file
"
+
sVAExecutableFile
+
"
does not exist
"
)
self
.
oLauncherConnection
.
send
(
b
'
n
'
)
#answer 'binary file cannot be found or invalid'
return
elif
s
Working
Dir
==
None
:
s
Working
Dir
=
os
.
path
.
dirname
(
self
.
sVAExecutableFile
)
elif
s
VAServer
Dir
==
None
:
s
VAServer
Dir
=
os
.
path
.
dirname
(
sVAExecutableFile
)
#TODO-PSC: VAServer should always be started from its main directory, not the "bin" folder
except
KeyError
:
self
.
sVAExecutableFile
=
None
sVAExecutableFile
=
None
print
(
"
ERROR: config for
"
+
self
.
sVAServerID
+
"
has no valid
\"
file
\"
entry
"
)
self
.
oLauncherConnection
.
send
(
b
'
i
'
)
#answer 'invalid file entry in the config'
self
.
oLauncherConnection
.
close
()
return
if
not
self
.
sVAExecutableFile
:
if
not
sVAExecutableFile
:
return
sCommand
=
self
.
sVAExecutableFile
try
:
sParams
=
tInstance
[
"
params
"
]
sCommand
=
sCommand
+
'
'
+
sParams
except
KeyError
:
sParams
=
None
try
:
nSleep
=
tInstance
[
"
sleep
"
]
except
KeyError
:
nSleep
=
self
.
oConfig
.
nDefaultSleep
# Create start command
sConnectionParam
=
self
.
oConfig
.
sLocalIP
+
"
:
"
+
str
(
self
.
oConfig
.
nVAServerPort
)
sVACoreIniParam
=
"
conf/VACore.ini
"
sParams
=
sConnectionParam
+
"
"
+
sVACoreIniParam
sCommand
=
sVAExecutableFile
+
"
"
+
sParams
# start instance
print
(
'
executing
"'
+
sCommand
+
'"'
)
self
.
oVAProcess
=
subprocess
.
Popen
(
sCommand
,
cwd
=
s
Working
Dir
,
creationflags
=
subprocess
.
CREATE_NEW_PROCESS_GROUP
)
self
.
oVAProcess
=
subprocess
.
Popen
(
sCommand
,
cwd
=
s
VAServer
Dir
,
creationflags
=
subprocess
.
CREATE_NEW_PROCESS_GROUP
)
# wait for requested duration before sending the go signal
time
.
sleep
(
n
Sleep
)
time
.
sleep
(
self
.
oConfig
.
nDefault
Sleep
)
if
self
.
oVAProcess
.
poll
()
!=
None
:
print
(
"
VA Process died - sending abort token
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment