/******************************************************************** * Height map * _heightmap_form ********************************************************************/ private void heightMapToolStripMenuItem_Click(object sender, EventArgs e) { if (_heightmap_form == null) { _heightmap_form = new ControlHeightMapForm(); _heightmap_form.FormClosed += formClosed_HeightmapForm; _heightmap_form.btnStartHeightScan.Click += getGCodeScanHeightMap; // in MainFormGetCodeTransform _heightmap_form.loadHeightMapToolStripMenuItem.Click += loadHeightMap; // in MainFormGetCodeTransform _heightmap_form.btnApply.Click += applyHeightMap; // in MainFormGetCodeTransform _heightmap_form.RaiseXYZEvent += OnRaisePositionClickEvent; // in MainForm _heightmap_form.btnGCode.Click += getGCodeFromHeightMap; // in MainFormGetCodeTransform } else { _heightmap_form.Visible = false; } _heightmap_form.Show(this); _heightmap_form.WindowState = FormWindowState.Normal; }
private void formClosed_HeightmapForm(object sender, FormClosedEventArgs e) { _heightmap_form = null; VisuGCode.clearHeightMap(); _serial_form.stopStreaming(); }