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
d14ea43f
Commit
d14ea43f
authored
2 years ago
by
Philipp Schäfer
Browse files
Options
Downloads
Patches
Plain Diff
VA launcher script: now allows sending a rendering file during connection process
parent
3458b199
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
LaunchScript/VirtualAcousticsStarterServer.py
+21
-11
21 additions, 11 deletions
LaunchScript/VirtualAcousticsStarterServer.py
with
21 additions
and
11 deletions
LaunchScript/VirtualAcousticsStarterServer.py
+
21
−
11
View file @
d14ea43f
...
...
@@ -32,9 +32,9 @@ class LauncherConfig:
sys
.
exit
(
ErrorCodes
.
ERROR_INCOMPLETE_CONFIG
)
class
VAComposedIniParser
:
def
__init__
(
self
,
lsReproductionModuleIDs
,
sRendererIniPath
=
None
):
def
__init__
(
self
,
lsReproductionModuleIDs
):
self
.
lsReproductionModuleIDs
=
lsReproductionModuleIDs
self
.
sRendererIniPath
=
sRendererIniPath
self
.
sRendererIniPath
=
None
self
.
sConfFolder
=
"
../conf/
"
def
_create_parser
(
self
):
...
...
@@ -163,6 +163,7 @@ class VirtualAcousticsLauncher:
self
.
oLauncherConnection
=
None
self
.
sVAServerDir
=
None
self
.
sVAServerID
=
None
self
.
vaIniParser
.
sRendererIniPath
=
None
def
_close_va_and_reset_connection
(
self
):
if
self
.
oVAProcess
:
...
...
@@ -175,9 +176,6 @@ class VirtualAcousticsLauncher:
def
main_loop
(
self
):
try
:
#TODO-PSC: Receive file and name from client
self
.
vaIniParser
.
sRendererIniPath
=
None
self
.
vaIniParser
.
prepare_inis
()
while
True
:
if
not
self
.
oLauncherConnection
:
self
.
wait_for_connection
()
...
...
@@ -217,15 +215,23 @@ class VirtualAcousticsLauncher:
self
.
oVAProcess
.
kill
()
self
.
oVAProcess
=
None
self
.
receive_va_server_id
()
self
.
receive_va_start_info
()
self
.
vaIniParser
.
prepare_inis
()
#Checks for a message containing the ID of the VAServer instance to be started and returns the respective VAServer directory
def
receive_va_s
erver_id
(
self
):
def
receive_va_s
tart_info
(
self
):
try
:
self
.
sVAServerID
=
self
.
oLauncherConnection
.
recv
(
512
)
if
type
(
self
.
sVAServerID
)
is
bytes
:
self
.
sVAServerID
=
self
.
sVAServerID
.
decode
(
'
utf-8
'
)
sMessage
=
self
.
oLauncherConnection
.
recv
(
512
)
if
type
(
sMessage
)
is
bytes
:
sMessage
=
sMessage
.
decode
(
'
utf-8
'
)
if
"
:
"
not
in
sMessage
:
#VAServer ID, should be received last
self
.
sVAServerID
=
sMessage
else
:
#VARenderer.ini file, optional
self
.
vaIniParser
.
sRendererIniPath
=
self
.
receive_file
(
sMessage
)
return
self
.
receive_va_start_info
()
print
(
"
Received launch request for variant:
"
+
self
.
sVAServerID
)
except
socket
.
error
:
print
(
"
Error while reading variant
"
)
...
...
@@ -305,7 +311,7 @@ class VirtualAcousticsLauncher:
if
sMessage
.
startswith
(
"
file
"
):
self
.
receive_file
(
sMessage
)
else
:
#NOT sMessage.startswith("file")
print
(
"
Received quit event:
"
+
sMessage
)
print
(
"
Received quit event:
"
+
sMessage
)
self
.
_close_va_and_reset_connection
()
break
...
...
@@ -319,6 +325,8 @@ class VirtualAcousticsLauncher:
raise
#re-raise for higher instance to catch
# Receives a file from a client, copies it to a tmp folder and returns the respective fullpath
# Input is a string message starting with "file:"
def
receive_file
(
self
,
sMessage
):
aMessageParts
=
sMessage
.
split
(
"
:
"
)
iBytesToReceive
=
int
(
aMessageParts
[
2
])
...
...
@@ -367,6 +375,8 @@ class VirtualAcousticsLauncher:
self
.
oLauncherConnection
.
send
(
b
'
fail
'
)
#send failure
print
(
"
File receive failed
"
)
return
Fullpath
+
Filename
#create an instance of the class
...
...
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