예제 #1
0
        private void BT_Cut_Click(object sender, EventArgs e)
        {
            if (GV_Cut.GetFocusedDataSourceRowIndex() < 0 || GV_Cut.RowCount < 1)
            {
                MessageBox.Show("没有路径");
                return;
            }
            //   Edit_Cut frm = new Edit_Cut(TrajName, GV_Cut.GetSelectedRows()[0] + 1);
            Batch_TrajPos frm = new Batch_TrajPos(TrajName);

            frm.ShowDialog();
            ViewPoint(GC_Cut, GV_Cut, db.GetDV_Trajpos(TrajName));
        }
예제 #2
0
        private void timer_Refresh_Tick(object sender, EventArgs e)
        {
            try
            {
                if (TxtData.SoapData.BIOValue != null && TxtData.SoapData.BIOValue.Length == 32)
                {
                    LL_MainPower.Text  = TxtData.SoapData.BIOValue[22] ? "主轴[上]电" : "主轴[下]电";
                    LL_MainEnable.Text = TxtData.SoapData.BIOValue[23] ? "主轴[启动]" : "主轴[停止]";
                    LL_ATI.Text        = TxtData.SoapData.bZero ? "置零ATI数据[开]" : "置零ATI数据[关]";

                    LL_TEnable.Text = TxtData.SoapData.BIOValue[25] ? "转台[启动]" : "转台[停止]";


                    LL_MainPower.ForeColor = TxtData.SoapData.BIOValue[22]
                        ? System.Drawing.Color.Red
                        : System.Drawing.Color.Black;
                    LL_MainEnable.ForeColor = TxtData.SoapData.BIOValue[23]
                        ? System.Drawing.Color.Red
                        : System.Drawing.Color.Black;
                    LL_TEnable.ForeColor = TxtData.SoapData.BIOValue[25]
                        ? System.Drawing.Color.Red
                        : System.Drawing.Color.Black;

                    LL_ATI.ForeColor = TxtData.SoapData.bZero ? System.Drawing.Color.Red : System.Drawing.Color.Black;
                    int T = 0;
                    for (int i = 0; i < 6; i++)
                    {
                        T = T + (int)((TxtData.SoapData.BIOValue[16 + i] ? 1 : 0) * Math.Pow(2, i));
                    }

                    // Speed = T;
                    LL_Table.Text = "转台速度:" + T.ToString();
                }
                else
                {
                    LL_TEnable.Text    = "转台启动状态未知";
                    LL_Table.Text      = "转台速度状态未知";
                    LL_MainPower.Text  = "主轴上电状态未知";
                    LL_MainEnable.Text = "主轴启动状态未知";
                    LL_ATI.Text        = "置零ATI数据状态未知";
                }
                if (TxtData.SoapData.SoapStaus && TxtData.SoapData.productStatus != null &&
                    TxtData.SoapData.productStatus.Length == 10)
                {
                    ll0.Text = TxtData.SoapData.productStatus[0];
                    ll1.Text = TxtData.SoapData.productStatus[1];
                    ll2.Text = TxtData.SoapData.productStatus[2];
                    ll3.Text = TxtData.SoapData.productStatus[3];
                    ll4.Text = TxtData.SoapData.productStatus[4];
                    ll5.Text = TxtData.SoapData.productStatus[5];
                    ll6.Text = TxtData.SoapData.productStatus[6];
                    ll7.Text = TxtData.SoapData.productStatus[7];
                    ll8.Text = TxtData.SoapData.productStatus[8];
                    ll9.Text = TxtData.SoapData.productStatus[9];
                }
                else
                {
                    ll0.Text             =
                        ll1.Text         =
                            ll2.Text     =
                                ll3.Text = ll4.Text = ll5.Text = ll6.Text = ll7.Text = ll8.Text = ll9.Text = "状态未知";
                }



                GC_Infor.Text = "生产信息:" + RecipeName + ":" + TxtData.SoapData.Moveid.ToString(); if (TxtData.SoapData.InterfaceType == 13 && TxtData.SoapData.productStatus[2].IndexOf("生产中") >= 0)
                {
                    if (!ChartFill)
                    {
                        ChartFill = true;
                        string[] buff = TxtData.SoapData.productStatus[1].Split(new char[] { '.' });
                        if (buff != null && buff[0] != null)
                        {
                            RecipeName = buff[0].Trim();

                            Char();
                            TrajInfor();
                        }


                        if (TrajName != null && TrajName != "")
                        {
                            ViewPoint(GC_Cut, GV_Cut, db.GetDV_Trajpos(TrajName));
                        }
                    }


                    if (TxtData.SoapData.Moveid > 2 && TxtData.SoapData.Moveid < GV_Cut.RowCount)
                    {
                        int rowindex = (int)(TxtData.SoapData.Moveid - 1);
                        //GV_Cut.SelectRow(rowindex);
                        if (rowindex > GV_Cut.GetSelectedRows()[0])
                        {
                            GV_Cut.MoveBy(rowindex - GV_Cut.GetSelectedRows()[0]);
                        }
                        //  GV_Cut.se
                        //  GV_Cut.SelectRow();
                        // GV_Cut.SetFocusedRowModified();
                    }
                }
            }
            catch (Exception)
            {
                //  throw;
            }
        }