Пример #1
0
        private void TapeEditForm_Load(object sender, EventArgs e)
        {
            Row = TapesDataGrid.Rows[TapeRowNo];
            if (Row.Cells["Id_Column"].Value != null)
            {
                ID_textBox.Text = Row.Cells["Id_Column"].Value.ToString();
            }
            if (Row.Cells["Orientation_Column"].Value != null)
            {
                TapeOrientation_comboBox.SelectedItem = Row.Cells["Orientation_Column"].Value;
            }
            if (Row.Cells["Rotation_Column"].Value != null)
            {
                TapeRotation_comboBox.SelectedItem = Row.Cells["Rotation_Column"].Value;
            }
            if (MainForm.Setting.Nozzles_Enabled)
            {
                Nozzle_numericUpDown.Maximum = MainForm.Setting.Nozzles_count;
                if (Row.Cells["Nozzle_Column"].Value != null)
                {
                    int nozzle;
                    if (int.TryParse(Row.Cells["Nozzle_Column"].Value.ToString(), out nozzle))
                    {
                        Nozzle_numericUpDown.Value = nozzle;
                    }
                    else
                    {
                        Nozzle_numericUpDown.Value = MainForm.Setting.Nozzles_default;
                    }
                }
                else
                {
                    Nozzle_numericUpDown.Value = MainForm.Setting.Nozzles_default;
                }
            }
            else
            {
                Nozzle_numericUpDown.Enabled = false;
            }

            if (Row.Cells["Width_Column"].Value != null)
            {
                TapeWidth_comboBox.Text = Row.Cells["Width_Column"].Value.ToString();
            }

            if (Row.Cells["Pitch_Column"].Value != null)
            {
                TapePitch_textBox.Text = Row.Cells["Pitch_Column"].Value.ToString();
                ValidateDouble(TapePitch_textBox);
            }

            if (Row.Cells["OffsetX_Column"].Value != null)
            {
                TapeOffsetX_textBox.Text = Row.Cells["OffsetX_Column"].Value.ToString();
                ValidateDouble(TapePitch_textBox);
            }

            if (Row.Cells["OffsetY_Column"].Value != null)
            {
                TapeOffsetY_textBox.Text = Row.Cells["OffsetY_Column"].Value.ToString();
                ValidateDouble(TapeOffsetY_textBox);
            }

            if (Row.Cells["Capacity_Column"].Value != null)
            {
                Capacity_textBox.Text = Row.Cells["Capacity_Column"].Value.ToString();
            }

            if (Row.Cells["Type_Column"].Value != null)
            {
                Type_comboBox.Text = Row.Cells["Type_Column"].Value.ToString();
            }

            if (Row.Cells["NextPart_Column"].Value != null)
            {
                NextPart_textBox.Text = Row.Cells["NextPart_Column"].Value.ToString();
            }

            if (Row.Cells["FirstX_Column"].Value != null)
            {
                FirstX_textBox.Text = Row.Cells["FirstX_Column"].Value.ToString();
            }
            if (Row.Cells["FirstY_Column"].Value != null)
            {
                FirstY_textBox.Text = Row.Cells["FirstY_Column"].Value.ToString();
            }

            if (Row.Cells["LastX_Column"].Value != null)
            {
                LastX_textBox.Text = Row.Cells["LastX_Column"].Value.ToString();
            }
            if (Row.Cells["LastY_Column"].Value != null)
            {
                LastY_textBox.Text = Row.Cells["LastY_Column"].Value.ToString();
            }
            if (Row.Cells["RotationDirect_Column"].Value != null)
            {
                RotationDirect_textBox.Text = Row.Cells["RotationDirect_Column"].Value.ToString();
            }

            if (Row.Cells["Z_Pickup_Column"].Value != null)
            {
                PickupZ_textBox.Text = Row.Cells["Z_Pickup_Column"].Value.ToString();
            }
            if (Row.Cells["Z_Place_Column"].Value != null)
            {
                PlacementZ_textBox.Text = Row.Cells["Z_Place_Column"].Value.ToString();
            }
            if (Row.Cells["TrayID_Column"].Value != null)
            {
                TrayID_textBox.Text = Row.Cells["TrayID_Column"].Value.ToString();
            }
            MainForm.DownCameraRotationFollowsA = true;
            DrawCross     = Cam.DrawCross;
            Cam.DrawCross = false;
            if (Row.Cells["CoordinatesForParts_Column"].Value != null)
            {
                if (Row.Cells["CoordinatesForParts_Column"].Value.ToString() == "True")
                {
                    CoordinatesForParts_checkBox.Checked = true;
                    double val;
                    if (double.TryParse(RotationDirect_textBox.Text.Replace(',', '.'), out val))
                    {
                        MainForm.CNC_A_m(val);
                    }
                    EnableLastItems();
                }
                else
                {
                    CoordinatesForParts_checkBox.Checked = false;
                    EnableLastItems();
                }
            }
            else
            {
                CoordinatesForParts_checkBox.Checked = false;
                EnableLastItems();
            }
        }
Пример #2
0
        // =================================================================================
        // CNC interface functions
        // =================================================================================

        private bool CNC_A_m(double A)
        {
            return(MainForm.CNC_A_m(A));
        }