Skip to content

Commit

Permalink
Fixing Bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Huzifa1 committed Jun 17, 2024
1 parent cbd52ad commit 5502daf
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
11 changes: 6 additions & 5 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: "Channel" + 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: "Channel" + i,
text: "Channel " + i,
stroke: 1,
radius: 0,
bgColor: null,
Expand Down Expand Up @@ -308,7 +308,8 @@ FPGAShape = draw2d.shape.layout.FlexGridLayout.extend({
},

getName: function () {
return this.fpgaLabel.getText();

return "acl" + this.fpgaLabel.getText().substring(5);
},

getLabel: function () {
Expand Down Expand Up @@ -421,7 +422,7 @@ NodeShape = draw2d.shape.layout.FlexGridLayout.extend({
let prop = this.ORIENTATION_PROPERTIES[orientation];
let fpga = new FPGAShape({
"orientation": this.orientation,
"name": "FPGA" + string_acl.substring(3),
"name": "FPGA " + string_acl.substring(3),
"channelsCount": channelsCount
});

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

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

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

var nodeLabel = node.getLabel();
var nodeNum = parseInt(nodeLabel.getText().substring(4));
var nodeNum = parseInt(node.getName().substring(1));
// Update all nodes that have greater num than the node to delete.
if (num_to_delete < nodeNum) {
// n..
var newnum = nodeNum - 1;

var newname = "n";
var newname = "Node ";
if (newnum < 10) {
newname += "0";
}
Expand Down
2 changes: 1 addition & 1 deletion gui/Util.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function generate_fpgalink_output(channel) {
var parent_fpga = channel.getFPGA();
var parent_node = parent_fpga.getNode();

var channelName = "ch" + channel.getText().substring(7)
var channelName = "ch" + channel.getText().substring(8)

fpgalink = parent_node.getName() + ":" + parent_fpga.getName() + ":" + channelName;
}
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 = "Node";
var newname = "Node ";
// var numnodes = this.getFigures().getSize();
var numnodes = get_number_of_fpga_nodes(this.getFigures());

Expand Down

0 comments on commit 5502daf

Please sign in to comment.