Skip to content

Commit

Permalink
Added meaningful names to the shapes
Browse files Browse the repository at this point in the history
  • Loading branch information
Huzifa1 committed Jun 17, 2024
1 parent 6635839 commit 563429f
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 95 deletions.
8 changes: 4 additions & 4 deletions gui/NodeShape.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ FPGAShape = draw2d.shape.layout.FlexGridLayout.extend({
orientation = this.getOrientation();
let prop = this.ORIENTATION_PROPERTIES[orientation];
let channel = new ChannelShape({
text: "ch" + i,
text: "Channel" + i,
stroke: 0,
radius: 0,
bgColor: null,
Expand All @@ -257,7 +257,7 @@ FPGAShape = draw2d.shape.layout.FlexGridLayout.extend({
});

let channel2 = new ChannelShape({
text: "ch" + i,
text: "Channel" + i,
stroke: 1,
radius: 0,
bgColor: null,
Expand Down Expand Up @@ -421,7 +421,7 @@ NodeShape = draw2d.shape.layout.FlexGridLayout.extend({
let prop = this.ORIENTATION_PROPERTIES[orientation];
let fpga = new FPGAShape({
"orientation": this.orientation,
"name": string_acl,
"name": "FPGA" + string_acl.substring(3),
"channelsCount": channelsCount
});

Expand Down Expand Up @@ -557,7 +557,7 @@ NodeShape = draw2d.shape.layout.FlexGridLayout.extend({
},

getName: function () {
return this.nodeLabel.getText();
return "n" + this.nodeLabel.getText().substring(4);
},

getLabel: function () {
Expand Down
2 changes: 1 addition & 1 deletion gui/SelectionMenuPolicy.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ var SelectionMenuPolicy = draw2d.policy.figure.SelectionPolicy.extend({
}

var nodeLabel = node.getLabel();
var nodeNum = parseInt(nodeLabel.getText().substring(1));
var nodeNum = parseInt(nodeLabel.getText().substring(4));
// Update all nodes that have greater num than the node to delete.
if (num_to_delete < nodeNum) {
// n..
Expand Down
2 changes: 1 addition & 1 deletion gui/Toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ example.Toolbar = Class.extend({
} else {
pos_x = 20;

pos_y += 300;
pos_y += 370;
}

}
Expand Down
4 changes: 3 additions & 1 deletion gui/Util.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ function generate_fpgalink_output(channel) {
var parent_fpga = channel.getFPGA();
var parent_node = parent_fpga.getNode();

fpgalink = parent_node.getName() + ":" + parent_fpga.getName() + ":" + channel.getText();
var channelName = "ch" + channel.getText().substring(7)

fpgalink = parent_node.getName() + ":" + parent_fpga.getName() + ":" + channelName;
}

return fpgalink;
Expand Down
2 changes: 1 addition & 1 deletion gui/View.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ example.View = draw2d.Canvas.extend({
},

getNodeNameNew: function () {
var newname = "n";
var newname = "Node";
// var numnodes = this.getFigures().getSize();
var numnodes = get_number_of_fpga_nodes(this.getFigures());

Expand Down
Loading

0 comments on commit 563429f

Please sign in to comment.