Esempio n. 1
0
        private void btnReadfromROM_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (VarGlobal.m_Connected)
            {
                for (ushort point = 1; point <= 24; point++)
                {
                    //int nRtn_1 = EziMOTIONPlusRLib.FAS_PosTableReadItem(VarGlobal.PortNo, 1, i, ref VarGlobal.Instance().node_item_x);
                    //int nRtn_2 = EziMOTIONPlusRLib.FAS_PosTableReadItem(VarGlobal.PortNo, 2, i, ref VarGlobal.Instance().node_item_y);

                    //if (nRtn_1 != EziMOTIONPlusRLib.FMM_OK || nRtn_2 != EziMOTIONPlusRLib.FMM_OK)
                    //{
                    //    string strMsg;
                    //    strMsg = "FAS_PosTableReadItem() \nReturned: " + nRtn_1.ToString() + "And" + nRtn_2.ToString();
                    //    MessageBox.Show(strMsg, "Function Failed");
                    //}
                    //Coordinates.Xcoordinate.Instance().x_coor[i] = VarGlobal.Instance().node_item_x.lPosition;
                    //Coordinates.Ycoordinate.Instance().y_coor[i] = VarGlobal.Instance().node_item_y.lPosition;

                    _arr = SQLite.Instance().GetPointsCoordinate("T24DefaultPointMeasurement",
                                                                 point, "Xcoor", "Ycoor", "Zcoor");
                    Coordinates.Xcoordinate.Instance().x_coor[point - 1] = Calculate.Calculate_Coordinate_pulse(
                        float.Parse(_arr[0]), Calculate.STEP_X);
                    Coordinates.Ycoordinate.Instance().y_coor[point - 1] = Calculate.Calculate_Coordinate_pulse(
                        float.Parse(_arr[1]), Calculate.STEP_Y);
                    Coordinates.Zcoordinate.Instance().z_coor[point - 1] = Calculate.Calculate_Coordinate_pulse(
                        float.Parse(_arr[2]), Calculate.STEP_Z);

                    arr_txt_x[point - 1].Text = _arr[0];
                    arr_txt_y[point - 1].Text = _arr[1];
                }
            }
            else
            {
                MessageBox.Show("Not connect");
            }
        }