コード例 #1
0
        private void NewHeightMapDialog_Size_Ok()
        {
            if (machine.Mode == Machine.OperatingMode.Probe || Map != null)
            {
                return;
            }

            if (NewHeightMapDialog.Min.X == NewHeightMapDialog.Max.X || NewHeightMapDialog.Min.Y == NewHeightMapDialog.Max.Y)
            {
                return;
            }

            try
            {
                Map = new HeightMap(NewHeightMapDialog.GridSize, NewHeightMapDialog.Min, NewHeightMapDialog.Max);

                if (NewHeightMapDialog.GenerateTestPattern)
                {
                    try
                    {
                        Map.FillWithTestPattern(NewHeightMapDialog.TestPattern);
                        Map.NotProbed.Clear();
                    }
                    catch { MessageBox.Show("Error in test pattern"); }
                }

                Map.MapUpdated += Map_MapUpdated;
                UpdateProbeTabButtons();
                Map_MapUpdated();
            }
            catch (Exception ex)
            {
                Machine_Info(ex.Message);
            }
        }