Commit dfad86f3 authored by Michael Büsch's avatar Michael Büsch

cli: Add support for server forking in win-standalone

Signed-off-by: Michael Büsch's avatarMichael Buesch <m@bues.ch>
parent 389412a6
......@@ -58,7 +58,8 @@ def usage():
printInfo("Server backend related options:")
printInfo(" -c|--connect IP:PORT Connect to server backend")
printInfo(" -b|--spawn-backend Spawn a new backend server and connect to it")
printInfo(" -i|--interpreter EXE Set the backend interpreter executable")
if not isWinStandalone:
printInfo(" -i|--interpreter EXE Set the backend interpreter executable")
printInfo("")
printInfo("Loading hardware modules:")
printInfo(" -H|--hardware NAME:PARAM=VAL:PARAM=VAL...")
......@@ -260,9 +261,14 @@ def runWithServerBackend(inputFile):
host, port = AwlSimServer.DEFAULT_HOST, AwlSimServer.DEFAULT_PORT
if opt_connect:
host, port = opt_connect
client.spawnServer(interpreter = opt_interpreter,
listenHost = host,
listenPort = port)
if isWinStandalone:
client.spawnServer(serverExecutable = "awlsim-server-module.exe",
listenHost = host,
listenPort = port)
else:
client.spawnServer(interpreter = opt_interpreter,
listenHost = host,
listenPort = port)
writeStdout("Connecting to core server...\n")
if opt_connect:
client.connectToServer(host = opt_connect[0],
......@@ -463,6 +469,9 @@ def main():
if o in ("-b", "--spawn-backend"):
opt_spawnBackend = True
if o in ("-i", "--interpreter"):
if isWinStandalone:
printError("-i|--interpreter not supported on win-standalone")
sys.exit(1)
opt_interpreter = v
if o in ("--list-sfc", "--list-sfc-verbose"):
printInfo("The supported system functions (SFCs) are:")
......
......@@ -195,7 +195,7 @@ class CpuWidget(QWidget):
# before our server is able to allocate it.
if isWinStandalone:
# Run the py2exe standalone server process
client.spawnServer(serverExecutable = "awlsim-gui-backend-server.exe",
client.spawnServer(serverExecutable = "awlsim-server-module.exe",
listenHost = host,
listenPort = port)
else:
......
......@@ -38,7 +38,7 @@ copy COMPATIBILITY.txt %distdir%\
copy TODO.txt %distdir%\
xcopy doc\foreign-licenses %distdir%\licenses\ /E
copy COPYING.txt %distdir%\licenses\AWLSIM-LICENSE.txt
move %bindir%\server.exe %bindir%\awlsim-gui-backend-server.exe
move %bindir%\server.exe %bindir%\awlsim-server-module.exe
rem ---
rem Make startup wrapper
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment