forked from DynamoDS/Dynamo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into pm-publishpackage…
…-packagecontents
- Loading branch information
Showing
23 changed files
with
866 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System; | ||
using System.Collections.ObjectModel; | ||
using Dynamo.Core; | ||
using Dynamo.Properties; | ||
|
||
namespace Dynamo.Configuration | ||
{ | ||
/// <summary> | ||
/// Represents the stringified version of the nodes connections from a graph | ||
/// </summary> | ||
public class GraphChecksumItem | ||
{ | ||
public string GraphId { get; set; } | ||
|
||
public string Checksum { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
using CoreNodeModels.Properties; | ||
using Dynamo.Graph.Nodes; | ||
using Newtonsoft.Json; | ||
using ProtoCore.AST.AssociativeAST; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace CoreNodeModels.Logic | ||
{ | ||
[NodeName("Gate")] | ||
[NodeDescription(nameof(Resources.GateDescription), typeof(Resources))] | ||
[NodeCategory(BuiltinNodeCategories.LOGIC)] | ||
[NodeSearchTags(nameof(Resources.GateSearchTags), typeof(Resources))] | ||
[InPortNames(">")] | ||
[InPortTypes("object")] | ||
[InPortDescriptions(nameof(Resources.GateInPortToolTip), nameof(Resources))] | ||
[OutPortNames(">")] | ||
[OutPortTypes("object")] | ||
[OutPortDescriptions(nameof(Resources.GateOutPortToolTip), nameof(Resources))] | ||
[IsDesignScriptCompatible] | ||
public class Gate : NodeModel | ||
{ | ||
private bool value; | ||
|
||
[JsonProperty("InputValue")] | ||
public virtual bool Value | ||
{ | ||
get | ||
{ | ||
return value; | ||
} | ||
set | ||
{ | ||
if (!this.value.Equals(value)) | ||
{ | ||
this.value = value; | ||
ClearDirtyFlag(); | ||
OnNodeModified(); | ||
RaisePropertyChanged(nameof(Value)); | ||
} | ||
} | ||
} | ||
|
||
[JsonConstructor] | ||
private Gate(IEnumerable<PortModel> inPorts, IEnumerable<PortModel> outPorts) : base(inPorts, outPorts) | ||
{ | ||
ShouldDisplayPreviewCore = false; | ||
} | ||
|
||
public Gate() | ||
{ | ||
Value = false; | ||
RegisterAllPorts(); | ||
ShouldDisplayPreviewCore = false; | ||
} | ||
|
||
public override IEnumerable<AssociativeNode> BuildOutputAst(List<AssociativeNode> inputAstNodes) | ||
{ | ||
// Check that node can run | ||
if (!Value) | ||
{ | ||
return new[] | ||
{AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), AstFactory.BuildNullNode())}; | ||
} | ||
|
||
return new[] { AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), inputAstNodes[0]) }; | ||
} | ||
} | ||
} |
Oops, something went wrong.