예제 #1
0
 public void ActivatePanelizer(GerberPanelize act)
 {
     ActivePanelizeInstance          = act;
     saveToolStripMenuItem.Enabled   = true;
     saveAsToolStripMenuItem.Enabled = true;
     exportMergedGerbersToolStripMenuItem.Enabled = true;
 }
예제 #2
0
        private void ShowNewForm(object sender, EventArgs e)
        {
            GerberPanelize childForm = new GerberPanelize(this, TV, ID);

            childForm.MdiParent = this;
            childForm.Show();
            childForm.ZoomToFit();
            ActivePanelizeInstance = childForm;
        }
예제 #3
0
        internal void RemovePanelizer()
        {
            saveToolStripMenuItem.Enabled   = false;
            saveAsToolStripMenuItem.Enabled = false;
            exportMergedGerbersToolStripMenuItem.Enabled = false;

            ActivePanelizeInstance = null;
            TV.BuildTree(null, null);
            ID.UpdateBoxes(null);
        }
예제 #4
0
        private void GerberPanelizerParent_DragDrop(object sender, DragEventArgs e)
        {
            if (e.Data.GetDataPresent(DataFormats.FileDrop))
            {
                GerberPanelize childForm = new GerberPanelize(this, TV, ID);
                childForm.MdiParent = this;
                childForm.Show();
                childForm.ZoomToFit();
                childForm.glControl1_DragDrop(sender, e);
                ActivePanelizeInstance = childForm;
                childForm.ThePanel.MaxRectPack();
                childForm.ThePanel.BuildAutoTabs(new GerberLibrary.StandardConsoleLog());
                childForm.ZoomToFit();

                childForm.Redraw(true);
            }
        }
예제 #5
0
        private void OpenFile(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
            openFileDialog.Filter           = "Gerber Set Files (*.gerberset)|*.gerberset|All Files (*.*)|*.*";
            if (openFileDialog.ShowDialog(this) == DialogResult.OK)
            {
                string         FileName  = openFileDialog.FileName;
                GerberPanelize childForm = new GerberPanelize(this, TV, ID);
                childForm.MdiParent = this;
                childForm.Show();
                childForm.LoadFile(FileName);
                childForm.ZoomToFit();
                ActivePanelizeInstance = childForm;
            }
        }
예제 #6
0
        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;
        }
예제 #7
0
        public void BuildTree(GerberPanelize Parent, GerberLayoutSet S)
        {
            this.Visible = true;
            TargetHost   = Parent;
            if (TargetHost == null)
            {
                treeView1.Enabled = false; return;
            }
            else
            {
                treeView1.Enabled = true;
            };
            while (Gerbers.Nodes.Count > 0)
            {
                Gerbers.Nodes[0].Remove();
            }
            while (BreakTabs.Nodes.Count > 0)
            {
                BreakTabs.Nodes[0].Remove();
            }
            foreach (var a in S.LoadedOutlines)
            {
                Gerbers.Nodes.Add(new GerberFileNode(a));
            }

            foreach (var a in S.Instances)
            {
                foreach (GerberFileNode t in Gerbers.Nodes)
                {
                    if (t.pPath == a.GerberPath)
                    {
                        t.Nodes.Add(new InstanceTreeNode(a));
                    }
                }
            }


            foreach (var t in S.Tabs)
            {
                BreakTabs.Nodes.Add(new InstanceTreeNode(t));
            }

            treeView1.ExpandAll();
        }
예제 #8
0
 public Progress(GerberPanelize Parent)
 {
     InitializeComponent();
     MyPanelize = Parent;
 }