Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Docker-in-Docker (DinD) capabilities of public runners deactivated.
More info
Open sidebar
TOUZE Francois
PSPA
Commits
d3302565
Commit
d3302565
authored
Dec 17, 2019
by
TOUZE Francois
Browse files
docker container creation: step 3
parent
53db3b12
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
48 additions
and
18 deletions
+48
-18
backend/pspa/v0/src/Core/dataManager.cpp
backend/pspa/v0/src/Core/dataManager.cpp
+2
-2
backend/pspa/v0/src/Core/mixedTools.h
backend/pspa/v0/src/Core/mixedTools.h
+6
-6
controller/cython-cpp/README
controller/cython-cpp/README
+1
-0
controller/cython-cpp/pspaplot.py
controller/cython-cpp/pspaplot.py
+0
-6
controller/cython-cpp/pspaplots.cpp
controller/cython-cpp/pspaplots.cpp
+3
-2
controller/cython-cpp/pspaplots.h
controller/cython-cpp/pspaplots.h
+0
-0
controller/cython-cpp/pspaplots.pxd
controller/cython-cpp/pspaplots.pxd
+2
-2
controller/cython-cpp/pspaplots.py
controller/cython-cpp/pspaplots.py
+14
-0
controller/cython-cpp/pypspaplots.pyx
controller/cython-cpp/pypspaplots.pyx
+20
-0
No files found.
backend/pspa/v0/src/Core/dataManager.cpp
View file @
d3302565
...
...
@@ -86,7 +86,7 @@ bool dataManager::executeAll()
particleBeam
*
computedBeam
=
NULL
;
for
(
unsigned
int
k
=
0
;
k
<
blks
.
size
();
++
k
)
{
computingBlock
*
ptr
=
blks
.
at
(
k
);
//
computingBlock *ptr= blks.at(k);
abstractSoftware
*
softw
=
blks
.
at
(
k
)
->
getSoftware
();
if
(
softw
==
NULL
)
{
success
=
false
;
...
...
@@ -607,7 +607,7 @@ bool dataManager::parseJSONFile( string fileName )
cout
<<
"1- ############ Liste du/des secteur(s): ############
\n
"
;
sectors_
.
clear
();
for
(
int
i
=
0
;
i
<
cmap
.
size
();
++
i
)
for
(
unsigned
i
=
0
;
i
<
cmap
.
size
();
++
i
)
{
string
key
=
"KEY"
+
mixedTools
::
intToString
(
i
);
map
<
string
,
vector
<
json
>
>::
iterator
it
=
cmap
.
find
(
key
);
...
...
backend/pspa/v0/src/Core/mixedTools.h
View file @
d3302565
...
...
@@ -110,13 +110,13 @@ class mixedTools
static
void
print
(
const
std
::
vector
<
smap
>&
v
)
{
for
(
int
i
=
0
;
i
<
v
.
size
();
i
++
)
{
for
(
unsigned
i
=
0
;
i
<
v
.
size
();
i
++
)
{
std
::
cout
<<
"v["
<<
i
<<
"].size() is "
<<
v
[
i
].
size
()
<<
'\n'
;
smap
::
const_iterator
it
;
for
(
it
=
v
[
i
].
begin
();
it
!=
v
[
i
].
end
();
++
it
)
{
std
::
cout
<<
"*** m["
<<
it
->
first
<<
"] : "
;
int
nsz
=
it
->
second
.
size
();
for
(
int
k
=
0
;
k
<
nsz
;
k
++
)
{
unsigned
nsz
=
it
->
second
.
size
();
for
(
unsigned
k
=
0
;
k
<
nsz
;
k
++
)
{
if
(
k
<
nsz
-
1
)
std
::
cout
<<
it
->
second
.
at
(
k
)
<<
", "
;
else
std
::
cout
<<
it
->
second
.
at
(
k
)
<<
";"
;
}
...
...
@@ -127,10 +127,10 @@ class mixedTools
static
void
print
(
const
std
::
vector
<
psvs
>&
v
)
{
for
(
int
i
=
0
;
i
<
v
.
size
();
i
++
)
{
for
(
unsigned
i
=
0
;
i
<
v
.
size
();
i
++
)
{
std
::
cout
<<
"v["
<<
v
.
at
(
i
).
first
<<
"] : "
;
int
nsz
=
v
.
at
(
i
).
second
.
size
();
for
(
int
k
=
0
;
k
<
nsz
;
k
++
)
{
unsigned
nsz
=
v
.
at
(
i
).
second
.
size
();
for
(
unsigned
k
=
0
;
k
<
nsz
;
k
++
)
{
std
::
cout
<<
v
.
at
(
i
).
second
.
at
(
k
)
<<
"; "
;
}
std
::
cout
<<
std
::
endl
;
...
...
controller/cython-cpp/README
View file @
d3302565
...
...
@@ -3,4 +3,5 @@ how to wrap C++ with Cython.
Assuming you have Python, Cython, Git and a C++ compiler installed
$ python pspaclass.py build_ext --inplace
$ python pspaplots.py build_ext --inplace
controller/cython-cpp/pspaplot.py
deleted
100644 → 0
View file @
53db3b12
from
distutils.core
import
setup
from
Cython.Build
import
cythonize
setup
(
ext_modules
=
cythonize
(
"pypspaplot.pyx"
)
)
controller/cython-cpp/pspaplot.cpp
→
controller/cython-cpp/pspaplot
s
.cpp
View file @
d3302565
#include <iostream>
#include <fstream>
#include <iomanip> // std::setw
#include "pspaplot.h"
#include "pspaplot
s
.h"
// Default constructor
pspaplot
::
pspaplot
()
{}
...
...
@@ -225,7 +226,7 @@ json pspaplot::plotSelection(json j)
if
(
ymap
.
empty
())
continue
;
for
(
auto
&
y
:
ymap
)
{
for
(
int
k
=
0
;
k
<
y
.
second
.
size
();
++
k
)
{
for
(
unsigned
k
=
0
;
k
<
y
.
second
.
size
();
++
k
)
{
Ymaps
[
y
.
first
].
push_back
(
y
.
second
.
at
(
k
)
);
}
}
...
...
controller/cython-cpp/pspaplot.h
→
controller/cython-cpp/pspaplot
s
.h
View file @
d3302565
File moved
controller/cython-cpp/pspaplot.pxd
→
controller/cython-cpp/pspaplot
s
.pxd
View file @
d3302565
from
libcpp.string
cimport
string
cdef
extern
from
"pspaplot.cpp"
:
cdef
extern
from
"pspaplot
s
.cpp"
:
pass
cdef
extern
from
"pspaplot.h"
:
cdef
extern
from
"pspaplot
s
.h"
:
cdef
cppclass
pspaplot
:
pspaplot
()
except
+
pspaplot
(
string
)
except
+
...
...
controller/cython-cpp/pspaplots.py
0 → 100644
View file @
d3302565
from
distutils.core
import
setup
from
distutils.extension
import
Extension
from
Cython.Build
import
cythonize
xtension
=
Extension
(
name
=
"pypspaplots"
,
sources
=
[
"pypspaplots.pyx"
],
include_dirs
=
[
"/usr/local/json/include"
]
)
setup
(
name
=
"pypspaplots"
,
ext_modules
=
cythonize
([
xtension
])
)
controller/cython-cpp/pypspaplots.pyx
0 → 100644
View file @
d3302565
# distutils: language = c++
from
pspaplots
cimport
pspaplot
from
libcpp.string
cimport
string
cdef
class
PyPspaPlot
:
cdef
pspaplot
*
ptr
def
__cinit__
(
self
):
self
.
ptr
=
new
pspaplot
()
def
__cinit__
(
self
,
string
s
):
self
.
ptr
=
new
pspaplot
(
s
)
def
__dealloc__
(
self
):
del
self
.
ptr
def
settings
(
self
,
string
s
):
return
self
.
ptr
.
settings
(
s
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment