コード例 #1
0
        private void btnWrite_Click(object sender, EventArgs e)
        {
            CommPrgForm commPrgForm = new CommPrgForm();

            commPrgForm.StartPosition = FormStartPosition.CenterParent;
            commPrgForm.IsRead        = false;

            MainForm.startAddress = int.Parse(txtStartAddr.Text, System.Globalization.NumberStyles.HexNumber);
            if (MainForm.startAddress % 32 != 0)
            {
                MessageBox.Show("Start address must be a multiple of 0x20");
                return;
            }


            MainForm.transferLength = int.Parse(txtLen.Text, System.Globalization.NumberStyles.HexNumber);
            if (MainForm.transferLength % 32 != 0)
            {
                MessageBox.Show("Length must be a multplie of 0x20");
                return;
            }

            if (MainForm.startAddress + MainForm.transferLength > MainForm.eeprom.Length)
            {
                MessageBox.Show("Start address and length settings would result in writing beyond the end of memory");
                return;
            }
            copyHexboxToEeprom();
            commPrgForm.ShowDialog();
        }
コード例 #2
0
        private void btnRead_Click(object sender, EventArgs e)
        {
            CommPrgForm commPrgForm = new CommPrgForm();

            commPrgForm.StartPosition = FormStartPosition.CenterParent;
            commPrgForm.IsRead        = true;
            MainForm.startAddress     = int.Parse(txtStartAddr.Text, System.Globalization.NumberStyles.HexNumber);
            if (MainForm.startAddress % 32 != 0)
            {
                MessageBox.Show("Start address must be a multiple of 0x20");
                return;
            }

            MainForm.transferLength = int.Parse(txtLen.Text, System.Globalization.NumberStyles.HexNumber);
            if (MainForm.transferLength == 0)
            {
                MessageBox.Show("Length cant be zero");
                return;
            }
            if (MainForm.transferLength % 32 != 0)
            {
                MessageBox.Show("Length must be a multplie of 0x20");
                return;
            }

            if (MainForm.startAddress + MainForm.transferLength > MainForm.eeprom.Length)
            {
                MessageBox.Show("Start address and length settings would result in reading beyond the end of memory");
                return;
            }
            commPrgForm.ShowDialog();
            hexBox.ByteProvider = _dbp = new FixedByteProvider(eeprom);
            _hexboxHasChanged   = false;
        }
コード例 #3
0
ファイル: MainForm.cs プロジェクト: lxa520/GD-77
        private void btnWriteCalibration_Click(object sender, EventArgs e)
        {
            hexBox.ScrollByteToTop(0x8F000);
            CommPrgForm commPrgForm = new CommPrgForm();

            commPrgForm.StartPosition = FormStartPosition.CenterParent;
            commPrgForm.IsRead        = false;
            MainForm.startAddress     = 0x80000;
            MainForm.transferLength   = 0x10000;
            copyHexboxToEeprom();
            commPrgForm.ShowDialog();
        }
コード例 #4
0
ファイル: MainForm.cs プロジェクト: lxa520/GD-77
        private void btnReadCalibration_Click(object sender, EventArgs e)
        {
            CommPrgForm commPrgForm = new CommPrgForm();

            commPrgForm.StartPosition = FormStartPosition.CenterParent;
            commPrgForm.IsRead        = true;
            MainForm.startAddress     = 0x80000;
            MainForm.transferLength   = 0x10000;
            commPrgForm.ShowDialog();
            hexBox.ByteProvider = _dbp = new FixedByteProvider(CommsBuffer);
            hexBox.ScrollByteToTop(0x8F000);
            _hexboxHasChanged = false;
        }