예제 #1
0
        private void frmChild_MouseDown(object sender, MouseEventArgs e)//鼠标点击
        {
            int    i      = 0;
            PointF MouseP = new PointF((e.X - frmMain.iLeftD) / frmMain.iWinFoucs, (e.Y - frmMain.iTopD) / frmMain.iWinFoucs);

            if (e.Button == System.Windows.Forms.MouseButtons.Left)
            {
                for (i = ListTuYuan.Count - 1; i > -1; i--)
                {
                    CBase obj = (CBase)ListTuYuan[i];
                    if (obj.ElementType == LCElementType.Ring)
                    {
                        if (obj.Selected(MouseP))
                        {
                            CStation     Sta  = frmMain.staComm.GetStaByStaName("NJ301");
                            CProtcolFINS SPLC = (CProtcolFINS)Sta;
                            if (SPLC.System[0] == 7)
                            {
                                return;
                            }

                            CRing nRing = (CRing)obj;

                            string sVar = "AV" + nRing.ShowText.PadLeft(3, '0');
                            SPLC.SendAODO(sVar, 0, "DO");
                            break;
                        }
                    }
                }
            }
        }
예제 #2
0
        public void nCon_ValueChanged(object sender, EventArgs e)//微调框数值改变
        {
            NumericUpDown nCon   = (NumericUpDown)sender;
            string        sVar   = nCon.Name;
            int           iValue = (int)nCon.Value;
            CStation      Sta    = frmMain.staComm.GetStaByStaName("NJ301");
            CProtcolFINS  SPLC   = (CProtcolFINS)Sta;

            SPLC.SendAODO(sVar, iValue, "AO");
        }