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
26731163
Commit
26731163
authored
Feb 18, 2014
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement shift spreadsheet
parent
7ee95995
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
40 additions
and
31 deletions
+40
-31
dream/platform/static/index.html
dream/platform/static/index.html
+3
-3
dream/platform/static/src/dream_launcher.js
dream/platform/static/src/dream_launcher.js
+9
-1
dream/platform/static/src/jsonPlumb.js
dream/platform/static/src/jsonPlumb.js
+23
-18
dream/simulation/GUI/Batches.py
dream/simulation/GUI/Batches.py
+3
-3
dream/simulation/GUI/Default.py
dream/simulation/GUI/Default.py
+2
-1
dream/simulation/GUI/Shifts.py
dream/simulation/GUI/Shifts.py
+0
-5
No files found.
dream/platform/static/index.html
View file @
26731163
...
...
@@ -42,8 +42,8 @@
<div
class=
"twelve columns"
>
<div
id=
"main"
></div>
<div
id=
"wip_spreadsheet"
></div>
<div
id=
"shift_spreadsheet"
></div>
<div
id=
"wip_spreadsheet"
style=
"display: none;"
></div>
<div
id=
"shift_spreadsheet"
style=
"display: none;"
></div>
</div>
</div>
...
...
@@ -67,7 +67,7 @@
<div
id=
"result_zone"
>
<div>
Result List
</div>
<ul
id=
"result_list"
></ul></div>
<div
id=
"graph_zone"
>
<!-- station_utilisation_graph -->
<div
id=
"graph_zone"
>
<div>
Stations Utilization
</div>
<div
id=
"graph"
></div>
</div>
...
...
dream/platform/static/src/dream_launcher.js
View file @
26731163
...
...
@@ -74,6 +74,9 @@
if
(
configuration
[
'
Dream-Configuration
'
].
gui
.
wip_spreadsheet
){
$
(
"
#wip_spreadsheet
"
).
show
();
}
if
(
configuration
[
'
Dream-Configuration
'
].
gui
.
shift_spreadsheet
){
$
(
"
#shift_spreadsheet
"
).
show
();
}
if
(
configuration
[
'
Dream-Configuration
'
].
gui
.
debug_json
){
$
(
"
#debug_json
"
).
show
();
}
...
...
@@ -86,6 +89,12 @@
spreadsheet
.
handsontable
(
'
populateFromArray
'
,
0
,
0
,
wip_spreadsheet_data
);
spreadsheet
.
find
(
'
.htCore
'
).
width
(
spreadsheet
.
width
());
}
var
shift_spreadsheet_data
=
data
.
shift_spreadsheet
;
if
(
shift_spreadsheet_data
!==
undefined
)
{
var
spreadsheet
=
$
(
'
#shift_spreadsheet
'
);
spreadsheet
.
handsontable
(
'
populateFromArray
'
,
0
,
0
,
shift_spreadsheet_data
);
spreadsheet
.
find
(
'
.htCore
'
).
width
(
spreadsheet
.
width
());
}
var
preference
=
data
.
preference
!==
undefined
?
data
.
preference
:
{};
...
...
@@ -172,7 +181,6 @@
}
else
{
$
(
"
#result_zone
"
).
hide
();
$
(
"
#graph_zone
"
).
hide
();
$
(
"
#shift_spreadsheet
"
).
hide
();
$
(
"
#job_schedule_spreadsheet
"
).
hide
();
$
(
"
#job_gantt
"
).
hide
();
$
(
"
#json_result
"
).
effect
(
'
shake
'
,
50
).
val
(
data
[
'
error
'
]);
...
...
dream/platform/static/src/jsonPlumb.js
View file @
26731163
...
...
@@ -133,24 +133,25 @@
}
});
wip_spreadsheet
.
find
(
'
.htCore
'
).
width
(
wip_spreadsheet
.
width
());
if
(
0
)
{
var
shift_spreadsheet
=
$
(
'
#shift_spreadsheet
'
);
var
data
=
[
[
"
Monday
"
,
"
Tuesday
"
,
"
...
"
,
]
];
shift_spreadsheet
.
handsontable
({
data
:
data
,
minSpareRows
:
1
,
afterChange
:
function
()
{
priv
.
onDataChange
();
}
});
shift_spreadsheet
.
find
(
'
.htCore
'
).
width
(
shift_spreadsheet
.
width
());
}
var
shift_spreadsheet
=
$
(
'
#shift_spreadsheet
'
);
var
data
=
[
[
"
Day
"
,
"
Machines
"
,
// XXX more generic name ?
"
Start
"
,
"
End
"
]
];
shift_spreadsheet
.
handsontable
({
data
:
data
,
minSpareRows
:
1
,
afterChange
:
function
()
{
priv
.
onDataChange
();
}
});
shift_spreadsheet
.
find
(
'
.htCore
'
).
width
(
shift_spreadsheet
.
width
());
};
priv
.
updateElementCoordinate
=
function
(
node_id
,
coordinate
)
{
...
...
@@ -320,6 +321,10 @@
if
(
wip_spreadsheet
.
length
>
0
)
{
data
[
'
wip_spreadsheet
'
]
=
wip_spreadsheet
.
handsontable
(
'
getData
'
);
}
var
shift_spreadsheet
=
$
(
'
#shift_spreadsheet
'
);
if
(
shift_spreadsheet
.
length
>
0
)
{
data
[
'
shift_spreadsheet
'
]
=
shift_spreadsheet
.
handsontable
(
'
getData
'
);
}
return
data
;
};
...
...
dream/simulation/GUI/Batches.py
View file @
26731163
...
...
@@ -4,12 +4,12 @@ import time
import
random
import
operator
from
dream.simulation.GUI.
Default
import
Simulation
as
Default
Simulation
from
dream.simulation.GUI.
Shifts
import
Simulation
as
Shifts
Simulation
from
dream.simulation.GUI.Default
import
schema
class
Simulation
(
Default
Simulation
):
class
Simulation
(
Shifts
Simulation
):
def
getConfigurationDict
(
self
):
conf
=
Default
Simulation
.
getConfigurationDict
(
self
)
conf
=
Shifts
Simulation
.
getConfigurationDict
(
self
)
conf
[
'Dream-LineClearance'
]
=
{
"_class"
:
"Dream.LineClearance"
,
"name"
:
"Clearance"
,
...
...
dream/simulation/GUI/Default.py
View file @
26731163
...
...
@@ -260,7 +260,8 @@ class Simulation(object):
"""Run one scenario.
To be reused by subclasses.
"""
return
json
.
loads
(
simulate_line_json
(
input_data
=
json
.
dumps
(
data
)))
return
json
.
loads
(
simulate_line_json
(
input_data
=
json
.
dumps
(
self
.
_preprocess
(
data
))))
def
_preprocess
(
self
,
data
):
"""Preprocess the data, for instance reading spreadsheet.
...
...
dream/simulation/GUI/Shifts.py
View file @
26731163
...
...
@@ -8,11 +8,6 @@ from dream.simulation.GUI.Default import Simulation as DefaultSimulation
class
Simulation
(
DefaultSimulation
):
def
getConfigurationDict
(
self
):
conf
=
DefaultSimulation
.
getConfigurationDict
(
self
)
conf
[
"Dream-Configuration"
][
"gui"
][
"shift_spreadsheet"
]
=
1
return
conf
def
_preprocess
(
self
,
data
):
"""Preprocess data, reading shift spreadsheet"""
# TODO
...
...
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