private void cmsPicBoxClearBackground_Click(object sender, EventArgs e) { VisuGCode.setPathAsLandMark(true); }
// if startline > 0 start with pause private void startStreaming(int startLine = 0) { Logger.Trace("startStreaming serialPortOpen:{0} ", _serial_form.serialPortOpen); isStreamingRequestStop = false; lblInfoOkString = Localization.getString("mainInfoSendCode"); notifierUpdateMarker = false; notifierUpdateMarkerFinish = false; if (fCTBCode.LinesCount > 1) { if (!isStreaming) { clearErrorLines(); Logger.Info("Start streaming at line:{0} showProgress:{1} backgroundImage:{2}", startLine, Properties.Settings.Default.guiProgressShow, Properties.Settings.Default.guiBackgroundImageEnable); expandCodeBlocksToolStripMenuItem_Click(null, null); VisuGCode.ProcessedPath.processedPathClear(); MainTimer.Stop(); MainTimer.Start(); isStreaming = true; isStreamingPause = false; isStreamingCheck = false; isStreamingOk = true; VisuGCode.markSelectedFigure(0); if (startLine > 0) { btnStreamStart.Image = Properties.Resources.btn_pause; // isStreamingPause = true; } if (!grbl.isVersion_0) { gBoxOverride.Height = 175; gBoxOverrideBig = true; } timerUpdateControlSource = "startStreaming"; updateControls(); timeInit = DateTime.UtcNow; elapsed = TimeSpan.Zero; setInfoLabel(Localization.getString("mainInfoSendCode"), Color.Lime); for (int i = 0; i < fCTBCode.LinesCount; i++) { fCTBCode.UnbookmarkLine(i); } //save gcode string fileName = Application.StartupPath + "\\" + fileLastProcessed; string txt = fCTBCode.Text; File.WriteAllText(fileName + ".nc", txt); File.Delete(fileName + ".xml"); SaveRecentFile(fileLastProcessed + ".nc"); lblElapsed.Text = "Time " + elapsed.ToString(@"hh\:mm\:ss"); _serial_form.startStreaming(fCTBCode.Lines, startLine); btnStreamStart.Image = Properties.Resources.btn_pause; btnStreamCheck.Enabled = false; onPaint_setBackground(); // Generante a background-image for pictureBox to avoid frequent drawing of pen-up/down paths VisuGCode.setPathAsLandMark(); ControlPowerSaving.SuppressStandby(); } else { if (!isStreamingPause) { Logger.Info("Pause streaming - pause stream"); btnStreamStart.Image = Properties.Resources.btn_play; _serial_form.pauseStreaming(); // isStreamingPause = true; statusStripSet(0, Localization.getString("statusStripeStreamingStatusSaved"), Color.LightGreen); } else { Logger.Info("Pause streaming - continue stream ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄"); btnStreamStart.Image = Properties.Resources.btn_pause; _serial_form.pauseStreaming(); isStreamingPause = false; statusStripClear(0); } } } }
private void cmsPicBoxSetGCodeAsBackground_Click(object sender, EventArgs e) { VisuGCode.setPathAsLandMark(); Properties.Settings.Default.guiBackgroundShow = toolStripViewBackground.Checked = true; }