Exemplo n.º 1
0
 public GerberStatsForm(GerberProject project)
 {
     InitializeComponent();
     this.project = project;
     if (project.FileInfo.Count > 0)
     {
         fileIndex = 0;
     }
 }
Exemplo n.º 2
0
 private void Form1_Load(object sender, EventArgs e)
 {
     gerberLib     = new LibGerberVS();
     project       = gerberLib.CreateNewProject();
     renderInfo    = new RenderInformation();
     selectionInfo = new SelectionInformation();
     RenderModeComboBox.SelectedIndex = 0;
     renderMode = GerberRenderMode.TranslateToCentre;
     pcbImagePanel.BackColor = Color.Black;
     project.BackgroundColor = pcbImagePanel.BackColor;
     fullScreen = false;
     UpdateMenus();
 }
Exemplo n.º 3
0
        // Saves the device library to an XML file.
        public static void WriteProject(GerberProject project)
        {
            string projectName = project.ProjectName;
            int    count       = project.FileInfo.Count;

            XmlWriterSettings settings = new XmlWriterSettings();

            settings.Indent = true;
            settings.NewLineOnAttributes = true;

            using (XmlWriter writer = XmlWriter.Create(projectName + ".gpf", settings))
            {
                writer.WriteStartDocument();

                writer.WriteStartElement("ProjectInformation");
                writer.WriteElementString("ProjectName", project.ProjectName);
                writer.WriteElementString("CurrentIndex", project.CurrentIndex.ToString());
                writer.WriteElementString("BackgroundColor", (Convert.ToInt32(project.BackgroundColor.ToArgb())).ToString());

                writer.WriteStartElement("ProjectTransformation");

                writer.WriteElementString("ScaleX", project.UserTransform.ScaleX.ToString());
                writer.WriteElementString("ScaleY", project.UserTransform.ScaleY.ToString());
                //writer.WriteElementString("Inverted", project.UserTransform.Inverted.ToString());
                writer.WriteEndElement();

                writer.WriteStartElement("FileInformation");
                for (int i = 0; i < count; i++)
                {
                    writer.WriteElementString("FileName", project.FileInfo[i].FileName);
                    writer.WriteElementString("FilePath", project.FileInfo[i].FullPathName);
                    writer.WriteElementString("LayerColor", (Convert.ToInt32(project.FileInfo[i].Color.ToArgb())).ToString());
                    writer.WriteElementString("LayerAlpha", project.FileInfo[i].Alpha.ToString());
                    writer.WriteElementString("LayerVisible", project.FileInfo[i].IsVisible.ToString());

                    //writer.WriteEndElement();
                }

                writer.WriteEndElement();

                writer.WriteEndDocument();
                writer.Flush();
                writer.Close();
            }
        }
Exemplo n.º 4
0
 public LayerEditForm(GerberProject project)
 {
     InitializeComponent();
 }