Example #1
0
        private void cmdNext_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];
                }
                else
                {
                    MessageBox.Show
                    (
                        "Please Enter Word in legal HEX string format.",
                        "Wizard Warnning",
                        MessageBoxButtons.OK,
                        MessageBoxIcon.Warning
                    );
                    return;
                }
            }


            frmCommandWizardStepH CommandWizard = new frmCommandWizardStepH(m_Command);

            this.Hide();
            CommandWizard.Show();
            this.Dispose();
        }
Example #2
0
        private void cmdNext_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
                    {
                        MessageBox.Show
                        (
                            "Please Enter a legal HEX string.",
                            "Wizard Warnning",
                            MessageBoxButtons.OK,
                            MessageBoxIcon.Warning
                        );
                        return;
                    }
                }
                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];
                    }
                }
            }

            frmCommandWizardStepH CommandWizard = new frmCommandWizardStepH(m_Command);

            this.Hide();
            CommandWizard.Show();
            this.Dispose();
        }
Example #3
0
        private void cmdNext_Click(object sender, EventArgs e)
        {
            if (null != m_Command)
            {
                if (rbNoResponse.Checked)
                {
                    m_Command.ResponseMode = BM_CMD_RT.BM_CMD_RT_NO_RESPONSE;
                }
                else if (rbNoTimeout.Checked)
                {
                    m_Command.ResponseMode = BM_CMD_RT.BM_CMD_RT_NO_TIME_OUT;
                }
                else
                {
                    System.UInt16 hwResult = 0;
                    if (DECBuilder.DECStringToWord(txtTimeout.Text, ref hwResult))
                    {
                        m_Command.TimeOut = hwResult;
                    }
                    else
                    {
                        MessageBox.Show
                        (
                            "Please Enter a legal timeout period or select a response mode.",
                            "Wizard Warnning",
                            MessageBoxButtons.OK,
                            MessageBoxIcon.Warning
                        );
                        return;
                    }
                }

                this.Hide();
                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:
                {
                    frmCommandWizardStepH CommandWizard = new frmCommandWizardStepH(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;
                }
                this.Dispose();
            }
        }