Add button to simulate machine
This commit is contained in:
@@ -58,6 +58,7 @@ function parseFromJson(json) {
|
||||
|
||||
doc.states = doc.states.map(state => Object.assign(new State(0, 0), state));
|
||||
doc.connections = doc.connections.map(connection => {
|
||||
console.log(connection.type);
|
||||
switch(connection.type) {
|
||||
case 'Connection':
|
||||
connection = Object.assign(new Connection(null, null), connection);
|
||||
@@ -73,9 +74,10 @@ function parseFromJson(json) {
|
||||
|
||||
break;
|
||||
case 'StartConnection':
|
||||
connection = Object.assign(new StartConnection(null, {x: 0, y: 0}), connection);
|
||||
connection = Object.assign(new StartConnection(), connection);
|
||||
|
||||
connection.state = doc.states.find(state => state.id === connection.state);
|
||||
console.log(connection.state);
|
||||
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user