void UpdateInstance()
        {
            if (Initializing)
            {
                return;
            }

            if (TargetInstance == null)
            {
                return;
            }

            if (TargetInstance.SelectedInstance == null)
            {
                return;
            }

            TargetInstance.SelectedInstance.Center.X = (float)xbox.Value;
            TargetInstance.SelectedInstance.Center.Y = (float)ybox.Value;
            TargetInstance.SelectedInstance.Angle    = (float)rbox.Value;

            if (TargetInstance.SelectedInstance.GetType() == typeof(BreakTab))
            {
                BreakTab BT = TargetInstance.SelectedInstance as BreakTab;
                BT.Radius = (float)radiusbox.Value;
            }
            TargetInstance.Redraw(true);
        }
        public void UpdateBoxes(GerberPanelize newTarget)
        {
            TargetInstance = newTarget;
            this.Visible   = true;

            if (TargetInstance == null || TargetInstance.SelectedInstance == null)
            {
                panel1.Enabled = false; return;
            }
            else
            {
                panel1.Enabled = true;
            }
            newTarget.SuspendRedraw = true;
            double x   = TargetInstance.SelectedInstance.Center.X;
            double y   = TargetInstance.SelectedInstance.Center.Y;
            double r   = TargetInstance.SelectedInstance.Angle;
            double rad = 0;

            radiusbox.Enabled = false;
            Bigger.Enabled    = false;
            Smaller.Enabled   = false;

            if (TargetInstance.SelectedInstance.GetType() == typeof(BreakTab))
            {
                BreakTab BT = TargetInstance.SelectedInstance as BreakTab;
                NameLabel.Text    = "Break tab";
                Bigger.Enabled    = true;
                Smaller.Enabled   = true;
                rad               = BT.Radius;
                radiusbox.Enabled = true;
            }

            if (TargetInstance.SelectedInstance.GetType() == typeof(GerberInstance))
            {
                GerberInstance GI = TargetInstance.SelectedInstance as GerberInstance;
                NameLabel.Text = Path.GetFileName(Path.GetDirectoryName(GI.GerberPath));
            }

            xbox.Value              = (decimal)x;
            ybox.Value              = (decimal)y;
            rbox.Value              = (decimal)r;
            radiusbox.Value         = (decimal)rad;
            Initializing            = false;
            newTarget.SuspendRedraw = false;
        }
Beispiel #3
0
        void UpdateInstance()
        {
            if (Initializing)
            {
                return;
            }

            if (TargetInstance == null)
            {
                return;
            }

            if (TargetInstance.SelectedInstance == null)
            {
                return;
            }

            TargetInstance.SelectedInstance.Center.X = (float)xbox.Value;
            TargetInstance.SelectedInstance.Center.Y = (float)ybox.Value;
            TargetInstance.SelectedInstance.Angle    = (float)rbox.Value;

            if (TargetInstance.SelectedInstance.GetType() == typeof(BreakTab))
            {
                BreakTab BT = TargetInstance.SelectedInstance as BreakTab;
                BT.Radius = (float)radiusbox.Value;
            }
            else if (TargetInstance.SelectedInstance.GetType() == typeof(GerberInstance))

            {
                GerberInstance GI = TargetInstance.SelectedInstance as GerberInstance;
                GI.RebuildTransformed(TargetInstance.ThePanel.GerberOutlines[GI.GerberPath], TargetInstance.ThePanel.TheSet.ExtraTabDrillDistance);
            }

            TargetInstance.UpdateHoverControls();
            TargetInstance.Redraw(true);
        }