コード例 #1
0
        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;
            }
        }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
        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;
            }
        }
コード例 #4
0
ファイル: PrintPanel.cs プロジェクト: yikuaiyu/Repetier-Host
        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") + "%";
        }
コード例 #5
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);
        }
コード例 #6
0
 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();
 }
コード例 #7
0
        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();
        }
コード例 #8
0
        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();
            }
        }
コード例 #9
0
        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;
        }