From 7ba307bafe45590dc164feff98f00086077e26f3 Mon Sep 17 00:00:00 2001 From: jiteshjha Date: Mon, 11 Jul 2016 13:06:19 +0530 Subject: Data Structures style error --- index.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 554ff15..b8726c3 100644 --- a/index.html +++ b/index.html @@ -790,7 +790,12 @@ { var stylesheet = graph.getStylesheet(); var style = stylesheet.styles[cell.value.getAttribute('style')]; - var displayedLabel = style['displayedLabel']; + var displayedLabel = null; + + if(style != null) { + displayedLabel = style['displayedLabel']; + } + if(displayedLabel != null) { var displayParameter = cell.blockInstance.instance.displayParameter; for(i in displayParameter) { -- cgit From 8223207d188ea3ff0689cd6ea62662826300ed02 Mon Sep 17 00:00:00 2001 From: sarangsingh29 Date: Mon, 11 Jul 2016 14:35:11 +0530 Subject: Import Button added --- index.html | 553 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 530 insertions(+), 23 deletions(-) mode change 100644 => 100755 index.html diff --git a/index.html b/index.html old mode 100644 new mode 100755 index 554ff15..4ff538b --- a/index.html +++ b/index.html @@ -15,7 +15,6 @@ - @@ -3241,10 +3169,10 @@ + document.getElementById('outlineContainer'), + document.getElementById('toolbarContainer'), + document.getElementById('sidebarContainer'), + document.getElementById('statusContainer'));" style="margin:0px;">
@@ -3284,38 +3212,37 @@ - + \ No newline at end of file -- cgit From 72cffd01e9cfdf9b462958e9aa05248c87121e65 Mon Sep 17 00:00:00 2001 From: sarangsingh29 Date: Mon, 11 Jul 2016 15:01:14 +0530 Subject: Import button --minor changes --- index.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.html b/index.html index b36364c..d4c25d2 100755 --- a/index.html +++ b/index.html @@ -15,6 +15,8 @@ + + - + - \ No newline at end of file + -- cgit From 04ee10094696a2c68276f193901007686e1cc635 Mon Sep 17 00:00:00 2001 From: sarangsingh29 Date: Tue, 12 Jul 2016 11:38:58 +0530 Subject: variables changed --- index.html | 112 ++++++++++++++++++++++++++++++------------------------------- 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/index.html b/index.html index 399a042..67e46e7 100755 --- a/index.html +++ b/index.html @@ -1076,7 +1076,7 @@ Careful mapping needs to be done between these two ids. */ editor.addAction('importXcos', function(editor, cell) { - var xml = ''; + var xmlDoc = ''; var div = document.createElement('div'); var node = document.createElement('form'); div.setAttribute("id", "tempdiv"); @@ -1100,11 +1100,11 @@ textArea.setAttribute("cols", "60"); textArea.setAttribute("name", "tarea"); node.appendChild(textArea); - var btn = document.createElement('button'); - btn.innerHTML = 'Submit'; - btn.type = "button"; - btn.name = "submit"; - node.appendChild(btn); + var button = document.createElement('button'); + button.innerHTML = 'Submit'; + button.type = "button"; + button.name = "submit"; + node.appendChild(button); fileNode.addEventListener('change', function(evt) { @@ -1118,14 +1118,14 @@ The following regular expressions are used to format the imported Xcos XML according to the format that is recognized by the mxCodec decoder. */ - xml = contents; + xmlDoc = contents; //RegEx to replace all the newline characters. - xml = xml.replace(/\n*/, ''); + xmlDoc = xmlDoc.replace(/\n*/, ''); //RegEx to replace all the space characters between any a closing and the next opening tag. - xml = xml.replace(/>\s*<'); + xmlDoc = xmlDoc.replace(/>\s*<'); //RegEx to replace all the XML comments. - xml = xml.replace(//g, ''); - textArea.value = xml; + xmlDoc = xmlDoc.replace(//g, ''); + textArea.value = xmlDoc; } @@ -1137,16 +1137,16 @@ A dictionary is used to perform the mapping between the old ids and the new ids. See explanation at the beginning of the function!!! */ - var dict = {}; + var dictionary = {}; - btn.onclick = function() { + button.onclick = function() { wind.destroy(); graph.model.beginUpdate(); try { var parent = graph.getDefaultParent(); - var doc = mxUtils.parseXml(xml); + var doc = mxUtils.parseXml(xmlDoc); var codec = new mxCodec(doc); var rootNode = doc.documentElement; /* @@ -1202,19 +1202,19 @@ } var cells = []; - var elt = rootNode.firstChild; - while (elt != null) { - var curNodeName = elt.nodeName; + var currentNode = rootNode.firstChild; + while (currentNode != null) { + var curNodeName = currentNode.nodeName; - var cell = codec.decode(elt); + var cell = codec.decode(currentNode); - var curId = elt.getAttribute('id'); + var curId = currentNode.getAttribute('id'); /* Maverick Finding the mxGeometry node for all the nodes. */ - var geometryNode = elt.firstChild; + var geometryNode = currentNode.firstChild; var geometryCell = null; if (geometryNode != null) { @@ -1261,7 +1261,7 @@ var node = enc.encode(details); var temp = enc.encode(parent); var stylesheet = graph.getStylesheet(); - var styleName = elt.getAttribute('style'); + var styleName = currentNode.getAttribute('style'); if (styleName.indexOf(';') != -1) { styleName = styleName.substring(0, styleName.indexOf(';')); } @@ -1316,7 +1316,7 @@ v1.blockInstance = createInstanceTag(details_instance); temporaryMapObject.newId = v1.id; - dict[curId] = temporaryMapObject; + dictionary[curId] = temporaryMapObject; //findAndCreatePorts(graph,v1,doc,curId,codec); //createPorts(graph, v1, inputPorts, controlPorts, outputPorts, commandPorts); @@ -1332,15 +1332,15 @@ // (x-5, y-5.5) is the offset to correct the position of split-block var v1 = graph.insertVertex(graph.getDefaultParent(), null, '', geometryCell.x - 5, geometryCell.y - 5.5, 10, 10, 'Split', false); temporaryMapObject.newId = v1.id; - dict[curId] = temporaryMapObject; + dictionary[curId] = temporaryMapObject; v1.setConnectable(false); } } if (curNodeName.endsWith('Port')) { - var oldParentId = elt.getAttribute('parent'); - var newParentObj = dict[oldParentId]; + var oldParentId = currentNode.getAttribute('parent'); + var newParentObj = dictionary[oldParentId]; var newParentId = newParentObj.newId; var newParentCell = graph.getModel().getCell(newParentId); @@ -1371,51 +1371,51 @@ } //To continue traversal of all the nodes. - elt = elt.nextSibling; + currentNode = currentNode.nextSibling; } /* Maverick Adding the ports. */ - elt = rootNode.firstChild; - while (elt != null) { - var curNodeName = elt.nodeName; + currentNode = rootNode.firstChild; + while (currentNode != null) { + var curNodeName = currentNode.nodeName; /* Maverick Handling all the ports of a given block collectively. */ if (!(curNodeName.endsWith('Port') || curNodeName.endsWith('Link'))) { - var curId = elt.getAttribute('id'); - var newParentObj = dict[curId]; + var curId = currentNode.getAttribute('id'); + var newParentObj = dictionary[curId]; if (newParentObj != null) { var newParentId = newParentObj.newId; var newParentCell = graph.getModel().getCell(newParentId); - createPorts(graph, newParentCell, newParentObj.inputArray, newParentObj.controlArray, newParentObj.outputArray, newParentObj.commandArray, newParentObj, dict); + createPorts(graph, newParentCell, newParentObj.inputArray, newParentObj.controlArray, newParentObj.outputArray, newParentObj.commandArray, newParentObj, dictionary); } } - elt = elt.nextSibling; + currentNode = currentNode.nextSibling; } /* Maverick Connecting the links. */ - //elt=doc.documentElement.firstChild.firstChild.firstChild; - elt = rootNode.firstChild; - while (elt != null) { - var curNodeName = elt.nodeName; + + currentNode = rootNode.firstChild; + while (currentNode != null) { + var curNodeName = currentNode.nodeName; if (curNodeName.endsWith('Link')) { var pointsArray = []; - var newSourceObj = dict[elt.getAttribute('source')]; - var newTargetObj = dict[elt.getAttribute('target')]; + var newSourceObj = dictionary[currentNode.getAttribute('source')]; + var newTargetObj = dictionary[currentNode.getAttribute('target')]; var newSourceCell = graph.getModel().getCell(newSourceObj.newId); var newTargetCell = graph.getModel().getCell(newTargetObj.newId); - var childNode = elt.firstChild; + var childNode = currentNode.firstChild; if (childNode != null) { if (childNode.nodeName == 'mxGeometry') { var tempNode = childNode.firstChild; @@ -1437,7 +1437,7 @@ createEdgeObject(graph, newSourceCell, newTargetCell, null); } - elt = elt.nextSibling; + currentNode = currentNode.nextSibling; } } finally { @@ -2670,14 +2670,14 @@ New parameters are the parentObj where the port is supposed to be added and a dictionary object which contains the mapping between the newly assigned Ids and imported Ids. */ - function createPorts(graph, block, left, top, right, bottom, parentObj, dict) { + function createPorts(graph, block, left, top, right, bottom, parentObj, dictionary) { - createInputPorts(graph, block, left, top, parentObj, dict); - createOutputPorts(graph, block, right, bottom, parentObj, dict); + createInputPorts(graph, block, left, top, parentObj, dictionary); + createOutputPorts(graph, block, right, bottom, parentObj, dictionary); } - function createInputPorts(graph, block, leftArray, topArray, parentObj, dict) { + function createInputPorts(graph, block, leftArray, topArray, parentObj, dictionary) { var topNumber = topArray.length; var leftNumber = leftArray.length; @@ -2690,7 +2690,7 @@ var portType = leftArray[i - 1]; //console.log(parentObj.inputIds); if (parentObj != null) { - createInputPort(graph, block, x, y, portType, 'left', i, dict, parentObj.inputIds); + createInputPort(graph, block, x, y, portType, 'left', i, dictionary, parentObj.inputIds); } else { createInputPort(graph, block, x, y, portType, 'left', i); } @@ -2704,7 +2704,7 @@ var portType = topArray[i - 1]; //console.log(parentObj.controlIds); if (parentObj != null) { - createInputPort(graph, block, x, y, portType, 'top', i, dict, parentObj.controlIds); + createInputPort(graph, block, x, y, portType, 'top', i, dictionary, parentObj.controlIds); } else { createInputPort(graph, block, x, y, portType, 'top', i); } @@ -2713,7 +2713,7 @@ }; - function createOutputPorts(graph, block, rightArray, bottomArray, parentObj, dict) { + function createOutputPorts(graph, block, rightArray, bottomArray, parentObj, dictionary) { var bottomNumber = bottomArray.length; var rightNumber = rightArray.length; @@ -2724,7 +2724,7 @@ var portType = rightArray[i - 1]; //console.log(parentObj.outputIds); if (parentObj != null) { - createOutputPort(graph, block, x, y, portType, 'right', i, dict, parentObj.outputIds); + createOutputPort(graph, block, x, y, portType, 'right', i, dictionary, parentObj.outputIds); } else { createOutputPort(graph, block, x, y, portType, 'right', i); } @@ -2737,7 +2737,7 @@ var portType = bottomArray[i - 1]; //console.log(parentObj.commandIds); if (parentObj != null) { - createOutputPort(graph, block, x, y, portType, 'bottom', i, dict, parentObj.commandIds); + createOutputPort(graph, block, x, y, portType, 'bottom', i, dictionary, parentObj.commandIds); } else { createOutputPort(graph, block, x, y, portType, 'bottom', i); } @@ -2746,7 +2746,7 @@ }; - function createInputPort(graph, block, x, y, portType, position, ordering, dict, idArray) { + function createInputPort(graph, block, x, y, portType, position, ordering, dictionary, idArray) { var port = null; if (portType == 'COMMAND') { @@ -2766,12 +2766,12 @@ } port.ordering = ordering; - if (dict != null) { + if (dictionary != null) { var obj = new Object(); obj.newId = port.id; obj.oldId = idArray[ordering - 1]; //console.log(idArray[ordering-1]); - dict[idArray[ordering - 1]] = obj; + dictionary[idArray[ordering - 1]] = obj; } if (block.style == 'Split') { @@ -2781,7 +2781,7 @@ } }; - function createOutputPort(graph, block, x, y, portType, position, ordering, dict, idArray) { + function createOutputPort(graph, block, x, y, portType, position, ordering, dictionary, idArray) { var port = null; if (portType == 'COMMAND') { @@ -2802,12 +2802,12 @@ } port.ordering = ordering; - if (dict != null) { + if (dictionary != null) { var obj = new Object(); obj.newId = port.id; obj.oldId = idArray[ordering - 1]; //console.log(idArray[ordering-1]); - dict[idArray[ordering - 1]] = obj; + dictionary[idArray[ordering - 1]] = obj; } if (block.style == 'Split') { -- cgit From 7db05087097259538b1f1e437b3bdd5d736e7115 Mon Sep 17 00:00:00 2001 From: sarangsingh29 Date: Tue, 12 Jul 2016 11:51:36 +0530 Subject: variables changed --- index.html | 67 ++--- untitled1.xcos | 867 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 902 insertions(+), 32 deletions(-) create mode 100644 untitled1.xcos diff --git a/index.html b/index.html index 67e46e7..302cbcf 100755 --- a/index.html +++ b/index.html @@ -1076,7 +1076,7 @@ Careful mapping needs to be done between these two ids. */ editor.addAction('importXcos', function(editor, cell) { - var xmlDoc = ''; + var xmlDocument = ''; var div = document.createElement('div'); var node = document.createElement('form'); div.setAttribute("id", "tempdiv"); @@ -1105,8 +1105,11 @@ button.type = "button"; button.name = "submit"; node.appendChild(button); - - + + /* + Maverick + Reference: www.htmlgoodies.com + */ fileNode.addEventListener('change', function(evt) { var f = evt.target.files[0]; @@ -1118,14 +1121,14 @@ The following regular expressions are used to format the imported Xcos XML according to the format that is recognized by the mxCodec decoder. */ - xmlDoc = contents; + xmlDocument = contents; //RegEx to replace all the newline characters. - xmlDoc = xmlDoc.replace(/\n*/, ''); + xmlDocument = xmlDocument.replace(/\n*/, ''); //RegEx to replace all the space characters between any a closing and the next opening tag. - xmlDoc = xmlDoc.replace(/>\s*<'); + xmlDocument = xmlDocument.replace(/>\s*<'); //RegEx to replace all the XML comments. - xmlDoc = xmlDoc.replace(//g, ''); - textArea.value = xmlDoc; + xmlDocument = xmlDocument.replace(//g, ''); + textArea.value = xmlDocument; } @@ -1137,7 +1140,7 @@ A dictionary is used to perform the mapping between the old ids and the new ids. See explanation at the beginning of the function!!! */ - var dictionary = {}; + var nodeDataObject = {}; button.onclick = function() { @@ -1146,7 +1149,7 @@ graph.model.beginUpdate(); try { var parent = graph.getDefaultParent(); - var doc = mxUtils.parseXml(xmlDoc); + var doc = mxUtils.parseXml(xmlDocument); var codec = new mxCodec(doc); var rootNode = doc.documentElement; /* @@ -1316,7 +1319,7 @@ v1.blockInstance = createInstanceTag(details_instance); temporaryMapObject.newId = v1.id; - dictionary[curId] = temporaryMapObject; + nodeDataObject[curId] = temporaryMapObject; //findAndCreatePorts(graph,v1,doc,curId,codec); //createPorts(graph, v1, inputPorts, controlPorts, outputPorts, commandPorts); @@ -1332,7 +1335,7 @@ // (x-5, y-5.5) is the offset to correct the position of split-block var v1 = graph.insertVertex(graph.getDefaultParent(), null, '', geometryCell.x - 5, geometryCell.y - 5.5, 10, 10, 'Split', false); temporaryMapObject.newId = v1.id; - dictionary[curId] = temporaryMapObject; + nodeDataObject[curId] = temporaryMapObject; v1.setConnectable(false); } } @@ -1340,7 +1343,7 @@ if (curNodeName.endsWith('Port')) { var oldParentId = currentNode.getAttribute('parent'); - var newParentObj = dictionary[oldParentId]; + var newParentObj = nodeDataObject[oldParentId]; var newParentId = newParentObj.newId; var newParentCell = graph.getModel().getCell(newParentId); @@ -1387,12 +1390,12 @@ */ if (!(curNodeName.endsWith('Port') || curNodeName.endsWith('Link'))) { var curId = currentNode.getAttribute('id'); - var newParentObj = dictionary[curId]; + var newParentObj = nodeDataObject[curId]; if (newParentObj != null) { var newParentId = newParentObj.newId; var newParentCell = graph.getModel().getCell(newParentId); - createPorts(graph, newParentCell, newParentObj.inputArray, newParentObj.controlArray, newParentObj.outputArray, newParentObj.commandArray, newParentObj, dictionary); + createPorts(graph, newParentCell, newParentObj.inputArray, newParentObj.controlArray, newParentObj.outputArray, newParentObj.commandArray, newParentObj, nodeDataObject); } } currentNode = currentNode.nextSibling; @@ -1409,8 +1412,8 @@ if (curNodeName.endsWith('Link')) { var pointsArray = []; - var newSourceObj = dictionary[currentNode.getAttribute('source')]; - var newTargetObj = dictionary[currentNode.getAttribute('target')]; + var newSourceObj = nodeDataObject[currentNode.getAttribute('source')]; + var newTargetObj = nodeDataObject[currentNode.getAttribute('target')]; var newSourceCell = graph.getModel().getCell(newSourceObj.newId); var newTargetCell = graph.getModel().getCell(newTargetObj.newId); @@ -2670,14 +2673,14 @@ New parameters are the parentObj where the port is supposed to be added and a dictionary object which contains the mapping between the newly assigned Ids and imported Ids. */ - function createPorts(graph, block, left, top, right, bottom, parentObj, dictionary) { + function createPorts(graph, block, left, top, right, bottom, parentObj, nodeDataObject) { - createInputPorts(graph, block, left, top, parentObj, dictionary); - createOutputPorts(graph, block, right, bottom, parentObj, dictionary); + createInputPorts(graph, block, left, top, parentObj, nodeDataObject); + createOutputPorts(graph, block, right, bottom, parentObj, nodeDataObject); } - function createInputPorts(graph, block, leftArray, topArray, parentObj, dictionary) { + function createInputPorts(graph, block, leftArray, topArray, parentObj, nodeDataObject) { var topNumber = topArray.length; var leftNumber = leftArray.length; @@ -2690,7 +2693,7 @@ var portType = leftArray[i - 1]; //console.log(parentObj.inputIds); if (parentObj != null) { - createInputPort(graph, block, x, y, portType, 'left', i, dictionary, parentObj.inputIds); + createInputPort(graph, block, x, y, portType, 'left', i, nodeDataObject, parentObj.inputIds); } else { createInputPort(graph, block, x, y, portType, 'left', i); } @@ -2704,7 +2707,7 @@ var portType = topArray[i - 1]; //console.log(parentObj.controlIds); if (parentObj != null) { - createInputPort(graph, block, x, y, portType, 'top', i, dictionary, parentObj.controlIds); + createInputPort(graph, block, x, y, portType, 'top', i, nodeDataObject, parentObj.controlIds); } else { createInputPort(graph, block, x, y, portType, 'top', i); } @@ -2713,7 +2716,7 @@ }; - function createOutputPorts(graph, block, rightArray, bottomArray, parentObj, dictionary) { + function createOutputPorts(graph, block, rightArray, bottomArray, parentObj, nodeDataObject) { var bottomNumber = bottomArray.length; var rightNumber = rightArray.length; @@ -2724,7 +2727,7 @@ var portType = rightArray[i - 1]; //console.log(parentObj.outputIds); if (parentObj != null) { - createOutputPort(graph, block, x, y, portType, 'right', i, dictionary, parentObj.outputIds); + createOutputPort(graph, block, x, y, portType, 'right', i, nodeDataObject, parentObj.outputIds); } else { createOutputPort(graph, block, x, y, portType, 'right', i); } @@ -2737,7 +2740,7 @@ var portType = bottomArray[i - 1]; //console.log(parentObj.commandIds); if (parentObj != null) { - createOutputPort(graph, block, x, y, portType, 'bottom', i, dictionary, parentObj.commandIds); + createOutputPort(graph, block, x, y, portType, 'bottom', i, nodeDataObject, parentObj.commandIds); } else { createOutputPort(graph, block, x, y, portType, 'bottom', i); } @@ -2746,7 +2749,7 @@ }; - function createInputPort(graph, block, x, y, portType, position, ordering, dictionary, idArray) { + function createInputPort(graph, block, x, y, portType, position, ordering, nodeDataObject, idArray) { var port = null; if (portType == 'COMMAND') { @@ -2766,12 +2769,12 @@ } port.ordering = ordering; - if (dictionary != null) { + if (nodeDataObject != null) { var obj = new Object(); obj.newId = port.id; obj.oldId = idArray[ordering - 1]; //console.log(idArray[ordering-1]); - dictionary[idArray[ordering - 1]] = obj; + nodeDataObject[idArray[ordering - 1]] = obj; } if (block.style == 'Split') { @@ -2781,7 +2784,7 @@ } }; - function createOutputPort(graph, block, x, y, portType, position, ordering, dictionary, idArray) { + function createOutputPort(graph, block, x, y, portType, position, ordering, nodeDataObject, idArray) { var port = null; if (portType == 'COMMAND') { @@ -2802,12 +2805,12 @@ } port.ordering = ordering; - if (dictionary != null) { + if (nodeDataObject != null) { var obj = new Object(); obj.newId = port.id; obj.oldId = idArray[ordering - 1]; //console.log(idArray[ordering-1]); - dictionary[idArray[ordering - 1]] = obj; + nodeDataObject[idArray[ordering - 1]] = obj; } if (block.style == 'Split') { diff --git a/untitled1.xcos b/untitled1.xcos new file mode 100644 index 0000000..714b052 --- /dev/null +++ b/untitled1.xcos @@ -0,0 +1,867 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit From 88c08794fba23958fff51e28bdeddb17fab39346 Mon Sep 17 00:00:00 2001 From: sarangsingh29 Date: Tue, 12 Jul 2016 11:55:36 +0530 Subject: variables changed --- untitled1.xcos | 867 --------------------------------------------------------- 1 file changed, 867 deletions(-) delete mode 100644 untitled1.xcos diff --git a/untitled1.xcos b/untitled1.xcos deleted file mode 100644 index 714b052..0000000 --- a/untitled1.xcos +++ /dev/null @@ -1,867 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- cgit From 316be2fb6c6253e62ef2832fed867f9843593eaa Mon Sep 17 00:00:00 2001 From: Adhitya Kamakshidasan Date: Tue, 12 Jul 2016 12:08:24 +0530 Subject: Updated combined.js --- combined.js | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/combined.js b/combined.js index 4c04f99..5e0c942 100644 --- a/combined.js +++ b/combined.js @@ -10676,3 +10676,36 @@ function TKSCALE() { return this.x; } } +function TOWS_c() { + + TOWS_c.prototype.define = function TOWS_c() { + this.nu = -1; + this.nz = 128; + this.varnam = "A"; + this.herit = 0; + + var model = scicos_model(); + model.sim = list(new ScilabString(["tows_c"]), new ScilabDouble([4])); + model.in = new ScilabDouble([this.nu]); + model.in2 = new ScilabDouble([-2]); + model.intyp = new ScilabDouble([-1]); + model.out = new ScilabDouble(); + model.evtin = new ScilabDouble([1]); + model.evtout = new ScilabDouble(); + model.rpar = new ScilabDouble(); + model.ipar = new ScilabDouble([this.nz], [this.varnam.length], ascii(this.varnam)); + model.blocktype = new ScilabString(["d"]); + model.firing = new ScilabDouble(); + model.dep_ut = new ScilabBoolean([false, false]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"TOWS_c\",sz(1),sz(2));"]);; + + var exprs = new ScilabString([this.nz], [this.varnam], [this.herit]); + this.x = new standard_define(new ScilabDouble([4, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + + TOWS_c.prototype.details = function TOWS_c() { + return this.x; + } +} -- cgit From c8373df0c62fa85a8eb38992604b717d42ac2a54 Mon Sep 17 00:00:00 2001 From: Avi Dutta Date: Tue, 12 Jul 2016 07:07:38 +0000 Subject: Implement ZCROSS_f Block --- data_structures_correct/ZCROSS_f.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 data_structures_correct/ZCROSS_f.js diff --git a/data_structures_correct/ZCROSS_f.js b/data_structures_correct/ZCROSS_f.js new file mode 100644 index 0000000..8d2e66a --- /dev/null +++ b/data_structures_correct/ZCROSS_f.js @@ -0,0 +1,29 @@ +function ZCROSS_f() { + + ZCROSS_f.prototype.define = function ZCROSS_f() { + this.rpar = [[-1], [-1], [0], [0]]; + + this.in = 1; + + var model = scicos_model(); + model.sim = list(new ScilabString(["zcross"]), new ScilabDouble([1])); + model.in = new ScilabDouble([this.in]); + model.nzcross = new ScilabDouble([this.in]); + model.evtout = new ScilabDouble([1]); + model.rpar = new ScilabDouble([-1], [-1], [0], [0]); + model.blocktype = new ScilabString(["z"]); + model.firing = new ScilabDouble([-1]); + model.dep_ut = new ScilabBoolean([true, false]); + + var exprs = new ScilabString([sci2exp(this.in)]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"ZCROSS_f\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, exprs, gr_i); + + return new BasicBlock(this.x); + } + + ZCROSS_f.prototype.details = function ZCROSS_f() { + return this.x; + } +} -- cgit From 3bd2720042be7ccd4f5ba8c86f9e684acda5234f Mon Sep 17 00:00:00 2001 From: Avi Dutta Date: Tue, 12 Jul 2016 09:41:50 +0000 Subject: Implement VVsourceAC Block --- data_structures_correct/VVsourceAC.js | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 data_structures_correct/VVsourceAC.js diff --git a/data_structures_correct/VVsourceAC.js b/data_structures_correct/VVsourceAC.js new file mode 100644 index 0000000..00a3107 --- /dev/null +++ b/data_structures_correct/VVsourceAC.js @@ -0,0 +1,41 @@ +function VVsourceAC() { + + VVsourceAC.prototype.define = function VVsourceAC() { + var model = scicos_model(); + + model.in = new ScilabDouble([1], [1]); + model.out = new ScilabDouble([1]); + + this.VA = 220; + this.FR = 50; + + model.rpar = new ScilabDouble([this.FR]); + model.sim = new ScilabString(["VVsourceAC"]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + + var mo = modelica_function(); + mo.model = new ScilabString(["VVsourceAC"]); + mo.inputs = new ScilabString(["p", "VA"]); + mo.outputs = new ScilabString(["n"]); + mo.parameters = list(new ScilabString(["f"]), list(new ScilabDouble([this.FR]))); + model.equations = mo; + + var exprs = new ScilabString([this.FR]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"VVsourceAC\",sz(1),sz(2));"]); + + + this.x = standard_define([2, 2], model, exprs, list(gr_i, 0)); + this.x.graphics.in_implicit = new ScilabString(["I", "E"]); + this.x.graphics.out_implicit = new ScilabString(["I"]); + + return new BasicBlock(this.x); + + } + + VVsourceAC.prototype.details = function VVsourceAC() { + return this.x; + + } +} -- cgit From a258d21056e4aad7841a70300588ec2574d77f75 Mon Sep 17 00:00:00 2001 From: Avi Dutta Date: Tue, 12 Jul 2016 09:50:48 +0000 Subject: Implement VsourceAC Block --- data_structures_correct/VsourceAC.js | 37 ++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 data_structures_correct/VsourceAC.js diff --git a/data_structures_correct/VsourceAC.js b/data_structures_correct/VsourceAC.js new file mode 100644 index 0000000..59cc3b4 --- /dev/null +++ b/data_structures_correct/VsourceAC.js @@ -0,0 +1,37 @@ +function VsourceAC() { + + VsourceAC.prototype.define = function VsourceAC() { + var model = scicos_model(); + model.in = new ScilabDouble([1]); + model.out = new ScilabDouble([1]); + + this.VA = 220; + + this.FR = 50; + model.rpar = new ScilabDouble([this.VA], [this.FR]); + model.sim = new ScilabString(["VsourceAC"]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + + var mo = modelica_function(); + mo.model = new ScilabString(["VsourceAC"]); + mo.inputs = new ScilabString(["p"]); + mo.outputs = new ScilabString(["n"]); + mo.parameters = list(new ScilabString(["VA"], ["f"]), list(new ScilabDouble([this.VA]), new ScilabDouble([this.FR]))); + model.equations = mo; + + var exprs = new ScilabString([this.VA], [this.FR]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"VsourceAC\",sz(1),sz(2));"]); + + this.x = standard_define([2, 2], model, exprs, list(gr_i, 0)); + this.x.graphics.in_implicit = new ScilabString(["I"]); + this.x.graphics.out_implicit = new ScilabString(["I"]); + + return new BasicBlock(this.x); + } + + VsourceAC.prototype.details = function VsourceAC() { + return this.x; + } +} -- cgit From 4e2adfaa2c68899b72f70d3cb82d9960a647644a Mon Sep 17 00:00:00 2001 From: Avi Dutta Date: Tue, 12 Jul 2016 09:57:39 +0000 Subject: Minor fix --- data_structures_correct/VVsourceAC.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/data_structures_correct/VVsourceAC.js b/data_structures_correct/VVsourceAC.js index 00a3107..120b3bb 100644 --- a/data_structures_correct/VVsourceAC.js +++ b/data_structures_correct/VVsourceAC.js @@ -31,11 +31,9 @@ function VVsourceAC() { this.x.graphics.out_implicit = new ScilabString(["I"]); return new BasicBlock(this.x); - } VVsourceAC.prototype.details = function VVsourceAC() { return this.x; - } } -- cgit