public BlockBoolConstant()
 {
     width = 50;
     height = 50;
     Capability capability = new Capability(this);
     capability.AddDataOutput("Constant", "bool");
     UpdateConnectors();
 }
        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();
        }
        public void Create()
        {
            Capabilities.Clear();
            width = 100;
            height = 50;
            ProductDataBase.Device device = ProductDataBase.GetDeviceByID(DeviceType);
            if (device != null)
            {
                ProductDataBase.Device.Event evnt = device.GetEventByID(EventID);
                if (evnt != null)
                {

                    Capability capability = new Capability(this);
                    capability.AddTriggerOutput("Trigger");

                    foreach (ProductDataBase.Device.Event.Output o in evnt.Outputs)
                    {
                        capability.AddDataOutput(o.Name, o.Type);
                    }
                }
            }

            UpdateConnectors();
        }
 public BlockIntConstant()
 {
     width = 50;
     height = 50;
     Capability capability = new Capability(this);
     capability.AddDataOutput("", "int");
     UpdateConnectors();
     Name = "Constant";
 }
 public BlockBoolInvert()
 {
     width = 100;
     height = 50;
     Capability capability = new Capability(this);
     capability.AddDataInput("", "bool");
     capability.AddDataOutput("", "bool");
     UpdateConnectors();
     Name = "Invert";
 }
 public BlockEventDelay()
 {
     width = 100;
     height = 50;
     Capability capability = new Capability(this);
     capability.AddDataOutput("Running ?", "bool");
     capability.AddTriggerOutput("");
     capability.AddTriggerInput("Start");
     capability.AddTriggerInput("Abort");
     UpdateConnectors();
 }
 public BlockDigitalOutputGetState()
 {
     width = 100;
     height = 25;
     Capability capability = new Capability(this);
     capability.AddDataOutput("State", "bool");
     UpdateConnectors();
     Name = "k8055 get output";
 }
 public BlockSwitchGetState()
 {
     width = 100;
     height = 25;
     Capability capability = new Capability(this);
     capability.AddDataOutput("State", "bool");
     UpdateConnectors();
     Name = "Get state";
 }
 public BlockMathVariable()
 {
     width = 100;
     height = 50;
     Capability capability = new Capability(this);
     capability.AddDataInput("Value", "int");
     capability.AddDataOutput("Value", "int");
     UpdateConnectors();
 }
        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();
        }