Ejemplo n.º 1
0
 protected virtual void HomeSequence(GCodeBuilder builder)
 {
     if (Machine.HasAutoBedLeveling && Machine.EnableAutoBedLeveling)
     {
         builder.BeginGLine(28).AppendL("W").AppendComment("home all without bed level");
         builder.BeginGLine(80, "auto-level bed");
     }
     else
     {
         // standard home sequenece
         builder.BeginGLine(28, "home x/y").AppendI("X", 0).AppendI("Y", 0);
         builder.BeginGLine(28, "home z").AppendI("Z", 0);
     }
 }
Ejemplo n.º 2
0
        public void BeginGLineAndAppend()
        {
            MockGCodeAccumulator mockGCA = new MockGCodeAccumulator();
            GCodeBuilder         gcb     = new GCodeBuilder(mockGCA);

            gcb.BeginGLine(1, "comment");
            Assert.IsTrue(mockGCA.Lines.Count == 0);

            gcb.AppendComment("addingComment");
            gcb.AppendI("intTest", 3);
            gcb.AppendF("floatTest", 2.3);
            gcb.AppendS("stringTest", "stringTest");
            gcb.AppendL("labelTest");

            gcb.EndLine();
            Assert.IsTrue(mockGCA.Lines.Count == 1);
            Assert.AreEqual("addingComment", mockGCA.Lines[0].Comment);
            Assert.AreEqual(LineType.GCode, mockGCA.Lines[0].Type);
            Assert.AreEqual(0, mockGCA.Lines[0].LineNumber);

            var par = mockGCA.Lines[0].Parameters;

            Assert.AreEqual(4, par.Length);
            Assert.AreEqual(GCodeParamTypes.IntegerValue, par[0].Type);
            Assert.AreEqual(3, par[0].IntegerValue);
            Assert.AreEqual("intTest", par[0].Identifier);
            Assert.AreEqual(GCodeParamTypes.DoubleValue, par[1].Type);
            Assert.AreEqual(2.3, par[1].DoubleValue);
            Assert.AreEqual("floatTest", par[1].Identifier);
            Assert.AreEqual(GCodeParamTypes.TextValue, par[2].Type);
            Assert.AreEqual("stringTest", par[2].TextValue);
            Assert.AreEqual("stringTest", par[2].Identifier);
            Assert.AreEqual(GCodeParamTypes.NoValue, par[3].Type);
            Assert.AreEqual("labelTest", par[3].Identifier);
        }
Ejemplo n.º 3
0
 protected void HeaderCustomF(RepRapAssembler.HeaderState state, GCodeBuilder Builder)
 {
     if (state == RepRapAssembler.HeaderState.BeforePrime)
     {
         if (EnableAutoBedLevel)
         {
             Builder.BeginGLine(29, "auto-level bed");
         }
     }
 }
Ejemplo n.º 4
0
        public void BeginAndEndGLine()
        {
            MockGCodeAccumulator mockGCA = new MockGCodeAccumulator();
            GCodeBuilder         gcb     = new GCodeBuilder(mockGCA);

            gcb.BeginGLine(1, "comment");
            Assert.IsTrue(mockGCA.Lines.Count == 0);

            gcb.EndLine();
            Assert.IsTrue(mockGCA.Lines.Count == 1);
            Assert.AreEqual("comment", mockGCA.Lines[0].Comment);
            Assert.AreEqual(LineType.GCode, mockGCA.Lines[0].Type);
            Assert.AreEqual(0, mockGCA.Lines[0].LineNumber);
        }