コード例 #1
0
 public PlateFilletVertexType()
     : base(outputName)
 {
     InPorts.Clear();
     OutPorts.Clear();
     RegisterAllPorts();
 }
コード例 #2
0
 //AdvanceSteel.Nodes.Properties
 public CircleScrewBoltPattern()
     : base(outputName)
 {
     InPorts.Clear();
     OutPorts.Clear();
     RegisterAllPorts();
 }
コード例 #3
0
 public ASPropertiesIsolatedFooting()
     : base(outputName)
 {
     InPorts.Clear();
     OutPorts.Clear();
     RegisterAllPorts();
 }
コード例 #4
0
 public SlotDirection()
     : base(outputName)
 {
     InPorts.Clear();
     OutPorts.Clear();
     RegisterAllPorts();
 }
コード例 #5
0
 public ASPropertiesBeamCutPlaneFeatures()
     : base(outputName)
 {
     InPorts.Clear();
     OutPorts.Clear();
     RegisterAllPorts();
 }
コード例 #6
0
 public ASPropertiesPlatePolylineNotchFeatures()
     : base(outputName)
 {
     InPorts.Clear();
     OutPorts.Clear();
     RegisterAllPorts();
 }
コード例 #7
0
 public BodyResolution()
     : base(outputName)
 {
     InPorts.Clear();
     OutPorts.Clear();
     RegisterAllPorts();
 }
コード例 #8
0
 public HoleType()
     : base(outputName)
 {
     InPorts.Clear();
     OutPorts.Clear();
     RegisterAllPorts();
 }
コード例 #9
0
 public ASPropertiesPlateVertexFeatures()
     : base(outputName)
 {
     InPorts.Clear();
     OutPorts.Clear();
     RegisterAllPorts();
 }
コード例 #10
0
 //AdvanceSteel.Nodes.Properties
 public ASPropertiesBolts()
     : base(outputName)
 {
     InPorts.Clear();
     OutPorts.Clear();
     RegisterAllPorts();
 }
コード例 #11
0
 public WeldConnectionType()
     : base(outputName)
 {
     InPorts.Clear();
     OutPorts.Clear();
     RegisterAllPorts();
 }
コード例 #12
0
        private void inports_collectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            //The visual height of the node is bound to preferred height.
            //PreferredHeight = Math.Max(inPorts.Count * 20 + 10, outPorts.Count * 20 + 10); //spacing for inputs + title space + bottom space

            if (e.Action == NotifyCollectionChangedAction.Add)
            {
                //create a new port view model
                foreach (var item in e.NewItems)
                {
                    PortViewModel inportViewModel = SubscribePortEvents(item as PortModel);
                    InPorts.Add(inportViewModel);
                }
            }
            else if (e.Action == NotifyCollectionChangedAction.Remove)
            {
                //remove the port view model whose model item
                //is the one passed in
                foreach (var item in e.OldItems)
                {
                    PortViewModel portToRemove = UnSubscribePortEvents(InPorts.ToList().First(x => x.PortModel == item));;
                    InPorts.Remove(portToRemove);
                    portToRemove.Dispose();
                }
            }
            else if (e.Action == NotifyCollectionChangedAction.Reset)
            {
                foreach (var p in InPorts)
                {
                    UnSubscribePortEvents(p);
                    p.Dispose();
                }
                InPorts.Clear();
            }
        }
コード例 #13
0
 public BeamRefAxisType()
     : base(outputName)
 {
     InPorts.Clear();
     OutPorts.Clear();
     RegisterAllPorts();
 }
コード例 #14
0
 public ASPropertiesUnfoldedBeam()
     : base(outputName)
 {
     InPorts.Clear();
     OutPorts.Clear();
     RegisterAllPorts();
 }
コード例 #15
0
        private void UpdatePorts()
        {
            var guids = InPorts.Select(x => x.GUID).ToArray();

            InPorts.Clear();
            for (int input = 0; input < InputCount; input++)
            {
                var name = $"Port {input + 1}";
                var pm   = new PortModel(PortType.Input, this, new PortData(name, ""));
                InPorts.Add(pm);
                if (guids.Length == InputCount)
                {
                    pm.GUID = guids[input];
                }
            }

            guids = OutPorts.Select(x => x.GUID).ToArray();
            OutPorts.Clear();
            for (int output = 0; output < OutputCount; output++)
            {
                var name = $"Port {output + 1}";
                var pm   = new PortModel(PortType.Output, this, new PortData(name, ""));
                OutPorts.Add(pm);
                if (guids.Length == OutputCount)
                {
                    pm.GUID = guids[output];
                }
            }

            RegisterAllPorts();
        }
コード例 #16
0
 public ASPropertiesStraightBeam()
     : base(outputName)
 {
     InPorts.Clear();
     OutPorts.Clear();
     RegisterAllPorts();
 }
コード例 #17
0
 public AnchorOrientationType()
     : base(outputName)
 {
     InPorts.Clear();
     OutPorts.Clear();
     RegisterAllPorts();
 }
コード例 #18
0
 public ASSelectObjecTypes()
     : base(outputName)
 {
     InPorts.Clear();
     OutPorts.Clear();
     RegisterAllPorts();
 }
コード例 #19
0
        /// <summary>
        /// Initializes ports with default information when the function is unresolved.
        /// </summary>
        /// <param name="inputs">The input nodes for tis function node.</param>
        /// <param name="outputs">The output nodes for tis function node.</param>
        public void UpdatePortsForUnresolved(PortModel[] inputs, PortModel[] outputs)
        {
            InPorts.Clear();
            for (int input = 0; input < inputs.Length; input++)
            {
                InPorts.Add(new PortModel(PortType.Input, this, new PortData(inputs[input].Name, inputs[input].ToolTip)));
            }

            OutPorts.Clear();
            for (int output = 0; output < outputs.Length; output++)
            {
                OutPorts.Add(new PortModel(PortType.Output, this, new PortData(outputs[output].Name, outputs[output].ToolTip)));
            }

            RegisterAllPorts();
        }
コード例 #20
0
ファイル: DummyNode.cs プロジェクト: wynged/Dynamo
        private void UpdatePorts()
        {
            InPorts.Clear();
            for (int input = 0; input < InputCount; input++)
            {
                var name = string.Format("Port {0}", input + 1);
                InPorts.Add(new PortModel(PortType.Input, this, new PortData(name, "")));
            }

            OutPorts.Clear();
            for (int output = 0; output < OutputCount; output++)
            {
                var name = string.Format("Port {0}", output + 1);
                OutPorts.Add(new PortModel(PortType.Output, this, new PortData(name, "")));
            }

            RegisterAllPorts();
        }
コード例 #21
0
ファイル: Range.cs プロジェクト: erisonliang/Expressior
 private Range(IEnumerable <PortModel> inPorts, IEnumerable <PortModel> outPorts) : base(inPorts, outPorts)
 {
     if (inPorts.Count() == 3)
     {
         inPorts.ElementAt(0).DefaultValue = startPortDefaultValue;
         inPorts.ElementAt(1).DefaultValue = endPortDefaultValue;
         inPorts.ElementAt(2).DefaultValue = stepPortDefaultValue;
     }
     else
     {
         // If information from json does not look correct, clear the default ports and add ones with default value
         InPorts.Clear();
         InPorts.Add(new PortModel(PortType.Input, this, new PortData("start", Resources.RangePortDataStartToolTip, startPortDefaultValue)));
         InPorts.Add(new PortModel(PortType.Input, this, new PortData("end", Resources.RangePortDataEndToolTip, endPortDefaultValue)));
         InPorts.Add(new PortModel(PortType.Input, this, new PortData("step", Resources.RangePortDataStepToolTip, stepPortDefaultValue)));
     }
     if (outPorts.Count() == 0)
     {
         OutPorts.Add(new PortModel(PortType.Output, this, new PortData("seq", Resources.RangePortDataSeqToolTip)));
     }
     ArgumentLacing = LacingStrategy.Auto;
     SetNodeStateBasedOnConnectionAndDefaults();
 }
コード例 #22
0
        private void ProcessFormula()
        {
            Expression e;

            try
            {
                e = new Expression(
                    FormulaString.ToLower()
                    .Replace(" and ", "+").Replace("&&", "+")
                    .Replace(" or ", "+").Replace("||", "+"),
                    EvaluateOptions.IgnoreCase);
            }
            catch (Exception ex)
            {
                Error(ex.Message);
                return;
            }

            if (e.HasErrors())
            {
                Error(e.Error);
                return;
            }

            var parameters = new List <string>();
            var paramSet   = new HashSet <string>();

            e.EvaluateParameter += delegate(string name, ParameterArgs args)
            {
                if (!paramSet.Contains(name) && !reservedParamNames.Contains(name))
                {
                    paramSet.Add(name);
                    parameters.Add(name);
                }

                args.Result = 0;
            };

            e.EvaluateFunction += delegate(string name, FunctionArgs args)
            {
                foreach (var p in args.Parameters)
                {
                    p.Evaluate();
                }

                args.Result = 0;
            };

            try
            {
                e.Evaluate();
            }
            catch { }

            InPorts.Clear();

            foreach (var p in parameters)
            {
                InPorts.Add(new PortModel(PortType.Input, this, new PortData(p, "variable")));
            }

            ClearRuntimeError();
        }