Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
dream
Commits
6c8fdf8e
Commit
6c8fdf8e
authored
Sep 08, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ManPyObject to create id and name if not given
parent
0bbc3b3d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
12 deletions
+14
-12
dream/simulation/CoreObject.py
dream/simulation/CoreObject.py
+1
-1
dream/simulation/ManPyObject.py
dream/simulation/ManPyObject.py
+13
-4
dream/simulation/MouldAssembly.py
dream/simulation/MouldAssembly.py
+0
-7
No files found.
dream/simulation/CoreObject.py
View file @
6c8fdf8e
...
@@ -35,7 +35,7 @@ from ManPyObject import ManPyObject
...
@@ -35,7 +35,7 @@ from ManPyObject import ManPyObject
class
CoreObject
(
ManPyObject
):
class
CoreObject
(
ManPyObject
):
class_name
=
'Dream.CoreObject'
class_name
=
'Dream.CoreObject'
def
__init__
(
self
,
id
,
name
,
inputsDict
=
{},
**
kw
):
def
__init__
(
self
,
id
,
name
,
**
kw
):
ManPyObject
.
__init__
(
self
,
id
,
name
)
ManPyObject
.
__init__
(
self
,
id
,
name
)
self
.
objName
=
name
self
.
objName
=
name
# lists that hold the previous and next objects in the flow
# lists that hold the previous and next objects in the flow
...
...
dream/simulation/ManPyObject.py
View file @
6c8fdf8e
...
@@ -33,10 +33,19 @@ Also only abstract ManPy classes inherit directly (CoreObject, Entity, ObjectRes
...
@@ -33,10 +33,19 @@ Also only abstract ManPy classes inherit directly (CoreObject, Entity, ObjectRes
class
ManPyObject
(
object
):
class
ManPyObject
(
object
):
def
__init__
(
self
,
id
,
name
,
**
kw
):
def
__init__
(
self
,
id
,
name
,
**
kw
):
self
.
id
=
id
if
id
:
self
.
name
=
name
self
.
id
=
id
# if no id was given create a random one
else
:
self
.
id
=
str
(
self
.
__class__
.
__name__
)
import
random
self
.
id
=
self
.
id
+
str
(
random
.
randint
(
1
,
1000000
))
if
name
:
self
.
name
=
name
# if no name was given give id as name
else
:
self
.
name
=
self
.
id
#===========================================================================
#===========================================================================
# method used to request allocation from the Router
# method used to request allocation from the Router
#===========================================================================
#===========================================================================
...
...
dream/simulation/MouldAssembly.py
View file @
6c8fdf8e
...
@@ -77,13 +77,6 @@ class AssembleMouldError(Exception):
...
@@ -77,13 +77,6 @@ class AssembleMouldError(Exception):
# the MachineManagedJob object
# the MachineManagedJob object
# ===========================================================================
# ===========================================================================
class
MouldAssembly
(
MachineManagedJob
):
class
MouldAssembly
(
MachineManagedJob
):
# =======================================================================
# parses inputs if they are given in a dictionary
# =======================================================================
def
parseInputs
(
self
,
**
kw
):
from
Globals
import
G
G
.
MouldAssemblyList
.
append
(
self
)
# =======================================================================
# =======================================================================
# the initialize method
# the initialize method
...
...
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