Exemple #1
0
 public static VarGlobal Instance()
 {
     if (_instance == null)
     {
         _instance = new VarGlobal();
     }
     return(_instance);
 }
Exemple #2
0
 private void btnStop_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     if (!VarGlobal.Instance().Move_Z_Axis_Abs_Pos(VarGlobal.POSITION_INTERMEDIATE_Z_AXIS))
     {
         return;
     }
     FormMotion.fmMotionTest frm = new FormMotion.fmMotionTest();
     frm.Show();
 }
Exemple #3
0
 private void btnMoveOrigin_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     if (Calculate.CommandPosX < 0 || Calculate.CommandPosY < 0 || Calculate.CommandPosZ < 0)
     {
         VarGlobal.Instance().All_Move_Stop();
         return;
     }
     VarGlobal.Instance().Move_All_Axis_Origin();
 }
Exemple #4
0
        private void btnSettingPosition_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (!VarGlobal.Instance().Move_Z_Axis_Abs_Pos(Coordinates.Zcoordinate.Instance().z_coor[0]))
            {
                return;
            }
            VarGlobal.SELECT_FORM_SETTING = 1;
            fmSettingPointsPosition frm = new fmSettingPointsPosition();

            frm.Show();
        }
        private void SetPoint_Load(object sender, EventArgs e)
        {
            _arr = SQLite.Instance().GetPointsCoordinate("T24DefaultPointMeasurement",
                                                         VarGlobal.Point + 1, "Xcoor", "Ycoor", "Zcoor");
            x_pos_abs = Calculate.Calculate_Coordinate_pulse(float.Parse(_arr[0]), Calculate.STEP_X);
            y_pos_abs = Calculate.Calculate_Coordinate_pulse(float.Parse(_arr[1]), Calculate.STEP_Y);
            z_pos_abs = Calculate.Calculate_Coordinate_pulse(float.Parse(_arr[2]), Calculate.STEP_Z);

            VarGlobal.Instance().Move_All_Axis_Abs_Pos(x_pos_abs, y_pos_abs);

            _thread = new Thread(GetActualPosition);
            _thread.IsBackground = true;
            _thread.Start();
        }
Exemple #6
0
        private void btnDisconnect_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            EziMOTIONPlusRLib.FAS_Close(VarGlobal.PortNo);
            VarGlobal.adamCom.CloseComPort();
            VarGlobal.Reset();
            bsiX.Caption = "...";
            bsiY.Caption = "...";
            bsiZ.Caption = "...";

            bsiPosX.Caption        = "---";
            bsiPosY.Caption        = "---";
            bsiPosZ.Caption        = "---";
            bsiMeasurement.Caption = "---";
            bsiAdam.Caption        = "---";
        }
        private void btnSave_Click(object sender, EventArgs e)
        {
            this.Invoke(new Action(() =>
            {
                Coordinates.Xcoordinate.Instance().x_coor[VarGlobal.Point] = Calculate.CommandPosX;
                Coordinates.Ycoordinate.Instance().y_coor[VarGlobal.Point] = Calculate.CommandPosY;
                Coordinates.Zcoordinate.Instance().z_coor[VarGlobal.Point] = Calculate.CommandPosZ;

                VarGlobal.Instance().node_item_x.lPosition = Calculate.CommandPosX;
                int nRtn_1 = EziMOTIONPlusRLib.FAS_PosTableWriteItem(VarGlobal.PortNo, 1, VarGlobal.Point, VarGlobal.Instance().node_item_x);
                if (nRtn_1 != EziMOTIONPlusRLib.FMM_OK)
                {
                    string strmsg;
                    strmsg = "FAS_PosTableWriteItem() \nreturned: " + nRtn_1.ToString();
                    MessageBox.Show(strmsg, "function failed");
                }

                VarGlobal.Instance().node_item_y.lPosition = Calculate.CommandPosY;
                int ntRn_2 = EziMOTIONPlusRLib.FAS_PosTableWriteItem(VarGlobal.PortNo, 2, VarGlobal.Point, VarGlobal.Instance().node_item_y);
                if (ntRn_2 != EziMOTIONPlusRLib.FMM_OK)
                {
                    string strmsg;
                    strmsg = "FAS_PosTableWriteItem() \nreturned: " + ntRn_2.ToString();
                    MessageBox.Show(strmsg, "function failed");
                }
                VarGlobal.Instance().node_item_z.lPosition = Calculate.CommandPosZ;
                int ntRn_3 = EziMOTIONPlusRLib.FAS_PosTableWriteItem(VarGlobal.PortNo, 2, VarGlobal.Point, VarGlobal.Instance().node_item_z);
                if (ntRn_3 != EziMOTIONPlusRLib.FMM_OK)
                {
                    string strmsg;
                    strmsg = "FAS_PosTableWriteItem() \nreturned: " + ntRn_3.ToString();
                    MessageBox.Show(strmsg, "function failed");
                }
                if (!SQLite.Instance().CheckExistData("T24DefaultPointMeasurement", VarGlobal.Point + 1))
                {
                    SQLite.Instance().InsertDefaultPointsCoordinate("T24DefaultPointMeasurement", VarGlobal.Point + 1,
                                                                    "Point " + (VarGlobal.Point + 1), lblCoorX.Text, lblCoorY.Text, lblCoorZ.Text);
                }
                else
                {
                    SQLite.Instance().UpdateDefaultPointsCoordinate("T24DefaultPointMeasurement", VarGlobal.Point + 1,
                                                                    lblCoorX.Text, lblCoorY.Text, lblCoorZ.Text);
                }
                this.Close();
            }));
        }
Exemple #8
0
 private void btnStop_ItemClick_1(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     VarGlobal.Instance().All_Move_Stop();
 }