Example #1
0
        private void frmC机械手_MouseDown(object sender, MouseEventArgs e)
        {
            int    i      = 0;
            PointF MouseP = new PointF(e.X, e.Y);;

            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))
                        {
                            CRing nRing = (CRing)obj;

                            string       sVar = "AV" + nRing.ShowText.PadLeft(3, '0');
                            CStation     Sta  = frmMain.staComm.GetStaByStaName("NJ301");
                            CProtcolFINS SPLC = (CProtcolFINS)Sta;
                            SPLC.SendAODO(sVar, 0, "DO");
                            break;
                        }
                    }
                }
            }
        }
Example #2
0
        public frmC机械手(Form _Owner, int iTop)
        {
            InitializeComponent();

            this.MdiParent = _Owner;
            cForm.iTop     = iTop;
            LoadWins();
            this.Top = (int)cForm.m_Location.Y + cForm.iTop;

            CMach.MachByStation(40);
            this.DoubleBuffered = true;

            CStation Sta = frmMain.staComm.GetStaByStaName("NJ301");

            SPLC  = (CProtcolFINS)Sta;
            DI074 = frmMain.staComm.GetVarByStaNameVarName("NJ301", "DI074");
            DI075 = frmMain.staComm.GetVarByStaNameVarName("NJ301", "DI075");
            DI076 = frmMain.staComm.GetVarByStaNameVarName("NJ301", "DI076");
            DI110 = frmMain.staComm.GetVarByStaNameVarName("NJ301", "DI110");
            DI111 = frmMain.staComm.GetVarByStaNameVarName("NJ301", "DI111");

            //启动端口数据收发线程
            CTran.Setting = CMach.Setting;
            CTran.fm      = this;
            CTran.Open();
            TPortThread              = new Thread(new ThreadStart(CTPortThread));
            TPortThread.Name         = "TPortThread";
            TPortThread.IsBackground = true;
            TPortThread.Start();
            splitContainer2.Visible = false;
        }
Example #3
0
        private void frm设置_Load(object sender, EventArgs e)
        {
            CStation Sta = frmMain.staComm.GetStaByStaName("NJ301");

            SPLC = (CProtcolFINS)Sta;
            //SPLC.SendReadIdle();

            LoadXML();
            FillGrid();
        }
Example #4
0
        public frmC生长室维护(Form _Owner, int iTop)
        {
            InitializeComponent();
            CStation Sta = frmMain.staComm.GetStaByStaName("NJ301");

            SPLC = (CProtcolFINS)Sta;

            this.MdiParent = _Owner;
            LoadWins();
            LoadFromPLC();
            button1.Visible = false;
            this.Top        = (int)cForm.m_Location.Y + iTop;

            this.DoubleBuffered = true;
        }
Example #5
0
        public frmC温度控制(Form _Owner, int iTop)
        {
            InitializeComponent();

            this.MdiParent      = _Owner;
            this.DoubleBuffered = true;

            this.Top = iTop;
            CStation Sta = frmMain.staComm.GetStaByStaName("NJ301");

            SPLC = (CProtcolFINS)Sta;
            FillDGV(dGV1);

            FillGrid2();
        }
Example #6
0
        private void dGV1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            string   sSta = (string)dGV1.Rows[e.RowIndex].Cells[0].Value;
            CStation nSta = frmMain.staComm.GetStaByStaName(sSta);

            if (nSta == null)
            {
                return;
            }
            if (nSta.StaDevice.PortProtocol == "Modbus_TCP")
            {
                CProtcolModbusTCP nnn = (CProtcolModbusTCP)nSta;
                nnn.Show(true);
                nnn.bDebug = false;
            }
            if (nSta.StaDevice.PortProtocol == "FINS_TCP")
            {
                CProtcolFINS nnn = (CProtcolFINS)nSta;
                nnn.Show(true);
                nnn.bDebug = false;
            }
        }