public override string ToString() { string gcodeLineText = ""; gcodeLineText += LineNumber.ToString() + ";"; foreach (string command in Command) { gcodeLineText += command + ";"; } gcodeLineText += XPos.ToString() + SEPERATOR + YPos.ToString() + SEPERATOR + ZPos.ToString() + SEPERATOR + IPos.ToString() + SEPERATOR + JPos.ToString() + SEPERATOR + CRNumber.ToString() + SEPERATOR; foreach (ErrorGCode error in Error) { gcodeLineText += error.ToString() + SEPERATOR; } return(gcodeLineText); }
public VectorInput(PropertyInfo prop, object owner, NodeType type = NodeType.Float4, NumberInputType ntype = NumberInputType.Float) { InitializeComponent(); property = prop; propertyOwner = owner; switch (type) { case NodeType.Float2: ZPos.Visibility = Visibility.Collapsed; WPos.Visibility = Visibility.Collapsed; break; case NodeType.Float3: ZPos.Visibility = Visibility.Visible; WPos.Visibility = Visibility.Collapsed; break; case NodeType.Float4: ZPos.Visibility = Visibility.Visible; WPos.Visibility = Visibility.Visible; break; } object b = prop.GetValue(owner); if (b == null) { pc = new VectorPropertyContainer(new MVector()); } else { MVector vec = (MVector)b; pc = new VectorPropertyContainer(vec); } pc.OnUpdate += Pc_OnUpdate; var xprop = pc.GetType().GetProperty("XProp"); var yprop = pc.GetType().GetProperty("YProp"); var zprop = pc.GetType().GetProperty("ZProp"); var wprop = pc.GetType().GetProperty("WProp"); XPos.Set(ntype, pc, xprop); YPos.Set(ntype, pc, yprop); ZPos.Set(ntype, pc, zprop); WPos.Set(ntype, pc, wprop); }