WriteLine


Node Information
Writes the specified value and the NewLine to the output buffer.
General Information
• This node doesn't have other available options.
Visual
Visual

Ports
Text Type DataType Accepts IsList CustomAcception
WriteLine IN RUN MULTIPLE FALSE FALSE
SerialPort IN SerialPort ONE FALSE FALSE
Value IN String ONE FALSE FALSE

Source
namespace Korduene.KGraph.Nodes.IO.SerialPort
{
    [IsNode("WriteLine")]
    public class WriteLine : Node
    {
        Port run = new Port(PortType.IN, typeof(RUN), AcceptsLinks.MULTIPLE, "WriteLine");
        Port serial = new Port(PortType.IN, typeof(System.IO.Ports.SerialPort), AcceptsLinks.ONE, "SerialPort");
        Port val = new Port(PortType.IN, typeof(string), AcceptsLinks.ONE, "Value");
        public WriteLine()
        {
            Name = "WriteLine";
            NodeType = KGraph.NodeType.Method;
            AddPort(run);
            AddPort(serial);
            AddPort(val);
            Information = "Writes the specified value and the NewLine to the output buffer.";
        }
        public override string Code()
        {
            return GetValue(serial) + ".WriteLine(" + GetValue(val) + ");";
        }
        public override void UpdateResults()
        {
            if (!serial.IsConnected)
            {
                ErrorMessage = "No Serial Port is connected.";
                Status = NodeStatus.ERROR;
                return;
            }
            else
            {
                Status = NodeStatus.OK;
            }
        }
    }
}