private void loadHeightMap(object sender, EventArgs e) { if (_heightmap_form.mapIsLoaded) { VisuGCode.drawHeightMap(_heightmap_form.Map); VisuGCode.createMarkerPath(); VisuGCode.calcDrawingArea(); pictureBox1.BackgroundImage = null; pictureBox1.Invalidate(); isHeightMapApplied = false; _heightmap_form.mapIsLoaded = false; } }
// handle event from create Height Map form private void getGCodeScanHeightMap(object sender, EventArgs e) { if (!isStreaming && _serial_form.serialPortOpen) { if (_heightmap_form.scanStarted) { string[] commands = _heightmap_form.getCode.ToString().Split('\r'); _serial_form.isHeightProbing = true; foreach (string cmd in commands) // fill up send queue { if (machineStatus == grblState.alarm) { break; } sendCommand(cmd); } VisuGCode.drawHeightMap(_heightmap_form.Map); VisuGCode.createMarkerPath(); VisuGCode.calcDrawingArea(); pictureBox1.BackgroundImage = null; pictureBox1.Invalidate(); if (_diyControlPad != null) { _diyControlPad.isHeightProbing = true; } Properties.Settings.Default.counterUseHeightMap += 1; } else { _serial_form.stopStreaming(); if (_diyControlPad != null) { _diyControlPad.isHeightProbing = false; } } isHeightMapApplied = false; } }