Exemplo n.º 1
0
        /// <summary>
        /// 停止测试
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Menu_Stop_Click(object sender, EventArgs e)
        {
            //Comm.GlobalUnit.ForceVerifyStop = true;

            ProtocolView.BaseControl _Item = null;
            _Item = Panel_Data.Controls[0] as ProtocolView.BaseControl;
            _Item.StopTest();
        }
Exemplo n.º 2
0
        /// <summary>
        /// 开始测试
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Cmd_Start_Click(object sender, EventArgs e)
        {
            if (Txt_Adr.Text == "")
            {
                CLDC_DataCore.Const.GlobalUnit.g_MsgControl.OutMessage("请输入一个正确的测试表地址", false, CLDC_Comm.Enum.Cus_MessageType.提示消息);

                return;
            }
            if (txtBW.Text == "" || !CLDC_DataCore.Function.Number.IsIntNumber(txtBW.Text))
            {
                CLDC_DataCore.Const.GlobalUnit.g_MsgControl.OutMessage("请输入一个正确的测试表位表", false, CLDC_Comm.Enum.Cus_MessageType.提示消息);
                return;
            }
            if (cmbU.Text == "")
            {
                CLDC_DataCore.Const.GlobalUnit.g_MsgControl.OutMessage("请选择一个测试电压", false, CLDC_Comm.Enum.Cus_MessageType.提示消息);
                return;
            }
            float u     = float.Parse(cmbU.Text);
            int   Index = int.Parse(txtBW.Text) - 1;

            //隐藏测试面板
            CLDC_DataCore.Function.SetControl.SetVisible(Panel_Test, false);

            // Panel_Test.Visible = false;
            ProtocolView.BaseControl _Item = null;
            _Item = Panel_Data.Controls[0] as ProtocolView.BaseControl;
            if (!(_Item is ProtocolView.BaseControl))
            {
                return;
            }

            // if (_Item.EquipmentUnit == null)
            //{
            //_Item.EquipmentUnit = m_EquipUnit;
            //_Item.EquipmentUnit = m_EquipUnit;
            //}
            CLDC_DataCore.Model.DgnProtocol.DgnProtocolInfo TmpProtocol = new CLDC_DataCore.Model.DgnProtocol.DgnProtocolInfo();
            //init verifyadapter


            TmpProtocol.DllFile   = "ClAmMeterProtocol";      //这个是固定的!协议库名称
            TmpProtocol.ClassName = Cmb_ProtocolClass.Text;   //协议类名称

            _Item.TestProtocolPra = TmpProtocol;
            _Item.StartTest(Txt_Adr.Text, u, Index);

            //if (_Item is ProtocolView.DLT645)
            //{
            //    //指定多功能组件
            //    //((ProtocolView.DLT645)_Item).m_DgnControl = m_DgnControl;
            //    ((ProtocolView.DLT645)_Item).StartTest(Txt_Adr.Text);
            //}
            //if (_Item is ProtocolView.DLT6452007)
            //{
            //    ((ProtocolView.DLT6452007)_Item).StartTest(Txt_Adr.Text);
            //} if (_Item is ProtocolView.EDMIMK)
            //{
            //    ((ProtocolView.EDMIMK)_Item).StartTest(Txt_Adr.Text);
            //} if (_Item is ProtocolView.IEC1107St)
            //{
            //    ((ProtocolView.IEC1107St)_Item).StartTest(Txt_Adr.Text);
            //} if (_Item is ProtocolView.A1600)
            //{
            //    ((ProtocolView.A1600)_Item).StartTest(Txt_Adr.Text);
            //}
        }