Exemple #1
0
        private void cmdPrevious_Click(object sender, EventArgs e)
        {
            if (null != m_Command)
            {
                if (checkWriteBlockShowHEX.Checked)
                {
                    //! hex string
                    System.Byte[] cResult = null;

                    //! hex string model
                    if (HEXBuilder.HEXStringToByteArray(txtCommandBrief.Text, ref cResult))
                    {
                        m_Command.Data = cResult;
                    }
                }
                else
                {
                    //! normal string
                    System.Byte[] BlockWriteBuffer = null;

                    if (null != txtCommandBrief.Text)
                    {
                        Char[] CharBuffer = txtCommandBrief.Text.ToCharArray();
                        BlockWriteBuffer = new System.Byte[CharBuffer.Length];

                        for (System.Int32 n = 0; n < BlockWriteBuffer.Length; n++)
                        {
                            BlockWriteBuffer[n] = (System.Byte)CharBuffer[n];
                        }

                        m_Command.Data = BlockWriteBuffer;
                    }
                    else
                    {
                        m_Command.Data = new Byte[0];
                    }
                }
            }

            frmCommandWizardStepF CommandWizard = new frmCommandWizardStepF(m_Command);

            this.Hide();
            CommandWizard.Show();
            this.Dispose();
        }
Exemple #2
0
        private void cmdPrevious_Click(object sender, EventArgs e)
        {
            if (null != m_Command)
            {
                System.UInt16[] hwResult = null;
                if (HEXBuilder.HEXStringToU16Array(txtWriteWord.Text, ref hwResult))
                {
                    //! legal input
                    ((ESCommandWriteWord)m_Command).DataValue = hwResult[0];
                }
            }

            frmCommandWizardStepF CommandWizard = new frmCommandWizardStepF(m_Command);

            this.Hide();
            CommandWizard.Show();
            this.Dispose();
        }
        private void cmdPrevious_Click(object sender, EventArgs e)
        {
            this.Hide();
            if (null != m_Command)
            {
                switch (m_Command.Type)
                {
                case BM_CMD_TYPE.BM_CMD_TYPE_NO_PARAMETER:
                case BM_CMD_TYPE.BM_CMD_TYPE_BLOCK_READ:
                case BM_CMD_TYPE.BM_CMD_TYPE_WORD_READ:
                {
                    frmCommandWizardStepF CommandWizard = new frmCommandWizardStepF(m_Command);
                    CommandWizard.Show();
                }
                break;

                case BM_CMD_TYPE.BM_CMD_TYPE_BLOCK_WRITE:
                {
                    frmCommandWizardStepGWB CommandWizard = new frmCommandWizardStepGWB(m_Command);
                    CommandWizard.Show();
                }
                break;

                case BM_CMD_TYPE.BM_CMD_TYPE_WORD_WRITE:
                {
                    frmCommandWizardStepGWW CommandWizard = new frmCommandWizardStepGWW(m_Command);
                    CommandWizard.Show();
                }
                break;
                }
            }
            else
            {
                frmCommandWizardStepA CommandWizard = new frmCommandWizardStepA(m_Command);
                CommandWizard.Show();
            }
            this.Dispose();
        }
        private void cmdNext_Click(object sender, EventArgs e)
        {
            if (null != m_Command)
            {
                if (-1 == combCommandAddress.SelectedIndex)
                {
                    System.Byte[] cResult = null;
                    if (HEXBuilder.HEXStringToByteArray(combCommandAddress.Text, ref cResult))
                    {
                        m_Command.AddressValue = cResult[0];
                    }
                }
                else
                {
                    switch (combCommandAddress.SelectedIndex)
                    {
                    case 0:                         //!< Adapter
                        m_Command.AddressValue = (Byte)BM_CMD_ADDR.BM_CMD_ADDR_ADAPTER;
                        break;

                    case 1:                         //!< SMBus
                        m_Command.AddressValue = (Byte)BM_CMD_ADDR.BM_CMD_ADDR_SMBUS;
                        break;

                    case 2:
                        m_Command.AddressValue = (Byte)BM_CMD_ADDR.BM_CMD_ADDR_SMBUS_PEC;
                        break;

                    case 3:                         //!< UART
                        m_Command.AddressValue = (Byte)BM_CMD_ADDR.BM_CMD_ADDR_UART;
                        break;

                    case 4:
                        m_Command.AddressValue = (Byte)BM_CMD_ADDR.BM_CMD_ADDR_UART_PEC;
                        break;

                    case 5:                         //!< Single wire UART
                        m_Command.AddressValue = (Byte)BM_CMD_ADDR.BM_CMD_ADDR_SINGLE_WIRE_UART;
                        break;

                    case 6:
                        m_Command.AddressValue = (Byte)BM_CMD_ADDR.BM_CMD_ADDR_SINGLE_WIRE_UART_PEC;
                        break;

                    case 7:                         //!< SPI
                        m_Command.AddressValue = (Byte)BM_CMD_ADDR.BM_CMD_ADDR_SPI;
                        break;

                    case 8:
                        m_Command.AddressValue = (Byte)BM_CMD_ADDR.BM_CMD_ADDR_SPI_PEC;
                        break;

                    case 9:                         //!< I2C
                        m_Command.AddressValue = (Byte)BM_CMD_ADDR.BM_CMD_ADDR_I2C;
                        break;

                    case 10:
                        m_Command.AddressValue = (Byte)BM_CMD_ADDR.BM_CMD_ADDR_I2C_PEC;
                        break;

                    case 11:                        //!< Loader
                        m_Command.AddressValue = (Byte)BM_CMD_ADDR.BM_CMD_ADDR_LOADER;
                        break;

                    case 12:                        //!< Charger
                        m_Command.AddressValue = (Byte)BM_CMD_ADDR.BM_CMD_ADDR_CHARGER;
                        break;

                    case 13:                        //!< printer
                        m_Command.AddressValue = (Byte)BM_CMD_ADDR.BM_CMD_ADDR_PRN;
                        break;

                    case 14:                        //!< LCD
                        m_Command.AddressValue = (Byte)BM_CMD_ADDR.BM_CMD_ADDR_LCD;
                        break;

                    case 15:                         //!< SMBus Extend
                        m_Command.AddressValue = (Byte)BM_CMD_ADDR.BM_CMD_ADDR_SMBUS_EX;
                        break;

                    case 16:
                        m_Command.AddressValue = (Byte)BM_CMD_ADDR.BM_CMD_ADDR_SMBUS_PEC_EX;
                        break;

                    case 17:                         //!< UART Extend
                        m_Command.AddressValue = (Byte)BM_CMD_ADDR.BM_CMD_ADDR_UART_EX;
                        break;

                    case 18:
                        m_Command.AddressValue = (Byte)BM_CMD_ADDR.BM_CMD_ADDR_UART_PEC_EX;
                        break;

                    case 19:                         //!< Single wire UART Extend
                        m_Command.AddressValue = (Byte)BM_CMD_ADDR.BM_CMD_ADDR_SINGLE_WIRE_UART_EX;
                        break;

                    case 20:
                        m_Command.AddressValue = (Byte)BM_CMD_ADDR.BM_CMD_ADDR_SINGLE_WIRE_UART_PEC_EX;
                        break;

                    case 21:                         //!< SPI Extend
                        m_Command.AddressValue = (Byte)BM_CMD_ADDR.BM_CMD_ADDR_SPI_EX;
                        break;

                    case 22:
                        m_Command.AddressValue = (Byte)BM_CMD_ADDR.BM_CMD_ADDR_SPI_PEC_EX;
                        break;

                    case 23:                         //!< I2C Extend
                        m_Command.AddressValue = (Byte)BM_CMD_ADDR.BM_CMD_ADDR_I2C_EX;
                        break;

                    case 24:
                        m_Command.AddressValue = (Byte)BM_CMD_ADDR.BM_CMD_ADDR_I2C_PEC_EX;
                        break;

                    case 25:                        //!< All
                        m_Command.AddressValue = (Byte)BM_CMD_ADDR.BM_CMD_ADDR_ALL;
                        break;
                    }
                }

                do
                {
                    Byte[] cResult = null;
                    if (HEXBuilder.HEXStringToByteArray(txtSubAddress.Text, ref cResult))
                    {
                        m_Command.SubAddress = cResult[0];
                    }
                    else
                    {
                        m_Command.SubAddress = 0;
                    }
                }while (false);
            }

            frmCommandWizardStepF CommandWizard = new frmCommandWizardStepF(m_Command);

            this.Hide();
            CommandWizard.Show();
            this.Dispose();
        }