Пример #1
0
        public SExpression GetSExpression()
        {
            SExpression result = new SExpression();

            result.Name  = "pad";
            result.Items = new List <SNodeBase>();
            result.Items.Add(new SNodeAtom(number));
            result.Items.Add(new SNodeAtom(type));
            result.Items.Add(new SNodeAtom(shape));

            result.Items.Add(position.GetSExpression());

            result.Items.Add(new SExpression("size", new List <SNodeBase> {
                new SNodeAtom(size.Width),
                new SNodeAtom(size.Height)
            }));

            if (drill != null)
            {
                result.Items.Add(drill.GetSExpression());
            }

            if (_layers != null)
            {
                result.Items.Add(_layers.GetSExpression());
            }

            if (net != null)
            {
                result.Items.Add(net.GetSExpression());
            }

            //todo:
            //public float die_length;
            //public float solder_paste_margin;
            //public int solder_paste_ratio;
            //public float thermal_width;
            //public float thermal_gap;

            if (zone_connect != 0)
            {
                result.Items.Add(new SExpression("zone_connect", zone_connect));
            }

            if (solder_mask_margin != 0)
            {
                result.Items.Add(new SExpression("solder_mask_margin", solder_mask_margin));
            }

            if (clearance != 0)
            {
                result.Items.Add(new SExpression("clearance", clearance));
            }

            return(result);
        }