Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DetectorWriteSim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EWMSCP
DetectorWriteSim
Commits
15e86942
Commit
15e86942
authored
1 year ago
by
Michael Reuscher
Browse files
Options
Downloads
Patches
Plain Diff
Simrunner 1.0 und README Controller
parent
0af92db6
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!4
Python driver and data analysis part
,
!2
Threading fix
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
controller/README.md
+23
-0
23 additions, 0 deletions
controller/README.md
controller/setup.py
+1
-1
1 addition, 1 deletion
controller/setup.py
simrunner/simrunner.py
+22
-0
22 additions, 0 deletions
simrunner/simrunner.py
with
46 additions
and
1 deletion
controller/README.md
0 → 100644
+
23
−
0
View file @
15e86942
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
This diff is collapsed.
Click to expand it.
controller/setup.py
+
1
−
1
View file @
15e86942
...
...
@@ -15,7 +15,7 @@ setup(
],
entry_points
=
{
'
console_scripts
'
:
[
'
mein_programm
=controller.main:main
'
'
controller_run
=controller.main:main
'
]
}
)
...
...
This diff is collapsed.
Click to expand it.
simrunner/simrunner.py
0 → 100644
+
22
−
0
View file @
15e86942
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
)
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