Exemple #1
0
        //! \brief constructor
        public frmCommandWizardStepF(ESCommand Command)
        {
            InitializeComponent();

            m_Command = Command;

            if (null == m_Command)
            {
                cmdNext.Enabled      = false;
                rbNoResponse.Enabled = false;
                rbNoTimeout.Enabled  = false;
                rbTimeout.Enabled    = false;
                txtTimeout.Enabled   = false;
            }
            else
            {
                switch (m_Command.ResponseMode)
                {
                case BM_CMD_RT.BM_CMD_RT_NO_RESPONSE:
                    rbNoResponse.Checked = true;
                    break;

                case BM_CMD_RT.BM_CMD_RT_NO_TIME_OUT:
                    rbNoTimeout.Checked = true;
                    break;

                default:
                    rbTimeout.Checked  = true;
                    txtTimeout.Text    = m_Command.TimeOut.ToString();
                    txtTimeout.Visible = true;
                    break;
                }
            }
        }
Exemple #2
0
        //! \brief a public method for clone a command withoud events related content
        public ESCommand ContentClone()
        {
            //BatteryManageCommand newCommand = (BatteryManageCommand)this.MemberwiseClone();

            ESCommand newCommand = CopyConstruct(this.Data, this.ID);

            newCommand.ContentCopy(this);

            newCommand.CommandRemovedEvent      = null;
            newCommand.CommandWizardReportEvent = null;

            return(newCommand);
        }
        //! \brief default constructor
        public frmCommandWizardStepA()
        {
            InitializeComponent();

            if (null == m_Command)
            {
                m_Command                     = new ESCommand();
                m_Command.ID                  = null;
                m_Command.Address             = BM_CMD_ADDR.BM_CMD_ADDR_SMBUS;
                m_Command.TimeOut             = 300;
                combCommandType.SelectedIndex = 0;
            }
        }
        //! \brief constructor
        public frmCommandWizardStepC(ESCommand Command)
        {
            InitializeComponent();

            m_Command = Command;

            if (null == m_Command)
            {
                cmdNext.Enabled    = false;
                txtCommand.Enabled = false;
            }
            else
            {
                txtCommand.Text = m_Command.Command.ToString("X2");
            }
        }
        //! \brief constructor
        public frmCommandWizardStepD(ESCommand Command)
        {
            InitializeComponent();

            m_Command = Command;

            if (null == m_Command)
            {
                txtCommandBrief.Enabled = false;
                cmdNext.Enabled         = false;
            }
            else
            {
                txtCommandBrief.Text = m_Command.Description;
            }
        }
Exemple #6
0
        //! \brief constructor
        public frmCommandWizardStepGWB(ESCommand Command)
        {
            InitializeComponent();

            m_Command = Command;

            if (null == m_Command)
            {
                cmdNext.Enabled         = false;
                txtCommandBrief.Enabled = false;
            }
            else
            {
                txtCommandBrief.Text = HEXBuilder.ByteArrayToHEXString(m_Command.Data);
            }
        }
Exemple #7
0
        //! \brief constructor
        public frmCommandWizardStepB(ESCommand Command)
        {
            InitializeComponent();

            m_Command = Command;

            if (null == m_Command)
            {
                cmdNext.Enabled      = false;
                txtCommandID.Enabled = false;
            }
            else
            {
                txtCommandID.Text = m_Command.ID;
            }
        }
Exemple #8
0
        //! \brief constructor
        public frmCommandWizardStepGWW(ESCommand Command)
        {
            InitializeComponent();

            m_Command = Command;

            if (null == m_Command)
            {
                cmdNext.Enabled      = false;
                txtWriteWord.Enabled = false;
            }
            else
            {
                txtWriteWord.Text = ((ESCommandWriteWord)m_Command).DataValue.ToString("X4");
            }
        }
Exemple #9
0
        public ESCommand ContentCopy(ESCommand Command)
        {
            if (null == Command)
            {
                return(this);
            }

            this.Command        = Command.Command;
            this.AddressValue   = Command.AddressValue;
            this.SubAddress     = Command.SubAddress;
            this.TimeOut        = Command.TimeOut;
            this.IsPureListener = Command.IsPureListener;
            this.Data           = Command.Data;
            this.Description    = Command.Description;


            return(this);
        }
        //! \brief constructor
        public frmCommandEditor(ESCommand Command)
        {
            InitializeComponent();

            m_Command = Command;

            if (null == m_Command)
            {
                grbCMDEditor.Enabled = false;
            }
            else
            {
                FormInitialize(Command);
            }

            combCommandType.Enabled = false;
            txtCommandID.Enabled    = false;
        }
        private void cmdNext_Click(object sender, EventArgs e)
        {
            ESCommand tempCommand = null;

            switch (combCommandType.SelectedIndex)
            {
            case 0:                 //!< Just command
                if (m_Command.Type != BM_CMD_TYPE.BM_CMD_TYPE_NO_PARAMETER)
                {
                    tempCommand             = new ESCommand();
                    tempCommand.Address     = m_Command.Address;
                    tempCommand.Command     = m_Command.Command;
                    tempCommand.ID          = m_Command.ID;
                    tempCommand.Description = m_Command.Description;
                    tempCommand.TimeOut     = m_Command.TimeOut;
                    tempCommand.CommandWizardReportEventHandler = m_Command.CommandWizardReportEventHandler;
                    tempCommand.CommandRemovedEventHandler      = m_Command.CommandRemovedEventHandler;
                    tempCommand.IsPureListener = m_Command.IsPureListener;
                    m_Command = tempCommand;
                }
                break;

            case 1:                 //!< Write word
                if (m_Command.Type != BM_CMD_TYPE.BM_CMD_TYPE_WORD_WRITE)
                {
                    tempCommand             = new ESCommandWriteWord();
                    tempCommand.Address     = m_Command.Address;
                    tempCommand.Command     = m_Command.Command;
                    tempCommand.Data        = m_Command.Data;
                    tempCommand.ID          = m_Command.ID;
                    tempCommand.Description = m_Command.Description;
                    tempCommand.TimeOut     = m_Command.TimeOut;
                    tempCommand.CommandWizardReportEventHandler = m_Command.CommandWizardReportEventHandler;
                    tempCommand.CommandRemovedEventHandler      = m_Command.CommandRemovedEventHandler;
                    tempCommand.IsPureListener = m_Command.IsPureListener;
                    m_Command = tempCommand;
                }
                break;

            case 2:                 //!< Read word
                if (m_Command.Type != BM_CMD_TYPE.BM_CMD_TYPE_WORD_READ)
                {
                    tempCommand             = new ESCommandReadWord(m_Command.Data);
                    tempCommand.Address     = m_Command.Address;
                    tempCommand.Command     = m_Command.Command;
                    tempCommand.ID          = m_Command.ID;
                    tempCommand.Description = m_Command.Description;
                    tempCommand.TimeOut     = m_Command.TimeOut;
                    tempCommand.CommandWizardReportEventHandler = m_Command.CommandWizardReportEventHandler;
                    tempCommand.CommandRemovedEventHandler      = m_Command.CommandRemovedEventHandler;
                    tempCommand.IsPureListener = m_Command.IsPureListener;
                    m_Command = tempCommand;
                }
                break;

            case 3:                 //!< Write block
                if (m_Command.Type != BM_CMD_TYPE.BM_CMD_TYPE_BLOCK_WRITE)
                {
                    tempCommand             = new ESCommandWriteBlock();
                    tempCommand.Address     = m_Command.Address;
                    tempCommand.Command     = m_Command.Command;
                    tempCommand.Data        = m_Command.Data;
                    tempCommand.ID          = m_Command.ID;
                    tempCommand.Description = m_Command.Description;
                    tempCommand.TimeOut     = m_Command.TimeOut;
                    tempCommand.CommandWizardReportEventHandler = m_Command.CommandWizardReportEventHandler;
                    tempCommand.CommandRemovedEventHandler      = m_Command.CommandRemovedEventHandler;
                    tempCommand.IsPureListener = m_Command.IsPureListener;
                    m_Command = tempCommand;
                }
                break;

            case 4:                 //!< Read Block
                if (m_Command.Type != BM_CMD_TYPE.BM_CMD_TYPE_BLOCK_READ)
                {
                    tempCommand             = new ESCommandReadBlock(m_Command.Data);
                    tempCommand.Address     = m_Command.Address;
                    tempCommand.Command     = m_Command.Command;
                    tempCommand.ID          = m_Command.ID;
                    tempCommand.Description = m_Command.Description;
                    tempCommand.TimeOut     = m_Command.TimeOut;
                    tempCommand.CommandWizardReportEventHandler = m_Command.CommandWizardReportEventHandler;
                    tempCommand.CommandRemovedEventHandler      = m_Command.CommandRemovedEventHandler;
                    tempCommand.IsPureListener = m_Command.IsPureListener;
                    m_Command = tempCommand;
                }
                break;
            }


            frmCommandWizardStepB CommandWizard = new frmCommandWizardStepB(m_Command);

            this.Hide();
            CommandWizard.Show();
            this.Dispose();
        }
        //! \brief method for show a command wizard to initialize a specified command
        public void ShowWizard(ESCommand Command)
        {
            frmCommandWizardStepA CommandWizard = new frmCommandWizardStepA(Command);

            CommandWizard.Show();
        }
        //! \brief default constructor
        public frmCommandWizardStepH(ESCommand Command)
        {
            InitializeComponent();

            m_Command = Command;

            if (null == m_Command)
            {
                cmdFinish.Enabled     = false;
                txtCommandDetail.Text = "";
            }
            else
            {
                StringBuilder sbCommandDetail = new StringBuilder();

                //! ID
                sbCommandDetail.Append("[Command ID]\r\n");
                sbCommandDetail.Append("    = " + m_Command.ID + "\r\n\r\n");

                //! Command Type
                sbCommandDetail.Append("[Command Type]\r\n");
                switch (m_Command.Type)
                {
                case BM_CMD_TYPE.BM_CMD_TYPE_NO_PARAMETER:
                    sbCommandDetail.Append("    = NO_PARAMETER\r\n\r\n");
                    break;

                case BM_CMD_TYPE.BM_CMD_TYPE_BLOCK_READ:
                    sbCommandDetail.Append("    = READ_BLOCK\r\n\r\n");
                    break;

                case BM_CMD_TYPE.BM_CMD_TYPE_BLOCK_WRITE:
                    sbCommandDetail.Append("    = WRITE_BLOCK\r\n\r\n");
                    break;

                case BM_CMD_TYPE.BM_CMD_TYPE_WORD_READ:
                    sbCommandDetail.Append("    = READ_WORD\r\n\r\n");
                    break;

                case BM_CMD_TYPE.BM_CMD_TYPE_WORD_WRITE:
                    sbCommandDetail.Append("    = WRITE_WORD\r\n\r\n");
                    break;
                }

                //! Command
                sbCommandDetail.Append("[Command]\r\n");
                sbCommandDetail.Append("    = " + m_Command.Command.ToString("X2") + "\r\n\r\n");

                //! Brief
                sbCommandDetail.Append("[Command Brief Information]\r\n");
                sbCommandDetail.Append("    = " + m_Command.Description + "\r\n\r\n");

                //! Response type
                sbCommandDetail.Append("[Timeout Mode]\r\n");
                switch (m_Command.ResponseMode)
                {
                case BM_CMD_RT.BM_CMD_RT_NO_RESPONSE:
                    sbCommandDetail.Append("    = NO_RESPONSE\r\n\r\n");
                    break;

                case BM_CMD_RT.BM_CMD_RT_NO_TIME_OUT:
                    sbCommandDetail.Append("    = NO_TIMEOUT\r\n\r\n");
                    break;

                default:
                    sbCommandDetail.Append("    = TIME OUT SETTING:");
                    sbCommandDetail.Append(m_Command.TimeOut);
                    sbCommandDetail.Append("\r\n\r\n");
                    break;
                }

                //! Address
                sbCommandDetail.Append("[Destination Address]\r\n");
                sbCommandDetail.Append("    = ");
                switch (m_Command.Address)
                {
                case BM_CMD_ADDR.BM_CMD_ADDR_ADAPTER:
                    sbCommandDetail.Append("Adapter\r\n\r\n");
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_ALL:
                    sbCommandDetail.Append("Broadcast\r\n\r\n");
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_CHARGER:
                    sbCommandDetail.Append("Charger\r\n\r\n");
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_LCD:
                    sbCommandDetail.Append("Display ESnail.Device\r\n\r\n");
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_LOADER:
                    sbCommandDetail.Append("Electronic Loader\r\n\r\n");
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_PC:
                    sbCommandDetail.Append("PC\r\n\r\n");
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_PRN:
                    sbCommandDetail.Append("Printer\r\n\r\n");
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_SINGLE_WIRE_UART:
                    sbCommandDetail.Append("Single-wire UART\r\n\r\n");
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_SINGLE_WIRE_UART_PEC:
                    sbCommandDetail.Append("Single-wire UART with PEC\r\n\r\n");
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_SMBUS:
                    sbCommandDetail.Append("SMBus\r\n\r\n");
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_SMBUS_PEC:
                    sbCommandDetail.Append("SMBus with PEC\r\n\r\n");
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_SPI:
                    sbCommandDetail.Append("SPI\r\n\r\n");
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_SPI_PEC:
                    sbCommandDetail.Append("SPI with PEC\r\n\r\n");
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_UART:
                    sbCommandDetail.Append("UART\r\n\r\n");
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_UART_PEC:
                    sbCommandDetail.Append("UART with PEC\r\n\r\n");
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_I2C:
                    sbCommandDetail.Append("I2C\r\n\r\n");
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_I2C_PEC:
                    sbCommandDetail.Append("I2C with PEC\r\n\r\n");
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_I2C_EX:
                    sbCommandDetail.Append("Extend I2C\r\n\r\n");
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_I2C_PEC_EX:
                    sbCommandDetail.Append("Extend I2C with PEC\r\n\r\n");
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_SINGLE_WIRE_UART_EX:
                    sbCommandDetail.Append("Extend Single-wire UART\r\n\r\n");
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_SINGLE_WIRE_UART_PEC_EX:
                    sbCommandDetail.Append("Extend Single-wire UART with PEC\r\n\r\n");
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_SMBUS_EX:
                    sbCommandDetail.Append("Extend SMBus\r\n\r\n");
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_SMBUS_PEC_EX:
                    sbCommandDetail.Append("Extend SMBus with PEC\r\n\r\n");
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_SPI_EX:
                    sbCommandDetail.Append("Extend SPI\r\n\r\n");
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_SPI_PEC_EX:
                    sbCommandDetail.Append("Extend SPI with PEC\r\n\r\n");
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_UART_EX:
                    sbCommandDetail.Append("Extend UART\r\n\r\n");
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_UART_PEC_EX:
                    sbCommandDetail.Append("Extend UART with PEC\r\n\r\n");
                    break;

                default:
                    sbCommandDetail.Append("[");
                    sbCommandDetail.Append(m_Command.AddressValue.ToString("X2"));
                    sbCommandDetail.Append("]\r\n\r\n");
                    break;
                }

                //! optional sub address
                sbCommandDetail.Append("[Optional Sub-Address]\r\n");
                sbCommandDetail.Append("    = [");
                sbCommandDetail.Append(m_Command.SubAddress.ToString("X2"));
                sbCommandDetail.Append("]\r\n\r\n");

                //! Parameter
                sbCommandDetail.Append("[Parameter]\r\n");
                switch (m_Command.Type)
                {
                case BM_CMD_TYPE.BM_CMD_TYPE_NO_PARAMETER:
                    sbCommandDetail.Append("    = NO_PARAMETER\r\n\r\n");
                    break;

                case BM_CMD_TYPE.BM_CMD_TYPE_WORD_READ:
                case BM_CMD_TYPE.BM_CMD_TYPE_BLOCK_READ:
                    sbCommandDetail.Append("    = NO_INITIAL_PARAMETER\r\n\r\n");
                    break;

                case BM_CMD_TYPE.BM_CMD_TYPE_WORD_WRITE:
                    sbCommandDetail.Append("    = ");
                    sbCommandDetail.Append(((ESCommandWriteWord)m_Command).DataValue.ToString("X4"));
                    sbCommandDetail.Append("\r\n\r\n");
                    break;

                case BM_CMD_TYPE.BM_CMD_TYPE_BLOCK_WRITE:
                    sbCommandDetail.Append("    DATA LENGHT :");
                    sbCommandDetail.Append(m_Command.Data.Length.ToString());
                    sbCommandDetail.Append("\r\n");

                    System.Byte[] chDataBuffer = m_Command.Data;
                    System.Int32  nCounter     = 0;

                    while (nCounter < chDataBuffer.Length)
                    {
                        sbCommandDetail.Append("    ");
                        for (System.Int32 n = 0; n < 8; n++)
                        {
                            if (n + nCounter >= chDataBuffer.Length)
                            {
                                break;
                            }

                            sbCommandDetail.Append(chDataBuffer[n + nCounter].ToString("X2"));
                            sbCommandDetail.Append(" ");
                        }

                        sbCommandDetail.Append("         ");

                        for (System.Int32 n = 0; n < 8; n++)
                        {
                            if (n + nCounter >= chDataBuffer.Length)
                            {
                                break;
                            }

                            if ((chDataBuffer[n + nCounter] >= 0x20) && (chDataBuffer[n + nCounter] <= 0x7F))
                            {
                                sbCommandDetail.Append((char)chDataBuffer[n + nCounter]);
                            }
                            else
                            {
                                sbCommandDetail.Append('.');
                            }
                        }
                        sbCommandDetail.Append("\r\n");

                        nCounter += 8;
                    }
                    break;
                }

                txtCommandDetail.Text = sbCommandDetail.ToString();
            }
        }
        private void FormInitialize(ESCommand Command)
        {
            //! initialize command type
            ChangeCommandType(Command.Type);

            //! commmand type
            switch (Command.Type)
            {
            case BM_CMD_TYPE.BM_CMD_TYPE_NO_PARAMETER:
                combCommandType.SelectedIndex = 0;
                break;

            case BM_CMD_TYPE.BM_CMD_TYPE_WORD_WRITE:
                combCommandType.SelectedIndex = 1;
                //! command parameter
                txtWriteWord.Text = ((ESCommandWriteWord)Command).DataValue.ToString("X4");
                break;

            case BM_CMD_TYPE.BM_CMD_TYPE_WORD_READ:
                combCommandType.SelectedIndex = 2;
                break;

            case BM_CMD_TYPE.BM_CMD_TYPE_BLOCK_WRITE:
                combCommandType.SelectedIndex = 3;
                //! command parameter
                if (checkWriteBlockShowHEX.Checked)
                {
                    txtWriteBlock.Text = HEXBuilder.ByteArrayToHEXString(Command.Data);
                }
                else
                {
                    System.Byte[] chTempBuffer = Command.Data;

                    if (null != chTempBuffer)
                    {
                        //! normal string
                        StringBuilder sbTempString = new StringBuilder();

                        for (System.Int32 n = 0; n < chTempBuffer.Length; n++)
                        {
                            if ((chTempBuffer[n] >= 0x20) && (chTempBuffer[n] <= 0x7F))
                            {
                                sbTempString.Append((char)chTempBuffer[n]);
                            }
                            else
                            {
                                sbTempString.Append(".");
                            }

                            txtWriteBlock.Text = sbTempString.ToString();
                        }
                    }
                }
                break;

            case BM_CMD_TYPE.BM_CMD_TYPE_BLOCK_READ:
                combCommandType.SelectedIndex = 4;
                break;
            }

            //! command ID
            txtCommandID.Text = Command.ID;

            //! command
            txtCommand.Text = Command.Command.ToString("X2");

            //! brief
            textBrief.Text = Command.Description;

            //! timeout
            switch (Command.ResponseMode)
            {
            case BM_CMD_RT.BM_CMD_RT_NO_RESPONSE:
                combResponseType.SelectedIndex = 0;
                break;

            case BM_CMD_RT.BM_CMD_RT_NO_TIME_OUT:
                combResponseType.SelectedIndex = 1;
                break;

            default:
                combResponseType.Text = Command.TimeOut.ToString("D");
                break;
            }

            //! address
            switch (m_Command.Address)
            {
            case BM_CMD_ADDR.BM_CMD_ADDR_ADAPTER:
                combAddress.SelectedIndex = 0;
                break;

            case BM_CMD_ADDR.BM_CMD_ADDR_SMBUS:
                combAddress.SelectedIndex = 1;
                break;

            case BM_CMD_ADDR.BM_CMD_ADDR_SMBUS_PEC:
                combAddress.SelectedIndex = 2;
                break;

            case BM_CMD_ADDR.BM_CMD_ADDR_UART:
                combAddress.SelectedIndex = 3;
                break;

            case BM_CMD_ADDR.BM_CMD_ADDR_UART_PEC:
                combAddress.SelectedIndex = 4;
                break;

            case BM_CMD_ADDR.BM_CMD_ADDR_SINGLE_WIRE_UART:
                combAddress.SelectedIndex = 5;
                break;

            case BM_CMD_ADDR.BM_CMD_ADDR_SINGLE_WIRE_UART_PEC:
                combAddress.SelectedIndex = 6;
                break;

            case BM_CMD_ADDR.BM_CMD_ADDR_SPI:
                combAddress.SelectedIndex = 7;
                break;

            case BM_CMD_ADDR.BM_CMD_ADDR_SPI_PEC:
                combAddress.SelectedIndex = 8;
                break;

            case BM_CMD_ADDR.BM_CMD_ADDR_I2C:
                combAddress.SelectedIndex = 9;
                break;

            case BM_CMD_ADDR.BM_CMD_ADDR_I2C_PEC:
                combAddress.SelectedIndex = 10;
                break;

            case BM_CMD_ADDR.BM_CMD_ADDR_LOADER:
                combAddress.SelectedIndex = 11;
                break;

            case BM_CMD_ADDR.BM_CMD_ADDR_CHARGER:
                combAddress.SelectedIndex = 12;
                break;

            case BM_CMD_ADDR.BM_CMD_ADDR_LCD:
                combAddress.SelectedIndex = 13;
                break;

            case BM_CMD_ADDR.BM_CMD_ADDR_PRN:
                combAddress.SelectedIndex = 14;
                break;

            case BM_CMD_ADDR.BM_CMD_ADDR_SMBUS_EX:
                combAddress.SelectedIndex = 15;
                break;

            case BM_CMD_ADDR.BM_CMD_ADDR_SMBUS_PEC_EX:
                combAddress.SelectedIndex = 16;
                break;

            case BM_CMD_ADDR.BM_CMD_ADDR_UART_EX:
                combAddress.SelectedIndex = 17;
                break;

            case BM_CMD_ADDR.BM_CMD_ADDR_UART_PEC_EX:
                combAddress.SelectedIndex = 18;
                break;

            case BM_CMD_ADDR.BM_CMD_ADDR_SINGLE_WIRE_UART_EX:
                combAddress.SelectedIndex = 19;
                break;

            case BM_CMD_ADDR.BM_CMD_ADDR_SINGLE_WIRE_UART_PEC_EX:
                combAddress.SelectedIndex = 20;
                break;

            case BM_CMD_ADDR.BM_CMD_ADDR_SPI_EX:
                combAddress.SelectedIndex = 21;
                break;

            case BM_CMD_ADDR.BM_CMD_ADDR_SPI_PEC_EX:
                combAddress.SelectedIndex = 22;
                break;

            case BM_CMD_ADDR.BM_CMD_ADDR_I2C_EX:
                combAddress.SelectedIndex = 23;
                break;

            case BM_CMD_ADDR.BM_CMD_ADDR_I2C_PEC_EX:
                combAddress.SelectedIndex = 24;
                break;

            case BM_CMD_ADDR.BM_CMD_ADDR_ALL:
                combAddress.SelectedIndex = 25;
                break;

            default:
                combAddress.Text = m_Command.AddressValue.ToString("X2");
                break;
            }

            //! optional address
            txtSubAddress.Text = m_Command.SubAddress.ToString("X2");
        }
        //! \brief constructor
        public frmCommandWizardStepE(ESCommand Command)
        {
            InitializeComponent();

            m_Command = Command;

            if (null == m_Command)
            {
                cmdNext.Enabled            = false;
                combCommandAddress.Enabled = false;
            }
            else
            {
                switch (m_Command.Address)
                {
                case BM_CMD_ADDR.BM_CMD_ADDR_ADAPTER:
                    combCommandAddress.SelectedIndex = 0;
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_SMBUS:
                    combCommandAddress.SelectedIndex = 1;
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_SMBUS_PEC:
                    combCommandAddress.SelectedIndex = 2;
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_UART:
                    combCommandAddress.SelectedIndex = 3;
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_UART_PEC:
                    combCommandAddress.SelectedIndex = 4;
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_SINGLE_WIRE_UART:
                    combCommandAddress.SelectedIndex = 5;
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_SINGLE_WIRE_UART_PEC:
                    combCommandAddress.SelectedIndex = 6;
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_SPI:
                    combCommandAddress.SelectedIndex = 7;
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_SPI_PEC:
                    combCommandAddress.SelectedIndex = 8;
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_I2C:
                    combCommandAddress.SelectedIndex = 9;
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_I2C_PEC:
                    combCommandAddress.SelectedIndex = 10;
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_LOADER:
                    combCommandAddress.SelectedIndex = 11;
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_CHARGER:
                    combCommandAddress.SelectedIndex = 12;
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_LCD:
                    combCommandAddress.SelectedIndex = 13;
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_PRN:
                    combCommandAddress.SelectedIndex = 14;
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_SMBUS_EX:
                    combCommandAddress.SelectedIndex = 15;
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_SMBUS_PEC_EX:
                    combCommandAddress.SelectedIndex = 16;
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_UART_EX:
                    combCommandAddress.SelectedIndex = 17;
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_UART_PEC_EX:
                    combCommandAddress.SelectedIndex = 18;
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_SINGLE_WIRE_UART_EX:
                    combCommandAddress.SelectedIndex = 19;
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_SINGLE_WIRE_UART_PEC_EX:
                    combCommandAddress.SelectedIndex = 20;
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_SPI_EX:
                    combCommandAddress.SelectedIndex = 21;
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_SPI_PEC_EX:
                    combCommandAddress.SelectedIndex = 22;
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_I2C_EX:
                    combCommandAddress.SelectedIndex = 23;
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_I2C_PEC_EX:
                    combCommandAddress.SelectedIndex = 24;
                    break;

                case BM_CMD_ADDR.BM_CMD_ADDR_ALL:
                    combCommandAddress.SelectedIndex = 25;
                    break;

                default:
                    combCommandAddress.Text = m_Command.AddressValue.ToString("X2");
                    break;
                }

                txtSubAddress.Text = m_Command.SubAddress.ToString("X2");
            }
        }