Beispiel #1
0
        private void btnSaveAndClose_Click(object sender, EventArgs e)
        {
            burnerPanel.FormToProj();
            project.BurnFuseBox = txtYourFusebox.Text.Trim();

            this.originalProject = this.project.CopyProperties(this.originalProject);
            this.Close();
        }
        /// <summary>
        /// close without saving
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void AvrDudeWindow_FormClosed(object sender, FormClosedEventArgs e)
        {
            burnerPanel.FormToProj();

            TryKill();
        }
Beispiel #3
0
        private void FormToProj()
        {
            burnerPanel.FormToProj();

            project.OutputDir = txtOutputPath.Text;

            string newDev = (string)dropDevices.Items[dropDevices.SelectedIndex];

            if (project.Device != newDev)
            {
                project.ShouldReloadDevice = true;
            }

            project.Device = newDev;

            if (project.ClockFreq != numClockFreq.Value)
            {
                project.ShouldReloadClock = false;
            }

            project.ClockFreq          = numClockFreq.Value;
            project.LinkerOptions      = txtLinkerOptions.Text;
            project.OtherOptions       = txtOtherOptions.Text;
            project.OtherOptionsForC   = txtCOptions.Text;
            project.OtherOptionsForCPP = txtCPPOptions.Text;
            project.OtherOptionsForS   = txtSOptions.Text;
            project.Optimization       = (string)listOptimization.Items[listOptimization.SelectedIndex];

            project.PackStructs       = chklistOptions.GetItemChecked(2);
            project.ShortEnums        = chklistOptions.GetItemChecked(3);
            project.UnsignedBitfields = chklistOptions.GetItemChecked(1);
            project.UnsignedChars     = chklistOptions.GetItemChecked(0);
            project.FunctionSections  = chklistOptions.GetItemChecked(4);
            project.DataSections      = chklistOptions.GetItemChecked(5);

            project.UseInitStack  = chkUseInitStack.Checked;
            project.InitStackAddr = Convert.ToUInt32("0x" + txtInitStackAddr.Text, 16);

            project.IncludeDirList.Clear();
            foreach (DataGridViewRow i in dgvIncPaths.Rows)
            {
                if (string.IsNullOrEmpty((string)i.Cells[0].Value) == false)
                {
                    project.IncludeDirList.Add(Program.CleanFilePath(((string)i.Cells[0].Value).Trim('"').Trim()));
                }
            }

            project.LibraryDirList.Clear();
            foreach (DataGridViewRow i in dgvLibPaths.Rows)
            {
                if (string.IsNullOrEmpty((string)i.Cells[0].Value) == false)
                {
                    project.LibraryDirList.Add(Program.CleanFilePath(((string)i.Cells[0].Value).Trim('"').Trim()));
                }
            }

            project.LinkObjList.Clear();
            project.LinkLibList.Clear();
            foreach (object i in listLinkObj.Items)
            {
                string s = (string)i;
                if (string.IsNullOrEmpty(s) == false)
                {
                    if (s.ToLowerInvariant().Trim().EndsWith(".o"))
                    {
                        project.LinkObjList.Add(Program.CleanFilePath(s).Trim('"').Trim());
                    }
                    else if (s.ToLowerInvariant().Trim().EndsWith(".a"))
                    {
                        project.LinkLibList.Add(Program.CleanFilePath(s).Trim('"').Trim());
                    }
                }
            }

            project.MemorySegList.Clear();
            foreach (DataGridViewRow i in dgvMemory.Rows)
            {
                if (string.IsNullOrEmpty((string)i.Cells[1].Value) == false)
                {
                    project.MemorySegList.Add((string)i.Cells[1].Value, new MemorySegment((string)i.Cells[0].Value, (string)i.Cells[1].Value, Convert.ToUInt32("0x" + (string)i.Cells[2].Value, 16)));
                }
            }

            project.ArduinoCoreOverride = txtArduinoCoreOverride.Text;
        }