summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPooja Soundalgekar2016-06-14 14:57:31 +0530
committerPooja Soundalgekar2016-06-14 14:57:31 +0530
commitf3c1898f50a719ad07ff2e93035a7f5a59c73058 (patch)
treec969ed9a6957d4adcb82afd34360f930eaaa6931
parent6d10513b5fb4a89b12f0858ae3665d435a90d935 (diff)
downloadxcos-on-web-f3c1898f50a719ad07ff2e93035a7f5a59c73058.tar.gz
xcos-on-web-f3c1898f50a719ad07ff2e93035a7f5a59c73058.tar.bz2
xcos-on-web-f3c1898f50a719ad07ff2e93035a7f5a59c73058.zip
Added tooltip
-rw-r--r--details.js2
-rw-r--r--index.html63
2 files changed, 48 insertions, 17 deletions
diff --git a/details.js b/details.js
index 6316cb9..149031a 100644
--- a/details.js
+++ b/details.js
@@ -848,7 +848,7 @@ function BasicBlock() {
}
this.simulationFunctionType = func_type;
} else {
- this.simulationFunctionName = getData(options.model.sim[0])[0];
+ this.simulationFunctionName = getData(options.model.sim)[0];
this.simulationFunctionType = "DEFAULT";
}
this.style = arguments.callee.caller.name;
diff --git a/index.html b/index.html
index 55769c0..7630567 100644
--- a/index.html
+++ b/index.html
@@ -437,24 +437,55 @@
graph.getTooltipForCell = function(cell) {
var text = null;
- // If cell is a block or port
- if (cell.source == null && cell.target == null) {
- if (cell.connectable) { // Cell is a port
- // @ToDo: Port Number
- text = 'Style : ' + cell.style + "\n";
- } else { //Cell is a block
- // @ToDo: Block Name, Simulation, Flip, Mirror
- // @ToDo: Number of Input, Output, Control, Command Ports
- var geometry = cell.getGeometry();
- text = 'UID : ' + cell.id + "\n" +
- 'Style : ' + cell.style + "\n" +
- 'x : ' + geometry.x + "\n" +
- 'y : ' + geometry.y + "\n" +
- 'w : ' + geometry.width + "\n" +
- 'h : ' + geometry.height + "\n";
+ if(cell.isVertex() == true && cell.isConnectable() == false) {
+ var name = cell.value.getAttribute('blockElementName');
+ var cellvar = window[name]('details');
+ // If cell is a block or port
+
+ if (cell.source == null && cell.target == null) {
+ if (cell.connectable) { // Cell is a port
+ // @ToDo: Port Number
+ text = 'Style : ' + cell.style + "\n";
+ } else { //Cell is a block
+ // @ToDo: Block Name, Simulation, Flip, Mirror
+ // @ToDo: Number of Input, Output, Control, Command Ports
+ var inputport, outputport, controlport, commandport;
+ if (cellvar.model.in.width == null)
+ inputport = 0;
+ else
+ inputport = cellvar.model.in.width;
+ if (cellvar.model.out.width == null)
+ outputport = 0;
+ else
+ outputport = cellvar.model.out.width;
+ if (cellvar.model.evtin.width == null)
+ controlport = 0;
+ else
+ controlport = cellvar.model.evtin.width;
+ if (cellvar.model.evtout.width == null)
+ commandport = 0;
+ else
+ commandport = cellvar.model.evtout.width;
+ var geometry = cell.getGeometry();
+ text = 'Block Name : ' + cell.value.getAttribute('blockElementName') + "\n" +
+ 'Simulation : ' + cell.value.getAttribute('simulationFunctionName') + "\n" +
+ 'UID : ' + cell.id + "\n" +
+ 'Style : ' + cell.style + "\n" +
+ 'Flip : ' + getData(cellvar.graphics.flip)[0] + "\n" +
+ 'Mirror : false' + "\n" +
+ 'Input Ports : ' + inputport + "\n" +
+ 'Output Ports : ' + outputport + "\n" +
+ 'Control Ports : ' + controlport + "\n" +
+ 'Command Ports : ' + commandport + "\n" +
+ 'x : ' + geometry.x + "\n" +
+ 'y : ' + geometry.y + "\n" +
+ 'w : ' + geometry.width + "\n" +
+ 'h : ' + geometry.height + "\n";
+ }
}
+ return text;
}
- return text;
+
};
// Create XML tags!