diff --git a/src/Eagle.ts b/src/Eagle.ts
index 19844f2b..f9f11021 100644
--- a/src/Eagle.ts
+++ b/src/Eagle.ts
@@ -4193,7 +4193,7 @@ export class Eagle {
if (choice === -1){
return;
}
- console.log('choice: ', choice)
+
// hide the custom text input unless the first option in the select is chosen
if (choice === 0){
newField.setParameterType(parameterType);
@@ -4202,7 +4202,6 @@ export class Eagle {
node.addField(newField);
} else {
- console.log('field: ',this.currentField().getDisplayText())
const clone : Field = this.currentField().clone();
clone.setId(Utils.generateFieldId());
clone.setParameterType(parameterType);
@@ -4276,90 +4275,6 @@ export class Eagle {
}, 100);
}
- showFieldValuePicker = (fieldIndex : number, input : boolean) : void => {
- const selectedNode = this.selectedNode();
-
- if (selectedNode === null){
- console.error("Attempt to show field picker when no node selected");
- return;
- }
-
- const selectedNodeId: NodeId = selectedNode.getId();
-
- console.log("ShowFieldValuePicker() node:", selectedNode.getName(), "fieldIndex:", fieldIndex, "input", input);
-
- // build list of nodes that are attached to this node
- const nodes : string[] = [];
- for (const edge of this.logicalGraph().getEdges()){
- // add output nodes to the list
- if (edge.getSrcNodeId() === selectedNodeId){
- const destNode : Node = this.logicalGraph().findNodeById(edge.getDestNodeId());
- const s : string = "output:" + destNode.getName() + ":" + destNode.getId();
- nodes.push(s);
- }
-
- // add input nodes to the list
- if (edge.getDestNodeId() === selectedNodeId){
- const srcNode : Node = this.logicalGraph().findNodeById(edge.getSrcNodeId());
- const s : string = "input:" + srcNode.getName() + ":" + srcNode.getId();
- nodes.push(s);
- }
- }
-
- // ask the user to choose a node
- Utils.requestUserChoice("Select node", "Choose the input or output node to connect to this parameter", nodes, 0, false, "", (completed : boolean, userChoiceIndex: number) => {
- // abort if the user aborted
- if (!completed){
- return;
- }
-
- // split the user string into input/output, name, key
- const isInput : boolean = nodes[userChoiceIndex].split(":")[0] === "input";
- const key : string = nodes[userChoiceIndex].split(":")[2];
-
- let newValue : string;
- if (isInput){
- newValue = "%i[" + key + "]";
- } else {
- newValue = "%o[" + key + "]";
- }
-
- // update the correct field
- selectedNode.getFields()[fieldIndex].setValue(newValue);
- });
- }
-
- private setNodeApplication = (title: string, message: string, callback:(node:Node) => void) : void => {
- const applications: Node[] = this.getApplications();
- const applicationNames: string[] = [];
- for (const application of applications){
- applicationNames.push(application.getName())
- }
-
- // add "None" to the application list
- applicationNames.push(Node.NO_APP_STRING);
-
- Utils.requestUserChoice(title, message, applicationNames, 0, false, "", (completed : boolean, userChoiceIndex: number) => {
- if (!completed){
- return;
- }
-
- // abort if the user picked "None"
- if (userChoiceIndex === applicationNames.length - 1){
- console.log("User selected no application");
- callback(null);
- return;
- }
-
- const application : Node = applications[userChoiceIndex];
-
- // duplicate the input application
- const newNode: Node = Utils.duplicateNode(application);
-
- callback(newNode);
- });
- }
-
getNewNodePosition = (radius: number) : {x:number, y:number, extended:boolean} => {
const MARGIN = 100; // buffer to keep new nodes away from the maxX and maxY sides of the LG display area
const navBarHeight = 84
diff --git a/src/Edge.ts b/src/Edge.ts
index d02aa4e5..827e9b9c 100644
--- a/src/Edge.ts
+++ b/src/Edge.ts
@@ -273,25 +273,25 @@ export class Edge {
}
if (sourcePortId === null){
- const issue = Errors.Fix("source port has no id", function(){Utils.fixNodeFieldIds(eagle, sourceNodeId)}, "Generate ids for ports on source node");
+ const issue = Errors.Fix("Source port has no id", function(){Utils.fixNodeFieldIds(eagle, sourceNodeId)}, "Generate ids for ports on source node");
Edge.isValidLog(edge, draggingPortMode, Errors.Validity.Impossible, issue, showNotification, showConsole, errorsWarnings);
return Errors.Validity.Impossible;
}
if (destinationPortId === null){
- const issue = Errors.Fix("destination port has no id", function(){Utils.fixNodeFieldIds(eagle, sourceNodeId)}, "Generate ids for ports on destination node");
+ const issue = Errors.Fix("Destination port has no id", function(){Utils.fixNodeFieldIds(eagle, sourceNodeId)}, "Generate ids for ports on destination node");
Edge.isValidLog(edge, draggingPortMode, Errors.Validity.Impossible, issue, showNotification, showConsole, errorsWarnings);
return Errors.Validity.Impossible;
}
if (sourcePortId === null){
- const issue = Errors.Fix("source port id is null", function(){Utils.fixNodeFieldIds(eagle, sourceNodeId)}, "Generate ids for ports on source node");
+ const issue = Errors.Fix("Source port id is null", function(){Utils.fixNodeFieldIds(eagle, sourceNodeId)}, "Generate ids for ports on source node");
Edge.isValidLog(edge, draggingPortMode, Errors.Validity.Impossible, issue, showNotification, showConsole, errorsWarnings);
return Errors.Validity.Impossible;
}
if (destinationPortId === null){
- const issue = Errors.Fix("destination port id is null", function(){Utils.fixNodeFieldIds(eagle, sourceNodeId)}, "Generate ids for ports on destination node");
+ const issue = Errors.Fix("Destination port id is null", function(){Utils.fixNodeFieldIds(eagle, sourceNodeId)}, "Generate ids for ports on destination node");
Edge.isValidLog(edge, draggingPortMode, Errors.Validity.Impossible, issue, showNotification, showConsole, errorsWarnings);
return Errors.Validity.Impossible;
}
@@ -316,12 +316,12 @@ export class Edge {
// if source node or destination node is a construct, then something is wrong, constructs should not have ports
if (sourceNode.getCategoryType() === Category.Type.Construct){
- const issue: Errors.Issue = Errors.ShowFix("Edge (" + edgeId + ") cannot have a source node (" + sourceNode.getName() + ") that is a construct", function(){Utils.showEdge(eagle, edgeId)}, function(){Utils.fixMoveEdgeToEmbeddedApplication(eagle, edgeId)}, "Move edge to embedded application");
+ const issue: Errors.Issue = Errors.ShowFix("Edge cannot have a source node (" + sourceNode.getName() + ") that is a construct", function(){Utils.showEdge(eagle, edgeId)}, function(){Utils.fixMoveEdgeToEmbeddedApplication(eagle, edgeId)}, "Move edge to embedded application");
Edge.isValidLog(edge, draggingPortMode, Errors.Validity.Error, issue, showNotification, showConsole, errorsWarnings);
}
if (destinationNode.getCategoryType() === Category.Type.Construct){
- const issue: Errors.Issue = Errors.ShowFix("Edge (" + edgeId + ") cannot have a destination node (" + destinationNode.getName() + ") that is a construct", function(){Utils.showEdge(eagle, edgeId)}, function(){Utils.fixMoveEdgeToEmbeddedApplication(eagle, edgeId)}, "Move edge to embedded application");
+ const issue: Errors.Issue = Errors.ShowFix("Edge cannot have a destination node (" + destinationNode.getName() + ") that is a construct", function(){Utils.showEdge(eagle, edgeId)}, function(){Utils.fixMoveEdgeToEmbeddedApplication(eagle, edgeId)}, "Move edge to embedded application");
Edge.isValidLog(edge, draggingPortMode, Errors.Validity.Error, issue, showNotification, showConsole, errorsWarnings);
}
@@ -330,7 +330,7 @@ export class Edge {
// this is not supported. How would a BashShellApp read data from another process?
if ((sourceNode.getCategory() === Category.Memory && destinationNode.getCategory() === Category.BashShellApp) ||
(sourceNode.getCategory() === Category.Memory && destinationNode.isGroup() && destinationNode.getInputApplication() !== undefined && destinationNode.hasInputApplication() && destinationNode.getInputApplication().getCategory() === Category.BashShellApp)){
- const issue: Errors.Issue = Errors.ShowFix("output from Memory Node cannot be input into a BashShellApp or input into a Group Node with a BashShellApp inputApplicationType", function(){Utils.showNode(eagle, sourceNode.getId())}, function(){Utils.fixNodeCategory(eagle, sourceNode, Category.File, Category.Type.Data)}, "Change data component type to File");
+ const issue: Errors.Issue = Errors.ShowFix("Output from Memory Node cannot be input into a BashShellApp or input into a Group Node with a BashShellApp inputApplicationType", function(){Utils.showNode(eagle, sourceNode.getId())}, function(){Utils.fixNodeCategory(eagle, sourceNode, Category.File, Category.Type.Data)}, "Change data component type to File");
Edge.isValidLog(edge, draggingPortMode, Errors.Validity.Error, issue, showNotification, showConsole, errorsWarnings);
}
@@ -339,7 +339,7 @@ export class Edge {
// check if source port was found
if (sourcePort === null) {
- const issue: Errors.Issue = Errors.ShowFix("Source port (" + sourcePortId + ") doesn't exist on source node (" + sourceNode.getName() + ")", function(){Utils.showEdge(eagle, edgeId)}, function(){Utils.addSourcePortToSourceNode(eagle, edgeId)}, "Add source port to source node");
+ const issue: Errors.Issue = Errors.ShowFix("Source port doesn't exist on source node (" + sourceNode.getName() + ")", function(){Utils.showEdge(eagle, edgeId)}, function(){Utils.addSourcePortToSourceNode(eagle, edgeId)}, "Add source port to source node");
Edge.isValidLog(edge, draggingPortMode, Errors.Validity.Impossible, issue, showNotification, showConsole, errorsWarnings);
impossibleEdge = true;
return Errors.Validity.Impossible;
@@ -347,7 +347,7 @@ export class Edge {
// check if destination port was found
if (destinationPort === null){
- const issue: Errors.Issue = Errors.ShowFix("Destination port (" + destinationPortId + ") doesn't exist on destination node (" + destinationNode.getName() + ")", function(){Utils.showEdge(eagle, edgeId)}, function(){Utils.addDestinationPortToDestinationNode(eagle, edgeId)}, "Add destination port to destination node");
+ const issue: Errors.Issue = Errors.ShowFix("Destination port doesn't exist on destination node (" + destinationNode.getName() + ")", function(){Utils.showEdge(eagle, edgeId)}, function(){Utils.addDestinationPortToDestinationNode(eagle, edgeId)}, "Add destination port to destination node");
Edge.isValidLog(edge, draggingPortMode, Errors.Validity.Impossible, issue, showNotification, showConsole, errorsWarnings);
impossibleEdge = true;
return Errors.Validity.Impossible;
@@ -445,22 +445,22 @@ export class Edge {
// - destNode has a 'group_start' field set to true
if (closesLoop){
if (!sourceNode.isData()){
- const x = Errors.Show("Closes Loop Edge (" + edgeId + ") does not start from a Data component.", function(){Utils.showEdge(eagle, edgeId);});
+ const x = Errors.Show("Closes Loop Edge does not start from a Data component.", function(){Utils.showEdge(eagle, edgeId);});
Edge.isValidLog(edge, draggingPortMode, Errors.Validity.Error, x, showNotification, showConsole, errorsWarnings);
}
if (!destinationNode.isApplication()){
- const x = Errors.Show("Closes Loop Edge (" + edgeId + ") does not end at an Application component.", function(){Utils.showEdge(eagle, edgeId);});
+ const x = Errors.Show("Closes Loop Edge does not end at an Application component.", function(){Utils.showEdge(eagle, edgeId);});
Edge.isValidLog(edge, draggingPortMode, Errors.Validity.Error, x, showNotification, showConsole, errorsWarnings);
}
if (!sourceNode.hasFieldWithDisplayText(Daliuge.FieldName.GROUP_END) || !Utils.asBool(sourceNode.getFieldByDisplayText(Daliuge.FieldName.GROUP_END).getValue())){
- const x = Errors.ShowFix("'Closes Loop' Edge (" + edgeId + ") start node (" + sourceNode.getName() + ") does not have 'group_end' set to true.", function(){Utils.showEdge(eagle, edgeId);}, function(){Utils.fixFieldValue(eagle, sourceNode, Daliuge.groupEndField, "true")}, "Set 'group_end' to true");
+ const x = Errors.ShowFix("'Closes Loop' Edge start node (" + sourceNode.getName() + ") does not have 'group_end' set to true.", function(){Utils.showEdge(eagle, edgeId);}, function(){Utils.fixFieldValue(eagle, sourceNode, Daliuge.groupEndField, "true")}, "Set 'group_end' to true");
Edge.isValidLog(edge, draggingPortMode, Errors.Validity.Error, x, showNotification, showConsole, errorsWarnings);
}
if (!destinationNode.hasFieldWithDisplayText(Daliuge.FieldName.GROUP_START) || !Utils.asBool(destinationNode.getFieldByDisplayText(Daliuge.FieldName.GROUP_START).getValue())){
- const x = Errors.ShowFix("'Closes Loop' Edge (" + edgeId + ") end node (" + destinationNode.getName() + ") does not have 'group_start' set to true.", function(){Utils.showEdge(eagle, edgeId);}, function(){Utils.fixFieldValue(eagle, destinationNode, Daliuge.groupStartField, "true")}, "Set 'group_start' to true");
+ const x = Errors.ShowFix("'Closes Loop' Edge end node (" + destinationNode.getName() + ") does not have 'group_start' set to true.", function(){Utils.showEdge(eagle, edgeId);}, function(){Utils.fixFieldValue(eagle, destinationNode, Daliuge.groupStartField, "true")}, "Set 'group_start' to true");
Edge.isValidLog(edge, draggingPortMode, Errors.Validity.Error, x, showNotification, showConsole, errorsWarnings);
}
}
diff --git a/src/Field.ts b/src/Field.ts
index e83aef00..246b07a0 100644
--- a/src/Field.ts
+++ b/src/Field.ts
@@ -793,7 +793,7 @@ export class Field {
// for normal nodes
if(!node.isEmbedded()){
- issue = Errors.ShowFix("Node " + node.getId() + " (" + node.getName() + ") has input port (" + field.getDisplayText() + ") whose type is not specified", function(){Utils.showField(eagle, node.getId(),field);}, function(){Utils.fixFieldType(eagle, field)}, "");
+ issue = Errors.ShowFix("Node (" + node.getName() + ") has input port (" + field.getDisplayText() + ") whose type is not specified", function(){Utils.showField(eagle, node.getId(),field);}, function(){Utils.fixFieldType(eagle, field)}, "");
}else{
// for embedded nodes
@@ -801,9 +801,9 @@ export class Field {
if(constructNode.getInputApplication() === node){
//if node is input application
- issue = Errors.ShowFix("Node " + node.getEmbedId() + " (" + constructNode.getName() + ") has input application (" + node.getName() + ") with input port (" + field.getDisplayText() + ") whose type is not specified", function(){Utils.showField(eagle, node.getId(),field);}, function(){Utils.fixFieldType(eagle, field)}, "");
+ issue = Errors.ShowFix("Node (" + constructNode.getName() + ") has input application (" + node.getName() + ") with input port (" + field.getDisplayText() + ") whose type is not specified", function(){Utils.showField(eagle, node.getId(),field);}, function(){Utils.fixFieldType(eagle, field)}, "");
}else{
- issue = Errors.ShowFix("Node " + node.getEmbedId() + " (" + constructNode.getName() + ") has output application (" + node.getName() + ") with input port (" + field.getDisplayText() + ") whose type is not specified", function(){Utils.showField(eagle, node.getId(),field);}, function(){Utils.fixFieldType(eagle, field)}, "");
+ issue = Errors.ShowFix("Node (" + constructNode.getName() + ") has output application (" + node.getName() + ") with input port (" + field.getDisplayText() + ") whose type is not specified", function(){Utils.showField(eagle, node.getId(),field);}, function(){Utils.fixFieldType(eagle, field)}, "");
}
}
field.issues().push({issue:issue,validity:Errors.Validity.Warning})
@@ -821,7 +821,7 @@ export class Field {
//for normal nodes
if(!node.isEmbedded()){
- issue = Errors.ShowFix("Node " + node.getId() + " (" + node.getName() + ") has output port (" + field.getDisplayText() + ") whose type is not specified", function(){Utils.showField(eagle, node.getId(),field);}, function(){Utils.fixFieldType(eagle, field)}, "");
+ issue = Errors.ShowFix("Node (" + node.getName() + ") has output port (" + field.getDisplayText() + ") whose type is not specified", function(){Utils.showField(eagle, node.getId(),field);}, function(){Utils.fixFieldType(eagle, field)}, "");
}else{
// for embedded nodes
@@ -829,9 +829,9 @@ export class Field {
if(constructNode.getInputApplication() === node){
//if node is input application
- issue = Errors.ShowFix("Node " + node.getEmbedId() + " (" + constructNode.getName() + ") has input application (" + node.getName() + ") with output port (" + field.getDisplayText() + ") whose type is not specified", function(){Utils.showField(eagle, node.getId(),field);}, function(){Utils.fixFieldType(eagle, field)}, "");
+ issue = Errors.ShowFix("Node (" + constructNode.getName() + ") has input application (" + node.getName() + ") with output port (" + field.getDisplayText() + ") whose type is not specified", function(){Utils.showField(eagle, node.getId(),field);}, function(){Utils.fixFieldType(eagle, field)}, "");
}else{
- issue = Errors.ShowFix("Node " + node.getEmbedId() + " (" + constructNode.getName() + ") has output application (" + node.getName() + ") with output port (" + field.getDisplayText() + ") whose type is not specified", function(){Utils.showField(eagle, node.getId(),field);}, function(){Utils.fixFieldType(eagle, field)}, "");
+ issue = Errors.ShowFix("Node (" + constructNode.getName() + ") has output application (" + node.getName() + ") with output port (" + field.getDisplayText() + ") whose type is not specified", function(){Utils.showField(eagle, node.getId(),field);}, function(){Utils.fixFieldType(eagle, field)}, "");
}
}
field.issues().push({issue:issue,validity:Errors.Validity.Warning})
@@ -842,25 +842,25 @@ export class Field {
//check that the field has an id
if (field.getId() === "" || field.getId() === null){
- const issue = Errors.ShowFix("Node " + node.getId() + " (" + node.getName() + ") has field (" + field.getDisplayText() + ") with no id", function(){Utils.showField(eagle, node.getId(),field);}, function(){Utils.fixFieldId(eagle, field)}, "Generate id for field");
+ const issue = Errors.ShowFix("Node (" + node.getName() + ") has field (" + field.getDisplayText() + ") with no id", function(){Utils.showField(eagle, node.getId(),field);}, function(){Utils.fixFieldId(eagle, field)}, "Generate id for field");
field.issues().push({issue:issue,validity:Errors.Validity.Error})
}
// check that the field has a default value
if (field.getDefaultValue() === "" && !field.isType(Daliuge.DataType.String) && !field.isType(Daliuge.DataType.Password) && !field.isType(Daliuge.DataType.Object) && !field.isType(Daliuge.DataType.Unknown)) {
- const issue: Errors.Issue = Errors.ShowFix("Node " + node.getId() + " (" + node.getName() + ") has a component parameter (" + field.getDisplayText() + ") whose default value is not specified", function(){Utils.showField(eagle, node.getId(),field)}, function(){Utils.fixFieldDefaultValue(eagle, field)}, "Generate default value for parameter");
+ const issue: Errors.Issue = Errors.ShowFix("Node (" + node.getName() + ") has a component parameter (" + field.getDisplayText() + ") whose default value is not specified", function(){Utils.showField(eagle, node.getId(),field)}, function(){Utils.fixFieldDefaultValue(eagle, field)}, "Generate default value for parameter");
field.issues().push({issue:issue,validity:Errors.Validity.Warning})
}
// check that the field has a known type
if (!Utils.validateType(field.getType())) {
- const issue: Errors.Issue = Errors.ShowFix("Node " + node.getId() + " (" + node.getName() + ") has a component parameter (" + field.getDisplayText() + ") whose type (" + field.getType() + ") is unknown", function(){Utils.showField(eagle, node.getId(),field)}, function(){Utils.fixFieldType(eagle, field)}, "Prepend existing type (" + field.getType() + ") with 'Object.'");
+ const issue: Errors.Issue = Errors.ShowFix("Node (" + node.getName() + ") has a component parameter (" + field.getDisplayText() + ") whose type (" + field.getType() + ") is unknown", function(){Utils.showField(eagle, node.getId(),field)}, function(){Utils.fixFieldType(eagle, field)}, "Prepend existing type (" + field.getType() + ") with 'Object.'");
field.issues().push({issue:issue,validity:Errors.Validity.Warning})
}
// check that the fields "key" is the same as the key of the node it belongs to
if (field.getNodeId() !== node.getId()) {
- const issue: Errors.Issue = Errors.ShowFix("Node " + node.getId() + " (" + node.getName() + ") has a field (" + field.getDisplayText() + ") whose node id (" + field.getNodeId() + ") doesn't match the node (" + node.getId() + ")", function(){Utils.showField(eagle, node.getId(),field)}, function(){Utils.fixFieldNodeId(eagle, node, field)}, "Set field node id correctly");
+ const issue: Errors.Issue = Errors.ShowFix("Node (" + node.getName() + ") has a field (" + field.getDisplayText() + ") whose node id (" + field.getNodeId() + ") doesn't match the node (" + node.getId() + ")", function(){Utils.showField(eagle, node.getId(),field)}, function(){Utils.fixFieldNodeId(eagle, node, field)}, "Set field node id correctly");
field.issues().push({issue:issue,validity:Errors.Validity.Error})
}
@@ -873,11 +873,11 @@ export class Field {
if (field.getDisplayText() === field1.getDisplayText() && field.getParameterType() === field1.getParameterType()){
if (field.getId() === field1.getId()){
- const issue: Errors.Issue = Errors.ShowFix("Node " + node.getId() + " (" + node.getName() + ") has multiple attributes with the same display text and id (" + field.getDisplayText() + ").", function(){Utils.showField(eagle, node.getId(),field);}, function(){Utils.fixNodeMergeFieldsByIndex(eagle, node, fieldIndex, j)}, "Merge fields");
+ const issue: Errors.Issue = Errors.ShowFix("Node (" + node.getName() + ") has multiple attributes with the same display text and id (" + field.getDisplayText() + ").", function(){Utils.showField(eagle, node.getId(),field);}, function(){Utils.fixNodeMergeFieldsByIndex(eagle, node, fieldIndex, j)}, "Merge fields");
field.issues().push({issue:issue,validity:Errors.Validity.Warning})
// errorsWarnings.warnings.push(issue);
} else {
- const issue: Errors.Issue = Errors.ShowFix("Node " + node.getId() + " (" + node.getName() + ") has multiple attributes with the same display text (" + field.getDisplayText() + ").", function(){Utils.showField(eagle, node.getId(),field);}, function(){Utils.fixNodeMergeFields(eagle, node, field, field1)}, "Merge fields");
+ const issue: Errors.Issue = Errors.ShowFix("Node (" + node.getName() + ") has multiple attributes with the same display text (" + field.getDisplayText() + ").", function(){Utils.showField(eagle, node.getId(),field);}, function(){Utils.fixNodeMergeFields(eagle, node, field, field1)}, "Merge fields");
field.issues().push({issue:issue,validity:Errors.Validity.Warning})
// errorsWarnings.warnings.push(issue);
}
@@ -923,7 +923,7 @@ export class Field {
}
}
- const message = "Node " + node.getId() + " (" + node.getName() + ") with category " + node.getCategory() + " contains field (" + field.getDisplayText() + ") with unsuitable type (" + field.getParameterType() + ").";
+ const message = "Node (" + node.getName() + ") with category " + node.getCategory() + " contains field (" + field.getDisplayText() + ") with unsuitable type (" + field.getParameterType() + ").";
const issue: Errors.Issue = Errors.ShowFix(message, function(){Utils.showField(eagle, node.getId(),field);}, function(){Utils.fixFieldParameterType(eagle, node, field, suitableType)}, "Switch to suitable type, or remove if no suitable type");
field.issues().push({issue:issue,validity:Errors.Validity.Warning})
}
diff --git a/src/LogicalGraph.ts b/src/LogicalGraph.ts
index 2ba64daa..5d828804 100644
--- a/src/LogicalGraph.ts
+++ b/src/LogicalGraph.ts
@@ -1025,7 +1025,7 @@ export class LogicalGraph {
if (graphNode === null){
const issue: Errors.Issue = Errors.Fix(
- "Node (" + graphConfigNode.getId() +") in graph config (" + graphConfig.getName() + ") is not present in Logical Graph",
+ "Node in graph config (" + graphConfig.getName() + ") is not present in Logical Graph",
function(){
graphConfig.removeNode(graphConfigNode);
},
@@ -1040,7 +1040,7 @@ export class LogicalGraph {
if (graphField === null){
const issue: Errors.Issue = Errors.Fix(
- "Field (" + graphConfigField.getId() + ") in graph config (" + graphConfig.getName() + ", " + graphNode.getName() + ") is not present in Logical Graph",
+ "Field in graph config (" + graphConfig.getName() + ", " + graphNode.getName() + ") is not present in Logical Graph",
function(){
graphConfigNode.removeFieldById(graphConfigField.getId());
},
diff --git a/src/Node.ts b/src/Node.ts
index f4f0abd8..4a77dade 100644
--- a/src/Node.ts
+++ b/src/Node.ts
@@ -1710,26 +1710,26 @@ export class Node {
if (!node.hasInputApplication()){
if (Setting.findValue(Setting.CREATE_APPLICATIONS_FOR_CONSTRUCT_PORTS)){
node.inputApplication(Node.createEmbeddedApplicationNode(port.getDisplayText(), Category.UnknownApplication, "", node.getId()));
- errorsWarnings.errors.push(Errors.Message("Created new embedded input application (" + node.inputApplication().getName() + ") for node (" + node.getName() + ", " + node.getId() + "). Application category is " + node.inputApplication().getCategory() + " and may require user intervention."));
+ errorsWarnings.errors.push(Errors.Message("Created new embedded input application (" + node.inputApplication().getName() + ") for node (" + node.getName() + "). Application category is " + node.inputApplication().getCategory() + " and may require user intervention."));
} else {
errorsWarnings.errors.push(Errors.Message("Cannot add input port to construct that doesn't support input ports (name:" + node.getName() + " category:" + node.getCategory() + ") port name" + port.getDisplayText() ));
return;
}
}
node.inputApplication().addField(port);
- errorsWarnings.warnings.push(Errors.Message("Moved input port (" + port.getDisplayText() + "," + port.getId().substring(0,4) + ") on construct node (" + node.getName() + ", " + node.getId() + ") to an embedded input application (" + node.inputApplication().getName() + ", " + node.inputApplication().getId() + ")"));
+ errorsWarnings.warnings.push(Errors.Message("Moved input port (" + port.getDisplayText() + "," + port.getId().substring(0,4) + ") on construct node (" + node.getName() + ") to an embedded input application (" + node.inputApplication().getName() + ", " + node.inputApplication().getId() + ")"));
} else {
if (!node.hasOutputApplication()){
if (Setting.findValue(Setting.CREATE_APPLICATIONS_FOR_CONSTRUCT_PORTS)){
node.outputApplication(Node.createEmbeddedApplicationNode(port.getDisplayText(), Category.UnknownApplication, "", node.getId()));
- errorsWarnings.errors.push(Errors.Message("Created new embedded output application (" + node.outputApplication().getName() + ") for node (" + node.getName() + ", " + node.getId() + "). Application category is " + node.outputApplication().getCategory() + " and may require user intervention."));
+ errorsWarnings.errors.push(Errors.Message("Created new embedded output application (" + node.outputApplication().getName() + ") for node (" + node.getName() + "). Application category is " + node.outputApplication().getCategory() + " and may require user intervention."));
} else {
errorsWarnings.errors.push(Errors.Message("Cannot add output port to construct that doesn't support output ports (name:" + node.getName() + " category:" + node.getCategory() + ") port name" + port.getDisplayText() ));
return;
}
}
node.outputApplication().addField(port);
- errorsWarnings.warnings.push(Errors.Message("Moved output port (" + port.getDisplayText() + "," + port.getId().substring(0,4) + ") on construct node (" + node.getName() + ", " + node.getId() + ") to an embedded output application (" + node.outputApplication().getName() + ", " + node.outputApplication().getId() + ")"));
+ errorsWarnings.warnings.push(Errors.Message("Moved output port (" + port.getDisplayText() + "," + port.getId().substring(0,4) + ") on construct node (" + node.getName() + ") to an embedded output application (" + node.outputApplication().getName() + ", " + node.outputApplication().getId() + ")"));
}
}
@@ -1933,7 +1933,7 @@ export class Node {
// check that node has modern (not legacy) category
if (node.getCategory() === Category.Component){
- const issue: Errors.Issue = Errors.ShowFix("Node " + node.getId() + " (" + node.getName() + ") has legacy category (" + node.getCategory() + ")", function(){Utils.showNode(eagle, node.getId());}, function(){Utils.fixNodeCategory(eagle, node, Category.PythonApp, Category.Type.Application)}, "");
+ const issue: Errors.Issue = Errors.ShowFix("Node (" + node.getName() + ") has legacy category (" + node.getCategory() + ")", function(){Utils.showNode(eagle, node.getId());}, function(){Utils.fixNodeCategory(eagle, node, Category.PythonApp, Category.Type.Application)}, "");
node.issues().push({issue:issue,validity:Errors.Validity.Warning})
}
@@ -1959,22 +1959,22 @@ export class Node {
const cData: Category.CategoryData = CategoryData.getCategoryData(node.getCategory());
if (node.getInputPorts().length < cData.minInputs){
- const message: string = "Node " + node.getId() + " (" + node.getName() + ") may have too few input ports. A " + node.getCategory() + " component would typically have at least " + cData.minInputs;
+ const message: string = "Node (" + node.getName() + ") may have too few input ports. A " + node.getCategory() + " component would typically have at least " + cData.minInputs;
const issue: Errors.Issue = Errors.ShowFix(message, function(){Utils.showNode(eagle, node.getId())}, null, "");
node.issues().push({issue:issue,validity:Errors.Validity.Warning})
}
if ((node.getInputPorts().length - node.getInputEventPorts().length) > cData.maxInputs){
- const message: string = "Node " + node.getId() + " (" + node.getName() + ") has too many input ports. Should have at most " + cData.maxInputs;
+ const message: string = "Node (" + node.getName() + ") has too many input ports. Should have at most " + cData.maxInputs;
const issue: Errors.Issue = Errors.ShowFix(message, function(){Utils.showNode(eagle, node.getId())}, null, "");
node.issues().push({issue:issue,validity:Errors.Validity.Warning})
}
if (node.getOutputPorts().length < cData.minOutputs){
- const message: string = "Node " + node.getId() + " (" + node.getName() + ") may have too few output ports. A " + node.getCategory() + " component would typically have at least " + cData.minOutputs;
+ const message: string = "Node (" + node.getName() + ") may have too few output ports. A " + node.getCategory() + " component would typically have at least " + cData.minOutputs;
const issue: Errors.Issue = Errors.ShowFix(message, function(){Utils.showNode(eagle, node.getId())}, null, "");
node.issues().push({issue:issue,validity:Errors.Validity.Warning})
}
if ((node.getOutputPorts().length - node.getOutputEventPorts().length) > cData.maxOutputs){
- const message: string = "Node " + node.getId() + " (" + node.getName() + ") may have too many output ports. Should have at most " + cData.maxOutputs;
+ const message: string = "Node (" + node.getName() + ") may have too many output ports. Should have at most " + cData.maxOutputs;
const issue: Errors.Issue = Errors.ShowFix(message, function(){Utils.showNode(eagle, node.getId())}, null, "");
node.issues().push({issue:issue,validity:Errors.Validity.Warning})
}
@@ -2010,23 +2010,23 @@ export class Node {
// check if a node is completely disconnected from the graph, which is sometimes an indicator of something wrong
// only check this if the component has been selected in the graph. If it was selected from the palette, it doesn't make sense to complain that it is not connected.
if (!isConnected && !(cData.maxInputs === 0 && cData.maxOutputs === 0) && selectedLocation === Eagle.FileType.Graph){
- const issue: Errors.Issue = Errors.ShowFix("Node " + node.getId() + " (" + node.getName() + ") has no connected edges. It should be connected to the graph in some way", function(){Utils.showNode(eagle, node.getId())}, null, "");
+ const issue: Errors.Issue = Errors.ShowFix("Node (" + node.getName() + ") has no connected edges. It should be connected to the graph in some way", function(){Utils.showNode(eagle, node.getId())}, null, "");
node.issues().push({issue:issue,validity:Errors.Validity.Warning})
}
// check embedded application categories are not 'None'
if (node.hasInputApplication() && node.getInputApplication().getCategory() === Category.None){
- const issue: Errors.Issue = Errors.Message("Node " + node.getId() + " (" + node.getName() + ") has input application with category 'None'.")
+ const issue: Errors.Issue = Errors.Message("Node (" + node.getName() + ") has input application with category 'None'.")
node.issues().push({issue:issue,validity:Errors.Validity.Error});
}
if (node.hasOutputApplication() && node.getOutputApplication().getCategory() === Category.None){
- const issue : Errors.Issue = Errors.Message("Node " + node.getId() + " (" + node.getName() + ") has output application with category 'None'.")
+ const issue : Errors.Issue = Errors.Message("Node (" + node.getName() + ") has output application with category 'None'.")
node.issues().push({issue:issue,validity:Errors.Validity.Error});
}
// check that Service nodes have inputApplications with no output ports!
if (node.getCategory() === Category.Service && node.hasInputApplication() && node.getInputApplication().getOutputPorts().length > 0){
- const issue : Errors.Issue = Errors.Message("Node " + node.getId() + " (" + node.getName() + ") is a Service node, but has an input application with at least one output.")
+ const issue : Errors.Issue = Errors.Message("Node (" + node.getName() + ") is a Service node, but has an input application with at least one output.")
node.issues().push({issue:issue,validity:Errors.Validity.Error});
}
@@ -2056,11 +2056,11 @@ export class Node {
// if not, create one by cloning the required field
// if so, check the attributes of the field match
if (existingField === null){
- const message = "Node " + node.getId() + " (" + node.getName() + ":" + node.category() + ":" + node.categoryType() + ") does not have the required '" + field.getDisplayText() + "' field";
+ const message = "Node (" + node.getName() + ":" + node.category() + ":" + node.categoryType() + ") does not have the required '" + field.getDisplayText() + "' field";
const issue : Errors.Issue = Errors.ShowFix(message, function(){Utils.showNode(eagle, node.getId());}, function(){Utils.addMissingRequiredField(eagle, node, field);}, "Add missing " + field.getDisplayText() + " field.")
node.issues().push({issue:issue,validity:Errors.Validity.Error});
} else if (existingField.getParameterType() !== field.getParameterType()){
- const message = "Node " + node.getId() + " (" + node.getName() + ") has a '" + field.getDisplayText() + "' field with the wrong parameter type (" + existingField.getParameterType() + "), should be a " + field.getParameterType();
+ const message = "Node (" + node.getName() + ") has a '" + field.getDisplayText() + "' field with the wrong parameter type (" + existingField.getParameterType() + "), should be a " + field.getParameterType();
const issue : Errors.Issue = Errors.ShowFix(message, function(){Utils.showField(eagle, node.getId(),existingField);}, function(){Utils.fixFieldParameterType(eagle, node, existingField, field.getParameterType())}, "Switch type of field to '" + field.getParameterType())
existingField.addError(issue,Errors.Validity.Error)
}
diff --git a/src/ParameterTable.ts b/src/ParameterTable.ts
index 7e8130c1..7183fbdf 100644
--- a/src/ParameterTable.ts
+++ b/src/ParameterTable.ts
@@ -345,17 +345,16 @@ export class ParameterTable {
}
static getErrorsWarningsAsHtml(field:Field) : string {
- let result:string = ''
+ const messages: string[] = [];
field.getErrorsWarnings().errors.forEach(function(error){
- result += error.message+'
'
+ messages.push('||| ' + error.message + ' |||')
})
field.getErrorsWarnings().warnings.forEach(function(warning){
- result += warning.message+'
'
-
+ messages.push('||| ' + warning.message + ' |||')
})
- return result
+ return messages.join('
');
}
static requestAddField(currentField: Field): void {
diff --git a/src/Utils.ts b/src/Utils.ts
index f2519024..5165ba12 100644
--- a/src/Utils.ts
+++ b/src/Utils.ts
@@ -1413,7 +1413,14 @@ export class Utils {
for (const node of palette.getNodes()){
// check existing keys
if (keys.indexOf(node.getId()) !== -1){
- errorsWarnings.errors.push(Errors.Message("Key " + node.getId() + " used by multiple components in palette."));
+ errorsWarnings.errors.push(
+ Errors.ShowFix(
+ "Node (" + node.getName() + ") within palette (" + palette.fileInfo().name + ") has id already used by at least one other component.",
+ function(){Utils.showNode(Eagle.getInstance(), node.getId())},
+ function(){node.setId(Utils.generateNodeId())},
+ "Generate new id for " + node.getName()
+ )
+ );
} else {
keys.push(node.getId());
}