protected override void DefinedPort(IUnitPort port, UnitPortDescription description)
        {
            base.DefinedPort(port, description);

            foreach (var branch in unit.branches)
            {
                if (port == branch.Key || port == branch.Value)
                {
                    var index = int.Parse(port.key.PartAfter('_'));

                    var letter = ((char)('A' + index)).ToString();

                    description.label = letter;

                    if (port == branch.Key)
                    {
                        description.summary = $"Trigger to select the {letter} value.";
                    }
                    else if (port == branch.Value)
                    {
                        description.summary = $"The value to return if the {letter} control input is triggered.";
                    }
                }
            }
        }
Exemple #2
0
        protected virtual void DefinedPort(IUnitPort port, UnitPortDescription description)
        {
            var reflectedPortDescription = ReflectedPortDescription(port);

            if (reflectedPortDescription != null)
            {
                description.CopyFrom(reflectedPortDescription);
            }
        }
        protected override void DefinedPort(IUnitPort port, UnitPortDescription description)
        {
            base.DefinedPort(port, description);

            if (port is ControlInput && unit.awaitedInputs.Contains((ControlInput)port))
            {
                description.showLabel = false;
            }
        }
Exemple #4
0
        protected override void DefinedPort(IUnitPort port, UnitPortDescription description)
        {
            base.DefinedPort(port, description);

            if (port == unit.value)
            {
                description.summary = unit.member.info.Summary();
            }
        }
Exemple #5
0
        public void DescribePort(IUnitPort port, UnitPortDescription description)
        {
            description.getMetadata = (unitMetadata) => unitMetadata.StaticObject(port);

            // Only defined units can have specific ports
            if (state == State.Defined)
            {
                DefinedPort(port, description);
            }
        }
        protected override void DefinedPort(IUnitPort port, UnitPortDescription description)
        {
            base.DefinedPort(port, description);

            if (unit.dictionary && port == unit.currentItem)
            {
                description.label   = "Value";
                description.summary = "The value of the current item of the loop.";
            }
        }
Exemple #7
0
        protected override void DefinedPort(IUnitPort port, UnitPortDescription description)
        {
            base.DefinedPort(port, description);

            if (port is ValueOutput && unit.members.TryGetValue((ValueOutput)port, out Member member))
            {
                description.label   = member.info.HumanName();
                description.summary = member.info.Summary();
            }
        }
        protected override void DefinedPort(IUnitPort port, UnitPortDescription description)
        {
            base.DefinedPort(port, description);

            var index = unit.argumentPorts.IndexOf(port as ValueOutput);

            if (index >= 0)
            {
                description.label = "Arg. " + index;
            }
        }
        protected override void DefinedPort(IUnitPort port, UnitPortDescription description)
        {
            base.DefinedPort(port, description);

            var documentation = member.info.Documentation();

            if (port == unit.enter)
            {
                description.label   = "Invoke";
                description.summary = "The entry point to invoke the method.";

                if (member.isGettable)
                {
                    description.summary += " You can still get the return value without connecting this port.";
                }
            }
            else if (port == unit.exit)
            {
                description.summary = "The action to call once the method has been invoked.";
            }
            else if (port == unit.result)
            {
                if (member.isGettable)
                {
                    description.summary = documentation?.returns;
                }

                if (unit.supportsChaining && unit.chainable)
                {
                    description.showLabel = true;
                }
            }
            else if (port == unit.targetOutput)
            {
                if (member.isGettable)
                {
                    description.showLabel = true;
                }
            }
            else if (port is ValueInput && unit.inputParameters.ContainsValue((ValueInput)port))
            {
                var parameter = member.GetParameterInfos().Single(p => "%" + p.Name == port.key);

                description.label   = parameter.DisplayName();
                description.summary = documentation?.ParameterSummary(parameter);
            }
            else if (port is ValueOutput && unit.outputParameters.ContainsValue((ValueOutput)port))
            {
                var parameter = member.GetParameterInfos().Single(p => "&" + p.Name == port.key);

                description.label   = parameter.DisplayName();
                description.summary = documentation?.ParameterSummary(parameter);
            }
        }
        protected override void DefinedPort(IUnitPort port, UnitPortDescription description)
        {
            base.DefinedPort(port, description);

            if (port is ValueInput)
            {
                var index = unit.multiInputs.IndexOf((ValueInput)port);

                if (index >= 0)
                {
                    description.label = ((char)('A' + index)).ToString();
                }
            }
        }
        protected override void DefinedPort(IUnitPort port, UnitPortDescription description)
        {
            base.DefinedPort(port, description);

            foreach (var branch in unit.branches)
            {
                if (branch.Value == port)
                {
                    var enumValue = branch.Key;
                    description.label   = enumValue.DisplayName();
                    description.summary = $"The action to execute if the enum has the value '{enumValue}'.";
                }
            }
        }
        protected override void DefinedPort(IUnitPort port, UnitPortDescription description)
        {
            base.DefinedPort(port, description);

            if (port is ControlOutput)
            {
                var index = unit.multiOutputs.IndexOf((ControlOutput)port);

                if (index >= 0)
                {
                    description.label = index.ToString();
                }
            }
        }
        protected override void DefinedPort(IUnitPort port, UnitPortDescription description)
        {
            base.DefinedPort(port, description);

            var definition = unit.graph.validPortDefinitions.OfType <IUnitInputPortDefinition>().SingleOrDefault(d => d.key == port.key);

            if (definition != null)
            {
                description.label   = definition.Label();
                description.summary = definition.summary;

                if (definition.hideLabel)
                {
                    description.showLabel = false;
                }
            }
        }
Exemple #14
0
        protected override void DefinedPort(IUnitPort port, UnitPortDescription description)
        {
            base.DefinedPort(port, description);

            if (port == unit.assign)
            {
                description.label   = "Set";
                description.summary = "The entry point to set the value.";
            }
            else if (port == unit.assigned)
            {
                description.label   = "On Set";
                description.summary = "The action to call once the value has been set.";
            }
            else if (port == unit.output)
            {
                description.summary = unit.member.info.Summary();
            }
        }