コード例 #1
0
        /// <summary>
        /// 显示字符
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void bu_str_Click(object sender, EventArgs e)
        {
            iNodeAddr                 = short.Parse(this.cb_ip.Text);
            this.cb_str.ForeColor     = Color.Red;
            this.radioButton2.Checked = true;
            //this.cb_str.Enabled = false;
            if (this.cb_str.Text == string.Empty || this.cb_str.Text == "")
            {
                MessageBox.Show("请选择字符!");
                return;
            }
            string sShowData;

            radioButton2.Checked = true;
            //ShowFunColor(3);

            //if (CheckNodeAddr() == -1) return;
            //if (CheckNumeric() == -1) return;
            //if (CheckLEDInterval() == -1) return;

            sShowData = cb_str.Text /*.Trim()*/;
            if (sShowData.Length > 6)
            {
                sShowData = sShowData.Substring(0, 6);
            }
            else
            {
                sShowData = sShowData.PadLeft(6);
            }

            for (int i = 0; i < GWCount; i++)
            {
                if (iNodeAddr != 0)
                {
                    Dapapi.AB_LB_DspStr(GWID[i], iNodeAddr, sShowData, iDigitPoint, iLEDInterval);
                    Bigling(GWID[i], i);
                }

                else
                {
                    Dapapi.AB_LB_DspStr(GWID[i], -252, sShowData, iDigitPoint, iLEDInterval);
                    Dapapi.AB_LB_DspStr(GWID[i], 252, sShowData, iDigitPoint, iLEDInterval);
                }
            }
        }
コード例 #2
0
        /// <summary>
        /// 熄灭所有标签
        /// </summary>
        private void TagClear()
        {
            for (int i = 0; i < GWCount; i++)
            {
                if (Dapapi.AB_GW_Status(GWID[i]) == 7)
                {
                    Dapapi.AB_LB_DspNum(GWID[i], -252, 0, 0, -3);
                    Dapapi.AB_LB_DspNum(GWID[i], 252, 0, 0, -3);
                    Dapapi.AB_LED_Dsp(GWID[i], -252, 0, 0);
                    Dapapi.AB_LED_Dsp(GWID[i], 252, 0, 0);
                    Dapapi.AB_BUZ_On(GWID[i], -252, 0);
                    Dapapi.AB_BUZ_On(GWID[i], 252, 0);
                    Dapapi.AB_LB_DspStr(GWID[i], -252, "", 0, -3);
                    Dapapi.AB_LB_DspStr(GWID[i], 252, "", 0, -3);

                    //12-digits Alphanumerical display
                    Dapapi.AB_AHA_ClrDsp(GWID[i], -252);
                    Dapapi.AB_AHA_ClrDsp(GWID[i], 252);
                    Dapapi.AB_AHA_BUZ_On(GWID[i], -252, 0);
                    Dapapi.AB_AHA_BUZ_On(GWID[i], 252, 0);
                }
            }
        }