コード例 #1
0
        public BlockSetDebugLed()
        {
            width = 100;
            height = 50;
            Capability capability = new Capability(this);
            capability.AddDataInput("State", "bool");
            capability.AddTriggerInput("");
            UpdateConnectors();

            Name = "Set Debug LED";
        }
コード例 #2
0
        public void Create()
        {
            Capabilities.Clear();
            width = 100;
            height = 50;
            ProductDataBase.Device device = ProductDataBase.GetDeviceByID(DeviceType);
            if (device != null)
            {
                Capability capability = new Capability(this);

                ProductDataBase.Device.RemoteEvent evnt = device.GetRemoteEventByID(EventID);
                if (evnt != null)
                {
                    foreach (ProductDataBase.Device.RemoteEvent.Output o in evnt.Outputs)
                    {
                        capability.AddDataOutput(o.Name, o.Type);
                    }

                    foreach (ProductDataBase.Device.RemoteEvent.Input i in evnt.Inputs)
                    {
                        if (i.Type == "void")
                            capability.AddTriggerInput(i.Name);
                        else
                            capability.AddDataInput(i.Name, i.Type);
                    }
                    if (capability.TriggerInputs.Count == 0 && (capability.TriggerInputs.Count != 0 || capability.DataOutputs.Count == 0))
                    {
                        capability.AddTriggerInput("Trigger");
                    }
                }
            }

            UpdateConnectors();
        }
コード例 #3
0
 public BlockBoolInvert()
 {
     width = 100;
     height = 50;
     Capability capability = new Capability(this);
     capability.AddDataInput("", "bool");
     capability.AddDataOutput("", "bool");
     UpdateConnectors();
     Name = "Invert";
 }
コード例 #4
0
 public BlockDelay()
 {
     width = 100;
     height = 50;
     Capability capability = new Capability(this);
     capability.AddTriggerOutput("");
     capability.AddTriggerInput("Reset");
     capability.AddDataInput("Delay", "int");
     UpdateConnectors();
 }
コード例 #5
0
 public BlockDigitalOutputSetState()
 {
     width = 100;
     height = 25;
     Capability capability = new Capability(this);
     capability.AddTriggerInput("");
     capability.AddDataInput("State", "bool");
     UpdateConnectors();
     Name = "K8055 set output";
 }
コード例 #6
0
 public BlockIfNot()
 {
     width = 100;
     height = 25;
     Capability capability = new Capability(this);
     capability.AddDataInput("Condition", "bool");
     capability.AddTriggerInput("");
     capability.AddTriggerOutput("");
     UpdateConnectors();
     Name = "If not";
 }
コード例 #7
0
 public BlockSwitchSetState()
 {
     width = 100;
     height = 25;
     Capability capability = new Capability(this);
     capability.AddTriggerInput("");
     capability.AddDataInput("State", "bool");
     UpdateConnectors();
     Name = "Set state";
 }
コード例 #8
0
 public BlockMathVariable()
 {
     width = 100;
     height = 50;
     Capability capability = new Capability(this);
     capability.AddDataInput("Value", "int");
     capability.AddDataOutput("Value", "int");
     UpdateConnectors();
 }
コード例 #9
0
        public BlockMathSubstract()
        {
            width = 100;
            height = 50;
            Name = "Substract";
            Capability capability = new Capability(this);
            capability.AddDataInput("A", "int");
            capability.AddDataInput("B", "int");
            capability.AddDataOutput("C", "int");

            UpdateConnectors();
        }
コード例 #10
0
 public BlockMathPrint()
 {
     width = 100;
     height = 25;
     Capability capability = new Capability(this);
     capability.AddTriggerInput("Invoke");
     capability.AddDataInput("Value", "int");
     UpdateConnectors();
 }
コード例 #11
0
        public BlockMathEquals()
        {
            width = 100;
            height = 50;
            Capability capability = new Capability(this);
            capability.AddDataInput("A", "int");
            capability.AddDataInput("B", "int");
            capability.AddTriggerInput("Trigger");
            capability.AddTriggerOutput("True");
            capability.AddTriggerOutput("False");

            UpdateConnectors();
        }