Пример #1
0
        private void comboBoxMeasurePoints_TextChanged(object sender, EventArgs e)
        {
            controller.CommandController("DA posA[0]");
            controller.CommandController("DA posB[0]");
            controller.CommandController("size = " + comboBoxMeasurePoints.Text);
            controller.CommandController("DM posA[size]");
            controller.CommandController("DM posB[size]");

            //Add checks for anything possible or simply ignore certain keys
            if (comboBoxMeasurePoints.Text == "")
            {
            }
            else if (Convert.ToInt16(comboBoxMeasurePoints.Text) <= 1)
            {
                //This check does not allow any X points less than 1
                if (Convert.ToInt16(comboBoxMeasurePoints.Text) < 1)
                {
                    comboBoxMeasurePoints.Text = "1";
                }


                textBoxLengthBetweenPointsX.Text    = "0";       //This will change the offset variable in the controller to 0 since there is only 1 point
                textBoxLengthBetweenPointsX.Enabled = false;     //Disable length between points because there is only 1 point in this case
            }
            else if (Convert.ToInt16(comboBoxMeasurePoints.Text) > 1)
            {
                //If more than one X point dont allow a 0 inches between points
                //you cannot have 0 inches between 2 points
                if (textBoxLengthBetweenPointsX.Text == "0")
                {
                    textBoxLengthBetweenPointsX.Text = "1"; //Set to minimum of 1 if 0
                }
            }



            else
            {
                textBoxLengthBetweenPointsX.Enabled = true;
            }
        }
Пример #2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            bool connected = false;

            GalilWidgets.GalilWidget wi; //for casting to Widget Interface
            wi = (GalilWidgets.GalilWidget)gwTerm1; gwComs1.GWRegisterWidget(ref wi);
            wi = (GalilWidgets.GalilWidget)gwDatRec1; gwComs1.GWRegisterWidget(ref wi);
            wi = (GalilWidgets.GalilWidget)gwDatRec2; gwComs1.GWRegisterWidget(ref wi);
            wi = (GalilWidgets.GalilWidget)gwPoll1; gwComs1.GWRegisterWidget(ref wi);
            wi = (GalilWidgets.GalilWidget)gwSettings1; gwComs1.GWRegisterWidget(ref wi);
            string gi      = GalilWidgets.LibraryPath.GclibDllPath_; gi = "C:\\Program Files (x86)\\Galil\\gclib\\dll\\x64\\gclib.dll";
            string xmlPath = "C:\\Users\\cbracamontes\\Downloads\\galilwidgets_15\\xml\\4000\\";

            gwPoll1.GWLoadFile(xmlPath + "GWPoll_Revised.xml");
            gwDatRec2.GWLoadFile(xmlPath + "GWDatRec_IO.xml"); //assuming #2 is upper right
            gwDatRec1.GWLoadFile(xmlPath + "GWDatRec_Axis_A_Revised.xml");
            gwSettings1.GWLoadFile(xmlPath + "GWSettings_Revised.xml");
            connected  = gwComs1.GWOpen("172.18.114.194"); //put the correct connection address here
            controller = new MotionController(gwComs1);
            profilometer.GetSerialPorts(cboBaudRate, cboPorts, cboDataBits, cboStopBits,
                                        cboParity, cboHandShaking, portsButtonClicked);
            cboBaudRate.Hide();
            cboDataBits.Hide();
            cboHandShaking.Hide();
            cboParity.Hide();
            cboPorts.Hide();
            cboStopBits.Hide();
            btnPorts.Hide();
            btnPortState.Hide();
            btnHello.Hide();
            controller.CommandController("DA size");
            controller.CommandController("DA *[]");
            controller.CommandController("DA offset");
            controller.CommandController("DA rotation");
            controller.CommandController("DA rStep");
        }
Пример #3
0
 private void comboBoxMeasurePoints_SelectedIndexChanged(object sender, EventArgs e)
 {
     controller.CommandController("DA *[]"); //Will deallocate motion controller arrays to allow for a new set
 }