Пример #1
0
 public CompileConfig(int rAM, int flash, int eEPROM, HASMMachineBannedFeatures bannedFeatures, List <Define> defines)
 {
     RAM            = rAM;
     Flash          = flash;
     EEPROM         = eEPROM;
     BannedFeatures = bannedFeatures;
     Defines        = defines;
 }
Пример #2
0
        private void button_ok_Click(object sender, EventArgs e)
        {
            config.IncludePaths = new List <string>();
            config.IncludePaths.AddRange(richTextBox_incPath.Text.Split('\n'));

            config.EEPROM             = int.Parse(textBox_eeprom.Text);
            config.Flash              = int.Parse(textBox_flash.Text);
            config.RAM                = int.Parse(textBox_ram.Text);
            config.RegisterNameFormat = textBox_registerNameFormat.Text;
            config.RegisterCount      = int.Parse(textBox_registerCount.Text);
            config.Base               = int.Parse(comboBox_base.Text);

            HASMMachineBannedFeatures bf = 0;

            foreach (var a in checkedListBox_bf.Items)
            {
                string name = (string)a;
                if (checkedListBox_bf.CheckedItems.Contains(a))
                {
                    bf |= (HASMMachineBannedFeatures)Enum.Parse(typeof(HASMMachineBannedFeatures), name);
                }
            }

            List <Define> defines = new List <Define>();

            foreach (DataGridViewRow row in dataGridView1.Rows)
            {
                string name  = (string)row.Cells[0].Value;
                string value = (string)row.Cells[1].Value;
                defines.Add(new Define(name, value));
            }

            config.BannedFeatures = bf;
            config.Defines        = defines;

            CompileConfig.ToFile(config.FileName, config);
            DialogResult = DialogResult.OK;
            Close();
        }