Commit 9e5224dc authored by Jérome Perrin's avatar Jérome Perrin

rename spreadsheet -> wip_spreadsheet in stored json

parent 0cb51353
......@@ -385,7 +385,7 @@
// find the corresponding input
var data = that.getData(),
input_job;
$.each(data.spreadsheet, function(i, line){
$.each(data.wip_spreadsheet, function(i, line){
if (line[1] == obj['id']) {
input_job = line;
}
......@@ -503,14 +503,14 @@
}
if (spreadsheet_data.length > 1) {
var spreadsheet = $('#job_schedule_spreadsheet');
var job_schedule_spreadsheet = $('#job_schedule_spreadsheet');
if (configuration['Dream-Configuration'].gui.job_schedule_spreadsheet){
spreadsheet.show();
spreadsheet.handsontable({
job_schedule_spreadsheet.show();
job_schedule_spreadsheet.handsontable({
data: spreadsheet_data,
readOnly: true
});
spreadsheet.find('.htCore').width(spreadsheet.width());
job_schedule_spreadsheet.find('.htCore').width(job_schedule_spreadsheet.width());
}
gantt.templates.task_class = function (start, end, obj) {
return obj.parent ? "sub_task" : "";
......
......@@ -80,10 +80,10 @@
try {
// spreadsheets
var spreadsheet_data = data.spreadsheet; // XXX rename as wip_spreadsheet in json ?
if (spreadsheet_data !== undefined) {
var wip_spreadsheet_data = data.wip_spreadsheet;
if (wip_spreadsheet_data !== undefined) {
var spreadsheet = $('#wip_spreadsheet');
spreadsheet.handsontable('populateFromArray', 0, 0, spreadsheet_data);
spreadsheet.handsontable('populateFromArray', 0, 0, wip_spreadsheet_data);
spreadsheet.find('.htCore').width(spreadsheet.width());
}
......
......@@ -316,10 +316,9 @@
"preference": priv.preference_container,
"general": priv.general_container
};
var spreadsheet = $('#wip_spreadsheet');
if (spreadsheet !== undefined) {
// XXX wip_spreadsheet ?
data['spreadsheet'] = spreadsheet.handsontable('getData');
var wip_spreadsheet = $('#wip_spreadsheet');
if (wip_spreadsheet.length > 0) {
data['wip_spreadsheet'] = wip_spreadsheet.handsontable('getData');
}
return data;
};
......
......@@ -99,7 +99,7 @@
},
"zoom_level": 0.99999
},
"spreadsheet": [
"wip_spreadsheet": [
[
"Jobs",
"ID",
......
......@@ -38,9 +38,9 @@ class Simulation(ACO.Simulation):
""" Set the WIP in queue from spreadsheet data.
"""
data = copy(in_data)
if 'spreadsheet' in data:
if 'wip_spreadsheet' in data:
wip_dict = {}
for value_list in data['spreadsheet']:
for value_list in data['wip_spreadsheet']:
if value_list[1] == 'ID' or not value_list[1]:
continue
sequence_list = value_list[6].split('-')
......@@ -70,6 +70,6 @@ class Simulation(ACO.Simulation):
for node_id in data['nodes'].keys():
if node_id in wip_dict:
data['nodes'][node_id]['wip'] = wip_dict[node_id]
del(data['spreadsheet'])
del(data['wip_spreadsheet'])
return data
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