Example #1
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();
        }
Example #2
0
 public BlockDelay()
 {
     width = 100;
     height = 50;
     Capability capability = new Capability(this);
     capability.AddTriggerOutput("");
     capability.AddTriggerInput("Reset");
     capability.AddDataInput("Delay", "int");
     UpdateConnectors();
 }
Example #3
0
        public BlockSetDebugLed()
        {
            width = 100;
            height = 50;
            Capability capability = new Capability(this);
            capability.AddDataInput("State", "bool");
            capability.AddTriggerInput("");
            UpdateConnectors();

            Name = "Set Debug LED";
        }
Example #4
0
 public BlockGenericEventInvoke()
 {
     width = 100;
     height = 50;
     Capability capability = new Capability(this);
     capability.AddTriggerInput("Trigger");
     UpdateConnectors();
     //TriggerInputs[0].X += width / 3;
 }
Example #5
0
 public BlockIfNot()
 {
     width = 100;
     height = 25;
     Capability capability = new Capability(this);
     capability.AddDataInput("Condition", "bool");
     capability.AddTriggerInput("");
     capability.AddTriggerOutput("");
     UpdateConnectors();
     Name = "If not";
 }
Example #6
0
 public BlockDigitalOutputToggleState()
 {
     width = 100;
     height = 25;
     Capability capability = new Capability(this);
     capability.AddTriggerInput("");
     UpdateConnectors();
     Name = "k8055 toggle output";
 }
Example #7
0
 public BlockEventDelay()
 {
     width = 100;
     height = 50;
     Capability capability = new Capability(this);
     capability.AddDataOutput("Running ?", "bool");
     capability.AddTriggerOutput("");
     capability.AddTriggerInput("Start");
     capability.AddTriggerInput("Abort");
     UpdateConnectors();
 }
Example #8
0
 public BlockControlSwitch()
 {
     width = 100;
     height = 100;
     Capability capability = new Capability(this);
     capability.AddTriggerOutput("");
     capability.AddTriggerInput("Toggle");
     UpdateConnectors();
     Name = "Switch";
 }
Example #9
0
 public BlockDigitalOutputSetState()
 {
     width = 100;
     height = 25;
     Capability capability = new Capability(this);
     capability.AddTriggerInput("");
     capability.AddDataInput("State", "bool");
     UpdateConnectors();
     Name = "K8055 set output";
 }
Example #10
0
 public BlockSwitchSetState()
 {
     width = 100;
     height = 25;
     Capability capability = new Capability(this);
     capability.AddTriggerInput("");
     capability.AddDataInput("State", "bool");
     UpdateConnectors();
     Name = "Set state";
 }
Example #11
0
 public BlockSpeak()
 {
     width = 100;
     height = 50;
     Capability capability = new Capability(this);
     capability.AddTriggerInput("");
     UpdateConnectors();
 }
Example #12
0
 public BlockMathPrint()
 {
     width = 100;
     height = 25;
     Capability capability = new Capability(this);
     capability.AddTriggerInput("Invoke");
     capability.AddDataInput("Value", "int");
     UpdateConnectors();
 }
Example #13
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();
        }
Example #14
0
 public BlockInvokeRemote()
 {
     width = 100;
     height = 25;
     Capability capability = new Capability(this);
     capability.AddTriggerInput("");
     UpdateConnectors();
     Name = "Invoke Remote Event";
 }