Commit 3047d1a7 authored by Sebastien Robin's avatar Sebastien Robin

PartJobShop: display in GUI a spreadsheet to define parts of an order

parent d7ffe32a
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
<div class="twelve columns"> <div class="twelve columns">
<div id="main"></div> <div id="main"></div>
<div id="wip_spreadsheet" style="display: none;"></div> <div id="wip_spreadsheet" style="display: none;"></div>
<div id="wip_part_spreadsheet" style="display: none;"></div>
<div id="shift_spreadsheet" style="display: none;"></div> <div id="shift_spreadsheet" style="display: none;"></div>
</div> </div>
......
...@@ -70,10 +70,14 @@ ...@@ -70,10 +70,14 @@
$('#shift_spreadsheet').hide(); $('#shift_spreadsheet').hide();
$("#job_gantt").hide(); $("#job_gantt").hide();
$("#wip_spreadsheet").hide(); $("#wip_spreadsheet").hide();
$("#wip_part_spreadsheet").hide();
if (configuration['Dream-Configuration'].gui.wip_spreadsheet){ if (configuration['Dream-Configuration'].gui.wip_spreadsheet){
$("#wip_spreadsheet").show(); $("#wip_spreadsheet").show();
} }
if (configuration['Dream-Configuration'].gui.wip_part_spreadsheet){
$("#wip_part_spreadsheet").show();
}
if (configuration['Dream-Configuration'].gui.shift_spreadsheet){ if (configuration['Dream-Configuration'].gui.shift_spreadsheet){
$("#shift_spreadsheet").show(); $("#shift_spreadsheet").show();
} }
...@@ -95,6 +99,12 @@ ...@@ -95,6 +99,12 @@
spreadsheet.handsontable('populateFromArray', 0, 0, shift_spreadsheet_data); spreadsheet.handsontable('populateFromArray', 0, 0, shift_spreadsheet_data);
spreadsheet.find('.htCore').width(spreadsheet.width()); spreadsheet.find('.htCore').width(spreadsheet.width());
} }
var wip_part_spreadsheet_data = data.wip_part_spreadsheet;
if (wip_part_spreadsheet_data !== undefined) {
var spreadsheet = $('#wip_part_spreadsheet');
spreadsheet.handsontable('populateFromArray', 0, 0, wip_part_spreadsheet_data);
spreadsheet.find('.htCore').width(spreadsheet.width());
}
var preference = data.preference !== undefined ? var preference = data.preference !== undefined ?
data.preference : {}; data.preference : {};
......
...@@ -134,6 +134,29 @@ ...@@ -134,6 +134,29 @@
}); });
wip_spreadsheet.find('.htCore').width(wip_spreadsheet.width()); wip_spreadsheet.find('.htCore').width(wip_spreadsheet.width());
var wip_part_spreadsheet = $('#wip_part_spreadsheet');
var data = [
[
"Order ID",
"Due Date",
"Priority",
"Project Manager",
"Parts",
"Part Type",
"Sequence",
"Processing Times",
"Electrodes Needed"
]
];
wip_part_spreadsheet.handsontable({
data: data,
minSpareRows: 1,
afterChange: function () {
priv.onDataChange();
}
});
wip_part_spreadsheet.find('.htCore').width(wip_part_spreadsheet.width());
var shift_spreadsheet = $('#shift_spreadsheet'); var shift_spreadsheet = $('#shift_spreadsheet');
var data = [ var data = [
[ [
...@@ -321,6 +344,10 @@ ...@@ -321,6 +344,10 @@
if (wip_spreadsheet.length > 0) { if (wip_spreadsheet.length > 0) {
data['wip_spreadsheet'] = wip_spreadsheet.handsontable('getData'); data['wip_spreadsheet'] = wip_spreadsheet.handsontable('getData');
} }
var wip_part_spreadsheet = $('#wip_part_spreadsheet');
if (wip_part_spreadsheet.length > 0) {
data['wip_part_spreadsheet'] = wip_part_spreadsheet.handsontable('getData');
}
var shift_spreadsheet = $('#shift_spreadsheet'); var shift_spreadsheet = $('#shift_spreadsheet');
if (shift_spreadsheet.length > 0) { if (shift_spreadsheet.length > 0) {
data['shift_spreadsheet'] = shift_spreadsheet.handsontable('getData'); data['shift_spreadsheet'] = shift_spreadsheet.handsontable('getData');
......
...@@ -245,6 +245,7 @@ class Simulation(object): ...@@ -245,6 +245,7 @@ class Simulation(object):
"gui": { "gui": {
'debug_json': 0, 'debug_json': 0,
'wip_spreadsheet': 0, 'wip_spreadsheet': 0,
'wip_part_spreadsheet': 0,
'shift_spreadsheet': 0, 'shift_spreadsheet': 0,
'station_utilisation_graph': 1, 'station_utilisation_graph': 1,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment