Commit 79a0156c authored by Sebastien Robin's avatar Sebastien Robin

fix initialization problems, use better througput values for demo

parent fa31b4df
......@@ -34,12 +34,18 @@ def someTest():
@crossdomain(origin='*')
def setModel():
app.logger.debug('setModel')
app.logger.debug("request.json: %r" % (request.json,))
#model = deunicodeData(request.json)
data['model'] = request.json
data['simulation_parameters'] = {}
app.logger.debug("model: %r" % (data['model'],))
return "ok"
@app.route("/updateModel", methods=["POST", "OPTIONS"])
@crossdomain(origin='*')
def setModel():
app.logger.debug('updateModel')
data['model'] = request.json
return "ok"
@app.route("/setSimulationParameters", methods=["POST", "OPTIONS"])
@crossdomain(origin='*')
def setSimulationParameters():
......
......@@ -244,6 +244,22 @@
});
};
priv.updateModel = function () {
// Now communicate our model to the simulation server
$.ajax({
url: "http://localhost:5000/updateModel",
type: 'POST',
data: JSON.stringify(model),
contentType: "application/json",
success: function(response) {
console.log("got json response",response);
},
error: function(xhr, textStatus, error) {
priv.onError(error);
}
});
};
priv.updateConnectionLabel = function (source_id, target_id, title) {
var connection_array, i, i_length, connection;
connection_array = jsPlumb.getConnections({source: source_id, target: target_id});
......
......@@ -5,17 +5,17 @@
i, i_length;
graph_data.throughput = 0;
graph_data.box_list = [
{id: 'window1', title: 'attach1', throughput: 23, target_list: ['window2'], coordinate: {top: 5, left: 5}},
{id: 'window1', title: 'attach1', throughput: 30, target_list: ['window2'], coordinate: {top: 5, left: 5}},
{id: 'window2', title: 'attach2', throughput: 21, target_list: ['window3'], coordinate: {top: 5, left: 15}},
{id: 'window3', title: 'attach3', throughput: 23, target_list: ['window7'], coordinate: {top: 5, left: 25}},
{id: 'window3', title: 'attach3', throughput: 29, target_list: ['window7'], coordinate: {top: 5, left: 25}},
{id: 'window4', title: 'attach1', throughput: 22, target_list: ['window5'], coordinate: {top: 20, left: 5}},
{id: 'window5', title: 'attach2', throughput: 23, target_list: ['window6'], coordinate: {top: 20, left: 15}},
{id: 'window6', title: 'attach3', throughput: 23, target_list: ['window7'], coordinate: {top: 20, left: 25}},
{id: 'window5', title: 'attach2', throughput: 27, target_list: ['window6'], coordinate: {top: 20, left: 15}},
{id: 'window6', title: 'attach3', throughput: 26, target_list: ['window7'], coordinate: {top: 20, left: 25}},
{id: 'window7', title: 'Moulding', throughput: 40, target_list: ['window8', 'window10'], coordinate: {top: 12, left: 35}},
{id: 'window8', title: 'tests', throughput: 23, target_list: ['window9'], coordinate: {top: 5, left: 45}},
{id: 'window9', title: 'packaging', throughput: 23, coordinate: {top: 5, left: 55}},
{id: 'window10', title: 'tests', throughput: 23, target_list: ['window11'], coordinate: {top: 20, left: 45}},
{id: 'window11', title: 'packaging', throughput: 23, coordinate: {top: 20, left: 55}},
{id: 'window9', title: 'packaging', throughput: 25, coordinate: {top: 5, left: 55}},
{id: 'window10', title: 'tests', throughput: 28, target_list: ['window11'], coordinate: {top: 20, left: 45}},
{id: 'window11', title: 'packaging', throughput: 27, coordinate: {top: 20, left: 55}},
];
dream_instance = DREAM.newDream(graph_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