public void fastLayerUpdate() { GCodeAnalyzer a = new GCodeAnalyzer(true); foreach (GCodeShort code in getContentArray(1)) { a.analyzeShort(code); } foreach (GCodeShort code in getContentArray(0)) { a.analyzeShort(code); } foreach (GCodeShort code in getContentArray(2)) { a.analyzeShort(code); } MaxLayer = a.layer; SettingsProvider.Instance.CommonSettings.MaxLayer = MaxLayer; SettingsProvider.Instance.CommonSettings.MinLayer = 1; SettingsProvider.Instance.CommonSettings.HigherLayer = MaxLayer; SettingsProvider.Instance.CommonSettings.LowerLayer = 1; SettingsProvider.Instance.PrintingStatistic.LayersCount = a.layer; SettingsProvider.Instance.PrintingStatistic.LineCodeCount = lines.Count; SettingsProvider.Instance.PrintingStatistic.FilamentLength = (int)a.filamentLength; if (a.printingTime > 0) { SettingsProvider.Instance.PrintingStatistic.PrintingTime = a.printingTime; } }
public override void PauseJob(string text) { if (paused) { return; } paused = true; GCodeAnalyzer a = con.analyzer; pauseX = a.x - a.xOffset; pauseY = a.y - a.yOffset; pauseZ = a.z - a.zOffset; pauseE = a.activeExtruder.e - a.activeExtruder.eOffset; pauseF = a.f; pauseRelative = a.relative; PauseInfo.ShowPause(text); foreach (GCodeShort code in Main.main.editor.getContentArray(4)) { InjectManualCommand(code.text); } Main.main.Invoke(Main.main.UpdateJobButtons); if (eventPauseChanged != null) { eventPauseChanged(true); } }
public PrintPanel() { InitializeComponent(); con = Main.conn; ann = con.analyzer; con.eventConnectionChange += ConnectionChanged; ann.fanVoltage = trackFanVoltage.Value; // ann.eventPosChanged += coordUpdate; ann.eventChange += analyzerChange; UpdateConStatus(false); float volt = 100f * trackFanVoltage.Value / 255; labelVoltage.Text = Trans.T1("L_OUTPUT_PERCENT", volt.ToString("0.0")); //"Output " + volt.ToString("0.0") + "%"; labelLaserVoltage.Text = Trans.T1("L_OUTPUT_PERCENT", volt.ToString("0.0")); //"Output " + volt.ToString("0.0") + "%"; arrowButtonXMinus.PossibleValues = Custom.GetString("xyMoveDistances", arrowButtonXMinus.PossibleValues); arrowButtonXPlus.PossibleValues = Custom.GetString("xyMoveDistances", arrowButtonXPlus.PossibleValues); arrowButtonYMinus.PossibleValues = Custom.GetString("xyMoveDistances", arrowButtonYMinus.PossibleValues); arrowButtonYPlus.PossibleValues = Custom.GetString("xyMoveDistances", arrowButtonYPlus.PossibleValues); if (Custom.GetBool("noPowerControlButton", false)) { switchPower.Visible = false; } timer.Start(); if (Main.main != null) { translate(); Main.main.languageChanged += translate; } }
public PrintPanel() { InitializeComponent(); con = Main.conn; ann = con.analyzer; con.eventConnectionChange += ConnectionChanged; con.eventTempChange += tempUpdate; ann.eventPosChanged += coordUpdate; ann.eventChange += analyzerChange; UpdateConStatus(false); float volt = 100f * trackFanVoltage.Value / 255; labelVoltage.Text = "Output " + volt.ToString("0.0") + "%"; }
public override void ContinueJob() { GCodeAnalyzer a = con.analyzer; InjectManualCommand("G90"); InjectManualCommand("G1 X" + pauseX.ToString(GCode.format) + " Y" + pauseY.ToString(GCode.format) + " F" + con.travelFeedRate.ToString(GCode.format)); InjectManualCommand("G1 Z" + pauseZ.ToString(GCode.format) + " F" + con.maxZFeedRate.ToString(GCode.format)); InjectManualCommand("G92 E" + pauseE.ToString(GCode.format)); if (a.relative != pauseRelative) { InjectManualCommand(pauseRelative ? "G91" : "G90"); } InjectManualCommand("G1 F" + pauseF.ToString(GCode.format)); // Reset old speed paused = false; Main.main.Invoke(Main.main.UpdateJobButtons); }
public void BeginJob() { con.firePrinterAction("L_BUILDING_PRINT_JOB..."); //"Building print job..."); dataComplete = false; jobList.Clear(); //times.Clear(); totalLines = 0; linesSend = 0; computedPrintingTime = 0; con.lastlogprogress = -1000; maxLayer = -1; mode = 1; ana = new GCodeAnalyzer(true); con.analyzer.StartJob(); con.Main.main.UpdateJobButtons.Invoke(); }
private void buttonContinuePrinting_Click(object sender, EventArgs e) { GCodeAnalyzer a = Main.conn.analyzer; PrinterConnection c = Main.conn; c.injectManualCommand("G90"); c.injectManualCommand("G1 X" + x.ToString(GCode.format) + " Y" + y.ToString(GCode.format) + " F" + c.travelFeedRate.ToString(GCode.format)); c.injectManualCommand("G1 Z" + z.ToString(GCode.format) + " F" + c.maxZFeedRate.ToString(GCode.format)); c.injectManualCommand("G92 E" + PauseInfo.e.ToString(GCode.format)); if (a.relative != relative) { c.injectManualCommand(relative ? "G91" : "G90"); } c.injectManualCommand("G1 F" + f.ToString(GCode.format)); // Reset old speed Main.conn.paused = false; Hide(); }
public static void ShowPause(string info) { if (form == null) { form = new PauseInfo(); } form.labelInfo.Text = info; GCodeAnalyzer a = Main.conn.analyzer; x = a.x - a.xOffset; y = a.y - a.yOffset; z = a.z - a.zOffset; e = a.e - a.eOffset; f = a.f; relative = a.relative; if (form.Visible == false) { form.Show(); } }
public ManualPrinterControl() { InitializeComponent(); con = Main.connection; ann = con.analyzer; con.eventConnectionChange += ConnectionChanged; ann.fanVoltage = trackFanVoltage.Value; con.eventTempChange += tempUpdate; // ann.eventPosChanged += coordUpdate; ann.eventChange += analyzerChange; UpdateConStatus(false); textExtrudeSpeed.Text = RegMemory.GetString("panelExtrudeSpeed", textExtrudeSpeed.Text); textExtrudeAmount.Text = RegMemory.GetString("panelExtrudeAmount", textExtrudeAmount.Text); textRetractAmount.Text = RegMemory.GetString("panelRetractAmount", textRetractAmount.Text); float volt = 100f * trackFanVoltage.Value / 255; labelVoltage.Text = Trans.T1("L_OUTPUT_PERCENT", volt.ToString("0.0")); //"Output " + volt.ToString("0.0") + "%"; arrowButtonXMinus.PossibleValues = Custom.GetString("xyMoveDistances", arrowButtonXMinus.PossibleValues); arrowButtonXPlus.PossibleValues = Custom.GetString("xyMoveDistances", arrowButtonXPlus.PossibleValues); arrowButtonYMinus.PossibleValues = Custom.GetString("xyMoveDistances", arrowButtonYMinus.PossibleValues); arrowButtonYPlus.PossibleValues = Custom.GetString("xyMoveDistances", arrowButtonYPlus.PossibleValues); if (Custom.GetBool("noPowerControlButton", false)) { switchPower.Visible = false; } timer.Start(); comboExtruder.SelectedIndex = 0; if (Main.main != null) { translate(); Main.main.languageChanged += translate; } // Set the width and height. These change if in developer mode. this.Size = normalControlSize; }