Exemplo n.º 1
0
 private Constructor()
 {
     OutputTerminal = new NodeTerminal(NationalInstruments.CommonModel.Direction.Output, NITypes.Void, "value");
     FixedTerminals = new OwnerComponentCollection(this);
     FixedTerminals.Add(OutputTerminal);
     TypeName = QualifiedName.Empty;
     Type     = NITypes.Void;
 }
Exemplo n.º 2
0
        protected TerminateLifetime()
        {
            var immutableReferenceType = NITypes.Void.CreateImmutableReference();
            var inputTerminal          = new NodeTerminal(Direction.Input, immutableReferenceType, "inner lifetime 0");

            FixedTerminals.Add(inputTerminal);
            var outputTerminal = new NodeTerminal(Direction.Output, immutableReferenceType, "outer lifetime");

            FixedTerminals.Add(outputTerminal);
        }
Exemplo n.º 3
0
        public void UpdateTerminals(int inputTerminalCount, int outputTerminalCount)
        {
            var immutableReferenceType    = NITypes.Void.CreateImmutableReference();
            int currentInputTerminalCount = InputTerminals.Count();

            if (currentInputTerminalCount < inputTerminalCount)
            {
                for (; currentInputTerminalCount < inputTerminalCount; ++currentInputTerminalCount)
                {
                    var inputTerminal = new NodeTerminal(Direction.Input, immutableReferenceType, "nested scope");
                    InsertComponent(currentInputTerminalCount, inputTerminal);
                }
            }
            else if (currentInputTerminalCount > inputTerminalCount)
            {
                int i = currentInputTerminalCount - 1;
                while (i >= 0 && currentInputTerminalCount > inputTerminalCount)
                {
                    Terminal inputTerminal = InputTerminals.ElementAt(i);
                    if (!inputTerminal.Connected)
                    {
                        RemoveComponent(inputTerminal);
                        --currentInputTerminalCount;
                    }
                    --i;
                }
            }

            int currentOutputTerminalCount = OutputTerminals.Count();

            if (currentOutputTerminalCount < outputTerminalCount)
            {
                for (; currentOutputTerminalCount < outputTerminalCount; ++currentOutputTerminalCount)
                {
                    var outputTerminal = new NodeTerminal(Direction.Output, immutableReferenceType, "outer scope");
                    InsertComponent(currentInputTerminalCount + currentOutputTerminalCount, outputTerminal);
                }
            }
            else if (currentOutputTerminalCount > outputTerminalCount)
            {
                int i = currentOutputTerminalCount - 1;
                while (i >= 0 && currentOutputTerminalCount > outputTerminalCount)
                {
                    Terminal outputTerminal = OutputTerminals.ElementAt(i);
                    if (!outputTerminal.Connected)
                    {
                        RemoveComponent(outputTerminal);
                        --currentOutputTerminalCount;
                    }
                    --i;
                }
            }

            SetIconViewGeometry();
        }
            private void CreateTerminals(MethodCall methodCall, FunctionSignatureCache signatureCache)
            {
                var cachedParameters = signatureCache?.CachedParameters;

                if (cachedParameters != null)
                {
                    foreach (var cachedParameter in cachedParameters)
                    {
                        var direction = PFTypes.ParameterCallDirectionToDirection(cachedParameter.CallDirection);
                        var terminal  = new NodeTerminal(
                            direction,
                            cachedParameter.DataType,
                            cachedParameter.SideIndex.ToString(),
                            cachedParameter.Hotspot);
                        methodCall.AddTerminal(terminal);
                    }
                }
            }
Exemplo n.º 5
0
 public void VisitNodeTerminal(NodeTerminal nodeTerminal)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 6
0
 protected StructFieldAccessor()
 {
     StructInputTerminal = new NodeTerminal(Direction.Input, NITypes.Void, "valueRef", TerminalHotspots.Input1);
     StructType          = NITypes.Void;
 }
Exemplo n.º 7
0
 public StructFieldAccessorTerminalViewModel(NodeTerminal terminal)
     : base(terminal)
 {
 }