コード例 #1
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            string name = null;
            string abbDeclaration = null, kukaDeclaration = null, urDeclaration = null;
            string abbCode = null, kukaCode = null, urCode = null;

            if (!DA.GetData(0, ref name))
            {
                return;
            }
            DA.GetData(1, ref abbDeclaration);
            DA.GetData(2, ref kukaDeclaration);
            DA.GetData(3, ref urDeclaration);
            DA.GetData(4, ref abbCode);
            DA.GetData(5, ref kukaCode);
            DA.GetData(6, ref urCode);

            var command = new Robots.Commands.Custom(name);

            command.AddCommand(Manufacturers.ABB, abbCode, abbDeclaration);
            command.AddCommand(Manufacturers.KUKA, kukaCode, kukaDeclaration);
            command.AddCommand(Manufacturers.UR, urCode, urDeclaration);

            DA.SetData(0, new GH_Command(command));
        }
コード例 #2
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            string name = null;
            string manufacturerText = null;
            string code = null, declaration = null;

            if (!DA.GetData(0, ref name))
            {
                return;
            }
            if (!DA.GetData(1, ref manufacturerText))
            {
                return;
            }
            DA.GetData(2, ref code);
            DA.GetData(3, ref declaration);

            var command = new Robots.Commands.Custom(name);

            if (!Enum.TryParse <Manufacturers>(manufacturerText, out var manufacturer))
            {
                throw new ArgumentException($"Manufacturer {manufacturerText} not valid.");
            }

            command.AddCommand(manufacturer, code, declaration);
            DA.SetData(0, new GH_Command(command));
        }
コード例 #3
0
ファイル: Commands.cs プロジェクト: visose/Robots
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            string name = null;
            string abbDeclaration = null, kukaDeclaration = null, urDeclaration = null;
            string abbCode = null, kukaCode = null, urCode = null;

            if (!DA.GetData(0, ref name)) { return; }
            DA.GetData(1, ref abbDeclaration);
            DA.GetData(2, ref kukaDeclaration);
            DA.GetData(3, ref urDeclaration);
            DA.GetData(4, ref abbCode);
            DA.GetData(5, ref kukaCode);
            DA.GetData(6, ref urCode);

            var command = new Robots.Commands.Custom(name, abbDeclaration, kukaDeclaration, urDeclaration, abbCode, kukaCode, urCode);
            DA.SetData(0, new GH_Command(command));
        }