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
318c47ac
Commit
318c47ac
authored
Feb 25, 2014
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make name and id of new elements configurable
parent
6b935735
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
5 deletions
+17
-5
dream/platform/static/src/dream.js
dream/platform/static/src/dream.js
+2
-2
dream/platform/static/src/jsonPlumb.js
dream/platform/static/src/jsonPlumb.js
+4
-3
dream/simulation/GUI/Batches.py
dream/simulation/GUI/Batches.py
+6
-0
dream/simulation/GUI/Default.py
dream/simulation/GUI/Default.py
+5
-0
No files found.
dream/platform/static/src/dream.js
View file @
318c47ac
...
@@ -133,7 +133,7 @@
...
@@ -133,7 +133,7 @@
autoOpen
:
false
,
autoOpen
:
false
,
width
:
350
,
width
:
350
,
modal
:
true
,
modal
:
true
,
title
:
title
||
""
,
title
:
node_dict
[
node_id
].
_class
+
"
"
+
title
||
""
,
buttons
:
{
buttons
:
{
Cancel
:
function
()
{
Cancel
:
function
()
{
$
(
this
).
dialog
(
"
close
"
);
$
(
this
).
dialog
(
"
close
"
);
...
@@ -196,7 +196,7 @@
...
@@ -196,7 +196,7 @@
var
element_type
=
element
.
_class
.
replace
(
'
.
'
,
'
-
'
);
var
element_type
=
element
.
_class
.
replace
(
'
.
'
,
'
-
'
);
element
.
element_id
=
that
.
generateElementId
();
element
.
element_id
=
that
.
generateElementId
();
if
(
!
element
.
id
)
{
if
(
!
element
.
id
)
{
element
.
id
=
that
.
generateNodeId
(
element_type
);
element
.
id
=
that
.
generateNodeId
(
element_type
,
configuration
[
element_type
]
);
}
}
priv
.
super_newElement
(
element
,
configuration
[
element_type
]);
priv
.
super_newElement
(
element
,
configuration
[
element_type
]);
$
(
"
#
"
+
element
.
element_id
).
on
(
'
click
'
,
function
()
{
$
(
"
#
"
+
element
.
element_id
).
on
(
'
click
'
,
function
()
{
...
...
dream/platform/static/src/jsonPlumb.js
View file @
318c47ac
...
@@ -37,12 +37,12 @@
...
@@ -37,12 +37,12 @@
return
priv
.
node_container
[
node_id
].
element_id
;
return
priv
.
node_container
[
node_id
].
element_id
;
};
};
that
.
generateNodeId
=
function
(
element_type
)
{
that
.
generateNodeId
=
function
(
element_type
,
option
)
{
var
n
=
1
;
var
n
=
1
;
while
((
element_type
+
'
_
'
+
n
)
in
priv
.
node_container
)
{
while
((
(
option
[
'
short_id
'
]
||
element_type
)
+
n
)
in
priv
.
node_container
)
{
n
+=
1
;
n
+=
1
;
}
}
return
element_type
+
'
_
'
+
n
;
return
(
option
[
'
short_id
'
]
||
element_type
)
+
n
;
};
};
that
.
generateElementId
=
function
()
{
that
.
generateElementId
=
function
()
{
...
@@ -427,6 +427,7 @@
...
@@ -427,6 +427,7 @@
};
};
that
.
newElement
=
function
(
element
,
option
)
{
that
.
newElement
=
function
(
element
,
option
)
{
element
.
name
=
element
.
name
||
option
.
name
;
priv
.
addElementToContainer
(
element
);
priv
.
addElementToContainer
(
element
);
var
render_element
,
style_string
=
""
,
var
render_element
,
style_string
=
""
,
coordinate
=
element
.
coordinate
,
coordinate
=
element
.
coordinate
,
...
...
dream/simulation/GUI/Batches.py
View file @
318c47ac
...
@@ -13,6 +13,7 @@ class Simulation(ShiftsSimulation):
...
@@ -13,6 +13,7 @@ class Simulation(ShiftsSimulation):
conf
[
'Dream-LineClearance'
]
=
{
conf
[
'Dream-LineClearance'
]
=
{
"_class"
:
"Dream.LineClearance"
,
"_class"
:
"Dream.LineClearance"
,
"name"
:
"Clearance"
,
"name"
:
"Clearance"
,
"short_id"
:
"C"
,
"property_list"
:
conf
[
'Dream-Queue'
][
'property_list'
]}
"property_list"
:
conf
[
'Dream-Queue'
][
'property_list'
]}
batch_source_entity
=
copy
(
schema
[
"entity"
])
batch_source_entity
=
copy
(
schema
[
"entity"
])
...
@@ -20,6 +21,7 @@ class Simulation(ShiftsSimulation):
...
@@ -20,6 +21,7 @@ class Simulation(ShiftsSimulation):
conf
[
'Dream-BatchSource'
]
=
{
conf
[
'Dream-BatchSource'
]
=
{
"_class"
:
"Dream.BatchSource"
,
"_class"
:
"Dream.BatchSource"
,
"name"
:
"Source"
,
"name"
:
"Source"
,
"short_id"
:
"S"
,
"property_list"
:
[
schema
[
'interarrivalTime'
],
"property_list"
:
[
schema
[
'interarrivalTime'
],
batch_source_entity
,
batch_source_entity
,
schema
[
'batchNumberOfUnits'
]]
schema
[
'batchNumberOfUnits'
]]
...
@@ -33,22 +35,26 @@ class Simulation(ShiftsSimulation):
...
@@ -33,22 +35,26 @@ class Simulation(ShiftsSimulation):
conf
[
'Dream-BatchDecompositionStartTime'
]
=
{
conf
[
'Dream-BatchDecompositionStartTime'
]
=
{
"_class"
:
"Dream.BatchDecompositionStartTime"
,
"_class"
:
"Dream.BatchDecompositionStartTime"
,
"name"
:
"Decomposition"
,
"name"
:
"Decomposition"
,
"short_id"
:
"D"
,
"property_list"
:
[
zeroProcessingTime
,
schema
[
'numberOfSubBatches'
]
]
"property_list"
:
[
zeroProcessingTime
,
schema
[
'numberOfSubBatches'
]
]
}
}
conf
[
'Dream-BatchReassembly'
]
=
{
conf
[
'Dream-BatchReassembly'
]
=
{
"_class"
:
"Dream.BatchReassembly"
,
"_class"
:
"Dream.BatchReassembly"
,
"name"
:
"Reassembly"
,
"name"
:
"Reassembly"
,
"short_id"
:
"R"
,
"property_list"
:
[
zeroProcessingTime
,
schema
[
'numberOfSubBatches'
]
]
"property_list"
:
[
zeroProcessingTime
,
schema
[
'numberOfSubBatches'
]
]
}
}
conf
[
'Dream-BatchScrapMachine'
]
=
{
conf
[
'Dream-BatchScrapMachine'
]
=
{
"_class"
:
"Dream.BatchScrapMachine"
,
"_class"
:
"Dream.BatchScrapMachine"
,
"name"
:
"Station"
,
"name"
:
"Station"
,
"short_id"
:
"St"
,
"property_list"
:
conf
[
'Dream-Machine'
][
'property_list'
]
"property_list"
:
conf
[
'Dream-Machine'
][
'property_list'
]
}
}
conf
[
'Dream-EventGenerator'
]
=
{
conf
[
'Dream-EventGenerator'
]
=
{
"_class"
:
"Dream.EventGenerator"
,
"_class"
:
"Dream.EventGenerator"
,
"name"
:
"Attainment"
,
"name"
:
"Attainment"
,
"short_id"
:
"A"
,
"property_list"
:
[
schema
[
'start'
],
schema
[
'stop'
],
schema
[
'duration'
],
"property_list"
:
[
schema
[
'start'
],
schema
[
'stop'
],
schema
[
'duration'
],
schema
[
'interval'
],
schema
[
'method'
],
schema
[
'argumentDict'
]]
schema
[
'interval'
],
schema
[
'method'
],
schema
[
'argumentDict'
]]
}
}
...
...
dream/simulation/GUI/Default.py
View file @
318c47ac
...
@@ -246,6 +246,7 @@ class Simulation(object):
...
@@ -246,6 +246,7 @@ class Simulation(object):
schema
[
"interarrivalTime"
],
schema
[
"interarrivalTime"
],
schema
[
"entity"
]
schema
[
"entity"
]
],
],
"short_id"
:
"S"
,
"_class"
:
'Dream.Source'
"_class"
:
'Dream.Source'
},
},
"Dream-Machine"
:
{
"Dream-Machine"
:
{
...
@@ -253,6 +254,7 @@ class Simulation(object):
...
@@ -253,6 +254,7 @@ class Simulation(object):
schema
[
"processingTime"
],
schema
[
"processingTime"
],
schema
[
"failures"
]
schema
[
"failures"
]
],
],
"short_id"
:
"M"
,
"_class"
:
'Dream.Machine'
"_class"
:
'Dream.Machine'
},
},
"Dream-Queue"
:
{
"Dream-Queue"
:
{
...
@@ -261,12 +263,15 @@ class Simulation(object):
...
@@ -261,12 +263,15 @@ class Simulation(object):
schema
[
"isDummy"
],
schema
[
"isDummy"
],
schema
[
"schedulingRule"
]
schema
[
"schedulingRule"
]
],
],
"short_id"
:
"Q"
,
"_class"
:
'Dream.Queue'
"_class"
:
'Dream.Queue'
},
},
"Dream-Exit"
:
{
"Dream-Exit"
:
{
"short_id"
:
"E"
,
"_class"
:
'Dream.Exit'
"_class"
:
'Dream.Exit'
},
},
"Dream-Repairman"
:
{
"Dream-Repairman"
:
{
"short_id"
:
"R"
,
"property_list"
:
[
schema
[
"capacity"
]],
"property_list"
:
[
schema
[
"capacity"
]],
"_class"
:
'Dream.Repairman'
"_class"
:
'Dream.Repairman'
},
},
...
...
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