Skip to content
Snippets Groups Projects
Commit 15e86942 authored by Michael Reuscher's avatar Michael Reuscher
Browse files

Simrunner 1.0 und README Controller

parent 0af92db6
Branches
Tags
2 merge requests!4Python driver and data analysis part,!2Threading fix
Install the controller and its dependencies
by following these instructions:
Please make sure that you are using Python 3.9 or higher.
Please make sure that you have installed setuptools for python3
if not:
sudo apt install python3-setuptools
or
pip install setuptools
1. Navigate to /detectorwritesim/controller
2. Create a new Python3.9 or higher virtual environment:
python3 -m venv cenv
3. Activate the environment:
source cenv/bin/activate
4. Build the controller:
python3 setup.py install
Now you have completed the setup process,
you can start the controller by entering the following command:
controller_run
\ No newline at end of file
......@@ -15,7 +15,7 @@ setup(
],
entry_points={
'console_scripts': [
'mein_programm=controller.main:main'
'controller_run=controller.main:main'
]
}
)
......
import os
import subprocess
def start_cpp_program(program_path, arguments):
command = [program_path] + arguments
process = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
return process
def send_input(program_path, arguments):
command = [program_path] + arguments
process = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
output = process.stdout.readline().decode()
return output
# Beispielverwendung
cpp_program_path = os.path.join(os.path.dirname(__file__), "../build/src/detsim")
arguments = ["-o", "output", "--posixDataDir", "protokoll", "-n", "100", "-s", "2M", "-i", "0.1s", "-N", "4"]
send_input(cpp_program_path, arguments)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment